var xmlHttp
var clientid="";
var vacationid ="";
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;
//alert(url);

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, itinerary, depDate, Level, iti_id)
{

xmlHttp_object = GetXmlHttpObject();
if(itinerary=='yes'){
	xmlHttp_object_url = "vacation_iti_description.php?iti_des_id="+iti_des_id+"&itinerary=yes&dep_date="+depDate+"&level="+Level+"&iti_id="+iti_id;
} else {
	xmlHttp_object_url = "vacation_iti_description.php?iti_des_id="+iti_des_id+"&dep_date="+depDate+"&level="+Level+"&iti_id="+iti_id;

}
xmlHttp_object.onreadystatechange=stateChanged_object;
xmlHttp_object.open("GET",xmlHttp_object_url,true);
xmlHttp_object.send(null);

}


/*===============SHOW Itinerary ===============================*/


function iti_detail2(iti_des_id)
{

xmlHttp_object = GetXmlHttpObject();

	xmlHttp_object_url = "vacation_iti_description.php";
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";	
//		
//		}
//	}
//}
// *********************Fetch a Textarear Information ************************8
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_div(ID){
	
	document.getElementById(ID).style.display = "block";
	
}

function show_form_div(form_div_id, tag)
{
	document.getElementById('reserve').style.display = "none";
	document.getElementById('question').style.display = "none";

for(i=1; i<=2 ; i++)
	{
	if(form_div_id==i)
		{
		document.getElementById('div_form'+i).style.display = "";
		document.getElementById(tag).style.display = "";
		
		}
		else
		{

		document.getElementById('div_form'+i).style.display = "none";
		document.getElementById(tag).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,vacation_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?vacation_id="+vacation_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,startDate) {

	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_vacation_day.php?tour_id="+tour_id+"&selected_day="+selected_day+"&itinerary_id="+itinerary_id+"&startDate="+startDate;
		//alert(url_city_list);
		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_vacationiti_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 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 reserveForm()
{


if(string_value2(document.form_reserve.inquiry_name,2,55,'Name','Y') == false) { return false }
if(email(document.form_reserve.inquiry_email,5,55,'Email','Y') == false) { return false }
if(phone_fax(document.form_reserve.inquiry_phone,3,25,'Phone number','Y')==false){ return false }

if(document.form_reserve.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.form_reserve.number_of_guests,1,1,1,25,'Number of Travelers',"Y")==false )
	{

return false;

	}
document.form_reserve.submit();

}


function chk_inquiry()
{

if(document.inquiry_form.lodginglevel.value=="") {
		alert('Please select Lodging.');
		//window.location.href="#";
		return false;
		
	}

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.inquiry_phone.value=='') {
	alert('Please enter phone number');
	document.inquiry_form.inquiry_phone.focus();
	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(document.inquiry_form.number_of_guests.value=='')
{
alert("Please eneter number of Travelers.");
document.inquiry_form.number_of_guests.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 Travelers',"Y")==false )
	{

return false;

	}*/



document.inquiry_form.submit();


}

//=======================Brochure form validation========================
function brochure()
{

if(document.brochureform.b_typ.selectedIndex=="0")
{
alert("Please Select Brochure Type.");
document.brochureform.b_typ.focus();
return false;
}


if(string_value2(document.brochureform.name,2,55,'Name','Y') == false) { return false }
if(email(document.brochureform.email,5,55,'Email','Y') == false) { return false }
if(phone_fax(document.brochureform.phone,3,25,'Phone number','Y')==false){ return false }

if(document.brochureform.Source.selectedIndex=="0")
{
alert("Please tell us from where did you first hear of us?");
document.brochureform.Source.focus();
return false;
}




document.brochureform.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-255) + "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.vacation_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="vacation_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="vacation_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==4)
		{ 
	
		document.getElementById("add_day").innerHTML=xmlHttp_show_act.responseText;

		document.getElementById("add_day").style.display ="";

		}


}


div_to_chng="";
function update_schedule(iti_id,div_to_change,url)
{
	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_vacation_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;
			var redirect_url = window.location.href;
			//================Replace Url in #====================
			redirect_url	= redirect_url.replace("#div_inquiry", " ");
			redirect_url	= redirect_url.replace("#Itinerary_detailed", " ");
			redirect_url	= redirect_url.replace("#top", " ");
			redirect_url	= redirect_url.replace("#vacation_iti_lodging", " ");
			window.location=redirect_url;
				
		}


}



function delete_day(iti_id, dep_date )
{
		AssignPosition(document.getElementById('del_day'));
		xmlHttp_delete_day=GetXmlHttpObject(); 
		var url_delete_day="delete_vacation_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_vacation_iti.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;
	
			var url = window.location.href;
			//================Replace Url in #====================
			var replaceurl=url.replace("#div_inquiry"," ");
			window.location.href=replaceurl;
		}

}





function save_vacationid(vacation_id,client_id,days)
{
	//alert(tour_id+"--"+client_id);
	clientid = client_id;
	vacationid = vacation_id;
	
	day = days;
	//alert(days);
xmlHttpsave_vacation=GetXmlHttpObject();

if (xmlHttpsave_vacation==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
  //========== if selected destination tab is not selected======================
  //================== then only go for =========
if(document.getElementById("plus_img"+vacation_id)){

if(document.getElementById("plus_img"+vacation_id).title !="Selected")
	{
var urlsave_tour="vacation_duration.php?vacation_id="+vacationid+"&client_id="+clientid;

	
			xmlHttpsave_vacation.onreadystatechange = function() {
				if (xmlHttpsave_vacation.readyState == 4) {
					// only if "OK"
					if (xmlHttpsave_vacation.status == 200) {
							//alert('hi');
							if(xmlHttpsave_vacation.readyState==4|| xmlHttpsave_vacation.readyState=='complete'){
	
								document.getElementById("selection_div").innerHTML = xmlHttpsave_vacation.responseText;
								document.getElementById("header_div").style.display="none";
								document.getElementById("cat_des_div").style.display = "none";
								draw_on_map2(clientid);
									save_build_day(vacationid,clientid, day);
									//show_connected(vacation_id, client_id, flag);
									
							}
				
						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}	
				
				else {
	//document.getElementById('p_div2').innerHTML="<img align='center' src='images/ajax-loader.gif' style='padding:55px;' >";
					
				}
					
			}	


xmlHttpsave_vacation.open("GET",urlsave_tour,true);
xmlHttpsave_vacation.send(null);
	document.getElementById("plus_img"+vacation_id).src ="images/click.gif";
	document.getElementById("plus_img"+vacation_id).style.cursor ="default";
	document.getElementById("plus_img"+vacation_id).title ="Selected";


	
	}
	else
	{
	delete_selected_vacations(vacation_id,client_id);
	
	
	}

} 
else {
var urlsave_tour="vacation_duration.php?vacation_id="+vacationid+"&client_id="+clientid;
xmlHttpsave_vacation.onreadystatechange=stateChangedsave_vacation;
xmlHttpsave_vacation.open("GET",urlsave_tour,true);
xmlHttpsave_vacation.send(null);
}

/*if (xmlHttpsave_vacation==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
	if(document.getElementById("plus_img"+vacationid)){
		if(document.getElementById("plus_img"+vacationid).title !="Selected")
			{
				var urlsave_tour="vacation_duration.php?vacation_id="+vacationid+"&client_id="+clientid;
				xmlHttpsave_vacation.onreadystatechange=stateChangedsave_vacation;
				xmlHttpsave_vacation.open("GET",urlsave_tour,true);
				xmlHttpsave_vacation.send(null);
				
				document.getElementById("plus_img"+vacationid).src ="images/click.gif";
				document.getElementById("plus_img"+vacationid).style.cursor ="default";
				document.getElementById("plus_img"+vacationid).title ="Selected";
				
			
			}
			else
			{
			delete_selected_vacations(vacation_id,client_id);
				
			
			}
	}else{
		var urlsave_tour="vacation_duration.php?vacation_id="+vacationid+"&client_id="+clientid;
		xmlHttpsave_vacation.onreadystatechange=stateChangedsave_vacation;
		xmlHttpsave_vacation.open("GET",urlsave_tour,true);
		xmlHttpsave_vacation.send(null);
		
	}*/
}


function stateChangedsave_vacation()
{ 
if(xmlHttpsave_vacation.readyState==4|| xmlHttpsave_vacation.readyState=='complete')
{

document.getElementById("selection_div").innerHTML = xmlHttpsave_vacation.responseText;
document.getElementById("header_div").style.display="none";
document.getElementById("cat_des_div").style.display = "none";

draw_on_map2(clientid);

save_build_day(vacationid,clientid, day);
}
}

function saveRecommendDays(vacation_id,client_id)
{
clientid = client_id;
var days= document.getElementById("recommend_day"+vacation_id).value;
xmlHttpsaveRecommendDays=GetXmlHttpObject();
if (xmlHttpsaveRecommendDays==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

var urlsave="save_recommend_day.php?vacation_id="+vacation_id+"&client_id="+client_id+"&days="+days;
xmlHttpsaveRecommendDays.onreadystatechange=stateChangedxmlHttpsaveRecommendDays;
xmlHttpsaveRecommendDays.open("GET",urlsave,true);
xmlHttpsaveRecommendDays.send(null);

}


function stateChangedxmlHttpsaveRecommendDays() 
{ 
if(xmlHttpsaveRecommendDays.readyState==4|| xmlHttpsaveRecommendDays.readyState=='complete')
{
	document.getElementById("selection_div").innerHTML = xmlHttpsaveRecommendDays.responseText;
	document.getElementById("header_div").style.display="none";
	document.getElementById("cat_des_div").style.display = "none";

}
}


function delete_selected_vacations(selected_vacation,client_id){
clientid = client_id;
vacationid=selected_vacation;
confirm_str="";

if(selected_vacation=="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="save_recommend_day.php?selected_vacation="+selected_vacation+"&client_id="+client_id+"&action=delete";
xmlHttpdelete_tour.onreadystatechange = stateChangedelete_tour;

xmlHttpdelete_tour.open("GET",urldelete_tour,true);
xmlHttpdelete_tour.send(null);
//show_selected_lodging(client_id);
document.getElementById("cat_des_div").style.display = "none";

if(selected_vacation=="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_vacation).src ="images/plus.gif";
			document.getElementById("plus_img"+selected_vacation).style.cursor ="pointer";
			document.getElementById("plus_img"+selected_vacation).title ="Click to add";
		}
//setTimeout("draw_on_map("+client_id+");",555);

	}
//xmlHttpdelete_tour.onreadystatechange=function(){
//	
//	//if(xmlHttpdelete_tour.readyState==4){
////		document.getElementById("cat_des_div").style.display='none';
////		document.getElementById("selection_div").innerHTML = xmlHttpdelete_tour.responseText;
////		//if(selected_vacation=="all"){
//////			
//////			//document.location.href='build_your_vacation.php?pre_set=1';
//////		
//////		}
////		
////		
////	}
//draw_on_map2(clientid);	
////if(xmlHttpdelete_tour.responseText){
////	
////show_selected_lodging(xmlHttpdelete_tour.responseText);	
////}
//}

//xmlHttpdelete_tour.open("GET",urldelete_tour,true);
//xmlHttpdelete_tour.send(null);	

}

function stateChangedelete_tour() 
{ 
if(xmlHttpdelete_tour.readyState==4)
{
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";
}

if(xmlHttpdelete_tour.responseText){
	
show_selected_lodging(xmlHttpdelete_tour.responseText);	
}

}
draw_on_map2(clientid);
document.getElementById('select_build_own_desc').style.display='';
}






function delete_selected_vacation(selected_vacation,client_id)
{
clientid = client_id;
vacationid=selected_vacation;
confirm_str="";

if(selected_vacation=="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="delete_vacation_location.php?selected_vacation="+selected_vacation+"&client_id="+client_id;
xmlHttpdelete_tour.onreadystatechange=stateChangedelete_tour;
xmlHttpdelete_tour.open("GET",urldelete_tour,true);
xmlHttpdelete_tour.send(null);


if(selected_vacation=="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_vacation).src ="images/plus.gif";
		document.getElementById("plus_img"+selected_vacation).style.cursor ="pointer";
		document.getElementById("plus_img"+selected_vacation).title ="Click to add";
		}
//setTimeout("draw_on_map("+client_id+");",555);

	}
}

function stateChangedelete_tour() 
{ 

if(xmlHttpdelete_tour.readyState==4)
{
document.getElementById("selection_div").innerHTML = xmlHttpdelete_tour.responseText;

if((vacationid!="all")&&(document.getElementById("cat_des_div").style.display==""))
	{
document.getElementById("cat_des_div").style.display=="none";
}
if(xmlHttpdelete_tour.responseText){
	
show_selected_lodging(xmlHttpdelete_tour.responseText);	
}
}
draw_on_map2(clientid);


}









function save_vacationid2(vacation_id,client_id)
{
	
xmlHttpsave_tour=GetXmlHttpObject();
if (xmlHttpsave_tour==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

var urlsave_tour="select_location_old.php?vacation_id="+vacation_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;
}
}

function delete_selected_vacation2(selected_vacation,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_vacation).checked=false;

var urldelete_tour="select_location_old.php?selected_vacation="+selected_vacation+"&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;
}
}



/*===============Hide div preview Section====================*/
function HidePreview(preview_div_1) {


document.getElementById(preview_div_1).style.display="none";

}
/*===============Check date is select or not====================*/

function date_check()
{
	alert('Before Insert or Delete day you need to choose arrival date.');
	return false;
	
}
/*function date_checks()
{
	alert('Before Insert or Delete day you need a choose arrival date.');
	document.getElementById('lodging_per_finish').style.focus();
	return false;
}*/

/*===============Select duration ====================*/
function chk_duration() {
		if(document.search2.duration.selectedIndex==''){
				alert('Please Select duration');
				return false;
			}
	}



function sendenquiryform(client_id)
{

	xmlenquiryform=GetXmlHttpObject();
	if (xmlenquiryform==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
	
	var urlenquiry_form="vacation_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 Travelers',"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 = "map2_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);
		}	
		
	}
/***********************************************************************/

function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail ID")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail ID")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

 		 return true					
	}


