  function centerWin(winFile, W, H){
    if(W > 100 && H > 100 && window.screen){
      var theX = (screen.width - W)/2
      var theY = (screen.height - H)/2
      showWin(winFile, 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=' + W + ',height=' + H + ',screenX=' + theX + ',screenY=' + theY + ',left=' + theX + ',top=' + theY)
    }
    else{
      showWin(winFile, 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=' + (W + 25) + ',height=' + (H + 25) + ',screenX=80,screenY=80,left=80,top=80')
    }
  }
  function centerWinCtrl(winFile, W, H){
    if(W > 100 && H > 100 && window.screen){
      var theX = (screen.width - W)/2
      var theY = (screen.height - H)/2
      showWin(winFile, 'toolbar=yes,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=' + W + ',height=' + H + ',screenX=' + theX + ',screenY=' + theY + ',left=' + theX + ',top=' + theY)
    }
    else{
      showWin(winFile, 'toolbar=yes,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=' + (W + 25) + ',height=' + (H + 25) + ',screenX=80,screenY=80,left=80,top=80')
    }
  }

  function centerWinScroll(winFile, W, H){
    if(W > 100 && H > 100 && window.screen){
      var theX = (screen.width - W)/2
      var theY = (screen.height - H)/2
      showWin(winFile, 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=' + W + ',height=' + H + ',screenX=' + theX + ',screenY=' + theY + ',left=' + theX + ',top=' + theY)
    }
    else{
      showWin(winFile, 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=' + (W + 25) + ',height=' + (H + 25) + ',screenX=80,screenY=80,left=80,top=80')
    }
  }

  function centerWinScrollCtrl(winFile, W, H){
    if(W > 100 && H > 100 && window.screen){
      var theX = (screen.width - W)/2
      var theY = (screen.height - H)/2
      showWin(winFile, 'toolbar=yes,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=' + W + ',height=' + H + ',screenX=' + theX + ',screenY=' + theY + ',left=' + theX + ',top=' + theY)
    }
    else{
      showWin(winFile, 'toolbar=yes,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=' + (W + 25) + ',height=' + (H + 25) + ',screenX=80,screenY=80,left=80,top=80')
    }
  }


  function showWin(winFile, winParams){
    theFilePointer = winFileName(winFile)
    theData = window.open(winFile, theFilePointer, winParams);
    window.theData.focus();
  }
  function winFileName(winFile){ //Uses the toBaseN function to convert the file pointer to a unique Base 22 number
    var tempVar = "wptr", i = 0
    for(i = 0; i < winFile.length; i++)
       tempVar += toBaseN(winFile.charCodeAt(i),22)
    return tempVar
  }
  function toBaseN(x, n){//Converts any decimal # to that of another base specified by n, where A = 10, B = 11, etc. from base 2 to base 26
    if(n >=2 && n <= 26)
      if(x == "0")
        return x
      else
        if(x < n)
          return ("" + x)
        else{
          var indx = x % n
          if(indx > 9)//  if greater than 10, start using "A", "B", "C", etc...
            indx = String.fromCharCode(indx + 55)
          return "" + toBaseN(Math.floor(x/n), n) + indx
        }
  }

