/*************************************************************************************
  Function: DoNotAllowSpaces()
  
  Attach this to a textbox control via the onkeypress= event
  and it will prevent spaces from being typed into
  the field.
*/
function Keyup_DoNotAllowSpaces() 
{  
  var space = 32;
   var keyCode = new Number(this.event.keyCode);

 // Does not allow spaces to go in 
 if (keyCode == space)  
 {
 return false;
 }

}
function CheckRequiredFields()
{
 var num=document.frmLogin.Userid.value;
var browserName;
var browserVer;
var uid;
uid = document.frmLogin.Userid.value.indexOf(' ');
browserName=navigator.appName; 
browserVer=parseInt(navigator.appVersion);
if (num == '' )
   
 {alert("User ID is required");
 document.frmLogin.Userid.focus();
     return false;
  }
 else if ((browserName=="Netscape" && browserVer>=4)) 
 
 { 
 	if (uid!=-1)
	 { alert('User ID should not have space')
  	   document.frmLogin.Userid.focus();
     	   return false;
         }
 }
  else if ((document.frmLogin.txtPassword.value.length >15) || (document.frmLogin.txtPassword.value.length ==0))
 {
    alert("Password is a required field.  Password must not be more 15 characters.");
    document.frmLogin.txtPassword.focus();
    return false;
 }
  
  
  return true; 
 
}

function ForgotPIN()
{
var num=document.frmLogin.Userid.value;
//var poo=document.frmLogin.PortOfOrigin.value;
var poo=document.frmLogin.PortOfOrigin.options[document.frmLogin.PortOfOrigin.selectedIndex].value;
var uid;
var browserName;
var browserVer;
uid = document.frmLogin.Userid.value.indexOf(' ');
browserName=navigator.appName; 
browserVer=parseInt(navigator.appVersion);


//  If the user has provided a userid, allow him to proceed
//  to the "forgot PIN" screen.  
 if ( document.frmLogin.Userid.value.length == 0 ) 
 {
    alert("User ID is required.");
    document.frmLogin.Userid.focus();
    document.frmLogin.cbxForgot.value = 0;
   
 }
    else if (poo<1)
 {
    alert("Please select a valid user type");
    document.frmLogin.PortOfOrigin.focus();
    document.frmLogin.cbxForgot.value = 0;
    
 }
 else if ((browserName=="Netscape" && browserVer>=4)) 
 
{ 
 if (uid!=-1)
 { alert('User ID should not have space')
 document.frmLogin.Userid.focus();
 
 }
} 
 else
 {
  // fill in the userid field and submit
  document.frmForgotPIN.userid.value = document.frmLogin.Userid.value;
  document.frmForgotPIN.PortOfOrigin.value=poo;
  document.frmLogin.cbxForgot.value=0;
  //document.frmForgotPIN.action='<%= Application("LinkPrefixsec") %>securedlogons.humana.com/common/scripts/ForgotPIN.asp';
  //document.frmForgotPIN.method='post';
  document.frmForgotPIN.submit();
  return true;

 }
 
}