/************************* Submit download with ajax ***************************/
function submitDownload(vacation_id, dep_date, iti_id) {	
name 	= document.form_pda_download.pda_name.value;
emailID = document.form_pda_download.pda_email_address.value;

if(name==''){
	alert("Name required");
	return false;
}
if ((emailID==null)||(emailID=="")){
		alert("Please Enter your Email ID")
		return false;
	}
	if (echeck(emailID)==false){
		return false;
	}

var strURL="vacation_pda_link.php?tour_id="+vacation_id+"&dep_date="+dep_date+"&iti_id="+iti_id+"&pda_name="+name+"&pda_email_address="+emailID;
//alert(strURL);
document.getElementById('downloadForm').style.display='none';
document.getElementById('downloadResult').innerHTML="<img align='center' src='images/ajax-loader.gif' style='padding:35px;' >";

		var req = getXMLHTTP();
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					if (req.status == 200) {
			
	document.getElementById('downloadResult').innerHTML=req.responseText;						
						
						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}	
				
				
					
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}	
		
	}
/***********************************************************************/

//=============================== validate Date function ==============================================
function valid_arrival_date(){
			
	//var start_date = document.form_change_calender.arrival_date.value;
	var year_form = document.form_change_calender.year.value;
	var month_form = document.form_change_calender.month.value;
	var day_form = document.form_change_calender.day.value;
	
	start_date	= year_form+'-'+month_form+'-'+day_form;
	var currentTime = new Date()
	var month = currentTime.getMonth() + 1
	var day = currentTime.getDate()
	var year = currentTime.getFullYear();
	date1	= start_date.replace(/-/, "/");
	date2	= date1.replace(/-/, "/");

	//alert(year + "/" + month + "/" + day)
	
	splitStart 	= start_date.split("-");
	splitYear	= splitStart[0];
	splitMonth	= splitStart[1];
	splitDay	= splitStart[2];
	
	//==================== If Year or month or day is blank=====================================================
	if((splitYear=='')||(splitMonth=='')||(splitDay=='')){
		alert('Invalid date.');
		return false;
	}
	
	//==================== If Year<>4 (1970)or month<>2 or day<>2 is blank=================================
	//if ((splitYear.length<4)||(splitMonth.length<2)||(splitDay.length<2)||(splitYear.length>4)||(splitMonth.length>2)||(splitDay.length>2)) {
       // alert('Invalid date.');
		//return false;
	//}
	
	//==================== If Year or month or day is not a number==============================================
	if ((isNaN(parseInt(splitYear)))|| (isNaN(parseInt(splitMonth)))||(isNaN(parseInt(splitDay)))) {
        alert('Invalid date.');
		return false;
		}
	
	
	//========================= If date is blank ===============================================================
	if(start_date==''){
		alert("Arrival date is required.");
		document.form_change_calender.arrival_date.focus();
		return false;
		
	}
	
	//========================= If date is older than current ==================================================
		if(Date.parse(year + "/" + month + "/" + day)>Date.parse(date2))
		{
		alert("Arrival date is old.");
			
			return false;
		}
		return true;
}




