var mylocation = window.location;
var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December")

var mydate=new Date()
var year=mydate.getYear()

if (year < 1000)
year+=1900

var day=mydate.getDay()
var month=mydate.getMonth()

var daym=mydate.getDate()
if (daym<10)
daym="0"+daym
var hours=mydate.getHours()
var minutes=mydate.getMinutes()
var seconds=mydate.getSeconds()
var dn="AM"
if (hours>=12)
dn="PM"
if (hours>12){
hours=hours-12
}
if (hours==0)
hours=12
if (minutes<=9)
minutes="0"+minutes
if (seconds<=9)
seconds="0"+seconds

var dateVal = daym + "-" + montharray[month] + "-" + year
var rtflg=true;
var pkflg=true;
var retmn = 0;
var pickmn = 0;

/* -------------------------------------- Validation Functions Begin ---------------------------------------*/

function validateGeneralQry(form)				//Validates General Query
{
var v=allblanksGeneral(form)
isGeneralQryQuery(form)
isGeneralQryChildren(form)
isGeneralQryAdults(form)
isGeneralQryDaysInHands(form)
isGeneralQryTentArrival(form)
isGeneralQryPhone(form)
isGeneralQryCityCode(form)
isGeneralQryCountryCode(form)
isGeneralQryCountry(form)
isGeneralQryEmail(form)
isGeneralQryName(form)
if( v == true)
	{
		v=confirm("Have You entered \nthe information Correctly !!");
	}
return v;
}

function allblanksGeneral(form) {
if( (isGeneralQryName(form) && isGeneralQryEmail(form)) && (isGeneralQryCountry(form) && isGeneralQryCountryCode(form)) && (isGeneralQryCityCode(form) && isGeneralQryPhone(form)) && (isGeneralQryTentArrival(form)&& isGeneralQryDaysInHands(form)) && ( isGeneralQryAdults(form) && isGeneralQryChildren(form)) && isGeneralQryQuery(form) ) {
 return true ;
}
if( (isGeneralQryName(form) == false) || (isGeneralQryEmail(form) == false) || (isGeneralQryCountry(form) == false) || (isGeneralQryCountryCode(form) == false) || (isGeneralQryCityCode(form) == false) || (isGeneralQryPhone(form) == false) || (isGeneralQryTentArrival(form) == false) || (isGeneralQryDaysInHands(form) == false) || (isGeneralQryAdults(form)== false) || (isGeneralQryChildren(form) == false) || (isGeneralQryQuery(form) == false) ) {
composeGeneral(form);
return false ;
   }
}
function composeGeneral(form) {
var text = " You entered incorrectly or forgot to fill in ::\n"	
if(isGeneralQryName(form) == false) {
text += "\nYour Name -- must be purely alphabetic"
}
if(isGeneralQryEmail(form) == false) {
text += "\nYour E-mail -- improper/incomplete e-mail ID"
}
if(isGeneralQryCountry(form) == false) {
text += "\nYour Country of Residence -- not selected yet"
}
if(isGeneralQryCountryCode(form) == false) {
text += "\nCountry Code for Phone -- should be number or blank"
}
if(isGeneralQryCityCode(form) == false) {
text += "\nArea Code for Phone -- should be a number or blank"
}
if(isGeneralQryPhone(form) == false) {
text += "\nPhone Number -- should be number or blank"
}
if(isGeneralQryTentArrival(form) == false) {
text += "\nTentative Date for Trip -- cannot be earlier than today"
}
if(isGeneralQryDaysInHands(form) == false) {
text += "\nDays in Hand -- should be a number or blank"
}
if(isGeneralQryAdults(form) == false) {
text += "\nNo. of Adults travelling -- should be a number or blank"
}
if(isGeneralQryChildren(form) == false) {
text += "\nNo. of Children travelling -- should be a number or blank"
}
if(isGeneralQryQuery(form) == false) {
text += "\nTopic Comments/Query -- should atleast be a line or blank"
}
alert(text)
}

//FOR NAME
function isGeneralQryName(form) {
if (trim(form.txtName.value) == "") {
form.txtName.focus();
return false;
}
else {
		form.txtName.value=trim(form.txtName.value);
	    if(checkforchar(form.txtName.value)==0)
		   {
			form.txtName.focus();
			return(false);
			}
		return true ;
   }
}

//FOR EMAIL
function isGeneralQryEmail(form) {
if (trim(form.txtEmail.value)== "")
	{
		form.txtEmail.focus();
		return false; // because  it is not optional 
	}
else
	{
		var eid=form.txtEmail.value=trim(form.txtEmail.value);
		if (eid.indexOf(' ')!= -1)
			{
			form.txtEmail.focus();
			return false ; // no spaces
			} 
		if (eid.length < 6 ){
			form.txtEmail.focus();
			return false ; // at least j.a@in
			}
		at=eid.indexOf('@', 0); //check from first position ---- 
		if ( at == -1 || at == 0){ //should not be at first place
			form.txtEmail.focus();
			return false ;
			}
		else
			{
				var at1=eid.indexOf('@', (at + 1)); //looking for another at one place ahead
				if ( at1 == -1 ) // ie only one at is there
				{
					var dot=eid.indexOf('.',(at + 1));//looking for just next value
					if(dot == (at + 1)|| dot== -1){ //if dot is not there or in the next place
						form.txtEmail.focus();
						return false ;	
						}
					else
						{
						 if ( (dot + 2 ) < eid.length )
							return true ;
						 else
						    {
							form.txtEmail.focus();
							return false ;
							}
						}
				}
				else // two @ are there
				{
				form.txtEmail.focus();
				return false;
				}
			}	
	form.txtEmail.focus();
	return false ;
	}		
}

//for country of residence
function isGeneralQryCountry(form)
{
 if(form.selCountry.value == "NA")
	{
	 form.selCountry.focus(); 
	 return false; //presently not used
	} 
 else
   return true;  
 }

//FOR PHONE
function isGeneralQryPhone(form) {
if (trim(form.txtPhone.value) == "") {
form.txtPhone.value=trim(form.txtPhone.value);
return true   //because it is optional
}
else {
			form.txtPhone.value=trim(form.txtPhone.value);
	     if(checkfornum(form.txtPhone.value)==0)
		   {
			form.txtPhone.focus();
			return(false);
			}
return true
   }
}

//FOR CITY CODE OF PHONE

