// POP UP WINDOW CODE ---------------------------------------------------------
var win = null;
function popper(theURL,winName,features) {
  if (win!=null && !win.closed) win.close();
  win = window.open(theURL,winName,features);
  win.focus();
}

// FORM HANDLER CODE ----------------------------------------------------------
var win = null;

function formHandle(formname, listname) {
  var l = document.forms[formname][listname];
  var i = l.selectedIndex;
  var url = l.options[i].value;
  var firstChar = url.charAt(0);
  var secondChar = url.charAt(1);
  
  var windowprops = new Array;
  windowprops[0] = "width=400,height=300,scrollbars=yes,resizable=yes";
  windowprops[1] = "width=320,height=180,screenX=30,screenY=30";
 // add new window properties here and call them by using '$' followed by the next array number and place in front of url 
 // windowprops[1] = " ";
 // windowprops[2] = " ";
  
  // do nothing if no url is selected
  if (url=='none') l.selectedIndex = 0;
  
  // open the link in a new browser window
  else if (firstChar=='+') open(url.substring(1), '_blank');
  
  // open as popup with attributes defined in the array windowprops[]
  else if (firstChar=='$') window.open(url.substring(2),"MenuPopup",windowprops[secondChar]);
  
  // just go to the URL
  else location.href = url;
}
