/***********************************************************************************

                                 -~=+> NOTICE <+=~-

There are differences from the supplied rezgateway code in the following functions:

loadDataNew_H, buildOcc, buildOccHome (added), buildOccSpecial (added), befSubmit

buildOccSpecial is for the second search box (in left sidebar) on BOV's /hotels/

This file provides functonality to have multiple searches on a single page as opposed
to pkg_scripts.js which only allows for one search per page

This file has been put live and used instead of pkg_scripts.js as of 6/01/2010

***********************************************************************************/


var searchError=false;
var errorMsg=false;
var search	="";
var searchLoc="";
var searchLocHA="";
var showAllLoc=false;
var fireFox=false;
var showAllLoc=false;


var schemaName="ebg";
var subURL="http://rez.bestofvegas.com/"+schemaName+"";
//var subURL="http://192.168.1.72/"+schemaName+"";

function loadDataNew_H(eng_no){
setFields("H",eng_no);
document.forms["ResPkgSearchForm"].action=subURL+"/packaging/reservation/ResPkgSearchCriteria.do?ActionType=ResSearchHotels";
if (chkDates()){showError();return;}

var searchStr = document.forms["form_rez_"+eng_no].hid_H_Loc.value.split("|");
document.forms["ResPkgSearchForm"].searchCityId.value		= searchStr[0];
document.forms["ResPkgSearchForm"].searchCityName.value	= searchStr[1];
document.forms["ResPkgSearchForm"].searchStateId.value	= searchStr[2];
document.forms["ResPkgSearchForm"].searchCountryId.value	= searchStr[3];

document.forms["ResPkgSearchForm"].cmbCty_Hotels.value	= document.forms["ResPkgSearchForm"].searchCityId.value;
document.forms["ResPkgSearchForm"].cityLookup_Hotels.value	= document.forms["ResPkgSearchForm"].searchCityName.value;
document.forms["ResPkgSearchForm"].cmbSte_Hotels.value	= document.forms["ResPkgSearchForm"].searchStateId.value;
document.forms["ResPkgSearchForm"].cmbCtry_Hotels.value	= document.forms["ResPkgSearchForm"].searchCountryId.value;

//Checkin dates
document.forms["ResPkgSearchForm"].cmbInYr_Hotels.value	= document.forms["form_rez_"+eng_no].elements["H_In_"+eng_no+"_Year"].value;
document.forms["ResPkgSearchForm"].cmbInMn_Hotels.value	= document.forms["form_rez_"+eng_no].elements["H_In_"+eng_no+"_Month"].value;
document.forms["ResPkgSearchForm"].cmbInDt_Hotels.value	= document.forms["form_rez_"+eng_no].elements["H_In_"+eng_no+"_Date"].value;

//Checkout dates
document.forms["ResPkgSearchForm"].cmbOutYr_Hotels.value = document.forms["form_rez_"+eng_no].elements["H_Out_"+eng_no+"_Year"].value;
document.forms["ResPkgSearchForm"].cmbOutMn_Hotels.value = document.forms["form_rez_"+eng_no].elements["H_Out_"+eng_no+"_Month"].value;
document.forms["ResPkgSearchForm"].cmbOutDt_Hotels.value = document.forms["form_rez_"+eng_no].elements["H_Out_"+eng_no+"_Date"].value;

//Total Nights
var oNight = new Date();
var iCheckinNight = oNight.setFullYear(document.forms["form_rez_"+eng_no].elements["H_In_"+eng_no+"_Year"].value,document.forms["form_rez_"+eng_no].elements["H_In_"+eng_no+"_Month"].value-1,document.forms["form_rez_"+eng_no].elements["H_In_"+eng_no+"_Date"].value);
var iCheckoutNight = oNight.setFullYear(document.forms["form_rez_"+eng_no].elements["H_Out_"+eng_no+"_Year"].value,document.forms["form_rez_"+eng_no].elements["H_Out_"+eng_no+"_Month"].value-1,document.forms["form_rez_"+eng_no].elements["H_Out_"+eng_no+"_Date"].value);
document.forms["ResPkgSearchForm"].cmbNgt_Hotels.value = Math.round((( iCheckoutNight - iCheckinNight)/86400000));

//Total Rooms
document.forms["ResPkgSearchForm"].cmbNoRm_Hotels.value	= Number(document.forms["form_rez_"+eng_no].elements["H_cmbNoOfRooms"].options[document.forms["form_rez_"+eng_no].elements["H_cmbNoOfRooms"].selectedIndex].value);
document.forms["ResPkgSearchForm"].totRooms_Hotels.value	= Number(document.forms["form_rez_"+eng_no].elements["H_cmbNoOfRooms"].options[document.forms["form_rez_"+eng_no].elements["H_cmbNoOfRooms"].selectedIndex].value);

//Checkin dates again
document.forms["ResPkgSearchForm"].cmbInMn.value = document.forms["form_rez_"+eng_no].elements["H_In_"+eng_no+"_Month"].value;
document.forms["ResPkgSearchForm"].cmbInYr.value = document.forms["form_rez_"+eng_no].elements["H_In_"+eng_no+"_Year"].value;
document.forms["ResPkgSearchForm"].cmbInDt.value = document.forms["form_rez_"+eng_no].elements["H_In_"+eng_no+"_Date"].value;

//Checkout dates again
document.forms["ResPkgSearchForm"].cmbOutMn.value = document.forms["form_rez_"+eng_no].elements["H_Out_"+eng_no+"_Month"].value;
document.forms["ResPkgSearchForm"].cmbOutYr.value = document.forms["form_rez_"+eng_no].elements["H_Out_"+eng_no+"_Year"].value;
document.forms["ResPkgSearchForm"].cmbOutDt.value = document.forms["form_rez_"+eng_no].elements["H_Out_"+eng_no+"_Date"].value;

var totalAdults 	= 0;
var totalChildren	= 0;
var occupancyStr	= "";

if(document.forms["ResPkgSearchForm"].hotelCode_Hotels.value==""){
document.forms["ResPkgSearchForm"].shtcd_Hotels.value="0";
}
if(document.forms["ResPkgSearchForm"].occupancy_Details_Hotels.value==""){
document.forms["ResPkgSearchForm"].occupancy_Details_Hotels.value = "<room1Adult>1</room1Adults><room1Children>0</room1Children>";
}

var oneYear=Number(document.forms["form_rez_"+eng_no].elements["H_In_"+eng_no+"_Year"].value);

var onemon=Number(document.forms["form_rez_"+eng_no].elements["H_In_"+eng_no+"_Month"].value)+1;
var onedate=Number(document.forms["form_rez_"+eng_no].elements["H_In_"+eng_no+"_Date"].value);

var twYear=Number(document.forms["form_rez_"+eng_no].elements["H_Out_"+eng_no+"_Year"].value);
var twmon=Number(document.forms["form_rez_"+eng_no].elements["H_Out_"+eng_no+"_Month"].value)+1;
var twdate=Number(document.forms["form_rez_"+eng_no].elements["H_Out_"+eng_no+"_Date"].value);



document.forms["ResPkgSearchForm"].cmbtourOpt_Hotels.value="0";
document.forms["ResPkgSearchForm"].pkgType.value	= "H";

var stDate = new Date(oneYear,onemon,onedate);
var ndDate = new Date(twYear,twmon,twdate);
var one_day=1000*60*60*24;

var newHotelInDate=new Date(Number(document.forms["ResPkgSearchForm"].cmbInYr_Hotels.value),Number(document.forms["ResPkgSearchForm"].cmbInMn_Hotels.value)-1,Number(document.forms["ResPkgSearchForm"].cmbInDt_Hotels.value),0,0,0,0);

var newHotelOutDate=new Date(Number(document.forms["ResPkgSearchForm"].cmbOutYr_Hotels.value),Number(document.forms["ResPkgSearchForm"].cmbOutMn_Hotels.value)-1,Number(document.forms["ResPkgSearchForm"].cmbOutDt_Hotels.value),0,0,0,0);

var hotelDtDiff=Number(get_deference(newHotelInDate,newHotelOutDate));	
var today = new Date();
var checkHotPastDt = Number(get_deference(today,newHotelInDate));
var dif = Math.ceil((ndDate.getTime()-stDate.getTime())/(one_day)); 
if(Number(checkHotPastDt) < -0){
alert("The arrival date you specified is invalid. Please search for future dates");
}else if(Number(hotelDtDiff) <= 0){
alert("Invalid search criteria. Please make sure your checkout date is after your checkin date");
}else if (dif >=31){
alert("You can only book maximum of 31 nights");
}else{
befSubmit('H');
if(window.loadSplash) loadSplash();
document.forms["ResPkgSearchForm"].submit();
}}