function isGeneralQryCityCode(form) {
if (trim(form.txtCityCode.value) == "") {
form.txtCityCode.value=trim(form.txtCityCode.value);
return true   //because it is optional
}
else {
			form.txtCityCode.value=trim(form.txtCityCode.value);
	     if(checkfornum(form.txtCityCode.value)==0)
		   {
			form.txtCityCode.focus();
			return(false);
			}
return true
   }
}

//for country code of phone
function isGeneralQryCountryCode(form) {
	if (trim(form.txtCityCode.value) == "") {
	form.txtCountryCode.value = trim(form.txtCountryCode.value);
	return true   //because it is optional
	}
	else {
			form.txtCityCode.value=trim(form.txtCityCode.value);
		    if(checkfornum(form.txtCountryCode.value)==0)
			{
				form.txtCountryCode.focus();
				return false;
			}
		return true;
	}
}

//FOR No. of Adults
function isGeneralQryAdults(form) {
if (trim(form.txtAdults.value) == "") {
//form.adults.value=trim(form.adults.value);
//form.adults.focus();
return(true);   //because it is optional
}
else {
			//form.adults.value=trim(form.adults.value);
	     if(checkfornum(form.txtAdults.value)==0)
		   {
			form.txtAdults.focus();
			return(false);
			}
return true
   }
}

//FOR No. of Children if any
function isGeneralQryChildren(form) {
if (trim(form.txtChildren.value) == "" ) { //since children are optional so it doesn't include checkforzero
form.txtChildren.value=trim(form.txtChildren.value);
return(true); //because it is optional
}
else {
			form.txtChildren.value=trim(form.txtChildren.value);
	     if(checkfornum(form.txtChildren.value)==0)
		   {
			form.txtChildren.focus();
			return(false);
			}
return true
   }
}

//FOR Days in hands
function isGeneralQryDaysInHands(form) {
if (trim(form.txtDaysInHand.value) == "") {
//form.hands.value=trim(form.hands.value);
//form.hands.focus();
return(true);   //because it is optional
}
else {
			form.txtDaysInHand.value=trim(form.txtDaysInHand.value);
	     if(checkfornum(form.txtDaysInHand.value)==0)
		   {
			form.txtDaysInHand.focus();
			return(false);
			}
return true
   }
}

function isGeneralQryTentArrival(form)
{
	if ((form.selTentMonth.value == "NA") || (form.selTentDate.value == "NA") || (form.selTentYear.value == "NA"))
	{
		if(form.selTentMonth.value == "NA")
			form.selTentMonth.focus()
			return false;
		if(form.selTentDate.value == "NA")
			form.selTentDate.focus()
			return false;  
		if(form.selTentYear.value == "NA")
			form.selTentYear.focus()
			return false;
	}
	else{
		if (isGeneralQryTentDate(form)==false)
		{
			return false;
		}
		else
			return true;
	}
}

function isGeneralQryTentDate(form)
{
	for(i=0;i<=montharray.length;i++)
	{
		if (montharray[i]==form.selTentMonth.value)
		{
			dgt=i;
			break;
		}
	}
	//alert(dgt)
if(form.selTentYear.value < year)
{
	//alert("Invalid date. It must be a future date.");
	pkflg = false;
	form.selTentYear.focus(); 
	return false; //presently  used
 } 
 else
	{
		if((form.selTentYear.value == year) && (dgt < month))
		{
			//alert("Invalid date. It must be a future date.");
			pkflg = false;
			form.selTentMonth.focus();
			return false;
		}
		else
		{
			if((form.selTentYear.value == year) && (dgt == month))
			{
				if (form.selTentDate.value < daym)
				{
				//alert("Invalid date. It must be a future date.");
				pkflg = false;
				form.selTentDate.focus();
				return false;
				}
				else
					return true;
			}
		}
	}
 }

 //FOR Query
function isGeneralQryQuery(form) {
form.txaQuery.value=trim(form.txaQuery.value);
if (trim(form.txaQuery.value) == "") {
//form.txaQuery.focus();
return true;
}
else {
			
	     if(checkfornum(form.txaQuery.value)==1)// i. e, it is a pure number that is invalid
		   {
			form.txaQuery.focus();
			return(false);
			}
		qry=trim(form.txaQuery.value);
		if(qry.length <= 6 )// if it is too short
			{
			 form.txaQuery.focus();
			 return(false);
			}	
return true ;
   }
}


function validateAirQry(form)			//Validates Air txaQuery
{
var v=allblanksAir(form)
//isAirQryQuery(form)
isAirQryPax(form)
isAirQryTravel(form)
isAirQryCityTo(form)
isAirQryCountryTo(form)
isAirQryCityFrom(form)
isAirQryCountryFrom(form)
isAirQryPhone(form)
isAirQryCityCode(form)
isAirQryCountryCode(form)
isAirQryCountry(form)
isAirQryEmail(form)
isAirQryName(form)
if( v == true)
	{
		v=confirm("Have You entered \nthe information Correctly !!");
	}
return v;
}

function allblanksAir(form) {
if( (isAirQryName(form) && isAirQryEmail(form)) && ( isAirQryCountry(form) && isAirQryCountryCode(form)) && ( isAirQryCityCode(form) && isAirQryPhone(form)) && ( isAirQryCountryTo(form) && isAirQryCountryFrom(form)) && ( isAirQryCityTo(form) && isAirQryCityFrom(form))  && ( isAirQryTravel(form) && isAirQryPax(form))  &&  isAirQryQuery(form)) {
 return true ;
}
if( (isAirQryName(form) == false ) || ( isAirQryEmail(form) == false || isAirQryCountry(form)==false ) || ( isAirQryCountryCode(form) == false || isAirQryCityCode(form)==false )  || ( isAirQryPhone(form) == false || isAirQryCountryTo(form)==false ) || ( isAirQryCountryFrom(form) == false || isAirQryCityTo(form)==false ) || ( isAirQryCityFrom(form) == false || isAirQryTravel(form)==false ) || ( isAirQryPax(form) == false || isAirQryQuery(form)==false )) {
composeAir(form);
return false ;
   }
}

