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("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail ID")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail ID")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

 		 return true					
	}

	function validateBookFlight()
	{
	if (document.bookflight.trip.value== "")
		 {
		 alert("Please Select Flight !.");
		 document.bookflight.trip.focus();
		 return false;
		  }
	if (document.bookflight.flight_from.value== "")
		 {
		 alert("Please Input Leaving City !.");
		 document.bookflight.flight_from.focus();
		 return false;
		  }
	if (document.bookflight.flight_to.value== "")
		 {
		 alert("Please Input Destination City !.");
		 document.bookflight.flight_to.focus();
		 return false;
		  }
	if (document.bookflight.start_date.value== "")
		 {
		 alert("Please Input Departure Date !.");
		 document.bookflight.start_date.focus();
		 return false;
		  }
	if (document.bookflight.end_date.value== "")
		 {
		 alert("Please Input Return Date !.");
		 document.bookflight.end_date.focus();
		 return false;
		  }
	if (document.bookflight.class.value== "")
		 {
		 alert("Please Select Flight Class !.");
		 document.bookflight.class.focus();
		 return false;
		  }
	if (document.bookflight.passenger_num.value== "")
		 {
		 alert("Please Input Number Of Passengers !.");
		 document.bookflight.passenger_num.focus();
		 return false;
		  }
	if (document.bookflight.full_name.value== "")
		 {
		 alert("Please Input Full Name !.");
		 document.bookflight.full_name.focus();
		 return false;
		  }
	if (document.bookflight.phone.value== "")
		 {
		 alert("Please Input Phone !.");
		 document.bookflight.phone.focus();
		 return false;
		  }
	if (document.bookflight.email.value== "")
		 {
			 alert("Please Input Your Valid Email Address !");
			 document.bookflight.email.focus();
			 return false;
		 }
		 else
		 { 
			 if (echeck(document.bookflight.email.value)==false)
			 {
				document.bookflight.email.focus();
				return false;
			 }
		 }
	if (document.bookflight.city.value== "")
		 {
		 alert("Please Input Your City !.");
		 document.bookflight.city.focus();
		 return false;
		  }
	if (document.bookflight.message.value== "")
		 {
		 alert("Please Input Message !.");
		 document.bookflight.message.focus();
		 return false;
		  }		  
	if (document.bookflight.security_code.value== "")
		 {
		 alert("Please Input Security Code !.");
		 document.bookflight.security_code.focus();
		 return false;
		  }
	
	
		  
	return true;
	}  
