/********************************************************************
* Description: code for Common validations.
* Author: Sudhakar Reddy.P
* Date: 03/08/2007 (MM/DD/YYYY)
* Modified time:  (MM/DD/YYYY)
* Revision:
* Modified by Date Modified Reason for modification
* xxxxx Xx/xx/xxxx xxxxx
******************************************************************* */

//function to chk whether given given text field is empty or not
function isValidEntry(element,msg) 
{
  
   if(element.value.length == 0)
	{
		alert("Please enter the "+ msg);
		element.focus();
		return false;
	}
	return true;
} // closing the function isValidEntry()


//function to chk for valid email
function isValidEmail(VarEmail)
{
		if(VarEmail.value == "" || VarEmail.length == 0)
		{
			alert("Please enter Email Address");
			VarEmail.focus();
			return false;
		}	

		if(VarEmail.value!="")
        {

			if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(VarEmail.value)))
			{
				alert("Invalid Email address!");
				VarEmail.focus();
				return false;
			}
        } 
		return true;
}

