var xmlHttp
var clientid="";
var tourid ="";
function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}


function ajax_child_ages(no_of_children)
{
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

var url;
url="getchildren.php?no_of_children="+no_of_children;
xmlHttp.onreadystatechange=stateChangedchild;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
} 


function stateChangedchild() 
{ 
if(xmlHttp.readyState==3)
{ 
document.getElementById("children_ages").innerHTML="Loading...";
}

if(xmlHttp.readyState==4)
{ 
document.getElementById("children_ages").innerHTML=xmlHttp.responseText;
document.getElementById("children_ages1").innerHTML=xmlHttp.responseText;

}
}



function iti_details(iti_des_id)
{

xmlHttp_object = GetXmlHttpObject();
xmlHttp_object_url = "get_iti_description.php?iti_des_id="+iti_des_id;
xmlHttp_object.onreadystatechange=stateChanged_object;
xmlHttp_object.open("GET",xmlHttp_object_url,true);
xmlHttp_object.send(null);

}
 


function stateChanged_object()
{

if(xmlHttp_object.readyState==1)
	{
	dd = document.getElementById("div_city_description");


	  
dd.style.display ="";

	}

if(xmlHttp_object.readyState==4)
	{
	document.getElementById("div_city_description").innerHTML = xmlHttp_object.responseText;


	}

}





   function HideContentitidiv(d) {


document.getElementById(d).style.display="none";

/*
Effect.SlideUp(d,{queue:{scope:'myscope', position:'end', limit: 1}});
*/

      }

 





function show_acc_div(acc_div_id)
{
for(i=1; i<=4 ; i++)
	{
	if(acc_div_id==i)
		{
		document.getElementById('div_iti_'+i).style.display = "";
		document.getElementById('td'+i).className="selectedtab";
		}
		else
		{

		document.getElementById('div_iti_'+i).style.display = "none";
		
		document.getElementById('td'+i).className="nonselectedtab";	
		
		}
	}
}



function show_form_div(form_div_id)
{
for(i=1; i<=2 ; i++)
	{
	if(form_div_id==i)
		{
		document.getElementById('div_form'+i).style.display = "";
		
		}
		else
		{

		document.getElementById('div_form'+i).style.display = "none";

		/*
		
		document.getElementById('td_form'+i).className="nonselectedthistour";

		document.getElementById('td_form'+i).rowSpan="1";


		*/
		
		}
	}
}


		var cX = 0; var cY = 0; var rX = 0; var rY = 0;

      function UpdateCursorPosition(e){ cX = e.pageX; cY = e.pageY;}

      function UpdateCursorPositionDocAll(e){ cX = event.clientX; cY = event.clientY;}

      if(document.all) { document.onmousemove = UpdateCursorPositionDocAll; }

      else { document.onmousemove = UpdateCursorPosition; }





      function AssignPosition(d) {
      if(self.pageYOffset) {

      rX = self.pageXOffset;

      rY = self.pageYOffset;

      }

      else if(document.documentElement && document.documentElement.scrollTop) {

      rX = document.documentElement.scrollLeft;

      rY = document.documentElement.scrollTop;

      }

      else if(document.body) {

      rX = document.body.scrollLeft;

      rY = document.body.scrollTop;

      }

      if(document.all) {

      cX += rX;

      cY += rY;

      }

      d.style.left = (cX-535) + "px";
      d.style.top = (cY-155) + "px";

      }

	   
	   function ShowContent(d,tour_id,selected_day) {

	selected_day = parseInt(selected_day)+1;
	
		d = "uniquename3"
		 var dd = document.getElementById(d);

         AssignPosition(dd);
		
	
		xmlHttp_show_schedule_day=GetXmlHttpObject(); 

		var url_city_list="show_day.php?tour_id="+tour_id+"&selected_day="+selected_day;
		
		xmlHttp_show_schedule_day.onreadystatechange=stateChanged_show_day;
		xmlHttp_show_schedule_day.open("GET",url_city_list,true);
		xmlHttp_show_schedule_day.send(null);

    
      }
	  

