﻿/******************************************************************************************************************
 * Module Name         : Login
 * File Name           : FSLogin.js
 * Created On          : 27/1/2007
 * Developed By        : Lopamudra Patnaik
 * Version             : 1.01
 * Brief Description   : This module validates the login form.
 * Last Modified       : 26/11/2007
 * 
 ******************************************************************************************************************
 * Revision History
 *******************************************************************************************************************
 * Version      Change Id       Defect Id       Modified By         Date        Brief Description
 * 1.01          CH 001                         Pranesh K S         26-Nov-2207 Added a new javascript function to verify that user has entered email id.
 ********************************************************************************************************************/



function ValidateForm()
{
    var email = trim(document.getElementById(emailFieldID).value);
    var password = trim(document.getElementById(passwordFieldID).value);
    
    if(email.length == 0)
    {
        alert("Please enter your email address");
        document.getElementById(emailFieldID).focus();
        return false;
    }
    if(!validateEmail(email))
    {
        alert("Please enter a valid email address");
        document.getElementById(emailFieldID).select();
        return false;
    }
    if(password.length == 0)
    {
        alert("Please enter the password");
        document.getElementById(passwordFieldID).focus();
        return false;
    }

    return true;
}

//CH 001 ------ Start
function lnkvalidateEmail()
{
  if(emailField!=null)
  { 
    if(!validateEmail(emailField.value))
     {
      alert("Please enter a Valid Email ID");
        return false;
     }            
  }
 return true; 
}
//CH 001 ------ End