function emptyvalidation(entered, alertbox)
{
with (entered)
{
if (value==null || value=="" || value==0)
{if (alertbox!="") {alert(alertbox);} return false;}
else {return true;}
}
} 
function chkboxchked()
{
	for(i=1; i <= 7; i++)
	{
	 var cb = document.getElementById("Interests"+i);
	
	 if(cb.checked)
		 return true;
	}
	
	return false;
}
function isChecked(radioObj) {
	if(!radioObj)
		return -1;
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return 1;
		else
			return -1;
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return 1;
		}
	}
	return -1;
}
function emailvalidation(entered, alertbox)
{
with (entered)
{
apos=value.indexOf("@"); 
dotpos=value.lastIndexOf(".");
lastpos=value.length-1;
if (apos<1 || dotpos-apos<2 || lastpos-dotpos>3 || lastpos-dotpos<2) 
{if (alertbox) {alert(alertbox);} return false;}
else {return true;}
}
} 


function phonevalidation(entered, alertbox)
{
with (entered)
{
if (isNaN(value))
{if (alertbox!="") {alert(alertbox);} return false;}
else {return true;}
}
} 




function formvalidation(thisform)
{
		with (thisform)
		{
				if (emptyvalidation(fname,"Error ! Please type in your First Name !")==false) {fname.focus(); document.getElementById('fname').className='txtfieldstyle error';return false;}
				if (emptyvalidation(country,"Error ! Please type in your Country !")==false) {country.focus(); document.getElementById('country').className='txtfieldstyle error'; return false;}
				if (emptyvalidation(email_add,"Error ! Please type in your Email Address !")==false) {email_add.focus(); document.getElementById('email_add').className='txtfieldstyle error'; return false;}
				if (emailvalidation(email_add,"Error ! Please provide with your valid Email Address !")==false) {email_add.focus(); document.getElementById('email_add').className='txtfieldstyle error'; return false;}
				if (emptyvalidation(telphone,"Error ! Please type in Phone Number !")==false) {telphone.focus(); document.getElementById('telphone').className='txtfieldstyle error'; return false;}
				if (emptyvalidation(no_person,"Error ! Please type in Number of Persons !")==false) {no_person.focus(); document.getElementById('no_person').className='txtfieldstyle error'; return false;}
				if (emptyvalidation(arrival_date,"Error ! Please type in Arrival Date !")==false) {arrival_date.focus(); document.getElementById('arrival_date').className='txtfieldstyle error'; return false;}
				if (emptyvalidation(departure_date,"Error ! Please type in Arrival Date !")==false) {departure_date.focus(); document.getElementById('departure_date').className='txtfieldstyle error'; return false;}
				if (emptyvalidation(vechile_type,"Error ! Please type in type of vechile !")==false) {vechile_type.focus(); document.getElementById('vechile_type').className='txtfieldstyle error'; return false;}
				if (emptyvalidation(cboperson_no,"Error ! Please type in no of persons in your group !")==false) {cboperson_no.focus(); document.getElementById('cboperson_no').className='txtfieldstyle error'; return false;}
				else
				{
					document.inquiry.submit();
				}
		}
}

