var whatB = navigator.appName
var whatV = parseInt(navigator.appVersion.charAt(0))
var bOk = false
var dOk = false
var ns4 = (document.layers)? true:false
var ns6 = (document.getElementById && !document.all)? true:false
var ie4 = (document.all)? true:false
var ie5 = false
var ie6 = false
var Opera = false

var calWin, helpWin, mapWin, searchWin, xWin, dashWin, wizardWin, secondWin, printWin, emailWin, usagehistoryWin
var theWin, theNextWin
var folderoff, folderon

if (ie4)
   {
   if ((navigator.userAgent.indexOf("MSIE 5")>0) || (navigator.userAgent.indexOf('MSIE 6') > 0)) { ie5 = true }
   else { ie5 = false }
   }
else { ie5 = false }

if ((ie5) && (navigator.userAgent.indexOf("MSIE 6") > 0)) { ie6 = true }

if (navigator.appVersion.indexOf("MSIE 5") > 0)
   { whatV = 5 }

if ((whatB == "Netscape" && whatV > 2) || (whatB == "Microsoft Internet Explorer" && whatV > 3))
   { bOk = true }

if ((whatB == "Netscape" && whatV > 3) || (whatB == "Microsoft Internet Explorer" && whatV > 3))
   { dOk = true }

if ((whatB == "Mozilla") || (whatB == "Camino") || (whatB == "Opera"))
{
   ns6 = true
}

if (navigator.userAgent.indexOf("Opera") > 0)
{
   ie4 = false
   Opera = true
}

//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+ CHECK YEAR 2000				                                          +
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function chkYear2000(intY) {
   if (intY > 1900) { return intY }
   else { return (intY+1900) }
}


//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+ CLOSE ME						                                          +
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function closeMe() {
   if (bOk) { opener.closeWin() }
   else { self.close() }
}


//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+ CLOSE NEXT WIN				                                          +
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function closeNextWin() {
   if (bOk)
      {
      if ((theNextWin) && (!theNextWin.closed))
         {
         theNextWin.close()
         theNextWin = 0
         }
      }
   else
      { theNextWin.close() }
}


//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+ CLOSE WIN						                                          +
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function closeWin() {
   if (bOk)
      {
      if ((theWin) && (!theWin.closed))
         {
         theWin.close()
         theWin = 0
         }
      }
   else
      { theWin.close() }
}


//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+ GET D MESSAGE					                                          +
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function getDMsg() {
   var aM = new Array()
   var aD = new Array()
   var objD = new Date()

   function oM(name) { this.name = name }
   function oD(name) { this.name = name }

   aM[0]  = new oM('January')
   aM[1]  = new oM('February')
   aM[2]  = new oM('March')
   aM[3]  = new oM('April')
   aM[4]  = new oM('May')
   aM[5]  = new oM('June')
   aM[6]  = new oM('July')
   aM[7]  = new oM('August')
   aM[8]  = new oM('September')
   aM[9]  = new oM('October')
   aM[10] = new oM('November')
   aM[11] = new oM('December')

   document.write(aM[objD.getMonth()].name+"&nbsp;"+objD.getDate()+",&nbsp;"+ chkYear2000(objD.getYear()))
}


//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+ IMAGE ON						                                          +
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function imageOn(whatImage)
{
   if (bOk)
      { document [whatImage].src = eval(whatImage + "on.file") }
}


//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+ IMAGE OFF						                                          +
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function imageOff(whatImage)
{
   if (bOk)
      { document [whatImage].src = eval(whatImage + "off.file") }
}


//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+ LAUNCH WIN						                                          +
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function LAUNCHWIN(whatWin,addField,whatSize) {
  launchWin(whatWin,addField,whatSize)
}


//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+ LAUNCH WIN						                                          +
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function launchWin(whatWin,addField,whatSize)  {

   var x = 500
   var y = 340

   if ((bOk) && (theWin) && (!theWin.closed))
      { theWin.close() }

   if (whatSize > 0)
   {
      whatV = parseInt(navigator.appVersion.charAt(0))

      if (whatV > 3)
      {
        x = Math.round((whatSize/100) * screen.width)
        y = Math.round((whatSize/100) * screen.height)
      }
   }

   var winToLaunch = null

   if (addField == "N")
      { winToLaunch = whatWin }
   else
      { winToLaunch = whatWin + document.searchForm.keywords.value }

   if (whatB == "Microsoft Internet Explorer")
      { theWin = window.open(winToLaunch,"", "status=no,toolbar=no,location=no,resizable=no,copyhistory=no,menu=no,scrollbars=yes,width="+x+",height="+y) }
   else
      { theWin = window.open(winToLaunch,"theWin", "status=no,toolbar=no,location=no,resizable=no,copyhistory=no,menu=no,scrollbars=yes,width="+x+",height="+y) }

   moveWinToStandardLoc(theWin)

   theWin.focus()
}