/************************* This function is used to fetch Enquiry Form ***************************/
	function show_lodging_load(sesID) {	

		var strURL="lodging_ajax_vacation.php?client_id="+sesID;
		var req = getXMLHTTP();
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					if (req.status == 200) {
							
	document.getElementById('p_div2').innerHTML=req.responseText;						
						
						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}	
				
				else {
	document.getElementById('p_div2').innerHTML="<img align='center' src='images/ajax-loader.gif' style='padding:55px;' >";
					
				}
					
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}	
		
	}
/***********************************************************************/


/************************* This function is used to fetch destinations in build your own ***************************/
function show_destination(ID, sesID, BG, Total) {	
		var strURL="destination_ajax_vacation.php?ID="+ID+"&sesID="+sesID;
		
		var req = getXMLHTTP();
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					if (req.status == 200) {
							
	document.getElementById('getDestination').innerHTML=req.responseText;		
	//=========== first time click on the destinations show first tab with selected bg ===================
	//============ BG is the id of first bg ===============================================================
	//============= Total are the no of total tabs for looping so ======================================
		if(BG!=''){
				for(i=1; i<=Total; i++){
					divID	= 'desc_'+i;
					
					if(BG==i){
						document.getElementById('desc_'+i).style.backgroundColor="#FFFFFF";
						document.getElementById('descimg_'+i).style.display="";
					}else{
						document.getElementById('desc_'+i).style.backgroundColor="#E6D2C7";
						document.getElementById('descimg_'+i).style.display="none";
					}
				}
	
			
			}
						
						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
						
						
					}
				}	
				
				else {
	document.getElementById('getDestination').innerHTML="<img align='center' src='images/ajax-loader.gif' style='padding:55px;' >";
					
				}
					
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}	
		
	}
