﻿// JScript File

//the following function is used in change password validation

function changepassvalidation()
{

    var _Regexpemail = /^(?:\w+\.?)*\w+@(?:\w+\.)+\w+$/;
    var _Email =  window.document.getElementById('ctl00_BodyContents_txt_email').value;
    var _Oldpass=  window.document.getElementById('ctl00_BodyContents_txt_oldPassword').value;
    var _Newpass=  window.document.getElementById('ctl00_BodyContents_txt_newPassword').value;
    var _Confirmpass =  window.document.getElementById('ctl00_BodyContents_txt_confirmPassword').value;    
        
    //email  text box 
if(_Email == "")
        {
        alert("Please Provide Email Address.");
        window.document.getElementById('ctl00_BodyContents_txt_email').focus();       
        return false;                 
        }
        
//email   validation 
if (!(_Regexpemail).test(_Email))
        {
        alert("Please Provide Valid Format Email Address.");
        window.document.getElementById('ctl00_BodyContents_txt_email').focus();       
        return false;                 
        }
        
if(_Oldpass == "")
        {
        alert("Please Provide Old Password.");
        window.document.getElementById('ctl00_BodyContents_txt_oldPassword').focus();       
        return false;                 
        }
        
        
if(_Newpass == "")
        {
        alert("Please Provide New Password.");
        window.document.getElementById('ctl00_BodyContents_txt_newPassword').focus();       
        return false;                 
        }
        
        
if(_Confirmpass == "")
        {
        alert("Please Provide Confirm Password.");
        window.document.getElementById('ctl00_BodyContents_txt_confirmPassword').focus();       
        return false;                 
        }
        
if(_Confirmpass != _Newpass)
        {
        alert("Confirm Password Does Not Match.");
        window.document.getElementById('ctl00_BodyContents_txt_confirmPassword').focus();       
        return false;                 
        }
}


//the following function is used in forgot password validation page

function forgotpasswordvalid()
{

    var _Regexpemail = /^(?:\w+\.?)*\w+@(?:\w+\.)+\w+$/;
    var _Email =  window.document.getElementById('ctl00_BodyContents_txt_emailforgot').value;
    
        
        //email  text box 
        if(_Email == "")
            {
            alert("Please Provide Email Address.");
            window.document.getElementById('ctl00_BodyContents_txt_emailforgot').focus();       
            return false;                 
            }
        
       //email   validation 

        if (!(_Regexpemail).test(_Email))
            {
            alert("Please Provide Valid Format Email Address.");
            window.document.getElementById('ctl00_BodyContents_txt_emailforgot').focus();       
            return false;                 
            }       
}



