function GMarkerGroup(b,c,a){this.active=b;this.markers=c||new Array();this.markersById=a||new Object()}GMarkerGroup.prototype=new GOverlay();GMarkerGroup.prototype.initialize=function(c){this.map=c;if(this.active){for(var b=0,a=this.markers.length;b<a;b++){this.map.addOverlay(this.markers[b])}for(var d in this.markersById){this.map.addOverlay(this.markersById[d])}}};GMarkerGroup.prototype.remove=function(){this.deactivate()};GMarkerGroup.prototype.redraw=function(a){};GMarkerGroup.prototype.copy=function(){var a=new GMarkerGroup(this.active);a.markers=this.markers;a.markersById=this.markersById;return a};GMarkerGroup.prototype.clear=function(){this.deactivate();this.markers=new Array();this.markersById=new Object()};GMarkerGroup.prototype.addMarker=function(a,b){if(b==undefined){this.markers.push(a)}else{this.markersById[b]=a}if(this.active&&this.map!=undefined){this.map.addOverlay(a)}};GMarkerGroup.prototype.showMarker=function(b){var a=this.markersById[b];if(a!=undefined){GEvent.trigger(a,"click")}};GMarkerGroup.prototype.activate=function(c){c=(c==undefined)?true:c;if(!c){if(this.active){if(this.map!=undefined){for(var b=0,a=this.markers.length;b<a;b++){this.map.removeOverlay(this.markers[b])}for(var d in this.markersById){this.map.removeOverlay(this.markersById[d])}}this.active=false}}else{if(!this.active){if(this.map!=undefined){for(var b=0,a=this.markers.length;b<a;b++){this.map.addOverlay(this.markers[b])}for(var d in this.markersById){this.map.addOverlay(this.markersById[d])}}this.active=true}}};GMarkerGroup.prototype.centerAndZoomOnMarkers=function(){if(this.map!=undefined){var a=this.markers.slice();for(var b in this.markersById){a.push(this.markersById[b])}if(a.length>0){this.map.centerAndZoomOnMarkers(a)}}};GMarkerGroup.prototype.deactivate=function(){this.activate(false)};Clusterer=function(g,e,f,c,b,a){this.markers=[];if(g){for(var d=0;d<g.length;d++){this.addMarker(g[d])}}this.clusters=[];this.timeout=null;this.maxVisibleMarkers=f||150;this.gridSize=c||5;this.minMarkersPerCluster=b||5;this.maxLinesPerInfoBox=a||10;this.icon=e||G_DEFAULT_ICON};Clusterer.prototype=new GOverlay();Clusterer.prototype.initialize=function(c){this.map=c;this.currentZoomLevel=c.getZoom();GEvent.addListener(c,"zoomend",Clusterer.makeCaller(Clusterer.display,this));GEvent.addListener(c,"moveend",Clusterer.makeCaller(Clusterer.display,this));GEvent.addListener(c,"infowindowclose",Clusterer.makeCaller(Clusterer.popDown,this));for(var b=0,a=this.markers.length;b<a;b++){this.markers[b].setMap(c)}this.displayLater()};Clusterer.prototype.remove=function(){for(var a=0;a<this.markers.length;++a){this.removeMarker(this.markers[a])}};Clusterer.prototype.copy=function(){return new Clusterer(this.markers,this.icon,this.maxVisibleMarkers,this.gridSize,this.minMarkersPerCluster,this.maxLinesPerInfoBox)};Clusterer.prototype.redraw=function(a){this.displayLater()};Clusterer.prototype.setIcon=function(a){this.icon=a};Clusterer.prototype.addMarker=function(a,b){a.onMap=false;this.markers.push(a);a.description=a.description||b;if(this.map!=null){a.setMap(this.map);this.displayLater()}};Clusterer.prototype.removeMarker=function(b){for(var e=0;e<this.markers.length;++e){if(this.markers[e]==b){if(b.onMap){this.map.removeOverlay(b)}for(var d=0;d<this.clusters.length;++d){var a=this.clusters[d];if(a!=null){for(var c=0;c<a.markers.length;++c){if(a.markers[c]==b){a.markers[c]=null;--a.markerCount;break}}if(a.markerCount==0){this.clearCluster(a);this.clusters[d]=null}else{if(a==this.poppedUpCluster){Clusterer.rePop(this)}}}}this.markers[e]=null;break}}this.displayLater()};Clusterer.prototype.displayLater=function(){if(this.timeout!=null){clearTimeout(this.timeout)}this.timeout=setTimeout(Clusterer.makeCaller(Clusterer.display,this),50)};Clusterer.display=function(t){var v,u,l,w,x,m;clearTimeout(t.timeout);var f=t.map.getZoom();if(f!=t.currentZoomLevel){for(v=0,x=t.clusters.length;v<x;++v){if(t.clusters[v]!=null){t.clearCluster(t.clusters[v]);t.clusters[v]=null}}t.clusters.length=0;t.currentZoomLevel=f}var k=t.map.getBounds();var r=k.getSouthWest();var h=k.getNorthEast();var p=h.lng()-r.lng();var o=h.lat()-r.lat();p*=0.1;o*=0.1;k=new GLatLngBounds(new GLatLng(r.lat()-o,r.lng()-p),new GLatLng(h.lat()+o,h.lng()+p));var q=[];var n=[];for(v=0,x=t.markers.length;v<x;++v){l=t.markers[v];if(l!=null){if(k.contains(l.getPoint())){q.push(l)}else{n.push(l)}}}for(v=0,x=n.length;v<x;++v){l=n[v];if(l.onMap){t.map.removeOverlay(l);l.onMap=false}}for(v=0,x=t.clusters.length;v<x;++v){w=t.clusters[v];if(w!=null&&!k.contains(w.marker.getPoint())&&w.onMap){t.map.removeOverlay(w.marker);w.onMap=false}}if(q.length>t.maxVisibleMarkers){var s=k.getNorthEast().lat()-k.getSouthWest().lat();var c=s/t.gridSize;var e=c/Math.cos((k.getNorthEast().lat()+k.getSouthWest().lat())/2*Math.PI/180);for(var g=k.getSouthWest().lat();g<=k.getNorthEast().lat();g+=c){for(var y=k.getSouthWest().lng();y<=k.getNorthEast().lng();y+=e){w=new Object();w.clusterer=t;w.bounds=new GLatLngBounds(new GLatLng(g,y),new GLatLng(g+c,y+e));w.markers=[];w.markerCount=0;w.onMap=false;w.marker=null;t.clusters.push(w)}}for(v=0,x=q.length;v<x;++v){l=q[v];if(l!=null&&!l.inCluster){for(u=0,m=t.clusters.length;u<m;++u){w=t.clusters[u];if(w!=null&&w.bounds.contains(l.getPoint())){w.markers.push(l);++w.markerCount;l.inCluster=true}}}}for(v=0,x=t.clusters.length;v<x;++v){if(t.clusters[v]!=null&&t.clusters[v].markerCount<t.minMarkersPerCluster){t.clearCluster(t.clusters[v]);t.clusters[v]=null}}for(v=t.clusters.length-1;v>=0;--v){if(t.clusters[v]!=null){break}else{--t.clusters.length}}for(v=0,x=t.clusters.length;v<x;++v){w=t.clusters[v];if(w!=null){for(u=0,m=w.markers.length;u<m;++u){l=w.markers[u];if(l!=null&&l.onMap){t.map.removeOverlay(l);l.onMap=false}}}}for(v=0,x=t.clusters.length;v<x;++v){w=t.clusters[v];if(w!=null&&w.marker==null){var a=0,d=0;for(u=0,m=w.markers.length;u<m;++u){l=w.markers[u];if(l!=null){a+=(+l.getPoint().lng());d+=(+l.getPoint().lat())}}var b=new GLatLng(d/w.markerCount,a/w.markerCount);l=new GMarker(b,{icon:t.icon});w.marker=l;GEvent.addListener(l,"click",Clusterer.makeCaller(Clusterer.popUp,w))}}}for(v=0,x=q.length;v<x;++v){l=q[v];if(l!=null&&!l.onMap&&!l.inCluster){t.map.addOverlay(l);l.addedToMap();l.onMap=true}}for(v=0,x=t.clusters.length;v<x;++v){w=t.clusters[v];if(w!=null&&!w.onMap&&k.contains(w.marker.getPoint())){t.map.addOverlay(w.marker);w.onMap=true}}Clusterer.rePop(t)};Clusterer.popUp=function(b){var d=b.clusterer;var f='<table width="300">';var g=0;for(var e=0,a=b.markers.length;e<a;++e){var c=b.markers[e];if(c!=null){++g;f+="<tr><td>";if(c.getIcon().smallImage!=null){f+='<img src="'+c.getIcon().smallImage+'">'}else{f+='<img src="'+c.getIcon().image+'" width="'+(c.getIcon().iconSize.width/2)+'" height="'+(c.getIcon().iconSize.height/2)+'">'}f+="</td><td>"+c.description+"</td></tr>";if(g==d.maxLinesPerInfoBox-1&&b.markerCount>d.maxLinesPerInfoBox){f+='<tr><td colspan="2">...and '+(b.markerCount-g)+" more</td></tr>";break}}}f+="</table>";d.map.closeInfoWindow();b.marker.openInfoWindowHtml(f);d.poppedUpCluster=b};Clusterer.rePop=function(a){if(a.poppedUpCluster!=null){Clusterer.popUp(a.poppedUpCluster)}};Clusterer.popDown=function(a){a.poppedUpCluster=null};Clusterer.prototype.clearCluster=function(a){var c,b;for(c=0;c<a.markers.length;++c){if(a.markers[c]!=null){a.markers[c].inCluster=false;a.markers[c]=null}}a.markers.length=0;a.markerCount=0;if(a==this.poppedUpCluster){this.map.closeInfoWindow()}if(a.onMap){this.map.removeOverlay(a.marker);a.onMap=false}};Clusterer.makeCaller=function(b,a){return function(){b(a)}};GMarker.prototype.setMap=function(a){this.map=a};GMarker.prototype.getMap=function(){return this.map};GMarker.prototype.addedToMap=function(){this.map=null};GMarker.prototype.origOpenInfoWindow=GMarker.prototype.openInfoWindow;GMarker.prototype.openInfoWindow=function(b,a){if(this.map!=null){return this.map.openInfoWindow(this.getPoint(),b,a)}else{return this.origOpenInfoWindow(b,a)}};GMarker.prototype.origOpenInfoWindowHtml=GMarker.prototype.openInfoWindowHtml;GMarker.prototype.openInfoWindowHtml=function(a,b){if(this.map!=null){return this.map.openInfoWindowHtml(this.getPoint(),a,b)}else{return this.origOpenInfoWindowHtml(a,b)}};GMarker.prototype.origOpenInfoWindowTabs=GMarker.prototype.openInfoWindowTabs;GMarker.prototype.openInfoWindowTabs=function(b,a){if(this.map!=null){return this.map.openInfoWindowTabs(this.getPoint(),b,a)}else{return this.origOpenInfoWindowTabs(b,a)}};GMarker.prototype.origOpenInfoWindowTabsHtml=GMarker.prototype.openInfoWindowTabsHtml;GMarker.prototype.openInfoWindowTabsHtml=function(a,b){if(this.map!=null){return this.map.openInfoWindowTabsHtml(this.getPoint(),a,b)}else{return this.origOpenInfoWindowTabsHtml(a,b)}};GMarker.prototype.origShowMapBlowup=GMarker.prototype.showMapBlowup;GMarker.prototype.showMapBlowup=function(a){if(this.map!=null){return this.map.showMapBlowup(this.getPoint(),a)}else{return this.origShowMapBlowup(a)}};function addDescriptionToMarker(a,b){a.description=b;return a}function GeoRssOverlay(d,c,b,a){this.rssurl=d;this.icon=c;this.proxyurl=b;if(a.visible==undefined){this.visible=true}else{this.visible=a.visible}this.listDiv=a.listDiv;this.contentDiv=a.contentDiv;this.listItemClass=a.listItemClass;this.limitItems=a.limit;this.request=false;this.markers=[]}GeoRssOverlay.prototype=new GOverlay();GeoRssOverlay.prototype.initialize=function(a){this.map=a;this.load()};GeoRssOverlay.prototype.redraw=function(a){};GeoRssOverlay.prototype.remove=function(){for(var b=0,a=this.markers.length;b<a;b++){this.map.removeOverlay(this.markers[b])}};GeoRssOverlay.prototype.showHide=function(){if(this.visible){for(var a=0;a<this.markers.length;a++){this.map.removeOverlay(this.markers[a])}this.visible=false}else{for(var a=0;a<this.markers.length;a++){this.map.addOverlay(this.markers[a])}this.visible=true}};GeoRssOverlay.prototype.showMarker=function(b){var a=this.markers[b];if(a!=undefined){GEvent.trigger(a,"click")}};GeoRssOverlay.prototype.copy=function(){var b=new GeoRssOVerlay(this.rssurl,this.icon,this.proxyurl);b.markers=[];for(var c=0,a=this.markers.length;c<a;c++){b.markers.push(this.markers[c].copy())}return b};GeoRssOverlay.prototype.load=function(){if(this.request!=false){return}this.request=GXmlHttp.create();if(this.proxyurl!=undefined){this.request.open("GET",this.proxyurl+"?q="+encodeURIComponent(this.rssurl),true)}else{this.request.open("GET",this.rssurl,true)}var a=this;this.request.onreadystatechange=function(){a.callback()};this.request.send(null)};GeoRssOverlay.prototype.callback=function(){if(this.request.readyState==4){if(this.request.status=="200"){var f=this.request.responseXML;if(f.documentElement.getElementsByTagName("item").length!=0){var c=f.documentElement.getElementsByTagName("item")}else{if(f.documentElement.getElementsByTagName("entry").length!=0){var c=f.documentElement.getElementsByTagName("entry")}}for(var d=0,a=this.limitItems?Math.min(this.limitItems,c.length):c.length;d<a;d++){try{var b=this.createMarker(c[d],d);this.markers.push(b);if(this.visible){this.map.addOverlay(b)}}catch(g){}}}this.request=false}};GeoRssOverlay.prototype.createMarker=function(p,g){var m=p.getElementsByTagName("title")[0].childNodes[0].nodeValue;if(p.getElementsByTagName("description").length!=0){var o=p.getElementsByTagName("description")[0].childNodes[0].nodeValue;var j=p.getElementsByTagName("link")[0].childNodes[0].nodeValue}else{if(p.getElementsByTagName("summary").length!=0){var o=p.getElementsByTagName("summary")[0].childNodes[0].nodeValue;var j=p.getElementsByTagName("link")[0].attributes[0].nodeValue}}if(navigator.userAgent.toLowerCase().indexOf("msie")<0){if(p.getElementsByTagNameNS("http://www.w3.org/2003/01/geo/wgs84_pos#","lat").length!=0){var i=p.getElementsByTagNameNS("http://www.w3.org/2003/01/geo/wgs84_pos#","lat")[0].childNodes[0].nodeValue;var k=p.getElementsByTagNameNS("http://www.w3.org/2003/01/geo/wgs84_pos#","long")[0].childNodes[0].nodeValue}else{if(p.getElementsByTagNameNS("http://www.georss.org/georss","point").length!=0){var c=p.getElementsByTagNameNS("http://www.georss.org/georss","point")[0].childNodes[0].nodeValue.split(" ");var i=c[0];var k=c[1]}}}else{if(p.getElementsByTagName("geo:lat").length!=0){var i=p.getElementsByTagName("geo:lat")[0].childNodes[0].nodeValue;var k=p.getElementsByTagName("geo:long")[0].childNodes[0].nodeValue}else{if(p.getElementsByTagName("georss:point").length!=0){var c=p.getElementsByTagName("georss:point")[0].childNodes[0].nodeValue.split(" ");var i=c[0];var k=c[1]}}}var n=new GLatLng(parseFloat(i),parseFloat(k));var e=new GMarker(n,{title:m});var f='<a href="'+j+'">'+m+"</a><p/>"+o;if(this.contentDiv==undefined){GEvent.addListener(e,"click",function(){e.openInfoWindowHtml(f)})}else{var d=this.contentDiv;GEvent.addListener(e,"click",function(){document.getElementById(d).innerHTML=f})}if(this.listDiv!=undefined){var l=document.createElement("a");l.innerHTML=m;l.setAttribute("href","#");var h=this;l.onclick=function(){h.showMarker(g);return false};var b=document.createElement("div");if(this.listItemClass!=undefined){b.setAttribute("class",this.listItemClass)}b.appendChild(l);document.getElementById(this.listDiv).appendChild(b)}return e};var WGS84_SEMI_MAJOR_AXIS=6378137;var WGS84_ECCENTRICITY=0.08181919131087181;var DEG2RAD=0.0174532922519943;var PI=3.14159267;function dd2MercMetersLng(a){return WGS84_SEMI_MAJOR_AXIS*(a*DEG2RAD)}function dd2MercMetersLat(b){var a=b*DEG2RAD;return WGS84_SEMI_MAJOR_AXIS*Math.log(Math.tan((a+PI/2)/2)*Math.pow(((1-WGS84_ECCENTRICITY*Math.sin(a))/(1+WGS84_ECCENTRICITY*Math.sin(a))),(WGS84_ECCENTRICITY/2)))}function addWMSPropertiesToLayer(a,g,f,c,e,b,d){a.format=e;a.baseURL=g;a.styles=c;a.layers=f;a.mercatorEpsg=b;a.useGeographic=d;return a}getTileUrlForWMS=function(l,k,i){var e=new GPoint(l.x*256,(l.y+1)*256);var d=new GPoint((l.x+1)*256,l.y*256);var h=G_NORMAL_MAP.getProjection().fromPixelToLatLng(e,k,i);var g=G_NORMAL_MAP.getProjection().fromPixelToLatLng(d,k,i);if(this.useGeographic){var m=h.x+","+h.y+","+g.x+","+g.y;var j="EPSG:4326"}else{var m=dd2MercMetersLng(h.x)+","+dd2MercMetersLat(h.y)+","+dd2MercMetersLng(g.x)+","+dd2MercMetersLat(g.y);var j="EPSG:"+this.mercatorEpsg}var f=this.baseURL;f+="?REQUEST=GetMap";f+="&SERVICE=WMS";f+="&VERSION=1.1.1";f+="&LAYERS="+this.layers;f+="&STYLES="+this.styles;f+="&FORMAT=image/"+this.format;f+="&BGCOLOR=0xFFFFFF";f+="&TRANSPARENT=TRUE";f+="&SRS="+j;f+="&BBOX="+m;f+="&WIDTH=256";f+="&HEIGHT=256";f+="&reaspect=false";return f};function addInfoWindowToMarker(a,c,b){GEvent.addListener(a,"click",function(){a.openInfoWindowHtml(c,b)});return a}function addInfoWindowTabsToMarker(a,c,b){GEvent.addListener(a,"click",function(){a.openInfoWindowTabsHtml(c,b)});return a}function addPropertiesToLayer(d,e,c,a,b){d.getTileUrl=e;d.getCopyright=c;d.getOpacity=a;d.isPng=b;return d}function addOptionsToIcon(c,b){for(var a in b){c[a]=b[a]}return c}function addCodeToFunction(b,a){if(b==undefined){return a}else{return function(){b();a()}}}function addGeocodingToMarker(b,a){b.orig_initialize=b.initialize;orig_redraw=b.redraw;b.redraw=function(c){};b.initialize=function(c){new GClientGeocoder().getLatLng(a,function(d){if(d){b.redraw=orig_redraw;b.orig_initialize(c);b.setPoint(d)}})};return b}GMap2.prototype.centerAndZoomOnMarkers=function(d){var c=new GLatLngBounds(d[0].getPoint(),d[0].getPoint());for(var b=1,a=d.length;b<a;b++){c.extend(d[b].getPoint())}this.centerAndZoomOnBounds(c)};GMap2.prototype.centerAndZoomOnPoints=function(c){var d=new GLatLngBounds(c[0],c[0]);for(var b=1,a=c.length;b<a;b++){d.extend(c[b])}this.centerAndZoomOnBounds(d)};GMap2.prototype.centerAndZoomOnBounds=function(b){var a=b.getCenter();this.setCenter(a,this.getBoundsZoomLevel(b))};function setWindowDims(a){if(window.innerWidth){a.style.height=(window.innerHeight)+"px;";a.style.width=(window.innerWidth)+"px;"}else{if(document.body.clientWidth){a.style.width=(document.body.clientWidth)+"px";a.style.height=(document.body.clientHeight)+"px"}}}ManagedMarker=function(b,c,a){this.markers=b;this.minZoom=c;this.maxZoom=a};function addMarkersToManager(b,d){for(var a=0,c=d.length;a<c;a++){mm=d[a];b.addMarkers(mm.markers,mm.minZoom,mm.maxZoom)}b.refresh();return b}var INVISIBLE=new GLatLng(0,0);jQuery(window).bind("unload",GUnload);function findPosition(b){b=$("#"+b)[0];var c=null;var a=null;if(b.offsetParent){for(c=0,a=0;b.offsetParent;b=b.offsetParent){c+=b.offsetLeft;a+=b.offsetTop}return[c,a]}else{c=b.x;a=b.y;return[c,a]}}GMap2.prototype.getResolutions=function(){ne=new Array();ne.lat=this.getBounds().getNorthEast().lat();ne.lng=this.getBounds().getNorthEast().lng();sw=new Array();sw.lat=this.getBounds().getSouthWest().lat();sw.lng=this.getBounds().getSouthWest().lng();if(ne.lng<sw.lng){longitude_degrees=Math.abs(-180-ne.lng)+Math.abs(180-sw.lng)}else{longitude_degrees=Math.abs(ne.lng-sw.lng)}if(ne.lat<sw.lat){latitude_degrees=Math.abs(-90-ne.lat)+Math.abs(90-sw.lat)}else{latitude_degrees=Math.abs(ne.lat-sw.lat)}latitude_resolution=latitude_degrees/this.getContainer().clientHeight;longtitude_resolution=longitude_degrees/this.getContainer().clientWidth;return[latitude_resolution,longtitude_resolution]};GMap2.prototype.getTrimmedBounds=function(b,c){ne=new Array();ne.lat=this.getBounds().getNorthEast().lat();ne.lng=this.getBounds().getNorthEast().lng();sw=new Array();sw.lat=this.getBounds().getSouthWest().lat();sw.lng=this.getBounds().getSouthWest().lng();margin_north=b[1];margin_east=c[0]-b[0];margin_south=c[1]-b[1];margin_west=b[0];var a=this.getResolutions();return(new GLatLngBounds(new GLatLng(sw.lat+margin_south*a[0],sw.lng+margin_west*a[1]),new GLatLng(ne.lat-margin_north*a[0],ne.lng-margin_east*a[1])))};GMap2.prototype.expandBounds=function(d,b,c){var a=this.getResolutions();var e=new GLatLngBounds(new GLatLng(d.getSouthWest().lat()-b[1]/2*a[0],d.getSouthWest().lng()-b[0]/2*a[1]),new GLatLng(d.getNorthEast().lat()+b[1]/2*a[0],d.getNorthEast().lng()+b[0]/2*a[1]));return e};GMap2.prototype.expandedCenterAndZoomOnMarkers=function(d){var c=new GLatLngBounds(d[0].getPoint(),d[0].getPoint());for(var b=1,a=d.length;b<a;b++){c.extend(d[b].getPoint())}var e=this.expandBounds(c,[24,32],[15,31]);this.centerAndZoomOnBounds(e)};var imagesPrefix="/images/";function toggleMapType(){var c=map.getCurrentMapType();var b=[G_NORMAL_MAP,G_SATELLITE_MAP,G_HYBRID_MAP,G_PHYSICAL_MAP];var a=b.indexOf(c);map.setMapType(b[(a+1)%b.length])}function ZuperMapControl(){}ZuperMapControl.prototype=new GControl();ZuperMapControl.prototype.initialize=function(b){var c=document.createElement("div");var m=10;var g=17;var j=17;var d=b.getSize().width;var e=0;if(d>0){e=(d-g)/2}var o=b.getSize().height;var f=0;if(o>0){f=(o-j)/2}var h=document.createElement("div");this.setButtonStyle(h,f,d-g-m);c.appendChild(h);$("<img />").attr("src",imagesPrefix+"map/map_arrow_right.png").addClass("map_control").appendTo($(h));GEvent.addDomListener(h,"click",function(){b.panDirection(-1,0)});var p=document.createElement("div");this.setButtonStyle(p,f,m);c.appendChild(p);$("<img />").attr("src",imagesPrefix+"map/map_arrow_left.png").addClass("map_control").appendTo($(p));GEvent.addDomListener(p,"click",function(){b.panDirection(1,0)});var i=document.createElement("div");this.setButtonStyle(i,m,e);c.appendChild(i);$("<img />").attr("src",imagesPrefix+"map/map_arrow_up.png").addClass("map_control").appendTo($(i));GEvent.addDomListener(i,"click",function(){b.panDirection(0,1)});var l=document.createElement("div");this.setButtonStyle(l,o-j-m,e);c.appendChild(l);$("<img />").attr("src",imagesPrefix+"map/map_arrow_down.png").addClass("map_control").appendTo($(l));GEvent.addDomListener(l,"click",function(){b.panDirection(0,-1)});var k=document.createElement("div");this.setButtonStyle(k,m,d-g-m);c.appendChild(k);$("<img />").attr("src",imagesPrefix+"map/map_zoom_in.png").addClass("map_control").appendTo($(k));GEvent.addDomListener(k,"click",function(){if(b.getZoom()==17&&(b.getCurrentMapType()==G_NORMAL_MAP)){b.setMapType(G_HYBRID_MAP)}b.zoomIn()});var a=document.createElement("div");this.setButtonStyle(a,m+j+2,d-g-m);c.appendChild(a);$("<img />").attr("src",imagesPrefix+"map/map_zoom_out.png").addClass("map_control").appendTo($(a));GEvent.addDomListener(a,"click",function(){b.zoomOut()});var n=document.createElement("div");this.setButtonStyle(n,m,d-g-m-56);c.appendChild(n);n.appendChild(document.createTextNode("map type"));n.style.backgroundColor="white";n.style.color="#05ABD8";n.style.border="1px solid #05ABD8";n.style.padding="1px";n.style.width="50px";GEvent.addDomListener(n,"click",function(){toggleMapType()});b.getContainer().appendChild(c);return c};ZuperMapControl.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_TOP_LEFT,new GSize(0,0))};ZuperMapControl.prototype.setButtonStyle=function(c,a,b){c.style.top=a+"px";c.style.left=b+"px";c.style.position="absolute";c.style.cursor="pointer"};var basePlaceIcon=new GIcon();basePlaceIcon.iconSize=new GSize(23,24);basePlaceIcon.shadowSize=new GSize(29,24);basePlaceIcon.iconAnchor=new GPoint(4,24);var basePoiIcon=new GIcon();basePoiIcon.iconSize=new GSize(19,23);basePoiIcon.iconAnchor=new GPoint(9,11);function ZuperMarkerNamespace(){var n4=(document.layers);var n6=(document.getElementById&&!document.all);var ie=(document.all&&!window.opera);var o6=(navigator.appName.indexOf("Opera")!=-1);var safari=(navigator.userAgent.indexOf("Safari")!=-1);var currentSpan=new GBounds();var likesDXFilters=false;var ie=(document.all&&!window.opera);if(ie){var ua=navigator.userAgent;var re=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})");if(re.exec(ua)!=null){var rv=parseFloat(RegExp.$1);if(rv>=7){likesDXFilters=true}else{if((rv>=6)&&((new RegExp("SV1")).exec(ua)!=null)){likesDXFilters=true}}}}window.likesDXFilters=likesDXFilters;window.ie=ie;function ZuperMarker(a,b){if(typeof b.tooltip!="undefined"){this.setTooltip(b.tooltip);delete (b.tooltip);if(typeof b.tooltipGravity!="undefined"){this.tooltipGravity=b.tooltipGravity;delete (b.tooltipGravity)}else{this.tooltipGravity="auto"}}if(typeof b.linkTo!="undefined"){this.setLinkTo(b.linkTo,b.linkToTarget);delete (b.linkToTarget);delete (b.linkTo)}if(typeof b.hoverIcon!="undefined"){this.hoverIcon=b.hoverIcon;delete (b.hoverIcon);this.oldImagePath="";this.imagesArray=""}if(typeof b.transparentIcon!="undefined"){this.transparentIcon=b.transparentIcon;delete (b.transparentIcon)}if(typeof b.transparentHoverIcon!="undefined"){this.transparentHoverIcon=b.transparentHoverIcon;delete (b.transparentHoverIcon)}if(typeof b.markerType!="undefined"){this.markerType=b.markerType;delete (b.markerType)}this.age=0;this.inheritFrom=GMarker;this.inheritFrom(a,b);this.markerlatlng=a;if(!currentSpan.minX||a.x<currentSpan.minX){currentSpan.minX=a.x}if(!currentSpan.maxX||a.x>currentSpan.maxX){currentSpan.maxX=a.x}if(!currentSpan.minY||a.y<currentSpan.minY){currentSpan.minY=a.y}if(!currentSpan.maxY||a.y>currentSpan.maxY){currentSpan.maxY=a.y}}ZuperMarker.prototype=new GMarker(new GLatLng(1,1));ZuperMarker.prototype.setIcon=function(a){this.remove();this.icon=a;this.initialize(this.map);this.redraw(true)};ZuperMarker.prototype.setHoverIcon=function(a){this.hoverIcon=a};ZuperMarker.prototype.setTooltip=function(string){this.removeTooltip();this.tooltip=new Object();this.tooltip.contents=string};ZuperMarker.prototype.setLinkTo=function(url,target){this.clickURL=url;if(typeof target=="undefined"){this.target="_self"}else{this.target=target}};ZuperMarker.prototype.onClick=function(){if(this.clickURL){window.open(this.clickURL,this.target)}};ZuperMarker.prototype.setIcon=function(a){if(this.imagesArray.length==0){this.imagesArray=findImagesArray(this)}if(this.imagesArray.length!=""){if(this.oldImagePath.length==0){this.oldImagePath=this[this.imagesArray][0].src}if(ie&&likesDXFilters){this[this.imagesArray][0].style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+a+'")'}else{this[this.imagesArray][0].src=a}this[this.imagesArray][0].style.zIndex=4999;this.redraw(true)}};ZuperMarker.prototype.makeTransparent=function(){this.transparent=true;this.setIcon(this.transparentIcon.image);this.oldImagePath=this.transparentIcon.image;this.hoverIcon=this.transparentHoverIcon};ZuperMarker.prototype.showHighlight=function(){this.setIcon(this.hoverIcon.image)};ZuperMarker.prototype.removeHighlight=function(){if(this.imagesArray.length==0){this.imagesArray=findImagesArray(this)}if(this.imagesArray.length>0){if(ie&&likesDXFilters){this[this.imagesArray][0].style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+this.oldImagePath+'")'}else{if(this.oldImagePath!=""){this[this.imagesArray][0].src=this.oldImagePath}}this.oldImagePath="";this[this.imagesArray][0].style.zIndex=4998;this.redraw(true)}};ZuperMarker.prototype.initialize=function(a){if(typeof a=="GMap"){GLog.write("ZuperMarker requires GMap2");return}try{GMarker.prototype.initialize.call(this,a);this.map=a;GEvent.bind(this,"mouseover",this,this.onMouseOver);GEvent.bind(this,"mouseout",this,this.onMouseOut);GEvent.bindDom(this,"click",this,this.onClick)}catch(e){alert("ZuperMarker initialize error: "+e)}};ZuperMarker.prototype.remove=function(a){this.removeTooltip();GMarker.prototype.remove.call(this)};ZuperMarker.prototype.removeTooltip=function(){if(this.tooltipObject){document.body.removeChild(this.tooltipObject);this.tooltipObject=null}};ZuperMarker.prototype.onInfoWindowOpen=function(){this.hideTooltip();GMarker.prototype.onInfoWindowOpen.call(this)};var inMouseOver=false;ZuperMarker.prototype.onMouseOver=function(){if(inMouseOver){return}inMouseOver=true;if(this.hoverIcon){this.showHighlight()}this.showTooltip();inMouseOver=false};ZuperMarker.prototype.onMouseOut=function(){if(this.hoverIcon){this.removeHighlight()}this.hideTooltip()};ZuperMarker.prototype.showTooltip=function(){if(this.tooltip){if(!this.tooltipObject){var opacity=this.tooltip.opacity/100;this.tooltipObject=document.createElement("div");this.tooltipObject.style.display="none";this.tooltipObject.style.position="absolute";this.tooltipObject.style.background="#fff";this.tooltipObject.style.padding="0";this.tooltipObject.style.margin="0";this.tooltipObject.style.MozOpacity=opacity;this.tooltipObject.style.filter="alpha(opacity="+this.tooltip.opacity+")";this.tooltipObject.style.opacity=opacity;this.tooltipObject.style.zIndex=50000;this.tooltipObject.innerHTML='<div class="markerTooltip">'+this.tooltip.contents+"</div>";document.body.appendChild(this.tooltipObject)}var mapPos=findPosition(this.map.getContainer());var tlcLatLng=this.map.fromContainerPixelToLatLng(new GPoint(0,0),true);var tlcDivPixel=this.map.fromLatLngToDivPixel(tlcLatLng);var pointDivPixel=this.map.fromLatLngToDivPixel(this.getPoint());var c=new GPoint(pointDivPixel.x-tlcDivPixel.x,pointDivPixel.y-tlcDivPixel.y);this.tooltipObject.style.left="-1000px";this.tooltipObject.style.top="-1000px";this.tooltipObject.style.display="block";var tipLeft=c.x-this.getIcon().iconAnchor.x+mapPos[0];var tipTop=c.y-this.getIcon().iconAnchor.y+mapPos[1];if(this.tooltipGravity.charAt(0)=="n"){tipTop-=this.tooltipObject.offsetHeight}else{if(this.tooltipGravity.charAt(0)=="s"){tipTop+=this.getIcon().iconSize.height}else{if(c.y>(this.map.getContainer().offsetHeight/2)){tipTop-=this.tooltipObject.offsetHeight}else{tipTop+=this.getIcon().iconSize.height}}}if(this.tooltipGravity.charAt(1)=="w"){tipLeft-=this.tooltipObject.offsetWidth}else{if(this.tooltipGravity.charAt(1)=="e"){tipLeft+=this.getIcon().iconSize.width}else{var mapWidth=map.getSize().width;if(c.x>mapWidth/2){tipLeft-=this.tooltipObject.offsetWidth}else{tipLeft+=this.getIcon().iconSize.width}}}this.tooltipObject.style.left=tipLeft+"px";this.tooltipObject.style.top=tipTop+"px"}};ZuperMarker.prototype.hideTooltip=function(){if(this.tooltipObject){this.tooltipObject.style.display="none"}};GMap.prototype.flushOverlays=function(){currentSpan=new GBounds();this.clearOverlays()};GMap.prototype.zoomToMarkers=function(){var span=new GSize(currentSpan.maxX-currentSpan.minX,currentSpan.maxY-currentSpan.minY);for(var zoom=0;zoom<this.spec.numZoomLevels;zoom++){var ppd=this.spec.getPixelsPerDegree(zoom);var pixelSpan=new GSize(Math.round(span.width*ppd.x),Math.round(span.height*ppd.y));if(pixelSpan.width<=this.viewSize.width&&pixelSpan.height<=this.viewSize.height){break}}this.centerAndZoom(new GPoint(currentSpan.minX+(span.width/2),currentSpan.minY+(span.height/2)),zoom)};ZuperMarker.prototype.unload=function(){};ZuperMarker.bindEventListener=function(element,marker){element=$(element);if(!(typeof element=="undefined")&&!(typeof marker=="undefined")){element.onmouseover=marker.onMouseOver.bindAsEventListener(marker);element.onmouseout=marker.onMouseOut.bindAsEventListener(marker)}};function findImagesArray(marker){for(var i in marker){if(eval("typeof marker."+i)=="object"){try{if(eval("typeof marker."+i+"[0].src")!="undefined"){return i}}catch(e){}}}return""}function makeInterface(a){var b=a||window;b.ZuperMarker=ZuperMarker}makeInterface()}ZuperMarkerNamespace();if(Zuper==undefined){var Zuper={}}Zuper.mTest=null;Zuper.startScroll=null;Zuper.mapScrollObserver=function(a){if(Zuper.mTest){clearInterval(Zuper.mTest)}else{Zuper.startScroll=document.documentElement.scrollTop}Zuper.mTest=setInterval("Zuper.moveTest()",300)};Zuper.mapTopOffset=15;Zuper.moveBox=function(b){var c=$("#site-announcement");var d=$("#scrollContainer");var a=d.prev();var f=findPosition("profile-box")[1]+a.height()+parseInt(a.css("margin-bottom"))-(c.length>0?c[0].clientHeight+10:0);var e=findPosition("footer")[1];var g=d.height();if((e-g)>b&&b>(f-Zuper.mapTopOffset)){d.animate({marginTop:(b-(f-Zuper.mapTopOffset))+"px"})}else{if((e-g)>b){d.animate({marginTop:"0px"})}else{d.animate({marginTop:(e-g-f-10)+"px"})}}d=null};Zuper.moveTest=function(){var a=truvo.dom.findScrollDist();if(Zuper.startScroll==a){clearInterval(Zuper.mTest);Zuper.mTest=null;Zuper.moveBox(a)}Zuper.startScroll=a};function timeNow(){return(new Date()).getTime()}if(Zuper==undefined){var Zuper={}}Zuper.geocoder=function(b){var a=new GClientGeocoder();if(b!=null){a.setBaseCountryCode(b)}return a};Zuper.Search={splitUrl:function(){var a={};if(window.location.href.match("#")){var b=window.location.href.split("#");a.url=b[0];a.args=b[1]}else{a.url=window.location.href;a.args=""}return a},setUrl:function(a){window.location.href=this.splitUrl().url+"#"+a},initialize:function(a){if(typeof a=="undefined"){a={}}if(typeof a.map=="undefined"){a.map=map}this.map=a.map;if(typeof a.form=="undefined"){a.form="search_form"}this.form=$("#"+a.form);this.requestUrl=a.requestUrl||this.form.attr("action");if(this.hasMap()){this.Map.initialize()}this.sendRequestFromUrl();return this},hasMap:function(){return(typeof this.map!="undefined")},sendRequest:function(a){a=a||Zuper.Search.requestUrl;$("input[name=authenticity_token]",this.form).attr("disabled","disabled");var b=$(Zuper.Search.form).serialize();$.ajax({url:a,data:b,dataType:"script"});$("input[name=authenticity_token]",this.form).attr("disabled","disabled");this.setUrl($(Zuper.Search.form).serialize());$("input[name=authenticity_token]",this.form).removeAttr("disabled")},sendPoiRequest:function(){$.ajax({url:Zuper.Search.requestUrl,data:$(Zuper.Search.form).serialize(),dataType:"script",type:"post"})},sendRequestFromUrl:function(){},setOrder:function(a){this.setFormField("search_order","search[order]",a)},changeOrder:function(a){this.setOrder(a);this.sendRequest()},setFormField:function(d,b,c){var a=$("#"+d);if(a.length==0){$("<div></div>").html($('<input type="hidden" />').attr("id",d).attr("name",b).attr("value",c)).appendTo(this.form)}else{a.val(c)}},Map:{initialize:function(a){this.moveThreshold=20;this.continuousSearchDelay=1000;this.mapEventListener=GEvent.addListener(Zuper.Search.map,"dragend",function(){Zuper.Search.Map.mapChangeHandler()});this.mapEventListener=GEvent.addListener(Zuper.Search.map,"zoomend",function(b,c){Zuper.Search.Map.mapChangeHandler()});this.lastMapCoordinates=Zuper.Search.map.getBounds();this.setTrimmedBoundFilter([23,24],[13,23]);this.setAnchorField();this.setZoomLevelField()},updateBigMapDivSize:function(){var a=300;var b=jQuery(window).height()-a;$("#searchResults").css("height",b+"px");$("#map").css("height",b+"px");map.checkResize()},passedMapSearchDelay:function(){var a=((timeNow()-this.lastContinuousSearch));return(a>this.continuousSearchDelay-100)},continuousSearch:function(a){if(typeof a=="undefined"){a=false}if(a||(this.passedMapSearchDelay()&&(this.mapMovedSignificantly()||this.zoomChanged()))){Zuper.Search.sendRequest()}this.lastMapZoom=Zuper.Search.map.getZoom();this.lastMapCoordinates=Zuper.Search.map.getBounds()},focusOnParams:function(){Zuper.Search.map.setCenter(this.getAnchorLatLng(),parseInt($("#search_zoom_level").val()))},focusOnParamsWithoutSearch:function(){this.mapEventListener=GEvent.addListener(Zuper.Search.map,"zoomend",function(){});Zuper.Search.map.setCenter(this.getAnchorLatLng(),parseInt($("#search_zoom_level").val()));this.mapEventListener=GEvent.addListener(Zuper.Search.map,"zoomend",function(a,b){Zuper.Search.Map.mapChangeHandler()})},doContinuousSearch:function(){return false},doPoiSearch:function(){var a=Zuper.Search.form.find("input[name='search[poi][filter_tags][]']");for(var b=0;b<a.size();b++){node=a[b];if(node.checked){return true}}if(Zuper.Search.form.find("select[name='search[poi][category_ids][]']").val()!=""){return true}return false},poiSearch:function(){if(this.mapMovedSignificantly()||this.zoomChanged()){Zuper.Search.sendPoiRequest()}},setAnchorField:function(){var a=Zuper.Search.map.getCenter();Zuper.Search.setFormField("search_anchor_lat","search[anchor]",a.lat()+","+a.lng())},setZoomLevelField:function(){Zuper.Search.setFormField("search_zoom_level","search[zoom_level]",Zuper.Search.map.getZoom())},getAnchorLatLng:function(){var b=$("#search_anchor_lat").val();var a=$("#search_anchor_lng").val();return new GLatLng(b,a)},mapChangeHandler:function(){this.setZoomLevelField();this.setAnchorField();this.setTrimmedBoundFilter([23,24],[13,23]);if(this.doContinuousSearch()||this.doPoiSearch()){this.lastContinuousSearch=timeNow();if((typeof this.continuousSearchDelay=="undefined")||(this.continuousSearchDelay==0)){if(this.doContinuousSearch()){this.continuousSearch()}if(this.doPoiSearch()){this.poiSearch()}}else{if(this.doContinuousSearch()){clearTimeout(this.searchTimeout);this.searchTimeout=setTimeout("Zuper.Search.Map.continuousSearch()",this.continuousSearchDelay)}if(this.doPoiSearch()){clearTimeout(this.poiTimeout);this.poiTimeout=setTimeout("Zuper.Search.Map.poiSearch()",this.continuousSearchDelay)}}}},forceContinuousSearch:function(){if(!this.doContinuousSearch()){this.continuousSearch(true)}},zoomOutAndSearch:function(){Zuper.Search.map.zoomOut();this.forceContinuousSearch()},zoomAndSearch:function(b,a){b=parseInt(b);Zuper.Search.map.setZoom(b);this.forceContinuousSearch();if(typeof a!="undefined"){$(a.parentNode.parentNode).children.each(function(c){c.removeClass("active")});a.parentNode.addClass("active")}},zoomChanged:function(){return((this.lastMapZoom==null)||(this.lastMapZoom!=Zuper.Search.map.getZoom()))},mapMovedSignificantly:function(){if(this.lastMapCoordinates!=null){resolutions=Zuper.Search.map.getResolutions();var a=[(Zuper.Search.map.getBounds().getNorthEast().lat()-this.lastMapCoordinates.getNorthEast().lat())/resolutions[0],(Zuper.Search.map.getBounds().getNorthEast().lng()-this.lastMapCoordinates.getNorthEast().lng())/resolutions[1]];if(Math.abs(a[0])>this.moveThreshold||Math.abs(a[1])>this.moveThreshold){return true}}return false},setTrimmedBoundFilter:function(c,b){var a=Zuper.Search.map.getTrimmedBounds(b,c);this.setMapBoundsFilterFields(a)},setMapBoundsFilterFields:function(a){Zuper.Search.setFormField("search_filter_lat","search[filter_lat]",this.deg2rad(a.getSouthWest().lat())+".."+this.deg2rad(a.getNorthEast().lat()));Zuper.Search.setFormField("search_filter_lng","search[filter_lng]",this.deg2rad(a.getSouthWest().lng())+".."+this.deg2rad(a.getNorthEast().lng()))},deg2rad:function(a){return a/180*Math.PI}}};Zuper.Search.Behaviours={unselectList:function(a){a.childElements().each(function(b){b.removeClassName("active")})},selectSingle:function(a){list=a.parentNode.parentNode;list_item=a.parentNode;this.unselectList(list);list_item.addClassName("active")},toggleLabel:function(b){var a=b.target;var c=a.parentNode.select("input");if(c[0].checked){c[1].checked=true}else{c[0].checked=true}this.selectSingle(a)},handleClickOnLabelForZuperRadioButton:function(a){label=a.target;radioButtonId=label.readAttribute("for");radioButton=$(radioButtonId);radioButtonState=radioButton.checked;if(radioButton!=null&&label!=null){list=radioButton.parentNode.parentNode;children=list.childElements();children.each(function(b){subChildren=b.childElements();subChildren.each(function(c){if(c.checked){c.checked=false}if(c.hasClassName("selected")){c.removeClassName("selected")}})});if(radioButtonState){label.removeClassName("selected");radioButton.checked=false}else{label.addClassName("selected");radioButton.checked=true}Event.stop(a)}},handleClickOnLabelForZuperCheckbox:function(a){label=a.target;checkBoxId=label.readAttribute("for");checkBox=$(checkBoxId);if(checkBox!=null&&label!=null){if(checkBox.checked){label.removeClassName("selected");checkBox.checked=false}else{label.addClassName("selected");checkBox.checked=true}}Event.stop(a)},handleOrderChange:function(a){Event.stop(a);div=a.target;orderFilterLabels=$$("div.orderFilter");orderFilterInputs=$$("div.orderSelectorContainer > input");newOrder="";radioId="";if(a.target.hasClassName("descending")){newOrder="ascending";radioId="search_order_"+a.target.readAttribute("order_attribute")+"_asc"}else{newOrder="descending";radioId="search_order_"+a.target.readAttribute("order_attribute")+"_desc"}orderFilterInputs.each(function(b){b.checked=false});orderFilterLabels.each(function(b){if(b.hasClassName("selected")){b.removeClassName("selected")}if(b.hasClassName("descending")){b.removeClassName("descending")}if(b.hasClassName("ascending")){b.removeClassName("ascending")}});a.target.addClassName(newOrder);a.target.addClassName("selected");radioButton=$(radioId);if(radioButton!=null){radioButton.checked=true}return false}};