/**************************************************************************************************/




	/************************* This function is used to fetch Lodging in build your own ***************************/
function show_duration_load(sesID) {	
		var strURL="duration_selection.php?client_id="+sesID;
		var req = getXMLHTTP();
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					if (req.status == 200) {
							
				document.getElementById('p_div3').innerHTML=req.responseText;						
						
						
					} else {


						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}	
				
				else {
	document.getElementById('p_div3').innerHTML="<img align='center' src='images/ajax-loader.gif' style='padding:55px;' >";
					
				}
					
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}	
		
	}
	
	



/**********************  Function for show or hide div*************************************************/
function showDiv(divID){
	document.getElementById(divID).style.display ='';
}
function hideDiv(divID){
	
document.getElementById(divID).style.display = 'none';
}
/***********************************************************************/

	/************************* This function is used to fetch Lodging in vacation ***************************/
function show_lodging_per(sesID, ID, Total) {			
		var strURL="lodging_per_vacation.php?sesID="+sesID+"&ID="+ID+"&Total="+Total;
	
		var req = getXMLHTTP();
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					if (req.status == 200) {
							
				document.getElementById('p_div2').innerHTML=req.responseText;						
						show_lodging_ajax(ID, sesID, '1', Total);
						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}	
				
				else {
	document.getElementById('p_div2').innerHTML="<img align='center' src='images/ajax-loader.gif' style='padding:55px;' >";
					
				}
					
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}	
		
	}
	
	//============ load lodging at first ==================
	

/************************* This function is used to fetch Lodging in build your own ***************************/

function show_lodging_ajax(ID, sesID, BG, Total ) {	

var strURL="lodging_vacation_ajax.php?ID="+ID+"&sesID="+sesID+"&BG="+BG+"&Total="+Total;
		var req = getXMLHTTP();
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					if (req.status == 200) {
							
	document.getElementById('getLodgingPer').innerHTML=req.responseText;						
						//=========== first time click on the destinations show first tab with selected bg ===================
	//============ BG is the id of first bg ===============================================================
	//============= Total are the no of total tabs for looping so ======================================
		if(BG!=''){
				for(i=1; i<=Total; i++){
					divID	= 'desc_'+i;
					
					if(BG==i){
						document.getElementById('per_'+i).style.fontWeight="bold";
						document.getElementById('per_'+i).style.textDecoration="none";
						document.getElementById('perimg_'+i).style.display="";
					}else{
						document.getElementById('per_'+i).style.fontWeight="normal";
						document.getElementById('per_'+i).style.textDecoration="underline";
						document.getElementById('perimg_'+i).style.display="none";
					}
			}
	
			
			}
			
						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}	
				
				else {
	document.getElementById('getLodgingPer').innerHTML="<img align='center' src='images/ajax-loader.gif' style='padding:55px;' >";
					
				}
					
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}	
		
	}	
	
	
/************************* This function is used to save Lodging for all prefernce in build your own ***************************/
function save_per_hotels(ID, sesID) {	

chk = document.all_pre.lodging_prefer;
		final_array  = '';
			for (i = 0; i < chk.length; i++){
				if(chk[i].checked == true){
						if((i>0)&&(final_array!='')){
							final_array +=':';
					} 
				final_array += chk[i].value;
			}
		}

		var strURL="vacation_per_hotels.php?ID="+ID+"&client_id="+sesID+"&lodging="+final_array;

		var req = getXMLHTTP();
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					if (req.status == 200) {
						show_selected_lodging(sesID);	
						//document.getElementById('lodginglevel').value=2;
			//	document.getElementById('p_div2').innerHTML=req.responseText;						
						
						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}	
				
				else {
	//document.getElementById('p_div3').innerHTML="<img align='center' src='images/ajax-loader.gif' style='padding:55px;' >";
					
				}
					
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}	
		
	}
	
	
