function printPage() {
  if (pr) // NS4, IE5
    window.print()
  else if (da && !mac) // IE4 (Windows)
    vbPrintPage()
  else // other browsers
    alert("Sorry, your browser doesn't support this feature.");
  return false;
}

if (da && !pr && !mac) with (document) {
  writeln('<OBJECT ID="WB" WIDTH="0" HEIGHT="0" CLASSID="clsid:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>');
  writeln('<' + 'SCRIPT LANGUAGE="VBScript">');
  writeln('Sub window_onunload');
  writeln('  On Error Resume Next');
  writeln('  Set WB = nothing');
  writeln('End Sub');
  writeln('Sub vbPrintPage');
  writeln('  OLECMDID_PRINT = 6');
  writeln('  OLECMDEXECOPT_DONTPROMPTUSER = 2');
  writeln('  OLECMDEXECOPT_PROMPTUSER = 1');
  writeln('  On Error Resume Next');
  writeln('  WB.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER');
  writeln('End Sub');
  writeln('<' + '/SCRIPT>');
}

  isNS4 = (document.layers) ? true : false;
  isIE4 = (document.all && !document.getElementById) ? true : false;
  isIE5 = (document.all && document.getElementById) ? true : false;
  isNS6 = (!document.all && document.getElementById) ? true : false;
 //This script will fix the print screen problem on IE 4

var da = (document.all) ? 1 : 0;
var pr = (window.print) ? 1 : 0;
var mac = (navigator.userAgent.indexOf("Mac") != -1);

  function ShowHideDiv(){
  //Take unlimited number of Div names and show or hide layer according to the last argument (boolean)
  //Parameters: In format 'div1','div2',.....,boolean
    var NumVar = ShowHideDiv.arguments.length;
    var NumDivs = NumVar - 1
    var BolVisible = ShowHideDiv.arguments[NumVar];  
    
    for(i=0;i<NumDivs;i++)
      switchDiv(ShowHideDiv.arguments[i],BolVisible);
  }
  
  function ChangeVisibility(strDivName){
  //Check the visibility of the div passsed and change to the opposit
  //Parameter: Div name
  
    var objElement = document.getElementById(strDivName);
    
    if(objElement.style.visibility == "visible"){
      objElement.style.visibility = "hidden"
      objElement.style.display = "none";
    }else
      switchDiv(strDivName,true)   
  }
  

  function switchDiv(strDivName,bolVisible){
  //identify the element based on browser type
  if (isNS4) {
    objElement = document.layers[strDivName];
  } else if (isIE4) {
    objElement = document.all[strDivName];
  } else if (isIE5 || isNS6) {
    objElement = document.getElementById(strDivName);
  }

  if (isNS4) {
    if (!bolVisible) {
      //objElement.style.visibility = "hidden";
      objElement.visibility ="hidden"
      objElement.style.display = "none";
    } else {
      //objElement.style.visibility = "visible";
      objElement.visibility ="visible";
      objElement.style.display = "";
    }
  } else {
    if (!bolVisible) {
      objElement.style.visibility = "hidden";
      objElement.style.display = "none";
      //document.layers[strDivName].visibility ="hidden"
    } else {
      objElement.style.visibility = "visible";
      objElement.style.display = "";
      //document.layers[strDivName].visibility ="visible"
    }
  }
}



function privacy(filename)
{
  window.open(filename,'priv','menubar=no,location=no,menus=no,resizable=1,status=no,top=5,width=400,height=300');
}
function NewWindow(filename)
{
  window.open(filename,'Plain','menubar=no,toolbar=no,location=no,menus=no,scrollbars,resizable=1,status=yes,screenX=50,screenY=50,width=630,height=580');
}
function IBWindow(filename)
{
var windowprops = "menubar=no,toolbar=no,location=no,menus=no,scrollbars,resizable=1,status=yes, top=0,left=0" + ",width=" + (screen.width -40) + ",height=" + (screen.height-85);

  window.open(filename,'New',windowprops);
}

function Window1000(filename)
{
  window.open(filename,'1000','menubar=no,toolbar=no,location=no,menus=no,scrollbars,resizable=1,status=yes,top=5,width=1000,height=720');
}
function Window950(filename)
{
  window.open(filename,'950','menubar=no,toolbar=no,location=no,menus=no,scrollbars,resizable=1,status=yes,top=5,width=950,height=720');
}
function Window900(filename)
{
  window.open(filename,'900','menubar=no,toolbar=no,location=no,menus=no,scrollbars,resizable=1,status=yes,top=5,width=900,height=720');
}
function Window850(filename)
{
  window.open(filename,'850','menubar=no,toolbar=no,location=no,menus=no,scrollbars,resizable=1,status=yes,top=5,width=850,height=550');
}
function Window800(filename)
{
  window.open(filename,'800','menubar=no,toolbar=no,location=no,menus=no,scrollbars,resizable=1,status=yes,top=5,width=800,height=550');
}
function Window750(filename)
{
  window.open(filename,'750','menubar=no,location=no,menus=no,scrollbars,resizable=1,status=yes,top=5,width=740,height=640');
}
function Window700(filename)
{
  window.open(filename,'700','menubar=no,location=no,menus=no,scrollbars,resizable=1,status=yes,top=5,width=700,height=540');
}
function Window640(filename)
{
window.open(filename,'640','menubar=no,toolbar=no,location=no,menus=no,scrollbars,resizable=1,status=yes,top=5,width=640,height=560');
}
function Window500(filename)
{
  window.open(filename,'sec','menubar=no,location=no,menus=no,scrollbars=yes,resizable=1,status=yes,top=5,width=500,height=450');
}
function Widow450(filename)
{
  window.open(filename,'450','menubar=no,location=no,menus=no,scrollbars=yes,resizable=1,status=yes,top=5,width=450,height=400');
}