function formvalidation1(thisform)
{
	with (thisform)
	{
		if (emailvalidation(fren_email,"Error ! Please provide with your valid Email Address !")==false) {
			fren_email.focus(); 

			//document.getElementById('fren_email').className='txtfieldstyle error';
			return false;
		}
		else
		{
			document.recommend.submit();
		}
	}
}
function formvalidation2(thisform)
{
	with (thisform)
	{
		if (emptyvalidation(name,"Error ! Please type in your First Name !")==false) 
		{
			name.focus(); 
			//document.getElementById('name').className='txtfieldstyle error';
			return false;
			}
		if (emailvalidation(email_add,"Error ! Please provide with your valid Email Address !")==false) {
			email_add.focus(); 

			//document.getElementById('email_add').className='txtfieldstyle error';
			return false;
		}
		if (emailvalidation(short_msg,"Error ! Please Provide Message !")==false) {
			short_msg.focus(); 

			//document.getElementById('email_add').className='txtfieldstyle error';
			return false;
		}
		
		
		else
		{
			document.mailinglist.submit();
		}
	}
}
function formvalidation3(thisform)
{
	with (thisform)
	{
		if (emptyvalidation(program,"Error ! Please type in your tour program/code !")==false) 
			{
			program.focus(); 
			document.getElementById('program').className='txtfieldstyle error';
			return false;
			}
			
		if (isChecked(accom,"Error ! Please select one required accomodation !")==false) 
			{
			accom.focus(); 
			//document.getElementById('accom').className='txtfieldstyle error';
			return false;
			}
		if (emptyvalidation(full_name,"Error ! Please type in your full name !")==false) 
			{
			full_name.focus(); 
			document.getElementById('full_name').className='txtfieldstyle error';
			return false;
			}	
			if (emptyvalidation(mailing_add,"Error ! Please type in your Email Address !")==false) {email_add.focus(); document.getElementById('mailing_add').className='txtfieldstyle error'; return false;}
				if (emailvalidation(mailing_add,"Error ! Please provide with your valid Email Address !")==false) {mailing_add.focus(); document.getElementById('mailing_add').className='txtfieldstyle error'; return false;}
			if (emptyvalidation(cbocountry,"Error ! Please select country!")==false) 
			{
			cbocountry.focus(); 
			//document.getElementById('cbocountry').className='txtfieldstyle error';
			return false;
			}
		if (phonevalidation(phone,"Error ! Please type in valid phone no !")==false) 
			{
			phone.focus(); 
			document.getElementById('phone').className='txtfieldstyle error';
			return false;
			}
		if (isChecked(pickup,"Error ! Please select one mode of payment !")==false) 
			{
			pickup.focus(); 
			//document.getElementById('pickup').className='txtfieldstyle error';
			return false;
			}
		if (isChecked(mode_of_payment,"Error ! Please select one mode of payment !")==false) 
			{
			mode_of_payment.focus(); 
			//document.getElementById('mode_of_payment').className='txtfieldstyle error';
			return false;
			}

		else
		{
			document.book_now.submit();
		}
	}
}
function formvalidation4(thisform)
{
	with (thisform)
	{
		if (emptyvalidation(fname,"Error ! Please type in your First Name !")==false) 
		{
			fname.focus(); 			
			return false;
		}	
		if (emptyvalidation(email,"Error ! Please type in your Email Address!")==false) 
		{
			email.focus(); 			
			return false;
		}		
		if (emptyvalidation(comments,"Error ! Please provide with your comments !")==false) {
			comments.focus(); 
			return false;
		}		
		if (emailvalidation(email,"Error ! Please provide with your valid Email Address !")==false) {
			email.focus(); 
			return false;
		}		
		else
		{
			document.feedback.submit();
		}
	}
}
function vechile_enquiryformvalidation(thisform)
{
		with (thisform)
		{
				if (emptyvalidation(fname,"Error ! Please type in your First Name !")==false) {fname.focus(); document.getElementById('fname').className='txtfieldstyle error';return false;}
				
				if (emptyvalidation(email_add,"Error ! Please type in your Email Address !")==false) {email_add.focus(); document.getElementById('email_add').className='txtfieldstyle error'; return false;}
				if (emailvalidation(email_add,"Error ! Please provide with your valid Email Address !")==false) {email_add.focus(); document.getElementById('email_add').className='txtfieldstyle error'; return false;}				
				if (emptyvalidation(telphone,"Error ! Please type in Phone Number !")==false) {telphone.focus(); document.getElementById('telphone').className='txtfieldstyle error'; return false;}				
				if (emptyvalidation(vechile_type,"Error ! Please type in type of vechile !")==false) {vechile_type.focus(); document.getElementById('vechile_type').className='txtfieldstyle error'; return false;}
				if (emptyvalidation(cboperson_no,"Error ! Please type in no of persons in your group !")==false) {cboperson_no.focus(); document.getElementById('cboperson_no').className='txtfieldstyle error'; return false;}
				else
				{
					document.inquiry.submit();
				}
		}
}
function airticket_booking(thisform)
{
		with (thisform)
		{

				if (emptyvalidation(email_phone,"Error ! Please type in your Email Address or Phone No !")==false) {email_phone.focus(); document.getElementById('email_phone').className='txtfieldstyle error'; return false;}						
				if (emptyvalidation(flight_date,"Error ! Please provide with Flight Date !")==false) {flight_date.focus(); document.getElementById('flight_date').className='txtfieldstyle error'; return false;}				
				if (emptyvalidation(origin,"Error ! Please type in the place travelling from !")==false) {origin.focus(); document.getElementById('origin').className='txtfieldstyle error'; return false;}
				if (emptyvalidation(destination,"Error ! Please type in the place travelling to!")==false) {destination.focus(); document.getElementById('destination').className='txtfieldstyle error'; return false;}
				else
				{
					document.airreservation.submit();
				}
		}
}