if (navigator.userAgent.indexOf("Firefox")>-1){fireFox=true;}

var _month = new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");

if (!fireFox){
var ixp_ie = (document.all)? true:false;
if (!ixp_ie) window.captureEvents(Event.CLICK)
document.onclick = getMouseXY;
}

calShown=false;
var activeDateObjNM="";
var activeDateObjIO="";
function retDate(add){
var tmpd= new Date();
var tmpd1= new Date(tmpd.setDate(tmpd.getDate()+add));
return new Date(tmpd1.getFullYear(),tmpd1.getMonth(),tmpd1.getDate(),0,0,0,0);
}
var maxChis=0;
var _MouseX=0;
var _MouseY=0;

function getMouseXY(e) {
if (ixp_ie) {_MouseX=event.clientX+document.body.scrollLeft;_MouseY=event.clientY+document.body.scrollTop;
}else{if (fireFox){_MouseX = e.pageX;_MouseY = e.pageY;}}  
if (_MouseX<0){_MouseX=0}
if (_MouseY<0){_MouseY=0}  
hide_things();
return true
}

function hide_things(){
try{
setObjPos('ixpDataFrame',0,0,0,0,'none');
}catch(ex){}
try{
setObjPos('maskFrame',0,0,0,0,'none');
}catch(ex){}
}

var toDay = new retDate(0);
var _InDate = new retDate(2);

var _OutDate = new retDate(3);
function twoChar(val){
var tval=""+val+"";
if (tval.length<2){return "0"+val+"";}else{return ""+val+"";}
}
var numToday=Number(""+toDay.getFullYear()+""+twoChar(Number(toDay.getMonth())+1)+""+twoChar(toDay.getDate())+"");


function maxdays(mm,yy){
var maxd;
if (mm==1){
if(yy%4==0){return 29;}else{maxd=28;}
}else if (mm==0 || mm==2 || mm==4 || mm==6 || mm==7 || mm==9 || mm==11){
maxd=31;
}else{
maxd=30;
}
return maxd;
}

function dateOpts(days,date){
var ixpoptDays="";
var sel="";
for (var ixpa=0; ixpa<days; ixpa++){
if (date==(ixpa+1)){sel=" selected";}else{sel="";}
if (ixpa<9){
ixpoptDays+="<option value=\"0"+(ixpa+1)+"\""+sel+">0"+(ixpa+1)+"</option>";
}else{
ixpoptDays+="<option value=\""+(ixpa+1)+"\""+sel+">"+(ixpa+1)+"</option>";	
}
}
return ixpoptDays;
}
function monthOpts(setmonth){
var sel="";
var  m_months= new Array("January","February","March","April","May","June","July","August","September","October","November","December");
var optMonths="";
for (var ixpb=0; ixpb<m_months.length; ixpb++){
if (setmonth==ixpb){sel=" selected";}else{sel="";}
optMonths+="<option value=\""+ixpb+"\""+sel+">"+m_months[ixpb]+"</option>";
}
return optMonths;
}
function dateCombo(objNm,inout,eng_no,year,month,date) {
retStr="";
if (inout=="_In"){
retStr="<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"+
"<tr>"+
"<td><select name=\""+objNm+inout+'_'+eng_no+"_Date\" onChange=\"setDtOptIn('"+objNm+"','"+inout+"',this,"+eng_no+");\">"+dateOpts(maxdays(month,year),date)+
"</select></td>"+
"<td><img src=\"images/s.gif\" width=\"1\" height=\"1\"></td>"+
"<td><select name=\""+objNm+inout+'_'+eng_no+"_Month\" onChange=\"setDtOptIn('"+objNm+"','"+inout+"',this,"+eng_no+");\">"+monthOpts(month)+
"</select></td>"+
"<td><img src=\"images/s.gif\" width=\"1\" height=\"1\"></td>"+
"<td><select name=\""+objNm+inout+'_'+eng_no+"_Year\" onChange=\"setDtOptIn('"+objNm+"','"+inout+"',this,"+eng_no+");\">";	
}else{
retStr="<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"+
"<tr>"+
"<td><select name=\""+objNm+inout+'_'+eng_no+"_Date\" onChange=\"setDtOptIn('"+objNm+"','"+inout+"',this,"+eng_no+");\">"+dateOpts(maxdays(month,year),date)+
"</select></td>"+
"<td><img src=\"images/s.gif\" width=\"1\" height=\"1\"></td>"+
"<td><select name=\""+objNm+inout+'_'+eng_no+"_Month\" onChange=\"setDtOptIn('"+objNm+"','"+inout+"',this,"+eng_no+");\">"+monthOpts(month)+
"</select></td>"+
"<td><img src=\"images/s.gif\" width=\"1\" height=\"1\"></td>"+
"<td><select name=\""+objNm+inout+'_'+eng_no+"_Year\" onChange=\"setDtOptIn('"+objNm+"','"+inout+"',this,"+eng_no+");\">";	
}

var ixpc=3;
if (inout.indexOf("_Out")>-1){ixpc=4;}
for (ixpd=0; ixpd<ixpc; ixpd++){
var tmpy=""+(toDay.getFullYear()+ixpd)+"";
if (year==tmpy){
retStr+="<option value=\""+tmpy+"\" selected>"+tmpy+"</option>";	
}else{
retStr+="<option value=\""+tmpy+"\">"+tmpy+"</option>";	
}
}
retStr+="</select></td>"+
"<td><img src=\"images/s.gif\" width=\"3\" height=\"1\"></td>"+
"<td><a href=\"JavaScript:void(0)\" onClick=\"loadixpCal('"+objNm+"','"+inout+"','"+eng_no+"');\"><img name=\""+objNm+""+inout+"_"+eng_no+"\" src=\"images/cal_new.gif\" width=\"18\" height=\"18\" border=\"0\"></a></td>"+
"</tr>"+
"</table>";
return retStr;
}

