function CheckForm()
{
	
	if (window.document.WEB2LEAD.lead_personfirstname.value=="")
	{
	alert("Please enter your Name!")
	window.document.WEB2LEAD.lead_personfirstname.focus();
	return false;	
	}
	if (window.document.WEB2LEAD.lead_personemail.value=="")
	{
	alert("Please enter your email! you@yourdomain.com")
	window.document.WEB2LEAD.lead_personemail.focus();
	return false;	
	}		
 if (echeck(window.document.WEB2LEAD.lead_personemail.value)==false){
		
		window.document.WEB2LEAD.lead_personemail.focus();
		return false;
	}
	
	if (document.WEB2LEAD.lead_personphonenumber.value=="")
	{
	alert("Please enter your Phone!")
	document.WEB2LEAD.lead_personphonenumber.focus();
	return (false);	
	}

	if (window.document.WEB2LEAD.lead_companycountry.value=="")
	{
	alert("Please enter your country!")
	window.document.WEB2LEAD.lead_companycountry.focus();
	return false;	
	}

	
    if (window.document.WEB2LEAD.lead_arrivaldt.value=="mm/dd/yyyy")
	{
	alert("Please enter your Arrival Day( DD/MM/YYYY)!")
	window.document.WEB2LEAD.lead_arrivaldt.focus();
	return false;	
	}
	
	if (window.document.WEB2LEAD.lead_depart.value=="mm/dd/yyyy")
	{
	alert("Please enter your Departue Day( DD/MM/YYYY)!")
	window.document.WEB2LEAD.lead_depart.focus();
	return false;	
	}
	
	if (window.document.WEB2LEAD.lead_adults.value=="")
	{
	alert("Please enter No. of Adults")
	window.document.WEB2LEAD.lead_adults.focus();
	return false;	
	}	
	if (window.document.WEB2LEAD.lead_othercity.value=="")
	{
	alert("Please enter citie you want to see!")
	window.document.WEB2LEAD.lead_othercity.focus();
	return false;	
	}
if (window.document.WEB2LEAD.lead_budget.value=="")
	{
	alert("Please enter your Budget!")
	window.document.WEB2LEAD.lead_budget.focus();
	return false;	
	}
	if (window.document.WEB2LEAD.lead_meal.value=="")
	{
	alert("Please select Your Meal Plan!")
	window.document.WEB2LEAD.lead_meal.focus();
	return false;	
	}
	if (window.document.WEB2LEAD.lead_rooms.value=="")
	{
	alert("Please enter No. of Rooms!")
	window.document.WEB2LEAD.lead_rooms.focus();
	return false;	
	}
	if (window.document.WEB2LEAD.lead_companycountry.value=="")
	{
	alert("Please enter your country!")
	window.document.WEB2LEAD.lead_companycountry.focus();
	return false;	
	}	
if (document.getElementById('t').value!=document.getElementById('hexn').value)
	{
	alert("Please enter correct code !")
	document.getElementById('t').focus();
	return false;	
	}
}

function echeck(str) {
//alert("lead_personemail is "+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("Please enter your email! you@yourdomain.com")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Please enter your email! you@yourdomain.com")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Please enter your email! you@yourdomain.com")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Please enter your email! you@yourdomain.com")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Please enter your email! you@yourdomain.com")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Please enter your email! you@yourdomain.com")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Please enter your email! you@yourdomain.com")
		    return false
		 }

 		 return true				
	}