function stateChanged_show_day()
{
if (xmlHttp_show_schedule_day.readyState==1)
	{
	document.getElementById("uniquename3").innerHTML = "<div align='center'  ><img src='images/ajax-loader.gif' >"+
"</div>";
     document.getElementById("uniquename3").style.display = "";

	}

if (xmlHttp_show_schedule_day.readyState==4)
		{ 
	
		document.getElementById("uniquename3").innerHTML=xmlHttp_show_schedule_day.responseText;
		}


}


/***************************************************************************************************/

	   function ShowContent2(d,tour_id,selected_day,itinerary_id) {

	selected_day = parseInt(selected_day)+1;
	
		d = "uniquename3"
		 var dd = document.getElementById(d);

         AssignPosition(dd);
		
	
		xmlHttp_show_schedule_day=GetXmlHttpObject(); 

		var url_city_list="show_day2.php?tour_id="+tour_id+"&selected_day="+selected_day+"&itinerary_id="+itinerary_id;
		
		xmlHttp_show_schedule_day.onreadystatechange=stateChanged_show_day2;
		xmlHttp_show_schedule_day.open("GET",url_city_list,true);
		xmlHttp_show_schedule_day.send(null);

    
      }
	  

function stateChanged_show_day2()
{

if (xmlHttp_show_schedule_day.readyState==1)
		{ 
	document.getElementById("uniquename3").innerHTML = "<div align='center' ><img src='images/ajax-loader.gif' >"+
"</div>";
	document.getElementById("uniquename3").style.display = "";
		
		}

if (xmlHttp_show_schedule_day.readyState==4)
		{ 

		document.getElementById("uniquename3").innerHTML=xmlHttp_show_schedule_day.responseText;
		}


}

/******************************************************************************/

	     function HideContent(d) {

      if(d.length < 1) { return; }

      document.getElementById(d).style.display = "none";

      }

     



 function show_all_content(city_id) {

	
		d = "uniquename3"
		 var dd = document.getElementById(d);

         AssignPosition(dd);
		
	
		xmlHttp_show_schedule_day=GetXmlHttpObject(); 

		var url_city_list="show_all_day.php?city_id="+city_id;
		
		xmlHttp_show_schedule_day.onreadystatechange=stateChanged_show_all_day;
		xmlHttp_show_schedule_day.open("GET",url_city_list,true);
		xmlHttp_show_schedule_day.send(null);

    
      }



 function show_all_content2(itinerary_id,dep_date,city_id) {

	
		d = "uniquename3"
		 var dd = document.getElementById(d);

         AssignPosition(dd);
		
	
		xmlHttp_show_schedule_day=GetXmlHttpObject(); 

		var url_city_list="show_all_day.php?city_id="+city_id+"&itinerary_id="+itinerary_id+"&dep_date="+dep_date;
		
		xmlHttp_show_schedule_day.onreadystatechange=stateChanged_show_all_day;
		xmlHttp_show_schedule_day.open("GET",url_city_list,true);
		xmlHttp_show_schedule_day.send(null);

    
      }


	  

function stateChanged_show_all_day()
{

if (xmlHttp_show_schedule_day.readyState==1)
		{ 
document.getElementById("uniquename3").innerHTML="<div align='center' ><img src='images/ajax-loader.gif' >"+
"</div>";

      document.getElementById("uniquename3").style.display = "";
		}

if (xmlHttp_show_schedule_day.readyState==4)
		{ 

		document.getElementById("uniquename3").innerHTML=xmlHttp_show_schedule_day.responseText;
		}

}


function show_any_content(d)
{

AssignPosition_change_date(document.getElementById(d));

document.getElementById(d).style.display = "";

}


 function AssignPosition_change_date(d) {

      if(self.pageYOffset) {

      rX = self.pageXOffset;

      rY = self.pageYOffset;

      }

      else if(document.documentElement && document.documentElement.scrollTop) {

      rX = document.documentElement.scrollLeft;

      rY = document.documentElement.scrollTop;

      }

      else if(document.body) {

      rX = document.body.scrollLeft;

      rY = document.body.scrollTop;

      }

      if(document.all) {

      cX += rX;

      cY += rY;

      }

      d.style.left = (cX-415) + "px";

      d.style.top = (cY-233) + "px";

      }




