function show_form(file)
{
	var xmlHttp=null;
try
  {  // Firefox, Opera 8.0+, Safari  
  xmlHttp=new XMLHttpRequest(); 
  }
catch (e)
  {  // Internet Explorer  
  try
    {    
	xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");    
	}
  catch (e)
    {   
	try
      {     
	  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");      
	  }
    catch (e)
      {      
	  alert("Your browser does not support AJAX!");      
	  return false;      
	  }    
	  }  
	  }
	  url='form_car_booking.php';
	 if(file=='1')
	url='form_car_booking.php';
	if(file=='2')
	url='form_hotel_booking.php';
	if(file=='3')
	url='form_tour.php';
	
	
	document.getElementById('form_content').innerHTML='<img src="images/wait.gif" />';
	
	
  xmlHttp.open("get",url,true);
	xmlHttp.setRequestHeader("Cache-Control", "no-cache");
	xmlHttp.setRequestHeader("If-Modified-Since", "Thu, 1 Jan 1970 00:00:00 GMT");
 xmlHttp.send(null);
 
  xmlHttp.onreadystatechange=function()
    {
    if(xmlHttp.readyState==4)
      {
		  
      document.getElementById('form_content').innerHTML=xmlHttp.responseText;
      }
    }
	
	
	
}





function validate_car_booking(theForm)
{
	//Check name
	t=theForm.name;
	if(t.value==""){
	alert('Please Enter Your Name');
	t.focus();
	return false;
	}
	// check e-mail
	t = theForm.email.value;
	if( t == "your@company.com" || t == "" || t.indexOf("@") == -1 || t.indexOf(".") == -1 || t.indexOf(" ")!=-1 || t.length < 6 || t.indexOf("xyz.com") > 0 || t.indexOf("abc.com") > 0 || t.indexOf("jagatniwaspalace.com") > 0 ) {
		alert("Your Email seems to be invalid!");
		theForm.email.focus();
		return (false);
	}
	//Check country
	t=theForm.country;
	if(t.value==""){
	alert('Please Select Your country');
	t.focus();
	return false;
	}
	
	//Check phone
	t=theForm.phone;
	if(t.value==""){
	alert('Please Enter Your Phone Number');
	t.focus();
	return false;
	}
	
	
	//Check vehicle_type
	t=theForm.vehicle_type;
	if(t.value==""){
	alert('Please Select Your Vehicle Type');
	t.focus();
	return false;
	}
	
	//Check vehicle_type
	t1=theForm.Adult;
	t2=theForm.child;
	if(t1.value=="" && t2.value==""){
	alert('Please Enter Number Of Person');
	t1.focus();
	return false;
	}

	
	//Check luggage
	t=theForm.luggage;
	if(t.value==""){
	alert('Please Enter Luggage Number');
	t.focus();
	return false;
	}
	
	//Check pick up date
	t=theForm.pickup_date;
	if(t.value==""){
	alert('Please Select Pickup Date');
	t.focus();
	return false;
	}
	
	//Check city_pick
	t=theForm.city_pick;
	if(t.value==""){
	alert('Please Select Pickup City');
	t.focus();
	return false;
	}
	
	//Check dept date
	t=theForm.dept_date;
	if(t.value==""){
	alert('Please Select Departure Date');
	t.focus();
	return false;
	}
	
	//Check city_pick
	t=theForm.city_dept;
	if(t.value==""){
	alert('Please Select Departure City');
	t.focus();
	return false;
	}
	
	//Check tour plane
	t=theForm.message;
	if(t.value==""){
	alert('Please Enter Tour Plan');
	t.focus();
	return false;
	}


}


