AH.Room={init:function(){$("#room_list a").click(function(){AH.Room.popup(this);return false});$("#photogallery .photos a").click(function(){AH.Photo.changeImage(this.href);this.blur();return false});if($("#hotel_photo a").length==1){$("#hotel_photo ul").remove()}else{if($("#hotel_photo a").length<4){$("#hotel_photo ul").attr("style","height: 72px")}}if($("div#tp_reviews").length>0){$("div#primary").append('<div id="tp_overview" class="tabpanel" style="display:none;"></div><div id="tp_howtobook" class="tabpanel" style="display:none;"></div>')}else{if($("div#tp_howtobook").length>0){$("div#primary").append('<div id="tp_overview" class="tabpanel" style="display:none;"></div><div id="tp_reviews" class="tabpanel" style="display:none;"></div>')}else{$("div#primary").append('<div id="tp_reviews" class="tabpanel" style="display:none;"></div><div id="tp_howtobook" class="tabpanel" style="display:none;"></div>')}}if($("div#tp_reviews").length>0){$("div#primary2").append('<div id="tp_overview" class="tabpanel" style="display:none;"></div><div id="tp_howtobook" class="tabpanel" style="display:none;"></div>')}else{if($("div#tp_howtobook").length>0){$("div#primary2").append('<div id="tp_overview" class="tabpanel" style="display:none;"></div><div id="tp_reviews" class="tabpanel" style="display:none;"></div>')}else{$("div#primary2").append('<div id="tp_reviews" class="tabpanel" style="display:none;"></div><div id="tp_howtobook" class="tabpanel" style="display:none;"></div>')}}$("#brochuretabs a").click(function(){AH.Tabs.changeTabs(this);this.blur();return false});$("#reviewsummary a, #customer_comments a").click(function(){AH.Tabs.changeTabs(document.getElementById("tab_reviews"));this.blur();window.location="#tab_reviews";return false});$("a.roomname").click(function(){AH.RoomInfo.toggle(this);this.blur();return false});$("a.roomName").click(function(){AH.RoomInformation.toggle(this);this.blur();return false})},show:function(B,D){var C=AH.Key.getTopPos(B)+5;var A=AH.Key.getLeftPos(B)+5;if(typeof D=="string"){D=$("#"+D)}$(D).css({left:A,top:C}).show();AH.Event.track(AH.Event.displayTracker,"Room Details","Show")},popup:function(A){$(".room_popup").remove();$('<div class="room_popup"><h3>'+roomDetailsTxt+'</h3><a id="close" href="#">Close</a><div id="container"></div></div>').appendTo("body");$("#close").click(function(){$(".room_popup").remove();this.blur();return false});AH.Room.show(A,$(".room_popup"));$("#container").html('<img src="/ahgimages/loading.gif" id="loading" />');$("#container").load(A.href)}};AH.Photo={changeImage:function(A){$("#mainphoto").css("backgroundImage","url("+A+")")}};AH.Tabs={changeTabs:function(B){var A="tp"+B.id.substring(3);$("#brochuretabs li.current").removeClass("current");$(".tabpanel").css("display","none");$(B).parent("li").addClass("current");$("#"+A).css("display","block");if($("#"+A).children().length==0){$("#"+A).html('<div class="tabloading"><img src="/ahgimages/loading.gif" /></div>');var C=B.href.split("#");$.get(C[0],{tileonly:"true"},function(D){$("#"+A).html(D)})}}};AH.RoomInfo={toggle:function(A){if($(A).parent("td").parent("tr").next("tr").children("td").children(".roominfo").length==0){$(A).parent("td").parent("tr").after('<tr class="'+$(A).parent("td").parent("tr").attr("class")+'"><td colspan="4" style="padding:0;"><div class="roominfo" style="display:none;"></div></td></tr>')}var B=$(A).parent("td").parent("tr").next("tr").find(".roominfo");if($(B).children().length==0){$(B).html('<div class="roomloading"><img src="/ahgimages/loading.gif" /></div>');$(B).load(A.href)}$(B).slideToggle("fast");return false}};AH.RoomInformation={toggle:function(A){if($(A).parent("td").parent("tr").next("tr").children("td").children(".roominfoBrochure").length==0){$(A).parent("td").parent("tr").after('<tr class="'+$(A).parent("td").parent("tr").attr("class")+'"><td colspan="6" style="padding:0;"><div class="roominfo" style="display:none;"></div></td></tr>')}var B=$(A).parent("td").parent("tr").next("tr").find(".roominfoBrochure");if($(B).children().length==0){$(B).html('<div class="roomloading"><img src="/ahgimages/loading.gif" /></div><div class="clear">&nbsp;</div>');$(B).load(A.href)}$(B).slideToggle("fast");return false}};AH.newRoomList={TruncateLongRoomList:function(){var A=0;$("table#prices tbody#priceTable_body tr").each(function(B){if(B>7){$(this).hide()}A=B+1});if(A>8){$("table#prices tbody#priceTable_body").append('<tr id="morelink"><td colspan="5"><a href="#">'+transl_moreinfo+"</a></td></tr>")}$("#morelink").click(function(){$("table#prices tbody#priceTable_body tr").show();$("table#prices tbody#priceTable_body tr#morelink").remove();return false})}};$(function(){AH.Room.init();AH.newRoomList.TruncateLongRoomList()});$(document).ready(function(){$("a.roomtitle").click(function(){var A=$(this).parent().next();A.slideToggle();A.html('<img src="/ahgimages/loading.gif" id="loading" />');A.load(this.href);return false})});function roomInfoSlide(A,B,C){if($(".roomInformationContent"+B).css("display")=="none"){if($(".roomInformationContent"+B).children().size()==0){$(".roomInformationContent"+B).html('<img src="/ahgimages/loading.gif" id="loading" />');$(".roomInformationContent"+B).load(A.href)}$(".roomInformationContent"+B).slideDown("slow");$(A).html("Close x")}else{$(".roomInformationContent"+B).hide();if(!C){$(A).html("view more details >>")}else{$(A).html("view more details"+C+">>")}}}$(document).ready(function(){$("input.jsButton").show();$("input.noJsButton").hide()});function revealRoomOcc(A,C){var D=$("select."+A).val();$(".roomOccupancy"+C).css("display","none");var B=1;while(B<=D){$("#row"+C+"selectNumber"+B).css("display","block");B++}}(function(A){jQuery.fn.gallery=function(B){var C=this;B=jQuery.extend({animationSpeed:"normal",itemWidth:"63"},B);itemLength=A("#photogallery li").length;galleryWidth=itemLength*parseInt(B.itemWidth);A("#photogallery ul").css("width",galleryWidth+"px");if(itemLength>5){A("#scroller_r").css("background-position","-1210px -461px")}animating=false;A(".next").click(function(){if(animating==false){animating=true;animateLeft=parseInt(A("#photogallery ul").css("left"))-(B.itemWidth*size);if(animateLeft+parseInt(A("#photogallery ul").css("width"))>0){A("#scroller_l").css("background-position","-1200px -461px");A("#photogallery ul").animate({left:animateLeft},"normal",function(){A(this).css("left",animateLeft);if(parseInt(A("#photogallery ul").css("left"))+parseInt(A("#photogallery ul").css("width"))<=B.itemWidth*5){A("#scroller_r").css("background-position","-1210px -400px")}animating=false})}else{animating=false}}return false});A(".prev").click(function(){if(animating==false){animating=true;animateLeft=parseInt(A("#photogallery ul").css("left"))+(B.itemWidth*size);if((animateLeft+parseInt(A("#photogallery ul").css("width")))<=parseInt(A("#photogallery ul").css("width"))){A("#scroller_r").css("background-position","-1210px -461px");A("#photogallery ul").animate({left:animateLeft},"normal",function(){A(this).css("left",animateLeft);if(parseInt(A("#photogallery ul").css("left"))==0){A("#scroller_l").css("background-position","-1200px -400px")}animating=false})}else{animating=false}}return false})}})(jQuery);var AH_MULTIMAP;var dv=true;var json_hotels;var is_location=(typeof view_on_map=="undefined")?false:true;AH_MULTIMAP={init:function(){if($("body.brochure").length){$("img#multimap").wrap("<a href='#' id='multimap_launch'></a>");$("a#multimap_launch").append("<span style='display:block;'>"+text_zoommap+"</span>");$("#multimap_launch").click(function(){AH_MULTIMAP.createContainer(true);this.blur();return false});AH_MULTIMAP.checkBirdsEyeCoverage(center_lat,center_long)}else{AH_MULTIMAP.createContainer(true)}},createContainer:function(D){if(D!=undefined){dv=D}if(!is_location){var A,F;if(self.pageYOffset){A=window.innerWidth;F=self.pageYOffset}else{if(document.documentElement&&document.documentElement.scrollTop){A=document.documentElement.clientWidth;F=document.documentElement.scrollTop}else{if(document.body){A=document.body.clientWidth;F=document.body.scrollTop}}}var E=((A-700)/2)+"px";var C=(120+F)+"px";if($("#mapcontainer").length){var B=(!dv)?MM_WORLD_OBLIQUE:MM_WORLD_MAP;viewer.setMapType(B);$("#mapcontainer,#mapcontaineriemask").css({left:E,top:C})}else{$("body").append("<div id='mapcontainer'><div class='mapbar'><a href='#' id='closelink'>"+text_close+"</a></div><div id='mapviewer'></div></div>");if($.browser.msie){$("body").append("<iframe src='blank.html' id='mapcontaineriemask'></iframe>")}$("#mapcontainer,#mapcontaineriemask").css({left:E,top:C});$("#closelink").click(function(){AH_MULTIMAP.hidemap();this.blur();return false});AH_MULTIMAP.getAPIjs()}}else{if($("#map").length){AH_MULTIMAP.getAPIjs()}}},getAPIjs:function(){$.getScript("http://www.multimap.com/API/InteractiveMapping/activeh_api?callback=callBuildMap&locale="+pagelanguage)},buildMap:function(){var E=(!dv)?MM_WORLD_OBLIQUE:MM_WORLD_MAP;viewer=MMFactory.createViewer(document.getElementById(map_id),E);var C=new MMLatLon(center_lat,center_long);var B;var D=undefined;var F=undefined;var A=undefined;viewer.goToPosition(C,zoom_level);AH_MULTIMAP.getHotelsJson(C);if(pagelanguage!="en"){viewer.setOption("units","km")}viewer.addWidget(new MMPanZoomWidget(new MMBox(5,5)));viewer.addWidget(new MMMapTypeWidget());viewer.setMappingAPI("virtualearth");viewer.addEventHandler("endPan",AH_MULTIMAP.logEvent);viewer.addEventHandler("changeZoom",AH_MULTIMAP.logEvent);viewer.addEventHandler("click",function(H,I,G){if(!G&&I.infobox_html){if(I.infoBoxOpened()){I.closeInfoBox()}else{I.openInfoBox()}}});B=new MMLocalInfoWidget(D,F,A);widget_available=true},hidemap:function(){$("#mapcontainer,#mapcontaineriemask").css("left","-9999px");if(viewer.getMapType()==4){}},logEvent:function(D,E,C,B,A){if((D=="endPan")&&(A!="infobox")){AH_MULTIMAP.getHotelsJson(B)}else{if(D=="changeZoom"){AH_MULTIMAP.getHotelsJson(viewer.getCurrentPosition())}}return true},getHotelsJson:function(D){var F="";F=String(D);F=F.replace(/[\(\)]/g,"");var B=F.split(",");var G=viewer.getMapBounds().getNorthEast();var E=String(viewer.getGreatCircleDistance(new MMLatLon(B[0],B[1]),new MMLatLon(G.lat,G.lon),"km"));E=(E>30)?30:E;var C=String(B[1]+"^"+B[0]+"^30");var A="";if(avail_mode){A="&day="+avail_day+"&month="+avail_month+"&year="+avail_year+"&numnights="+avail_nights+"&numrooms="+avail_rooms+""}$.getScript("http://www.activehotels.com/wl/servlet/hoteladfeed?trkref=AHG&centre="+C+"&radius="+E+A+"&callback=AH_MULTIMAP.renderHotels")},renderHotels:function(O){json_hotels=O;markers=[];viewer.removeAllOverlays();$("ol#map_list").empty();if(json_hotels){for(var H in json_hotels.hotels){E=json_hotels.hotels[H];var D="";if(E.fromPrice!=""){D=""+rooms_from+" "+E.hotelCurrency+parseFloat(E.fromPrice).toFixed(2)+""}if(avail_mode&&E.available){var Q=E.cheapestSingleRoom;var L=E.cheapestDoubleRoom;var C=E.cheapestFamilyRoom;if(Q==L==C==-1){}else{D="";if(Q!=-1){D=transl_singles+": "+E.hotelCurrency+parseFloat(Q).toFixed(2)+", "}if(L!=-1){D+=transl_doubles+": "+E.hotelCurrency+parseFloat(L).toFixed(2)+", "}if(C!=-1){D+=transl_larger+": "+E.hotelCurrency+parseFloat(C).toFixed(2)+"."}}}var B="/hotel/brochure/"+pagelanguage+"/"+E.hotelid+"";var A=(E.starRating)?'<img src="/ahgimages/'+E.starRating+"_"+E.ratingSymbol+'s.gif" alt="'+E.starRating+" "+E.ratingSymbol+'" />':"";var P='<h2><a href="'+B+'">'+E.hotelName+"</a> "+A+"</h2>";var G='<a href="'+B+'"><img src="'+E.hotelImage+'" width="60" height="60" /></a>';var K="";K="<p>"+D+"</p>";var J='<p><a href="'+B+'">'+view_details+"</a></p>";html='<div class="popupcontainer">'+P+G+K+J+"</div>";var N=new MMLatLon(parseFloat(E.lat),parseFloat(E.lon));var I=icon_name;if(is_location&&((parseInt(H)+1)<=10)){I+="_"+(parseInt(H)+1)}var M=new MMIcon("/ahgimages/"+I+".png");M.iconSize=new MMDimensions(i_width,i_height);M.iconAnchor=new MMPoint(i_anchor_left,i_anchor_top);M.infoBoxAnchor=new MMPoint(i_infobox_left,i_infobox_top);var F=viewer.createMarker(new MMLocation(N),E.name,M);F.setInfoBoxContent(html);markers.push(F);E.marker=F;if(is_location){$("ol#map_list").append('<li><a href="#map" onclick="json_hotels.hotels['+H+'].marker.openInfoBox();">'+E.hotelName+"</a> "+D+"</li>")}}if(typeof thisHotel!="undefined"){var E=thisHotel.hotel[0];var P="<h2>"+E.name+"</h2>";html='<div class="popupcontainer">'+P+"</div>";var N=new MMLatLon(parseFloat(E.lat),parseFloat(E.lon));var M=new MMIcon(center_icon);M.iconSize=new MMDimensions(ci_width,ci_height);M.iconAnchor=new MMPoint(ci_anchor_left,ci_anchor_top);M.infoBoxAnchor=new MMPoint(ci_infobox_left,ci_infobox_top);var F=viewer.createMarker(new MMLocation(N),E.name,M);F.setInfoBoxContent(html);markers.push(F);E.marker=F}}},checkBirdsEyeCoverage:function(lat,lon){$.getScript("http://dev.virtualearth.net/services/v1/ImageryMetadataService/ImageryMetadataService.asmx/GetBirdsEyeSceneByLocation?latitude="+lat+"&longitude="+lon+"&level=20&spinDirection=%22NoSpin%22&orientation=%22North%22&culture=%22en-us%22&format=json&rid=1",function(responseText){eval(responseText);var x=_f1();if(x.Scene!=null){$("#photogallery").after("<div id='birdseyeview'>"+transl_new+" <a href='#' onclick='AH_MULTIMAP.createContainer(false);return false;'>"+tranls_bev_of_hotelname+"</a></div>")}})}};function callBuildMap(){AH_MULTIMAP.buildMap()}var AH_GOOGLEMAP;var dv=true;var json_hotels;var is_location=(typeof view_on_map=="undefined")?false:true;AH_GOOGLEMAP={init:function(){if($("body.brochure").length){$("img#multimap").wrap("<a href='#' id='multimap_launch'></a>");$("a#multimap_launch").append("<span style='display:block;'>"+text_zoommap+"</span>");$("#multimap_launch").click(function(){AH_GOOGLEMAP.createContainer(true);this.blur();return false})}else{AH_GOOGLEMAP.createContainer(true)}},createContainer:function(C){if(C!=undefined){dv=C}if(!is_location){var A,E;if(self.pageYOffset){A=window.innerWidth;E=self.pageYOffset}else{if(document.documentElement&&document.documentElement.scrollTop){A=document.documentElement.clientWidth;E=document.documentElement.scrollTop}else{if(document.body){A=document.body.clientWidth;E=document.body.scrollTop}}}var D=((A-700)/2)+"px";var B=(120+E)+"px";if($("#mapcontainer").length){$("#mapcontainer,#mapcontaineriemask").css({left:D,top:B})}else{$("body").append("<div id='mapcontainer'><div class='mapbar'><a href='#' id='closelink'>"+text_close+"</a></div><div id='mapviewer'></div></div>");if($.browser.msie){$("body").append("<iframe src='blank.html' id='mapcontaineriemask'></iframe>")}$("#mapcontainer,#mapcontaineriemask").css({left:D,top:B});$("#closelink").click(function(){AH_GOOGLEMAP.hidemap();this.blur();return false});AH_GOOGLEMAP.getAPIjs()}}else{if($("#map").length){AH_GOOGLEMAP.getAPIjs()}}},getAPIjs:function(){AH_GOOGLEMAP.buildMap()},buildMap:function(){if(GBrowserIsCompatible()){map=new GMap2(document.getElementById(map_id));map.addControl(new GLargeMapControl());map.addControl(new GMapTypeControl());map.setCenter(new GLatLng(center_lat,center_long),zoom_level);GEvent.addListener(map,"dragend",function(){AH_GOOGLEMAP.getHotelsJson()});GEvent.addListener(map,"zoomend",function(){AH_GOOGLEMAP.getHotelsJson()});AH_GOOGLEMAP.getHotelsJson()}},hidemap:function(){$("#mapcontainer,#mapcontaineriemask").css("left","-9999px")},getHotelsJson:function(){var C=map.getCenter();var D=String(C.distanceFrom(map.getBounds().getNorthEast()));D=(D>30)?30:D;var B=String(C.lng()+"^"+C.lat()+"^30");var A="";if(avail_mode){A="&day="+avail_day+"&month="+avail_month+"&year="+avail_year+"&nights="+avail_nights+"&rooms="+avail_rooms+""}$.getScript("http://www.activehotels.com/wl/servlet/hoteladfeed?trkref=AHG&centre="+B+"&radius="+D+A+"&callback=AH_GOOGLEMAP.renderHotels")},createMarker:function(E,D,C){var A=new GLatLng(parseFloat(E.lat),parseFloat(E.lon));var B=new GMarker(A,C);GEvent.addListener(B,"click",function(){map.panTo(B.getPoint());B.openInfoWindowHtml(D)});map.addOverlay(B);E.marker=B;return B},renderHotels:function(N){json_hotels=N;map.clearOverlays();$("ol#map_list").empty();if(typeof thisHotel!="undefined"){var P=thisHotel.hotel[0];var Q="<h2>"+P.name+"</h2>";var H='<div class="popupcontainer">'+Q+"</div>";var L=new GIcon();L.image=center_icon;L.iconSize=new GSize(ci_width,ci_height);L.iconAnchor=new GPoint(ci_anchor_left,ci_anchor_top);L.infoWindowAnchor=new GPoint(ci_infobox_left,ci_infobox_top);var A={icon:L};AH_GOOGLEMAP.createMarker(P,H,A)}if(json_hotels){for(var F in json_hotels.hotels){hotel=json_hotels.hotels[F];var I=icon_name;if(is_location&&((parseInt(F)+1)<=10)){I+="_"+(parseInt(F)+1)}var L=new GIcon();L.image="/ahgimages/"+I+".png";L.iconSize=new GSize(i_width,i_height);L.iconAnchor=new GPoint(i_anchor_left,i_anchor_top);L.infoWindowAnchor=new GPoint(i_infobox_left,i_infobox_top);var A={icon:L};if(typeof P=="undefined"||hotel.hotelid!=P.hotelid){var D="";if(hotel.fromPrice!=""){D=""+rooms_from+" "+hotel.hotelCurrency+parseFloat(hotel.fromPrice).toFixed(2)+""}if(avail_mode&&hotel.available){var M=hotel.cheapestSingleRoom;var O=hotel.cheapestDoubleRoom;var K=hotel.cheapestFamilyRoom;if(M==O==K==-1){}else{D="";if(M!=-1){D=transl_singles+": "+hotel.hotelCurrency+parseFloat(M).toFixed(2)+", "}if(O!=-1){D+=transl_doubles+": "+hotel.hotelCurrency+parseFloat(O).toFixed(2)+", "}if(K!=-1){D+=transl_larger+": "+hotel.hotelCurrency+parseFloat(K).toFixed(2)+"."}}}var C="/hotel/brochure/"+pagelanguage+"/"+hotel.hotelid+"";var B=(hotel.starRating)?'<img src="/ahgimages/'+hotel.starRating+"_"+hotel.ratingSymbol+'s.gif" alt="'+hotel.starRating+" "+hotel.ratingSymbol+'" />':"";var Q='<h2><a href="'+C+'">'+hotel.hotelName+"</a> "+B+"</h2>";var E='<a href="'+C+'"><img src="'+hotel.hotelImage+'" width="60" height="60" /></a>';var J="";J="<p>"+D+"</p>";var G='<p><a href="'+C+'">'+view_details+"</a></p>";var H='<div class="popupcontainer">'+Q+E+J+G+"</div>";AH_GOOGLEMAP.createMarker(hotel,H,A);if(is_location){$("ol#map_list").append('<li><a href="#map" onclick="GEvent.trigger(json_hotels.hotels['+F+"].marker, 'click')\">"+hotel.hotelName+"</a> "+D+"</li>")}}}}}};function init(){if(arguments.callee.done){return }arguments.callee.done=true;if(_timer){clearInterval(_timer)}if(document.getElementById("roomselectform")){roomDropdowns()}}if(document.addEventListener){document.addEventListener("DOMContentLoaded",init,null)}if(/WebKit/i.test(navigator.userAgent)){var _timer=setInterval(function(){if(/loaded|complete/.test(document.readyState)){init()}},10)}window.onload=init;function toggleDropdowns(D){var A=D.parentNode.nextSibling;while(A.nodeType!=1){A=A.nextSibling}var B=A.getElementsByTagName("select");for(var C=1;C<B.length;C++){B[C].style.display=(C+1>D.value)?"none":""}}function roomDropdowns(){var B=getElementsByClassName(document,"select","no-of-rooms");for(var A=0;A<B.length;A++){B[A].onchange=function(){toggleDropdowns(this)};toggleDropdowns(B[A])}}function getElementsByClassName(B,F,A){var E=(F=="*"&&B.all)?B.all:B.getElementsByTagName(F);var H=new Array();A=A.replace(/\-/g,"\\-");var G=new RegExp("(^|\\s)"+A+"(\\s|$)");var D;for(var C=0;C<E.length;C++){D=E[C];if(G.test(D.className)){H.push(D)}}return(H)};