function show_reserve_link()
{
if(document.reserve_form.Electronic_Contract_Acceptance.checked==true)
	{
	

document.getElementById("div_form1").style.display="none";

document.getElementById("increase_height").height ="175";

document.getElementById("div_reserve").style.display="";
	}

	else
	{

alert("Please check the given check box to accept the terms and conditions");

	}

}





function chk_inquiry()
{

if(string_value2(document.inquiry_form.inquiry_name,2,55,'Name','Y') == false) { return false }
if(email(document.inquiry_form.inquiry_email,5,55,'Email','Y') == false) { return false }
if(phone_fax(document.inquiry_form.inquiry_phone,3,25,'Phone number','Y')==false){ return false }

if(document.inquiry_form.source_of_info.value=="0")
{
alert("Please tell us from where did you first hear of us?");
document.inquiry_form.source_of_info.focus();
return false;
}

/*
if(number(document.inquiry_form.duration,1,2,1,35,'Duration',"Y")==false )
	{

return false;

	}
*/

if(number(document.inquiry_form.number_of_guests,1,1,1,25,'Number of Guests',"Y")==false )
	{

return false;

	}




document.inquiry_form.submit();


}

function reserve_tour()
{

	document.form_reserve.submit();

}


 function AssignPosition_small_calendar(d) {

      if(self.pageYOffset) {

      rX = self.pageXOffset;

      rY = self.pageYOffset;

      }

      else if(document.documentElement && document.documentElement.scrollTop) {

      rX = document.documentElement.scrollLeft;

      rY = document.documentElement.scrollTop;

      }

      else if(document.body) {

      rX = document.body.scrollLeft;

      rY = document.body.scrollTop;

      }

      if(document.all) {

      cX += rX;

      cY += rY;

      }

      d.style.left = (cX+205) + "px";

      d.style.top = (cY-1) + "px";
//drawDatePicker(d,cX+105,cY-5 );
    }


 function AssignPosition_build_old(d) {

	if(self.pageYOffset) {

      rX = self.pageXOffset;

      rY = self.pageYOffset;

      }

      else if(document.documentElement && document.documentElement.scrollTop) {

      rX = document.documentElement.scrollLeft;

      rY = document.documentElement.scrollTop;

      }

      else if(document.body) {

      rX = document.body.scrollLeft;

      rY = document.body.scrollTop;

      }

      if(document.all) {

      cX += rX;

      cY += rY;

      }

      d.style.left = (cX-55) + "px";

      d.style.top = (cY+5) + "px";


    }


function show_small_calendar(div_id)
{
	AssignPosition_small_calendar(document.getElementById(div_id));
	document.getElementById(div_id).style.display="";
}


function chk_cal_validation(dt)
{
	
	
if(document.submit_tour.tour_id.value=="")
	{
	alert("Please select a tour");
	return false;
	}

	var date_now_chk = new Array(3);

	date_now_chk = dt.split("-", 3);

	var num_date_now = parseInt(date_now_chk[0]+date_now_chk[1]+date_now_chk[2]);

	
	var date_sel_chk = new Array(3);

	date_sel_chk = (document.submit_tour.dep_date.value).split("-", 3);

	var num_date_sel = parseInt(date_sel_chk[0]+date_sel_chk[1]+date_sel_chk[2]);

	
	if(num_date_now >= num_date_sel)
	{
	alert("Please select a valid date");
	return false;
	}




	if(document.submit_tour.dep_date.value=="")
	{
	alert("Please select tour date");
	return false;
	}


}








function show_cat_description(cat_id,client_id)
{
	xmlHttp_show_cat_des=GetXmlHttpObject(); 
	AssignPosition_build_new(document.getElementById("cat_des_div"));
		var url_cat_des="show_cat_des.php?categories_id="+cat_id+"&client_id="+client_id;
		xmlHttp_show_cat_des.onreadystatechange=stateChanged_cat_des;
		xmlHttp_show_cat_des.open("GET",url_cat_des,true);
		xmlHttp_show_cat_des.send(null);
	 
}