function composeAir(form) {
var text = " You entered incorrectly or forgot to fill in ::\n"	
if(isAirQryName(form) == false) {
text += "\nYour Name -- must be purely alphabetic"
}
if(isAirQryEmail(form) == false) {
text += "\nYour E-mail -- improper/incomplete e-mail ID"
}
if(isAirQryCountry(form) == false) {
text += "\nYour Country of Residence -- not selected yet"
}
if((isAirQryCountryCode(form) == false) || (isAirQryCityCode(form) == false) || (isAirQryPhone(form) == false) ) {
text += "\nTelephone Number -- should be a number "
}
if(isAirQryCountryFrom(form) == false) {
text += "\nFlying from Country -- not selected yet"
}
if(isAirQryCityFrom(form) == false) {
text += "\nFlying from City -- must be purely alphabetic"
}
if(isAirQryCountryTo(form) == false) {
text += "\nFlying to Country -- not selected yet"
}
if(isAirQryCityTo(form) == false) {
text += "\nFlying to City -- must be purely alphabetic"
}
if(isAirQryTravel(form) == false) {
text += "\nDate of Travel -- not selected yet"
}
if(isAirQryPax(form) == false) {
text += "\nNo. of Passengers -- should be a number"
}
if(isAirQryQuery(form) == false) {
text += "\nTopic Comments/Query -- should atleast be a line"
}
alert(text)
}

//for Travel Date
function isAirQryTravel(form)
{
 if((form.selDtArrival.value == "NA") || (form.selMtArrival.value == "NA") || (form.selYrArrival.value == "NA") ) {
	
	if(form.selYrArrival.value == "NA"){ 
	 form.selYrArrival.focus(); 
	}
	if(form.selMtArrival.value == "NA"){ 
	 form.selMtArrival.focus(); 
	}
	if(form.selDtArrival.value == "NA"){ 
	 form.selDtArrival.focus(); 
	}
		 return false; //presently  used
 } 
 else
   return true;  
 }

//For Passengers

function isAirQryPax(form) {
if (trim(form.txtPassenger.value) == "") {
form.txtPassenger.value=trim(form.txtPassenger.value);
form.txtPassenger.focus();
return false;   //because it is not optional
}
else {
			form.txtPassenger.value=trim(form.txtPassenger.value);
	     if(checkfornum(form.txtPassenger.value)==0)
		   {
			form.txtPassenger.focus();
			return(false);
			}
return true
   }
}

//FOR City flying to
function isAirQryCityTo(form) {
if (trim(form.txtFlyingToCity.value) == "") {
form.txtFlyingToCity.focus();
return false ;
}
else {
			form.txtFlyingToCity.value=trim(form.txtFlyingToCity.value);
	     if(checkforchar(form.txtFlyingToCity.value)==0)
		   {
			form.txtFlyingToCity.focus();
			return(false);
			}
return true ;
   }
}

//FOR City flying from
function isAirQryCityFrom(form) {
if (trim(form.txtFlyingFromCity.value) == "") {
form.txtFlyingFromCity.focus();
return false ;
}
else {
			form.txtFlyingFromCity.value=trim(form.txtFlyingFromCity.value);
	     if(checkforchar(form.txtFlyingFromCity.value)==0)
		   {
			form.txtFlyingFromCity.focus();
			return(false);
			}
return true ;
   }
}

//for country of residence used at present
function isAirQryCountry(form)
{
 if(form.selCountry.value == "NA")
	{
	 form.selCountry.focus(); 
	 return false; //presently  used
	} 
 else
   return true;  
 }
//for country of residence - Country flying to
function isAirQryCountryTo(form)
{
 if(form.selFlyingToCountry.value == "NA")
	{
	 form.selFlyingToCountry.focus(); 
	 return false; //presently  used
	} 
 else
   return true;  
 }
//for country of residence - Country flying from
function isAirQryCountryFrom(form)
{
 if(form.selFlyingFromCountry.value == "NA")
	{
	 form.selFlyingFromCountry.focus(); 
	 return false; //presently  used
	} 
 else
   return true;  
 }
//FOR EMAIL
function isAirQryEmail(form) {
if (trim(form.txtEmail.value)== "")
	{
		form.txtEmail.focus();
		return false; // because  it is not optional 
	}
else
	{
		var eid=form.txtEmail.value=trim(form.txtEmail.value);
		if (eid.indexOf(' ')!= -1)
			{
			form.txtEmail.focus();
			return false ; // no spaces
			} 
		if (eid.length < 6 ){
			form.txtEmail.focus();
			return false ; // at least j.a@in
			}
		at=eid.indexOf('@', 0); //check from first position ---- 
		if ( at == -1 || at == 0){ //should not be at first place
			form.txtEmail.focus();
			return false ;
			}
		else
			{
				var at1=eid.indexOf('@', (at + 1)); //looking for another at one place ahead
				if ( at1 == -1 ) // ie only one at is there
				{
					var dot=eid.indexOf('.',(at + 1));//looking for just next value
					if(dot == (at + 1)|| dot== -1){ //if dot is not there or in the next place
						form.txtEmail.focus();
						return false ;	
						}
					else
						{
						 if ( (dot + 2 ) < eid.length )
							return true ;
						 else
						    {
							form.txtEmail.focus();
							return false ;
							}
						}
				}
				else // two @ are there
				{
				form.txtEmail.focus();
				return false;
				}
			}	
	form.txtEmail.focus();
	return false ;
	}		

}
//FOR PHONE

function isAirQryPhone(form) {
if (trim(form.txtPhone.value) == "") {
form.txtPhone.value=trim(form.txtPhone.value);
form.txtPhone.focus();
return(false);  //because it is not optional
}
else {
			form.txtPhone.value=trim(form.txtPhone.value);
	     if(checkfornum(form.txtPhone.value)==0)
		   {
			form.txtPhone.focus();
			return(false);
			}
return true
   }
}
//FOR CITY CODE OF PHONE

function isAirQryCityCode(form) {
if (trim(form.txtCityCode.value) == "") {
form.txtCityCode.value=trim(form.txtCityCode.value);
form.txtCityCode.focus();
return(false);   //because it is not optional
}
else {
			form.txtCityCode.value=trim(form.txtCityCode.value);
	     if(checkfornum(form.txtCityCode.value)==0)
		   {
			form.txtCityCode.focus();
			return(false);
			}
return true
   }
}

//for country code of phone
function isAirQryCountryCode(form) {
if (trim(form.txtCountryCode.value) == "") {
form.txtCountryCode.value=trim(form.txtCountryCode.value);
form.txtCountryCode.focus();
return false   //because it is not optional
}
else {
		form.txtCountryCode.value=trim(form.txtCountryCode.value);
	     if(checkfornum(form.txtCountryCode.value)==0)
		   {
			form.txtCountryCode.focus();
			return(false);
			}
return true
   }
}
//FOR Query
function isAirQryQuery(form) {
form.txaQuery.value=trim(form.txaQuery.value);
if (trim(form.txaQuery.value) == "") {
form.txaQuery.focus();
return false;
}
else {
			
	     if(checkfornum(form.txaQuery.value)==1)// i. e, it is a pure number that is invalid
		   {
			form.txaQuery.focus();
			return(false);
			}
		qry=trim(form.txaQuery.value);
		if(qry.length <= 6 )// if it is too short
			{
			 form.txaQuery.focus();
			 return(false);
			}	
return true ;
   }
}