//******************** This function is used to save Lodging level for all prefernce in build your own ************************/
function save_per_level(ID, sesID) {	

chk = document.all_pre.lodging_level;
		final_array  = '';
			for (i = 0; i < chk.length; i++){
				if(chk[i].checked == true){
						if((i>0)&&(final_array!='')){
							final_array +=':';
					} 
				final_array += chk[i].value;
			}
		}

		var strURL="vacation_per_levels.php?ID="+ID+"&client_id="+sesID+"&level="+final_array;
		
		var req = getXMLHTTP();
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					if (req.status == 200) {
							
							if(req.responseTex!=''){
		       if(document.getElementById('finished')){
							document.getElementById('finished').style.display ='';
							document.getElementById('finished').innerHTML=req.responseText;
							
							
								}			
								show_selected_lodging(sesID);
								//document.getElementById('lodginglevel').value=2;
							}
							
							
						
						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}	
				
				else {
	//document.getElementById('p_div3').innerHTML="<img align='center' src='images/ajax-loader.gif' style='padding:55px;' >";
					
				}
					
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}	
		
	}

/************************* This function is used to save Lodging for all prefernce in build your own ***************************/
function save_all_hotels(sesID) {	

chk = document.all_pre.lodging_prefer;
		final_array  = '';
			for (i = 0; i < chk.length; i++){
				if(chk[i].checked == true){
						if((i>0)&&(final_array!='')){
							final_array +=':';
					} 
				final_array += chk[i].value;
			}
		}

		var strURL="vacation_all_hotels.php?client_id="+sesID+"&lodging="+final_array;
		

		var req = getXMLHTTP();
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					if (req.status == 200) {
			if(req.responseTex!=''){
		if(document.getElementById('finished')){
							document.getElementById('finished').style.display ='';
							document.getElementById('finished').innerHTML=req.responseText;
							
							
								}			
								show_selected_lodging(sesID);
								//document.getElementById('lodgignlevel').value=1;
							}
			//	document.getElementById('p_div2').innerHTML=req.responseText;						
						
						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}	
				
				else {
	//document.getElementById('p_div3').innerHTML="<img align='center' src='images/ajax-loader.gif' style='padding:55px;' >";
					
				}
					
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}	
		
	}
	
	
	/******************** This function is used to save Lodging level for all prefernce in build your own ************************/	
	
	
	
function save_all_level(sesID) {	

chk = document.all_pre.lodging_level;
		final_array  = '';
			for (i = 0; i < chk.length; i++){
				if(chk[i].checked == true){
						if((i>0)&&(final_array!='')){
							final_array +=':';
					} 
				final_array += chk[i].value;
			}
		}

		var strURL="vacation_all_levels.php?client_id="+sesID+"&level="+final_array;
	

		var req = getXMLHTTP();
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					
					if (req.status == 200) {
					if(req.responseTex!=''){
		if(document.getElementById('finished')){
							document.getElementById('finished').style.display ='';
							document.getElementById('finished').innerHTML=req.responseText;
							
							
								}			
								show_selected_lodging(sesID);
								//document.getElementById('lodgignlevel').value=1;
							}
				//document.getElementById('p_div2').innerHTML=req.responseText;						
						
						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}	
				
				else {
	//document.getElementById('p_div3').innerHTML="<img align='center' src='images/ajax-loader.gif' style='padding:55px;' >";
					
				}
					
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}	
		
	}
	
	
//******************** save destinations's days ************************/
function save_build_day(ID, sesID, days) {	
		var strURL="save_recommend_day.php?ID="+ID+"&client_id="+sesID+"&days="+days;
		//alert(strURL);
		var req = getXMLHTTP();
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					if (req.status == 200) {
							show_selected_lodging(sesID);
					document.getElementById('select_next').style.display='block';			
			//	document.getElementById('p_div2').innerHTML=req.responseText;
											
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}	
				
				else {
	//document.getElementById('p_div3').innerHTML="<img align='center' src='images/ajax-loader.gif' style='padding:55px;' >";
					
				}
					
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}	
		
	}


//******************** save destinations's days ************************/
function show_connected(ID, sesID, flag) {	
		var strURL="vacation_connected.php?ID="+ID+"&client_id="+sesID+"&flag="+flag;
		
		var req = getXMLHTTP();
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					if (req.status == 200) {
						
				document.getElementById('linked_msg_inner').innerHTML=req.responseText;			
				if(req.responseText!=''){
				document.getElementById('linked_msg').style.display = '';
				}
						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}	
				
				else {
	document.getElementById('linked_msg_inner').innerHTML="<img align='center' src='images/ajax-loader.gif' style='padding:55px;' >";
					
				}
					
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}	
		
	}

/************ This function is used to fetch content 0f hotels on build your own************/
function build_hotels_content(sesID, name, BG, total) {	
		var strURL="vacation_hotels.php?sesID="+sesID;
		
		var req = getXMLHTTP();
		if (req) {

			document.getElementById('lodging_hotel').style.display='';
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					if (req.status == 200) {
	
	document.getElementById('lodging_hotel_inner').innerHTML=req.responseText;
	
	
						show_lodging_hotels_list(name, sesID, BG, total );
						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}	
				
				else {
	document.getElementById('lodging_hotel_inner').innerHTML="<img align='center' src='images/ajax-loader.gif' style='padding:55px;' >";
					
				}
					
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}	
		
	}

//============ list of hotes ============
	function show_lodging_hotels_list(name, sesID, BG, Total ) {

var strURL="vacation_lodging_hotels_list.php?name="+name+"&sesID="+sesID+"&total="+BG;
		var req = getXMLHTTP();
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
				//alert(req.responseText);	
					if (req.status == 200) {
				
	document.getElementById('hotels_list').innerHTML=req.responseText;						
						//=========== first time click on the destinations show first tab with selected bg ===================
	//============ BG is the id of first bg ===============================================================
	//============= Total are the no of total tabs for looping so ======================================
		if(BG!=''){
				for(i=1; i<=Total; i++){
					divID	= 'desc_'+i;
					
					if(BG==i){
						document.getElementById('Hper_'+i).style.fontWeight="bold";
						document.getElementById('Hper_'+i).style.textDecoration="none";
						document.getElementById('Hperimg_'+i).style.display="";
					}else{
						document.getElementById('Hper_'+i).style.fontWeight="normal";
						document.getElementById('Hper_'+i).style.textDecoration="underline";
						document.getElementById('Hperimg_'+i).style.display="none";
					}
			}
	
			
			}
			
						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}	
				
				else {
	document.getElementById('hotels_list').innerHTML="<img align='center' src='images/ajax-loader.gif' style='padding:55px;' >";
					
				}
					
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}	
		
	}		 
	