function stateChanged_cat_des()
{
if (xmlHttp_show_cat_des.readyState==1)
{
	
		document.getElementById("cat_des_div").style.display ="";
		document.getElementById("cat_des_div").innerHTML='<div class="borderline_day_des_div" ><img src="images/ajax-loader.gif" align="middle"   /></div>';
		
}


if (xmlHttp_show_cat_des.readyState==4)
		{ 
		document.getElementById("cat_des_div").innerHTML=xmlHttp_show_cat_des.responseText;

		}


}


function show_cat_description2(cat_id,client_id)
{
	xmlHttp_show_cat_des=GetXmlHttpObject(); 
	AssignPosition_build_old(document.getElementById("cat_des_div"));

		var url_cat_des="show_cat_des2.php?categories_id="+cat_id+"&client_id="+client_id;
		xmlHttp_show_cat_des.onreadystatechange=stateChanged_cat_des2;
		xmlHttp_show_cat_des.open("GET",url_cat_des,true);
		xmlHttp_show_cat_des.send(null);
	 
}



function stateChanged_cat_des2()
{
if (xmlHttp_show_cat_des.readyState==1)
{	
//AssignPosition_build_old(document.getElementById("cat_des_div"));
document.getElementById("cat_des_div").style.display ="";
document.getElementById("cat_des_div").innerHTML='<img src="images/ajax-loader.gif" align="middle"   />';

}

if (xmlHttp_show_cat_des.readyState==4)
		{ 

		document.getElementById("cat_des_div").innerHTML=xmlHttp_show_cat_des.responseText;


		}


}


function ShowActivities( iti_id, dep_date  )
{
		AssignPosition(document.getElementById('add_day'));
		xmlHttp_show_act=GetXmlHttpObject(); 
		var url_act_des="show_activities_des.php?&iti_id="+iti_id+"&dep_date="+dep_date;
		xmlHttp_show_act.onreadystatechange=stateChanged_activites_des;
		xmlHttp_show_act.open("GET",url_act_des,true);
		xmlHttp_show_act.send(null);
}


function stateChanged_activites_des()
{

if (xmlHttp_show_act.readyState==1)
		{ 
	document.getElementById("add_day").innerHTML='<img align="center" src="images/ajax-loader.gif" alt="Loading">';
	document.getElementById("add_day").style.display ="";
		}
if (xmlHttp_show_act.readyState==4)
		{ 
		document.getElementById("add_day").innerHTML=xmlHttp_show_act.responseText;

		}
}


function ShowActivities2( iti_id, dep_date, city_id)
{
		//AssignPosition(document.getElementById('add_day'));
		xmlHttp_show_act=GetXmlHttpObject(); 
		var url_act_des="show_activities_des.php?&iti_id="+iti_id+"&dep_date="+dep_date+"&city_id="+city_id;
		xmlHttp_show_act.onreadystatechange=stateChanged_activites_des2;
		xmlHttp_show_act.open("GET",url_act_des,true);
		xmlHttp_show_act.send(null);
}




function stateChanged_activites_des2()
{

if (xmlHttp_show_act.readyState==1)
		{ 
	document.getElementById("uniquename3").innerHTML='<img align="center" src="images/ajax-loader.gif" alt="Loading">';
	document.getElementById("uniquename3").style.display ="";
		}
if (xmlHttp_show_act.readyState==4)
		{ 
	
		document.getElementById("uniquename3").innerHTML=xmlHttp_show_act.responseText;

		}

}


div_to_chng="";
function update_schedule(iti_id,div_to_change)
{
	div_to_chng = div_to_change;
city_tour = "";
vehicle = "";
guide ="";

if(document.change_schedule_form.city_tour.checked==true)
	{

city_tour = document.change_schedule_form.city_tour.value;

	}


if(document.change_schedule_form.vehicle.checked==true)
	{

vehicle = document.change_schedule_form.vehicle.value;

	}

if(document.change_schedule_form.guide.checked==true)
	{

guide = document.change_schedule_form.guide.value;

	}


day = document.change_schedule_form.day.value;

city = document.change_schedule_form.city.value;

		xmlHttp_sch_upd=GetXmlHttpObject(); 

		var url_sch_upd="change_schedule.php?&iti_id="+iti_id+"&day="+
			day+"&city_tour="+city_tour+"&vehicle="+vehicle+"&guide="+guide+"&city="+city;


		xmlHttp_sch_upd.onreadystatechange=stateChanged_schedule_upd;

		xmlHttp_sch_upd.open("GET",url_sch_upd,true);

		xmlHttp_sch_upd.send(null);


}