function loadixpCal(nm,inout,eng_no){
activeDateObjNM=nm;
activeDateObjIO=inout;
activeDateObjeng_no=eng_no;
setcalPos('show',""+nm+""+inout+"_"+eng_no);
}

function setcalPos(stat,obj){
with(document.getElementById("calFrame")){
if (stat=="show"){
style.left=getPosImg(obj,"left")+18;
style.top=getPosImg(obj,"top");
style.width=185;style.height=220;
style.display="block";
calShown=true;
}else{
style.display="none";
style.left=0;style.top=0;style.width=0;style.height=0;
calShown=false;
}}}

function opts(st,end,sel){
var retStr="";
for (var ixpe=st; ixpe<=end; ixpe++){
if (!isNaN(sel)){
if (sel==ixpe){
retStr+="<option value=\""+ixpe+"\" selected>"+ixpe+"</option>\n";
}else{
retStr+="<option value=\""+ixpe+"\">"+ixpe+"</option>\n";
}		
}else{
retStr+="<option value=\""+ixpe+"\">"+ixpe+"</option>\n";
}
}
return retStr;
}

function showRooms(num,eng_no){
setTimeout("showRoomsset("+num+","+eng_no+")",1);
}


function showRoomsset(num,eng_no){
for (ixpg=1; ixpg<=5; ixpg++){
if (ixpg<=num){
try{document.getElementById("occR_"+eng_no+""+ixpg+"").style.display="block";}catch(ex){}
}else{
try{document.getElementById("occR_"+eng_no+""+ixpg+"").style.display="none";}catch(ex){}
}
}
setSelRoomOcc(eng_no);
}


function setDtOptIn(type,inout,obj,eng_no){
var maxDates = maxdays(Number(document.forms["form_rez_"+eng_no].elements[""+(type+inout)+"_"+eng_no+"_Month"].options[document.forms["form_rez_"+eng_no].elements[""+(type+inout)+"_"+eng_no+"_Month"].selectedIndex].value),Number(document.forms["form_rez_"+eng_no].elements[""+(type+inout)+"_"+eng_no+"_Year"].options[document.forms["form_rez_"+eng_no].elements[""+(type+inout)+"_"+eng_no+"_Year"].selectedIndex].value));
var addopts=true;
try{
if (obj.name.indexOf("Date")>-1 && document.forms["form_rez_"+eng_no].elements[""+(type+inout)+"_"+eng_no+"_Date"].options.length==maxDates){addopts=false;}
}catch(ex){}
if (addopts){
//loadOpts(maxDates,type+inout+'Date',eng_no);
}
if (inout=="_Out"){
setNights(type,eng_no);
}else{
setOutDate(type,inout,eng_no);
}
}

function setOutDate(type,inout,eng_no){
var tmpOutDate;
with(document.forms["form_rez_"+eng_no]){
tmpOutDate = new Date(elements[""+(type+inout)+"_"+eng_no+"_Year"].options[elements[""+(type+inout)+"_"+eng_no+"_Year"].selectedIndex].value,elements[""+(type+inout)+"_"+eng_no+"_Month"].options[elements[""+(type+inout)+"_"+eng_no+"_Month"].selectedIndex].value,elements[""+(type+inout)+"_"+eng_no+"_Date"].options[elements[""+(type+inout)+"_"+eng_no+"_Date"].selectedIndex].value,0,0,0,0);
//alert("ssaasas"+tmpOutDate);
tmpOutDate = new Date(tmpOutDate.setDate(tmpOutDate.getDate()+Number(elements[""+type+"_nights"].value)));

elements[""+type+"_Out"+"_"+eng_no+"_Year"].selectedIndex=Number(tmpOutDate.getFullYear())-Number(toDay.getFullYear());
elements[""+type+"_Out"+"_"+eng_no+"_Month"].selectedIndex=Number(tmpOutDate.getMonth());
var tmpmaxDates = maxdays(Number(elements[""+type+"_Out_"+eng_no+"_Month"].options[elements[""+type+"_Out_"+eng_no+"_Month"].selectedIndex].value),Number(elements[""+type+"_Out_"+eng_no+"_Year"].options[elements[""+type+"_Out_"+eng_no+"_Year"].selectedIndex].value));
setTimeout("loadOpts("+tmpmaxDates+",'"+type+"_Out_"+eng_no+"_Date',"+(Number(tmpOutDate.getDate())-1)+","+eng_no+")",0);
}}

function loadOpts(opts,name,setDt,eng_no){
var selInd=document.forms["form_rez_"+eng_no].elements[name].selectedIndex;
document.forms["form_rez_"+eng_no].elements[name].options.length=0;
for (ixpk=0; ixpk<opts; ixpk++){
if (ixpk<9){
document.forms["form_rez_"+eng_no].elements[name].options[ixpk]= new Option("0"+(ixpk+1)+"","0"+(ixpk+1)+"");
}else{
document.forms["form_rez_"+eng_no].elements[name].options[ixpk]= new Option(ixpk+1,ixpk+1);
}
}
if (setDt>-1){
document.forms["form_rez_"+eng_no].elements[name].selectedIndex=setDt;
}else{
if (selInd>=opts){
document.forms["form_rez_"+eng_no].elements[name].selectedIndex=opts-1;
}else{
document.forms["form_rez_"+eng_no].elements[name].selectedIndex=selInd;
}}}