//FOR NAME
function isAirQryName(form) {
if (trim(form.txtName.value) == "") {
form.txtName.focus();
return false ;
}
else {
			form.txtName.value=trim(form.txtName.value);
	     if(checkforchar(form.txtName.value)==0)
		   {
			form.txtName.focus();
			return(false);
			}
return true ;
   }
}


function validateCarQry(form)			// Validates Car txaQuery
{
//prompt("jas val = "+form+"\n");
var v=allblanksCarQry(form)
//isCarQryQuery(form)
isCarQryRet(form)
isCarQryPick(form)
isCarQryPlace(form)
isCarQryCar(form)
isCarQryCountry(form)
isCarQryPhone(form)
isCarQryCityCode(form)
isCarQryCountryCode(form)
isCarQryAddress(form) 
isCarQryEmail(form)
isCarQryName(form)

if( v == true)
	{
		v=confirm("Have You entered \nthe information Correctly !!");
	}
return v;
}

function allblanksCarQry(form) {
if(isCarQryPlace(form) && (isCarQryRet(form) && isCarQryPick(form)) && (isCarQryAddress(form) && isCarQryCar(form)) && (isCarQryName(form) && isCarQryEmail(form)) && (isCarQryCountryCode(form) && isCarQryCityCode(form) && isCarQryPhone(form)) &&(isCarQryCountry(form) && isCarQryQuery(form)) ) {
 return true ;
}
if((isCarQryPlace(form) == false) || (isCarQryCountryCode(form) == false || isCarQryCityCode(form) == false || isCarQryPhone(form) == false) || (isCarQryRet(form) == false || isCarQryPick(form) == false )  || (isCarQryAddress(form) == false || isCarQryCar(form) == false )  || (isCarQryName(form) == false || isCarQryEmail(form) == false ) || ( isCarQryCountry(form) == false || isCarQryQuery(form)==false ) ) {
composeCarQry(form);
return false ;
   }
}
function composeCarQry(form) {
var text = " You entered incorrectly or forgot to fill in ::\n"	
if(isCarQryName(form) == false) {
text += "\nYour Name -- must be purely alphabetic"
}
if(isCarQryEmail(form) == false) {
text += "\nYour E-mail -- improper/incomplete e-mail ID"
}
if(isCarQryAddress(form) == false) {
text += "\nYour Address -- should atleast be a line"
}
if(isCarQryCountry(form) == false) {
text += "\nYour Country of Residence -- not selected yet"
}
if(isCarQryCar(form) == false) {
text += "\nYour Car Preference -- not selected yet"
}
if(isCarQryCountryCode(form) == false || isCarQryCityCode(form) == false || isCarQryPhone(form) == false) {
text += "\nYour Telephone number -- must be purely numeric"
}
if(isCarQryPlace(form) == false) {
text += "\nYour Car Picking Place -- can't be blank"
}
if(isCarQryPick(form) == false) {
text += "\nYour Car Picking Date -- not selected yet"
}
if(isCarQryRet(form) == false) {
text += "\nYour Car Returning Date -- not selected yet"
}
if(isCarQryQuery(form) == false) {
text += "\nComments/Query -- should atleast be a line"
}
alert(text)
}

//for country of residence
function isCarQryCountry(form)
{
 if(form.selCountry.value == "NA")
	{
	 form.selCountry.focus(); 
	 return false;
	} 
 else
   return true;  
 }

 //for car of preference
function isCarQryCar(form)
{
 if(form.selCarPref.value == "NA")
	{
	 form.selCarPref.focus(); 
	 return false;
	} 
 else
   return true;  
 }

//FOR EMAIL
function isCarQryEmail(form) {
if (trim(form.txtEmail.value)== "")
	{
		form.txtEmail.focus();
		return false; // because  it is not optional 
	}
else
	{
		var eid=form.txtEmail.value=trim(form.txtEmail.value);
		if (eid.indexOf(' ')!= -1)
			{
			form.txtEmail.focus();
			return false ; // no spaces
			} 
		if (eid.length < 6 ){
			form.txtEmail.focus();
			return false ; // at least j.a@in
			}
		at=eid.indexOf('@', 0); //check from first position ---- 
		if ( at == -1 || at == 0){ //should not be at first place
			form.txtEmail.focus();
			return false ;
			}
		else
			{
				var at1=eid.indexOf('@', (at + 1)); //looking for another at one place ahead
				if ( at1 == -1 ) // ie only one at is there
				{
					var dot=eid.indexOf('.',(at + 1));//looking for just next value
					if(dot == (at + 1)|| dot== -1){ //if dot is not there or in the next place
						form.txtEmail.focus();
						return false ;	
						}
					else
						{
						 if ( (dot + 2 ) < eid.length )
							return true ;
						 else
						    {
							form.txtEmail.focus();
							return false ;
							}
						}
				}
				else // two @ are there
				{
				form.txtEmail.focus();
				return false;
				}
			}	
	form.txtEmail.focus();
	return false ;
	}		

}
//FOR Query
function isCarQryQuery(form) {
form.txaQuery.value=trim(form.txaQuery.value);
if (trim(form.txaQuery.value) == "") {
form.txaQuery.focus();
return false;
}
else {
			
	     if(checkfornum(form.txaQuery.value)==1)// i. e, it is a pure number that is invalid
		   {
			form.txaQuery.focus();
			return(false);
			}
		qry=trim(form.txaQuery.value);
		if(qry.length <= 6 )// if it is too short
			{
			 form.txaQuery.focus();
			 return(false);
			}	
return true ;
   }
}
//FOR Picking Place
function isCarQryPlace(form) {
form.txtCarPickPlace.value=trim(form.txtCarPickPlace.value);
if (trim(form.txtCarPickPlace.value) == "") {
form.txtCarPickPlace.focus();
return false;
}
else {
			
	     if(checkfornum(form.txtCarPickPlace.value)==1)// i. e, it is a pure number that is invalid
		   {
			form.txtCarPickPlace.focus();
			return(false);
			}
		qry=trim(form.txtCarPickPlace.value);
		if(qry.length <= 4 )// if it is too short
			{
			 form.txtCarPickPlace.focus();
			 return(false);
			}	
return true ;
   }
}