function stateChanged_schedule_upd()
{

if (xmlHttp_sch_upd.readyState==4)
		{ 

window.location.href = window.location.href;
		}


}




function delete_day(iti_id, dep_date )
{
		AssignPosition(document.getElementById('del_day'));
		xmlHttp_delete_day=GetXmlHttpObject(); 
		var url_delete_day="delete_day.php?iti_id="+iti_id+"&dep_date="+dep_date;
		xmlHttp_delete_day.onreadystatechange=stateChanged_delete_day;
		xmlHttp_delete_day.open("GET",url_delete_day,true);
		xmlHttp_delete_day.send(null);

}


function stateChanged_delete_day()
{
if (xmlHttp_delete_day.readyState==4)
		{ 

		document.getElementById("del_day").innerHTML=xmlHttp_delete_day.responseText;

		document.getElementById("del_day").style.display ="";

		}


}




function delete_day_schedule(iti_id)
{
		day = document.delete_form.day.value;
		xmlHttp_delete_upd=GetXmlHttpObject(); 
		var xmlHttp_delete_url="delete_day_upd.php?iti_id="+iti_id+"&day="+day;
		xmlHttp_delete_upd.onreadystatechange=stateChanged_delete_upd;
		xmlHttp_delete_upd.open("GET",xmlHttp_delete_url,true);
		xmlHttp_delete_upd.send(null);


}


function stateChanged_delete_upd()
{

if (xmlHttp_delete_upd.readyState==4)
		{ 
	window.location.href = window.location.href;
		}

}