function setOut(type){
var tmpInDate = new Date(document.forms["form_rez"].elements[""+type+"_InYear"].options[document.forms["form_rez"].elements[""+type+"_InYear"].selectedIndex].value,document.forms["form_rez"].elements[""+type+"_InMonth"].options[document.forms["form_rez"].elements[""+type+"_InMonth"].selectedIndex].value,document.forms["form_rez"].elements[""+type+"_InDate"].options[document.forms["form_rez"].elements[""+type+"_InDate"].selectedIndex].value,0,0,0,0);
var tmpOutDate = new Date(tmpInDate.setDate(tmpInDate.getDate()+Number(document.forms["form_rez"].elements[""+type+"_nights"].value)));
document.forms["form_rez"].elements[""+type+"_OutYear"].selectedIndex=tmpOutDate.getFullYear()-toDay.getFullYear();
document.forms["form_rez"].elements[""+type+"_OutMonth"].selectedIndex=tmpOutDate.getMonth();
var maxDates = maxdays(Number(document.forms["form_rez"].elements[""+type+"_OutMonth"].options[document.forms["form_rez"].elements[""+type+"_OutMonth"].selectedIndex].value),Number(document.forms["form_rez"].elements[""+type+"_OutYear"].options[document.forms["form_rez"].elements[""+type+"_OutYear"].selectedIndex].value));
loadOpts(maxDates,""+type+"_OutDate");
document.forms["form_rez"].elements[""+type+"_OutDate"].selectedIndex=tmpOutDate.getDate()-1;
}

function setNights(type,eng_no){
var tmpInDate = new Date(document.forms["form_rez_"+eng_no].elements[""+type+"_In_"+eng_no+"_Year"].options[document.forms["form_rez_"+eng_no].elements[""+type+"_In_"+eng_no+"_Year"].selectedIndex].value,Number(document.forms["form_rez_"+eng_no].elements[""+type+"_In_"+eng_no+"_Month"].options[document.forms["form_rez_"+eng_no].elements[""+type+"_In_"+eng_no+"_Month"].selectedIndex].value),document.forms["form_rez_"+eng_no].elements[""+type+"_In_"+eng_no+"_Date"].options[document.forms["form_rez_"+eng_no].elements[""+type+"_In_"+eng_no+"_Date"].selectedIndex].value,0,0,0,0);
var tmpOutDate = new Date(document.forms["form_rez_"+eng_no].elements[""+type+"_Out_"+eng_no+"_Year"].options[document.forms["form_rez_"+eng_no].elements[""+type+"_Out_"+eng_no+"_Year"].selectedIndex].value,Number(document.forms["form_rez_"+eng_no].elements[""+type+"_Out_"+eng_no+"_Month"].options[document.forms["form_rez_"+eng_no].elements[""+type+"_Out_"+eng_no+"_Month"].selectedIndex].value),document.forms["form_rez_"+eng_no].elements[""+type+"_Out_"+eng_no+"_Date"].options[document.forms["form_rez_"+eng_no].elements[""+type+"_Out_"+eng_no+"_Date"].selectedIndex].value,0,0,0,0);
var diffe=Number(get_deference(tmpInDate,tmpOutDate));
if (diffe<=31 && diffe>0){
document.forms["form_rez_"+eng_no].elements[""+type+"_nights"].value=diffe;
}
}


function get_deference(ind,oud){
var milSec=parseInt(oud-ind);
var ret_val=milSec/86400000;
return ret_val;
}


function getPosImg(imgElem,ops) {
if (ops=="top"){
ixppos = document.images[imgElem].offsetTop;
tempEl = document.images[imgElem].offsetParent;
	while (tempEl != null) {
		ixppos += tempEl.offsetTop;
		tempEl = tempEl.offsetParent;
	}
return ixppos;
}else if (ops=="left"){
ixppos = document.images[imgElem].offsetLeft;
tempEl = document.images[imgElem].offsetParent;
	while (tempEl != null) {
		ixppos += tempEl.offsetLeft;
		tempEl = tempEl.offsetParent;
	}

return ixppos;
}
}

function showRes(img,outSt,records){
setObjPos('ixpDataFrame',getPosImg(img,'left'),getPosImg(img,'top'),200,records,'block');
setObjPos('maskFrame',getPosImg(img,'left'),getPosImg(img,'top'),200,records,'block');
document.getElementById("ixpDataFrame").innerHTML=outSt;
}

function setObjPos(name,x,y,w,recs,stat,records){
with(document.getElementById(name).style){
left=x;top=y-1;width=w;height=recs*23;display=stat;
}
}

function getSelVal(fr,nm){
try{
return; 
}catch(exp){
alert(nm)
return document.forms[fr].elements[nm].value;
}

}
var sel_adlts=0;
var sel_chis=0;
var set_agelist="";
function setFields(eng,eng_no){
with(document.forms["ResPkgSearchForm"]){
cmbInMn.value=Number(getSelVal("form_rez_"+eng_no,""+eng+"_InMonth"))+1;
cmbInDt.value=getSelVal("form_rez_"+eng_no,""+eng+"_InDate");
cmbInYr.value=getSelVal("form_rez_"+eng_no,""+eng+"_InYear");
cmbOutMn.value=Number(getSelVal("form_rez_"+eng_no,""+eng+"_OutMonth"))+1;
cmbOutDt.value=getSelVal("form_rez_"+eng_no,""+eng+"_OutDate");
cmbOutYr.value=getSelVal("form_rez_"+eng_no,""+eng+"_OutYear");

if (eng!="A"){
setAdults_Chi_Gstlst(Number(getSelVal("form_rez_"+eng_no,""+eng+"_cmbNoOfRooms")),eng_no);
cmbAdlt.value=sel_adlts;
if (document.forms["ResPkgSearchForm"].elements["accommodationType"].value=="HT"){
	cmbNoRm.value=getSelVal("form_rez_"+eng_no,""+eng+"_cmbNoOfRooms");
}else{
	cmbNoRm.value=sel_adlts;
}
cmbChi.value=sel_chis;
gstLst.value=set_agelist;
}
cmbNgt.value=getSelVal("form_rez_"+eng_no,""+eng+"_nights");

try{
	searchLoc=document.forms["form_rez_"+eng_no].elements["hid_"+eng+"_Loc"].value.split("|");
	cmbCty.value=searchLoc[0];
	ctyNm.value=searchLoc[1];
	cmbSte.value=searchLoc[2];
	cmbCtry.value=searchLoc[3];
}catch(ex){
}}}

