var current_tbl_id;

function BookNow(tbl_id, htl, pkg) {
	
	if (!(document.getElementById("chk_frm")== undefined)) {
	var z=document.getElementById("chk_frm");
	document.getElementById(current_tbl_id).deleteRow(z.rowIndex)
	}  

	current_tbl_id = tbl_id;
	var x=document.getElementById(tbl_id).insertRow(1)
	x.id="chk_frm";
	document.getElementById('chk_frm').style.backgroundColor="#ece7ca";
	var y=x.insertCell(0);
//	y.className="mtext1";
//	y.innerHTML="<a href=\"javascript:hide_menu();\" title=\"Click here to close the booking form.\"><b>Close</b> </a>"

	y.id="add_cell";
	y.innerHTML="<font style=\"font-size: 8pt; font-family: Arial\">loading...</font>";
	var frm=document.f1;
	var param="";	
		param=noCacheString()+"&pkg="+encodeURIComponent(pkg);
		param+="&htl="+encodeURIComponent(htl);
//		param+="&pkg_day="+encodeURIComponent(pkg_day);
		
	var xmlHttp;
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return ;
	  } 
	var url=URL_LINK+"pkgtblav_ajx.asp";
	var str=param;
				xmlHttp.onreadystatechange=function getdataajax_stateChanged()
				{ 
				if (xmlHttp.readyState==4)
				{ 
					y.align="right";
					y.innerHTML=xmlHttp.responseText;
					setTimeout("start_cal_in()", 1000);
				}
				}
		
	xmlHttp.open("POST",url,true);
	xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); 
	xmlHttp.send(str);			
		
}

function BookNow2(tbl_id, htl, pkg) {
	
	if (!(document.getElementById("chk_frm")== undefined)) {
	var z=document.getElementById("chk_frm");
	document.getElementById(current_tbl_id).deleteRow(z.rowIndex)
	}  

	current_tbl_id = tbl_id;
	var x=document.getElementById(tbl_id).insertRow(1)
	x.id="chk_frm";
	document.getElementById('chk_frm').style.backgroundColor="#ece7ca";
	var y=x.insertCell(0);
//	y.className="mtext1";
//	y.innerHTML="<a href=\"javascript:hide_menu();\" title=\"Click here to close the booking form.\"><b>Close</b> </a>"

	y.id="add_cell";
	y.innerHTML="<font style=\"font-size: 8pt; font-family: Arial\">loading...</font>";
	var frm=document.f1;
	var param="";	
		param=noCacheString()+"&pkg="+encodeURIComponent(pkg);
		param+="&htl="+encodeURIComponent(htl);
//		param+="&pkg_day="+encodeURIComponent(pkg_day);
		
	var xmlHttp;
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return ;
	  } 
	var url=URL_LINK+"pkgtblav2_ajx.asp";
	var str=param;
				xmlHttp.onreadystatechange=function getdataajax_stateChanged()
				{ 
				if (xmlHttp.readyState==4)
				{ 
					y.align="right";
					y.innerHTML=xmlHttp.responseText;
					setTimeout("start_cal_inout()", 1000);
				}
				}
		
	xmlHttp.open("POST",url,true);
	xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); 
	xmlHttp.send(str);			
		
}

function chgpkg_date() {

	if (!(document.getElementById("chk_frm")== undefined)) {
	var z=document.getElementById("chk_frm");
	document.getElementById("tbl_date").deleteRow(z.rowIndex)
	}  

	var x=document.getElementById("tbl_date").insertRow(1)
	x.id="chk_frm";
	var y=x.insertCell(0);
	y.align="center";
	var t=document.getElementById("tag_pkg");
	t.innerHTML="<a href=\"javascript:closepkg_date()\">Close</a>&nbsp;";
	
	var frm1 = document.frmBookingForm2;
	var param="";	
		param=noCacheString()+"&pkg="+encodeURIComponent(frm1.rmtype0.value);
		param+="&htl="+encodeURIComponent(frm1.h_code.value);		
	var xmlHttp;
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return ;
	  } 
	var url=URL_LINK+"pkgchgdate_ajx.asp";
	var str=param;
				xmlHttp.onreadystatechange=function getdataajax_stateChanged()
				{ 
				if (xmlHttp.readyState==4)
				{ 
					y.innerHTML=xmlHttp.responseText;
					setTimeout("start_cal_in()", 1000);
				}
				}
		
	xmlHttp.open("POST",url,true);
	xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); 
	xmlHttp.send(str);
	
}

