/*
##########################################################
#####     CREATED BY   : sunil kumar                ######
#####     CREATION DATE: 12/09/2008                 ######
#####     CODE BRIEFING: javascript file            ######
#####                                               ######
#####     COMPANY      : Binary SoftZone            ######
#####                                               ######
##########################################################
*/

//  this function checks the email format is correct or not
//  and return true or false accordingly.
	function is_email(email)
	{
		if(!email.match(/^[A-Za-z0-9\._\-+]+@[A-Za-z0-9_\-+]+(\.[A-Za-z0-9_\-+]+)+$/))
			return false;
		return true;
	}
// End of is_email Function

//--------------------- validation in helicopter yatra --------------------


function validate() 
{
      if(document.frmmail.name.value == "" ) {
		alert("Name can not be Blank !");
		document.frmmail.name.focus();
		return false;
	} if(document.frmmail.email.value == "" ) {
		alert("EmailID can not be Blank !");
		document.frmmail.email.focus();
		return false;
	} if(! is_email(document.frmmail.email.value)){
		alert("EmailID Should be valid format !");
		document.frmmail.email.value ="";
		document.frmmail.email.focus();
		return false;
	} if(document.frmmail.phone.value == "" ) {
		alert("Phone can not be Blank !");
		document.frmmail.phone.focus();
		return false;
	} if(document.frmmail.requirment.value == "" ) {
		alert("Requirement field can not be Blank !");
		document.frmmail.requirment.focus();
		return false;
	} 
    return true;
}

//--------------------- validation in helicopter yatra other form--------------------


function validation() 
{     
      if(document.form1.name.value == "" ) {
		alert("Name can not be Blank !");
		document.form1.name.focus();
		return false;
	} if(document.form1.country.value == "" ) {
		alert("Country can not be Blank !");
		document.form1.country.focus();
		return false;
	} if(document.form1.phone.value == "" ) {
		alert("Phone can not be Blank !");
		document.form1.phone.focus();
		return false;
	} if(document.form1.email.value == "" ) {
		alert("EmailID can not be Blank !");
		document.form1.email.focus();
		return false;
	} if(! is_email(document.form1.email.value)){
		alert("EmailID Should be valid format !");
		document.form1.email.value ="";
		document.form1.email.focus();
		return false;
	} if(document.form1.intended_month_year_of_visit.value == "" ) {
		alert("Tentative Date of Travel can not be Blank !");
		document.form1.intended_month_year_of_visit.focus();
		return false;
	} if(document.form1.requirment.value == "" ) {
		alert("Requirement can not be Blank !");
		document.form1.requirment.focus();
		return false;
	} 
    return true;
}
