function openPopupWin(pageToLoad,winName,width,height,center,menu){
  args=getArgs(width,height,center,menu);
  // since window.focus is buggy (js error on IE4), close the window
  // and reopen if present (focus is a security error and closing
  // isn't?... go figure)
  if (parseInt(navigator.appVersion) >= 4 ){
    if(window.PMpopup){
      PMpopup.close();
      PMpopup=window.open(pageToLoad,winName,args);
    }
  }
  PMpopup=window.open(pageToLoad,winName,args);
  return false;
}

function getArgs(width,height,center,menu){
  xposition=10; yposition=10;

  if ((parseInt(navigator.appVersion) >= 4 ) && (center)){
    if (menu==0){
      xposition = (screen.width - width) - 10;
      yposition = (screen.height - height) - 58;
    }
    else if(menu==1){
      xposition = (screen.width - width) / 2;
      yposition = ((screen.height - height) / 2) - 67;
    }
  }
  if (navigator.appName == 'Netscape'){
    width = width + 25;
    height = height + 25;
  }
  args="width="+width+",height="+height
    +",toolbar="+menu+",menubar="+menu
    +",screenx="+ xposition+",screeny="+yposition
    +",left="+xposition+",top="+yposition
    +",resizable=1,scrollbars=1";

  return args;
}

function hideShowLayer(eleID, show, showClass) {
	if (document.getElementById) {
		// this is the way the standards work
		var style2 = document.getElementById(eleID).style;
	}
	else if (document.all) {
		// this is the way old msie versions work
		var style2 = document.all[eleID].style;
	}
	else if (document.layers) {
		// this is the way nn4 works
		var style2 = document.layers[eleID].style;
	}
	if (document.all && !window.opera) {
		if (showClass == "table-row" || showClass == "table-row-group") {
			showClass = "inline"
		}
	}
	if (show == true) {
		style2.display = showClass; 
	}
	else {
		style2.display = "none"; 
	}
}


