bsnm=0;var sClientId,ddlAdults,ddlChilds;sIfrmCalID='ifrCalBN';bnDate="";bnTime="";function GetVariableName(strName){var s=new String(strName);return s.substr(s.lastIndexOf('$')+1,s.length-s.lastIndexOf('$'));}function GetKeyValue(objControl){var sEqual="~##~";var sSeprat="~;;~";var sValue="";var sType=objControl.type.toLowerCase();var sTName="";if(objControl.tagName.toLowerCase()=="input"&&(sType=="radio"||sType=="checkbox")){if(sType=="radio"){if(objControl.checked){sValue=objControl.value}else{if(objControl.parentNode.getAttribute("tname")!=null){objControl.parentNode.removeAttribute("tName");}if(objControl.getAttribute("tname")!=null)objControl.removeAttribute("tName");}}else if(sType=="checkbox"){if(objControl.checked)sValue="1";else sValue="0"}if(objControl.parentNode!=null&&objControl.parentNode.getAttribute("tname")!=null)sTName=objControl.parentNode.getAttribute("tname");if(objControl.getAttribute("tname")!=null)sTName=objControl.getAttribute("tname");}else{if(objControl.getAttribute("tJointName")!=null){var objJoint=document.getElementById(objControl.getAttribute("tJointName"));sValue=objControl.value+"$"+objJoint.value}else sValue=objControl.value;if(objControl.getAttribute("tname")!=null)sTName=objControl.getAttribute("tname");}if(sTName!=""){return sTName+sEqual+sValue+sSeprat}else{return""}}function validateSearchValue(){return true}function submitSearchData(sClientID){if(validateSearchValue()){var oHid=document.getElementById("__VIEWSTATE");oHid.name="name";var strDiv=new String(sClientID);strDiv=strDiv.substr(0,strDiv.lastIndexOf("_"));var obj=document.getElementById(strDiv+"_ModuleContent");var oElementColl=null;var arrElements=new Array("select","input");var arrElementCollections=new Array();var i=0;for(i=0;i<arrElements.length;i++){oElementColl=obj.getElementsByTagName(arrElements[i]);arrElementCollections.push(oElementColl);}var sSelectedValues="";for(k=0;k<arrElementCollections.length;k++){var oControlColl=arrElementCollections[k];for(m=0;m<oControlColl.length;m++){if(oControlColl[m].tagName.toLowerCase()=="input"){if(oControlColl[m].type.toLowerCase()!="hidden"&&oControlColl[m].type.toLowerCase()!="button")sSelectedValues+=GetKeyValue(oControlColl[m]);}else{sSelectedValues+=GetKeyValue(oControlColl[m]);}}}var oSetValue=document.getElementById('hdqsvalues');oSetValue.value=sSelectedValues;var oForm=document.getElementById("Form");oForm.action=document.getElementById("hdcmsgateway").value;oForm.submit();}else{alert('Incomplete Form');}return true}function converdate(dateValue){var date1=new Date(Date.parseDate(dateValue,'%d/%m/%Y'));return date1.getFullYear()+'-'+parseInt(date1.getMonth()+1)+'-'+date1.getDate();}function at_show_aux(parent,child){var p=document.getElementById('<%=ddlBus.ClientID %>');var c=document.getElementById(child);var top=(c["at_position"]=="y")?p.offsetHeight+2:0;var left=(c["at_position"]=="x")?p.offsetWidth+2:0;for(;p;p=p.offsetParent){top+=p.offsetTop;left+=p.offsetLeft}c.style.position="absolute";c.style.top=top+'px';c.style.left=left+'px';c.style.display=""}roomDiv='';childDiv='';childDivTitle='';showChildAge=true;showChildAgeControl='cmb';comboClass='combo-box';roomDivViewState='';childDivViewState='';function setJSStateVariable(cnt1,cnt2){roomDivViewState=cnt1;childDivViewState=cnt2}function copyTValue(eventSource){if(browserName!='Netscape'){eventSource=event.srcElement}eventSource.setAttribute('tValue',eventSource.value);jsCallSaveState();}function jsCallSaveState(){var destiRoom=document.getElementById(roomDiv);var sourceRoom=document.getElementById(roomDivViewState);var destiChild=document.getElementById(childDiv);var sourceChild=document.getElementById(childDivViewState);sourceRoom.value=destiRoom.innerHTML;sourceChild.value=destiChild.innerHTML}function jsSaveFromViewState(){return;var destiRoom=document.getElementById(roomDiv);var sourceRoom=document.getElementById(roomDivViewState);var destiChild=document.getElementById(childDiv);var sourceChild=document.getElementById(childDivViewState);destiRoom.innerHTML=sourceRoom.value;destiChild.innerHTML=sourceChild.value;jsSaveAttribute();}function jsSaveAttribute(){var mChildren=document.getElementById(aspChildID);var mAdults=document.getElementById(aspAdultID);var oElementColl=null;var arrElements=null;if(showChildAgeControl=='cmb'){arrElements=new Array("select","select");}else{arrElements=new Array("select","input");}var arrElementCollections=new Array();var i=0;var obj=document.getElementById(roomDiv);oElementColl=obj.getElementsByTagName(arrElements[0]);arrElementCollections.push(oElementColl);var obj=document.getElementById(childDiv);oElementColl=obj.getElementsByTagName(arrElements[1]);arrElementCollections.push(oElementColl);for(k=0;k<arrElementCollections.length;k++){var oControlColl=arrElementCollections[k];for(m=0;m<oControlColl.length;m++){oChild=document.getElementById(oControlColl[m].id);oChild.value=oControlColl[m].getAttribute('tvalue');if(oChild.id.indexOf('adult')>-1){mAdults.style.display='none';mChildren.style.display='none';if(browserName!='Netscape'){oChild.attachEvent('onchange',copyTValue);}}else if(oChild.id.indexOf('child')>-1){halert(oChild.id);if(browserName!='Netscape'){oChild.attachEvent('onchange',displayChild);oChild.attachEvent('onkeyup',displayChild);oChild.attachEvent('onchange',copyTValue);}}else if(oChild.id.indexOf('oChild')>-1){document.getElementById(childDivTitle).style.display='block';if(browserName!='Netscape'){oChild.attachEvent('onkeyup',copyTValue);}}}}}aspChildID='';aspAdultID='';CHILDAGETABLEID='';searchControlName='';caption='';function setGlobalVariable(searchName,tableName,adult,child,controlID,showChildAgeControl){sClientId=controlID;if(!showChildAgeControl){comboClass='HomePopup-Select'}else{comboClass='combo-box'}searchControlName=searchName;aspChildID=child;aspAdultID=adult;CHILDAGETABLEID=tableName;roomDiv=controlID+'divcontainer';childDiv=controlID+'divChildAgeContainer';childDivTitle=controlID+'divChildAgeContainerText';showChildAge=showChildAgeControl;if(searchControlName=='hotel')caption='Room';else caption='';document.getElementById(controlID+'_ddlRoom').value=1;document.getElementById(controlID+'_ddlChild').value=0;document.getElementById(roomDiv).innerHTML='';document.getElementById(childDiv).innerHTML='';document.getElementById(childDivTitle).style.display='none';document.getElementById(controlID+'_dvInfo').innerHTML='';displyRoom(document.getElementById(controlID+'_ddlRoom'),adult,child,6,6);}browserName=navigator.appName;function setTName(cntType,roomNo,index){if(searchControlName=='hotel'){if(cntType=='adult'){return'TV_noOfAdults';}else if(cntType=='childCount'){return'TV_noOfChildren';}else if(cntType=='childAge'){return'TV_childrenAge';}}}function halert(s){}function hclear(){var obj=document.getElementById("debug");if(obj!=null)obj.innerHTML=''}function isEmptyValue(cnt){tstrInput=cnt.value;tstrInput.replace(/^ *| *$/g,"");if(tstrInput==''){return true}return false}function checkKeyValue(ev){var keyPressValue;if(ev==null){keyPressValue=event.keyCode}else{if(ev.which==undefined){keyPressValue=ev.keyCode}else{keyPressValue=ev.which}}if(keyPressValue>=48&&keyPressValue<=57){}else if(keyPressValue==0||keyPressValue==8||keyPressValue==13){}else{return false}return true}function showrooms(objDiv){if(document.getElementById(objDiv).style.display=='block'){document.getElementById(objDiv).style.display='none'}else{document.getElementById(objDiv).style.display='block'}}function calculateCheckoutDate(checkinid,checkoutid,nightsid){var checkin=document.getElementById(checkinid);var checkout=document.getElementById(checkoutid);var nights=document.getElementById(nightsid);var match=new RegExp(/^\d+$/).exec(nights.value);if(match==null){return false}var date2=new Date(Date.parseDate(checkin.value,'%d/%m/%Y'));var e=eval(24*nights.value);date2.setHours(e);checkout.value=date2.print('%d/%m/%Y');}function fillDropdown(cnt,startIndex,EndIndex){var i=startIndex;cnt.options.length=parseInt(EndIndex-startIndex)+1;for(var k=0;k<cnt.options.length;k++){cnt.options[k].value=i;cnt.options[k].text=i;i++}}function fillChildDropdown(cnt,startIndex,EndIndex){var i=startIndex;cnt.options.length=parseInt(EndIndex-startIndex)+2;cnt.options[0].value='0';cnt.options[0].text='<1';for(var k=1;k<cnt.options.length;k++){cnt.options[k].value=i;cnt.options[k].text=i;i++}}function displyRoom(cnt,mAdultscnt,mChildrencnt,nToAdult,nToChild){var mAdults=document.getElementById(mAdultscnt);var mChildren=document.getElementById(mChildrencnt);var aspChild=document.getElementById(aspChildID);var aspAdult=document.getElementById(aspAdultID);var dc=document.getElementById(roomDiv);var room=parseInt(cnt.value);if(dc.childNodes.length==0&&room==1){mAdults.style.display='block';mChildren.style.display='block';aspAdult.setAttribute('tName',setTName('adult',1,1));aspChild.setAttribute('tName',setTName('childCount',1,1));aspAdult.value="1"}if(dc.childNodes.length>room){if(room==1){mAdults.style.display='block';mChildren.style.display='block';aspAdult.setAttribute('tName',setTName('adult',1,1));aspChild.setAttribute('tName',setTName('childCount',1,1));copyValue('jpscnt',0);aspAdult.value="1"}else{room++}var len=dc.childNodes.length;{len++}var i=0;for(i=len-1;i>=room;i--){var span=document.getElementById('span'+i);dc.removeChild(span);if(getTable()!=null){if(i==1){if(parseInt(document.getElementById(aspChildID).value)<1){removeChilAgeRow(getTable(),i,0);}}else removeChilAgeRow(getTable(),i,0);}}}else {if(room<2)return;mAdults.style.display='none';mChildren.style.display='none';if(aspAdult!=null)aspAdult.removeAttribute('tName');if(aspChild!=null)aspChild.removeAttribute('tName');var len=dc.childNodes.length;{len++}for(i=len;i<=room;i++){dc.appendChild(newRow(i,nToAdult,nToChild));if(i==1){copyValue('aspcnt',0);}}}}function newRow(index,nToAdult,nToChild){var span=document.createElement('SPAN');span.id="span"+index;var oAdults,oChild,oRoom,oBr,childSpan;oRoom=document.createElement('SPAN');oRoom.id='room'+index;oRoom.name='room'+index;if(caption!='')oRoom.innerHTML=caption+' '+index;oRoom.className='normal';oAdults=document.createElement('SELECT');oAdults.id='adults'+index;oAdults.name='adults'+index;oAdults.className=comboClass;oAdults.setAttribute("tName",setTName('adult',index,-1));oAdults.setAttribute('tValue','1');fillDropdown(oAdults,1,nToAdult);if(browserName!='Netscape'){oAdults.setAttribute('onchange',copyTValue);}else{oAdults.setAttribute('onchange','return copyTValue(this);');}oChild=document.createElement('SELECT');oChild.id='child'+index;oChild.name='child'+index;oChild.className=comboClass;oChild.setAttribute('tName',setTName('childCount',index,-1));oChild.setAttribute('tValue','0');fillDropdown(oChild,0,nToChild);if(showChildAge==true){if(browserName!='Netscape'){oChild.attachEvent('onchange',displayChild);oChild.attachEvent('onkeyup',displayChild);oChild.attachEvent('onchange',copyTValue);}else{oChild.setAttribute('onchange','displayChild(this);return copyTValue(this);');oChild.setAttribute('onkeyup','displayChild(this);');}}else{oChild.setAttribute('onchange','return copyTValue(this);');}oBr=document.createElement('BR');span.appendChild(oRoom);span.appendChild(oAdults);span.appendChild(oChild);span.appendChild(oBr);return span}function getTable(){var tbl=document.getElementById(CHILDAGETABLEID);return tbl}function createTable(cntName){var tbl=document.getElementById(cntName);if(tbl==null){tbl=document.createElement("TABLE");tbl.id=cntName;tbl.name=tbl.id;tbl.setAttribute("border",0);tbl.setAttribute("with",'100%');tbl.setAttribute("cellspacing",'0');tbl.setAttribute("cellspadding",'5');}return tbl}function createChildAgeRow(oMainTable,RoomNo,rowIndex,position){var parentChildCnt=document.getElementById(oMainTable.id+'Room'+RoomNo+'Row1');if(document.getElementById(oMainTable.id+'Room'+RoomNo+'Row'+rowIndex)!=null){return true}var newRow=oMainTable.insertRow(position);newRow.id=oMainTable.id+'Room'+RoomNo+'Row'+rowIndex;newRow.name=newRow.id;var startIndex=1;var endIndex=4;var newCell;var newCell=newRow.insertCell(0);if(rowIndex==1){if(caption!='')newCell.innerHTML=caption+' '+RoomNo}newCell.className='normal';newCell.setAttribute('nowrap','nowrap');newCell.setAttribute('rmIndex',RoomNo);for(var i=startIndex;i<endIndex;i++){newCell=newRow.insertCell(i);newCell.className='normal';newCell.id=oMainTable.id+'Room'+RoomNo+'Col'+i;newCell.name=newCell.id}}function copyValue(cntevent,val){var aspCnt=document.getElementById(aspChildID);var jspCnt=document.getElementById('child1');if(cntevent=='aspcnt'){try{jspCnt.value=aspCnt.value}catch(e){}}else{aspCnt.value=jspCnt.value;}var aspCnt=document.getElementById(aspAdultID);var jspCnt=document.getElementById('adults1');if(cntevent=='aspcnt'){try{jspCnt.value=aspCnt.value}catch(e){}}else{aspCnt.value=jspCnt.value;}}function removeChilAgeRow(oMainTable,RoomNo,newChildSelected){var oldTableRowCount=oMainTable.rows.length;var k=7;for(j=3;j>0;j--){if(newChildSelected<k){for(i=oMainTable.rows.length-1;i>=0;i--){if(oMainTable.rows[i].id==oMainTable.id+'Room'+RoomNo+'Row'+j){if(k!=1){var parentChildCnt=document.getElementById(oMainTable.id+'Room'+RoomNo+'Row1');}oMainTable.deleteRow(i);}}}k-=3}var contentTextCtn=document.getElementById(childDivTitle);if(oMainTable.rows.length<1){contentTextCtn.style.display='none'}else{contentTextCtn.style.display='block'}}function findRowInsertPosition(oMainTable,RoomNo){var roomIndex=oMainTable.rows.length;var i=0;var n=0;if(oMainTable.rows.length==0)return 0;for(i=oMainTable.rows.length-1;i>=0;i--){halert('V: '+oMainTable.rows[i].cells[0].getAttribute('rmIndex'));n=parseInt(oMainTable.rows[i].cells[0].getAttribute('rmIndex'));halert('['+n+'<='+RoomNo+']'+i);if(n>=RoomNo){roomIndex=i;halert('New Position '+roomIndex);}}halert('Ret : '+roomIndex);return roomIndex}function addChildAgeCombo(parId,RoomNo,index){var subTable=createTable(parId+'dd'+index);var subRow=subTable.insertRow(0);var subCell=subRow.insertCell(0);subCell.innerHTML="Child "+index+':';subCell.className='normal';subRow=subTable.insertRow(1);subCell=subRow.insertCell(0);var oChildAge;if(showChildAgeControl=='txt'){oChildAge=document.createElement('INPUT');oChildAge.setAttribute('size','3');oChildAge.setAttribute('maxlength',2);}else{oChildAge=document.createElement('SELECT');oChildAge.className=comboClass}oChildAge.id='oChild'+RoomNo+'Age'+index;oChildAge.name=oChildAge.id;oChildAge.setAttribute('tValue','');if(showChildAgeControl=='txt'){if(browserName!='Netscape'){oChildAge.attachEvent('onkeypress',checkKeyValue);oChildAge.setAttribute('onkeyup',copyTValue);}else{oChildAge.setAttribute('onkeypress','return checkKeyValue(event)');oChildAge.setAttribute('onkeyup','return copyTValue(this)');}}else{fillChildDropdown(oChildAge,1,18);if(browserName!='Netscape'){oChildAge.attachEvent('onkeyup',copyTValue);oChildAge.attachEvent('onchange',copyTValue);}else{oChildAge.setAttribute('onchange','copyTValue(this);');oChildAge.setAttribute('onkeyup','copyTValue(this);');}}oChildAge.setAttribute('tName',setTName('childAge',RoomNo,index));subCell.appendChild(oChildAge);return subTable}function displayChild(cnt){if(browserName!='Netscape'){cnt=event.srcElement}var dc=document.getElementById(childDiv);var oMainTable=document.getElementById(CHILDAGETABLEID);if(oMainTable==null){oMainTable=createTable('tblMain');dc.appendChild(oMainTable);}var NoOfChildren=parseInt(cnt.value);var RoomNo='';if(cnt.getAttribute('jsid')!=null){RoomNo=parseInt(cnt.getAttribute('jsid').substring('child'.length,cnt.getAttribute('jsid').length));}else{RoomNo=parseInt(cnt.id.substring('child'.length,cnt.id.length));if(RoomNo==1)copyValue('jscnt',NoOfChildren);}var isFindRow=-1;var i=0;var finalPosition=0;for(i=oMainTable.rows.length-1;i>=0;i--){if(oMainTable.rows[i].id==oMainTable.id+'Room'+RoomNo+'Row3'){isFindRow=3;finalPosition=i;break}if(oMainTable.rows[i].id==oMainTable.id+'Room'+RoomNo+'Row2'){if(isFindRow<2){isFindRow=2;finalPosition=i}}if(oMainTable.rows[i].id==oMainTable.id+'Room'+RoomNo+'Row1'){if(isFindRow<1){isFindRow=1;finalPosition=i}}}if(isFindRow==-1){hclear();finalPosition=findRowInsertPosition(oMainTable,RoomNo);halert(':: '+finalPosition);createChildAgeRow(oMainTable,RoomNo,1,finalPosition);isFindRow=1}halert('-'+finalPosition+'position');if(isFindRow==1){if(NoOfChildren>3){createChildAgeRow(oMainTable,RoomNo,isFindRow+1,finalPosition+1);finalPosition++;isFindRow=2}}if(isFindRow==2){if(NoOfChildren>6){createChildAgeRow(oMainTable,RoomNo,isFindRow+1,finalPosition+1);}}var dropDownIndex=1;for(var tbRowIndex=1;tbRowIndex<4;tbRowIndex++){var tbRowCnt=document.getElementById(oMainTable.id+'Room'+RoomNo+'Row'+tbRowIndex);if(tbRowCnt==null){halert('Combo add error');removeChilAgeRow(oMainTable,RoomNo,NoOfChildren);return false}var startIndex=1;var endIndex=4;for(var tbColIndex=startIndex;tbColIndex<endIndex;tbColIndex++){if(dropDownIndex<=NoOfChildren){if(tbRowCnt.cells[tbColIndex].childNodes.length==0){tbRowCnt.cells[tbColIndex].appendChild(addChildAgeCombo(oMainTable.id+'Room'+RoomNo+'Row'+tbRowIndex,RoomNo,dropDownIndex));}}else {if(tbRowCnt.cells[tbColIndex]==null){}else{if(tbRowCnt.cells[tbColIndex].childNodes.length==1){var c=document.getElementById(oMainTable.id+'Room'+RoomNo+'Row'+tbRowIndex+'dd'+dropDownIndex);if(c!=null){tbRowCnt.cells[tbColIndex].removeChild(c);}}}}dropDownIndex++}}removeChilAgeRow(oMainTable,RoomNo,NoOfChildren);}function CheckChildAges(){var oChildTable=document.getElementById(CHILDAGETABLEID);if(oChildTable!=null){var oAgeColl=oChildTable.getElementsByTagName("INPUT");for(i=0;i<oAgeColl.length;i++){if(oAgeColl[i].value==""){return false}}}return true}function at_show_aux(parent,child,iFrameID){try{var p=document.getElementById(parent);var c=document.getElementById(child);var oH=p.offsetHeight;oH+=4;var top=GetOffsetTop(p)+oH+'px';var left=GetOffsetLeft(p)+7+'px';c.style.position="absolute";c.style.top=top;c.style.left=left;c.style.display="block";var ifrBN=document.getElementById(iFrameID);ifrBN.style.position="absolute";ifrBN.style.top=top;ifrBN.style.left=left;ifrBN.style.display="block";ifrBN.style.width=c.offsetWidth;ifrBN.style.height=c.offsetHeight}catch(e){alert("Error in method(at_show_aux) : "+e.message);}}function ResetBookNow(){document.getElementById(bnSelect).value=0}function DisplayMyBookNow(rootId,type){try{clearAllError();ResetBookNow();HideControl('dvPopupAPBN');HideControl('dvPopupAcmdSearch');HideControl('dvPopupActivity');HideControl('dvPopupRestaurant');HideControl('dvPopupTransportation');var controlId='';var childRootId='';var searchTName='';var profilenameTName='';if(type=='hotel'){controlId='dvPopupAcmdSearch';var childRootId=rootId+'_AcmdSearch';var ddlAdults=childRootId+'_ddlAdults';var ddlChild=childRootId+'_ddlChild';var viewStateroomHolder=childRootId+'_ViewStateroomHolder';var viewStateChildHolder=childRootId+'_ViewStateChildHolder';searchTName='TV_hotelId';profilenameTName="TV_HotelName";setGlobalVariable('hotel','tblMain',ddlAdults,ddlChild,childRootId,true);setJSStateVariable(viewStateroomHolder,viewStateChildHolder);jsSaveFromViewState();}else if(type=='excursion'){controlId='dvPopupActivity';childRootId=rootId+'_Activity';searchTName='TV_TourOperatorID';profilenameTName="TV_CMSActName"}else if(type=='restaurant'){controlId='dvPopupRestaurant';childRootId=rootId+'_Restaurant';searchTName='TV_RestaurantId';profilenameTName="TV_RestaurantName"}else if(type=='vehicle'){controlId='dvPopupTransportation';childRootId=rootId+'_Transportation';searchTName='TV_VendorCode';sClientId=rootId+'_Transportation';profilenameTName="TV_CMSTransName"}try{SetControlTValue(type,childRootId,'detailpage');document.getElementById(childRootId+'_txtBuscd').setAttribute('tName',searchTName);document.getElementById(childRootId+'_txtBuscd').setAttribute('tValue',bsnm);document.getElementById(childRootId+'_txtBuscd').value=bsnm;document.getElementById(childRootId+'_txtProfileName').setAttribute('tName',profilenameTName);}catch(e){}DisplayInCenter(controlId,'');return true}catch(e){alert("Error in method(DisplayMyBookNow) : "+e.message);}}function DisplayBookNow(parent,child,iFrameID,rootId){try{clearAllError();HideControl('dvPopupAcmdSearch');HideControl('dvPopupActivity');HideControl('dvPopupRestaurant');HideControl('dvPopupTransportation');ddlBus=document.getElementById(rootId+'_ddlBus');var selectedBus=ddlBus.options[ddlBus.selectedIndex];HideControl(rootId+'_Acmd1_ModuleContent');HideControl(rootId+'_Act1_ModuleContent');HideControl(rootId+'_Rest1_ModuleContent');HideControl(rootId+'_Tran1_ModuleContent');if(ddlBus.selectedIndex<1){ResetBookNow();HideControl('dvPopupAPBN');return true}var lblMesg;if(selectedBus.value=='hotel'){lblMesg=document.getElementById(rootId+'_Acmd1_lblMesg');document.getElementById(rootId+'_Acmd1_ModuleContent').style.display='';var childRootId=rootId+'_Acmd1_ModuleContent';var AcmdRootId=rootId+'_Acmd1';var ddlAdults=AcmdRootId+'_ddlAdults';var ddlChild=AcmdRootId+'_ddlChild';var viewStateroomHolder=AcmdRootId+'_ViewStateroomHolder';var viewStateChildHolder=AcmdRootId+'_ViewStateChildHolder';SetControlTValue('hotel',AcmdRootId,'listingpage');setGlobalVariable('hotel','tblMain',ddlAdults,ddlChild,AcmdRootId,false);setJSStateVariable(viewStateroomHolder,viewStateChildHolder);jsSaveFromViewState();document.getElementById(AcmdRootId+'_lblHeading').innerHTML='Search '+selectedBus.text}else if(selectedBus.value=='excursion'){lblMesg=document.getElementById(rootId+'_Act1_lblMesg');document.getElementById(rootId+'_Act1_ModuleContent').style.display='';document.getElementById(rootId+'_Act1_lblHeading').innerHTML='Search '+selectedBus.text;SetControlTValue('excursion',rootId+'_Act1','listingpage');}else if(selectedBus.value=='restaurant'){lblMesg=document.getElementById(rootId+'_Rest1_lblMesg');document.getElementById(rootId+'_Rest1_ModuleContent').style.display='';document.getElementById(rootId+'_Rest1_lblHeading').innerHTML='Search '+selectedBus.text;SetControlTValue('restaurant',rootId+'_Rest1','listingpage');}else if(selectedBus.value=='vehicle'){lblMesg=document.getElementById(rootId+'_Tran1_lblMesg');sClientId=rootId+'_Tran1';document.getElementById(rootId+'_Tran1_ModuleContent').style.display='';document.getElementById(rootId+'_Tran1_lblHeading').innerHTML='Search '+selectedBus.text;SetControlTValue('vehicle',rootId+'_Tran1','listingpage');}var labelMessage="";if(labelMessage.length==0){labelMessage=lblMesg.innerHTML}lblMesg.innerHTML=labelMessage.replace("##NAME##",selectedBus.value);var p=document.getElementById(parent);var c=document.getElementById(child);if(c.style.display!="block"){at_show_aux(p.id,c.id,iFrameID);}return true}catch(e){alert("Error in method(DisplayBookNow) : "+e.message);}}var rootClientID;var jsDvInfo;function setRootID(rootID){rootClientID=rootID}function fnGetDateObject(val){return new Date(val.split('/')[2],val.split('/')[0]-1,val.split('/')[1]);}function IsEmpty(sString){return(Trim(sString).length<=0);}function disabledeControl(cnt){document.getElementById(cnt).setAttribute("disabled","disabled");}function EnableControl(cnt){document.getElementById(cnt).removeAttribute("disabled");}function setError(cnt,msg){cnt.innerHTML=cnt.innerHTML+' '+msg}function clearError(cnt){cnt.innerHTML=''}function dateCompare(date1,date2){var pickupDate=fnGetDateObject(date1.value);var returnDate=fnGetDateObject(date2.value);return(pickupDate>=returnDate);}function comparePickTime(date1,time1,date2,time2){var pDate=fnGetDateObject(date1.value);var dDate=fnGetDateObject(date2.value);var blnReturn=false;if(dDate>pDate){blnReturn=true}else if(dDate<pDate){blnReturn=false}else{var pDateTime=new Date(date1.value+" "+time1.value);var dDateTime=new Date(date2.value+" "+time2.value);var pHr=parseInt(pDateTime.getHours(),10);var dHr=parseInt(dDateTime.getHours(),10);if(dHr<=pHr){blnReturn=false}else if((dHr-pHr)==1){if(parseInt(pDateTime.getMinutes(),10)==parseInt(dDateTime.getMinutes(),10)){blnReturn=true}else{blnReturn=false}}else{blnReturn=true}}return!blnReturn}function pastDate(date1){var pickupDate=fnGetDateObject(date1);var dtTodate=new Date(bnDate);return!(pickupDate>=new Date(dtTodate.toDateString()));}function clearAllError(){clearError(document.getElementById('dnn_w_Acmd1_dvInfo'));clearError(document.getElementById('dnn_w_Act1_dvInfo'));clearError(document.getElementById('dnn_w_Rest1_dvInfo'));clearError(document.getElementById('dnn_w_Tran1_dvInfo'));}function validateSearch(searchType,rootID){if(searchType==''){if(rootID=='dnn_w_Acmd1'){searchType='hotel'}else if(rootID=='dnn_w_Act1'){searchType='excursion'}else if(rootID=='dnn_w_Rest1'){searchType='restaurant'}else if(rootID=='dnn_w_Tran1'){searchType='vehicle'}clearAllError();}rootClientID=rootID;jsDvInfo=document.getElementById(rootClientID+'_dvInfo');clearError(jsDvInfo);var isValidated=false;if(searchType=='hotel'||searchType=='acmdsearch'){isValidated=accomodationValidate(rootID);}else if(searchType=='excursion'||searchType=='activity'){isValidated=activityValidate(rootID);}else if(searchType=='restaurant'){isValidated=restaurantValidate(rootID);}else if(searchType=='vehicle'||searchType=='transportation'){isValidated=transportationValidate(rootID);}if(isValidated)submitSearchData(rootClientID+'_');return false}function ChangeDateVal(ctr){var str=ctr.value.split("/");if(str.length!=0){m=parseInt(str[0],10);d=parseInt(str[1],10);y=parseInt(str[2],10);ctr.value=m+"/"+d+"/"+y}}function accomodationValidate(rootID){var jsTxtInDate=document.getElementById(rootClientID+'_txtInDate');var jsTxtOutDate=document.getElementById(rootClientID+'_txtOutdate');if(IsEmpty(jsTxtInDate.value)){setError(jsDvInfo,'Please enter check in date.');}else if(!IsDate(jsTxtInDate.value)){setError(jsDvInfo,'Check In Date - Please enter the date in mm/dd/yyyy format.');}else if(IsEmpty(jsTxtOutDate.value)){setError(jsDvInfo,'Please enter check out date.');}else if(!IsDate(jsTxtOutDate.value)){setError(jsDvInfo,'Check Out Date - Please enter the date in mm/dd/yyyy format.');}else{ChangeDateVal(jsTxtInDate);ChangeDateVal(jsTxtOutDate);if(pastDate(jsTxtInDate.value)){setError(jsDvInfo,'Check in date - please enter date greater than or equal to today\'s date.');}else if(dateCompare(jsTxtInDate,jsTxtOutDate)){setError(jsDvInfo,'Check out date must occur after the check in date. Please change the date.');}else{return true}}return false}function activityValidate(rootID){var jsTxtDate=document.getElementById(rootClientID+'_txtDate');var jsDdlType=document.getElementById(rootClientID+'_ddlType');if(IsEmpty(jsTxtDate.value)){setError(jsDvInfo,'Please enter date of tour.');}else if(!IsDate(jsTxtDate.value)){setError(jsDvInfo,'Date of Tour - Please enter the date in mm/dd/yyyy format.');}else{ChangeDateVal(jsTxtDate);if(pastDate(jsTxtDate.value)){setError(jsDvInfo,'Date of tour - please enter date greater than or equal to today\'s date.');}else if(IsEmpty(jsDdlType.value)){setError(jsDvInfo,'Please select activity type.');}else{return true}}return false}function restaurantValidate(rootID){var jsTxtDate=document.getElementById(rootClientID+'_txtDate');var jsTxtTime=document.getElementById(rootClientID+'_ddlTime');var selTime=new Date(jsTxtDate.value+" "+jsTxtTime.value);var currentTime=new Date(bnDate+" "+bnTime);if(IsEmpty(jsTxtDate.value)){setError(jsDvInfo,'Please enter date.');}else if(!IsDate(jsTxtDate.value)){setError(jsDvInfo,'Date - Please enter the date in mm/dd/yyyy format.');}else if(selTime<currentTime){setError(jsDvInfo,'Date/time - Please enter date/time greater than current date/time.');}else{ChangeDateVal(jsTxtDate);return true}return false}function disabledOutArea(){var cnt=document.getElementById(rootClientID+'_ckb');var inLocation=document.getElementById(rootClientID+'_ddlInLocation');var outLocation=document.getElementById(rootClientID+'_ddlOutLocation');if(cnt.checked==true){outLocation.value=inLocation.value;disabledeControl(outLocation.id);}else{EnableControl(outLocation.id);}}function transportationValidate(rootID){var jsTxtInDate=document.getElementById(rootClientID+'_txtInDate');var jsTxtOutDate=document.getElementById(rootClientID+'_txtOutdate');var jsTxtInTime=document.getElementById(rootClientID+'_ddlInTime');var jsTxtOutTime=document.getElementById(rootClientID+'_ddlOutTime');var selTime=new Date(jsTxtInDate.value+" "+jsTxtInTime.value);var currentTime=new Date(bnDate+" "+bnTime);if(IsEmpty(jsTxtInDate.value)){setError(jsDvInfo,'Please enter pick up date.');}else if(!IsDate(jsTxtInDate.value)){setError(jsDvInfo,'Pick Up Date - Please enter the date in mm/dd/yyyy format.');}else if(IsEmpty(jsTxtOutDate.value)){setError(jsDvInfo,'Please enter drop off date.');}else if(!IsDate(jsTxtOutDate.value)){setError(jsDvInfo,'Drop Off Date - Please enter the date in mm/dd/yyyy format.');}else if(selTime<currentTime){setError(jsDvInfo,'Pick up date/time must be greater than or equal to current date/time.');}else if(comparePickTime(jsTxtInDate,jsTxtInTime,jsTxtOutDate,jsTxtOutTime)){setError(jsDvInfo,'Drop off date/time must occur after pick up date/time. Please change date/time.');}else{ChangeDateVal(jsTxtInDate);ChangeDateVal(jsTxtOutDate);return true}return false}function HideHomeBookNow(iFrameID){HideControl('dvPopupAPBN');HideControl('dvPopupAcmdSearch');HideControl('dvPopupActivity');HideControl('dvPopupRestaurant');HideControl('dvPopupTransportation');HideControl(iFrameID);}Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(BeginRequestHandler);Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);function BeginRequestHandler(sender,args){DisplayInCenter('divAPProc','');}function EndRequestHandler(sender,args){document.title=document.title.replace(/&amp;/g,'&');HideControl('divAPProc');}function fnAccomSetDropDowns(dllRoomClientID,mAdultscnt,mChildrencnt,nToAdult,nToChild){var objRoom=document.getElementById(dllRoomClientID);displyRoom(objRoom,mAdultscnt,mChildrencnt,nToAdult,nToChild);}function fnOnPckUpChange(){var toDayDate=new Date();var jsTxtInDate=document.getElementById(sClientId+'_txtInDate');var myInDate=new Date(jsTxtInDate.value);if(toDayDate<myInDate){fnSetDate(myInDate,1);}}function fnOnCheckInChange(){var toDayDate=new Date();var jsTxtInDate=document.getElementById(sClientId+'_txtInDate');var myInDate=new Date(jsTxtInDate.value);if(toDayDate<myInDate){fnSetDate(myInDate,2);}}function fnSetMailClientID(sID){sClientId=sID}function fnSetDate(myInDate,NoOfDays){myInDate.setDate(myInDate.getDate()+NoOfDays);var mmddyyyyFormat=myInDate.getMonth()+1+'/'+myInDate.getDate()+"/"+myInDate.getFullYear();document.getElementById(sClientId+'_txtOutdate').value=mmddyyyyFormat}function SetControlTValue(cntType,RootId,mode){var rootCnt=document.getElementById(RootId+'_ModuleContent');var searchType=document.createElement('INPUT');searchType.id='searchType';searchType.name='searchType';searchType.setAttribute("tName","MV_BusinessType");searchType.setAttribute("value",cntType);searchType.style.display='none';rootCnt.appendChild(searchType);var searchMode=document.createElement('INPUT');searchMode.id='searchMode';searchMode.name='searchMode';searchMode.setAttribute("tName","MV_Mode");searchMode.setAttribute("value",mode);searchMode.style.display='none';rootCnt.appendChild(searchMode);try{if(cntType=='hotel'||cntType=='acmdsearch'){document.getElementById(RootId+'_txtInDate').setAttribute("tName","TV_fromDate");document.getElementById(RootId+'_txtOutdate').setAttribute("tName","TV_toDate");document.getElementById(RootId+'_ddlRoom').setAttribute("tName","TV_noOfRooms");document.getElementById(RootId+'_ddlAdults').setAttribute("tName","TV_noOfAdults");document.getElementById(RootId+'_ddlChild').setAttribute("tName","TV_noOfChildren");document.getElementById(RootId+'_ddlChild').setAttribute("jsid","child 1");}else if(cntType=='excursion'||cntType=='activity'){document.getElementById(RootId+'_ddlLocation').setAttribute("tName","TV_LocationName");document.getElementById(RootId+'_txtDate').setAttribute("tName","TV_DateOfTour");document.getElementById(RootId+'_ddlType').setAttribute("tName","TV_ExcursionType");}else if(cntType=='restaurant'){document.getElementById(RootId+'_txtDate').setAttribute("tName","TV_bookingdate");document.getElementById(RootId+'_ddlTime').setAttribute("tName","TV_bookingtime");document.getElementById(RootId+'_ddlGuest').setAttribute("tName","TV_NoOfGuests");}else if(cntType=='vehicle'||cntType=='transportation'){document.getElementById(RootId+'_ddlInLocation').setAttribute("tName","TV_PULocName");document.getElementById(RootId+'_txtInDate').setAttribute("tName","TV_PUDT");document.getElementById(RootId+'_ddlOutLocation').setAttribute("tName","TV_DOLocName");document.getElementById(RootId+'_txtOutdate').setAttribute("tName","TV_DODT");document.getElementById(RootId+'_txtInDate').setAttribute("tJointName",RootId+'_ddlInTime');document.getElementById(RootId+'_txtOutdate').setAttribute("tJointName",RootId+'_ddlOutTime');document.getElementById(RootId+'_rbList_0').setAttribute("tName","TV_VehicleGroup");document.getElementById(RootId+'_rbList_1').setAttribute("tName","TV_VehicleGroup");}}catch(e){alert("Error in method(SetControlTValue) : "+e.message);}}