(function($){var icon=new GIcon();icon.image='/media/images/booking/layout/tooltip_icon.png';icon.shadow='';icon.iconSize=new GSize(30,37);icon.iconAnchor=new GPoint(15,25);function Tooltip(marker,text,padding){this.marker_=marker;this.text_=text;this.padding_=padding;}
Tooltip.prototype=new GOverlay();Tooltip.prototype.initialize=function(map){this.map_=map;this.div_=$('<div class="tooltip"><div class="text">'+this.text_+'</div><div class="foot"></div></div>');$(map.getPane(G_MAP_FLOAT_PANE)).append(this.div_);var id=this.marker_.forid;this.div_.mouseover(function(){$('#'+id).trigger('mouseover');});this.div_.mouseout(function(){$('#'+id).trigger('mouseout');});this.div_.click(function(){location.href=$('#'+id+' .select-button').attr('href');});};Tooltip.prototype.remove=function(){this.div_.remove();};Tooltip.prototype.copy=function(){return new Tooltip(this.marker_,this.text_,this.padding_);};Tooltip.prototype.redraw=function(force){if(!force)return;var markerPos=this.map_.fromLatLngToDivPixel(this.marker_.getPoint());var iconAnchor=this.marker_.getIcon().iconAnchor;var xPos=Math.round(markerPos.x-15);var yPos=markerPos.y-iconAnchor.y-this.padding_;var width=this.div_.find('.text').width()+this.div_.find('.foot').width();this.div_.css({top:yPos+'px',left:xPos+'px'});};Tooltip.prototype.show=function(){this.marker_.hide();$(this.div_).show();};Tooltip.prototype.hide=function(){$(this.div_).hide();this.marker_.show();};$.googleMap={maps:{},markersById:{},marker:function(m){if(!m){return null;}else if(m.lat==null&&m.lng==null){return $.googleMap.marker($.googleMap.readFromGeo(m));}else{var marker=new GMarker(new GLatLng(m.lat,m.lng),icon);if(m.txt){marker.tooltip=new Tooltip(marker,m.txt,0);}
if(m.forid){marker.forid=m.forid;GEvent.addListener(marker,"mouseover",function(){$('#'+marker.forid).trigger('mouseover');});GEvent.addListener(marker,"mouseout",function(){$('#'+marker.forid).trigger('mouseout');});}
return marker;}},readFromGeo:function(elem){var latElem=$(".latitude",elem)[0];var lngElem=$(".longitude",elem)[0];var foridElem=$(".forid",elem)[0];if(latElem&&lngElem){return{lat:parseFloat($(latElem).attr("title")),lng:parseFloat($(lngElem).attr("title")),txt:$(elem).attr("title"),forid:$(foridElem).attr("title")};}else{return null;}},mapNum:1};$.fn.googleMap=function(lat,lng,zoom,options){if(!window.GBrowserIsCompatible||!GBrowserIsCompatible())return this;if(lat==null)lat=37.4419;if(lng==null)lng=-122.1419;if(!zoom)zoom=13;if(!options||typeof options!='object')options={};options.mapOptions=options.mapOptions||{};options.markers=options.markers||[];options.controls=options.controls||{};return this.each(function(){if(!this.id)this.id="gMap"+$.googleMap.mapNum++;var map=$.googleMap.maps[this.id]=new GMap2(this,options.mapOptions);map.setCenter(new GLatLng(lat,lng),zoom);for(var i=0;i<options.controls.length;i++){var c=options.controls[i];eval("map.addControl(new "+c+"());");}
var marker=null;for(var i=0;i<options.markers.length;i++){if(marker=$.googleMap.marker(options.markers[i])){map.addOverlay(marker);if(marker.tooltip){map.addOverlay(marker.tooltip);}
if(marker.forid){$.googleMap.markersById[marker.forid]=marker;}};}});};})(jQuery);;jQuery(function($){var map;var mapData;var tooltip;if($('.birthDateSelector').length==0){$('.birthDateSelectorHead').hide();}
var changeSelectors=function(){var oldNrOfSelectors=$('.birthDateSelector').length;var nrOfSelectors=parseInt($('#id_nr_of_children').val())+parseInt($('#id_nr_of_babies').val());if(nrOfSelectors<oldNrOfSelectors){var nrToRemove=oldNrOfSelectors-nrOfSelectors;for(i=0;i<nrToRemove;i++){var selectorWidget=$('.birthDateSelector');var lastSelector=selectorWidget.get(selectorWidget.length-1);$(lastSelector).remove();}
if(nrOfSelectors==0){$('.birthDateSelectorHead').hide();}}
else if(nrOfSelectors>oldNrOfSelectors){if(oldNrOfSelectors==0){$('.birthDateSelectorHead').show();}
var nrToAdd=nrOfSelectors-oldNrOfSelectors;for(i=0;i<nrToAdd;i++){var tmpNrOfSelectors=$('.birthDateSelector').length;var selectorHtml='<tr><td colspan="3" class="birthDateSelector" ><select name="child_'+tmpNrOfSelectors+'-birthdate_day"><option value="">--</option>';for(j=1;j<32;j++){selectorHtml+='<option value="'+j+'">'+j+'</option>';}
selectorHtml+='</select><select name="child_'+tmpNrOfSelectors+'-birthdate_month">';selectorHtml+='<option value="">----</option><option value="1">januari</option><option value="2">februari</option><option value="3">maart</option><option value="4">april</option><option value="5">mei</option><option value="6">juni</option><option value="7">juli</option><option value="8">augustus</option><option value="9">september</option><option value="10">oktober</option><option value="11">november</option><option value="12">december</option>';selectorHtml+='</select><select name="child_'+tmpNrOfSelectors+'-birthdate_year"><option value="">----</option>';var d=new Date();for(j=d.getFullYear();j>d.getFullYear()-13;j--){selectorHtml+='<option value="'+j+'">'+j+'</option>';}
selectorHtml+='</select> </td></tr>';if($('.birthDateSelector').length==0){$('.birthDateSelectorHead').parent().after(selectorHtml);}
else{$($('.birthDateSelector').get($('.birthDateSelector').length-1)).parent().after(selectorHtml);}}}};$('#id_nr_of_children').change(function(){changeSelectors();});$('#id_nr_of_babies').change(function(){changeSelectors();});$('#slideshow').cycle({fx:'fade',speed:'fast',timeout:0,pager:'#slideshow-navigation'});if($('.geotag').length>0){$("#hotel-map").googleMap(parseFloat($('.geotag .latitude').attr('title')),parseFloat($('.geotag .longitude').attr('title')),14,{controls:["GSmallMapControl"],markers:$(".geotag")});$.googleMap.markersById[$('.product-item').attr('id')].tooltip.show();$.googleMap.markersById[$('.product-item').attr('id')].tooltip.div_.unbind('click');}});;