﻿// JScript File
/* Form Validation Script for User Login 
Developed By	: Ashok Mandial
Date			: 24 June, 2008 
Message			: Create an array of form elements and apply validation rules on them.
*/
function validate()
{
    var rules=new Array();   
  
        rules[0]='ctl00_ContentPlaceHolder1_txtEmail|required|Please enter Email address';
        rules[1]='ctl00_ContentPlaceHolder1_txtEmail|email|Please enter valid  Email address.The address should be of this form name@company.com';
        rules[2]='ctl00_ContentPlaceHolder1_txtConfirmEmail|required|Please enter Confirm Email address';
        rules[3]='ctl00_ContentPlaceHolder1_txtConfirmEmail:Confirm Email Address|equal|$ctl00_ContentPlaceHolder1_txtEmail:Email Address';
  
    if(rules.length>0)
    {
        return performCheck('aspnetForm', rules, 'classic');
    }
}
function SetFgtPwdRuleStatus()
{
    document.getElementById("hdnRules").value="FP";
}

function SetFgtPwdButtonClick(e)
{
    var unicode=e.keyCode? e.keyCode : e.charCode ? e.charCode : e.which
    if(unicode=='13')
    {
	    if(document.getElementById("hdnRules").value=='FP')
	    {					
		    document.getElementById("ctl00_ContentPlaceHolder1_imbForgotPwd").click();
		    e.returnValue=false;
		    return false;
	    }
    }
}
function clearField()
{
    document.getElementById("ctl00_ContentPlaceHolder1_txtEmail").value='';
    document.getElementById("ctl00_ContentPlaceHolder1_txtConfirmEmail").value='';
     document.getElementById("ctl00_ContentPlaceHolder1_txtEmail").focus();
    return false;
}