// JavaScript Document
function frmValidation()
{
    var Field= Array();
	var FieldName= Array();

	
	Field[0]=document.frmRequest.name.value;
	Field[1]=document.frmRequest.mail.value;
	Field[2]=document.frmRequest.phone1.value;
	Field[3]=document.frmRequest.phone2.value;
	Field[4]=document.frmRequest.phone3.value;
	Field[5]=document.frmRequest.city.value;
	Field[6]=document.frmRequest.state.value;
	
	
	FieldName[0]="Name";
	FieldName[1]="Email";
	FieldName[2]="Phone1";
	FieldName[3]="Phone2";
	FieldName[4]="Phone3";
	FieldName[5]="City";
	FieldName[6]="State";
	
	
	
	
	
	var msg="";
	var bval=true;
	
	for(i=0; i<7; i++)
	{
		if(Field[i]=="")
		{
			//alert("Please fill " + FieldName[i] + " field.");
			msg = msg + "\n" + ">> " + FieldName[i];

		}
	}
	
	if(msg != "")
	{
		al = "Please Fill the following fields" 
		al = al + "\n" + msg;
		alert(al);
		bval=false;
	}
	
	if(bval)
	{
		bval=emailCheck();
	}
	
	//alert("Hi");
	return bval;
}

function emailCheck() 
  	{
  	  		var emailPat=/^(.+)@(.+)$/
  	        var matchArray;	
  	  		var emailStr1 =document.frmRequest.mail.value;;	
			
  	  	
  	  		
					matchArray = emailStr1.match(emailPat);
					if (matchArray == null) 
					
					{
						alert("Please Enter Correct Email Address"); 
						document.frmRequest.mail.focus;
						return false;
					}	
					else 
					return true;
					  		
			
  	  	
    }