// JavaScript Document
function frmValidation()
{
	var Field= Array();
	var FieldName= Array();
	
	//alert ("hi");
	Field[0]=document.frmcontact.name.value;
	Field[1]=document.frmcontact.phone1.value;
	Field[2]=document.frmcontact.phone2.value;
	Field[3]=document.frmcontact.phone3.value;
	Field[4]=document.frmcontact.email.value;
	Field[5]=document.frmcontact.message.value;
	
	FieldName[0]="Name :";
	FieldName[1]="Phone1 :";
	FieldName[2]="Phone2 :";
	FieldName[3]="Phone3 :";
	FieldName[4]="Email :";
	FieldName[5]="Message :";
	
	var msg="";
	var bval = true;
	
	for(i=0; i<6; i++)
	{
		if(Field[i]=="" || Field[i]==0)
		{
			msg = msg + "Please Fill:"
			msg = msg + "\n" + ">> " + FieldName[i];
			alert(msg);
			bval = false;
			break;
		}
	}
	
	if(bval)
	{
		if(isNaN(Field[1]))
		{
			bval = false;
			alert("Invalite Phone Number");
		}
		if(isNaN(Field[2]))
		{
			bval = false;
			alert("Invalite Phone Number");
		}
		if(isNaN(Field[3]))
		{
			bval = false;
			alert("Invalite Phone Number");
		}
	}
	if(bval)
	{
		bval=emailcheck();
	}
	return bval;
}

function emailcheck()
	{
		var emailpat=/^[a-zA-Z0-9_\.\-]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$/
		var matcharray;
		var emailStrl=document.frmcontact.email.value;
		
		
		matcharray= emailStrl.match(emailpat);
		if (matcharray == null)
		
		{
			alert("Please Enter Correct Email Address");
			document.frmcontact.email.focus();
			return false;
		}
		else
		return true;
	}