/************ This function is used to fetch content 0f level on build your own************/
function build_level_content(level) {	
		var strURL="vacationLevelResult.php?level="+level;
		var req = getXMLHTTP();
		if (req) {
			document.getElementById('level_desc').style.display='';
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					if (req.status == 200) {
	
	
	document.getElementById('level_desc_inner').innerHTML=req.responseText;						
						
						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}	
				
				else {
	document.getElementById('level_desc_inner').innerHTML="<img align='center' src='images/ajax-loader.gif' style='padding:55px;' >";
					
				}
					
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}	
		
	}



	//************************* This function is used to fetch Lodging in build your own ***************************/
function show_vacation_lodging_load(tourID,dep_date) {	
		var strURL="vacation_iti_lodging_ajax.php?tourID="+tourID+"&dep_date="+dep_date;
		//alert(strURL);
		var req = getXMLHTTP();
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					if (req.status == 200) {
							
				document.getElementById('div_iti_4').innerHTML=req.responseText;						
						
						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}	
				
				else {
	document.getElementById('div_iti_4').innerHTML="<img align='center' src='images/ajax-loader.gif' style='padding:55px;' >";
					
				}
					
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}	
		
	}
	
	
	
	function save_custom_all_hotels(iti_id,dep_date) {	

		var chk = document.all_pre.lodging_prefer;
	  var  rad = document.all_pre.lodging_level;
	var	 final_array  = '';
			for (i = 0; i < chk.length; i++){
				if(chk[i].checked == true){
						if((i>0)&&(final_array!='')){
							final_array +=':';
					} 
				final_array += chk[i].value;
			}
		}
		
		
		var rad = document.all_pre.lodging_level;
		var final_array2  = '';
			for (j = 0; j < rad.length; j++){
				if(rad[j].checked == true){
						if((j>0)&&(final_array!='')){
							final_array2 +=':';
					} 
				final_array2 += rad[j].value;
			}
		}
		
		

		var strURL="save_vacation_all_hotels.php?iti_id="+iti_id+"&lodging="+final_array+"&dep_date="+dep_date;;

		var req = getXMLHTTP();
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"

					if (req.status == 200) {		
						//alert(req.response);
						
						if(final_array2){
						
							if(document.getElementById('lodging_per_finish')) {
								document.getElementById('lodging_per_finish').style.display="block";
							}
						showVcationItiLodging(iti_id);	
							//document.getElementById('lodging_per_finish').style.display="block";

						}
						//document.getElementById('div_iti_4').innerHTML=req.responseText;
						//document.getElementById('lodging_per_finish').style.display="block";
						//document.getElementById('vacation_iti_lodging').style.display='blo';	
						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}	
				
				else {
	//document.getElementById('p_div3').innerHTML="<img align='center' src='images/ajax-loader.gif' style='padding:55px;' >";
					
				}
					
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}	
		
	}
	
	
	/******************** This function is used to save Lodging level for all prefernce in build your own ************************/
function save_custom_all_level(iti_id,dep_date) {	

 chk = document.all_pre.lodging_level;
		 final_array  = '';
			for (i = 0; i < chk.length; i++){
				if(chk[i].checked == true){
						if((i>0)&&(final_array!='')){
							final_array +=':';
					} 
				final_array += chk[i].value;
			}
		}

 rad = document.all_pre.lodging_prefer;
		 final_array2  = '';
			for (j = 0; j < rad.length; j++){
				if(rad[j].checked == true){
						if((j>0)&&(final_array!='')){
							final_array2 +=':';
					} 
				final_array2 += rad[j].value;
			}
		}

		var strURL="save_vacation_all_levels.php?iti_id="+iti_id+"&dep_date="+dep_date+"&level="+final_array;
	//document.write(strURL);
	//alert(strURL);	
	

		var req = getXMLHTTP();
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					if (req.status == 200) {
						//	alert(req.responseText);
				//document.getElementById('p_div2').innerHTML=req.responseText;						
				//document.getElementById('lodging_per_finish').style.display="block";
						//document.write(final_array2);
						//alert(req.responseText);
						showVcationItiLodging(iti_id);
						if(final_array2){
									
							if(document.getElementById('lodging_per_finish')) {
								document.getElementById('lodging_per_finish').style.display="block";
							}
							//document.getElementById('lodging_per_finish').style.display="block";
								
						}
						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}	
				
				else {
	//document.getElementById('p_div3').innerHTML="<img align='center' src='images/ajax-loader.gif' style='padding:55px;' >";
					
				}
					
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}	
		
	}


/************************* This function is used to fetch Lodging in build your own ***************************/
function show_custom_lodging_ajax(city_id, iti_id, BG, Total,dep_date) {	

var strURL="vacation_lodging_per_ajax.php?city_id="+city_id+"&iti_id="+iti_id+"&BG="+BG+"&Total="+Total+"&dep_date="+dep_date;

//document.write(strURL);
		var req = getXMLHTTP();
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					if (req.status == 200) {
							
	document.getElementById('getLodgingPer').innerHTML=req.responseText;						
						//=========== first time click on the destinations show first tab with selected bg ===================
	//============ BG is the id of first bg ===============================================================
	//============= Total are the no of total tabs for looping so ======================================
		if(BG!=''){
				for(i=1; i<=Total; i++){
					divID	= 'desc_'+i;
					if(BG==i){
						document.getElementById('per_'+i).style.fontWeight="bold";
						document.getElementById('per_'+i).style.textDecoration="none";
						document.getElementById('perimg_'+i).style.display="";
					}else{
						document.getElementById('per_'+i).style.fontWeight="normal";
						document.getElementById('per_'+i).style.textDecoration="underline";
						document.getElementById('perimg_'+i).style.display="none";
					}
			}
	
			
			}
			
						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}	
				
				else {
	document.getElementById('getLodgingPer').innerHTML="<img align='center' src='images/ajax-loader.gif' style='padding:55px;' >";
					
				}
					
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}	
		
	}




