// JavaScript Document

function book_hotel(frm)
{
	
		error=false
		errormsg=""
		if(frm.name.value=="")
		{
			error=true
			errormsg+="\n\tPlease enter your Name\t\n"
		}
		
		if(frm.email.value=="")
		{
			error=true
			errormsg+="\n\tPlease enter your email address\t\n"
		}
	else
		{
			email=frm.email.value
			if(email.indexOf("@")==-1 || email.indexOf(".")==-1 || email.length<5)
				{
					error=true
					errormsg+="Please enter the proper email address..."
				}
		}
		if(frm.contactno.value=="")
		{
			error=true
			errormsg+="\n\tPlease enter your Contact No\t\n"
		}
		if(frm.fax.value=="")
		{
			error=true
			errormsg+="\n\tPlease enter your Fax\t\n"
		}
		if(frm.address.value=="")
		{
			error=true
			errormsg+="\n\tPlease enter your Address\t\n"
		}
		if(frm.city.value=="")
		{
			error=true
			errormsg+="\n\tPlease enter your City\t\n"
		}
		if(frm.state.value=="")
		{
			error=true
			errormsg+="\n\tPlease enter your State\t\n"
		}
		if(frm.country.value=="")
		{
			error=true
			errormsg+="\n\tPlease enter your Country\t\n"
		}
		if(frm.zip.value=="")
		{
			error=true
			errormsg+="\n\tPlease enter your Zip\t\n"
		}
		if(frm.datechkin.value=="")
		{
			error=true
			errormsg+="\n\tPlease enter your Check In Date\t\n"
		}
			if(frm.datechkout.value=="")
		{
			error=true
			errormsg+="\n\tPlease enter your Check Out Date\t\n"
		}
		if(frm.no_of_rooms.value=="")
		{
			error=true
			errormsg+="\n\tPlease enter No Of Rooms\t\n"
		}
		if(frm.adults.value=="")
		{
			error=true
			errormsg+="\n\tPlease enter No Of Persons\t\n"
		}
		
		if(frm.room_grade.value=="select")
		{
			error=true
			errormsg+="\n\tPlease select Room Grade\t\n"
		}
		if(frm.room_type.value=="select")
		{
			error=true
			errormsg+="\n\tPlease select Room Type\t\n"
		}
		if(frm.match_image.value!=frm.match_text.value)
			{
				errormsg+="\n\t Given String does not match..."
				error=true
			}
		if(error)	
		{
			alert(errormsg)
			return false
		}
}
function book_car(frm)
{
	
		error=false
		errormsg=""
		if(frm.name.value=="")
		{
			error=true
			errormsg+="\n\tPlease enter your Name\t\n"
		}
		
		if(frm.email.value=="")
		{
			error=true
			errormsg+="\n\tPlease enter your email address\t\n"
		}
	else
		{
			email=frm.email.value
			if(email.indexOf("@")==-1 || email.indexOf(".")==-1 || email.length<5)
				{
					error=true
					errormsg+="Please enter the proper email address..."
				}
		}
		if(frm.contactno.value=="")
		{
			error=true
			errormsg+="\n\tPlease enter your Contact No\t\n"
		}
		if(frm.fax.value=="")
		{
			error=true
			errormsg+="\n\tPlease enter your Fax\t\n"
		}
		if(frm.address.value=="")
		{
			error=true
			errormsg+="\n\tPlease enter your Address\t\n"
		}
		if(frm.city.value=="")
		{
			error=true
			errormsg+="\n\tPlease enter your City\t\n"
		}
		if(frm.state.value=="")
		{
			error=true
			errormsg+="\n\tPlease enter your State\t\n"
		}
		if(frm.country.value=="")
		{
			error=true
			errormsg+="\n\tPlease enter your Country\t\n"
		}
		if(frm.zip.value=="")
		{
			error=true
			errormsg+="\n\tPlease enter your Zip\t\n"
		}
		if(frm.car_cat.value=="Select Car Type")
		{
			error=true
			errormsg+="\n\tPlease enter your Car Category\t\n"
		}
			if(frm.car_type.value=="")
		{
			error=true
			errormsg+="\n\tPlease enter your Car Type\t\n"
		}
		if(frm.pickup_city.value=="")
		{
			error=true
			errormsg+="\n\tPlease enter your Pick Up City\t\n"
		}
		if(frm.drop_off_city.value=="")
		{
			error=true
			errormsg+="\n\tPlease enter your Drop Off City\t\n"
		}
		if(frm.datechkin.value=="")
		{
			error=true
			errormsg+="\n\tPlease enter your Required From Date\t\n"
		}
			if(frm.datechkout.value=="")
		{
			error=true
			errormsg+="\n\tPlease enter your Required Till Date\t\n"
		}
		if(frm.adults.value=="")
		{
			error=true
			errormsg+="\n\tPlease enter No Of Persons\t\n"
		}
		
		
		if(frm.match_image.value!=frm.match_text.value)
			{
				errormsg+="\n\t Given String does not match..."
				error=true
			}
		if(error)	
		{
			alert(errormsg)
			return false
		}
}
function book_tour(frm)
{
	
		error=false
		errormsg=""
		if(frm.name.value=="")
		{
			error=true
			errormsg+="\n\tPlease enter your Name\t\n"
		}
		
		if(frm.email.value=="")
		{
			error=true
			errormsg+="\n\tPlease enter your email address\t\n"
		}
	else
		{
			email=frm.email.value
			if(email.indexOf("@")==-1 || email.indexOf(".")==-1 || email.length<5)
				{
					error=true
					errormsg+="Please enter the proper email address..."
				}
		}
		if(frm.contactno.value=="")
		{
			error=true
			errormsg+="\n\tPlease enter your Contact No\t\n"
		}
		if(frm.fax.value=="")
		{
			error=true
			errormsg+="\n\tPlease enter your Fax\t\n"
		}
		if(frm.address.value=="")
		{
			error=true
			errormsg+="\n\tPlease enter your Address\t\n"
		}
		if(frm.city.value=="")
		{
			error=true
			errormsg+="\n\tPlease enter your City\t\n"
		}
		if(frm.state.value=="")
		{
			error=true
			errormsg+="\n\tPlease enter your State\t\n"
		}
		if(frm.country.value=="")
		{
			error=true
			errormsg+="\n\tPlease enter your Country\t\n"
		}
		if(frm.zip.value=="")
		{
			error=true
			errormsg+="\n\tPlease enter your Zip\t\n"
		}
		if(frm.hotel_type.value=="")
		{
			error=true
			errormsg+="\n\tPlease enter your Hotel Type\t\n"
		}
		if(frm.trans_type.value=="")
		{
			error=true
			errormsg+="\n\tPlease enter your Hotel Type\t\n"
		}
		if(frm.datechkin.value=="")
		{
			error=true
			errormsg+="\n\tPlease enter Date\t\n"
		}
			if(frm.datechkout.value=="")
		{
			error=true
			errormsg+="\n\tPlease enter Date\t\n"
		}
		if(frm.adults.value=="")
		{
			error=true
			errormsg+="\n\tPlease enter No Of Persons\t\n"
		}
		if(frm.match_image.value!=frm.match_text.value)
			{
				errormsg+="\n\t Given String does not match..."
				error=true
			}	
		
		if(error)	
		{
			alert(errormsg)
			return false
		}
}

