function launchwin(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);

  if (window == null || window.closed)
	{
	newwindow = window.open(theURL,winName,features);
		if (window.opener == null) // set the opener property manually for Nav 2.0.
		{				
			//window.opener = windowparent;
		}
	window.opener.name = windowparent; // give our parent window a name so we can target it from newwindow
	}	
 }

	 
function secureWindow(theURL, width, height) {
   windowprops = "width=" + width + ",height=" + height;
   if (document.all||document.layers||document.getElementById)
   {
   	var top = ((screen.height-50)-height)/2;
  	var left = ((screen.width-10 )-width)/2;
  	 windowprops += ",top=" + top + ",left=" + left;
   }
   	windowprops += "location=0,toolbar=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0";
  	 //alert(theURL);
	 secure = window.open(theURL, 'secure', windowprops);
	secure.focus();
  }	 
	 
function defaultMessageWindow(theURL, width, height, scrollbars) {
   windowprops = "width=" + width + ",height=" + height+",scrollbars="+scrollbars;
   messageWindow = window.open(theURL, 'messageWindow', windowprops);
   messageWindow.focus();
 }		 
	 
	 
function NewPrintWindow(FileToPrint) {
PrintWindow = window.open(FileToPrint,"","height=600,width=650,toolbar=yes,statusbar=no,menubar=no,titlebar=yes,location=no,scrollbars=yes");
			PrintWindow.focus();
}	


/* shows/hides a layer */
function toggleBox(szDivID, iState) // 1 visible, 0 hidden
{
    if(document.layers)	   //NN4+
    {
       document.layers[szDivID].visibility = iState ? "show" : "hide";
    }
    else if(document.getElementById)	  //gecko(NN6) + IE 5+
    {
        var obj = document.getElementById(szDivID);
        obj.style.visibility = iState ? "visible" : "hidden";
    }
    else if(document.all)	// IE 4
    {
        document.all[szDivID].style.visibility = iState ? "visible" : "hidden";
    }
}

function switchBoxOnOff(szDivID)
{
    if(document.layers)	   //NN4+
    {
       document.layers[szDivID].visibility = iState ? "show" : "hide";
    }
    else if(document.getElementById)	  //gecko(NN6) + IE 5+
    {
        var obj = document.getElementById(szDivID);
		if (obj.style.visibility == "visible") {
         obj.style.visibility = "hidden";
		}
		else {
          obj.style.visibility = "visible";
		}
   }
    else if(document.all)	// IE 4
    {
        document.all[szDivID].style.visibility = iState ? "visible" : "hidden";
    }
}

function openaprintwindow(theURL) {
	var width = 850;
	var height = 500;
	
	windowprops = "width=" + width + ",height=" + height;
	if (document.all||document.layers||document.getElementById)
	{
		var top = ((screen.height-50)-height)/2;
		var left = ((screen.width-10)-width)/2;
		windowprops += ",top=" + top + ",left=" + left;
	}
	windowprops += "toolbar=0,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=1";
	window.open(theURL, 'printableWindow', windowprops);
}

function openapopupwindow(theURL,theName,theWidth,theHeight) {
	
	windowprops = "width=" + theWidth + ",height=" + theHeight;
	if (document.all||document.layers||document.getElementById)
	{
		var top = ((screen.height-50)-theHeight)/2;
		var left = ((screen.width-10)-theWidth)/2;
		windowprops += ",top=" + top + ",left=" + left;
	}
	windowprops += "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1";
	window.open(theURL, theName, windowprops);
}