function chgpkg2_date() {

	if (!(document.getElementById("chk_frm")== undefined)) {
	var z=document.getElementById("chk_frm");
	document.getElementById("tbl_date").deleteRow(z.rowIndex)
	}  

	var x=document.getElementById("tbl_date").insertRow(1)
	x.id="chk_frm";
	var y=x.insertCell(0);
	y.align="center";
	var t=document.getElementById("tag_pkg");
	t.innerHTML="<a href=\"javascript:closepkg2_date()\">Close</a>&nbsp;";
	
	var frm1 = document.frmBookingForm2;
	var param="";	
		param=noCacheString()+"&pkg="+encodeURIComponent(frm1.rmtype0.value);
		param+="&htl="+encodeURIComponent(frm1.h_code.value);		
	var xmlHttp;
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return ;
	  } 
	var url=URL_LINK+"pkgchgdate2_ajx.asp";
	var str=param;
				xmlHttp.onreadystatechange=function getdataajax_stateChanged()
				{ 
				if (xmlHttp.readyState==4)
				{ 
					y.innerHTML=xmlHttp.responseText;
					setTimeout("start_cal_inout()", 1000);
				}
				}
		
	xmlHttp.open("POST",url,true);
	xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); 
	xmlHttp.send(str);
	
}

function closepkg_date() {

	var t=document.getElementById("tag_pkg");
	t.innerHTML="<a href=\"javascript:chgpkg_date();\" title=\"Click here to change the travel date.\">Change the travel date.</a>";

	if (!(document.getElementById("chk_frm")== undefined)) {
	var z=document.getElementById("chk_frm");
	document.getElementById("tbl_date").deleteRow(z.rowIndex)
	}  
	
}

function closepkg2_date() {

	var t=document.getElementById("tag_pkg");
	t.innerHTML="<a href=\"javascript:chgpkg2_date();\" title=\"Click here to change the travel date.\">Change the travel date.</a>";

	if (!(document.getElementById("chk_frm")== undefined)) {
	var z=document.getElementById("chk_frm");
	document.getElementById("tbl_date").deleteRow(z.rowIndex)
	}  
	
}

function chg_date() {

	if (!(document.getElementById("chk_frm")== undefined)) {
	var z=document.getElementById("chk_frm");
	document.getElementById("tbl_date").deleteRow(z.rowIndex)
	}  

	var x=document.getElementById("tbl_date").insertRow(1)
	x.id="chk_frm";
	var y=x.insertCell(0);
	y.align="center";
	var t=document.getElementById("tag_pkg");
	t.innerHTML="<a href=\"javascript:close_date()\">Close</a>&nbsp;";
	var param="";	
		param=noCacheString()		
	var xmlHttp;
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return ;
	  } 
	var url=URL_LINK+"chgdate_ajx.asp";
	var str=param;
				xmlHttp.onreadystatechange=function getdataajax_stateChanged()
				{ 
				if (xmlHttp.readyState==4)
				{ 
					y.innerHTML=xmlHttp.responseText;
					setTimeout("start_cal_inout()", 1000);
				}
				}
		
	xmlHttp.open("POST",url,true);
	xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); 
	xmlHttp.send(str);
	
}

function close_date() {

	var t=document.getElementById("tag_pkg");
	t.innerHTML="<a href=\"javascript:chg_date();\" title=\"Click here to change the travel date.\">Change Dates</a>";

	if (!(document.getElementById("chk_frm")== undefined)) {
	var z=document.getElementById("chk_frm");
	document.getElementById("tbl_date").deleteRow(z.rowIndex)
	}  
	
}