//FOR Address
function isCarQryAddress(form) {
form.txaAddress.value=trim(form.txaAddress.value);
if (trim(form.txaAddress.value) == "") {
form.txaAddress.focus();//compulsory
return false;
}
else {
		if(checkfornum(form.txaAddress.value)==1)// i. e, it is a pure number that is invalid
		   {
			form.txaAddress.focus();
			return(false);
			}
		qry=trim(form.txaAddress.value);
		if(qry.length <= 10 )// if it is too short
			{
			 form.txaAddress.focus();
			 return(false);
			}	
return true ;
   }
}

//FOR NAME
function isCarQryName(form) {
if (trim(form.txtName.value) == "") {
form.txtName.focus();
return false ;
}
else {
			form.txtName.value=trim(form.txtName.value);
	     if(checkforchar(form.txtName.value)==0)
		   {
			form.txtName.focus();
			return(false);
			}
return true ;
   }
}
//FOR PHONE

function isCarQryPhone(form) {
if (trim(form.txtPhone.value) == "") {
form.txtPhone.value=trim(form.txtPhone.value);
form.txtPhone.focus();
return(false);  //because it is not optional
}
else {
			form.txtPhone.value=trim(form.txtPhone.value);
	     if(checkfornum(form.txtPhone.value)==0)
		   {
			form.txtPhone.focus();
			return(false);
			}
return true
   }
}
//FOR CITY CODE OF PHONE

function isCarQryCityCode(form) {
if (trim(form.txtCityCode.value) == "") {
form.txtCityCode.value=trim(form.txtCityCode.value);
form.txtCityCode.focus();
return(false);   //because it is not optional
}
else {
			form.txtCityCode.value=trim(form.txtCityCode.value);
	     if(checkfornum(form.txtCityCode.value)==0)
		   {
			form.txtCityCode.focus();
			return(false);
			}
return true
   }
}

//for country code of phone
function isCarQryCountryCode(form) {
if (trim(form.txtCountryCode.value) == "") {
form.txtCountryCode.value=trim(form.txtCountryCode.value);
form.txtCountryCode.focus();
return false   //because it is not optional
}
else {
		form.txtCountryCode.value=trim(form.txtCountryCode.value);
	     if(checkfornum(form.txtCountryCode.value)==0)
		   {
			form.txtCountryCode.focus();
			return(false);
			}
return true
   }
}
//for Picking Date
function isCarQryPick(form)
{
 if((form.selPickDate.value == "NA") || (form.selPickMonth.value == "NA") || (form.selPickYear.value == "NA") ) {
	
	if(form.selPickYear.value == "NA"){ 
	 form.selPickYear.focus(); 
	}
	if(form.selPickDate.value == "NA"){ 
	 form.selPickDate.focus(); 
	}
	if(form.selPickMonth.value == "NA"){ 
	 form.selPickMonth.focus(); 
	}
		 return false; //presently  used
 } 
 else
   return true;  
 }

//for Returning Date
function isCarQryRet(form)
{
 if((form.selRetDate.value == "NA") || (form.selRetMonth.value == "NA") || (form.selRetYear.value == "NA") ) {
	
	if(form.selRetYear.value == "NA"){ 
	 form.selRetYear.focus(); 
	}
	if(form.selRetDate.value == "NA"){ 
	 form.selRetDate.focus(); 
	}
	if(form.selRetMonth.value == "NA"){ 
	 form.selRetMonth.focus(); 
	}
		 return false; //presently  used
 } 
 else
   return true;  
 }

function validateHotelQry(form) {				//Validates Hotel Query
var v=allblanksHotel(form)
isHotelQryQuery(form)
isHotelQryCheckOut(form)
isHotelQryCheckIn(form)
isHotelQryCity(form)
isHotelQryCountry(form)
isHotelQryEmail(form)
isHotelQryName(form)
if( v == true)
	{
		v=confirm("Have You entered \nthe information Correctly !!");
	}
return v;
}

function allblanksHotel(form) {
if((isHotelQryName(form) && isHotelQryEmail(form)) && (isHotelQryCountry(form) && isHotelQryCity(form)) && (isHotelQryCheckIn(form) && isHotelQryCheckOut(form)) && isHotelQryQuery(form)) {
 return true ;
}
if((isHotelQryName(form) == false || isHotelQryEmail(form) == false) || (isHotelQryCountry(form) == false || isHotelQryCity(form) == false) || (isHotelQryCheckIn(form) && isHotelQryCheckOut(form)) || isHotelQryQuery(form)==false) {
composeHotel(form);
return false ;
   }
}
function composeHotel(form) {
var text = " You entered incorrectly or forgot to fill in ::\n"	
if(isHotelQryName(form) == false) {
text += "\nYour Name -- must be purely alphabetic"
}
if(isHotelQryEmail(form) == false) {
text += "\nYour E-mail -- improper/incomplete e-mail ID"
}
if(isHotelQryCountry(form) == false) {
text += "\nYour Country of Residence -- not selected yet"
}
if(isHotelQryCity(form) == false) {
text += "\nHotel Required at -- must be purely alphabetic"
}
if(isHotelQryCheckIn(form) == false) {
text += "\nCheck In Date -- cannot be earlier than today"
}
if(isHotelQryCheckOut(form) == false) {
text += "\nCheck Out Date -- cannot be earlier than check out date"
}
if(isHotelQryQuery(form) == false) {
text += "\nComments/Query -- should atleast be a line"
}
alert(text)
}

//for country of residence
function isHotelQryCountry(form)
{
 if(form.selCountry.value == "NA")
	{
	 form.selCountry.focus(); 
	 return false; //presently used
	} 
 else
   return true;  
 }