function check_form(frm)
	{
		error=false
		errormsg=""
	if(frm.firstname.value=="")
		{
			error=true
			errormsg+="\n\tPlease enter your First name\t\n"
		}
		if(frm.lastname.value=="")
		{
			error=true
			errormsg+="\n\tPlease enter your Last name\t\n"
		}
		if(frm.telephone.value=="")
		{
			error=true
			errormsg+="\n\tPlease enter your Telephone No.\t\n"
		}
		
	if(frm.email.value=="")
		{
			error=true
			errormsg+="\n\tPlease enter your email address\t\n"
		}
	else
		{
			email=frm.email.value
			if(email.indexOf("@")==-1 || email.indexOf(".")==-1 || email.length<5)
				{
					error=true
					errormsg+="Please enter the proper email address..."
				}
		}
		if(frm.comments.value=="")
		{
			error=true
			errormsg+="\n\tPlease enter your enquiry...\t\n"
		}
		if(frm.match_image.value!=frm.match_text.value)
			{
				errormsg+="\n\t Given String does not match..."
				error=true
			}	
	
		
		
	if(error)	
		{
			alert(errormsg)
			return false
		}
		
	}

function same_as_above(frm)
	{
		frm.shippingaddress.value=frm.address.value
		frm.shippingcity.value=frm.city.value
		frm.shippingstate.value=frm.state.value
		frm.shippingcountry.value=frm.country.value		
		frm.shippingpostcode.value=frm.postcode.value				
		frm.shippingcounty.value=frm.county.value				
	}
