var GMarker=function(){};var GMap2=function(){};var GLatLng=function(){};var GUnload=function(){};var GOverlay=function(){};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};

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)};

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);if(self.Event&&Event.observe){Event.observe(window,"unload",GUnload)}else{window.onunload=GUnload};