function validate_hotel_booking(theForm)
{
	//Check name
	t=theForm.name;
	if(t.value==""){
	alert('Please Enter Your Name');
	t.focus();
	return false;
	}
	// check e-mail
	t = theForm.email.value;
	if( t == "your@company.com" || t == "" || t.indexOf("@") == -1 || t.indexOf(".") == -1 || t.indexOf(" ")!=-1 || t.length < 6 || t.indexOf("xyz.com") > 0 || t.indexOf("abc.com") > 0 || t.indexOf("jagatniwaspalace.com") > 0 ) {
		alert("Your Email seems to be invalid!");
		theForm.email.focus();
		return (false);
	}
	//Check country
	t=theForm.country;
	if(t.value==""){
	alert('Please Select Your country');
	t.focus();
	return false;
	}
	
	//Check phone
	t=theForm.phone;
	if(t.value==""){
	alert('Please Enter Your Phone Number');
	t.focus();
	return false;
	}
	
	
	//Check hetel
	t=theForm.hotel_type;
	if(t.value==""){
	alert('Please Select Your Hotel Type');
	t.focus();
	return false;
	}
	
	//Check hetel
	t=theForm.room_type;
	if(t.value==""){
	alert('Please Select Your Room Type');
	t.focus();
	return false;
	}
	
	//Check hetel
	t=theForm.plan_type;
	if(t.value==""){
	alert('Please Select Your Plan Type');
	t.focus();
	return false;
	}
	
	//Check vehicle_type
	t1=theForm.Adult;
	t2=theForm.child;
	if(t1.value=="" && t2.value==""){
	alert('Please Enter Number Of Person');
	t1.focus();
	return false;
	}

	
	//Check pick up date
	t=theForm.pickup_date;
	if(t.value==""){
	alert('Please Select Pickup Date');
	t.focus();
	return false;
	}
	
	//Check dept date
	t=theForm.dept_date;
	if(t.value==""){
	alert('Please Select Departure Date');
	t.focus();
	return false;
	}
	

}

function validate_tour_booking(theForm)
{
	//Check name
	t=theForm.name;
	if(t.value==""){
	alert('Please Enter Your Name');
	t.focus();
	return false;
	}
	// check e-mail
	t = theForm.email.value;
	if( t == "your@company.com" || t == "" || t.indexOf("@") == -1 || t.indexOf(".") == -1 || t.indexOf(" ")!=-1 || t.length < 6 || t.indexOf("xyz.com") > 0 || t.indexOf("abc.com") > 0 || t.indexOf("jagatniwaspalace.com") > 0 ) {
		alert("Your Email seems to be invalid!");
		theForm.email.focus();
		return (false);
	}
	//Check country
	t=theForm.country;
	if(t.value==""){
	alert('Please Select Your country');
	t.focus();
	return false;
	}
	
	//Check phone
	t=theForm.phone;
	if(t.value==""){
	alert('Please Enter Your Phone Number');
	t.focus();
	return false;
	}
	
	
	//Check vehicle_type
	t=theForm.vehicle_type;
	if(t.value==""){
	alert('Please Select Your Vehicle Type');
	t.focus();
	return false;
	}
	
	//Check vehicle_type
	t1=theForm.Adult;
	t2=theForm.child;
	if(t1.value=="" && t2.value==""){
	alert('Please Enter Number Of Person');
	t1.focus();
	return false;
	}

	
	//Check luggage
	t=theForm.luggage;
	if(t.value==""){
	alert('Please Enter Luggage Number');
	t.focus();
	return false;
	}
	
	//Check pick up date
	t=theForm.pickup_date;
	if(t.value==""){
	alert('Please Select Pickup Date');
	t.focus();
	return false;
	}
	
	//Check city_pick
	t=theForm.city_pick;
	if(t.value==""){
	alert('Please Select Pickup City');
	t.focus();
	return false;
	}
	
	//Check dept date
	t=theForm.dept_date;
	if(t.value==""){
	alert('Please Select Departure Date');
	t.focus();
	return false;
	}
	
	//Check city_pick
	t=theForm.city_dept;
	if(t.value==""){
	alert('Please Select Departure City');
	t.focus();
	return false;
	}
	//Check hetel
	t=theForm.hotel_type;
	if(t.value==""){
	alert('Please Select Your Hotel Type');
	t.focus();
	return false;
	}
	
	//Check hetel
	t=theForm.room_type;
	if(t.value==""){
	alert('Please Select Your Room Type');
	t.focus();
	return false;
	}
	
	//Check hetel
	t=theForm.plan_type;
	if(t.value==""){
	alert('Please Select Your Plan Type');
	t.focus();
	return false;
	}	
	
	//Check tour plane
	t=theForm.message;
	if(t.value==""){
	alert('Please Enter Related Comments');
	t.focus();
	return false;
	}


}

function checkNumeric(e)
{	//With FireFox Support
	var KeyID = (window.event) ? event.keyCode : e.which;	
	//alert(KeyID);
	if((KeyID >= 48 && KeyID <= 57)  || (KeyID == 43) || (KeyID == 45)|| (KeyID == 8) || (KeyID == 32) || (KeyID == 37) || (KeyID == 39) || (KeyID == 46))
	{				
		return true;			
	}                       
	return false;
}
