﻿function ValidateForgetPassword()
{ 
    var str='';
    var pnlid='';

    document.getElementById('ctl00_cphContent_lblNotFound').innerHTML = "";

    if(document.getElementById('ctl00_cphContent_txbEmail').value == "" )
    {
        str = "Please Enter the Email." ;
    }
    else if(ChkValidEmail(document.getElementById('ctl00_cphContent_txbEmail').value.replace(/^\s+|\s+$/, '')) == false)
    {
        str = "Invalid Email Address" ;
    }
    if (str!= "")
    {
        document.getElementById('ctl00_cphContent_lblNotFound').innerHTML =str;
        document.getElementById('ctl00_cphContent_lblNotFound').style.color ="red";
        return false;
    }
    else
    {
        return true;  
    }	
}
  
function Validatecredentials()
{ 

    var str='';
    
    if( document.getElementById('ctl00_cphContent_lblErrorMessage') != null)
    {
    document.getElementById('ctl00_cphContent_lblErrorMessage').innerHTML = "";
    }
    
 if( document.getElementById('ctl00_cphContent_txtUsername') != null)
    {
    if(document.getElementById('ctl00_cphContent_txtUsername').value == "" )
    {
        str = ", Username" ;
            
    }
    }
    
    if( document.getElementById('ctl00_cphContent_txtPassword') != null)
    {
    if(document.getElementById('ctl00_cphContent_txtPassword').value == "" )
    {
        str += ", Password" ;
            
    }
    }

    if (str!= "")
    {
        if( document.getElementById('ctl00_cphContent_lblErrorMessage') != null)
        {
        document.getElementById('ctl00_cphContent_lblErrorMessage').innerHTML = "Please complete the following fields: " + str.substring(1);
        return false;
        }
    }
    else
    {
        return true;  
    }	
} 
