/* VERSION:4a36583c0de03a7bad900b78bedc1e85:VERSION */(function(){for(var e=null,k="core",h,l=document.getElementsByTagName("script"),d=0;d<l.length;d++){var f=l[d].src.replace(/%20/g,"").match(/^(.*?)mxn\.js(\?\(\[?(.*?)\]?\))?$/);if(f!==null){h=f[1];if(f[3]){d=f[3].split(",[");e=d[0].replace("]","");if(d[1])k+=","+d[1]}break}}if(!(e===null||e=="none")){e=e.replace(/ /g,"").split(",");k=k.replace(/ /g,"").split(",");h='<script type="text/javascript" src="'+h+"mxn.";l=[];for(d=0;d<k.length;d++){l.push(h+k[d]+'.js"><\/script>');for(f=0;f<e.length;f++)l.push(h+
e[f]+"."+k[d]+'.js"><\/script>')}document.write(l.join(""))}})();
(function(){var e={},k=function(d,f,g,n,a){if(!h(d,f,g))throw"Method "+g+" of object "+f+" is not supported by API "+d+". Are you missing a script tag?";if(typeof e[d][f].deferrable!="undefined"&&e[d][f].deferrable[g]===true)l.deferUntilLoaded.call(n,function(){return e[d][f][g].apply(n,a)});else return e[d][f][g].apply(n,a)},h=function(d,f,g){if(typeof e[d]=="undefined")throw"API "+d+" not loaded. Are you missing a script tag?";if(typeof e[d][f]=="undefined")throw"Object definition "+f+" in API "+
d+" not loaded. Are you missing a script tag?";return typeof e[d][f][g]=="function"},l=window.mxn={register:function(d,f){e.hasOwnProperty(d)||(e[d]={});l.util.merge(e[d],f)},addProxyMethods:function(d,f,g){for(var n=0;n<f.length;n++){var a=f[n];d.prototype[a]=g?new Function("return this.invoker.go('"+a+"', arguments, { overrideApi: true } );"):new Function("return this.invoker.go('"+a+"', arguments);")}},checkLoad:function(d){if(this.loaded[this.api]===false){var f=this;this.onload[this.api].push(function(){d.callee.apply(f,
d)});return true}return false},deferUntilLoaded:function(d){this.loaded[this.api]===false?this.onload[this.api].push(d):d.call(this)},addEvents:function(d,f){for(var g=0;g<f.length;g++){var n=f[g];if(n in d)throw"Event or method "+n+" already declared.";d[n]=new l.Event(n,d)}}};l.Event=function(d,f){var g=[];if(!d)throw"Event name must be provided";this.addHandler=function(n,a){g.push({context:a,handler:n})};this.removeHandler=function(n,a){for(var b=0;b<g.length;b++)g[b].handler==n&&g[b].context==
a&&g.splice(b,1)};this.removeAllHandlers=function(){g=[]};this.fire=function(n){n=[d,f,n];for(var a=0;a<g.length;a++)g[a].handler.apply(g[a].context,n)}};l.Invoker=function(d,f,g){var n={overrideApi:false,context:null,fallback:null};this.go=function(a,b,c){b=typeof b!="undefined"?Array.prototype.slice.apply(b):[];if(typeof c=="undefined")c=n;var i;i=c.overrideApi?b.shift():g.apply(d);if(typeof i!="string")throw"API ID not available.";typeof c.context!="undefined"&&c.context!==null&&b.push(c.context);
return typeof c.fallback=="function"&&!h(i,f,a)?c.fallback.apply(d,b):k(i,f,a,d,b)}};l.util={merge:function(d,f){for(var g in f)if(f.hasOwnProperty(g))if(!d.hasOwnProperty(g)||typeof d[g]!=="object"||typeof f[g]!=="object")d[g]=f[g];else l.util.merge(d[g],f[g])},$m:function(){for(var d=[],f=0;f<arguments.length;f++){var g=arguments[f];if(typeof g=="string")g=document.getElementById(g);if(arguments.length==1)return g;d.push(g)}return d},loadScript:function(d,f){var g=document.createElement("script");
g.type="text/javascript";g.src=d;if(f)if(g.addEventListener)g.addEventListener("load",f,true);else if(g.attachEvent){var n=false;g.attachEvent("onreadystatechange",function(){if(!n&&document.readyState==="complete"){n=true;f()}})}document.getElementsByTagName("head")[0].appendChild(g)},convertLatLonXY_Yahoo:function(d,f){var g=1<<26-f,n=g/360,a=g/(2*Math.PI);g=new YCoordPoint(g/2,g/2);var b=new YCoordPoint;b.x=Math.floor(g.x+d.lon*n);n=Math.sin(d.lat*Math.PI/180);b.y=Math.floor(g.y+0.5*Math.log((1+
n)/(1-n))*-a);return b},loadStyle:function(d){var f=document.createElement("link");f.type="text/css";f.rel="stylesheet";f.href=d;document.getElementsByTagName("head")[0].appendChild(f)},getStyle:function(d,f){var g;if(d.currentStyle)g=d.currentStyle[f];else if(window.getComputedStyle)g=window.getComputedStyle(d,"").getPropertyValue(f);return g},lonToMetres:function(d,f){return d*111200*Math.cos(f*(Math.PI/180))},metresToLon:function(d,f){return d/(111200*Math.cos(f*(Math.PI/180)))},KMToMiles:function(d){return d/
1.609344},milesToKM:function(d){return d*1.609344},getDegreesFromGoogleZoomLevel:function(d,f){return 360*d/Math.pow(2,f+8)},getGoogleZoomLevelFromDegrees:function(d,f){return l.util.logN(360*d/f,2)-8},logN:function(d,f){return Math.log(d)/Math.log(f)},getAvailableProviders:function(){var d=[];for(var f in e)e.hasOwnProperty(f)&&d.push(f);return d},stringFormat:function(d){var f=Array.prototype.slice.apply(arguments);f.shift();return d.replace(/\{\d+\}/g,function(g){g=g.slice(1,-1);return f[g]})},
traverse:function(d){var f=Array.prototype.slice.apply(arguments);f.shift();for(var g=d;typeof g!="undefined"&&g!==null&&f.length>0;)g=f.shift()(g)}};l.util.Color=function(){if(arguments.length==3){this.red=arguments[0];this.green=arguments[1];this.blue=arguments[2]}else arguments.length==1&&this.setHexColor(arguments[0])};l.util.Color.prototype.reHex=/^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/;l.util.Color.prototype.setHexColor=function(d){if(d=d.match(this.reHex))d=d[1];else throw"Invalid HEX color format, expected #000, 000, #000000 or 000000";
if(d.length==3)d=d.replace(/\w/g,function(f){return f.concat(f)});this.red=parseInt(d.substr(0,2),16);this.green=parseInt(d.substr(2,2),16);this.blue=parseInt(d.substr(4,2),16)};l.util.Color.prototype.getHexColor=function(){var d=(this.blue|this.green<<8|this.red<<16).toString(16).toUpperCase();if(d.length<6)d="0"+d;return"#"+d}})();
(function(){var e=mxn.util.$m,k=function(){this.invoker.go("init",[this.currentElement,this.api]);this.applyOptions()},h=mxn.Mapstraction=function(a,b){b||(b=mxn.util.getAvailableProviders()[0]);this.api=b;this.maps={};this.currentElement=e(a);this.eventListeners=[];this.markers=[];this.polylines=[];this.images=[];this.controls=[];this.loaded={};this.onload={};this.onload[b]=[];this.element=a;this.options={enableScrollWheelZoom:false,enableDragging:true};this.addControlsArgs={};this.invoker=new mxn.Invoker(this,
"Mapstraction",function(){return this.api});mxn.addEvents(this,["load","click","endPan","changeZoom","markerAdded","markerRemoved","polylineAdded","polylineRemoved"]);k.apply(this)};h.ROAD=1;h.SATELLITE=2;h.HYBRID=3;h.PHYSICAL=4;mxn.addProxyMethods(h,["addLargeControls","addMapTypeControls","addOverlay","addSmallControls","applyOptions","getBounds","getCenter","getMapType","getPixelRatio","getZoom","getZoomLevelForBoundingBox","mousePosition","resizeTo","setBounds","setCenter","setCenterAndZoom",
"setMapType","setZoom","toggleTileLayer"]);h.prototype.setOptions=function(a){mxn.util.merge(this.options,a);this.applyOptions()};h.prototype.setOption=function(a,b){this.options[a]=b;this.applyOptions()};h.prototype.enableScrollWheelZoom=function(){this.setOption("enableScrollWheelZoom",true)};h.prototype.dragging=function(a){this.setOption("enableDragging",a)};h.prototype.swap=function(a,b){if(this.api!==b){var c=this.getCenter(),i=this.getZoom();this.currentElement.style.visibility="hidden";this.currentElement.style.display=
"none";this.currentElement=e(a);this.currentElement.style.visibility="visible";this.currentElement.style.display="block";this.api=b;this.onload[b]=[];if(this.maps[this.api]===undefined){k.apply(this);for(var m=0;m<this.markers.length;m++)this.addMarker(this.markers[m],true);for(m=0;m<this.polylines.length;m++)this.addPolyline(this.polylines[m],true)}this.setCenterAndZoom(c,i);this.addControls(this.addControlsArgs)}};h.prototype.isLoaded=function(a){if(a===null)a=this.api;return this.loaded[a]};h.prototype.setDebug=
function(a){if(a!==null)this.debug=a;return this.debug};h.prototype.setDefer=function(a){this.loaded[this.api]=!a};h.prototype.runDeferred=function(){for(;this.onload[this.api].length>0;)this.onload[this.api].shift().apply(this)};h.prototype.clickHandler=function(a,b){this.callEventListeners("click",{location:new d(a,b)})};h.prototype.moveendHandler=function(){this.callEventListeners("moveend",{})};h.prototype.addEventListener=function(){var a={};a.event_type=arguments[0];a.callback_function=arguments[1];
if(arguments.length==3){a.back_compat_mode=false;a.callback_object=arguments[2]}else{a.back_compat_mode=true;a.callback_object=null}this.eventListeners.push(a)};h.prototype.callEventListeners=function(a,b){b.source=this;for(var c=0;c<this.eventListeners.length;c++){var i=this.eventListeners[c];if(i.event_type==a)if(i.back_compat_mode)i.event_type=="click"?i.callback_function(b.location):i.callback_function();else i.callback_function.call(i.callback_object||this,b)}};h.prototype.addControls=function(a){this.addControlsArgs=
a;this.invoker.go("addControls",arguments)};h.prototype.addMarker=function(a,b){a.mapstraction=this;a.api=this.api;a.location.api=this.api;a.map=this.maps[this.api];var c=this.invoker.go("addMarker",arguments);a.setChild(c);b||this.markers.push(a);this.markerAdded.fire({marker:a})};h.prototype.addMarkerWithData=function(a,b){a.addData(b);this.addMarker(a)};h.prototype.addPolylineWithData=function(a,b){a.addData(b);this.addPolyline(a)};h.prototype.removeMarker=function(a){for(var b,c=0;c<this.markers.length;c++){b=
this.markers[c];if(a==b){this.invoker.go("removeMarker",arguments);a.onmap=false;this.markers.splice(c,1);this.markerRemoved.fire({marker:a});break}}};h.prototype.removeAllMarkers=function(){for(var a;this.markers.length>0;){a=this.markers.pop();this.invoker.go("removeMarker",[a])}};h.prototype.declutterMarkers=function(a){if(this.loaded[this.api]===false){var b=this;this.onload[this.api].push(function(){b.declutterMarkers(a)})}else{var c=this.maps[this.api];switch(this.api){case "multimap":c.declutterGroup(a.groupName);
break;case "  dummy":break;default:this.debug&&alert(this.api+" not supported by Mapstraction.declutterMarkers")}}};h.prototype.addPolyline=function(a,b){a.api=this.api;a.map=this.maps[this.api];var c=this.invoker.go("addPolyline",arguments);a.setChild(c);b||this.polylines.push(a);this.polylineAdded.fire({polyline:a})};var l=function(a){this.invoker.go("removePolyline",arguments);a.onmap=false;this.polylineRemoved.fire({polyline:a})};h.prototype.removePolyline=function(a){for(var b,c=0;c<this.polylines.length;c++){b=
this.polylines[c];if(a==b){this.polylines.splice(c,1);l.call(this,a);break}}};h.prototype.removeAllPolylines=function(){for(var a;this.polylines.length>0;){a=this.polylines.pop();l.call(this,a)}};h.prototype.autoCenterAndZoom=function(){for(var a=-90,b=90,c=-180,i=180,m,o,q=function(){if(m>a)a=m;if(m<b)b=m;if(o>c)c=o;if(o<i)i=o},p=0;p<this.markers.length;p++){m=this.markers[p].location.lat;o=this.markers[p].location.lon;q()}for(p=0;p<this.polylines.length;p++)for(var r=0;r<this.polylines[p].points.length;r++){m=
this.polylines[p].points[r].lat;o=this.polylines[p].points[r].lon;q()}this.setBounds(new f(b,i,a,c))};h.prototype.centerAndZoomOnPoints=function(a){for(var b=new f(a[0].lat,a[0].lon,a[0].lat,a[0].lon),c=1,i=a.length;c<i;c++)b.extend(a[c]);this.setBounds(b)};h.prototype.visibleCenterAndZoom=function(){for(var a=-90,b=90,c=-180,i=180,m,o,q=function(){if(m>a)a=m;if(m<b)b=m;if(o>c)c=o;if(o<i)i=o},p=0;p<this.markers.length;p++)if(this.markers[p].getAttribute("visible")){m=this.markers[p].location.lat;
o=this.markers[p].location.lon;q()}for(p=0;p<this.polylines.length;p++)if(this.polylines[p].getAttribute("visible"))for(j=0;j<this.polylines[p].points.length;j++){m=this.polylines[p].points[j].lat;o=this.polylines[p].points[j].lon;q()}this.setBounds(new f(b,i,a,c))};h.prototype.polylineCenterAndZoom=function(a){for(var b=-90,c=90,i=-180,m=180,o=0;o<mapstraction.polylines.length;o++)for(var q=0;q<mapstraction.polylines[o].points.length;q++){lat=mapstraction.polylines[o].points[q].lat;lon=mapstraction.polylines[o].points[q].lon;
latConv=lonConv=a;if(a>0){latConv=a/mapstraction.polylines[o].points[q].latConv();lonConv=a/mapstraction.polylines[o].points[q].lonConv()}if(lat+latConv>b)b=lat+latConv;if(lat-latConv<c)c=lat-latConv;if(lon+lonConv>i)i=lon+lonConv;if(lon-lonConv<m)m=lon-lonConv}this.setBounds(new f(c,m,b,i))};h.prototype.addImageOverlay=function(a,b,c,i,m,o,q){var p=document.createElement("img");p.style.display="block";p.setAttribute("id",a);p.setAttribute("src",b);p.style.position="absolute";p.style.zIndex=1;p.setAttribute("west",
i);p.setAttribute("south",m);p.setAttribute("east",o);p.setAttribute("north",q);this.invoker.go("addImageOverlay",arguments,{context:{imgElm:p}})};h.prototype.setImageOpacity=function(a,b){if(b<0)b=0;if(b>=100)b=100;var c=b/100,i=document.getElementById(a);if(typeof i.style.filter=="string")i.style.filter="alpha(opacity:"+b+")";if(typeof i.style.KHTMLOpacity=="string")i.style.KHTMLOpacity=c;if(typeof i.style.MozOpacity=="string")i.style.MozOpacity=c;if(typeof i.style.opacity=="string")i.style.opacity=
c};h.prototype.setImagePosition=function(a){var b=document.getElementById(a),c={latLng:{top:b.getAttribute("north"),left:b.getAttribute("west"),bottom:b.getAttribute("south"),right:b.getAttribute("east")},pixels:{top:0,right:0,bottom:0,left:0}};this.invoker.go("setImagePosition",arguments,{context:c});b.style.top=c.pixels.top.toString()+"px";b.style.left=c.pixels.left.toString()+"px";b.style.width=(c.pixels.right-c.pixels.left).toString()+"px";b.style.height=(c.pixels.bottom-c.pixels.top).toString()+
"px"};h.prototype.addJSON=function(a){a=typeof a=="string"?eval("("+a+")"):a;a=a.features;var b="",c,i,m=[];a.type=="FeatureCollection"&&this.addJSON(a.features);for(var o=0;o<a.length;o++){c=a[o];switch(c.geometry.type){case "Point":b="<strong>"+c.title+"</strong><p>"+c.description+"</p>";i=new g(new d(c.geometry.coordinates[1],c.geometry.coordinates[0]));m.push(i);this.addMarkerWithData(i,{infoBubble:b,label:c.title,date:'new Date("'+c.date+'")',iconShadow:c.icon_shadow,marker:c.id,iconShadowSize:c.icon_shadow_size,
icon:c.icon,iconSize:c.icon_size,category:c.source_id,draggable:false,hover:false});break;case "Polygon":b=new n([]);mapstraction.addPolylineWithData(b,{fillColor:c.poly_color,date:'new Date("'+c.date+'")',category:c.source_id,width:c.line_width,opacity:c.line_opacity,color:c.line_color,polygon:true});m.push(b);break;default:}}return m};h.prototype.addTileLayer=function(a,b,c,i,m,o){if(a){this.tileLayers=this.tileLayers||[];return this.invoker.go("addTileLayer",[a,b||0.6,c||"Mapstraction",i||1,m||
18,o||false])}};h.prototype.addFilter=function(a,b,c){if(!this.filters)this.filters=[];this.filters.push([a,b,c])};h.prototype.removeFilter=function(a,b,c){if(this.filters)for(var i=0;i<this.filters.length;i++)if(this.filters[i][0]==a&&(!b||this.filters[i][1]==b&&this.filters[i][2]==c)){this.filters.splice(i,1);i--}};h.prototype.toggleFilter=function(a,b,c){if(!this.filters)this.filters=[];for(var i=false,m=0;m<this.filters.length;m++)if(this.filters[m][0]==a&&this.filters[m][1]==b&&this.filters[m][2]==
c){this.filters.splice(m,1);m--;i=true}i||this.addFilter(a,b,c)};h.prototype.removeAllFilters=function(){this.filters=[]};h.prototype.doFilter=function(a,b){var c=this.maps[this.api],i=0,m;if(this.filters)switch(this.api){case "multimap":var o=[];for(m=0;m<this.filters.length;m++)o.push(new MMSearchFilter(this.filters[m][0],this.filters[m][1],this.filters[m][2]));c.setMarkerFilters(o);c.redrawMap();break;case "  dummy":break;default:for(o=0;o<this.markers.length;o++){c=true;for(m=0;m<this.filters.length;m++)this.applyFilter(this.markers[o],
this.filters[m])||(c=false);if(c){i++;a?a(this.markers[o]):this.markers[o].show()}else b?b(this.markers[o]):this.markers[o].hide();this.markers[o].setAttribute("visible",c)}break}return i};h.prototype.applyFilter=function(a,b){var c=true;switch(b[1]){case "ge":if(a.getAttribute(b[0])<b[2])c=false;break;case "le":if(a.getAttribute(b[0])>b[2])c=false;break;case "eq":if(a.getAttribute(b[0])==b[2])c=false;break}return c};h.prototype.getAttributeExtremes=function(a){for(var b,c,i=0;i<this.markers.length;i++){if(!b||
b>this.markers[i].getAttribute(a))b=this.markers[i].getAttribute(a);if(!c||c<this.markers[i].getAttribute(a))c=this.markers[i].getAttribute(a)}for(;i<this.polylines.length;i++){if(!b||b>this.polylines[0].getAttribute(a))b=this.polylines[0].getAttribute(a);if(!c||c<this.polylines[0].getAttribute(a))c=this.polylines[0].getAttribute(a)}return[b,c]};h.prototype.getMap=function(){return this.maps[this.api]};var d=mxn.LatLonPoint=function(a,b){this.lat=a;this.lng=this.lon=b;this.invoker=new mxn.Invoker(this,
"LatLonPoint")};mxn.addProxyMethods(d,["fromProprietary","toProprietary"],true);d.prototype.toString=function(){return this.lat+", "+this.lon};d.prototype.distance=function(a){var b=Math.PI/180,c=(this.lat-a.lat)*b,i=(this.lon-a.lon)*b;a=Math.sin(c/2)*Math.sin(c/2)+Math.cos(this.lat*b)*Math.cos(a.lat*b)*Math.sin(i/2)*Math.sin(i/2);return 2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a))*6371};d.prototype.equals=function(a){return this.lat==a.lat&&this.lon==a.lon};d.prototype.latConv=function(){return this.distance(new d(this.lat+
0.1,this.lon))*10};d.prototype.lonConv=function(){return this.distance(new d(this.lat,this.lon+0.1))*10};var f=mxn.BoundingBox=function(a,b,c,i){this.sw=new d(a,b);this.ne=new d(c,i)};f.prototype.getSouthWest=function(){return this.sw};f.prototype.getNorthEast=function(){return this.ne};f.prototype.isEmpty=function(){return this.ne==this.sw};f.prototype.contains=function(a){return a.lat>=this.sw.lat&&a.lat<=this.ne.lat&&a.lon>=this.sw.lon&&a.lon<=this.ne.lon};f.prototype.toSpan=function(){return new d(Math.abs(this.sw.lat-
this.ne.lat),Math.abs(this.sw.lon-this.ne.lon))};f.prototype.extend=function(a){if(this.sw.lat>a.lat)this.sw.lat=a.lat;if(this.sw.lon>a.lon)this.sw.lon=a.lon;if(this.ne.lat<a.lat)this.ne.lat=a.lat;if(this.ne.lon<a.lon)this.ne.lon=a.lon};var g=mxn.Marker=function(a){this.api=null;this.location=a;this.proprietary_marker=this.onmap=false;this.attributes=[];this.invoker=new mxn.Invoker(this,"Marker",function(){return this.api});mxn.addEvents(this,["openInfoBubble","closeInfoBubble","click"])};mxn.addProxyMethods(g,
["fromProprietary","hide","openBubble","closeBubble","show","toProprietary","update"]);g.prototype.setChild=function(a){this.proprietary_marker=a;a.mapstraction_marker=this;this.onmap=true};g.prototype.setLabel=function(a){this.labelText=a};g.prototype.addData=function(a){for(var b in a)if(a.hasOwnProperty(b))switch(b){case "label":this.setLabel(a.label);break;case "infoBubble":this.setInfoBubble(a.infoBubble);break;case "icon":if(a.iconSize&&a.iconAnchor)this.setIcon(a.icon,a.iconSize,a.iconAnchor);
else a.iconSize?this.setIcon(a.icon,a.iconSize):this.setIcon(a.icon);break;case "iconShadow":a.iconShadowSize?this.setShadowIcon(a.iconShadow,[a.iconShadowSize[0],a.iconShadowSize[1]]):this.setIcon(a.iconShadow);break;case "infoDiv":this.setInfoDiv(a.infoDiv[0],a.infoDiv[1]);break;case "draggable":this.setDraggable(a.draggable);break;case "hover":this.setHover(a.hover);this.setHoverIcon(a.hoverIcon);break;case "hoverIcon":this.setHoverIcon(a.hoverIcon);break;case "openBubble":this.openBubble();break;
case "closeBubble":this.closeBubble();break;case "groupName":this.setGroupName(a.groupName);break;default:this.setAttribute(b,a[b]);break}};g.prototype.setInfoBubble=function(a){this.infoBubble=a};g.prototype.setInfoDiv=function(a,b){this.infoDiv=a;this.div=b};g.prototype.setIcon=function(a,b,c){this.iconUrl=a;if(b)this.iconSize=b;if(c)this.iconAnchor=c};g.prototype.setIconSize=function(a){if(a)this.iconSize=a};g.prototype.setIconAnchor=function(a){if(a)this.iconAnchor=a};g.prototype.setShadowIcon=
function(a,b){this.iconShadowUrl=a;if(b)this.iconShadowSize=b};g.prototype.setHoverIcon=function(a){this.hoverIconUrl=a};g.prototype.setDraggable=function(a){this.draggable=a};g.prototype.setHover=function(a){this.hover=a};g.prototype.setGroupName=function(a){this.groupName=a};g.prototype.setAttribute=function(a,b){this.attributes[a]=b};g.prototype.getAttribute=function(a){return this.attributes[a]};var n=mxn.Polyline=function(a){this.api=null;this.points=a;this.attributes=[];this.proprietary_polyline=
this.onmap=false;this.pllID="mspll-"+(new Date).getTime()+"-"+Math.floor(Math.random()*Math.pow(2,16));this.invoker=new mxn.Invoker(this,"Polyline",function(){return this.api})};mxn.addProxyMethods(n,["fromProprietary","hide","show","toProprietary","update"]);n.prototype.addData=function(a){for(var b in a)if(a.hasOwnProperty(b))switch(b){case "color":this.setColor(a.color);break;case "width":this.setWidth(a.width);break;case "opacity":this.setOpacity(a.opacity);break;case "closed":this.setClosed(a.closed);
break;case "fillColor":this.setFillColor(a.fillColor);break;default:this.setAttribute(b,a[b]);break}};n.prototype.setChild=function(a){this.proprietary_polyline=a;this.onmap=true};n.prototype.setColor=function(a){this.color=a.length==7&&a[0]=="#"?a.toUpperCase():a};n.prototype.setWidth=function(a){this.width=a};n.prototype.setOpacity=function(a){this.opacity=a};n.prototype.setClosed=function(a){this.closed=a};n.prototype.setFillColor=function(a){this.fillColor=a};n.prototype.setAttribute=function(a,
b){this.attributes[a]=b};n.prototype.getAttribute=function(a){return this.attributes[a]};n.prototype.simplify=function(a){var b=[];b[0]=this.points[0];for(var c=0,i=1;i<this.points.length-1;i++)if(this.points[i].distance(this.points[c])>=a){b[b.length]=this.points[i];c=i}b[b.length]=this.points[this.points.length-1];this.points=b};(mxn.Radius=function(a,b){this.center=a;var c=a.latConv(),i=a.lonConv(),m=Math.PI/180;this.calcs=[];for(var o=0;o<360;o+=b)this.calcs.push([Math.cos(o*m)/c,Math.sin(o*m)/
i])}).prototype.getPolyline=function(a,b){for(var c=[],i=0;i<this.calcs.length;i++){var m=new d(this.center.lat+a*this.calcs[i][0],this.center.lon+a*this.calcs[i][1]);c.push(m)}c.push(c[0]);c=new n(c);c.setColor(b);return c}})();
mxn.register("googlev3",{Mapstraction:{init:function(e,k){var h=this;if(google&&google.maps){var l={disableDefaultUI:true,mapTypeId:google.maps.MapTypeId.ROADMAP,mapTypeControl:false,mapTypeControlOptions:null,navigationControl:false,navigationControlOptions:null,scrollwheel:false};if(!this.addControlsArgs&&loadoptions.addControlsArgs)this.addControlsArgs=loadoptions.addControlsArgs;if(this.addControlsArgs){if(this.addControlsArgs.zoom){l.navigationControl=true;if(this.addControlsArgs.zoom=="small")l.navigationControlOptions=
{style:google.maps.NavigationControlStyle.SMALL};if(this.addControlsArgs.zoom=="large")l.navigationControlOptions={style:google.maps.NavigationControlStyle.ZOOM_PAN}}if(this.addControlsArgs.map_type){l.mapTypeControl=true;l.mapTypeControlOptions={style:google.maps.MapTypeControlStyle.DEFAULT}}}l=new google.maps.Map(e,l);var d=[];google.maps.event.addListener(l,"idle",function(){var g=d.length;if(g>0){g=d.splice(0,g);for(var n;n=g.shift();)n()}});google.maps.event.addListener(l,"click",function(g){h.click.fire({location:new mxn.LatLonPoint(g.latLng.lat(),
g.latLng.lng())})});google.maps.event.addListener(l,"zoom_changed",function(){d.push(function(){h.changeZoom.fire()})});google.maps.event.addListener(l,"center_changed",function(){h.moveendHandler(h);h.endPan.fire()});var f=google.maps.event.addListener(l,"tilesloaded",function(){h.load.fire();google.maps.event.removeListener(f)});this.maps[k]=l;this.loaded[k]=true}else alert(k+" map script not imported")},applyOptions:function(){var e=this.maps[this.api],k=[];if(this.options.enableDragging)k.draggable=
true;if(this.options.enableScrollWheelZoom)k.scrollwheel=true;e.setOptions(k)},resizeTo:function(e,k){this.currentElement.style.width=e;this.currentElement.style.height=k;google.maps.event.trigger(this.maps[this.api],"resize")},addControls:function(e){var k=this.maps[this.api];if(e.zoom||e.pan)e.zoom=="large"?this.addLargeControls():this.addSmallControls();if(e.scale){k.setOptions({scaleControl:true,scaleControlOptions:{style:google.maps.ScaleControlStyle.DEFAULT}});this.addControlsArgs.scale=true}e.map_type&&
this.addMapTypeControls()},addSmallControls:function(){this.maps[this.api].setOptions({navigationControl:true,navigationControlOptions:{style:google.maps.NavigationControlStyle.SMALL}});this.addControlsArgs.pan=false;this.addControlsArgs.scale=false;this.addControlsArgs.zoom="small"},addLargeControls:function(){this.maps[this.api].setOptions({navigationControl:true,navigationControlOptions:{style:google.maps.NavigationControlStyle.DEFAULT}});this.addControlsArgs.pan=true;this.addControlsArgs.zoom=
"large"},addMapTypeControls:function(){this.maps[this.api].setOptions({mapTypeControl:true,mapTypeControlOptions:{style:google.maps.MapTypeControlStyle.DEFAULT}});this.addControlsArgs.map_type=true},setCenterAndZoom:function(e,k){var h=this.maps[this.api],l=e.toProprietary(this.api);h.setCenter(l);h.setZoom(k)},addMarker:function(e){return e.toProprietary(this.api)},removeMarker:function(e){e.hide()},declutterMarkers:function(){},addPolyline:function(e){var k=this.maps[this.api];e=e.toProprietary(this.api);
e.setMap(k);return e},removePolyline:function(e){e.proprietary_polyline.setMap(null)},getCenter:function(){var e=this.maps[this.api].getCenter();return new mxn.LatLonPoint(e.lat(),e.lng())},setCenter:function(e,k){var h=this.maps[this.api],l=e.toProprietary(this.api);k&&k.pan?h.panTo(l):h.setCenter(l)},setZoom:function(e){this.maps[this.api].setZoom(e)},getZoom:function(){return this.maps[this.api].getZoom()},getZoomLevelForBoundingBox:function(e){var k=this.maps[this.api],h=e.getSouthWest().toProprietary(this.api);
e=e.getNorthEast().toProprietary(this.api);h=new google.maps.LatLngBounds(h,e);k.fitBounds(h);return k.getZoom()},setMapType:function(e){var k=this.maps[this.api];switch(e){case mxn.Mapstraction.ROAD:k.setMapTypeId(google.maps.MapTypeId.ROADMAP);break;case mxn.Mapstraction.SATELLITE:k.setMapTypeId(google.maps.MapTypeId.SATELLITE);break;case mxn.Mapstraction.HYBRID:k.setMapTypeId(google.maps.MapTypeId.HYBRID);break;case mxn.Mapstraction.PHYSICAL:k.setMapTypeId(google.maps.MapTypeId.TERRAIN);break;
default:k.setMapTypeId(google.maps.MapTypeId.ROADMAP)}},getMapType:function(){switch(this.maps[this.api].getMapTypeId()){case google.maps.MapTypeId.ROADMAP:return mxn.Mapstraction.ROAD;case google.maps.MapTypeId.SATELLITE:return mxn.Mapstraction.SATELLITE;case google.maps.MapTypeId.HYBRID:return mxn.Mapstraction.HYBRID;case google.maps.MapTypeId.TERRAIN:return mxn.Mapstraction.PHYSICAL;default:return null}},getBounds:function(){var e=this.maps[this.api].getBounds();if(!e)throw"Bounds not available, map must be initialized";
var k=e.getSouthWest();e=e.getNorthEast();return new mxn.BoundingBox(k.lat(),k.lng(),e.lat(),e.lng())},setBounds:function(e){var k=this.maps[this.api],h=e.getSouthWest().toProprietary(this.api);e=e.getNorthEast().toProprietary(this.api);h=new google.maps.LatLngBounds(h,e);k.fitBounds(h)},addImageOverlay:function(e,k,h,l,d,f,g){e=this.maps[this.api];l=new google.maps.LatLngBounds(new google.maps.LatLng(d,l),new google.maps.LatLng(g,f));(new google.maps.GroundOverlay(k,l)).setMap(e)},setImagePosition:function(){},
addOverlay:function(e,k){var h=this.maps[this.api];(new google.maps.KmlLayer(e,{preserveViewport:!k})).setMap(h)},addTileLayer:function(e,k,h,l,d,f){var g=this.maps[this.api],n=[],a=this.tileLayers.length||0;n[0]={getTileUrl:function(b,c){url=e;url=url.replace(/\{Z\}/g,c);url=url.replace(/\{X\}/g,b.x);return url=url.replace(/\{Y\}/g,b.y)},tileSize:new google.maps.Size(256,256),isPng:true,minZoom:l,maxZoom:d,opacity:k,name:h};k=new google.maps.ImageMapType(n[0]);if(f){g.mapTypes.set("tile"+a,k);f=
[google.maps.MapTypeId.ROADMAP,google.maps.MapTypeId.HYBRID,google.maps.MapTypeId.SATELLITE,google.maps.MapTypeId.TERRAIN];for(h=0;h<this.tileLayers.length;h++)f.push("tile"+h);g.setOptions({mapTypeControlOptions:{mapTypeIds:f}})}else g.overlayMapTypes.insertAt(a,k);this.tileLayers.push([e,k,true,a]);return k},toggleTileLayer:function(e){for(var k=this.maps[this.api],h=0;h<this.tileLayers.length;h++){var l=this.tileLayers[h];if(l[0]==e)if(l[2]){k.overlayMapTypes.removeAt(l[3]);l[2]=false}else{k.overlayMapTypes.insertAt(l[3],
l[1]);l[2]=true}}},getPixelRatio:function(){},mousePosition:function(e){var k=this.maps[this.api],h=document.getElementById(e);if(h!==null){google.maps.event.addListener(k,"mousemove",function(l){l=l.latLng.lat().toFixed(4)+" / "+l.latLng.lng().toFixed(4);h.innerHTML=l});h.innerHTML="0.0000 / 0.0000"}}},LatLonPoint:{toProprietary:function(){return new google.maps.LatLng(this.lat,this.lon)},fromProprietary:function(e){this.lat=e.lat();this.lon=e.lng()}},Marker:{toProprietary:function(){var e={},k=
0,h=0;if(this.iconAnchor){k=this.iconAnchor[0];h=this.iconAnchor[1]}k=new google.maps.Point(k,h);if(this.iconUrl){e.icon=new google.maps.MarkerImage(this.iconUrl,new google.maps.Size(this.iconSize[0],this.iconSize[1]),new google.maps.Point(0,0),k);if(this.iconShadowUrl)e.shadow=this.iconShadowSize?new google.maps.MarkerImage(this.iconShadowUrl,new google.maps.Size(this.iconShadowSize[0],this.iconShadowSize[1]),new google.maps.Point(0,0),k):new google.maps.MarkerImage(this.iconShadowUrl)}if(this.draggable)e.draggable=
this.draggable;if(this.labelText)e.title=this.labelText;if(this.imageMap)e.shape={coord:this.imageMap,type:"poly"};e.position=this.location.toProprietary(this.api);e.map=this.map;var l=new google.maps.Marker(e);if(this.infoBubble){e="click";if(this.hover)e="mouseover";google.maps.event.addListener(l,e,function(){l.mapstraction_marker.openBubble()})}if(this.hoverIconUrl){e=new google.maps.Size(this.iconSize[0],this.iconSize[1]);h=new google.maps.Point(0,0);var d=new google.maps.MarkerImage(this.hoverIconUrl,
e,h,k),f=new google.maps.MarkerImage(this.iconUrl,e,h,k);google.maps.event.addListener(l,"mouseover",function(){l.setIcon(d)});google.maps.event.addListener(l,"mouseout",function(){l.setIcon(f)})}google.maps.event.addListener(l,"click",function(){l.mapstraction_marker.click.fire()});return l},openBubble:function(){var e,k=this;if(!this.hasOwnProperty("proprietary_infowindow")||this.proprietary_infowindow===null){e=new google.maps.InfoWindow({content:this.infoBubble});google.maps.event.addListener(e,
"closeclick",function(){k.closeBubble()})}else e=this.proprietary_infowindow;this.openInfoBubble.fire({marker:this});e.open(this.map,this.proprietary_marker);this.proprietary_infowindow=e},closeBubble:function(){if(this.hasOwnProperty("proprietary_infowindow")&&this.proprietary_infowindow!==null){this.proprietary_infowindow.close();this.proprietary_infowindow=null;this.closeInfoBubble.fire({marker:this})}},hide:function(){this.proprietary_marker.setOptions({visible:false})},show:function(){this.proprietary_marker.setOptions({visible:true})},
update:function(){var e=new mxn.LatLonPoint;e.fromProprietary("googlev3",this.proprietary_marker.getPosition());this.location=e}},Polyline:{toProprietary:function(){for(var e=[],k=0,h=this.points.length;k<h;k++)e.push(this.points[k].toProprietary("googlev3"));e={path:e,strokeColor:this.color||"#000000",strokeOpacity:this.opacity||1,strokeWeight:this.width||3};if(this.closed){e.fillColor=this.fillColor||"#000000";e.fillOpacity=e.strokeOpacity;return new google.maps.Polygon(e)}else return new google.maps.Polyline(e)},
show:function(){throw"Not implemented";},hide:function(){throw"Not implemented";}}});

