// JavaScript Document
// JavaScript Document

function frmValidationContactUs()
{
    var Field= Array();
	var FieldName= Array();
	//var email=document.frmCareer.email.value;
	
	Field[0]=document.frmContact.fName.value;
	Field[1]=document.frmContact.lName.value;
	Field[2]=document.frmContact.email.value;

		
	FieldName[0]="First Name";
	FieldName[1]="Last Name";
	FieldName[2]="Email";
	
	var al="";
	var bval = true;
	
	for(i=0; i<3; i++)
	{
		if(Field[i]=="")
			al=al + ">>" + FieldName[i] + "   " + "\n";
	}
	
	if(al!="")
	{
		alert("Please Fill the following Fields\n\n" + al);
		bval = false;
	} 
	
	if(bval)
	 {
		bval= emailCheck();
	 }
	return bval;
}
	 
function emailCheck() 
  	{
  	  		var emailPat=/^(.+)@(.+)$/
  	        var matchArray;	
  	  		var emailStr = document.frmContact.email.value;;	
  	  	
  	  		if(emailStr.length > 1)
  	  			{  	  	
			matchArray = emailStr.match(emailPat);
			if (matchArray == null) 
			
			{
				alert("Please Enter Correct Email Address"); 
				return false;
			}	
			else
			{
				return true;
			}  		
  		}
  	  	
    }