function not_same_as_above(frm)
	{
		frm.shippingaddress.value=''
		frm.shippingcity.value=''
		frm.shippingstate.value=''
		frm.shippingcountry.value=''	
		frm.shippingpostcode.value=''				
		frm.shippingcounty.value=''
}	
function checkUserRegister(frm)
	{
		error=false
		errormsg="Following Errors Occurs while processing Registeration form..."
		firstname=frm.firstname.value
		lastname=frm.lastname.value
		address=frm.address.value
		city=frm.city.value
		country=frm.country.value
		postcode=frm.postcode.value
		phonenumber=frm.phonenumber.value
		emailaddress=frm.email.value
		shippingaddress=frm.shippingaddress.value
		shippingcity=frm.shippingcity.value
		shippingcountry=frm.shippingcountry.value
		shippingpostcode=frm.shippingpostcode.value
		password=frm.password.value
		password2=frm.password2.value	
		match_image=frm.match_image.value
		match_text=frm.match_text.value
		if(firstname=="")
			{
				errormsg+="\n\t First name is Empty..."
				error=true
			}
		if(lastname=="")
			{
				errormsg+="\n\t Last  name is Empty..."
				error=true
			}			
		if(address=="")
			{
				errormsg+="\n\t Address is Empty..."
				error=true
			}
		if(city=="")
			{
				errormsg+="\n\t City is Empty..."
				error=true
			}
		if(country=="")
			{
				errormsg+="\n\t Country is Empty..."
				error=true
			}			
		if(postcode=="")
			{
				errormsg+="\n\t Postcode is Empty..."
				error=true
			}
			
		if(phonenumber=="")
			{
				errormsg+="\n\t Phonenumber is Empty..."
				error=true
			}
				
		if(emailaddress=="")
			{
				errormsg+="\n\t Email Address is Empty..."
				error=true
			}			
		if(emailaddress.indexOf("@")==-1 || emailaddress.indexOf("@")==-1 || emailaddress.length<6)
			{
				errormsg+="\n\t Please enter Proper Email Address..."
				error=true
			}
		if(password=="" || password2=="")	
			{
				errormsg+=" \n\t Please enter the Passwords"
				error=true
			}
		if(password!=password2)	
			{
				errormsg+=" \n\t Passwords do not match..."
				error=true
			}			
		if(shippingaddress=="")
			{
				errormsg+="\n\t Shipping Address is Empty..."
				error=true
			}
		if(shippingcity=="")
			{
				errormsg+="\n\t Shipping City is Empty..."
				error=true
			}
		if(shippingcountry=="")
			{
				errormsg+="\n\t Shipping Country is Empty..."
				error=true
			}			
		if(shippingpostcode=="")
			{
				errormsg+="\n\t Shipping Postcode is Empty..."
				error=true
			}
		if(match_image!=match_text)
			{
				errormsg+="\n\t Given String does not match..."
				error=true
			}
		if(error)
			{
				alert(errormsg)
				return false
			}
		
}
function set(frm)
	{
		error=false
		errormsg=""
	
	if (frm.name.value=="")  {
			error=true
			errormsg+="\n\t Kindly enter your name."
	}
	if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(frm.email.value))) {
			error=true
			errormsg+="\n\t Invalid Email ID. Kindly enter the correct ID."
	}
	if (frm.address.value== "")  {
			error=true
			errormsg+="\n\t Kindly enter your address."
	}
	if (frm.city.value== "")  {
			error=true
			errormsg+="\n\t Kindly enter your city."
	}
	if (frm.state.value=="")  {
			error=true
			errormsg+="\n\t Kindly enter your state(county)."
	}
	if (frm.country.value=="")  {
			error=true
			errormsg+="\n\t Kindly enter your country."
	}
	if (frm.phonenumber.value=="")  {
			error=true
			errormsg+="\n\t Kindly enter your phone number."
	}
	if (frm.query.value=="")  {
			error=true
			errormsg+="\n\t Kindly enter your query."
	}
	if (frm.match_image.value!=frm.match_text.value)  {
			error=true
			errormsg+="\n\t Security Code does not match !."
	}
	if(error)	
		{
			alert(errormsg)
			return false
		}
}

function checkinstantmsg(frm)
{
	error=false
		errormsg=""
	if(frm.name.value=="")
		{
			error=true
			errormsg+="\n\tPlease enter your Name\t\n"
		}
		if(frm.email.value=="")
		{
			error=true
			errormsg+="\n\tPlease enter your Email\t\n"
		}
		if(frm.message.value=="")
		{
			error=true
			errormsg+="\n\tPlease enter your Message\t\n"
		}
		if(frm.random_string.value!=frm.match_string.value)
			{
				errormsg+="\n\t Given String does not match..."
				error=true
			}
		if(error)
			{
				alert(errormsg)
				return false
			}
}

