// JavaScript Document

function home_vaildation()
{
	if(document.home_quote.name.value=="")
	{ 
	   alert("Please enter the name");
	   document.home_quote.name.focus();
	   return false;
	}
	if(document.home_quote.address1.value=="")
	{ 
	   alert("Please enter the address");
	   document.home_quote.address1.focus();
	   return false;
	}
	if(document.home_quote.telephone.value=="")
	{ 
	   alert("Please enter the telephone no");
	   document.home_quote.telephone.focus();
	   return false;
	}
	if(document.home_quote.security.value=="")
	{ 
	   alert("Please enter the social security");
	   document.home_quote.security.focus();
	   return false;
	}
	if(document.home_quote.birth.value=="")
	{ 
	   alert("Please enter the date of birth");
	   document.home_quote.birth.focus();
	   return false;
	}
	
	if(document.home_quote.built_year.value=="")
	{ 
	   alert("Please enter the Year house was built");
	   document.home_quote.built_year.focus();
	   return false;
	}
	if(document.home_quote.roof.value=="")
	{ 
	   alert("Please enter the Year of updates on roof");
	   document.home_quote.roof.focus();
	   return false;
	}
	if(document.home_quote.plumbing.value=="")
	{ 
	   alert("Please enter the Year of updates on plumbing");
	   document.home_quote.plumbing.focus();
	   return false;
	}
	if(document.home_quote.furnace.value=="")
	{ 
	   alert("Please enter the Year of updates on furnace");
	   document.home_quote.furnace.focus();
	   return false;
	}
	if(document.home_quote.electrical.value=="")
	{ 
	   alert("Please enter the Year of updates on electrical");
	   document.home_quote.electrical.focus();
	   return false;
	}
	if(document.home_quote.cost.value=="")
	{ 
	   alert("Please enter the replacement cost of home");
	   document.home_quote.cost.focus();
	   return false;
	}
	var deduct1 = document.home_quote.deduct[0].checked;
	var deduct2 = document.home_quote.deduct[1].checked;
	var deduct3 = document.home_quote.deduct[2].checked;
	if( deduct1==false && deduct2==false && deduct3==false )
	{ 
	   alert("Please select the Deductible cost");
	   document.home_quote.name.focus();
	   return false;
	}
}







function validate()
{	
	//enter the name
	if(document.auto.name.value=="")
	{
		alert("Enter the Name");
		document.auto.name.focus();
		return false;
	}
	//enter the address
	if(document.auto.address.value=="")
	{
		alert("Enter the Address");
		document.auto.address.focus();
		return false;
	}
	//enter the phone
	if(document.auto.phone.value=="")
	{
		alert("Enter the phone");
		document.auto.phone.focus();
		return false;
	}
	
	
	// Enter the Social Security
	if(document.auto.social.value=="")
	{
		alert("Enter the Social Security");
		document.auto.social.focus();
		return false;
	}
	//Enter the License
	if(document.auto.driving.value=="")
	{
		alert("Enter the Driving License");
		document.auto.driving.focus();
		return false;
	}
	//Enter the Date of Birth
	if(document.auto.dob.value=="")
	{
		alert("Enter the Date of Birth");
		document.auto.dob.focus();
		return false;
	}
	//Enter Driver Name
// 	if(document.auto.dname.value=="")
// 	{
// 		alert("Enter the Driver Name");
// 		document.auto.dname.focus();
// 		return false;
// 	}
// 	//Enter DRivining License
// 	if(document.auto.dlicense.value=="")
// 	{
// 		alert("Enter the Driver License");
// 		document.auto.dlicense.focus();
// 		return false;
// 	}
// 	//Enter Driver Date of Birth
// 	if(document.auto.ddob.value=="")
// 	{
// 		alert("Enter the Driver Date of Birth");
// 		document.auto.ddob.focus();
// 		return false;
// 	}
	

	
	//Enter Vechnicle Year
	if(document.auto.vyear.value=="")
	{
		alert("Enter the Vehicle Year");
		document.auto.vyear.focus();
		return false;
	}
	//Enter Make vehic
	if(document.auto.vmake.value=="")
	{
		alert("Enter the vechicle make ");
		document.auto.vmake.focus();
		return false;
	}
	//Enter vehicle model
	if(document.auto.vmodel.value=="")
	{
		alert("Enter the model of vehicle");
		document.auto.vmodel.focus();
		return false;
	}
	//Enter vehicle Insurance
	if(document.auto.vvin.value=="")
	{
		alert("Enter the Vehcile Insurance");
		document.auto.vvin.focus();
		return false;
	}
	//Select Radio Button
	if(!document.auto.vehicle[0].checked && !document.auto.vehicle[1].checked)
	{
		alert("Is Vechicle driven to work or school?");
		
		return false;
	}
	//Enter miles one way
	if(document.auto.vmiles.value=="")
	{
		alert("Please enter the miles");
		document.auto.vmiles.focus();
		return false;
	}
	//Check box validation
	if (!document.auto.collision[0].checked  &&
		    !document.auto.collision[1].checked  &&
		    !document.auto.collision[2].checked  &&
		   !document.auto.collision[3].checked )
	{
		alert("Please select collision deductible value");
		return false;
	}
	
	if (!document.auto.comprehensive[0].checked  &&
		    !document.auto.comprehensive[1].checked  &&
		    !document.auto.comprehensive[2].checked &&
		    !document.auto.comprehensive[3].checked )
	{
		alert("Please select comprehensive deductible value");
		return false;
	}
	
	
}