function launch(target, source) {
  popupwin = window.open(target, source, "width=400,height=400,menubar=yes,scrollbars=yes,resizable=yes");
  popupwin.focus();
  return false;
}

function popmenu(target) {
  menuwin = window.open(target, "popupmenu", "width=300,height=200,menubar=yes,scrollbars=no");
  menuwin.focus();
  return false;
}



// Define popup menus here

about = new popupMenu("about");
services = new popupMenu("services");
sgroups = new popupMenu("sgroups");
policies = new popupMenu("policies");
dlinks = new popupMenu("dlinks");


var selectboxes = null;
var selectboxTimerID = null;
var selectboxTimerRunning = false;

setBrowser();  // Initiate DHTML set
  
// Get select boxes and embedded OBJECTs so we can hide them while showing pop-up menus
// ... since they sometimes overlap pop-ups
if (document.getElementById) {
  selectboxes = document.getElementsByTagName("select");
  embedObjects = document.getElementsByTagName("object");
}


// Pop-up menu display

function popupMenu(nameToUse) {
  this.boxName = nameToUse;
  this.timerID = null;
  this.timerRunning = false;
  this.show = showPop;
  this.hide = hidePop;
  return this;
}

// Function to show pop up boxes
function showPop(speed) {
  if (isNav4) return;
  if (this.timerRunning) {
    clearTimeout(this.timerID);
    timerRunning = false;
  }
  
  // Clear timer to re-show select boxes and then hide them
  if (selectboxTimerRunning) {
    clearTimeout(selectboxTimerID);
    selectboxTimerRunning = false;
  }

  hideSelectBoxes();
  
  if (speed == "immediately") {
    setIdProperty(this.boxName, 'visibility', 'visible');
  }
  else {
    this.timerID = window.setTimeout("setIdProperty('" + this.boxName + "', 'visibility', 'visible')", 50);
    this.timerRunning = true;
  }  
  return true;
}


// Function to hide pop up boxes
function hidePop(speed) {
  if (isNav4) return;
  
  if (this.timerRunning) {
    clearTimeout(this.timerID);
  }
  
  if (selectboxTimerRunning) {
    clearTimeout(selectboxTimerID);
  }

  if (speed == "immediately") {
    this.timerID = window.setTimeout("setIdProperty('" + this.boxName + "', 'visibility', 'hidden')", 50);
  }
  
  else {
    this.timerID = window.setTimeout("setIdProperty('" + this.boxName + "', 'visibility', 'hidden')", 300);
  }

  this.timerRunning = true;
  selectboxTimerID = window.setTimeout("showSelectBoxes()", 300);
  selectboxTimerRunning = true;
  return true;
}


// Function to show select boxes and embedded objects (once hidden)
function showSelectBoxes() {
  if (document.getElementById) {
    for (x = 0; x < selectboxes.length; x++) {
      selectboxes[x].style.visibility="visible";
    }
    for (x = 0; x < embedObjects.length; x++) {
      embedObjects[x].style.visibility="visible";
    }
  }
}


// Hide select boxes and embedded objects
function hideSelectBoxes() {
  if (document.getElementById) {
    for (x = 0; x < selectboxes.length; x++) {
      selectboxes[x].style.visibility="hidden";
    }
    
    for (x = 0; x < embedObjects.length; x++) {
      embedObjects[x].style.visibility="hidden";
    }
  }
}



function popup(url, windowName, requestedWidth, requestedHeight) {
  windowWidth = (requestedWidth != null) ? requestedWidth : "550";
  windowHeight = (requestedHeight != null) ? requestedHeight : "450";
    
  popupWin = window.open(url, windowName,
    "width=" + windowWidth +
    ",height=" + windowHeight +
    ",resizable=yes,menubar=yes,scrollbars=yes");
  popupWin.focus();
  return false;
}



/* var currentMenu = null;
 
	function init() { // Start-up
			setBrowser();  // Initiate DHTML set								 
	}
	
// Dynamic menu functions

 function changeMenu(handle, flag) {
   if (flag == false) {
      setIdProperty(handle, "visibility", "hidden");
   }
   
   else if (flag == true) {     
     if (currentMenu != handle) {  // If menu is already shown, no need to do it again
       setIdProperty(handle, "visibility", "visible");
       if (currentMenu != null && currentMenu != handle)  { // If there is another menu shown, hide it
         changeMenu(currentMenu, false);
       }
     }
   }   
 }

	
	function showMenu(menu) { // Show menu
		 changeMenu(menu, true);
     currentMenu = menu;
     return true;
	}
	
	function hide() {  // Hide menu
	  if (currentMenu != null) {
     changeMenu(currentMenu, false);
     currentMenu = null;
   }
	}
*/