function setAdults_Chi_Gstlst(val,eng_no){
var AccomVal=document.forms["ResPkgSearchForm"].elements["accommodationType"].value;
with (document.forms["form_rez_"+eng_no]){
if (AccomVal=="HT"){
_noR = Number(elements["H_cmbNoOfRooms"].options[elements["H_cmbNoOfRooms"].selectedIndex].value);
	for (var _NOR=0; _NOR<_noR; _NOR++){
		sel_adlts+=Number(elements["R"+(_NOR+1)+"occAdults"].options[elements["R"+(_NOR+1)+"occAdults"].selectedIndex].value);
		sel_chis+=Number(elements["R"+(_NOR+1)+"occChi"].options[elements["R"+(_NOR+1)+"occChi"].selectedIndex].value);
	}

}else if (AccomVal=="HS"){
sel_adlts=Number(elements["H_Adults"].options[elements["H_Adults"].selectedIndex].value);
sel_chis=0;
}
}
set_agelist=document.forms["ResPkgSearchForm"].elements["gstLst"].value;
}

function chkDates(){
with(document.forms["ResPkgSearchForm"]){
var idtNum=Number(""+cmbInYr.value+""+twoChar(cmbInMn.value)+""+twoChar(cmbInDt.value)+"");
var odtNum=Number(""+cmbOutYr.value+""+twoChar(cmbOutMn.value)+""+twoChar(cmbOutDt.value)+"");
var tpInDate = new Date(cmbInYr.value,Number(cmbInMn.value)-1,cmbInDt.value,0,0,0,0);
var tpOutDate = new Date(cmbOutYr.value,Number(cmbOutMn.value)-1,cmbOutDt.value,0,0,0,0);
}
var diff=Number(get_deference(tpInDate,tpOutDate));
if (numToday>idtNum){
searchError=true;
errorMsg="Arrival Date Should be Greater Than Today's Date";
return true;
}
if (idtNum>odtNum){
searchError=true;
errorMsg="Departure Date Should be Greater Than Arrival Date";
return true;
}
if (diff>31){
searchError=true;
errorMsg="You Can Book Maximum of 31 Nights";
return true;
}
return false;
}


function showError(){
document.getElementById("errorMSG").innerHTML=errorMsg;
document.getElementById("errorTBL").style.display="block";
setTimeout("hideError()",2500);
}

function hideError(){
document.getElementById("errorMSG").innerHTML="";
document.getElementById("errorTBL").style.display="none";
errorMsg="";
searchError=false;
}

function setSelRoomOcc(eng_no){
var _noR="";
var _nChi="";
var tempOcc="";
var totAdlt=0;
var totChi=0;
var adlts=0;
var occupancyStr="";
var AccomVal=document.forms["ResPkgSearchForm"].elements["accommodationType"].value;
if (AccomVal=="HT"){

with (document.forms["form_rez_"+eng_no]){
_noR = Number(elements["H_cmbNoOfRooms"].options[elements["H_cmbNoOfRooms"].selectedIndex].value);

for (var _NOR=0; _NOR<_noR; _NOR++){
adlts = Number(elements["R"+(_NOR+1)+"occAdults"].options[elements["R"+(_NOR+1)+"occAdults"].selectedIndex].value);			
tempOcc+=elements["R"+(_NOR+1)+"occAdults"].options[elements["R"+(_NOR+1)+"occAdults"].selectedIndex].value+"|";
_nChi=Number(elements["R"+(_NOR+1)+"occChi"].options[elements["R"+(_NOR+1)+"occChi"].selectedIndex].value);

tempOcc+=_nChi+"|";
	if (_nChi>0){
		for (var _Nch=0; _Nch<_nChi; _Nch++){
			tempOcc+=elements["R"+(_NOR+1)+"occAge_"+eng_no+(_Nch+1)+""].options[elements["R"+(_NOR+1)+"occAge_"+eng_no+(_Nch+1)+""].selectedIndex].value;
			if ((_Nch+1)!=_nChi){tempOcc+=",";}
		}
		tempOcc+="|%|%@";
	}else{
		tempOcc+="-|%|%@";
	}
totAdlt+=adlts;
totChi+=_nChi;
occupancyStr = occupancyStr+"<room"+(_NOR+1)+"Adults>"+adlts+"</room"+(_NOR+1)+"Adults>"+"<room"+(_NOR+1)+"Children>"+_nChi+"</room"+(_NOR+1)+"Children>";
}

}

}else if (AccomVal=="HS"){
tempOcc="";
with (document.forms["form_rez"]){
var HSAdults=Number(elements["H_Adults"].options[elements["H_Adults"].selectedIndex].value);
for (var dfg=0; dfg<HSAdults; dfg++){
	tempOcc+="1|0|-|%|%@";
	}	}}

	document.forms["ResPkgSearchForm"].occupancy_Details_Hotels.value 	= occupancyStr;
	document.forms["ResPkgSearchForm"].totAdlt_Hotels.value				= totAdlt;
	document.forms["ResPkgSearchForm"].totChi_Hotels.value				= totChi;
	document.forms["ResPkgSearchForm"].elements["gstLst_Hotels"].value	= tempOcc;
}

function showAgCom(val,rm,eng_no){
setTimeout("showAgComset("+val+",'"+rm+"',"+eng_no+")",1);
}

function showAgComset(val,rm,eng_no){
if (val==0){
try{document.getElementById("R"+rm+""+eng_no+"_ageTbl").style.display="none";}catch(ex){}
}else{
try{document.getElementById("R"+rm+""+eng_no+"_ageTbl").style.display="block";}catch(ex){}
}
for (var fgh=1; fgh<=3; fgh++){
if (fgh<=val){
document.getElementById("R"+rm+"chAgHd_"+eng_no+fgh+"").style.display="block";
document.getElementById("R"+rm+"occAge_"+eng_no+fgh+"").style.display="block";
}else{
document.getElementById("R"+rm+"chAgHd_"+eng_no+fgh+"").style.display="none";
document.getElementById("R"+rm+"occAge_"+eng_no+fgh+"").style.display="none";
}}}

