google.maps.Map.prototype.markers=new Array();google.maps.Map.infobox=null;InfoBox.prototype.getCloseBoxImg_=function(){var img="";if(this.closeBoxURL_!==""){img="<img";img+=" src='"+this.closeBoxURL_+"'";img+=" align=right";img+=" style='";img+=" position: relative;";img+=" cursor: pointer; z-index: 2;";img+=" margin: "+this.closeBoxMargin_+";";img+="'>"}return img};google.maps.Map.prototype.addMarker=function(marker){this.markers[this.markers.length]=marker};google.maps.Map.prototype.addRestaurants=function(restaurants){for(i in restaurants){var marker=new google.maps.Marker({map:this,draggable:false,animation:google.maps.Animation.DROP,icon:webDir+"/images/marker_icon.png",title:restaurants[i].name,zIndex:parseInt(i)+1,position:new google.maps.LatLng(restaurants[i].lat,restaurants[i].lng),optimized:false});google.maps.event.addListener(marker,"click",function(coord){this.addInfobox(restaurants[this.getZIndex()-1]);return false});this.addMarker(marker)}if(this.getMarkers().length==1){google.maps.event.trigger(marker,"click")}else{this.centerMapsToMarkers()}};google.maps.Map.prototype.centerMapsToMarkers=function(){var targetBounds,i,marker;targetBounds=new google.maps.LatLngBounds();for(i=0;i<this.getMarkers().length;i++){targetBounds.extend(this.getMarkers()[i].getPosition())}this.fitBounds(targetBounds)};google.maps.Map.prototype.getMarkers=function(){return this.markers};google.maps.Map.prototype.clearMarkers=function(){for(var i=0;i<this.markers.length;i++){this.markers[i].setMap(null)}this.markers=new Array()};google.maps.Marker.prototype.addInfobox=function(restaurant){var html=restaurantContent(restaurant),pos=this.getPosition(),mapLocal=this.getMap(),width=($(this.getMap().getDiv()).width()-437)/2,zIndex=this.getZIndex()-1,marker=this;if(!this.getMap().infobox||!this.getMap().infobox.getProjection()){this.getMap().infobox=new InfoBox({latlng:pos,map:mapLocal,content:html,closeBoxURL:webDir+"images/gmap_close.png",closeBoxMargin:"5px",pixelOffset:new google.maps.Size(0,-200),pane:"overlayImage",zIndex:zIndex});this.getMap().infobox.setOptions({infoBoxClearance:new google.maps.Size(width,110)});google.maps.event.addListener(this.getMap().infobox,"position_changed",function(){infoboxPan(this)});google.maps.event.addListener(this.getMap().infobox,"content_changed",function(){Cufon.refresh()});google.maps.event.addListener(this.getMap().infobox,"domready",function(){Cufon.refresh()});this.getMap().infobox.open(mapLocal,this)}else{this.getMap().infobox.setContent(html);this.getMap().infobox.setPosition(this.getPosition());this.getMap().infobox.setZIndex(zIndex)}};function restaurantContent(restaurant){$("#infobox #restaurant-address").html(restaurant.address);$("#infobox #restaurant-phone").html(restaurant.phone);$("#infobox #restaurant-email").html(restaurant.email);$("#infobox #gmap-more-info span").html($("#infobox #gmap-more-info").attr("data-placeholder"));$("#infobox #gmap-more-info").attr("href",$("#infobox #gmap-more-info").attr("data-link")+restaurant.name_robot);$("#infobox h2").html($("#infobox h2").attr("data-placeholder")+"<span id='restaurant-name'>"+restaurant.name+"</span>");if(restaurant.published===false){$("#infobox #gmap-more-info").addClass("hidden")}else{$("#infobox #gmap-more-info").removeClass("hidden")}return $("#infobox-wrapper").html()}var map=null;jQuery.fn.googleMapsInit=function(options){var latlng=new google.maps.LatLng(49.9695849,14.3733875);var myOptions={zoom:8,center:latlng,mapTypeId:google.maps.MapTypeId.ROADMAP,scrollwheel:false,streetViewControl:false};if(typeof options=="object"){myOptions=$.extend(myOptions,options)}map=new google.maps.Map(document.getElementById($(this).attr("id")),myOptions);map.addRestaurants(restaurants)};