function checkUserLogin(frm)	
	{
		user=frm.userid.value
		pass=frm.password.value
		
		if(user=="")
			{
				alert("Please Enter the User Id")
				frm.userid.focus()
				return false
			}
		if(user.indexOf("@")==-1 || user.indexOf(".")==-1 || user.length<6)
			{
				alert("\tPlease Enter the Proper User Id\n\tYour Email you enterted at time of registeration will be treated as your user id\n")
				frm.userid.value=""
				frm.userid.focus()
				return false
			}
		if(pass=="")
			{
				alert("Please Enter the Password")
				frm.password.focus()
				return false
			}			
	}
	
function random_string()
{
	var text_big = new Array("A", "B", "C", "D", "E", "F", "G", "H", "J", "K", "M", "N", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z");
	var text_no = new Array("2", "3", "4", "5", "6", "7", "8", "9");
	var text_symbol = new Array("#", "@", "%", "#");
	
		
	var text_big_length = text_big.length;
	var rnd_big = Math.round((text_big_length-1)*Math.random());
	var txt_big=text_big[rnd_big];
	
	var text_no_length = text_no.length;
	var rnd_no = Math.round((text_no_length-1)*Math.random());
	var txt_no=text_no[rnd_no];
	
	var text_symbol_length = text_symbol.length;
	var rnd_symbol = Math.round((text_symbol_length-1)*Math.random());
	var txt_symbol=text_symbol[rnd_symbol];
	
	var round_no=Math.round(Math.random(-10)*100);
	
	var random_number=txt_big+round_no+txt_symbol+txt_no;
	
	document.write('<input name="random_string" type="text" size="7" maxlength="6" class="body" value="'+random_number+'" readonly="True">');
}


function checkUserAddEnquiry(frm)
	{
		error=false
		errormsg="Following Errors Occurs while processing Enquiry form..."
		name=frm.name.value
		emailaddress=frm.email.value
		address=frm.address.value
		city=frm.city.value
		
		country=frm.country.value
		postcode=frm.postcode.value
		phonenumber=frm.phonenumber.value
		query=frm.query.value
		
		match_image=frm.match_image.value
		match_text=frm.match_text.value
		if(name=="")
			{
				errormsg+="\n\t Name is Empty..."
				error=true
			}
			if(emailaddress=="")
			{
				errormsg+="\n\t Email Address is Empty..."
				error=true
			}	
				
		if(address=="")
			{
				errormsg+="\n\t Address is Empty..."
				error=true
			}
		if(city=="")
			{
				errormsg+="\n\t City is Empty..."
				error=true
			}
			
		if(country=="")
			{
				errormsg+="\n\t Country is Empty..."
				error=true
			}			
		if(postcode=="")
			{
				errormsg+="\n\t Postcode is Empty..."
				error=true
			}
			if(phonenumber=="")
			{
				errormsg+="\n\t Phone Number is Empty..."
				error=true
			}
			if(query=="")
			{
				errormsg+="\n\t Query is Empty..."
				error=true
			}

				
		if(emailaddress.indexOf("@")==-1 || emailaddress.indexOf("@")==-1 || emailaddress.length<6)
			{
				errormsg+="\n\t Please enter Proper Email Address..."
				error=true
			}
		
		if(match_image!=match_text)
			{
				errormsg+="\n\t Given String does not match..."
				error=true
			}
		if(error)
			{
				alert(errormsg)
				return false
			}
		
}

<!--  bookmark script

var os;
if(document.layers)
 os = "n4";
else if(document.getElementById&&!document.all)
 os = "n6";
else if(document.all)
 os = "ie";
function run()
{
 if(os == "ie"){
  document.getElementById('book').innerHTML='<a href="javascript:window.external.AddFavorite(\'http://www.jaipur-tour.com/\', \'http://www.jaipur-tour.com/\')" style="font-size:12px;color:#ffffff;font-family:verdana;"><img src="images/bookmark.jpg" alt="BOOKMARK " border=0><span style="background-color: seashell; font-size:10px;"></a>'
 }else{
  document.getElementById('book').innerHTML='<a href="javascript:window.sidebar.addPanel(\'http://www.jaipur-tour.com/\', \'http://www.jaipur-tour.com/\',\'\')" style="font-size:12px;color:#ffffff;font-family:verdana;"><img src="images/bookmark.jpg" alt="BOOKMARK " border=0><span style="background-color: seashell; font-size:10px;"></a>'
 }
 
}
	
function checklinkexchange(frm)
{
		error=false
		errormsg=""
	if(frm.name.value=="")
		{
			error=true
			errormsg+="\n\tPlease enter your Name\t\n"
			
		}
		
		if(frm.email.value=="")
		{
			error=true
			errormsg+="\n\tPlease enter your email address\t\n"
		}
	else
		{
			email=frm.email.value
			if(email.indexOf("@")==-1 || email.indexOf(".")==-1 || email.length<5)
				{
					error=true
					errormsg+="Please enter the proper email address..."
				}
		}
		if(frm.url_cust.value=="")
		{
			error=true
			errormsg+="\n\tPlease enter Url On which you apply our link exchange code\t\n"
			
		}
		if(frm.title.value=="")
		{
			error=true
			errormsg+="\n\tPlease enter Title of your code\t\n"
			
		}
		if(frm.description.value=="")
		{
			error=true
			errormsg+="\n\tPlease enter Description of your code\t\n"
			
		}
		if(frm.url.value=="")
		{
			error=true
			errormsg+="\n\tPlease enter Url of your site for link exchange\t\n"
			
		}
		if(frm.match_text.value!=frm.random_string.value)
	{
			error=true
			errormsg+="\n\tGiven String does not match...\t\n"
		
	}
		if(error)	
		{
			alert(errormsg)
			return false
		}
}
function show_form(frm)
{
		var text_small = new Array("MOUS.jpg", "HOPE.jpg", "AXEY.jpg", "WOXE.jpg", "BRVU.jpg", "AXMR.jpg", "BONE.jpg", "ARNM.jpg", "WCUQ.jpg", "RBJS.jpg", "NRHK.jpg", "SPQB.jpg", "WNXT.jpg", "ZRNQ.jpg", "SPWF.jpg", "AQXP.jpg", "ESLD.jpg", "HSAP.jpg", "XYWZ.jpg", "ISWR.jpg", "VIAR.jpg", "SPEN.jpg", "WXOB.jpg", "MDWX.jpg", "ZQAP.jpg", "RCYW.jpg", "MRDV.jpg", "QBTK.jpg", "AQXP.jpg", "ZRFK.jpg", "TREA.jpg", "MCRP.jpg", "BSRK.jpg", "AXQH.jpg", "WXPE.jpg", "NDRP.jpg","AYXZ.jpg","BLTD.jpg","XWOH.jpg");

	
	var text_small_length = text_small.length;
	var rnd_small = Math.round((text_small_length-1)*Math.random());
	
	var txt_small=text_small[rnd_small];
	
	var random_number=txt_small.substr(0,4);
		
	var round_no=Math.round(Math.random(-10)*100);
	var img_path="images/security/small/";
	var random_number_img=img_path+txt_small;
	
	
	document.getElementById('linkexchfrm').innerHTML='<form action="send_link_request.php" method="post" onSubmit="return checklinkexchange(this);"><table width="92%" border="0" class="solid3"><tr class="bg1"><td colspan="3" class="body21">Link Exchange Form </td></tr><tr><td width="33%" class="category">Name *</td><td width="5%" class="category">:</td><td width="62%"><input name="name" type="text" class="textfill" size="20" value=""/></td></tr><tr><td class="category">E-mail ID *</td><td class="category">:</td><td><input name="email" type="text" class="textfill" size="20" value=""/></td></tr><tr><td class="category">Url On which you apply our link exchange code *</td><td class="category">:</td><td><input name="url_cust" type="text" class="textfill" id="url_cust" size="20" value=""/></td></tr><tr><td class="category">Title *</td><td class="category">:</td><td><input name="title" type="text" class="textfill" id="title" size="20" value=""/></td></tr><tr><td class="category">Description *</td><td class="category">:</td><td><textarea name="description" cols="30" rows="3" class="textfill"></textarea></td></tr><tr><td class="category">Url of your site for link exchange *</td><td class="category">:</td><td><input name="url" type="text" class="textfill" id="url" size="20" value=""/></td></tr><tr><td class="category">Comments</td><td class="category">:</td><td><textarea name="comments" cols="30" rows="3" class="textfill"></textarea></td></tr><tr><td colspan="3"><div align="center"><img src="'+random_number_img+'" alt="Security Image" border="0" hspace="0" name="securityimage"><input name="random_string" type="hidden" size="5" maxlength="8" class="textfill" value="'+random_number+'" readonly="True"><span class="category" style="text-align:center;"> Match given text (Case Sensitive) </span><input name="match_text" type="text" class="textfill" size="7" /></div></td></tr><tr><td colspan="3"><input name="submit" type="submit" class="category" value="Send Request"></td></tr></table></form>'
}