//FOR EMAIL
function isHotelQryEmail(form) {
if (trim(form.txtEmail.value)== "")
	{
		form.txtEmail.focus();
		return false; // because  it is not optional 
	}
else
	{
		var eid=form.txtEmail.value=trim(form.txtEmail.value);
		if (eid.indexOf(' ')!= -1)
			{
			form.txtEmail.focus();
			return false ; // no spaces
			} 
		if (eid.length < 6 ){
			form.txtEmail.focus();
			return false ; // at least j.a@in
			}
		at=eid.indexOf('@', 0); //check from first position ---- 
		if ( at == -1 || at == 0){ //should not be at first place
			form.txtEmail.focus();
			return false ;
			}
		else
			{
				var at1=eid.indexOf('@', (at + 1)); //looking for another at one place ahead
				if ( at1 == -1 ) // ie only one at is there
				{
					var dot=eid.indexOf('.',(at + 1));//looking for just next value
					if(dot == (at + 1)|| dot== -1){ //if dot is not there or in the next place
						form.txtEmail.focus();
						return false ;	
						}
					else
						{
						 if ( (dot + 2 ) < eid.length )
							return true ;
						 else
						    {
							form.txtEmail.focus();
							return false ;
							}
						}
				}
				else // two @ are there
				{
				form.txtEmail.focus();
				return false;
				}
			}	
	form.txtEmail.focus();
	return false ;
	}		

}
//FOR Query
function isHotelQryQuery(form) {
form.txaQuery.value=trim(form.txaQuery.value);
if (trim(form.txaQuery.value) == "") {
form.txaQuery.focus();
return false;
}
else {
			
	     if(checkfornum(form.txaQuery.value)==1)// i. e, it is a pure number that is invalid
		   {
			form.txaQuery.focus();
			return(false);
			}
		qry=trim(form.txaQuery.value);
		if(qry.length <= 6 )// if it is too short
			{
			 form.txaQuery.focus();
			 return(false);
			}	
return true ;
   }
}


//FOR CITY
function isHotelQryCity(form) {
if (trim(form.txtReqCity.value) == "") {
form.txtReqCity.focus();
return false ;
}
else {
			form.txtReqCity.value=trim(form.txtReqCity.value);
	     if(checkforchar(form.txtReqCity.value)==0)
		   {
			form.txtReqCity.focus();
			return(false);
			}
return true ;
   }
}

//FOR NAME
function isHotelQryName(form) {
if (trim(form.txtName.value) == "") {
form.txtName.focus();
return false ;
}
else {
			form.txtName.value=trim(form.txtName.value);
	     if(checkforchar(form.txtName.value)==0)
		   {
			form.txtName.focus();
			return(false);
			}
return true ;
   }
}
function isHotelQryCheckIn(form)
{
	if ((form.selINMonth.value== "NA") || (form.selINDate.value== "NA") || (form.selINYear.value== "NA"))
	{
		if(form.selINMonth.value== "NA")
			form.selINMonth.focus()
			return false;
		if(form.selINDate.value== "NA")
			form.selINDate.focus()
			return false;  
		if(form.selINYear.value== "NA")
			form.selINYear.focus()
			return false;
	}
	else{
		if (isHotelQryArrDate(form)==false)
		{
			return false;
		}
		else
			return true;
	}
}

function isHotelQryArrDate(form)
{
	for(i=0;i<=montharray.length;i++)
	{
		if (montharray[i]==form.selINMonth.value)
		{
			dgt=i;
			break;
		}
	}
	//alert(dgt)
if(form.selINYear.value < year)
{
	//alert("Invalid date. It must be a future date.");
	pkflg = false;
	form.selINYear.focus(); 
	return false; //presently  used
 } 
 else
	{
		if((form.selINYear.value == year) && (dgt < month))
		{
			//alert("Invalid date. It must be a future date.");
			pkflg = false;
			form.selINMonth.focus();
			return false;
		}
		else
		{
			if((form.selINYear.value == year) && (dgt == month))
			{
				if (form.selINDate.value < daym)
				{
				//alert("Invalid date. It must be a future date.");
				pkflg = false;
				form.selINDate.focus();
				return false;
				}
				else
					return true;
			}
		}
	}
 }
 function isHotelQryCheckOut(form)
{
	if ((form.selOUTMonth.value== "NA") || (form.selOUTDate.value== "NA") || (form.selOUTYear.value== "NA"))
	{
		return true;
		//if(form.selOUTMonth.value== "NA")
			//form.selOUTMonth.focus()
			//return false;
		//if(form.selOUTDate.value== "NA")
			//form.selOUTDate.focus()
			//return false;  
		//if(form.selOUTYear.value== "NA")
			//form.selOUTYear.focus()
			//return false;
	}
	else{
		if (isHotelQryRetDate(form)==false)
		{
			return false;
		}
		else
			return true;
	}
}

function isHotelQryRetDate(form)
{
	if(form.selOUTYear.value < form.selINYear.value)
	{
		//alert("1")
		//alert("Return Date cannot be Earlier than Picking Date");
		rtflg = false;
		form.selOUTYear.focus(); 
		return false; //presently  used
	}
	else
	{
		for(i=0;i<=montharray.length;i++)
		{
			if (montharray[i]==form.selOUTMonth.value)
			{
				retmn=i+1;
				break;
			}
		}
		for(i=0;i<=montharray.length;i++)
		{
			if (montharray[i]==form.selINMonth.value)
			{
				pickmn=i+1;
				break;
			}
		}
		//alert(retmn)
		//alert(pickmn)
		if((form.selOUTYear.value == form.selINYear.value) && (retmn < pickmn))
		{
			//alert("2")
			//alert("Return Date cannot be Earlier than Picking Date");
			rtflg = false;
			form.selOUTMonth.focus();
			return false;
		}
		else
		{
			if((form.selOUTYear.value == form.selINYear.value) && (retmn == pickmn))
			{
				//alert("hello")
				//alert(form.selOutDate.value)
				//alert(form.d_arrival.value)
				if (parseInt(form.selOUTDate.value) < parseInt(form.selINDate.value))
				{
					//alert("3")
					//alert("Return Date cannot be Earlier than Picking Date");
					rtflg = false;
					form.selOUTDate.focus();
					return false;
				}
				else
					return true;
			}
		}
	}
 }
 function validateSpecificHotelQry(form) {				//Validates Hotel Query
var v=allblanksSpecificHotel(form)
isSpecificHotelQryQuery(form)
isSpecificHotelQryCheckOut(form)
isSpecificHotelQryCheckIn(form)
isSpecificHotelQryCountry(form)
isSpecificHotelQryEmail(form)
isSpecificHotelQryName(form)
if( v == true)
	{
		v=confirm("Have You entered \nthe information Correctly !!");
	}
return v;
}