function buildOccRez(eng_no){
var occStr="";
var _sty="";
for (var oc=0; oc<5; oc++){
if(oc==0){_sty="block";}else{_sty="none";}
occStr+="<span id=\"occR_"+eng_no+""+(oc+1)+"\" style=\"display:"+_sty+";\"><table width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">\n"+
"<tr>\n"+
"<td width=\"25%\" class=\"txt\">&nbsp;&nbsp;Room&nbsp;"+(oc+1)+"&nbsp;</td>\n"+
"<td width=\"25%\" class=\"txt\">Adults</td>\n"+
"<td width=\"25%\" class=\"txt\">Children</td>\n"+
"<td width=\"25%\" class=\"txt\"><img src=\"images/ixps.gif\" width=\"1\" height=\"1\"></td>\n"+
"</tr>\n"+
"<tr>\n"+
"<td width=\"25%\"><img src=\"images/ixps.gif\" width=\"1\" height=\"1\"></td>\n"+
"<td width=\"25%\"><select name=\"R"+(oc+1)+"occAdults\" style=\"width:40px;\" onChange=\"setSelRoomOcc("+eng_no+");\">\n"+opts(1,10,1)+"</select></td>\n"+
"<td width=\"25%\"><select name=\"R"+(oc+1)+"occChi\" style=\"width:40px;\" onChange=\"setSelRoomOcc("+eng_no+");showAgCom(Number(this.options[this.selectedIndex].value),"+(oc+1)+","+eng_no+");\">\n"+opts(0,3,0)+"</select></td>\n"+
"<td width=\"25%\" class=\"txt\"><img src=\"images/ixps.gif\" width=\"1\" height=\"1\"></td>\n"+
"</tr>\n"+
"<tr>\n"+
"<td colspan=\"4\"><span id=\"R"+(oc+1)+""+eng_no+"_ageTbl\" style=\"display:none;\"><table width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">\n"+
"<tr>\n"+
"<td width=\"25%\"><img src=\"images/ixps.gif\" width=\"1\" height=\"1\"></td>\n"+
"<td width=\"25%\" class=\"txt\"><span id=\"R"+(oc+1)+"chAgHd_"+eng_no+"1\" style=\"display:none;\">Age 1</span></td>\n"+
"<td width=\"25%\" class=\"txt\"><span id=\"R"+(oc+1)+"chAgHd_"+eng_no+"2\" style=\"display:none;\">Age 2</span></td>\n"+
"<td width=\"25%\" class=\"txt\"><span id=\"R"+(oc+1)+"chAgHd_"+eng_no+"3\" style=\"display:none;\">Age 3</span></td>\n"+
"</tr>\n"+
"<tr>\n"+
"<td width=\"25%\"><img src=\"images/ixps.gif\" width=\"1\" height=\"1\"></td>\n"+
"<td width=\"25%\"><select id=\"R"+(oc+1)+"occAge_"+eng_no+"1\" name=\"R"+(oc+1)+"occAge_"+eng_no+"1\" style=\"width:40px;display:none;\" onChange=\"setSelRoomOcc("+eng_no+");\">\n"+opts(1,18,1)+"</select></td>\n"+
"<td width=\"25%\"><select id=\"R"+(oc+1)+"occAge_"+eng_no+"2\" name=\"R"+(oc+1)+"occAge_"+eng_no+"2\" style=\"width:40px;display:none;\" onChange=\"setSelRoomOcc("+eng_no+");\">\n"+opts(1,18,1)+"</select></td>\n"+
"<td width=\"25%\"><select id=\"R"+(oc+1)+"occAge_"+eng_no+"3\" name=\"R"+(oc+1)+"occAge_"+eng_no+"3\" style=\"width:40px;display:none;\" onChange=\"setSelRoomOcc("+eng_no+");\">\n"+opts(1,18,1)+"</select></td>\n"+
"</tr>\n"+
"</table>\n"+
"</span></td>\n"+
"</tr>\n"+
"<tr align=\"center\">\n"+
"<td colspan=\"4\"><img src=\"images/ixps.gif\" width=\"1\" height=\"5\"></td>\n"+
"</tr>\n"+
"</table>\n";
}
return occStr;
}

function buildOcc(eng_no){
var occStr="";
var _sty="";

for (var oc=0; oc<5; oc++){
	if(oc==0){
		_sty="block";
	}else{
		_sty="none";
	}
	occStr += '<span id="occR_' + eng_no + '' + (oc+1) + '" style="display:' + _sty + ';">'
	+ '<table border="0" cellpadding="0" cellspacing="0" style="font-family:Arial,Helvetica,sans-serif;font-size:10px;font-weight:bold;">\n'
	+	'<tr>\n'
	+ 		'<td style="vertical-align:top;padding-top:3px;" valign="bottom">'
	//+			'<div style="font-weight:bold;">Rm #'+ (oc+1) + '</div>'
	+			'<select name="R' + (oc+1) + 'occAdults" style="width:40px;" onChange="setSelRoomOcc('+eng_no+');">\n' + opts(1,10,1) + '</select>'
	+			'<span style="padding-left:34px;"></span>'
	+			'<select id="children" name="R' + (oc+1) + 'occChi" style="width:40px;" onChange="hotelSearchDisplayer();setSelRoomOcc('+eng_no+');showAgCom(Number(this.options[this.selectedIndex].value),' + (oc+1) + ', '+ eng_no +');">\n' + opts(0,3,0) + '</select></td>\n'
	+	'</tr><tr>\n'
	+		'<td colspan="3" align="left">\n<span id="R' + (oc+1) + '' + eng_no + '_ageTbl" style="display:none;">'
	+			'<div><table border="0" cellpadding="0" cellspacing="0" style="font-family:Arial,Helvetica,sans-serif;font-size:10px;font-weight:bold;">\n'
	+				'<tr>\n'
	+					'<td style="text-align:center;" valign="bottom"><span id="R' + (oc+1) + 'chAgHd_'+eng_no+'1" style="display:none;">Age 1</span></td>\n'
	+					'<td style="text-align:center;" valign="bottom"><span id="R' + (oc+1) + 'chAgHd_'+eng_no+'2" style="display:none;">Age 2</span></td>\n'
	+					'<td style="text-align:center;" valign="bottom"><span id="R' + (oc+1) + 'chAgHd_'+eng_no+'3" style="display:none;">Age 3</span></td>\n'
	//+					'<td style="text-align:center;" valign="bottom"><span id="R' + (oc+1) + 'chAgHd4" style="display:none;">Age 4</span></td>\n'
	+				'</tr><tr>'
	+					'<td><select id="R' + (oc+1) + 'occAge_'+eng_no+'1" name="R' + (oc+1) + 'occAge_'+eng_no+'1" style="display:none;" onChange="setSelRoomOcc('+eng_no+');">\n' + opts(1,18,1) + '</select></td>\n'
	+					'<td><select id="R' + (oc+1) + 'occAge_'+eng_no+'2" name="R' + (oc+1) + 'occAge_'+eng_no+'2" style="display:none;" onChange="setSelRoomOcc('+eng_no+');">\n' + opts(1,18,1) + '</select></td>\n'
	+					'<td><select id="R' + (oc+1) + 'occAge_'+eng_no+'3" name="R' + (oc+1) + 'occAge_'+eng_no+'3" style="display:none;" onChange="setSelRoomOcc('+eng_no+');">\n' + opts(1,18,1) + '</select></td>\n'
	//+					'<td><select id="R' + (oc+1) + 'occAge4" name="R' + (oc+1) + 'occAge4" style="display:none;" onChange="setSelRoomOcc();">\n' + opts(1,17,1) + '</select></td>\n'
	+				'</tr>\n'
	+		'</table></div></span></td></tr>\n'
	+	'</table>\n'
}
return occStr;
}


