
/*******************************************************************/
/*                                                                 */
/* Copyright (c) 2005-2009 Jasob.com                               */
/*                                                                 */
/* This obfuscated code was created by Jasob 3.5 Trial Version.    */
/* The code may be used for evaluation purposes only.              */
/* To obtain full rights to the obfuscated code you have to        */
/* purchase the license key (http://www.jasob.com/Purchase.html).  */
/*                                                                 */
/*******************************************************************/

var arrCountryAsCity=['HK','LU','MO','MV','SG'];var arrCountryCityCode=['HOK','LUX','MAU','MAL','SGP'];var indexXmlHttpForAC;var indexpublicLastFocusId=0;var indexisAtleastOneTimeFocusWasSet=false;var indexstrLastKeyPressed="";var indexsearchValueForAC;var indexCountryCode;var indexCityCode;var page;var sCountryCode,sCityCode,i,sCountryAsCity;var newpoints=new Array();var GIcons=new Array();var GMarkers=new Array();var GmapIindexCheckValue=0;var GmapIndexSelected=0;var GmapTypeDB=3;var GMapDomain="http://www.hoteltravel.com/";function loadMapNew(areaCode,type){var iLon=0.0;var iLat=0.0;var iNumMarker=0;var bounds=new GLatLngBounds();if(type=='country'){for(var i=0;i<newpoints.length;i++){if(newpoints[i][5]==areaCode){GIcons[i].image=GMapDomain+"images/city_icon_select.gif";iLon=parseFloat(newpoints[i][0]);iLat=parseFloat(newpoints[i][1]);}else{GIcons[i].image=GMapDomain+"images/city_icon.gif";}bounds.extend(GMarkers[i].getPoint());iNumMarker=iNumMarker+1;}}else if(type=='countryreset'){for(var i=0;i<newpoints.length;i++){iLon=iLon+parseFloat(newpoints[i][0]);iLat=iLat+parseFloat(newpoints[i][1]);bounds.extend(GMarkers[i].getPoint());iNumMarker=iNumMarker+1;GIcons[i].image=GMapDomain+"images/city_icon.gif";}}else{if(type=='ALL'){for(var i=0;i<newpoints.length;i++){GIcons[i].image=GMapDomain+"images/hotel_icon.gif";iLon=iLon+parseFloat(newpoints[i][0]);iLat=iLat+parseFloat(newpoints[i][1]);bounds.extend(GMarkers[i].getPoint());iNumMarker=iNumMarker+1;}}else{for(var i=0;i<newpoints.length;i++){if(newpoints[i][5]==areaCode){GIcons[i].image=GMapDomain+"images/hotel_icon.gif";iLon=parseFloat(newpoints[i][7]);iLat=parseFloat(newpoints[i][8]);bounds.extend(GMarkers[i].getPoint());iNumMarker=iNumMarker+1;}else{GIcons[i].image=GMapDomain+"images/hotel_icon_black.gif";}}}}map=new GMap2(document.getElementById("googlemap"));var customUI=map.getDefaultUI();customUI.controls.scalecontrol=true;customUI.zoom.scrollwheel=false;map.setUI(customUI);var mapTypeControl=new GOverviewMapControl();map.removeControl(mapTypeControl);if(GmapTypeDB==2){map.removeMapType(G_NORMAL_MAP);}if(type=="reset"){if(iNumMarker==1){map.setCenter(new GLatLng(iLat,iLon),14);}else{map.setCenter(bounds.getCenter());map.setZoom(map.getBoundsZoomLevel(bounds));}}else if(type=="countryreset"){if(iNumMarker==1){map.setCenter(new GLatLng(iLat,iLon),5);}else{map.setCenter(bounds.getCenter());map.setZoom(map.getBoundsZoomLevel(bounds));}}else if(type=="country"){var zoomlevel=map.getBoundsZoomLevel(bounds);if((parseInt(zoomlevel)>5)&&(iNumMarker!=1)){map.setCenter(new GLatLng(iLat,iLon));map.setZoom(map.getBoundsZoomLevel(bounds));}else{map.setCenter(new GLatLng(iLat,iLon),5);}}else if(type=="ALL"){map.setCenter(bounds.getCenter());map.setZoom(map.getBoundsZoomLevel(bounds));}else{if(iNumMarker==1){map.setCenter(new GLatLng(iLat,iLon),14);}else{map.setCenter(bounds.getCenter());map.setZoom(map.getBoundsZoomLevel(bounds));}}};function addPointsNew(areaCode,type){GMarkers=null;GMarkers=new Array();var GIconsTemp=genLargeIcon(type);for(var i=0;i<newpoints.length;i++){var point=new GPoint(newpoints[i][0],newpoints[i][1]);var popuphtml=newpoints[i][4];if(type=='country'){if(newpoints[i][5]==areaCode){var marker=createMarkerCountry(point,GIconsTemp,popuphtml,newpoints[i][10]);}else{var marker=createMarkerCountry(point,newpoints[i][2],popuphtml,newpoints[i][10]);}}else if(type=='countryreset'){var marker=createMarkerCountry(point,newpoints[i][2],popuphtml,newpoints[i][10]);}else{var marker=createMarkerCity(point,newpoints[i][2],popuphtml,newpoints[i][10]);}map.addOverlay(marker);GMarkers[i]=marker;}if((type=='city')||(type=='reset')){setTimeout('ShowGoogleMap()',3000);}if((type=='reset')){document.getElementById('gMapSelectArea').selectedIndex=(GmapIndexSelected+1);var objcboArea=document.getElementById('gMapSelectArea');var text=objcboArea.options[GmapIndexSelected+1].text;LoadLocationNameMap2(text);}else if(type=='countryreset'){document.getElementById('gMapSelectArea').selectedIndex=(-1);}else if(type=="ALL"){var objcboArea=document.getElementById('gMapSelectArea');var text=objcboArea.options[0].text;LoadLocationNameMap2(text);}};function loadMapClickNew(iIndex,type){var areaCode='';var iLon=0.0;var iLat=0.0;areaCode=newpoints[iIndex][5];var bounds=new GLatLngBounds();var iNumMarker=0;if(type=='city'){for(var i=0;i<newpoints.length;i++){if(newpoints[i][5]==areaCode){GIcons[i].image=GMapDomain+"images/hotel_icon.gif";iLon=parseFloat(newpoints[i][0]);iLat=parseFloat(newpoints[i][1]);}else{GIcons[i].image=GMapDomain+"images/hotel_icon_black.gif";}}}else if(type=='country'){for(var i=0;i<newpoints.length;i++){if(newpoints[i][5]==areaCode){iLon=parseFloat(newpoints[i][0]);iLat=parseFloat(newpoints[i][1]);GIcons[i].image=GMapDomain+"images/city_icon_select.gif";}else{GIcons[i].image=GMapDomain+"images/city_icon.gif";}bounds.extend(GMarkers[i].getPoint());iNumMarker=iNumMarker+1;}}map=new GMap2(document.getElementById("googlemap"));var customUI=map.getDefaultUI();customUI.controls.scalecontrol=true;customUI.zoom.scrollwheel=false;map.setUI(customUI);var mapTypeControl=new GOverviewMapControl();map.removeControl(mapTypeControl);if(GmapTypeDB==2){map.removeMapType(G_NORMAL_MAP);}if(type=='city'){map.setCenter(new GLatLng(iLat,iLon),15);}else if(type=='country'){var zoomlevel=map.getBoundsZoomLevel(bounds);if((parseInt(zoomlevel)>5)&&(iNumMarker!=1)){map.setCenter(new GLatLng(iLat,iLon));map.setZoom(map.getBoundsZoomLevel(bounds));}else{map.setCenter(new GLatLng(iLat,iLon),5);}}};function addPointsClickNew(iIndex,type){GMarkers=null;GMarkers=new Array();var areaCode='';areaCode=newpoints[iIndex][5];var pageGMap;pageGMap=document.getElementById('indexcitycode').value;var point;var popuphtml;var marker;var GIconsTemp=genLargeIcon(type);for(var i=0;i<newpoints.length;i++){point=new GPoint(newpoints[i][0],newpoints[i][1]);popuphtml=newpoints[i][4];if(type=='city'){if(iIndex==i){marker=createMarkerCity(point,GIconsTemp,popuphtml,newpoints[i][10]);}else{marker=createMarkerCity(point,newpoints[i][2],popuphtml,newpoints[i][10]);}}else{if(iIndex==i){marker=createMarkerCountry(point,GIconsTemp,popuphtml,newpoints[i][10]);}else{marker=createMarkerCountry(point,newpoints[i][2],popuphtml,newpoints[i][10]);}}map.addOverlay(marker);GMarkers[i]=marker;}if((type=='country')||(type=='countryreset')){document.getElementById('gMapSelectArea').selectedIndex=(parseInt(newpoints[iIndex][11]));}else{document.getElementById('gMapSelectArea').selectedIndex=(parseInt(newpoints[iIndex][11]))+1;}LoadLocationNameMap2(newpoints[iIndex][6]);if((pageGMap!=undefined)&&(pageGMap!="")){setTimeout('ShowGoogleMap()',1500);}};function restoreIcon(i){for(var x=0;x<newpoints.length;x++){if(parseInt(x)!=parseInt(i)){if(GIcons[x].image==GMapDomain+"images/hotel_icon2.gif"){GMarkers[x].setImage(GMapDomain+"images/hotel_icon2.gif");}else if(GIcons[x].image==GMapDomain+"images/hotel_icon_black.gif"){GMarkers[x].setImage(GMapDomain+"images/hotel_icon_black.gif");}}}};function LoadLocationNameMap2(locationName){document.getElementById('GoogleMapLocationNameID').innerHTML=locationName;};function ShowGoogleMap(){var divMainMap;divMainMap=eval(document.getElementById('loading_map_hotel'));divMainMap.style.visibility='hidden';divMainMap.style.display='none';divMainMap=eval(document.getElementById('mainMapDivId01'));divMainMap.style.visibility='visible';divMainMap.style.display='';};function loadjscssfile(filename,filetype,id){if(filetype=="js"){var fileref=document.createElement('script');fileref.setAttribute("id",id);fileref.setAttribute("type","text/javascript");fileref.setAttribute("src",filename);}if(typeof fileref!="undefined"){document.getElementsByTagName("head")[0].appendChild(fileref);}};var xmlHttpRequestMap;function createXMLHttpRequestMap(){if(window.XMLHttpRequest){xmlHttpRequestMap=new XMLHttpRequest();}else if(window.ActiveXObject){try{xmlHttpRequestMap=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){alert('createXMLHttpRequestMap error:'+e);}}return xmlHttpRequestMap;};function sendRequestMap(url){createXMLHttpRequestMap();if(xmlHttpRequestMap){try{url=url+"&sid="+Math.random();xmlHttpRequestMap.open("GET",url,true);xmlHttpRequestMap.onreadystatechange=function(){responseStatusMap()};xmlHttpRequestMap.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlHttpRequestMap.send(null);}catch(e){alert('sendRequestMap error:'+e);}}};function responseStatusMap(){var testRes="";var TempValue="";try{if(xmlHttpRequestMap.readyState==4){if(xmlHttpRequestMap.status==200){var fileref=document.createElement('script');fileref.setAttribute("id","mapMainInfo");fileref.setAttribute("type","text/javascript");fileref.defer=true;fileref.text=xmlHttpRequestMap.responseText;testRes=fileref.text;if(typeof fileref!="undefined"){document.getElementsByTagName("head")[0].appendChild(fileref);}var divMainMap;divMainMap=eval(document.getElementById('loading_map_hotel'));divMainMap.style.visibility='hidden';divMainMap.style.display='none';divMainMap=eval(document.getElementById('mainMapDivId01'));divMainMap.style.visibility='visible';divMainMap.style.display='';LoadGoogleMapResp(testRes);setTimeout('CheckForShowGoogleMap()',1500);}else{}}}catch(e){}};function LoadGoogleMapResp(testres){try{eval(testres);loadMap();addPoints();}catch(e){}};function CheckForShowGoogleMap(){var divMainMap=document.getElementById('ctlMapArea').innerHTML;if(divMainMap.trim()==''){LoadGoogleMap();}};function genLargeIcon(type){var GIconsTemp=new GIcon();if(type=="city"){GIconsTemp.image=GMapDomain+"images/select_hotel.gif";GIconsTemp.iconSize=new GSize(35,37);}else{GIconsTemp.image=GMapDomain+"images/city_icon_select.gif";GIconsTemp.iconSize=new GSize(24,24);}GIconsTemp.iconAnchor=new GPoint(14,14);GIconsTemp.infoWindowAnchor=new GPoint(9,2);return GIconsTemp;};var saveFlash="";function toggleFlash(divId,on){var content=document.getElementById(divId).innerHTML;if(saveFlash=="")saveFlash=content;document.getElementById(divId).innerHTML=(on)?saveFlash:"";};function asyncroflash(){toggleFlash('loading_map_hotel',true);var divMainMap;divMainMap=eval(document.getElementById('loading_map_hotel'));divMainMap.style.visibility='visible';divMainMap.style.display='';divMainMap=eval(document.getElementById('mainMapDivId01'));divMainMap.style.visibility='hidden';divMainMap.style.display='block';};function renderMapByArea(){var objcboCurr=document.getElementById('gMapSelectArea');var val=objcboCurr.options[objcboCurr.selectedIndex].value;var text=objcboCurr.options[objcboCurr.selectedIndex].text;if(val=='ALL'){ShowMapAllCity();}else{LoadGoogleMap2(val);LoadLocationNameMap2(text);}};function renderMapByCity(){var objcboCurr=document.getElementById('gMapSelectArea');var val=objcboCurr.options[objcboCurr.selectedIndex].value;var text=objcboCurr.options[objcboCurr.selectedIndex].text;if(val=='ALL'){ShowMapAllCountry();}else{LoadGoogleMapCountry2(val);LoadLocationNameMap2(text);}};function ShowMapAllCity(areaCode){loadMapNew('','ALL');addPointsNew('','ALL');};function ShowMapAllCountry(){var objcboCurr=document.getElementById('gMapSelectArea');var val=objcboCurr.options[GmapIndexSelected+1].value;var text=objcboCurr.options[GmapIndexSelected+1].text;ResetMapCountry(val,type);};function createMarkerCity(point,icon,popuphtml,linkIconUrl){var marker=new GMarker(point,icon);GEvent.addListener(marker,"mouseover",function(){if(icon.image==GMapDomain+"images/hotel_icon.gif"){marker.setImage(GMapDomain+"images/hotel_icon_over.gif");}else if(icon.image==GMapDomain+"images/hotel_icon_black.gif"){marker.setImage(GMapDomain+"images/hotel_icon_black_over.gif");}marker.openExtInfoWindow(map,"simple_example_window",popuphtml,{beakOffset: -15});});GEvent.addListener(marker,"click",function(){if(GmapIindexCheckValue==1){GmapIindexCheckValue=0;marker.openExtInfoWindow(map,"simple_example_window",popuphtml,{beakOffset: -15});}else{location.href=linkIconUrl;}});GEvent.addListener(map,'extinfowindowbeforeclose',function(){if(icon.image==GMapDomain+"images/hotel_icon.gif"){marker.setImage(GMapDomain+"images/hotel_icon.gif");}else if(icon.image==GMapDomain+"images/select_hotel.gif"){marker.setImage(GMapDomain+"images/select_hotel.gif");}else{marker.setImage(GMapDomain+"images/hotel_icon_black.gif");}});GEvent.addListener(marker,'mouseout',function(){if(icon.image==GMapDomain+"images/hotel_icon.gif"){marker.setImage(GMapDomain+"images/hotel_icon.gif");}else if(icon.image==GMapDomain+"images/select_hotel.gif"){marker.setImage(GMapDomain+"images/select_hotel.gif");}else{marker.setImage(GMapDomain+"images/hotel_icon_black.gif");}map.closeExtInfoWindow()});return marker;};function LoadGoogleMap2(areaCode){loadMapNew(areaCode,'city');addPointsNew(areaCode,'city');};function ResetMap(areaCode,type){loadMapNew(areaCode,type);addPointsNew(areaCode,type);};var areaCodeTemp="";var typeTemp="";var indexClickTemp;function showRenderMap(){loadMapNew(areaCodeTemp,typeTemp);addPointsNew(areaCodeTemp,typeTemp);};function showRenderMapClick(){document.getElementById('topmapzoom').scrollIntoView();loadMapClickNew(indexClickTemp,typeTemp);addPointsClickNew(indexClickTemp,typeTemp);GEvent.trigger(GMarkers[indexClickTemp],"click");map.setCenter(GMarkers[indexClickTemp].getLatLng(),15);};function GmapClickCity(i){GmapIindexCheckValue=1;loadMapClickNew(i,'city');addPointsClickNew(i,'city');GEvent.trigger(GMarkers[i],"click");map.setCenter(GMarkers[i].getLatLng(),15);document.getElementById('topmapzoom').scrollIntoView();};function addJavascriptCity(){var iIndexTemp=0;if(!(document.getElementById('mapExtInfo'))){iIndexTemp=1;loadjscssfile(GMapDomain+"javascript/extinfowindow.js","js","mapExtInfo");}if(!(document.getElementById('mapMainInfo'))){iIndexTemp=1;var gmapUrl="";var gmapLang="";var gmapCityCode="";gmapLang=document.getElementById('indexlanguage').value;gmapCityCode=document.getElementById('indexcitycode').value;gmapUrl=GMapDomain+"utility/getmapsdata.aspx?lng="+gmapLang+"&cityCode="+gmapCityCode+"&maptype=ci";sendRequestMap(gmapUrl);}if(iIndexTemp==0){LoadGoogleMap();}else{var divMainMap;divMainMap=eval(document.getElementById('loading_map_hotel'));divMainMap.style.visibility='visible';divMainMap.style.display='';divMainMap=eval(document.getElementById('mainMapDivId01'));divMainMap.style.visibility='hidden';divMainMap.style.display='block';}};function createMarkerCountry(point,icon,popuphtml,linkIconUrl){var marker=new GMarker(point,icon);GEvent.addListener(marker,"mouseover",function(){marker.openExtInfoWindow(map,"simple_example_window",popuphtml,{beakOffset: -15});});GEvent.addListener(marker,"click",function(){if(GmapIindexCheckValue==1){GmapIindexCheckValue=0;marker.openExtInfoWindow(map,"simple_example_window",popuphtml,{beakOffset: -15});}else{location.href=linkIconUrl;}});GEvent.addListener(map,'extinfowindowbeforeclose',function(){if(icon.image==GMapDomain+"images/city_icon.gif"){marker.setImage(GMapDomain+"images/city_icon.gif");}else if(icon.image==GMapDomain+"images/city_icon_select.gif"){marker.setImage(GMapDomain+"images/city_icon_select.gif");}});GEvent.addListener(marker,'mouseout',function(){if(icon.image==GMapDomain+"images/city_icon.gif"){marker.setImage(GMapDomain+"images/city_icon.gif");}else if(icon.image==GMapDomain+"images/city_icon_select.gif"){marker.setImage(GMapDomain+"images/city_icon_select.gif");}map.closeExtInfoWindow()});return marker;};function LoadGoogleMapCountry2(cityCode){loadMapNew(cityCode,'country');addPointsNew(cityCode,'country');};function ResetMapCountry(areaCode,type){loadMapNew(areaCode,'countryreset');addPointsNew(areaCode,'countryreset');document.getElementById('GoogleMapLocationNameID').innerHTML="";};function GmapClickCountry(i){GmapIindexCheckValue=1;loadMapClickNew(i,'country');addPointsClickNew(i,'country');GEvent.trigger(GMarkers[i],"click");document.getElementById('topmapzoom').scrollIntoView();};function addJavascriptCountry(){var iIndexTemp=0;if(!(document.getElementById('mapExtInfo'))){iIndexTemp=1;loadjscssfile(GMapDomain+"javascript/extinfowindow.js","js","mapExtInfo");}if(!(document.getElementById('mapMainInfo'))){iIndexTemp=1;var gmapUrl="";var gmapLang="";var gmapCountryCode="";gmapLang=document.getElementById('indexlanguage').value;gmapCountryCode=document.getElementById('indexcountrycode').value;gmapUrl=GMapDomain+"utility/getmapsdata.aspx?lng="+gmapLang+"&countrycode="+gmapCountryCode+"&maptype=co";sendRequestMap(gmapUrl);}if(iIndexTemp==0){LoadGoogleMap();}else{var divMainMap;divMainMap=eval(document.getElementById('loading_map_hotel'));divMainMap.style.visibility='visible';divMainMap.style.display='';divMainMap=eval(document.getElementById('mainMapDivId01'));divMainMap.style.visibility='hidden';divMainMap.style.display='block';}};function indexcalendarcall(selectedcombo){var sselcombo;sselcombo=selectedcombo.toString();if(sselcombo=="A"){}else{document.getElementById('indeximgCalendardept').onclick();}};function indexdisableandopencalendar(selectedcombo){var sselcombo;sselcombo=selectedcombo.toString();if(sselcombo=="A"){document.getElementById('indeximgCalendararr').onclick();}else{document.getElementById('indeximgCalendardept').onclick();}};function indexpopulatmonthsearch(dateselected,selectedcombo){var sselcombo;sselcombo=selectedcombo.toString();var lang;lang=document.getElementById("language3").value;if(sselcombo=="A"){var finaldate;var bufArray1=dateselected.split("/");var effDateDay1;effDateDay1=bufArray1[0].toString();var effDateMonth1;effDateMonth1=bufArray1[1].toString();var effDateYear1;var effDateYear2;effDateYear2=bufArray1[2].toString();effDateYear1=bufArray1[2].toString().substring(2);if(effDateDay1.length<=1){effDateDay1="0"+effDateDay1;}if(effDateMonth1.length<=1){effDateMonth1="0"+effDateMonth1;}finaldate="";finaldate=dateconvertorsearchnew(lang,effDateDay1,effDateMonth1,effDateYear2);document.getElementById("indexcboArriveDay").value=finaldate;document.getElementById("indexarrivaldate").value=finaldate;document.getElementById("indexcalendararr").value=dateselected;var deptdt;deptdt=document.getElementById("indexcalendardept").value;var sdeptday;var sdeptmonth;var sdeptyear;bufArray1=deptdt.split("/");sdeptday=bufArray1[0].toString();sdeptmonth=bufArray1[1].toString();sdeptyear=bufArray1[2].toString();if(checkArrivaldept(deptdt,dateselected)==true){var stodaydate=new Date(effDateYear2,effDateMonth1-1,(Number(effDateDay1)+1));var todayday;var todayyear;var todaymon;var i;i=stodaydate.getDate().toString();if(i.length==1){todayday="0"+stodaydate.getDate();}else{todayday=stodaydate.getDate();}todayyear=stodaydate.getFullYear().toString();todaymon=(Number(stodaydate.getMonth())+1);i=(Number(stodaydate.getMonth())+1).toString();if(i.length==1){todaymon="0"+(Number(stodaydate.getMonth())+1);}else{todaymon=(Number(stodaydate.getMonth())+1);}finaldate=dateconvertorsearchnew(lang,todayday,todaymon,todayyear);dateselected=todayday+"/"+todaymon+"/"+todayyear;document.getElementById("indexdepaturedate").value=finaldate;document.getElementById("indexcalendardept").value=dateselected;}else if(checkdateNights(effDateDay1,effDateMonth1,effDateYear2,sdeptday,sdeptmonth,sdeptyear)==false){var stodaydate=new Date(effDateYear2,effDateMonth1-1,(Number(effDateDay1)+30));var todayday;var todayyear;var todaymon;var i;i=stodaydate.getDate().toString();if(i.length==1){todayday="0"+stodaydate.getDate();}else{todayday=stodaydate.getDate();}todayyear=stodaydate.getFullYear().toString();todaymon=(Number(stodaydate.getMonth())+1);i=(Number(stodaydate.getMonth())+1).toString();if(i.length==1){todaymon="0"+(Number(stodaydate.getMonth())+1);}else{todaymon=(Number(stodaydate.getMonth())+1);}finaldate=dateconvertorsearchnew(lang,todayday,todaymon,todayyear);dateselected=todayday+"/"+todaymon+"/"+todayyear;document.getElementById("indexdepaturedate").value=finaldate;document.getElementById("indexcalendardept").value=dateselected;}}else{var arrivaldate;arrivaldate=document.getElementById("indexarrivaldate").value;var finaldate;var bufArray1=dateselected.split("/");var effDateDay1;effDateDay1=bufArray1[0].toString();var effDateMonth1;effDateMonth1=bufArray1[1].toString();var effDateYear1;var effDateYear2;effDateYear2=bufArray1[2].toString();effDateYear1=bufArray1[2].toString().substring(2);if(effDateDay1.length<=1){effDateDay1="0"+effDateDay1;}if(effDateMonth1.length<=1){effDateMonth1="0"+effDateMonth1;}finaldate=dateconvertorsearchnew(lang,effDateDay1,effDateMonth1,effDateYear2);if(arrivaldate==finaldate){var effDateDate1=new Date(GetMonthString(Number(effDateMonth1-1))+" "+(Number(effDateDay1)+1)+", "+Number(effDateYear2));effDateDay1=(Number(effDateDate1.getDate())).toString();effDateMonth1=(Number(effDateDate1.getMonth())+1).toString();effDateYear2=(Number(effDateDate1.getFullYear())).toString();effDateYear1=effDateYear2.substring(2);if(effDateDay1.length<=1){effDateDay1="0"+effDateDay1;}if(effDateMonth1.length<=1){effDateMonth1="0"+effDateMonth1;}finaldate=dateconvertorsearchnew(lang,effDateDay1,effDateMonth1,effDateYear2);dateselected=effDateDay1+"/"+effDateMonth1+"/"+effDateYear2;}document.getElementById("indexcboArriveDay").value=effDateDay1;document.getElementById("indexdepaturedate").value=finaldate;document.getElementById("indexcalendardept").value=dateselected;}};function indexDisplayRooms(){var cbo;var iNoOf;var iNum;cbo=document.getElementById('indexddlNoOfRooms');eval(cbo);iNoOf=cbo.options[cbo.selectedIndex].text;if(iNoOf==1){DisplaySearch('indexRoom'+iNoOf,'Show');indexShowAgeddl();DisplaySearch('indexChildAges','Hide');}if(iNoOf>4){document.getElementById('indexmorerooms').style.visibility="visible";document.getElementById('indexmorerooms').style.display="";document.getElementById('indexddlNoOfRooms').value=4;iNoOf=4;}else{document.getElementById('indexmorerooms').style.visibility="hidden";document.getElementById('indexmorerooms').style.display="none";}for(iNum=1;iNum<=4;iNum++){if(iNum<=iNoOf){DisplaySearch('indexRoom'+iNum,'Show');}else{DisplaySearch('indexRoom'+iNum,'Hide');DisplaySearch('indexchildAgeR'+iNum,'Hide');}}return false;};function indexShowAgeddl(){var nor;var room;var i;var objChildrenDdl;var noOfChild;room=document.getElementById('indexddlNoOfRooms');eval(room);nor=room.options[room.selectedIndex].text;for(i=1;i<=4;i++){if(i<=nor){objChildrenDdl=document.getElementById('indexddlNoOfChild'+i);eval(objChildrenDdl);noOfChild=objChildrenDdl.options[objChildrenDdl.selectedIndex].text;var childs;if(noOfChild>0){DisplaySearch('indexChildAges','Show');childs=1;}else{if(childs!=1){DisplaySearch('indexChildAges','Hide');}}switch(noOfChild){case "--":DisplaySearch('indexchildAgeR'+i,'Hide');DisplaySearch('indexddlChildAge'+i+1,'Hide');DisplaySearch('indexddlChildAge'+i+2,'Hide');break;case "1":DisplaySearch('indexchildAgeR'+i,'Show');DisplaySearch('indexddlChildAge'+i+1,'Show');DisplaySearch('indexddlChildAge'+i+2,'Hide');break;case "2":DisplaySearch('indexchildAgeR'+i,'Show');DisplaySearch('indexddlChildAge'+i+1,'Show');DisplaySearch('indexddlChildAge'+i+2,'Show');break;default:DisplaySearch('indexchildAgeR'+i,'Hide');break;}}else{DisplaySearch('indexchildAgeR'+i,'Hide');DisplaySearch('indexddlChildAge'+i+1,'Hide');DisplaySearch('indexddlChildAge'+i+2,'Hide');}}};function indexdisallowDateBefore(date){var startDate;var endDate;var ONEDAY=3600*24*2;var zapnewdate=new Date();var stodaydate=new Date(GetMonthString(zapnewdate.getMonth())+" "+(Number(zapnewdate.getDate()))+", "+zapnewdate.getFullYear());date=date.getTime();if((startDate!=null)&&(date<(startDate+ONEDAY))){return true;}var now=stodaydate.getTime();if(date<(now-ONEDAY)){return true;}return false;};function indexdisallowDateAfter(date){var startDate;var endDate;var ONEDAY=3600*24*2;var zapnewdate=new Date();var inday;var inmon;var inyear;var obj;var arrdt;obj=eval('document.getElementById("indexcalendararr")');arrdt=obj.value;inday=arrdt.substring(0,2);inmon=arrdt.substring(3,5);inyear=arrdt.substring(6,10);var effDateDate1=new Date(GetMonthString(Number(inmon-1))+" "+(Number(inday))+", "+Number(inyear));var stodaydate=effDateDate1;var outday=Number(inday)+30;var effdate=new Date(GetMonthString(Number(inmon-1))+" "+outday+", "+Number(inyear));endDate=effdate.getTime();date=date.getTime();if((endDate!=null)&&(date>(endDate-ONEDAY))){return true;}var now=effDateDate1.getTime();if(date<(now-ONEDAY)){return true;}return false;};function indexsearchsubmit(defval){var sdomain;sdomain="www.hoteltravel.com";var stodaydate=new Date();stodaydate.setSeconds(stodaydate.getSeconds()+1);if(navigator.userAgent.indexOf("MSIE")>=0){document.cookie="HTNFILTER=test; expires="+stodaydate.toGMTString()+"; domain="+sdomain+"; path=/";}else{document.cookie="HTNFILTER=test; expires="+stodaydate.toGMTString()+"; domain="+sdomain+"; path=/";}page=document.getElementById('indexcitycode').value;if(page==undefined||page==""){page="country";}else{page="city";}sCountryCode=document.getElementById('indexcountrycode').value;for(i=0;i<arrCountryAsCity.length;i++){if(sCountryCode==arrCountryAsCity[i]){sCountryAsCity="True";}}var searkey;searkey=document.getElementById("indexsearchkey").value;var defvalue;if(searkey.indexOf('.htm')!= -1){overwritesearchcookie();window.location=searkey;}else{defvalue=document.getElementById("indexcFreeSearch").value;if(defval.trim()==defvalue.trim()&&page!="city"){if(sCountryAsCity=="True"){searkey.value="";var objCityCode,objCityName,objCityNameUrl,objAllCityHotels;objAllCityHotels=document.getElementById('AllCityHotels');objCityCode=document.getElementById('indexcitycode');objCityName=document.getElementById('indexcityname');objCityNameUrl=document.getElementById('indexcitynameurl');objCityCode.value=document.getElementById('countrycitycode').value;objCityName.value=document.getElementById('countrycityname').value;objCityNameUrl.value=document.getElementById('countrycityurl').value;indexsearchsubmit(objAllCityHotels.value);}else{document.getElementById("indexcFreeSearch").className="border_search text11normal_red";}}else if(defvalue==""){document.getElementById("indexcFreeSearch").value=defval;document.getElementById("indexcFreeSearch").className="border_search text11normal_red";}else{if(page=="city"){document.getElementById("indexcFreeSearch").value="";}document.getElementById('indexSearchfrm').submit();}}return false;};function overwritesearchcookie(){var sdomain;sdomain="www.hoteltravel.com";var scookiestring,arrDate,depDate,norm,occ,hotelname,hotelkey,searkey;var arryear,arrmoth,arrday,deptyear,deptmon,deptday;arrDate=document.getElementById("indexcalendararr").value;searchterm=document.getElementById("city").value;searkey="";hotelname=document.getElementById("indexcFreeSearch").value;hotelkey=document.getElementById("indexsearchkey").value;if(arrDate==undefined){arrDate="";}else if(arrDate==""){arrDate="";}else{arryear=arrDate.split("/")[2];arrmoth=arrDate.split("/")[1];arrday=arrDate.split("/")[0];arrDate=arryear+"-"+arrmoth+"-"+arrday;}depDate=document.getElementById("indexcalendardept").value;if(depDate=="undefined"){depDate="";}else if(depDate==""){depDate="";}else{deptyear=depDate.split("/")[2];deptmon=depDate.split("/")[1];deptday=depDate.split("/")[0];depDate=deptyear+"-"+deptmon+"-"+deptday;}norm=document.getElementById("indexddlNoOfRooms").value;occ="";for(i=1;i<=parseInt(norm);i++){var iadult;var ichild;var age1;var age2;age1="0";age2="0";if(i==1){iadult=document.getElementById("indexddlNoOfAdults").value;ichild=document.getElementById("indexddlNoOfChild1").value;if(parseInt(ichild)==1){age1=document.getElementById("indexddlChildAge11").value;age2="0";}else if(parseInt(ichild)==2){age1=document.getElementById("indexddlChildAge11").value;age2=document.getElementById("indexddlChildAge12").value;;}}else{iadult=document.getElementById("indexddlNoOfAdults"+i).value;ichild=document.getElementById("indexddlNoOfChild"+i).value;if(parseInt(ichild)==1){age1=document.getElementById("indexddlChildAge"+i+"1").value;age2="0";}else if(parseInt(ichild)==2){age1=document.getElementById("indexddlChildAge"+i+"1").value;age2=document.getElementById("indexddlChildAge"+i+"2").value;;}}if(age1=="0"){if(occ!=""){occ=occ+"~"+iadult+"|"+ichild;}else{occ=iadult+"|"+ichild;}}else if(age1!="0"){if(age2=="0"){if(occ!=""){occ=occ+"~"+iadult+"|"+ichild+"|"+age1;}else{occ=iadult+"|"+ichild+"|"+age1;}}else{if(occ!=""){occ=occ+"~"+iadult+"|"+ichild+"|"+age1+"|"+age2;}else{occ=iadult+"|"+ichild+"|"+age1+"|"+age2;}}}}scookiestring="Search$SearchTerm~";scookiestring=scookiestring+searchterm+"$ArrivalDate~";scookiestring=scookiestring+arrDate+"$DeptaureDate~";scookiestring=scookiestring+depDate+"$NoOfRoom~";scookiestring=scookiestring+norm+"$Occupancy~";scookiestring=scookiestring+occ+"$SearchKey~";scookiestring=scookiestring+searkey+"$HotelName~";scookiestring=scookiestring+hotelname+"$HotelKey~";scookiestring=scookiestring+hotelkey+"$EndSearch";var stodaydate=new Date();stodaydate.setSeconds(stodaydate.getSeconds()+20);if(navigator.userAgent.indexOf("MSIE")>=0){document.cookie="HTNhelpSearch="+indexutfencode(escape(scookiestring))+"; expires="+stodaydate.toGMTString()+"; domain="+sdomain+"; path=/";}else{document.cookie="HTNhelpSearch="+indexutfencode(scookiestring)+"; expires="+stodaydate.toGMTString()+"; domain="+sdomain+"; path=/";}};function indexutfencode(string){string=string.replace(/\r\n/g,"\n");var utftext="";for(var n=0;n<string.length;n++){var c=string.charCodeAt(n);if(c<128){utftext+=String.fromCharCode(c);}else if((c>127)&&(c<2048)){utftext+=String.fromCharCode((c>>6)|192);utftext+=String.fromCharCode((c&63)|128);}else{utftext+=String.fromCharCode((c>>12)|224);utftext+=String.fromCharCode(((c>>6)&63)|128);utftext+=String.fromCharCode((c&63)|128);}}return utftext;};function indexutfdecode(utftext){var string="";var i=0;var c=0;var c3;var c1=0;var c2=0;while(i<utftext.length){c=utftext.charCodeAt(i);if(c<128){string+=String.fromCharCode(c);i++;}else if((c>191)&&(c<224)){c2=utftext.charCodeAt(i+1);string+=String.fromCharCode(((c&31)<<6)|(c2&63));i+=2;}else{c3=0;c2=utftext.charCodeAt(i+1);c3=utftext.charCodeAt(i+2);string+=String.fromCharCode(((c&15)<<12)|((c2&63)<<6)|(c3&63));i+=3;}}return string;};function loadindexsearchcookie(){var soutput;soutput="";var str;str="";str=ReadindexCookiesearch("HTNSearch");if(str.length<=0){str="";str=ReadindexCookiesearch("HTNhelpSearch");}var finalcol=new Array();finalcol=maincookiesearchv2(str);var i;var ii;var changehref;var deletehref;var summaryhref;if(finalcol.length>0){for(i=0;i<finalcol.length;i++){ii=i;ii=ii+1;var ssearchterm;var sarrivaldate;var sdeptdate;var sroom;var socc;var skey;var shotelname;var shotelkey;var subfarray=new Array();subfarray=finalcol[i];if(subfarray.length>0){if(subfarray[0]==undefined){ssearchterm="";}else{ssearchterm=subfarray[0];}if(subfarray[1].length==0){sarrivaldate="";}else{sarrivaldate=subfarray[1];}if(subfarray[2].length==0){sdeptdate="";}else{sdeptdate=subfarray[2];}if(subfarray[3].length==0){sroom=1;}else{sroom=subfarray[3];}if(subfarray[4].length==0){socc="1|0";}else{socc=subfarray[4];}if(subfarray[5].length==0){skey="";}else{skey=subfarray[5];}var ssterm;ssterm=ssearchterm.replace(/[+]/g," ");setindexsearchcookie(ssterm,sarrivaldate,sdeptdate,sroom,socc,skey);}}}else{var sdate=new Date();sdate.setDate(sdate.getDate()+2);var stodaydate=new Date(GetMonthString(sdate.getMonth())+" "+sdate.getDate()+", "+sdate.getFullYear());var lang;lang=document.getElementById("indexlanguage").value;var stodayday;var stodayyear;var stodaymon;var sfinalarr,sfinaldept;var shdnarr,shdndept;stodayday=(Number(stodaydate.getDate()));stodayyear=stodaydate.getFullYear().toString();stodaymon=(Number(stodaydate.getMonth())+1);var i;i=stodaymon.toString();if(i.length==1){stodaymon="0"+stodaymon;}i=stodayday.toString();if(i.length==1){stodayday="0"+stodayday;}sfinalarr=dateconvertorsearchnew(lang,stodayday,stodaymon,stodayyear.toString());shdnarr=stodayday+"/"+stodaymon+"/"+stodayyear;document.getElementById("indexarrivaldate").value=sfinalarr;document.getElementById("indexcalendararr").value=shdnarr;sdate.setDate(sdate.getDate()+1);stodaydate=new Date(GetMonthString(sdate.getMonth())+" "+sdate.getDate()+", "+sdate.getFullYear());stodayday=(Number(stodaydate.getDate()));stodayyear=stodaydate.getFullYear().toString();stodaymon=(Number(stodaydate.getMonth())+1);i=stodaymon.toString();if(i.length==1){stodaymon="0"+stodaymon;}i=stodayday.toString();if(i.length==1){stodayday="0"+stodayday;}sfinaldept=dateconvertorsearchnew(lang,stodayday,stodaymon,stodayyear.toString());shdndept=stodayday+"/"+stodaymon+"/"+stodayyear;document.getElementById("indexdepaturedate").value=sfinaldept;document.getElementById("indexcalendardept").value=shdndept;}};function ReadindexCookiesearch(cookieName){var theCookie=""+document.cookie;var ind=theCookie.indexOf(cookieName);if(ind== -1||cookieName=="")return "";var ind1=theCookie.indexOf(';',ind);if(ind1== -1)ind1=theCookie.length;return indexutfdecode(unescape(theCookie.substring(ind+cookieName.length+1,ind1)));};function setindexsearchcookie(ssterm,arr,dept,sr,socc,skey){var lang;lang=document.getElementById("indexlanguage").value;var sarr,sfinalarr,sfinaldept,occ,adult,children,age,age1,splitocc,ssocc,nor;var shdnarr,shdndept;var sdate=new Date();sdate.setDate(sdate.getDate()+2);var stodaydate=new Date(GetMonthString(sdate.getMonth())+" "+sdate.getDate()+", "+sdate.getFullYear());var stodayday;var stodayyear;var stodaymon;stodayday=(Number(stodaydate.getDate()));stodayyear=stodaydate.getFullYear().toString();stodaymon=(Number(stodaydate.getMonth())+1);var i;i=stodaymon.toString();if(i.length==1){stodaymon="0"+stodaymon;}i=stodayday.toString();if(i.length==1){stodayday="0"+stodayday;}if(arr==""){sfinalarr=dateconvertorsearchnew(lang,stodayday,stodaymon,stodayyear.toString());shdnarr=stodayday+"/"+stodaymon+"/"+stodayyear.substring(2);}else{sarr=arr.split("-");sfinalarr=dateconvertorsearchnew(lang,sarr[2],sarr[1],sarr[0]);shdnarr=sarr[2]+"/"+sarr[1]+"/20"+sarr[0].substring(2);shdndept="";}sarr="";sdate.setDate(sdate.getDate()+1);stodaydate=new Date(GetMonthString(sdate.getMonth())+" "+sdate.getDate()+", "+sdate.getFullYear());stodayday=(Number(stodaydate.getDate()));stodayyear=stodaydate.getFullYear().toString();stodaymon=(Number(stodaydate.getMonth())+1);i=stodaymon.toString();if(i.length==1){stodaymon="0"+stodaymon;}i=stodayday.toString();if(i.length==1){stodayday="0"+stodayday;}if(dept==""){sfinaldept=dateconvertorsearchnew(lang,stodayday,stodaymon,stodayyear.toString());shdndept=stodayday+"/"+stodaymon+"/"+stodayyear.substring(2);}else if(dept=="undefined"){sfinaldept=dateconvertorsearchnew(lang,stodayday,stodaymon,stodayyear.toString());shdndept=stodayday+"/"+stodaymon+"/"+stodayyear.substring(2);}else{sarr=dept.split("-");sfinaldept=dateconvertorsearchnew(lang,sarr[2],sarr[1],sarr[0]);shdndept=sarr[2]+"/"+sarr[1]+"/20"+sarr[0].substring(2);}document.getElementById("indexcookieterm").value=ssterm;document.getElementById("indexarrivaldate").value=sfinalarr;document.getElementById("indexdepaturedate").value=sfinaldept;document.getElementById("indexddlNoOfRooms").value=sr;document.getElementById("indexcalendararr").value=shdnarr;document.getElementById("indexcalendardept").value=shdndept;document.getElementById("indexsearchkey").value=skey;occ=socc.split("~");nor=parseInt(sr);for(i=1;i<=4;i++){if(i<=nor){Displaycsearch('indexRoom'+i,'Show');ssocc=occ[i-1];splitocc=ssocc.split("|");adult=parseInt(splitocc[0]);children=parseInt(splitocc[1]);if(children==1){age=splitocc[2];}else if(children==2){age=splitocc[2];age1=splitocc[3];}var childs;if(children>0){Displaycsearch('indexChildAges','Show');childs=1;}else{if(childs!=1){Displaycsearch('indexChildAges','Hide');}}switch(children){case 0:if(i==1){document.getElementById("indexddlNoOfAdults").value=parseInt(adult);document.getElementById("indexddlNoOfChild1").value=parseInt(children);}else{var iNum;iNum=i-1;eval('document.getElementById("indexddlNoOfAdults'+i+'").value = parseInt(adult)');eval('document.getElementById("indexddlNoOfChild'+i+'").value = parseInt(children)');}Displaycsearch('indexchildAgeR'+i,'Hide');Displaycsearch('indexddlChildAge'+i+'1','Hide');Displaycsearch('indexddlChildAge'+i+'2','Hide');break;case 1:if(i==1){document.getElementById("indexddlNoOfAdults").value=adult;document.getElementById("indexddlNoOfChild1").value=children;document.getElementById("indexddlChildAge11").value=age;}else{eval('document.getElementById("indexddlNoOfAdults'+i+'").value = parseInt(adult)');eval('document.getElementById("indexddlNoOfChild'+i+'").value = parseInt(children)');eval('document.getElementById("indexddlChildAge'+i+'1").value = parseInt(age)');}Displaycsearch('indexchildAgeR'+i,'Show');Displaycsearch('indexddlChildAge'+i+'1','Show');Displaycsearch('indexddlChildAge'+i+'2','Hide');break;case 2:if(i==1){document.getElementById("indexddlNoOfAdults").value=adult;document.getElementById("indexddlNoOfChild1").value=children;document.getElementById("indexddlChildAge11").value=age;document.getElementById("indexddlChildAge22").value=age1;}else{eval('document.getElementById("indexddlNoOfAdults'+i+'").value = parseInt(adult)');eval('document.getElementById("indexddlNoOfChild'+i+'").value = parseInt(children)');eval('document.getElementById("indexddlChildAge'+i+'1").value = parseInt(age)');eval('document.getElementById("indexddlChildAge'+i+'2").value = parseInt(age1)');}Displaycsearch('indexchildAgeR'+i,'Show');Displaycsearch('indexddlChildAge'+i+'1','Show');Displaycsearch('indexddlChildAge'+i+'2','Show');break;default:Displaycsearch('indexchildAgeR'+i,'Hide');break;}}else{Displaycsearch('indexchildAgeR'+i,'Hide');Displaycsearch('indexddlChildAge'+i+'1','Hide');Displaycsearch('indexddlChildAge'+i+'2','Hide');}}};function checkinput(id,valtext){var cfreesearch=document.getElementById("indexcFreeSearch").value;if(cfreesearch.trim()==""){document.getElementById("indexcFreeSearch").value=valtext;}setTimeout("indexshowHideObject('container02','hide')",500);};function clearinput(id,valtext){var cFreeSearch=document.getElementById("indexcFreeSearch");cFreeSearch.focus();cFreeSearch.className="border_search searchtext_black_normal";page=document.getElementById('indexcitycode').value;if(page==undefined||page==""){page="country";}else{page="city";}var cval;cval=document.getElementById(id).value;if(cval.trim()==valtext.trim()){var obj=document.getElementById(id);obj.value="";}};function indexPerformSearch(searchTerm,evt){try{if(page=="city"){if(searchTerm.length<2){indexshowHideObject('container02','hide');return;}}else{if(searchTerm.length<0){indexshowHideObject('container02','hide');return;}}var numResults=20;if(window.event){theKey=window.event.keyCode;binIE=true;}if(theKey==undefined||theKey=='undefined'||theKey=='0'){evt=evt||window.event;var theKey=(evt.keyCode)?evt.keyCode:evt.which;}if(theKey==undefined||theKey==0){theKey=48;}if(theKey==9||theKey==27){indexshowHideObject('container02','hide');return;}if(theKey==40||theKey==38){var cFreeSearch=document.getElementById("indexcFreeSearch");cFreeSearch.focus();indextranserExecutionToContainer(numResults,theKey);return;}if(theKey==13){indextranserExecutionToEnterHandler();return;}indexpublicLastFocusId=0;indexshowHideObject('container02','show');var language=document.getElementById("indexlanguage");var strLngId=language.value;if(theKey==8){indexstrLastKeyPressed="";var CaretPos=0;CaretPos=indexgetCurrentPosition();strTextBoxString=document.getElementById('indexcFreeSearch').value;var strFirstPart=strTextBoxString.substr(0,CaretPos-1);var strSecondPart=strTextBoxString.substr(CaretPos,strTextBoxString.length);var strFinalString=strFirstPart+strSecondPart;var indexsearchValueForAC=strFinalString;}else if(theKey==46){indexstrLastKeyPressed="";var CaretPos=0;CaretPos=indexgetCurrentPosition();var strTextBoxString=document.getElementById('indexcFreeSearch').value;var strFirstPart=strTextBoxString.substr(0,CaretPos);var strSecondPart=strTextBoxString.substr(CaretPos+1,strTextBoxString.length);var strFinalString=strFirstPart+strSecondPart;var indexsearchValueForAC=strFinalString;}else if((theKey>=48&&theKey<=57)||(theKey>=65&&theKey<=90)||(theKey==32)||(theKey>=97&&theKey<=112)){var CaretPos=0;CaretPos=indexgetCurrentPosition();var strTextBoxString=document.getElementById('indexcFreeSearch').value;var strFirstPart=strTextBoxString.substr(0,CaretPos);var strSecondPart=strTextBoxString.substr(CaretPos,strTextBoxString.length);var strFinalString=strFirstPart+String.fromCharCode(theKey).toLowerCase()+strSecondPart;var indexsearchValueForAC=strFinalString;}else{return false;}var isFF=false;var textSelected=false;if(navigator.userAgent.toLowerCase().indexOf("firefox")>0){isFF=true;}var myArea=document.getElementById("indexcFreeSearch");var begin,selection,end;if(isFF==true){if(myArea.selectionStart!=undefined){begin=myArea.value.substr(0,myArea.selectionStart);selection=myArea.value.substr(myArea.selectionStart,myArea.selectionEnd-myArea.selectionStart);end=myArea.value.substr(myArea.selectionEnd);if(selection.length>0){textSelected=true;}}}else{if(window.getSelection){selection=window.getSelection();}else if(document.getSelection){selection=document.getSelection();}else if(document.selection){selection=document.selection.createRange().text;}if(selection==""){textSelected=false;}else{var startPos=myArea.value.indexOf(selection);if(startPos!= -1){var endPos=myArea.value.indexOf(selection)+selection.length;begin=myArea.value.substr(0,startPos);end=myArea.value.substr(endPos,myArea.value.length);textSelected=true;}}}if(textSelected==true){var stIndex;var endIndex;var strFirstPart;var strSecondPart;var strTextBoxString;var strFinalString;stIndex=myArea.value.indexOf(selection);endIndex=myArea.value.indexOf(selection)+selection.length;strTextBoxString=document.getElementById('indexcFreeSearch').value;strFirstPart=strTextBoxString.substr(0,stIndex);strSecondPart=strTextBoxString.substr(endIndex,strTextBoxString.length);strFinalString=strFirstPart+String.fromCharCode(theKey).toLowerCase()+strSecondPart;indexsearchValueForAC=strFinalString;strFinalString="";strFirstPart="";strSecondPart="";strTextBoxString="";endIndex=0;stIndex=0;}if(indexsearchValueForAC=="0"){indexsearchValueForAC="";}indexsearchValueForAC=indexsearchValueForAC.substring(0,1).toUpperCase()+indexsearchValueForAC.substring(1);indexsearchValueForAC=indexsearchValueForAC.trim();sCountryCode=document.getElementById('indexcountrycode').value;for(i=0;i<arrCountryAsCity.length;i++){if(sCountryCode==arrCountryAsCity[i]){sCountryAsCity="True";sCityCode=arrCountryCityCode[i];}}var requestUrl;var shttpurl;shttpurl=document.URL;if(shttpurl.indexOf("http://")== -1){if(page=="country"&&sCountryAsCity==undefined){requestUrl="http://www.hoteltravel.com/search/fuzzysearch.aspx";}else if(page=="country"&&sCountryAsCity=="True"){requestUrl="http://www.hoteltravel.com/search/hotelsearch.aspx";}}else{if(page=="country"&&sCountryAsCity==undefined){requestUrl="http://www.hoteltravel.com/search/fuzzysearch.aspx";}else if(page=="country"&&sCountryAsCity=="True"){requestUrl="http://www.hoteltravel.com/search/hotelsearch.aspx";}}indexsearchValueForAC=escape(indexsearchValueForAC);indexCreateXmlHttp();if(indexXmlHttpForAC){indexCountryCode=document.getElementById('indexcountrycode').value;indexCityCode=document.getElementById('indexcitycode').value;indexXmlHttpForAC.onreadystatechange=indexHandleResponse;if(page=="country"&&sCountryAsCity==undefined){indexXmlHttpForAC.open("GET",requestUrl+"?search="+indexsearchValueForAC+'&lng='+strLngId+'&noRec='+numResults+'&CountryCode='+indexCountryCode,true);}else if(page=="country"&&sCountryAsCity=="True"){indexXmlHttpForAC.open("GET",requestUrl+"?indexcFreeSearch="+indexsearchValueForAC+'&indexlanguage='+strLngId+'&norec='+numResults+'&indexcitycode='+sCityCode,true);}indexXmlHttpForAC.send(null);}}catch(e){}};function indexPerformhotelSearch(searchTerm,evt){try{if(searchTerm.length<2){indexshowHideObject('container02','hide');return;}var numResults=20;if(window.event){theKey=window.event.keyCode;binIE=true;}if(theKey==undefined||theKey=='undefined'||theKey=='0'){evt=evt||window.event;var theKey=(evt.keyCode)?evt.keyCode:evt.which;}if(theKey==9||theKey==27){indexshowHideObject('container02','hide');return;}if(theKey==40||theKey==38){var cFreeSearch=document.getElementById("indexcFreeSearch");cFreeSearch.focus();indextranserExecutionToContainer(numResults,theKey);return;}if(theKey==13){indextranserExecutionToEnterHandler();return;}indexpublicLastFocusId=0;indexshowHideObject('container02','show');var language=document.getElementById("indexlanguage");var strLngId=language.value;if(theKey==8){indexstrLastKeyPressed="";var CaretPos=0;CaretPos=indexgetCurrentPosition();strTextBoxString=document.getElementById('indexcFreeSearch').value;var strFirstPart=strTextBoxString.substr(0,CaretPos-1);var strSecondPart=strTextBoxString.substr(CaretPos,strTextBoxString.length);var strFinalString=strFirstPart+strSecondPart;var indexsearchValueForAC=strFinalString;}else if(theKey==46){indexstrLastKeyPressed="";var CaretPos=0;CaretPos=indexgetCurrentPosition();var strTextBoxString=document.getElementById('indexcFreeSearch').value;var strFirstPart=strTextBoxString.substr(0,CaretPos);var strSecondPart=strTextBoxString.substr(CaretPos+1,strTextBoxString.length);var strFinalString=strFirstPart+strSecondPart;var indexsearchValueForAC=strFinalString;}else if((theKey>=48&&theKey<=57)||(theKey>=65&&theKey<=90)||(theKey==32)||(theKey>=97&&theKey<=112)){var CaretPos=0;CaretPos=indexgetCurrentPosition();var strTextBoxString=document.getElementById('indexcFreeSearch').value;var strFirstPart=strTextBoxString.substr(0,CaretPos);var strSecondPart=strTextBoxString.substr(CaretPos,strTextBoxString.length);var strFinalString=strFirstPart+String.fromCharCode(theKey).toLowerCase()+strSecondPart;var indexsearchValueForAC=strFinalString;}else{return false;}var isFF=false;var textSelected=false;if(navigator.userAgent.toLowerCase().indexOf("firefox")>0){isFF=true;}var myArea=document.getElementById("indexcFreeSearch");var begin,selection,end;if(isFF==true){if(myArea.selectionStart!=undefined){begin=myArea.value.substr(0,myArea.selectionStart);selection=myArea.value.substr(myArea.selectionStart,myArea.selectionEnd-myArea.selectionStart);end=myArea.value.substr(myArea.selectionEnd);if(selection.length>0){textSelected=true;}}}else{if(window.getSelection){selection=window.getSelection();}else if(document.getSelection){selection=document.getSelection();}else if(document.selection){selection=document.selection.createRange().text;}if(selection==""){textSelected=false;}else{var startPos=myArea.value.indexOf(selection);if(startPos!= -1){var endPos=myArea.value.indexOf(selection)+selection.length;begin=myArea.value.substr(0,startPos);end=myArea.value.substr(endPos,myArea.value.length);textSelected=true;}}}if(textSelected==true){var stIndex;var endIndex;var strFirstPart;var strSecondPart;var strTextBoxString;var strFinalString;stIndex=myArea.value.indexOf(selection);endIndex=myArea.value.indexOf(selection)+selection.length;strTextBoxString=document.getElementById('indexcFreeSearch').value;strFirstPart=strTextBoxString.substr(0,stIndex);strSecondPart=strTextBoxString.substr(endIndex,strTextBoxString.length);strFinalString=strFirstPart+String.fromCharCode(theKey).toLowerCase()+strSecondPart;indexsearchValueForAC=strFinalString;strFinalString="";strFirstPart="";strSecondPart="";strTextBoxString="";endIndex=0;stIndex=0;}indexsearchValueForAC=indexsearchValueForAC.substring(0,1).toUpperCase()+indexsearchValueForAC.substring(1);indexsearchValueForAC=indexsearchValueForAC.trim();var requestUrl;var shttpurl;shttpurl=document.URL;if(shttpurl.indexOf("http://")== -1){requestUrl="http://www.hoteltravel.com/search/hotelsearch.aspx";}else{requestUrl="http://www.hoteltravel.com/search/hotelsearch.aspx";}indexsearchValueForAC=escape(indexsearchValueForAC);indexCreateXmlHttp();if(indexXmlHttpForAC){indexCityCode=document.getElementById('indexcitycode').value;indexXmlHttpForAC.onreadystatechange=indexHandleResponse;indexXmlHttpForAC.open("GET",requestUrl+"?indexcFreeSearch="+indexsearchValueForAC+'&indexlanguage='+strLngId+'&norec='+numResults+'&indexcitycode='+indexCityCode,true);indexXmlHttpForAC.send(null);}}catch(e){}};function indexCreateXmlHttp(){try{indexXmlHttpForAC=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{indexXmlHttpForAC=new ActiveXObject("Microsoft.XMLHTTP");}catch(oc){indexXmlHttpForAC=null;}}if(!indexXmlHttpForAC&&typeof XMLHttpRequest!="undefined"){indexXmlHttpForAC=new XMLHttpRequest();}};function indextranserExecutionToContainer(numResults,theKey){var i;var container=document.getElementById("container02");var cFreeSearch=document.getElementById("indexcFreeSearch");if(container.style.visibility=="visible"){indexisAtleastOneTimeFocusWasSet=true;var rightIndx=indexpublicLastFocusId-1;var myDiv=document.getElementById("indexDiv"+rightIndx);if(myDiv!=null){myDiv.setAttribute("class","boxNode02");myDiv.setAttribute("className","boxNode02");}if(theKey==38){indexpublicLastFocusId=indexpublicLastFocusId-2;}var myDiv=document.getElementById("indexDiv"+indexpublicLastFocusId);if(myDiv==null){indexpublicLastFocusId=0;myDiv=document.getElementById("indexDiv"+indexpublicLastFocusId);}myDiv.setAttribute("class","boxNodeOnFocus02");myDiv.setAttribute("className","boxNodeOnFocus02");indexpublicLastFocusId=indexpublicLastFocusId+1;}};function indextranserExecutionToEnterHandler(){var container=document.getElementById("container02");if(container.style.visibility=="visible"){if(indexisAtleastOneTimeFocusWasSet==true){var rightIndx=indexpublicLastFocusId-1;var myDiv=document.getElementById("indexDiv"+rightIndx).getElementsByTagName('div');var searchTerm=myDiv[0].innerHTML.split(",")[0].trim();var searchKey;if(page=="city"||page=="country"&&sCountryAsCity=="True"){searchKey=myDiv[0].id;}else{searchKey=myDiv[0].tabIndex;}document.getElementById('indexcFreeSearch').value=searchTerm;document.getElementById('indexsearchkey').value=searchKey;indexshowHideObject('container02','hide');indexisAtleastOneTimeFocusWasSet=false;}else{indexshowHideObject('container02','hide');}}else{indexsearchsubmit("submitorlink");}};function indexgetCurrentPosition(){var CaretPos=0;if(document.selection){document.getElementById('indexcFreeSearch').focus();var Sel=document.selection.createRange();Sel.moveStart('character',-document.getElementById('indexcFreeSearch').value.length);CaretPos=Sel.text.length;}else if(document.getElementById('indexcFreeSearch').selectionStart||document.getElementById('indexcFreeSearch').selectionStart=='0')CaretPos=document.getElementById('indexcFreeSearch').selectionStart;return CaretPos;};function indexHandleResponse(){try{if(indexXmlHttpForAC.readyState==4){if(indexXmlHttpForAC.status==200){indexPopulateContainer(indexXmlHttpForAC.responseXML.documentElement);}}}catch(e){}};function indexPopulateContainer(searchResultNode){var searchNodes=searchResultNode.getElementsByTagName('Destination');indexClearResultContainer();var container=document.getElementById("container02");container.innerHTML="<!--[if lte IE 6.5]><iframe></iframe><![endif]-->";var lang=document.getElementById("indexlanguage").value;if(lang.toLowerCase()=="en"){lang=""}else{lang=lang.toLowerCase()+"/"}var buf=[];for(var count=0;count<searchNodes.length;count++){if(page=="city"||page=="country"&&sCountryAsCity=="True"){var countryurl,cityurl,hotelurl,urlCol;var url=indexGetInnerText(searchNodes[count].childNodes[1]);urlCol=url.split("*");countryurl=urlCol[2];cityurl=urlCol[1];hotelurl=urlCol[0];url="http://www.hoteltravel.com/"+lang+countryurl+"/"+cityurl+"/"+hotelurl;}else{url="";}var textValue=indexGetInnerText(searchNodes[count].childNodes[2]);var val1,val2,val3,textValueCol;textValueCol=textValue.split("*");val1=textValueCol[0];val2=textValueCol[1];val3=textValueCol[2];if(val2==undefined&&val3==undefined||val2!=undefined&&val3==undefined){textValue=val1;}else{textValue=val1+","+val2;}var kv=indexGetInnerText(searchNodes[count].childNodes[3]);var strHtml=indexAddResult(url,textValue,count,kv);buf.push(strHtml);strHtml="";}document.getElementById("container02").innerHTML=buf.join('');};function indexGetInnerText(node){return(node.textContent||node.innerText||node.text);};function indexAddResult(url,resultText,count,kv){var container=document.getElementById("container02");var strId="indexDiv"+count.toString();var first;var strHtml;var allhotels;if(page=="city"||page=="country"&&sCountryAsCity=="True"){if(count=="0"){allhotels=document.getElementById('AllCityHotels').value;var hongkong;hongkong=url.indexOf('hongkong');if(hongkong>0){var hong_kong;var kowloon;var lantau;var City2;var City3;kowloon=document.getElementById('AllKowloonHotels');lantau=document.getElementById('AllLantauHotels');hong_kong=document.getElementById('AllHongkongHotels');if(hong_kong==null){City2=kowloon.value;City3=lantau.value;}else if(lantau==null){City2=kowloon.value;City3=hong_kong.value;}else if(kowloon==null){City2=hong_kong.value;City3=lantau.value;}strId="indexDiv0";first="<div class='boxFirstName' id=''>"+allhotels+"</div>";strHtml="<div id='"+strId+"' class='boxNode02' onclick=\"indexdoOnClick(' ','"+allhotels+"',' ');\" onmouseover=\" indexchangeCursor('"+strId+"'); \" >"+first+"</div>";strId="indexDiv1";first="<div class='boxFirstName' id=''>"+City2+"</div>";strHtml=strHtml+"<div id='"+strId+"' class='boxNode02' onclick=\"indexdoOnClick(' ','"+City2+"',' ');\" onmouseover=\" indexchangeCursor('"+strId+"'); \" >"+first+"</div>";strId="indexDiv2";first="<div class='boxFirstName' id=''>"+City3+"</div>";strHtml=strHtml+"<div id='"+strId+"' class='boxNode02' onclick=\"indexdoOnClick(' ','"+City3+"',' ');\" onmouseover=\" indexchangeCursor('"+strId+"'); \" >"+first+"</div>";strId="indexDiv3";first="<div class='boxFirstName' id='"+url+" '>"+resultText+"</div>";strHtml=strHtml+"<div id='"+strId+"' class='boxNode_city' onclick=\"indexdoOnClick('"+url+"','"+resultText+"','"+kv+"');\" onmouseover=\" indexchangeCursor('"+strId+"'); \" >"+first+"</div>";}else{strId="indexDiv0";first="<div class='boxFirstName' id=''>"+allhotels+"</div>";strHtml="<div id='"+strId+"' class='boxNode02' onclick=\"indexdoOnClick(' ','"+allhotels+"',' ');\" onmouseover=\" indexchangeCursor('"+strId+"'); \" >"+first+"</div>";strId="indexDiv1";first="<div class='boxFirstName' id='"+url+" '>"+resultText+"</div>";strHtml=strHtml+"<div id='"+strId+"' class='boxNode_city' onclick=\"indexdoOnClick('"+url+"','"+resultText+"','"+kv+"');\" onmouseover=\" indexchangeCursor('"+strId+"'); \" >"+first+"</div>";}}else{strId="indexDiv"+(parseInt(count)+1);first="<div class='boxFirstName' id='"+url+" '>"+resultText+"</div>";strHtml="<div id='"+strId+"' class='boxNode_city' onclick=\"indexdoOnClick('"+url+"','"+resultText+"','"+kv+"');\" onmouseover=\" indexchangeCursor('"+strId+"'); \" >"+first+"</div>";}}else if(page=="country"&&sCountryAsCity==undefined){first="<div class='boxFirstName' tabindex='"+kv+" '>"+resultText+"</div>";strHtml="<div id='"+strId+"' class='boxNode02' onclick=\"indexdoOnClick('"+url+"','"+resultText+"','"+kv+"');\" onmouseover=\" indexchangeCursor('"+strId+"'); \" >"+first+"</div>";}return strHtml;};function indexchangeCursor(innerMsgId){var rightIndx;if(indexpublicLastFocusId==undefined){}else{rightIndx=indexpublicLastFocusId-1;var myDiv=document.getElementById("indexDiv"+rightIndx);if(myDiv!=null){myDiv.setAttribute("class","boxNode02");myDiv.setAttribute("className","boxNode02");}}};function indexClearResultContainer(){var container=document.getElementById('container02');if(container.hasChildNodes()){while(container.childNodes.length>=1){container.removeChild(container.firstChild);}}};function indexdoOnClick(url,strParam,kv){try{indexpublicLastFocusId=0;var cFreeSearch=document.getElementById('indexcFreeSearch');var searchTerm=strParam.split(",")[0];searchTerm=searchTerm.trim();cFreeSearch.value=searchTerm;indexshowHideObject('container02','hide');var searchkey=document.getElementById('indexsearchkey');if(page=="country"&&sCountryAsCity=="True"){searchkey.value=url;}else if(page=="city"&&sCountryAsCity==undefined){searchkey.value=url;}else{searchkey.value=kv;}var objCityCode,objCityName,objCityNameUrl;objCityCode=document.getElementById('indexcitycode');objCityName=document.getElementById('indexcityname');objCityNameUrl=document.getElementById('indexcitynameurl');if(document.getElementById('indexcountrycode').value=="HK"){var objAllCityHotels,objcityHongkong,objcitykowloon,objcitylantau;objAllCityHotels=document.getElementById('AllCityHotels');objcityHongkong=document.getElementById('AllHongkongHotels');objcitykowloon=document.getElementById('AllKowloonHotels');objcitylantau=document.getElementById('AllLantauHotels');if(objcitykowloon!=null&&objcitykowloon.value==strParam){objCityCode.value=document.getElementById('KowloonCode').value;objCityName.value=document.getElementById('Kowloon').value;objCityNameUrl.value=document.getElementById('KowloonUrl').value;}else if(objcitylantau!=null&&objcitylantau.value==strParam){objCityCode.value=document.getElementById('LantauCode').value;objCityName.value=document.getElementById('Lantau').value;objCityNameUrl.value=document.getElementById('LantauUrl').value;}else if(objcityHongkong!=null&&objcityHongkong.value==strParam){objCityCode.value=document.getElementById('countrycitycode').value;objCityName.value=document.getElementById('countrycityname').value;objCityNameUrl.value=document.getElementById('countrycityurl').value;}else if(objAllCityHotels!=null&&objAllCityHotels.value==strParam){objCityCode.value=document.getElementById('countrycitycode').value;objCityName.value=document.getElementById('countrycityname').value;objCityNameUrl.value=document.getElementById('countrycityurl').value;}searchkey.value=url;}else if(document.getElementById('indexcountrycode').value=="SG"){searchkey.value=url;objCityCode.value=document.getElementById('countrycitycode').value;objCityName.value=document.getElementById('countrycityname').value;bjCityNameUrl.value=document.getElementById('countrycityurl').value;}else if(document.getElementById('indexcountrycode').value=="MV"){searchkey.value=url;objCityCode.value=document.getElementById('countrycitycode').value;objCityName.value=document.getElementById('countrycityname').value;objCityNameUrl.value=document.getElementById('countrycityurl').value;}else if(document.getElementById('indexcountrycode').value=="MO"){searchkey.value=url;objCityCode.value=document.getElementById('countrycitycode').value;objCityName.value=document.getElementById('countrycityname').value;objCityNameUrl.value=document.getElementById('countrycityurl').value;}else if(document.getElementById('indexcountrycode').value=="LU"){searchkey.value=url;objCityCode.value=document.getElementById('countrycitycode').value;objCityName.value=document.getElementById('countrycityname').value;objCityNameUrl.value=document.getElementById('countrycityurl').value;}}catch(e){indexshowHideObject('container02','hide');}};function indexshowHideObject(objName,strShowHideFlag){var objName=document.getElementById(objName);if(strShowHideFlag=='Show'||strShowHideFlag=='show'||strShowHideFlag=='SHOW'){objName.style.visibility="visible";objName.style.display="inline";}else{objName.style.visibility="hidden";objName.style.display="none";}};function indexHideContainer(){try{indexshowHideObject('container02','hide');}catch(e){indexshowHideObject('container02','hide');}};var map;var geocoder=null;var addressMarker;function load(countryCode,address){if(GBrowserIsCompatible()){map=new GMap2(document.getElementById("googlemap"));map.addControl(new GSmallMapControl());map.addControl(new GMapTypeControl());map.setMapType(G_NORMAL_MAP);geocoder=new GClientGeocoder();}if(geocoder){geocoder.setBaseCountryCode(countryCode);geocoder.getLatLng(address,function(point){if(!point){}else{if(addressMarker){map.removeOverlay(addressMarker);}addressMarker=new GMarker(point);map.setCenter(point,5);map.addOverlay(addressMarker);}});}setTimeout("hidegooglemaptabcontent()",100);};var strBody;var map;var icon0;function addLoadEvent(func){var oldonload=window.onload;if(typeof window.onload!='function'){window.onload=func}else{window.onload=function(){oldonload();func();}}};function ImageLoad(){addLoadEvent(loadMap);addLoadEvent(addPoints);setTimeout("hidegooglemaptabcontent()",800);};function LoadGoogleMap(){try{loadMap();addPoints();}catch(e){}};function onloadindexgoogle(){var url;var pos;var stab;url=document.URL;pos=url.indexOf('#');stab=url.substring(pos+1);if(pos>0){if(stab=="travelguide"||stab=="travelguides"){ChangeTab(3);}else if(stab=="maps"||stab=="map"){ChangeTab(2);}else if(stab=="hotels"||stab=="hotel"){ChangeTab(1);}else if(stab=="introduction"||stab=="introductions"){ChangeTab(0);}}else{document.getElementById("TabContent2").visibility="visible";document.getElementById("TabContent2").style.display="";document.getElementById("TabContent1").visibility="hidden";document.getElementById("TabContent1").style.display="none";document.getElementById("TabContent3").visibility="hidden";document.getElementById("TabContent3").style.display="none";document.getElementById("TabContent4").visibility="hidden";document.getElementById("TabContent4").style.display="none";document.getElementById("tabHotel").className="menu_on";document.getElementById("tabIntro").className="menu_off";document.getElementById("tabMap").className="menu_off";document.getElementById("tabTravelGuides").className="menu_off";document.getElementById("hrefHotels").className="text11blue_normal";document.getElementById("hrefIntro").className="text11white_normal";document.getElementById("hrefMaps").className="text11white_normal";document.getElementById("hrefTravelGuides").className="text11white_normal";}objNavigationLabel=document.getElementById("topnavigationlabel");objNavigationHotels=document.getElementById("lbtopnavigationhotels");if(objNavigationLabel.style.display=="none"){DisplaySearch('topnavigationlabel','Show');if(objNavigationHotels.value!=null){objNavigationLabel.innerHTML="&nbsp;/&nbsp;"+objNavigationHotels.value;}else{objNavigationLabel.innerHTML="";}}};function searchsubmitindex(){document.getElementById('formindex').submit();return false;};function hidegooglemaptabcontent(){document.getElementById("TabContent3").visibility="hidden";document.getElementById("TabContent3").style.display="none";};function onloadindex(){var url;var pos;var stab;url=document.URL;pos=url.indexOf('#');stab=url.substring(pos+1);if(pos>0){if(stab=="travelguide"||stab=="travelguides"){ChangeTab(3);}else if(stab=="maps"||stab=="map"){ChangeTab(2);}else if(stab=="hotels"||stab=="hotel"){ChangeTab(1);}else if(stab=="introduction"||stab=="introductions"){ChangeTab(0);}}else{document.getElementById("TabContent2").visibility="visible";document.getElementById("TabContent2").style.display="";document.getElementById("TabContent1").visibility="hidden";document.getElementById("TabContent1").style.display="none";document.getElementById("TabContent4").visibility="hidden";document.getElementById("TabContent4").style.display="none";document.getElementById("tabHotel").className="menu_on";document.getElementById("tabIntro").className="menu_off";document.getElementById("tabMap").className="menu_off";document.getElementById("tabTravelGuides").className="menu_off";document.getElementById("hrefHotels").className="text11blue_normal";document.getElementById("hrefIntro").className="text11white_normal";document.getElementById("hrefMaps").className="text11white_normal";document.getElementById("hrefTravelGuides").className="text11white_normal";}};function ChangeTab(itab){switch(parseInt(itab)){case 0:document.getElementById("TabContent1").visibility="visible";document.getElementById("TabContent1").style.display="block";document.getElementById("TabContent2").visibility="hidden";document.getElementById("TabContent2").style.display="none";document.getElementById("TabContent3").visibility="hidden";document.getElementById("TabContent3").style.display="none";document.getElementById("TabContent4").visibility="hidden";document.getElementById("TabContent4").style.display="none";document.getElementById("tabIntro").className="menu_on";document.getElementById("hrefIntro").className="text11blue_normal";document.getElementById("tabHotel").className="menu_off";document.getElementById("hrefHotels").className="text11white_normal";document.getElementById("tabMap").className="menu_off";document.getElementById("hrefMaps").className="text11white_normal";document.getElementById("tabTravelGuides").className="menu_off";document.getElementById("hrefTravelGuides").className="text11white_normal";break;case 1:document.getElementById("TabContent1").visibility="hidden";document.getElementById("TabContent1").style.display="none";document.getElementById("TabContent2").visibility="visible";document.getElementById("TabContent2").style.display="block";document.getElementById("TabContent3").visibility="hidden";document.getElementById("TabContent3").style.display="none";document.getElementById("TabContent4").visibility="hidden";document.getElementById("TabContent4").style.display="none";document.getElementById("tabIntro").className="menu_off";document.getElementById("hrefIntro").className="text11white_normal";document.getElementById("tabHotel").className="menu_on";document.getElementById("hrefHotels").className="text11blue_normal";document.getElementById("tabMap").className="menu_off";document.getElementById("hrefMaps").className="text11white_normal";document.getElementById("tabTravelGuides").className="menu_off";document.getElementById("hrefTravelGuides").className="text11white_normal";break;case 2:document.getElementById("TabContent1").visibility="hidden";document.getElementById("TabContent1").style.display="none";document.getElementById("TabContent2").visibility="hidden";document.getElementById("TabContent2").style.display="none";document.getElementById("TabContent3").visibility="visible";document.getElementById("TabContent3").style.display="";document.getElementById("TabContent4").visibility="hidden";document.getElementById("TabContent4").style.display="none";document.getElementById("tabIntro").className="menu_off";document.getElementById("hrefIntro").className="text11white_normal";document.getElementById("tabHotel").className="menu_off";document.getElementById("hrefHotels").className="text11white_normal";document.getElementById("tabMap").className="menu_on";document.getElementById("hrefMaps").className="text11blue_normal";document.getElementById("tabTravelGuides").className="menu_off";document.getElementById("hrefTravelGuides").className="text11white_normal";var pageGMap=document.getElementById('indexcitycode').value;if(pageGMap==undefined||pageGMap==""){addJavascriptCountry();}else{addJavascriptCity();}break;case 3:document.getElementById("TabContent1").visibility="hidden";document.getElementById("TabContent1").style.display="none";document.getElementById("TabContent2").visibility="hidden";document.getElementById("TabContent2").style.display="none";document.getElementById("TabContent3").visibility="hidden";document.getElementById("TabContent3").style.display="none";document.getElementById("TabContent4").visibility="visible";document.getElementById("TabContent4").style.display="block";document.getElementById("tabIntro").className="menu_off";document.getElementById("hrefIntro").className="text11white_normal";document.getElementById("tabHotel").className="menu_off";document.getElementById("hrefHotels").className="text11white_normal";document.getElementById("tabMap").className="menu_off";document.getElementById("hrefMaps").className="text11white_normal";document.getElementById("tabTravelGuides").className="menu_on";document.getElementById("hrefTravelGuides").className="text11blue_normal";break;}};function onloadmaphotels(){document.getElementById("maphotels").value="0";document.getElementById("allhotels").visibility="hidden";document.getElementById("allhotels").style.display="none";document.getElementById("hideshowhotels").className="show_detail_mid_blue";document.getElementById("ahideshowhotels").className="text11white_normal";document.getElementById("tabcover").className="show_detail_cover";document.getElementById("tabcoverleft").className="show_detail_l_blue";document.getElementById("tabcoverright").className="show_detail_r_blue";};function clickallhotels(){var ihotels;var obj;obj=document.getElementById("maphotels");ihotels=obj.value;if(ihotels==0){document.getElementById("maphotels").value="1";document.getElementById("allhotels").visibility="visible";document.getElementById("allhotels").style.display="";document.getElementById("hideshowhotels").className="hide_detail_midle_white";document.getElementById("ahideshowhotels").className="text11normal_gray";document.getElementById("tabcover").className="hide_detail_cover";document.getElementById("tabcoverleft").className="hide_detail_l_white";document.getElementById("tabcoverright").className="hide_detail_r_white";}else{document.getElementById("maphotels").value="0";document.getElementById("allhotels").visibility="hidden";document.getElementById("allhotels").style.display="none";document.getElementById("hideshowhotels").className="show_detail_mid_blue";document.getElementById("ahideshowhotels").className="text11white_normal";document.getElementById("tabcover").className="show_detail_cover";document.getElementById("tabcoverleft").className="show_detail_l_blue";document.getElementById("tabcoverright").className="show_detail_r_blue";}};function clickallmaps(){var imaps;imaps=document.getElementById("mapmaps").value;if(imaps==0){document.getElementById("mapmaps").value="1";document.getElementById("allmaps").style.visibility="visible";document.getElementById("allmaps").style.display="";document.getElementById("hideshowmaps").className="hide_detail_midle_white";document.getElementById("ahideshowmaps").className="text11normal_gray";document.getElementById("tabcover").className="hide_detail_cover";document.getElementById("tabcoverleft").className="hide_detail_l_white";document.getElementById("tabcoverright").className="hide_detail_r_white";}else{document.getElementById("mapmaps").value="0";document.getElementById("allmaps").style.visibility="hidden";document.getElementById("allmaps").style.display="none";document.getElementById("hideshowmaps").className="show_detail_mid_blue";document.getElementById("ahideshowmaps").className="text11white_normal";document.getElementById("tabcover").className="show_detail_cover";document.getElementById("tabcoverleft").className="show_detail_l_blue";document.getElementById("tabcoverright").className="show_detail_r_blue";}};function onloadmapmaps(){document.getElementById("mapmaps").value="0";document.getElementById("allmaps").style.visibility="hidden";document.getElementById("allmaps").style.display="none";document.getElementById("hideshowmaps").className="show_detail_mid_blue";document.getElementById("ahideshowmaps").className="text11white_normal";document.getElementById("tabcover").className="show_detail_cover";document.getElementById("tabcoverleft").className="show_detail_l_blue";document.getElementById("tabcoverright").className="show_detail_r_blue";}
  
  function createXMLHttpRequesttopdestinationcityhotels(){ 
	if (window.XMLHttpRequest){
	    xmlHttpRequesttopdestinationcityhotels=new XMLHttpRequest();
	}else if (window.ActiveXObject){
	    try{
		    xmlHttpRequesttopdestinationcityhotels=new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(e){
		    //alert('createXMLHttpRequestMap error:'+e);
		}
	}
	return xmlHttpRequesttopdestinationcityhotels;
}
/************** Top Destination City Hotels Rates **************/
function topdestinationcityhotels()
{
    //alert("inside topdestinationcityhotels");
    var str;
try{
    str="";
    str=ReadindexCookiesearch("HTNSearch");
	if (str.length<=0)
	{ 
	    str=""
	    str=ReadindexCookiesearch("HTNhelpSearch");
	}
    
    var finalcol=new Array();
    finalcol=maincookiesearchv2(str);
    //alert('finalcol='+finalcol);
    if (finalcol.length>0)
    {
        var xmlHttptopdestinationcityhotels;
        xmlHttptopdestinationcityhotels = createXMLHttpRequesttopdestinationcityhotels();
        if (xmlHttptopdestinationcityhotels == null)
        {
            return;
        } 
        var sdomain ='http://www.hoteltravel.com/utility/GetCityRates.aspx?';
        var co = document.getElementById('indexcountrycode').value;
        var ci= document.getElementById('indexcitycode').value;
        var htc= document.getElementById('indexhotelcodes').value;
        
        /* Condition1 : to Check if the last HotelCode Seprator is Pipe or not
         if Pipe then remove from Last position */
        if (htc.indexOf('|') != -1)
        {
            var LengthOfRequestedString = htc.length;
            var LastIndexOfPipe = htc.lastIndexOf("|");
            if ((LengthOfRequestedString-1) == LastIndexOfPipe)
            {
                var htc = htc.substring(0, htc.length-1);
            }
        }
        /* Condition1 */
        var cindx=getHTNTracker("cindx");
        if (cindx=='close')
        {
            cindx=0;
        }
        var slang = document.getElementById('indexlanguage').value;
        var url = sdomain + 'sCountry='+ co + '&sCity=' + ci + '&sCityLandingPageHotels=' + htc + '&slang=' + slang + '&cindx='+cindx;
        //alert('url='+url);
        //call func to handle the handler
        xmlHttptopdestinationcityhotels.onreadystatechange=function()
        {
            if(xmlHttptopdestinationcityhotels.readyState==4)
            {
                try
                {
                    //get response data
                    var txtResponce = xmlHttptopdestinationcityhotels.responseText;
                    //alert('txtResponce123='+txtResponce);
                    if(txtResponce.length>6 && txtResponce != '&nbsp;') 
                    {
                        ReplaceCityRates(txtResponce);
                        return;
                    }
                    else
                    {
                        /* If no Responce then show Default City Landing Page Rates*/
                        ShowDefaultCityHotelsRates();
                    }
                }
                catch(e)
                {
                    /* Do Error Handling */
                    // alert('Index1401.js Function: topdestinationcityhotels()');
                    /* If no Responce then show Default City Landing Page Rates*/
                    ShowDefaultCityHotelsRates();
                }
            }
        }
        xmlHttptopdestinationcityhotels.open("GET",url,true);
        xmlHttptopdestinationcityhotels.send(null);
    }
    else
    {
        /* If no Responce then show Default City Landing Page Rates*/
        ShowDefaultCityHotelsRates();
    }
}catch(e)
{
ShowDefaultCityHotelsRates();
}
}
function ShowDefaultCityHotelsRates()
{
    try
    {
        var arHotels = new Array();
        var htc= document.getElementById('indexhotelcodes').value;
        
        /* Condition1 : to Check if the last HotelCode Seprator is Pipe or not - Not required
        if Pipe, then remove from Last position */
        if (htc.indexOf('|') != -1)
        {
            var LengthOfRequestedString = htc.length;
            var LastIndexOfPipe = htc.lastIndexOf("|");
            if ((LengthOfRequestedString-1) == LastIndexOfPipe)
            {
                var htc = htc.substring(0, htc.length-1);
            }
        }
        /* Condition1 */
        arHotels =  htc.split("|");	
        for(var i = 1; i < arHotels.length+1 ; i++) 
        {
            DisplaySearch('divall'+i, 'Show');
        } 
    }
    catch(e)
    {
        //Do nothing
        //alert('Index1401.js Function: ShowDefaultCityHotelsRates')
    }
}
function ReplaceCityRates(txtResponce)
{
    //alert('Index1401.js Fn: Inside ReplaceLandingPageRates');
    ///alert('txtResponce='+txtResponce);
    try
    {
        var arRequestedHotels = new Array();
        var arResponceHotelsInfo = new Array();
        var strRateImg="<img id='[RateId]' src='[RateSrc]' />";
        
        
        var RequestedHotels = document.getElementById('indexhotelcodes').value;
        /* Condition1 : to Check if the last HotelCode Seprator is Pipe or not
         if Pipe then remove from Last position */
        if (RequestedHotels.indexOf('|') != -1)
        {
            var LengthOfRequestedString = RequestedHotels.length;
            var LastIndexOfPipe = RequestedHotels.lastIndexOf("|");
            if ((LengthOfRequestedString-1) == LastIndexOfPipe)
            {
                var RequestedHotels = RequestedHotels.substring(0, RequestedHotels.length-1);
            }
        }
        /* Condition1 */
        
        //Condition2 : Get the Length of Requested Hotels
        if (RequestedHotels.indexOf('|') != -1)
        {
            arRequestedHotels =  RequestedHotels.split("|");
            var NoOfRequestedHotels = arRequestedHotels.length;
        }
        else
        {
            if ( RequestedHotels != '' || RequestedHotels != undefined || RequestedHotels != null )
            {
                arRequestedHotels[0]=RequestedHotels;
                var NoOfRequestedHotels = 1 ;
            }
            else
            {
                /* If Some Error in Responce then show Default City Landing Page Rates*/
                ShowDefaultCityHotelsRates();
            }
        }
        //Condition2 : Ends
        
        //Condition3 : Get the Length of Responce Hotels and the Array of their Corresponding Rates
        if (txtResponce.indexOf('^') != -1)
        {
            arResponceHotelsInfo = txtResponce.split('^');
            var NoOfResponceHotels = arResponceHotelsInfo.length;
        }
        else
        {
            if ( txtResponce != '' || txtResponce != undefined || txtResponce != null )
            {
                arResponceHotelsInfo[0] = txtResponce;
                var NoOfResponceHotels = '1' ;
            }
            else
            {
                //return ;
                /* If Some Error in Responce then show Default City Landing Page Rates*/
                ShowDefaultCityHotelsRates();
            }
        }
        //Condition3 : Ends
/*    
        alert('NoOfRequestedHotels='+NoOfRequestedHotels);
        alert('NoOfResponceHotels='+NoOfResponceHotels);
*/
        //Condition4 : Condition to check if the requested and responce length is not same
        if (NoOfRequestedHotels != NoOfResponceHotels )
        {
           /* If Some Error in Responce then show Default City Landing Page Rates*/
            ShowDefaultCityHotelsRates();
        }
        //Condition4 : Ends
        
        //Condition5 :Replace the inner divrate innerHTML with corresponding rate URL
        for(var i = 0; i <= parseInt(NoOfResponceHotels)-1 ; i++)
        {
            var id = parseInt(i)+1;
            if (document.getElementById('divrate'+id))
            {   
                var EachHotelInfo=arResponceHotelsInfo[i];
                //Condition6 : Check if responce hotel Info has field seperator
                if ( EachHotelInfo.indexOf('~') != -1 )
                {
                    //Condition7 : Check if responce hotel format is correct or not i.e HotelCode~RateUrl~HangerColor
                    if ( EachHotelInfo.split('~').length == 3)
                    {
                        //Condition8 : Condition to check if the requested HotelCodes and responce HotelCodes are same
                        if (arRequestedHotels[i] == EachHotelInfo.split('~')[0])
                        {
                            // r : suffix used for Responce
                            //Getting Responce Hotel Info
                            var rHotelCode = EachHotelInfo.split('~')[0];
                            var IdHotelRate = 'TopCityHotel_' + rHotelCode;
                            var rRateImg = EachHotelInfo.split('~')[1];
                            var rHangerColor = EachHotelInfo.split('~')[2];
                            //Ends
                            
                            var strTmpRateImg=strRateImg;
                            //Display Image Rates
                            strTmpRateImg=strTmpRateImg.replace('[RateId]',IdHotelRate)
                            strTmpRateImg=strTmpRateImg.replace('[RateSrc]',rRateImg)
                            
                            document.getElementById('divrate'+id).innerHTML=strTmpRateImg;
                            switch(rHangerColor)
				            {
				                case "yellow":
					                //Relace nothing, Keep the default default logo
					                break;
        					        
				                case "purple": // Case Free Night - Default Color Purple
					                document.getElementById('divlogo'+id).className ='price_logo_purple';
					                break;
        					        
					            case "green": // Case Super Saver - Default Color Green
						            document.getElementById('divlogo'+id).className ='price_logo_green';
					                break;
        					        
					            case "blue": // Case Value Add - Default Color Blue
						            document.getElementById('divlogo'+id).className ='price_logo_blue';
					                break;
        					        
					            case "red": // Case Best Value - Default Color Red
						            document.getElementById('divlogo'+id).className ='price_logo_red';
					                break;
        					        
					            default:
						            //Do Nothing
						            break;
				            }
                            //Ends
                        }
                        else
                        {
                            //do nothing, Just go to next Record
                        }
                        //Condition8 : Ends
                    }
                    else
                    {
                        //do nothing, Just go to next Record
                    }
                    //Condition7 : Ends
                }
                else
                {
                    //do nothing, Just go to next Record
                }
                //Condition6 : Ends
            }
            else
            {
               //do nothing, Just go to next Record
            }
            DisplaySearch('divall'+id, 'Show');
        }// For Loop Ends
        //Condition5 : Ends
    }
    catch(e)
    {
        /* Do Error Handling */
        //alert('Error in Function ReplaceLandingPageRates : Index1401.js')
        /* If no Responce then show Default City Landing Page Rates*/
        ShowDefaultCityHotelsRates();
    }
}





