<!-- Created: 2002-09-06 -->
<!-- Updated: 2004-06-02 - resizable is now set to yes -->
var popup2, boolConfirm;
function launchLoginPopup(strURL) {
   var lngDlgWidth   = 650;   // 256 * 2 = 512
   var lngDlgHeight  = 460;
   var lngMoveY, lngMoveX;
   lngMoveX = (window.screen.width - lngDlgWidth) / 2;
   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();
      }
   }
}