function buildOccSpecial(eng_no){
var occStr="";
var _sty="";

for (var oc=0; oc<5; oc++){
	if(oc==0){
		_sty="block";
	}else{
		_sty="none";
	}
	occStr += '<span id="occR_' + eng_no + '' + (oc+1) + '" style="display:' + _sty + ';">'
	+ '<table border="0" cellpadding="0" cellspacing="0" style="font-family:Arial,Helvetica,sans-serif;font-size:10px;font-weight:bold;">\n'
	+	'<tr>\n'
	+ 		'<td style="vertical-align:top;padding-top:3px;" valign="bottom">'
	//+			'<div style="font-weight:bold;">Rm #'+ (oc+1) + '</div>'
	+			'<select name="R' + (oc+1) + 'occAdults" style="width:40px;" onChange="setSelRoomOcc('+eng_no+');">\n' + opts(1,10,1) + '</select>'
	+			'<span style="padding-left:20px;"></span>'
	+			'<select id="children" name="R' + (oc+1) + 'occChi" style="width:40px;" onChange="hotelSearchDisplayer();setSelRoomOcc('+eng_no+');showAgCom(Number(this.options[this.selectedIndex].value),' + (oc+1) + ', '+ eng_no +');">\n' + opts(0,3,0) + '</select></td>\n'
	+	'</tr><tr>\n'
	+		'<td colspan="3" align="left">\n<span id="R' + (oc+1) + '' + eng_no + '_ageTbl" style="display:none;">'
	+			'<div><table border="0" cellpadding="0" cellspacing="0" style="font-family:Arial,Helvetica,sans-serif;font-size:10px;font-weight:bold;">\n'
	+				'<tr>\n'
	+					'<td style="text-align:center;" valign="bottom"><span id="R' + (oc+1) + 'chAgHd_'+eng_no+'1" style="display:none;">Age 1</span></td>\n'
	+					'<td style="text-align:center;" valign="bottom"><span id="R' + (oc+1) + 'chAgHd_'+eng_no+'2" style="display:none;">Age 2</span></td>\n'
	+					'<td style="text-align:center;" valign="bottom"><span id="R' + (oc+1) + 'chAgHd_'+eng_no+'3" style="display:none;">Age 3</span></td>\n'
	+				'</tr><tr>'
	+					'<td><select id="R' + (oc+1) + 'occAge_'+eng_no+'1" name="R' + (oc+1) + 'occAge_'+eng_no+'1" style="display:none;" onChange="setSelRoomOcc('+eng_no+');">\n' + opts(1,18,1) + '</select></td>\n'
	+					'<td><select id="R' + (oc+1) + 'occAge_'+eng_no+'2" name="R' + (oc+1) + 'occAge_'+eng_no+'2" style="display:none;" onChange="setSelRoomOcc('+eng_no+');">\n' + opts(1,18,1) + '</select></td>\n'
	+					'<td><select id="R' + (oc+1) + 'occAge_'+eng_no+'3" name="R' + (oc+1) + 'occAge_'+eng_no+'3" style="display:none;" onChange="setSelRoomOcc('+eng_no+');">\n' + opts(1,18,1) + '</select></td>\n'
	+				'</tr>\n'
	+		'</table></div></span></td></tr>\n'
	+	'</table>\n'
}
return occStr;
}

function buildOccHome(){
var occStr="";
var _sty="";

for (var oc=0; oc<5; oc++){
	if(oc==0){
		_sty="block";
	}else{
		_sty="none";
	}
	occStr += '<span id="occR_1' + (oc+1) + '" style="display:' + _sty + ';">'
	+ '<table border="0" cellpadding="0" cellspacing="0" style="font-family:Arial,Helvetica,sans-serif;font-size:10px;font-weight:bold;">\n'
	+	'<tr>\n'
	+ 		'<td style="vertical-align:top;padding-top:3px;padding-left:5px;" valign="bottom">'
	+			'Adults<br/><select name="R' + (oc+1) + 'occAdults" style="width:40px;" onChange="setSelRoomOcc(1);">\n' + opts(1,10,1) + '</select>'
	+		'</td>\n'
	+ 		'<td style="vertical-align:top;padding-top:3px;padding-left:5px;" valign="bottom">'
	+			'Children<br/><select id="children" name="R' + (oc+1) + 'occChi" style="width:40px;" onChange="hotelSearchDisplayer();setSelRoomOcc(1);showAgCom(Number(this.options[this.selectedIndex].value),' + (oc+1) + ', 1);">\n' + opts(0,3,0) + '</select></td>\n'
	+	'</tr><tr>\n'
	+		'<td colspan="3" align="center">\n<span id="R' + (oc+1) + '1_ageTbl" style="display:none;">'
	+			'<table border="0" cellpadding="0" cellspacing="0" style="font-family:Arial,Helvetica,sans-serif;font-size:10px;font-weight:bold;">\n'
	+				'<tr>\n'
	+					'<td style="text-align:center;" valign="bottom"><span id="R' + (oc+1) + 'chAgHd_11" style="display:none;">Age 1</span></td>\n'
	+					'<td style="text-align:center;" valign="bottom"><span id="R' + (oc+1) + 'chAgHd_12" style="display:none;">Age 2</span></td>\n'
	+				'<tr>\n'
	+					'<td><select id="R' + (oc+1) + 'occAge_11" name="R' + (oc+1) + 'occAge_11" style="display:none;" onChange="setSelRoomOcc(1);">\n' + opts(1,18,1) + '</select></td>\n'
	+					'<td><select id="R' + (oc+1) + 'occAge_12" name="R' + (oc+1) + 'occAge_12" style="display:none;" onChange="setSelRoomOcc(1);">\n' + opts(1,18,1) + '</select></td>\n'
	+				'</tr><tr>'
	+					'<td style="text-align:center;" valign="bottom"><span id="R' + (oc+1) + 'chAgHd_13" style="display:none;">Age 3</span></td>\n'
	+					'<td style="text-align:center;" valign="bottom"><span id="R' + (oc+1) + 'chAgHd_14" style="display:none;">Age 4</span></td>\n'
	+				'</tr>\n'
	+				'</tr><tr>'
	+					'<td><select id="R' + (oc+1) + 'occAge_13" name="R' + (oc+1) + 'occAge_13" style="display:none;" onChange="setSelRoomOcc(1);">\n' + opts(1,17,1) + '</select></td>\n'
	+					'<td><select id="R' + (oc+1) + 'occAge_14" name="R' + (oc+1) + 'occAge_14" style="display:none;" onChange="setSelRoomOcc(1);">\n' + opts(1,17,1) + '</select></td>\n'
	+				'</tr>\n'
	+			'</table></span></td></tr>\n'
	+		'</table>\n'
}
return occStr;

}