//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+ LAUNCH WIN	XY					                                          +
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function launchWinXY(whatWin,winX,winY,scrollB,StatusBar) {
   var strStatus = 'no'

   if (StatusBar) { strStatus = 'yes' }

   if ((bOk) && (theWin) && (!theWin.closed))
      { theWin.close() }

   if (whatB == "Microsoft Internet Explorer")
      { theWin = window.open(whatWin,"theWin", "screenX=10,screenY=10,status="+strStatus+",toolbar=no,location=no,resizable=no,copyhistory=no,menu=no,scrollbars="+scrollB+",width="+winX+",height="+winY) }
   else
      { theWin = window.open(whatWin,"theWin", "screenX=10,screenY=10,status="+strStatus+",toolbar=no,location=no,resizable=no,copyhistory=no,menu=no,scrollbars="+scrollB+",width="+winX+",height="+winY) }

   moveWinToStandardLoc(theWin)
   theWin.focus()
}


//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+ LAUNCH NEXT WIN XY			                                          +
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function launchNextWinXY(whatWin,winX,winY,scrollB)  {
   if (theNextWin) { theNextWin.close() }

   if (whatB == "Microsoft Internet Explorer")
      { theNextWin = window.open(whatWin,"", "status=no,toolbar=no,location=no,resizable=no,copyhistory=no,menu=no,scrollbars="+scrollB+",width="+winX+",height="+winY) }
   else
      { theNextWin = window.open(whatWin,"theNextWin", "status=no,toolbar=no,location=no,resizable=no,copyhistory=no,menu=no,scrollbars="+scrollB+",width="+winX+",height="+winY) }

   moveWinToStandardLoc(theNextWin)
}


//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+ MOVE WIN TO STANDARD LOC	                                          +
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function moveWinToStandardLoc(winObj) {
   if (whatV >=4)
    { winObj.moveTo(10,10) }
}


//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+ NO OBJ WIN NO SCROLL		                                          +
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function noObjWinNoScroll(whatWin,x,y)  {
  var strWin
  strWin = "screenX=10,screenY=10,"
  strWin = strWin + "status=no,toolbar=no,"
  strWin = strWin + "location=no,resizable=no,"
  strWin = strWin + "copyhistory=no,menu=no,"
  strWin = strWin + "scrollbars=no,width=" + x + ",height=" + y
  window.open(whatWin,"",strWin)
}


//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+ NO OBJ WIN						                                          +
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function noObjWin(whatWin,x,y)  {
  var strWin
  strWin = "screenX=10,screenY=10,"
  strWin = strWin + "status=no,toolbar=no,"
  strWin = strWin + "location=no,resizable=no,"
  strWin = strWin + "copyhistory=no,menu=no,"
  strWin = strWin + "scrollbars=yes,width=" + x + ",height=" + y
  window.open(whatWin,"",strWin)
}


//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+ SEARCH WIN UP					                                          +
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function searchWinUp(e) {
   var wCode

   if (e != 0) {
      if (ns4) { wCode = e.which }
      else {
         if (e.type == "keypress") { wCode = e.keyCode }
         else { wCode = e.button }
      }
   }

   if ((wCode == 13)||(e == 0)) {
      upWinXY('searchWin','/help/search.asp',600,450,true)
   }
}


//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+ UPWIN							                                          +
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function upWin(winName,whatWin,whatSize,scrollB)  {

   var x = 600
   var y = 440

   if (whatSize > 0)
   {
      x = Math.round((whatSize/100) * screen.width)
      y = Math.round((whatSize/100) * screen.height)
   }

   upWinXY(winName,whatWin,x,y,scrollB)
}


//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+ UPWIN XY						                                          +
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function upWinXY(winName,whatWin,winX,winY,scrollB,StatusBar,blnResizable) {
   var strScrollBars = 'no'
   var strStatus = 'no'
   var strResizable = 'no'

   if (scrollB) { strScrollBars = 'yes' }
   if (StatusBar) { strStatus = 'yes' }
   if (blnResizable) { strResizable = 'yes' }

   eval("if (("+winName+") && (!"+winName+".closed)) { "+winName+".close() }")

   if (whatB == "Microsoft Internet Explorer" && whatV > 3)
      { eval(winName+" = window.open(whatWin,'','left=10,top=10,status="+strStatus+",toolbar=no,location=no,resizable="+strResizable+",copyhistory=no,menubar=no,scrollbars="+strScrollBars+",width="+winX+",height="+winY+"')") }
   else
      { eval(winName+" = window.open(whatWin,'"+winName+"','screenX=10,screenY=10,status="+strStatus+",toolbar=no,location=no,resizable="+strResizable+",copyhistory=no,menubar=no,scrollbars="+strScrollBars+",width="+winX+",height="+winY+"')") }
   if (whatWin.indexOf('http') < 0 ) {
     eval(winName+".moveTo(10,10)")
   }
}