// JavaScript Document $(function(){ var sdates = $("#hotelstarttime,#hotelendtime") .datepicker({showAnim:"fadeIn",duration:0,minDate: 0, maxDate:"2y",numberOfMonths: 3,showButtonPanel: true}); shcity= $("a[name='city']"); $("#hotelcityList a").click(function(){ $("#citys").val($(this).text()); shcity.text($(this).text()); $("#hotelcityList").hide(); }); $("a[name='city']").click(function(){ $("#hotelcityList").fadeIn(200); }); $(".closeIt").click(function(){ $("#hotelcityList").fadeOut(200); }); $("#introContent p:not(:first)").hide(); $("#introContent").slideDown(); var mapdiv = $("#mapEara"), mapbtn=$("#ShowHotelMap"); $(".mapcontrolButton").click(function(){ if(mapbtn.text()=="Close Map") { mapdiv.slideUp(600); mapbtn.text("Show Map"); } else { mapdiv.slideDown(600); mapbtn.text("Close Map"); } }); getFTmenu(); if( typeof $.fn.preview == 'function' ){ $("a.jq_preview").preview(); } }); //显示房型 function showRoom(){ if(ReadyRate) { clearInterval(showRoomT); pastRoom(); } } //价格展示 function pastRoom() { $(".eachhotelList table[data^='Hotel']").each(function(){ RObjId = $(this).attr("data"); EachObj = eval('hotelRate.'+RObjId); isHT = (EachObj.sourcePR=="HT")?true:false; $(this).find("tbody").html(''); EachObj.roomType.sort(function(a,b){ return (a.sortPrice - b.sortPrice); }); RoomTypeCount = EachObj.roomType.length; for(ii=0;iitbody").append(getTr(EachObj.roomType[ii], 1, isHT, ii)); } if(RoomTypeCount>3){ $(this).find(">tbody").append(getTr([RoomTypeCount], 2, isHT)); } if(RoomTypeCount==0){ $(this).find(">tbody").append(getTr(RObjId, 3, isHT)); } }); } // function getTr(data, type,isHT, index){ var trStr=""; var HideStr=""; switch(type){ case 1: HideStr = (index>=3)? 'name="roomtr" style="display:none"':""; trStr = ''+ ''+data.RoomTypeName+'
'+ ''+((data.RoomBreakfast!='')?'('+data.RoomBreakfast+')':'')+''+ ''+ ''+showPromotion(data.RoomPromotion)+''+ ''+showInternet(data.RoomNetwork,data.RoomInternet)+''+ ''+ ''+data.RoomPayment+''+ '$'+data.avgPrice+''+ ''+ ''+ 'Book this hotel'; break; case 2: trStr = '' + 'All Room Types['+data[0]+']' + '' + '' + ''+ ''; break; case 3: trStr = '' + 'Note:The hotel room rate is for request only, please click here to send your request.(alex@chinahighlights.net)' + ''; break; } return trStr; function showPromotion(Str){ if(Str.length > 0){ Str = Str.split('|_'); return ''+ ''; } else { return ""; } } function showInternet(a,b){ if(isHT){ if(a=="0"){ return "NO"; } else if(a=="1" || a=="2") { if(b=='Free'){ return 'Free internet access'; } else { return 'Free internet access'; } } else if(a=="3") { if(b=='Free'){ return 'Free internet access'; } else { return 'Free internet access'; } } else if(a=="4") { if(b=='Free'){ return 'Free internet access'; } else { return 'Free internet access'; } } } else { return "NO"; } } function showPaymantMsg(payType){ if(payType == 'instant confirm'){ return paymenttip('instant'); } else if (payType == 'Prepay'){ return paymenttip('Prepay'); } else if (payType == 'Pay at hotel'){ return paymenttip('Payathotel'); } } function showDalyRate(D,R){ var DateArr = new Date(D).toString().split(" "); return ''+DateArr[1]+'. '+DateArr[2]+', '+DateArr[3]+'$'+R+''; } function showAllDaylyRate(Ds){ var n = Ds.length; var Str=""; for(i=0;i"); //eimg.attr("src","/css/images/hotel/double-arrow-down.png"); } else { Obj.css("display","block"); textStr.html("Less Location Select"); subFTForm(); } //文本ID, 是否覆盖[即原来的值还有], 值, 点击的对象 function fTHotels(inputID, isOver, val, e){ var clickObj = $(e); var clickPerantObj = clickObj.parents("div"); var clickPerentObjID = clickPerantObj.attr("id"); var newVal=""; //sortSort 顺序 //sortPrice 价格 //sortRating 星级 //sortType 类型 //sortFacilties 设施 //sortDistrict 周边城市 switch(clickPerentObjID) { case "sortSort": newVal = val; break; case "sortPrice": clickObj.siblings().attr("class","unselect2").end().attr("class","select2"); newVal = val; break; case "sortRating": clickObj.siblings().attr("class","unselect2").end().attr("class","select2"); newVal = val; break; case "sortType": if(clickObj.attr("class") == "select"){ clickObj.attr("class", "unselect"); }else{ clickObj.attr("class", "select"); } $("#sortType .select").each(function(i){ if(newVal.length>0){newVal=newVal+ "," +$(this).attr("val");}else{newVal=$(this).attr("val");} }); break; case "sortFacilties": if(clickObj.attr("class") == "select"){ clickObj.attr("class", "unselect"); }else{ clickObj.attr("class", "select"); } $("#sortFacilties .select").each(function(i){ if(newVal.length>0){newVal=newVal+ "," +$(this).attr("val");}else{newVal=$(this).attr("val");} }); break; case "sortDistrict": break; default: } var Obj = $("#listCondition #"+inputID); Obj.val(newVal); $("#listCondition #page").val(1);//return to first page subFTForm(); } //付款方式提示 function paymenttip(payT){ if(payT == 'Prepay'){ //预付 return "Book and get confirmation after payment."; } else if (payT == "instant") { //时实支付 return 'Pay now and get Real Time confirmation.'; } else if (payT == "Payathotel") { //前台现付 return 'After making a reservation we send an email confirmation which includes all your booking details and your hotel reservation number.'; } } function Guaranteetip(){ return 'Our lowest price guarantee is only available for the lowest price room type that we use from each hotel. All claims must compare the same room in the same hotel on the same day. The comparison must include the same items (breakfast, service fees and tax) as us. For the guarantee, you must finish your payment within our specified advanced booking time. For instant hotel booking, you must pay online directly. For prepay hotels, the advanced booking time must be based on our quote email. The prices are not guaranteed until after payment. If you find a cheaper price from another site, please contact with the website address of the offer. We will check it. If it is valid we will debit your account for the difference.'; }