function validate()
{


	if(document.form1.name.value=="")
	{
		alert("Please enter your name");
		document.form1.name.focus();
		return false;
	}
	
	if(document.form1.dphone.value=="")
	{
		alert("Please enter your day time phone number(Please include area code)");
		document.form1.dphone.focus();
		return false;
	}
	
			if(document.form1.dphone.value.match(/[^0-9]/))
			{
			alert("Please enter numbers only");
			document.form1.dphone.focus();
			return false;
			}
	
	if(document.form1.email.value=="")
	{
		alert("Please enter your email address");
		document.form1.email.focus();
		return false;
	}
	
	var emailID=document.form1.email
	if ((emailID.value==null)||(emailID.value==""))
	{
	alert("Please enter your email address")
	emailID.focus()
	return false
	}
	if(echeck(emailID.value)==false)
	{
	emailID.value=""
	emailID.focus()
	return false
	}
	
	
	if(document.form1.address.value=="")
	{
		alert("Please enter your property address");
		document.form1.address.focus();
		return false;
	}
	
	
	if(document.form1.zip.value=="")
	{
		alert("Please enter your zip");
		document.form1.zip.focus();
		return false;
	}
	
			if(document.form1.zip.value.match(/[^0-9]/))
			{
			alert("Please enter numbers only");
			document.form1.zip.focus();
			return false;
			}
			
	alert("THANK YOU !!! We will be contacting you by phone within the next 48 hours. Have a great day! ");
	
}

function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Email address is not valid")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Email address is not valid")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr-1){
		    alert("Email address is not valid")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Email address is not valid")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Email address is not valid")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Email address is not valid")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Email address is not valid")
		    return false
	     }
}
	function clearDefault(el)
	 {
 		 if (el.defaultValue==el.value) el.value = ""
	 }