function show_custom_lodging_per(iti_id, city_id, Total,dep_date) {	
		var strURL="vacation_lodging_per_include.php?iti_id="+iti_id+"&city_id="+city_id+"&Total="+Total+"&dep_date="+dep_date;
		var req = getXMLHTTP();
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					if (req.status == 200) {
							
				document.getElementById('div_iti_4').innerHTML=req.responseText;						
						show_custom_lodging_ajax(city_id, iti_id, '1', Total,dep_date);
						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}	
				
				else {
	document.getElementById('div_iti_4').innerHTML="<img align='center' src='images/ajax-loader.gif' style='padding:55px;' >";
					
				}
					
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}	
		
	}
	
	
	
	//******************** This function is used to save Lodging level for all prefernce in build your own ************************/
function save_cutom_per_level(city_id, iti_id,dep_date) {	

chk = document.all_pre.lodging_level;
		final_array  = '';
			for (i = 0; i < chk.length; i++){
				if(chk[i].checked == true){
						if((i>0)&&(final_array!='')){
							final_array +=':';
					} 
				final_array += chk[i].value;
			}
		}
	

		var strURL="save_vacation_per_levels.php?city_id="+city_id+"&iti_id="+iti_id+"&level="+final_array+"&dep_date="+dep_date;
		
		var req = getXMLHTTP();
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					
					if (req.status == 200) {
				
				//document.getElementById('div_iti_4').innerHTML=req.responseText;
						
						document.getElementById('lodging_per_finish').innerHTML=req.responseText;
						showVcationItiLodging(iti_id);	
						
					
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}	
				
				else {
	//document.getElementById('p_div3').innerHTML="<img align='center' src='images/ajax-loader.gif' style='padding:55px;' >";
					
				}
					
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}	
		
	}

/************************* This function is used to save Lodging for all prefernce in build your own ***************************/
function save_custom_per_hotels(city_id, iti_id,dep_date) {	

chk = document.all_pre.lodging_prefer;
		final_array  = '';
			for (i = 0; i < chk.length; i++){
				if(chk[i].checked == true){
						if((i>0)&&(final_array!='')){
							final_array +=':';
						} 
				final_array += chk[i].value;
				}
			}
		

		var strURL="save_vacation_per_hotels.php?city_id="+city_id+"&iti_id="+iti_id+"&lodging="+final_array+"&dep_date="+dep_date;

		var req = getXMLHTTP();
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
			
					if (req.status == 200) {
			//	document.getElementById('p_div2').innerHTML=req.responseText;
		//document.getElementById('logding_next').style.display='block';
		
			document.getElementById('lodging_per_finish').innerHTML=req.responseText;
			showVcationItiLodging(iti_id);
			
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}	
				
				else {
	//document.getElementById('p_div3').innerHTML="<img align='center' src='images/ajax-loader.gif' style='padding:55px;' >";
					
				}
					
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}	
		
	}
	
		/************ This function is used to fetch content 0f hotels on build your own************/
function vacation_hotels_content(iti_id, name, BG, total) {	
		var strURL="vacation_iti_hotels.php?iti_id="+iti_id;
		var Total =total;
		var bg = BG;
		var names = name;
		var itid=iti_id;
		var req = getXMLHTTP();
		if (req) {
			document.getElementById('lodging_hotel').style.display='';
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					if (req.status == 200) {
	
	document.getElementById('lodging_hotel_inner').innerHTML=req.responseText;
	
						show_custom_lodging_hotels_list(names, itid, bg, Total );
						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}	
				
				else {
	document.getElementById('lodging_hotel_inner').innerHTML="<img align='center' src='images/ajax-loader.gif' style='padding:55px;' >";
					
				}
					
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}	
		
	}
	

//============ list of hotes ============
function show_custom_lodging_hotels_list(name, iti_id, BG, total ) {

var Total =total;
var strURL="vacation_iti_hotels_list.php?name="+name+"&iti_id="+iti_id+"&BG="+BG+"&total="+BG;
//alert(strURL);
		var req = getXMLHTTP();
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					if (req.status == 200) {
							
	document.getElementById('hotels_list').innerHTML=req.responseText;						
						//=========== first time click on the destinations show first tab with selected bg ===================
	//============ BG is the id of first bg ===============================================================
	//============= Total are the no of total tabs for looping so ======================================
		if(BG!=''){
				for(i=1; i<=Total; i++){
					divID	= 'desc_'+i;
					
					if(BG==i){
						document.getElementById('Hper_'+i).style.fontWeight="bold";
						document.getElementById('Hper_'+i).style.textDecoration="none";
						document.getElementById('Hperimg_'+i).style.display="";
					}else{
						document.getElementById('Hper_'+i).style.fontWeight="normal";
						document.getElementById('Hper_'+i).style.textDecoration="underline";
						document.getElementById('Hperimg_'+i).style.display="none";
					}
			}
	
			
			}
			
						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}	
				
				else {
	document.getElementById('hotels_list').innerHTML="<img align='center' src='images/ajax-loader.gif' style='padding:55px;' >";
					
				}
					
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}	
		
	}
	

//============ list of hotes ============
function showVcationItiLodging(iti_id,dep_date) {

var strURL="show_vcationIti_lodging.php?iti_id="+iti_id+"&dep_date="+dep_date;
//alert(strURL);
		var req = getXMLHTTP();
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					if (req.status == 200) {
						
						if(document.getElementById('div_inquiry').style.display='none'){
							document.getElementById('div_inquiry').style.display='block';
						
						}
						
						document.getElementById('vacation_iti_lodging').innerHTML=req.responseText;						
	
						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}	
				
				else {
					document.getElementById('vacation_iti_lodging').innerHTML="<img align='center' src='images/ajax-loader.gif' style='padding:55px;' >";
					
				}
					
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}	
		
	}

