
  /*******************************************************************************************************
     Copyright	         : © Copyright 2005 by Software Paradigms InternationalInc.
     File Name	         : prjLogin.js
     Description	       : ClientSide scripts for spiProject application Login.
     Calling Programs    : prjLogin.asp
     Author              : Prashanth Nandi Prakash.
     Date	               : Aug 26, 2005.
  /*******************************************************************************************************/
    function ForgotPassword()
    {
      if(document.frmLogin.txtLoginName.value=="")
      {
        alert("Please enter the User Name.");
        document.frmLogin.txtLoginName.focus()
      }
      else
      {
        strLoginId = document.frmLogin.txtLoginName.value
        intDomainId = 1
        document.frmLoginEncrypt.method = "post"
        document.frmLoginEncrypt.action = strConstPath + "prjForgotPassword.asp?LoginId=" + strLoginId +"&intDomainId=" + intDomainId
        document.frmLoginEncrypt.target = GstrOprFrameName;
        document.frmLoginEncrypt.submit();
      }
    }
    
    function checkreturnkey(e)
    {
      var charCode = (navigator.appName =="Netscape") ? e.which : e.keyCode;
      if (charCode==13)
      {
        Login();
      }
    }
    
    function Login()
    {
      if (document.frmLogin.txtLoginName.value=="")
      { 
        alert("Please enter the User Name.");
        document.frmLogin.txtLoginName.focus();
      }
      else
      {
          var strPwd = document.frmLogin.txtPassword.value;
          
          //It checks whether the "Remember me on this computer" check box is checked or not
          if (document.frmLogin.chkrem.checked) {
              document.frmLoginEncrypt.hidRememberMe.value = "true";
          }
          else {
              document.frmLoginEncrypt.hidRememberMe.value = "false";
          }
          
        document.frmLoginEncrypt.txtPassword.value = EncryptString(strPwd);
        document.frmLoginEncrypt.txtLoginName.value = document.frmLogin.txtLoginName.value;
        document.frmLoginEncrypt.cboDomain.value = 1;
        document.frmLoginEncrypt.method = "post";
        document.frmLoginEncrypt.action = strConstPath + "prjChecklogin.asp";
        document.frmLoginEncrypt.target = GstrOprFrameName;
        document.frmLoginEncrypt.submit();
      }
    }

    function ChangePassword()
    {
      if (document.frmLogin.txtLoginName.value=="")
      {
        alert("Please enter the User Name.");
        document.frmLogin.txtLoginName.focus()
      }
      else
      {
        document.frmLoginEncrypt.txtLoginName.value = document.frmLogin.txtLoginName.value
        document.frmLoginEncrypt.hidDomainId.value = 1
        document.frmLoginEncrypt.action = strConstPath + "prjCheckChangePasswordLogin.asp"
        document.frmLoginEncrypt.method = "post"
        document.frmLoginEncrypt.target = GstrOprFrameName
        document.frmLoginEncrypt.submit()
      }
    }

 function Demo_Click()
  {
          var strFilePath = strConstPath + "spiprojectdemo.html"
	  var intTop = (window.screen.height / 2) - 300;
	  var intLeft = (window.screen.width / 2) - 320;
	  window.open(strFilePath, "_new", "top=" + intTop + ", left=" + intLeft + ", width=760, height=560, scrollbars=no, menubar=no, toolbar=no, locationbar=no, resizable=no")
  }
  
  function btnHelp_Click()
  {
    var strFilePath = strConstPath + "Help/prjLogin.html"
    var width   = screen.availWidth
    var height  = screen.availHeight
    window.open(strFilePath, "LoginHelp", "width=" + width +", height=" + height + ", locationbar=no, scrollbars=yes, toolbar=no, personalbar=no, menubar=no, resizable=yes" )
  }
  function openAboutSPI()
  {
    var strLocation = "http://www.spiPortal.com"
    window.open(strLocation,'_new','toolbar=yes,menubar=yes,AddressBar=yes,scrollbars=yes,titlebar=yes,statusbar=yes,resizable=yes,locationbar=yes')
  }