function allblanksSpecificHotel(form) {
if((isSpecificHotelQryName(form) && isSpecificHotelQryEmail(form)) && (isSpecificHotelQryCountry(form)) && (isSpecificHotelQryCheckIn(form) && isSpecificHotelQryCheckOut(form)) && isSpecificHotelQryQuery(form)) {
 return true ;
}
if((isSpecificHotelQryName(form) == false || isSpecificHotelQryEmail(form) == false) || (isSpecificHotelQryCountry(form) == false ) || (isSpecificHotelQryCheckIn(form) && isSpecificHotelQryCheckOut(form)) || isSpecificHotelQryQuery(form)==false) {
composeSpecificHotel(form);
return false ;
   }
}
function composeSpecificHotel(form) {
var text = " You entered incorrectly or forgot to fill in ::\n"	
if(isSpecificHotelQryName(form) == false) {
text += "\nYour Name -- must be purely alphabetic"
}
if(isSpecificHotelQryEmail(form) == false) {
text += "\nYour E-mail -- improper/incomplete e-mail ID"
}
if(isSpecificHotelQryCountry(form) == false) {
text += "\nYour Country of Residence -- not selected yet"
}
if(isSpecificHotelQryCheckIn(form) == false) {
text += "\nCheck In Date -- cannot be earlier than today"
}
if(isSpecificHotelQryCheckOut(form) == false) {
text += "\nCheck Out Date -- cannot be earlier than check out date"
}
if(isSpecificHotelQryQuery(form) == false) {
text += "\nComments/Query -- should atleast be a line"
}
alert(text)
}

//for country of residence
function isSpecificHotelQryCountry(form)
{
 if(form.selCountry.value == "NA")
	{
	 form.selCountry.focus(); 
	 return false; //presently used
	} 
 else
   return true;  
 }
//FOR EMAIL
function isSpecificHotelQryEmail(form) {
if (trim(form.txtEmail.value)== "")
	{
		form.txtEmail.focus();
		return false; // because  it is not optional 
	}
else
	{
		var eid=form.txtEmail.value=trim(form.txtEmail.value);
		if (eid.indexOf(' ')!= -1)
			{
			form.txtEmail.focus();
			return false ; // no spaces
			} 
		if (eid.length < 6 ){
			form.txtEmail.focus();
			return false ; // at least j.a@in
			}
		at=eid.indexOf('@', 0); //check from first position ---- 
		if ( at == -1 || at == 0){ //should not be at first place
			form.txtEmail.focus();
			return false ;
			}
		else
			{
				var at1=eid.indexOf('@', (at + 1)); //looking for another at one place ahead
				if ( at1 == -1 ) // ie only one at is there
				{
					var dot=eid.indexOf('.',(at + 1));//looking for just next value
					if(dot == (at + 1)|| dot== -1){ //if dot is not there or in the next place
						form.txtEmail.focus();
						return false ;	
						}
					else
						{
						 if ( (dot + 2 ) < eid.length )
							return true ;
						 else
						    {
							form.txtEmail.focus();
							return false ;
							}
						}
				}
				else // two @ are there
				{
				form.txtEmail.focus();
				return false;
				}
			}	
	form.txtEmail.focus();
	return false ;
	}		

}
//FOR Query
function isSpecificHotelQryQuery(form) {
form.txaQuery.value=trim(form.txaQuery.value);
if (trim(form.txaQuery.value) == "") {
form.txaQuery.focus();
return false;
}
else {
			
	     if(checkfornum(form.txaQuery.value)==1)// i. e, it is a pure number that is invalid
		   {
			form.txaQuery.focus();
			return(false);
			}
		qry=trim(form.txaQuery.value);
		if(qry.length <= 6 )// if it is too short
			{
			 form.txaQuery.focus();
			 return(false);
			}	
return true ;
   }
}

//FOR NAME
function isSpecificHotelQryName(form) {
if (trim(form.txtName.value) == "") {
form.txtName.focus();
return false ;
}
else {
			form.txtName.value=trim(form.txtName.value);
	     if(checkforchar(form.txtName.value)==0)
		   {
			form.txtName.focus();
			return(false);
			}
return true ;
   }
}
function isSpecificHotelQryCheckIn(form)
{
	if ((form.selINMonth.value== "NA") || (form.selINDate.value== "NA") || (form.selINYear.value== "NA"))
	{
		if(form.selINMonth.value== "NA")
			form.selINMonth.focus()
			return false;
		if(form.selINDate.value== "NA")
			form.selINDate.focus()
			return false;  
		if(form.selINYear.value== "NA")
			form.selINYear.focus()
			return false;
	}
	else{
		if (isSpecificHotelQryArrDate(form)==false)
		{
			return false;
		}
		else
			return true;
	}
}

function isSpecificHotelQryArrDate(form)
{
	for(i=0;i<=montharray.length;i++)
	{
		if (montharray[i]==form.selINMonth.value)
		{
			dgt=i;
			break;
		}
	}
	//alert(dgt)
if(form.selINYear.value < year)
{
	//alert("Invalid date. It must be a future date.");
	pkflg = false;
	form.selINYear.focus(); 
	return false; //presently  used
 } 
 else
	{
		if((form.selINYear.value == year) && (dgt < month))
		{
			//alert("Invalid date. It must be a future date.");
			pkflg = false;
			form.selINMonth.focus();
			return false;
		}
		else
		{
			if((form.selINYear.value == year) && (dgt == month))
			{
				if (form.selINDate.value < daym)
				{
				//alert("Invalid date. It must be a future date.");
				pkflg = false;
				form.selINDate.focus();
				return false;
				}
				else
					return true;
			}
		}
	}
 }
 function isSpecificHotelQryCheckOut(form)
{
	if ((form.selOUTMonth.value== "NA") || (form.selOUTDate.value== "NA") || (form.selOUTYear.value== "NA"))
	{
		return true;
		//if(form.selOUTMonth.value== "NA")
			//form.selOUTMonth.focus()
			//return false;
		//if(form.selOUTDate.value== "NA")
			//form.selOUTDate.focus()
			//return false;  
		//if(form.selOUTYear.value== "NA")
			//form.selOUTYear.focus()
			//return false;
	}
	else{
		if (isHotelQryRetDate(form)==false)
		{
			return false;
		}
		else
			return true;
	}
}

