// JavaScript Document
function onsub()
{

	if (document.sch_userfrm.First_Name.value=="")
	{
		alert("Enter the First name");
		document.sch_userfrm.First_Name.focus();
		return false;
	}
	 if(document.sch_userfrm.Last_Name.value=="")
	{
		alert("Enter the Last name");
		document.sch_userfrm.Last_Name.focus();	
		return false;
	}
	
	
	if (document.sch_userfrm.email.value=="")
	{
		alert("Enter the email id");
		document.sch_userfrm.email.focus();
		return false;
	}
	if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.sch_userfrm.email.value))){
		alert("Enter the valid email id");
		document.sch_userfrm.email.focus();
		return false;
	}
	if (document.sch_userfrm.Address.value=="")
	{
		alert("Enter the Address");
		document.sch_userfrm.Address.focus();
		return false;
	}

	
	if (document.sch_userfrm.Town.value=="")
	{
		alert("Enter the Town");
		document.sch_userfrm.Town.focus();
		return false;
	}
	
	
	if (document.sch_userfrm.State.value=="")
	{
		alert("Enter the State");
		document.sch_userfrm.State.focus();
		return false;
	}
	 if(document.sch_userfrm.Zip_Code.value=="")
	{
		alert("Enter the Zipcode");
		document.sch_userfrm.Zip_Code.focus();	
		return false;
	}
	if(isNaN(document.sch_userfrm.Zip_Code.value))
	{
		alert("Enter the valid Zipcode");
		document.sch_userfrm.Zip_Code.focus();	
		return false;
	}
	
	if(document.sch_userfrm.Pool_Shape.value=="")
	{
		alert("Enter the Pool Shape");
		document.sch_userfrm.Pool_Shape.focus();	
		return false;
	}
	
	
	if (document.sch_userfrm.Pool_Size.value=="")
	{
		alert("Enter the Pool Size");
		document.sch_userfrm.Pool_Size.focus();
		return false;
	}
	
	if((document.sch_userfrm.package[0].checked==false)&&(document.sch_userfrm.package[1].checked==false)&&(document.sch_userfrm.package[2].checked==false))
	{
		alert("Please select any one package");	
		return false;
	}
	if((document.sch_userfrm.package[0].checked==true))
	{
		if(document.sch_userfrm.open_month.value=="0")
		{
			alert("Select the month");	
			document.sch_userfrm.open_month.focus();			
			return false;
			
		}
		if(document.sch_userfrm.open_week.value=="N/A")
		{
			alert("Select the week");	
			document.sch_userfrm.open_week.focus();			
			return false;
			
		}
	}
	
	if((document.sch_userfrm.package[1].checked==true)||(document.sch_userfrm.package[2].checked==true))
	{
		
		if(document.sch_userfrm.open_month.value=="0")
		{
			alert("Select the month");	
			document.sch_userfrm.open_month.focus();			
			return false;
			
		}
		if(document.sch_userfrm.open_week.value=="N/A")
		{
			alert("Select the week");	
			document.sch_userfrm.open_week.focus();			
			return false;
			
		}
		if(document.sch_userfrm.close_month.value=="N/A")
		{
			alert("Select the month");	
			document.sch_userfrm.close_month.focus();
			return false;
			
		}
		if(document.sch_userfrm.close_week.value=="N/A")
		{
			alert("Select the week");	
			document.sch_userfrm.close_week.focus();			
			return false;
			
		}
		
		if(document.sch_userfrm.trm.checked==false)
		{
			alert("Please check the Terms and Conditions");
			document.sch_userfrm.trm.focus();
			return false;
		}
	}
	return true;
}