function save_tourid(tour_id,client_id)
{
	clientid = client_id;
xmlHttpsave_tour=GetXmlHttpObject();
if (xmlHttpsave_tour==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

if(document.getElementById("plus_img"+tour_id).title !="Selected")
	{
var urlsave_tour="select_location.php?tour_id="+tour_id+"&client_id="+client_id;
xmlHttpsave_tour.onreadystatechange=stateChangedsave_tour;
xmlHttpsave_tour.open("GET",urlsave_tour,true);
xmlHttpsave_tour.send(null);
document.getElementById("plus_img"+tour_id).src ="images/click.gif";
document.getElementById("plus_img"+tour_id).style.cursor ="default";
document.getElementById("plus_img"+tour_id).title ="Selected";
	}
	else
	{
	delete_selected_tour(tour_id,client_id);
	
	}




/*setTimeout("draw_on_map("+client_id+");",555);*/
}


function stateChangedsave_tour() 
{ 
if(xmlHttpsave_tour.readyState==4|| xmlHttpsave_tour.readyState=='complete')
{
	
document.getElementById("selection_div").innerHTML = xmlHttpsave_tour.responseText;
document.getElementById("header_div").style.display="none";
document.getElementById("cat_des_div").style.display = "none";
draw_on_map2(clientid);
}
}

function delete_selected_tour(selected_tour,client_id)
{
clientid = client_id;
tourid=selected_tour;
confirm_str="";

if(selected_tour=="all")
	{

	confirm_str ="Are you sure you want to delete all the selected options";

	

	}
	else
	{
		confirm_str = "Are you sure you want to delete ! ";
	   

	}


var confirm_del = confirm(confirm_str);

if(confirm_del==false)
	{
	return false;
	}
	else
	{

xmlHttpdelete_tour=GetXmlHttpObject();
if (xmlHttpdelete_tour==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

var urldelete_tour="select_location.php?selected_tour="+selected_tour+"&client_id="+client_id;
xmlHttpdelete_tour.onreadystatechange=stateChangedelete_tour;
xmlHttpdelete_tour.open("GET",urldelete_tour,true);
xmlHttpdelete_tour.send(null);
if(selected_tour=="all")
		{
		for(i=0; i<1555; i++)
			{
			if(document.getElementById("plus_img"+i)!=null)
				{
		document.getElementById("plus_img"+i).src ="images/plus.gif";
		document.getElementById("plus_img"+i).style.cursor ="pointer";
		document.getElementById("plus_img"+i).title ="Click to add";
				}	
			}
		}

		else
		{
		document.getElementById("plus_img"+selected_tour).src ="images/plus.gif";
		document.getElementById("plus_img"+selected_tour).style.cursor ="pointer";
		document.getElementById("plus_img"+selected_tour).title ="Click to add";
		}
//setTimeout("draw_on_map("+client_id+");",555);

	}
}

function stateChangedelete_tour() 
{ 

if(xmlHttpdelete_tour.readyState==4)
{
document.getElementById("cat_des_div").style.display = "none";

document.getElementById("selection_div").innerHTML = xmlHttpdelete_tour.responseText;

if((tourid!="all")&&(document.getElementById("cat_des_div").style.display==""))
	{
document.getElementById("cat_des_div").style.display=="none";
}
}
draw_on_map2(clientid);


}









function save_tourid2(tour_id,client_id)
{
	clientid = client_id;
xmlHttpsave_tour=GetXmlHttpObject();
if (xmlHttpsave_tour==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

var urlsave_tour="select_location_old.php?tour_id="+tour_id+"&client_id="+client_id;
xmlHttpsave_tour.onreadystatechange=stateChangedsave_tour2;
xmlHttpsave_tour.open("GET",urlsave_tour,true);
xmlHttpsave_tour.send(null);
}


function stateChangedsave_tour2() 
{ 
if(xmlHttpsave_tour.readyState==4|| xmlHttpsave_tour.readyState=='complete')
{
document.getElementById("selection_div").innerHTML = xmlHttpsave_tour.responseText;
document.getElementById("cat_des_div").style.display = "none";

draw_on_map2(clientid);

}
}

function delete_selected_tour2(selected_tour,client_id)
{
		clientid = client_id;

	var confirm_delete = confirm("Are you sure to delete");
	
	if(confirm_delete==false)
	{
		return false;
	}
	else
	{
	
	
xmlHttpdelete_tour=GetXmlHttpObject();
if (xmlHttpdelete_tour==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 


document.getElementById("tourselection_" + selected_tour).checked=false;

var urldelete_tour="select_location_old.php?selected_tour="+selected_tour+"&client_id="+client_id;
xmlHttpdelete_tour.onreadystatechange=stateChangedelete_tour2;
xmlHttpdelete_tour.open("GET",urldelete_tour,true);
xmlHttpdelete_tour.send(null);
	}
}

function stateChangedelete_tour2() 
{ 
if(xmlHttpdelete_tour.readyState==4)
{
document.getElementById("selection_div").innerHTML = xmlHttpdelete_tour.responseText;
document.getElementById("cat_des_div").style.display = "none";

draw_on_map2(clientid);

}
}





function sendenquiryform(client_id)
{

xmlenquiryform=GetXmlHttpObject();
if (xmlenquiryform==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

var urlenquiry_form="enquiry_form.php?client_id="+client_id;
xmlenquiryform.onreadystatechange=stateChangedenquiry_form;
xmlenquiryform.open("GET",urlenquiry_form,true);
xmlenquiryform.send(null);





}



function stateChangedenquiry_form()
{

if(xmlenquiryform.readyState==1)
	{
document.getElementById("enquiry_div").style.display = "";
document.getElementById("enquiry_div").innerHTML = "<img src='images/ajax-loader.gif' >";

	}

if(xmlenquiryform.readyState==4)
{
document.getElementById("enquiry_div").innerHTML = xmlenquiryform.responseText;
}
}


function chk_inquiry2()
{
/*
if(string_value2(document.inquiry_form.inquiry_name,2,55,'Name','Y') == false) { return false }
if(email(document.inquiry_form.inquiry_email,5,55,'Email','Y') ==false) { return false }
if(phone_fax(document.inquiry_form.inquiry_phone,3,25,'Phone number','Y')==false){ return false }

if(document.inquiry_form.source_of_info.value=="0")
{
alert("Please tell us from from where did you first hear of us?");
document.inquiry_form.source_of_info.focus();
return false;
}

/*
if(number(document.inquiry_form.duration,1,2,1,35,'Duration',"Y")==false )
	{

return false;

	}

if(number(document.inquiry_form.number_of_guests,1,2,1,35,'Number of Guests',"Y")==false )
	{

return false;

	}
*/



document.inquiry_form.submit();


}



function draw_on_map(client_id)
{
	document.getElementById('map_iframe').src=document.getElementById('map_iframe').src;

document.frames['map_iframe'].location.reload(true);
/*
x_draw = GetXmlHttpObject();
x_draw_url = "map.php?client_id="+client_id;
x_draw.onreadystatechange=stateChanged_draw_on_map;
x_draw.open("GET",x_draw_url,true);
x_draw.send(null);
*/
}


function stateChanged_draw_on_map()
{
if(x_draw.readyState==4)
	{
/*document.getElementById('test_div').innerHTML = x_draw.responseText;*/

document.getElementById('map_iframe').src=document.getElementById('map_iframe').src;

document.frames['map_iframe'].location.reload(true);

}

}



function draw_on_map2(client_id)
{
x_draw2 = GetXmlHttpObject();
x_draw_url2 = "map_blink_div.php?client_id="+client_id;
x_draw2.onreadystatechange=stateChanged_draw_on_map2;
x_draw2.open("GET",x_draw_url2,true);
x_draw2.send(null);

}


function stateChanged_draw_on_map2()
{
if(x_draw2.readyState==4)
	{
		//alert(x_draw2.responseText);
		//alert(window.map_iframe.document.getElementById("map_highlights").innerHTML);
		window.map_iframe.document.getElementById("map_highlights").innerHTML= x_draw2.responseText;
		//alert(window.map_iframe.document.getElementById("map_highlights").innerHTML);
	//	window.frames['map_iframe'].document.getElementById("map_highlights").innerHTML= x_draw2.responseText;


}

}





function check_booking()
{
	
if(document.booking_form.name.value=="")
	{
	alert("Please enter your name");
	return false;
	}


if(document.booking_form.email.value=="")
	{
	alert("Please enter your email address");
	return false;
	}




}



function get_iti_menu(category_id)
{
	
x_menu = GetXmlHttpObject();
x_menu_url = "get_menu.php?category_id="+category_id;
x_menu.onreadystatechange=stateChanged_menu;
x_menu.open("GET",x_menu_url,true);
x_menu.send(null);
}


function stateChanged_menu()
{
if(x_menu.readyState==4)
	{
	
document.getElementById('itinerary_list').innerHTML = x_menu.responseText;


}



}

function AssignPosition_build_new(d) {

	if(self.pageYOffset) {

      rX = self.pageXOffset;

      rY = self.pageYOffset;

      }

      else if(document.documentElement && document.documentElement.scrollTop) {

      rX = document.documentElement.scrollLeft;

      rY = document.documentElement.scrollTop;

      }

      else if(document.body) {

      rX = document.body.scrollLeft;

      rY = document.body.scrollTop;

      }

      if(document.all) {

      cX += rX;

      cY += rY;

      }

   //   d.style.left = (cX-255) + "px";

      d.style.top = (cY+5) + "px";


    }

function getXMLHTTP() { //fuction to return the xml http object
		var xmlhttp=false;	
		try{
			xmlhttp=new XMLHttpRequest();
		}
		catch(e)	{		
			try{			
				xmlhttp= new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch(e){
				try{
				req = new ActiveXObject("Msxml2.XMLHTTP");
				}
				catch(e1){
					xmlhttp=false;
				}
			}
		}
		 	
		return xmlhttp;
    }

	/************************* This function is used to fetch Enquiry Form ***************************/
function show_inquiry_form(filename) {	
		var strURL=filename+".php";
		var req = getXMLHTTP();
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					if (req.status == 200) {
	document.getElementById('inquiry_form_div').innerHTML=req.responseText;						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}	
				
				else {
	document.getElementById('inquiry_form_div').innerHTML="<img align='center' src='images/ajax-loader.gif' style='padding:55px;' >";
					
				}
					
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}	
		
	}
/***********************************************************************/
