 <!--
//CHECK PASSWORD FUNCTION:
function checkPassword(password) {
passwordError = false;
if ((password.value == ""))
		{
			alert("Please enter password.");
 			password.select();
  			password.focus();
		passwordError = true;
		return false;
		}

if ((password.value.length<4))
		{
			alert("Password should be minimum of 4 characters in length.");
		    password.select();
  			password.focus();
		passwordError = true;
		return false;
		}

}

//CHECK EMAIL FUNCTION:
function checkEmail(Id) {
EmailError = false;
if ((Id.value == "")||(Id.value ==" ")) 
  {
    alert("Please enter Email ID.");
 			Id.select();
  			Id.focus();
    EmailError = true;
    return false;
  }

// checks if the e-mail address is valid
var emailStr = Id.value
var emailPat = /^(\".*\"|[A-Za-z]\w*)@(\[\d{1,3}(\.\d{1,3}){3}]|[A-Za-z]\w*(\.[A-Za-z]\w*)+)$/;
var matchArray = emailStr.match(emailPat);
if (matchArray == null) {
alert("Your email address seems incorrect.  Please try again (check the '@' and '.' in the email address)");
	Id.select();
  	Id.focus();
EmailError = true;
return false;
}

// make sure the IP address domain is valid
var IPArray = matchArray[2].match(/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/);
if (IPArray != null) {
for (var i=1;i<=4;i++) {
if (IPArray[i]>255) {
alert("Destination IP address is invalid in the email!")
	Id.select();
  	Id.focus();
EmailError = true;
return false;
      }
   }
}
}

function testLogin() {
var Id=document.LoginForm.EUnm;
var password=document.LoginForm.PW;

checkEmail(Id)
checkPassword(password)

if ((passwordError !== true) && (EmailError !== true)) {
document.LoginForm.swapL.disabled = true;
document.LoginForm.action = "signin.asp";
document.LoginForm.submit();
	}
}

// -->