function isSpecificHotelQryRetDate(form)
{
	if(form.selOUTYear.value < form.selINYear.value)
	{
		//alert("1")
		//alert("Return Date cannot be Earlier than Picking Date");
		rtflg = false;
		form.selOUTYear.focus(); 
		return false; //presently  used
	}
	else
	{
		for(i=0;i<=montharray.length;i++)
		{
			if (montharray[i]==form.selOUTMonth.value)
			{
				retmn=i+1;
				break;
			}
		}
		for(i=0;i<=montharray.length;i++)
		{
			if (montharray[i]==form.selINMonth.value)
			{
				pickmn=i+1;
				break;
			}
		}
		//alert(retmn)
		//alert(pickmn)
		if((form.selOUTYear.value == form.selINYear.value) && (retmn < pickmn))
		{
			//alert("2")
			//alert("Return Date cannot be Earlier than Picking Date");
			rtflg = false;
			form.selOUTMonth.focus();
			return false;
		}
		else
		{
			if((form.selOUTYear.value == form.selINYear.value) && (retmn == pickmn))
			{
				//alert("hello")
				//alert(form.selOutDate.value)
				//alert(form.d_arrival.value)
				if (parseInt(form.selOUTDate.value) < parseInt(form.selINDate.value))
				{
					//alert("3")
					//alert("Return Date cannot be Earlier than Picking Date");
					rtflg = false;
					form.selOUTDate.focus();
					return false;
				}
				else
					return true;
			}
		}
	}
 }
/* --------------------------------------- Common Functions --------------------------------------*/

//For Checking Name
function isName(form) 
{
	if (trim(form.txtName.value) == "") 
	{
		form.txtName.focus();
		return false ;
	}
	else 
	{
		form.txtName.value=trim(form.txtName.value);
	    if(checkforchar(form.txtName.value)==0)
		{
			form.txtName.focus();
			return(false);
		}
		return true ;
	}
}

// For Checking E-Mail
function isEmail(form) 
{
	if (trim(form.txtEmail.value)== "")
	{
		form.txtEmail.focus();
		return false; // because  it is not optional 
	}
	else
	{
		var eid=form.txtEmail.value=trim(form.txtEmail.value);
		if (eid.indexOf(' ')!= -1)
		{
			form.txtEmail.focus();
			return false ; // no spaces
		} 
		if (eid.length < 6 )
		{
			form.txtEmail.focus();
			return false ; // at least j.a@in
		}
		
		at=eid.indexOf('@', 0); //check from first position ---- 
		
		if ( at == -1 || at == 0)
		{						//should not be at first place
			form.txtEmail.focus();
			return false ;
		}
		else
		{
			var at1=eid.indexOf('@', (at + 1)); //looking for another at one place ahead
			if ( at1 == -1 ) // ie only one at is there
			{
				var dot=eid.indexOf('.',(at + 1));//looking for just next value
				if(dot == (at + 1)|| dot== -1)
				{ //if dot is not there or in the next place
					form.txtEmail.focus();
					return false ;	
				}
				else
				{
					if ( (dot + 2 ) < eid.length )
						return true ;
					else
					{
						form.txtEmail.focus();
						return false ;
					}
				}
			}
			else // two @ are there
			{
				form.txtEmail.focus();
				return false;
			}
		}	
	form.txtEmail.focus();
	return false ;
	}		
}

function trim(str1)
{
// This function trims any given field value for blank spaces.
        var intCtr=0
        for(intCtr=0;str1.charAt(intCtr)==" ";intCtr++);
        str1=str1.substring(intCtr,str1.length);
        return str1;    
}

function checkforchar(strdate)
{
//This function checks for string values
var validdate = "abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ";
	
	var strlength = strdate.length;
	for(var i=0; i<=strlength; i++)
	{
		var unitstr = strdate.substr(i,1);
		if (validdate.indexOf(unitstr)==-1)
		{
			return false;
		}
	}
	return true;
}

function checkfornum(str1) 
{
//This function checks for numeric values
	var numstr="1234567890 ,";
    var intctr,intLen;
    intLen=str1.length;
    for(intCtr=0;intCtr <= intLen && numstr.indexOf(str1.charAt(intCtr))>=0 ;intCtr++);
    if(intCtr > intLen)
    {
		return 1;
    }
    else
    {
    return 0;
    }
}


function GoBack() 
{ 
	history.back();   
}
				

				
//for country of residence
function isHotelCountry(form)
{
 if(form.txtcountry.value == "-")
	{
	 form.txtcountry.focus(); 
	 return false;
	} 
 else
   return true;  
 }

//FOR EMAIL
function isHotelEmail(form) {
if (trim(form.txtEmail.value)== "")
	{
		form.txtEmail.focus();
		return false; // because  it is not optional 
	}
else
	{
		var eid=form.txtEmail.value=trim(form.txtEmail.value);
		if (eid.indexOf(' ')!= -1)
			{
			form.txtEmail.focus();
			return false ; // no spaces
			} 
		if (eid.length < 6 ){
			form.txtEmail.focus();
			return false ; // at least j.a@in
			}
		at=eid.indexOf('@', 0); //check from first position ---- 
		if ( at == -1 || at == 0){ //should not be at first place
			form.txtEmail.focus();
			return false ;
			}
		else
			{
				var at1=eid.indexOf('@', (at + 1)); //looking for another at one place ahead
				if ( at1 == -1 ) // ie only one at is there
				{
					var dot=eid.indexOf('.',(at + 1));//looking for just next value
					if(dot == (at + 1)|| dot== -1){ //if dot is not there or in the next place
						form.txtEmail.focus();
						return false ;	
						}
					else
						{
						 if ( (dot + 2 ) < eid.length )
							return true ;
						 else
						    {
							form.txtEmail.focus();
							return false ;
							}
						}
				}
				else // two @ are there
				{
				form.txtEmail.focus();
				return false;
				}
			}	
	form.txtEmail.focus();
	return false ;
	}		

}
//FOR Query
function isHotelQuery(form) {
form.txaQuery.value=trim(form.txaQuery.value);
if (trim(form.txaQuery.value) == "") {
//form.txaQuery.focus();
return true;
}
else {
			
	     if(checkfornum(form.txaQuery.value)==1)// i. e, it is a pure number that is invalid
		   {
			form.txaQuery.focus();
			return(false);
			}
		qry=trim(form.txaQuery.value);
		if(qry.length <= 6 )// if it is too short
			{
			 form.txaQuery.focus();
			 return(false);
			}	
return true ;
   }
}


//FOR NAME
function isHotelName(form) {
if (trim(form.txtName.value) == "") {
form.txtName.focus();
return false ;
}
else {
			form.txtName.value=trim(form.txtName.value);
	     if(checkforchar(form.txtName.value)==0)
		   {
			form.txtName.focus();
			return(false);
			}
return true ;
   }
}