/*==============================SHOW PREVIEW INFORMATION =======================================================*/


function show_selected_lodging(sesID) {	
		var strURL="vacation_preview.php?client_id="+sesID;
		var req = getXMLHTTP();
		if (req) {
			document.getElementById('selected_result').style.display='';
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					if (req.status == 200) {
	
	document.getElementById('selected_result').innerHTML=req.responseText;	
	count_char	= req.responseText;
//	alert(count_char);
	if(count_char.length<50){
		
		document.getElementById('select_build_own_desc').style.display='';
	} else{
		document.getElementById('select_build_own_desc').style.display='none';
	}
						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}	
				
				else {
	document.getElementById('selected_result').innerHTML="<img align='center' src='images/ajax-loader.gif' style='padding:55px;' >";
					
				}
					
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}	
		
	}

	/************ This function is used to fetch content 0f Enquery form level on build your own************/
function build_level_contents(level) {	
		var strURL="vacationLevelResult.php?level="+level;
		var req = getXMLHTTP();
		if (req) {
			document.getElementById('level_description').style.display='';
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					if (req.status == 200) {
	
	
	                document.getElementById('level_desc_inners').innerHTML=req.responseText;						
						
						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}	
				
				else {
	document.getElementById('level_desc_inners').innerHTML="<img align='center' src='images/ajax-loader.gif' style='padding:55px;' >";
					
				}
					
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}	
		
	}

//============================================================

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);
		}	
		
	}




//============= Start disable right click -- copy content =========
	//====================================== Disble Right Click----Copy ================================
function disableCtrlModifer(evt)
{
var disabled = {a:0, u:0, c:0, x:0, v:0};
var ctrlMod = (window.event)? window.event.ctrlKey : evt.ctrlKey;
var key = (window.event)? window.event.keyCode : evt.which;
key = String.fromCharCode(key).toLowerCase();
return (ctrlMod && (key in disabled))? false : true;
}






function notAllowed (nKeyCode)
 {
     if ( (78 == nKeyCode) && (event.ctrlKey) ) {
         alert ("Sorry, not allowed!");
     }
 }







             
function disableCtrlModifer(evt)
{
var disabled = {a:0, u:0, c:0, x:0, v:0};
var ctrlMod = (window.event)? window.event.ctrlKey : evt.ctrlKey;
var key = (window.event)? window.event.keyCode : evt.which;
key = String.fromCharCode(key).toLowerCase();
return (ctrlMod && (key in disabled))? false : true;
}



function getKeyCode(a)
{
 if (window.event)
    return window.event.keyCode;
 else if (a)
    return a.which;
 else
    return null;
}








function keyRestrict(e, validchars) {
 var key='', keychar='';
 key = getKeyCode(e);
 if (key == null) return true;
 keychar = String.fromCharCode(key);
 keychar = keychar.toLowerCase();
 validchars = validchars.toLowerCase();
 if (validchars.indexOf(keychar) != -1)
  return true;
 if ( key==null || key==0 || key==8 || key==9 || key==13 || key==27 )
  return true;
 return false;
}




//Disable right click script

var message="";
///////////////////////////////////
function clickIE() {
if (document.all) {
(message);
return false;
}}

function clickNS(e) {

if(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}

}
if (document.layers){
	
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS;

}else{
document.onmouseup=clickNS;document.oncontextmenu=clickIE;

}

}

document.oncontextmenu=new Function("return false");


			
function disableCtrlModifer(evt)
{
	
var disabled = {a:0, c:0, x:0, v:0};
var ctrlMod = (window.event)? window.event.ctrlKey : evt.ctrlKey;
var key = (window.event)? window.event.keyCode : evt.which;
key = String.fromCharCode(key).toLowerCase();
return (ctrlMod && (key in disabled))? false : true;
	
}

window.onload = clickNS;
//window.onKeyDown=return disableCtrlModifer(event);

//onLoad=" clickNS();" onKeyPress="return disableCtrlModifer(event);" onKeyDown="return disableCtrlModifer(event);"

function mouseDowndisable (){
// Internet Explorer:
if (document.all)
  document.onselectstart =
    function () { return false; };

// Netscape 4:
if (document.layers) {
  document.captureEvents(Event.MOUSEDOWN);
  document.onmousedown =
    function (evt) { return false; };
}

// Netscape 6:
document.onmousedown = function () { return false; };

	
}
//========================================END=================================

//==========================Header Image Function==============================

function header_image(id) {	
		var strURL="build_header_image.php?id="+id;
		var req = getXMLHTTP();
		if (req) {
			document.getElementById('header_image_div').style.display='';			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					if (req.status == 200) {	
	
	                document.getElementById('header_image_div').innerHTML= req.responseText;								
					
					}
					else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}	
				
				else {
	document.getElementById('header_image_div').innerHTML="<img align='center' src='images/ajax-loader.gif' style='padding:55px;' >";	
					
				}
					
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}	
		
	}

function header_image_caption(id) {	
		var strURL="build_header_image_caption.php?id="+id;
		var req = getXMLHTTP();
		if (req) {
			document.getElementById('header_image_caption').style.display='';			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					if (req.status == 200) {	
	
	                document.getElementById('header_image_caption').innerHTML= req.responseText;									
					
					}
					else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}	
				
				else {
	document.getElementById('header_image_caption').innerHTML="<img align='center' src='images/ajax-loader.gif' style='padding:55px;' >";
					
				}
					
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}	
		
	}
	
	
	
	function change_bg_over(ID){

	document.getElementById(ID).style.backgroundColor='#880000';
}
function change_bg_out(ID){
	document.getElementById(ID).style.backgroundColor='#CB8585';
}
//========================================END=================================
