// JavaScript Document
function frmValidate()
{
	var Field= Array();
	var FieldName= Array();
	//var email=document.frmCareer.email.value;
	
	Field[0]=document.frmquote.firstname.value;
	Field[1]=document.frmquote.lastname.value;
	Field[2]=document.frmquote.companyname.value;
	Field[3]=document.frmquote.btcall.value;
	Field[4]=document.frmquote.phone1.value;
	Field[5]=document.frmquote.phone2.value;
	Field[6]=document.frmquote.phone3.value;
	Field[7]=document.frmquote.email.value;
	Field[8]=document.frmquote.phone4.value;

		
	FieldName[0]="First Name";
	FieldName[1]="Last Name";
	FieldName[2]="Company Name";
	FieldName[3]="Best time to call";
	FieldName[4]="Phone field1";
	FieldName[5]="Phone field2";
	FieldName[6]="Phone field3";
	FieldName[7]="Email Address";
	FieldName[8]="Phone field4";
	
	var al="";
	var bval = true;
	
	for(i=0; i<8; i++)
	{
		if(Field[i]=="")
			al=al + ">> " + FieldName[i] + "   " + "\n";
	}
	
	if(al!="")
	{
		alert("Please Fill the following Fields\n\n" + al);
		bval = false;
	} 
	
	if(bval)
	{
		if(isNaN(Field[4]) || isNaN(Field[5]) || isNaN(Field[6]) || isNaN(Field[8]))
		{
			bval = false;
			alert("Invalite Phone Number");
		}
	}
	
	if(bval)
	 {
		bval= emailCheck();
	 }
	return bval;
}
function frmconValidate()
{
	var Field= Array();
	var FieldName= Array();
	//var email=document.frmCareer.email.value;
	
	Field[0]=document.frncontact.name.value;
	Field[1]=document.frncontact.company.value;
	Field[2]=document.frncontact.serviceneed.value;
	Field[3]=document.frncontact.email.value;
	Field[4]=document.frncontact.phone1.value;
	Field[5]=document.frncontact.phone2.value;
	Field[6]=document.frncontact.phone3.value;
	Field[7]=document.frncontact.phone4.value;
	
	FieldName[0]="Name";
	FieldName[1]="Company";
	FieldName[2]="Service Needs";
	FieldName[3]="Emailaddress";
	FieldName[4]="Phone field1";
	FieldName[5]="Phone field2";
	FieldName[6]="Phone field3";
	FieldName[7]="Phone field4";
	
	var al="";
	var bval = true;
	
	for(i=0; i<7; i++)
	{
		if(Field[i]=="")
			al=al + ">> " + FieldName[i] + "   " + "\n";
	}
	
	if(al!="")
	{
		alert("Please Fill the following Fields\n\n" + al);
		bval = false;
	} 
	if(bval)
	{
		if(isNaN(Field[4]) || isNaN(Field[5]) || isNaN(Field[6]) || isNaN(Field[7]))
		{
			bval = false;
			alert("Invalite Phone Number");
		}
	}
	if(bval)
	 {
		bval= emailCheck1();
	 }
	return bval;
}
function emailCheck() 
  	{
  	  		var emailPat=/^(.+)@(.+)$/
  	        var matchArray;	
  	  		var emailStr = document.frmquote.email.value;	
  	  	
  	  		if(emailStr.length > 1)
  	  			{  	  	
			matchArray = emailStr.match(emailPat);
			if (matchArray == null) 
			
			{
				alert("Please Enter Correct Email Address"); 
				return false;
			}	
			else
			{
				return true;
			}  		
  		}
  	  	
    }
	function emailCheck1() 
  	{
  	  		var emailPat=/^(.+)@(.+)$/
  	        var matchArray;	
  	  		var emailStr = document.frncontact.email.value;	
  	  	
  	  		if(emailStr.length > 1)
  	  			{  	  	
			matchArray = emailStr.match(emailPat);
			if (matchArray == null) 
			
			{
				alert("Please Enter Correct Email Address"); 
				return false;
			}	
			else
			{
				return true;
			}  		
  		}
  	  	
    }
