<!-- Created: 2002-09-06 -->
<!-- Updated: 2004-06-02 - resizable is now set to yes -->
var popup2, boolConfirm, strW, strH;
function launchLoginPopup(strURL, strW, strH) {
   var lngDlgWidth, lngDlgHeight;
   
   if (!strW) { //if no width or height is defined in the JS popup call default to this size:
      lngDlgWidth    = 512;   // 256 * 2 = 512
      lngDlgHeight   = 382;
   } else { //default to size as defined in the JS popup call
      lngDlgWidth    = strW;
      lngDlgHeight   = strH;
   }
   var lngMoveY, lngMoveX;
   lngMoveX = (window.screen.width - lngDlgWidth) / 2; //Center window
   lngMoveY = (window.screen.height - lngDlgHeight) / 2;
   if (!window.popup2) {
      var openCommand = "window.open('" + strURL +
                     "', 'loginWindow',\"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,screenX=" +
                     lngMoveX + ",screenY=" + lngMoveY + ",top=" + lngMoveY + ",left=" + lngMoveX +
                     ",width=" + lngDlgWidth + ",height=" + lngDlgHeight + "\");";
      popup2 = eval(openCommand);
      popup2.focus();
   }
   else{
      if (!popup2.closed) {
         boolConfirm = confirm("An instance of this application is already running.\r\n\r\nClick OK to quit current application and login as a different user.\r\n\r\nClick CANCEL to resume current application.");
         if (boolConfirm) {
            //-- instead of calling logout.asp (which will bring the user to the login dialog), simply open the desired destination.
            //            popup2.location="/logout.asp";
            var openCommand = "window.open('" + strURL +
                           "', 'loginWindow',\"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,screenX=" +
                           lngMoveX + ",screenY=" + lngMoveY + ",top=" + lngMoveY + ",left=" + lngMoveX +
                           ",width=" + lngDlgWidth + ",height=" + lngDlgHeight + "\");";
            
            popup2 = eval(openCommand);
            popup2.focus();
         }   
         else {
            popup2.focus();
         }
      }
      else{
         var openCommand = "window.open('" + strURL +
            "', 'loginWindow',\"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,screenX=" +
            lngMoveX + ",screenY=" + lngMoveY + ",top=" + lngMoveY + ",left=" + lngMoveX +
            ",width=" + lngDlgWidth + ",height=" + lngDlgHeight + "\");";
         popup2 = eval(openCommand);
         popup2.focus();
      }
   }
}