function befSubmit(pkgType){
if(pkgType=='H'){
var srhdates="<br>Arriving on <b>"+_month[Number(document.forms["ResPkgSearchForm"].cmbInMn_Hotels.value)-1]+"-"+document.forms["ResPkgSearchForm"].cmbInDt_Hotels.value+"-"+document.forms["ResPkgSearchForm"].cmbInYr_Hotels.value+"</b>, Departing <b>"+_month[Number(document.forms["ResPkgSearchForm"].cmbOutMn_Hotels.value)-1]+"-"+document.forms["ResPkgSearchForm"].cmbOutDt_Hotels.value+"-"+document.forms["ResPkgSearchForm"].cmbOutYr_Hotels.value+"</b>";

var rooms = "Room(s) <b> "+document.forms["ResPkgSearchForm"].elements["cmbNoRm_Hotels"].value+"</b> ,";
var nignts = "Night(s) <b> "+document.forms["ResPkgSearchForm"].cmbNgt_Hotels.value+"</b> ";
var loc = "Location <b> "+document.forms["ResPkgSearchForm"].searchCityName.value+"</b> , ";

searchMessage="<strong>We are Searching, Please Wait ... </strong> "+srhdates;
searchMessage+="<br>"+loc+" "+rooms+" "+nignts;
}
//document.getElementById("searchMsg").innerHTML=searchMessage;
//document.getElementById("waitMsg").style.display="block";
document.getElementById("fullContent").style.display="none";
}

var AJAX;
function ajaxRequest(str)
{  
 var sendUrl=subURL+'/admin/common/TraceData.jsp?str='+str; 
 if (window.XMLHttpRequest)
 {// code for IE7+, Firefox, Chrome, Opera, Safari
	 AJAX = new XMLHttpRequest();
 }
 else
 {// code for IE6, IE5
	 AJAX = new ActiveXObject("Microsoft.XMLHTTP");
 }

 AJAX.onreadystatechange = function()
 {
  if(AJAX.readyState == 4)
  {
   if(AJAX.status == 200)
   {
    //document.getElementById(DivId).innerHTML = AJAX.responseText;   
	  //alert(AJAX.responseText);
   }
   else
   {
    //alert("Error: "+ AJAX.statusText +" "+ AJAX.status);
   }
  }   
 }
 
 AJAX.open("GET", sendUrl, true);
 AJAX.send(null);
}

function generatescript(eng_no){
	var Str1="";

        var inmn = Number(document.forms["form_rez_"+eng_no].elements["H_In_"+eng_no+"_Month"].value)+Number(1);
	var outmn = Number(document.forms["form_rez_"+eng_no].elements["H_Out_"+eng_no+"_Month"].value)+Number(1);

	Str1 = Str1 +"website="+ document.forms["ResPkgSearchForm"].elements["website"].value;
	Str1 = Str1 +",cmbCty="+ document.forms["form_rez_"+eng_no].hid_H_Loc.value;
	Str1 = Str1 +",cmbInMn="+ inmn;
	Str1 = Str1 +",cmbInDt="+ document.forms["form_rez_"+eng_no].elements["H_In_"+eng_no+"_Date"].value;
	Str1 = Str1 +",cmbInYr="+ Number(document.forms["form_rez_"+eng_no].elements["H_In_"+eng_no+"_Year"].value);
	Str1 = Str1 +",cmbOutMn="+ outmn;
	Str1 = Str1 +",cmbOutDt="+ document.forms["form_rez_"+eng_no].elements["H_Out_"+eng_no+"_Date"].value;
	Str1 = Str1 +",cmbOutYr="+ Number(document.forms["form_rez_"+eng_no].elements["H_Out_"+eng_no+"_Year"].value);
	Str1 = Str1 +",cmbNgt="+ Number(document.forms["form_rez_"+eng_no].elements["H_nights"].value);
	Str1 = Str1 +",cmbNoRm="+ Number(document.forms["form_rez_"+eng_no].elements["H_cmbNoOfRooms"].value);
	Str1 = Str1 +",totRooms_Hotels="+ document.forms["ResPkgSearchForm"].elements["totRooms_Hotels"].value;
	Str1 = Str1 +",totAdlt_Hotels="+ document.forms["ResPkgSearchForm"].elements["totAdlt_Hotels"].value;
	Str1 = Str1 +",totChi_Hotels="+ document.forms["ResPkgSearchForm"].elements["totChi_Hotels"].value;
	Str1 = Str1 +",shtcd_Hotels="+ document.forms["ResPkgSearchForm"].elements["shtcd_Hotels"].value;
	Str1 = Str1 +",partnerType="+ document.forms["ResPkgSearchForm"].elements["partnerType"].value;
	Str1 = Str1 +",partnerId="+ document.forms["ResPkgSearchForm"].elements["partnerId"].value;
	Str1 = Str1 +",userType="+ document.forms["ResPkgSearchForm"].elements["userType"].value;
	Str1 = Str1 +",userCode="+ document.forms["ResPkgSearchForm"].elements["userCode"].value;
	if (document.forms["ResPkgSearchForm"].elements["affCode"]){
		Str1 = Str1 +",affCode="+ document.forms["ResPkgSearchForm"].elements["affCode"].value;
	}
	if (document.forms["ResPkgSearchForm"].elements["copCode"]){
	Str1 = Str1 +",copCode="+ document.forms["ResPkgSearchForm"].elements["copCode"].value;
	}
}