function frmquesValidate()
{
	var Field= Array();
	var FieldName= Array();
	//var email=document.frmCareer.email.value;
	
	/*Field[0]=document.frmquestion.firstname.value;
	Field[1]=document.frmquestion.lastname.value;
	Field[2]=document.frmquestion.companyname.value;
	Field[3]=document.frmquestion.phonenumber.value;
	Field[4]=document.frmquestion.emailaddress.value;*/
	Field[0]=document.frmquestion.eventtype.value;
	Field[1]=document.frmquestion.guestattending.value;
	Field[2]=document.frmquestion.eventdate.value;
	Field[3]=document.frmquestion.servetype.value;
	Field[4]=document.frmquestion.budget.value;
	Field[5]=document.frmquestion.eventrequest.value;
	Field[6]=document.frmquestion.venue.value;
	
	
		
	/*FieldName[0]="First Name";
	FieldName[1]="Last Name";
	FieldName[2]="Company Name";
	FieldName[3]="Phone Number";
	FieldName[4]="Email Address";*/
	FieldName[0]="What type of event are you planning?";
	FieldName[1]="Approximately how many guests will be attending? ";
	FieldName[2]="What is the date of your event?";
	FieldName[3]="What type of menu would you like to serve?";
	FieldName[4]="Which of the following best describes your budget and expectations per person?";
	FieldName[5]="Your special requests, notes or comments regarding your event";
	FieldName[6]="Have you selected a venue?";
	
	
	var al="";
	var bval = true;
	
	for(i=0; i<7; 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= emailCheck2();
	 }*/
	return bval;
}
/*
function emailCheck2() 
  	{
  	  		var emailPat=/^(.+)@(.+)$/
  	        var matchArray;	
  	  		var emailStr = document.frmquestion.email.value;	
  	  	
  	  		if(emailStr.length > 1)
  	  			{  	  	
			matchArray = emailStr.match(emailPat);
			if (matchArray == null) 
			
			{
				alert("Please Enter Correct Email Address"); 
				return false;
			}	
			else
			{
				return true;
			}  		
  		}
  	  	
    }
	*/
function frmplanValidate()
{
	var Field= Array();
	var FieldName= Array();
	//var email=document.frmCareer.email.value;
	
	Field[0]=document.frmplan.firstname.value;
	Field[1]=document.frmplan.lastname.value;
	Field[2]=document.frmplan.companyname.value;
	Field[3]=document.frmplan.btcall.value;
	Field[4]=document.frmplan.phone1.value;
	Field[5]=document.frmplan.phone2.value;
	Field[6]=document.frmplan.phone3.value;
	Field[7]=document.frmplan.email.value;
	Field[8]=document.frmplan.eventtype.value;
	Field[9]=document.frmplan.guestattending.value;
	Field[10]=document.frmplan.eventdate.value;
	Field[11]=document.frmplan.servetype.value;
	Field[12]=document.frmplan.budget.value;
	Field[13]=document.frmplan.eventrequest.value;
	Field[14]=document.frmplan.venue.value;
	Field[15]=document.frmplan.phone4.value;
	
	FieldName[0]="First Name";
	FieldName[1]="Last Name";
	FieldName[2]="Company Name";
	FieldName[3]="Best time to call";
	FieldName[4]="Phone field1";
	FieldName[5]="Phone field2";
	FieldName[6]="Phone field3";
	FieldName[7]="Email Address";
	FieldName[8]="What type of event are you planning?";
	FieldName[9]="Approximately how many guests will be attending? ";
	FieldName[10]="What is the date of your event?";
	FieldName[11]="What type of menu would you like to serve?";
	FieldName[12]="Which of the following best describes your budget and expectations per person?";
	FieldName[13]="Your special requests, notes or comments regarding your event";
	FieldName[14]="Have you selected a venue?";
	FieldName[15]="Phone field4";
	
	
	var al="";
	var bval = true;
	
	for(i=0; i<15; i++)
	{
		if(Field[i]=="")
			al=al + ">> " + FieldName[i] + "   " + "\n";
	}
	
	if(al!="")
	{
		alert("Please Fill the following Fields\n\n" + al);
		bval = false;
	} 
	if(bval)
	{
		if(isNaN(Field[4]) || isNaN(Field[5]) || isNaN(Field[6]) || isNaN(Field[15]))
		{
			bval = false;
			alert("Invalite Phone Number");
		}
	}
	if(bval){
		bval = emailCheck2();
	}
	return bval;
}
function emailCheck2() 
  	{
			var emailPat=/^(.+)@(.+)$/
  	        var matchArray;	
  	  		var emailStr = document.frmplan.email.value;	
  	  	
  	  		if(emailStr.length > 1)
  	  			{  	  	
			matchArray = emailStr.match(emailPat);
			if (matchArray == null) 
			
			{
				alert("Please Enter Correct Email Address"); 
				return false;
			}	
			else
			{
				return true;
			}  		
  		}
  	  	
    }
