(function(b){var a={VERSION:"0.2",ROOT_URL:(function(){var d=document.getElementsByTagName("script"),h=/^(.*\/)leaflet-?([\w-]*)\.js.*$/;for(var g=0,c=d.length;g<c;g++){var j=d[g].src,f=j&&j.match(h);if(f){if(f[2]=="include"){break}return f[1]}}return"../../dist/"})(),noConflict:function(){b.L=this._originalL;return this},_originalL:b.L};window.L=a}(this));L.Util={extend:function(d){var c=Array.prototype.slice.call(arguments,1);for(var b=0,a=c.length,g;b<a;b++){g=c[b]||{};for(var f in g){if(g.hasOwnProperty(f)){d[f]=g[f]}}}return d},bind:function(a,b){return function(){return a.apply(b,arguments)}},stamp:(function(){var b=0,a="_leaflet_id";return function(c){c[a]=c[a]||++b;return c[a]}})(),requestAnimFrame:(function(){function b(c){window.setTimeout(c,1000/60)}var a=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||b;return function(d,c){d=c?L.Util.bind(d,c):c;a(d)}})(),limitExecByInterval:function(f,h,d){var c,g,b;function a(){c=false;if(g){b.callee.apply(d,b);g=false}}return function(){b=arguments;if(!c){c=true;setTimeout(a,h);f.apply(d,b)}else{g=true}}},falseFn:function(){return false},formatNum:function(a,c){var b=Math.pow(10,c||5);return Math.round(a*b)/b},setOptions:function(b,a){b.options=L.Util.extend({},b.options,a)},getParamString:function(b){var c=[];for(var a in b){if(b.hasOwnProperty(a)){c.push(a+"="+b[a])}}return"?"+c.join("&")}};L.Class=function(){};L.Class.extend=function(b){var d=function(){if(!L.Class._prototyping&&this.initialize){this.initialize.apply(this,arguments)}};L.Class._prototyping=true;var c=new this();L.Class._prototyping=false;c.constructor=d;d.prototype=c;c.superclass=this.prototype;if(b.statics){L.Util.extend(d,b.statics);delete b.statics}if(b.includes){L.Util.extend.apply(null,[c].concat(b.includes));delete b.includes}if(b.options&&c.options){b.options=L.Util.extend({},c.options,b.options)}L.Util.extend(c,b);d.extend=arguments.callee;d.include=function(f){L.Util.extend(this.prototype,f)};for(var a in this){if(this.hasOwnProperty(a)&&a!="prototype"){d[a]=this[a]}}return d};L.Mixin={};L.Mixin.Events={addEventListener:function(d,c,b){var a=this._leaflet_events=this._leaflet_events||{};a[d]=a[d]||[];a[d].push({action:c,context:b});return this},hasEventListeners:function(b){var a="_leaflet_events";return(a in this)&&(b in this[a])&&(this[a][b].length>0)},removeEventListener:function(g,f,d){if(!this.hasEventListeners(g)){return this}for(var c=0,b=this._leaflet_events,a=b[g].length;c<a;c++){if((b[g][c].action===f)&&(!d||(b[g][c].context===d))){b[g].splice(c,1);return this}}return this},fireEvent:function(d,g){if(!this.hasEventListeners(d)){return}var f=L.Util.extend({type:d,target:this},g);var c=this._leaflet_events[d].slice();for(var b=0,a=c.length;b<a;b++){c[b].action.call(c[b].context||this,f)}return this}};L.Mixin.Events.on=L.Mixin.Events.addEventListener;L.Mixin.Events.off=L.Mixin.Events.removeEventListener;L.Mixin.Events.fire=L.Mixin.Events.fireEvent;(function(){var c=navigator.userAgent.toLowerCase(),d=!!window.ActiveXObject,b=c.indexOf("webkit")!=-1,a=c.indexOf("mobile")!=-1;L.Browser={ie:d,ie6:d&&!window.XMLHttpRequest,webkit:b,webkit3d:b&&("WebKitCSSMatrix" in window)&&("m11" in new WebKitCSSMatrix()),mobileWebkit:b&&a,gecko:c.indexOf("gecko")!=-1,android:c.indexOf("android")!=-1}})();L.Point=function(a,c,b){this.x=(b?Math.round(a):a);this.y=(b?Math.round(c):c)};L.Point.prototype={add:function(a){return this.clone()._add(a)},_add:function(a){this.x+=a.x;this.y+=a.y;return this},subtract:function(a){return this.clone()._subtract(a)},_subtract:function(a){this.x-=a.x;this.y-=a.y;return this},divideBy:function(b,a){return new L.Point(this.x/b,this.y/b,a)},multiplyBy:function(a){return new L.Point(this.x*a,this.y*a)},distanceTo:function(b){var a=b.x-this.x,c=b.y-this.y;return Math.sqrt(a*a+c*c)},round:function(){return this.clone()._round()},_round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this},clone:function(){return new L.Point(this.x,this.y)},toString:function(){return"Point("+L.Util.formatNum(this.x)+", "+L.Util.formatNum(this.y)+")"}};L.Bounds=L.Class.extend({initialize:function(d,b){if(!d){return}var f=(d instanceof Array?d:[d,b]);for(var c=0,a=f.length;c<a;c++){this.extend(f[c])}},extend:function(a){if(!this.min&&!this.max){this.min=new L.Point(a.x,a.y);this.max=new L.Point(a.x,a.y)}else{this.min.x=Math.min(a.x,this.min.x);this.max.x=Math.max(a.x,this.max.x);this.min.y=Math.min(a.y,this.min.y);this.max.y=Math.max(a.y,this.max.y)}},getCenter:function(a){return new L.Point((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,a)},contains:function(c){var b,a;if(c instanceof L.Bounds){b=c.min;a=c.max}else{a=a=c}return(b.x>=this.min.x)&&(a.x<=this.max.x)&&(b.y>=this.min.y)&&(a.y<=this.max.y)}});L.Transformation=L.Class.extend({initialize:function(g,f,j,h){this._a=g;this._b=f;this._c=j;this._d=h},transform:function(a,b){return this._transform(a.clone(),b)},_transform:function(a,b){b=b||1;a.x=b*(this._a*a.x+this._b);a.y=b*(this._c*a.y+this._d);return a},untransform:function(a,b){b=b||1;return new L.Point((a.x/b-this._b)/this._a,(a.y/b-this._d)/this._c)}});L.LineUtil={simplify:function(b,a){if(!a){return b.slice()}b=this.reducePoints(b,a);b=this.simplifyDP(b,a);return b},pointToSegmentDistance:function(b,c,a){return Math.sqrt(this._sqPointToSegmentDist(b,c,a))},simplifyDP:function(m,n){var a=0,h=0,g=n*n;for(var f=1,j=m.length,d;f<j-1;f++){d=this._sqPointToSegmentDist(m[f],m[0],m[j-1]);if(d>a){h=f;a=d}}if(a>=g){var c=m.slice(0,h),b=m.slice(h),l=this.simplifyDP(c,n).slice(0,j-2),k=this.simplifyDP(b,n);return l.concat(k)}else{return[m[0],m[j-1]]}},reducePoints:function(f,b){var h=[f[0]],d=b*b;for(var c=1,g=0,a=f.length;c<a;c++){if(this._sqDist(f[c],f[g])<d){continue}h.push(f[c]);g=c}if(g<a-1){h.push(f[a-1])}return h},clipSegment:function(n,l,c,o){var j=c.min,m=c.max;var h=o?this._lastCode:this._getBitCode(n,c),g=this._getBitCode(l,c);this._lastCode=g;while(true){if(!(h|g)){return[n,l]}else{if(h&g){return false}else{var f=h||g,d=this._getEdgeIntersection(n,l,f,c),k=this._getBitCode(d,c);if(f==h){n=d;h=k}else{l=d;g=k}}}}},_getEdgeIntersection:function(g,d,l,k){var h=d.x-g.x,f=d.y-g.y,j=k.min,c=k.max;if(l&8){return new L.Point(g.x+h*(c.y-g.y)/f,c.y)}else{if(l&4){return new L.Point(g.x+h*(j.y-g.y)/f,j.y)}else{if(l&2){return new L.Point(c.x,g.y+f*(c.x-g.x)/h)}else{if(l&1){return new L.Point(j.x,g.y+f*(j.x-g.x)/h)}}}}},_getBitCode:function(c,b){var a=0;if(c.x<b.min.x){a|=1}else{if(c.x>b.max.x){a|=2}}if(c.y<b.min.y){a|=4}else{if(c.y>b.max.y){a|=8}}return a},_sqDist:function(d,c){var b=c.x-d.x,a=c.y-d.y;return b*b+a*a},_sqPointToSegmentDist:function(h,j,g){var b=g.x-j.x,d=g.y-j.y;if(!b&&!d){return this._sqDist(h,j)}var a=(h.x-j.x)*b+(h.y-j.y)*d,c=a/this._sqDist(j,g);if(c<0){return this._sqDist(h,j)}if(c>1){return this._sqDist(h,g)}var f=new L.Point(j.x+b*c,j.y+d*c);return this._sqDist(h,f)}};L.PolyUtil={};L.PolyUtil.clipPolygon=function(v,c){var l=c.min,t=c.max,r,n=[1,4,2,8],o,m,h,u,s,q,f,d,g=L.LineUtil;for(o=0,q=v.length;o<q;o++){v[o]._code=g._getBitCode(v[o],c)}for(h=0;h<4;h++){f=n[h];r=[];for(o=0,q=v.length,m=q-1;o<q;m=o++){u=v[o];s=v[m];if(!(u._code&f)){if(s._code&f){d=g._getEdgeIntersection(s,u,f,c);d._code=g._getBitCode(d,c);r.push(d)}r.push(u)}else{if(!(s._code&f)){d=g._getEdgeIntersection(s,u,f,c);d._code=g._getBitCode(d,c);r.push(d)}}}v=r}return v};L.DomEvent={addListener:function(h,g,f,c){var j=L.Util.stamp(f);function d(k){return f.call(c||h,k||L.DomEvent._getEvent())}if(L.Browser.mobileWebkit&&(g=="dblclick")&&this.addDoubleTapListener){this.addDoubleTapListener(h,d,j)}else{if("addEventListener" in h){if(g=="mousewheel"){h.addEventListener("DOMMouseScroll",d,false);h.addEventListener(g,d,false)}else{if((g=="mouseenter")||(g=="mouseleave")){var a=d,b=(g=="mouseenter"?"mouseover":"mouseout");d=function(k){if(!L.DomEvent._checkMouse(h,k)){return}return a(k)};h.addEventListener(b,d,false)}else{h.addEventListener(g,d,false)}}}else{if("attachEvent" in h){h.attachEvent("on"+g,d)}}}h["_leaflet_"+g+j]=d},removeListener:function(d,c,b){var f=L.Util.stamp(b),a="_leaflet_"+c+f;handler=d[a];if(L.Browser.mobileWebkit&&(c=="dblclick")&&this.removeDoubleTapListener){this.removeDoubleTapListener(d,f)}else{if("removeEventListener" in d){if(c=="mousewheel"){d.removeEventListener("DOMMouseScroll",handler,false);d.removeEventListener(c,handler,false)}else{if((c=="mouseenter")||(c=="mouseleave")){d.removeEventListener((c=="mouseenter"?"mouseover":"mouseout"),handler,false)}else{d.removeEventListener(c,handler,false)}}}else{if("detachEvent" in d){d.detachEvent("on"+c,handler)}}}d[a]=null},_checkMouse:function(a,d){var c=d.relatedTarget;if(!c){return true}try{while(c&&(c!=a)){c=c.parentNode}}catch(b){return false}return(c!=a)},_getEvent:function(){var b=window.event;if(!b){var a=arguments.callee.caller;while(a){b=a["arguments"][0];if(b&&Event==b.constructor){break}a=a.caller}}return b},stopPropagation:function(a){if(a.stopPropagation){a.stopPropagation()}else{a.cancelBubble=true}},disableClickPropagation:function(a){L.DomEvent.addListener(a,"mousedown",L.DomEvent.stopPropagation);L.DomEvent.addListener(a,"click",L.DomEvent.stopPropagation);L.DomEvent.addListener(a,"dblclick",L.DomEvent.stopPropagation)},preventDefault:function(a){if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}},stop:function(a){L.DomEvent.preventDefault(a);L.DomEvent.stopPropagation(a)},getMousePosition:function(c,b){var a=c.pageX?c.pageX:c.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,f=c.pageY?c.pageY:c.clientY+document.body.scrollTop+document.documentElement.scrollTop,d=new L.Point(a,f);return(b?d.subtract(L.DomUtil.getCumulativeOffset(b)):d)},getWheelDelta:function(a){var b=0;if(a.wheelDelta){b=a.wheelDelta/120}if(a.detail){b=-a.detail/3}return b}};L.Util.extend(L.DomEvent,{addDoubleTapListener:function(f,n,a){var m,j=false,g=250,d,b="_leaflet_",h="touchstart",l="touchend";function c(p){if(p.touches.length!=1){return}var o=Date.now(),q=o-(m||o);d=p.touches[0];j=(q>0&&q<=g);m=o}function k(o){if(j){d.type="dblclick";n(d);m=null}}f[b+h+a]=c;f[b+l+a]=k;f.addEventListener(h,c,false);f.addEventListener(l,k,false)},removeDoubleTapListener:function(b,c){var a="_leaflet_";b.removeEventListener(b,b[a+"touchstart"+c],false);b.removeEventListener(b,b[a+"touchend"+c],false)}});L.DomUtil={get:function(a){return(typeof a=="string"?document.getElementById(a):a)},getStyle:function(c,b){var d=c.style[b];if(!d&&c.currentStyle){d=c.currentStyle[b]}if(!d||d=="auto"){var a=document.defaultView.getComputedStyle(c,null);d=a?a[b]:null}return(d=="auto"?null:d)},getCumulativeOffset:function(a){var c=0,b=0;do{c+=a.offsetTop||0;b+=a.offsetLeft||0;a=a.offsetParent}while(a);return new L.Point(b,c)},create:function(b,d,a){var c=document.createElement(b);c.className=d;if(a){a.appendChild(c)}return c},disableTextSelection:function(){if(document.selection&&document.selection.empty){document.selection.empty()}if(!this._onselectstart){this._onselectstart=document.onselectstart;document.onselectstart=L.Util.falseFn}},enableTextSelection:function(){document.onselectstart=this._onselectstart;this._onselectstart=null},CLASS_RE:/(\\s|^)'+cls+'(\\s|$)/,hasClass:function(b,a){return(b.className.length>0)&&new RegExp("(^|\\s)"+a+"(\\s|$)").test(b.className)},addClass:function(b,a){if(!L.DomUtil.hasClass(b,a)){b.className+=(b.className?" ":"")+a}},setOpacity:function(a,b){if(L.Browser.ie){a.style.filter="alpha(opacity="+Math.round(b*100)+")"}else{a.style.opacity=b}},testProp:function(c){var b=document.documentElement.style;for(var a=0;a<c.length;a++){if(c[a] in b){return c[a]}}return false},getTranslateString:function(a){return L.DomUtil.TRANSLATE_OPEN+a.x+"px,"+a.y+"px"+L.DomUtil.TRANSLATE_CLOSE},getScaleString:function(b,a){return L.DomUtil.getTranslateString(a)+" scale("+b+") "+L.DomUtil.getTranslateString(a.multiplyBy(-1))},setPosition:function(b,a){b._leaflet_pos=a;if(L.Browser.webkit){b.style[L.DomUtil.TRANSFORM]=L.DomUtil.getTranslateString(a)}else{b.style.left=a.x+"px";b.style.top=a.y+"px"}},getPosition:function(a){return a._leaflet_pos}};L.Util.extend(L.DomUtil,{TRANSITION:L.DomUtil.testProp(["transition","webkitTransition","OTransition","MozTransition","msTransition"]),TRANSFORM:L.DomUtil.testProp(["transformProperty","WebkitTransform","OTransform","MozTransform","msTransform"]),TRANSLATE_OPEN:"translate"+(L.Browser.webkit3d?"3d(":"("),TRANSLATE_CLOSE:L.Browser.webkit3d?",0)":")"});L.Draggable=L.Class.extend({includes:L.Mixin.Events,statics:{START:L.Browser.mobileWebkit?"touchstart":"mousedown",END:L.Browser.mobileWebkit?"touchend":"mouseup",MOVE:L.Browser.mobileWebkit?"touchmove":"mousemove"},initialize:function(a,b){this._element=a;this._dragStartTarget=b||a},enable:function(){if(this._enabled){return}L.DomEvent.addListener(this._dragStartTarget,L.Draggable.START,this._onDown,this);this._enabled=true},disable:function(){if(!this._enabled){return}L.DomEvent.removeListener(this._dragStartTarget,L.Draggable.START,this._onDown);this._enabled=false},_onDown:function(a){if(a.shiftKey||((a.which!=1)&&(a.button!=1)&&!a.touches)){return}if(a.touches&&a.touches.length>1){return}if(a.touches&&a.touches.length==1){a=a.touches[0]}this._moved=false;L.DomUtil.disableTextSelection();this._setMovingCursor();this._startPos=L.DomUtil.getPosition(this._element);this._startPoint=new L.Point(a.clientX,a.clientY);L.DomEvent.addListener(document,L.Draggable.MOVE,this._onMove,this);L.DomEvent.addListener(document,L.Draggable.END,this._onUp,this);if(!L.Browser.mobileWebkit||L.Browser.android){L.DomEvent.preventDefault(a)}if(L.Browser.android){this._simulateEvent(a)}},_onMove:function(b){if(b.touches&&b.touches.length>1){return}if(b.touches&&b.touches.length==1){b=b.touches[0]}if(!this._moved){this.fire("dragstart");this._moved=true}var a=new L.Point(b.clientX,b.clientY);this._newPos=this._startPos.add(a).subtract(this._startPoint);L.Util.requestAnimFrame(this._updatePosition,this);this.fire("drag");L.DomEvent.preventDefault(b);if(L.Browser.android){this._simulateEvent(b)}},_updatePosition:function(){L.DomUtil.setPosition(this._element,this._newPos)},_onUp:function(){L.DomUtil.enableTextSelection();this._restoreCursor();L.DomEvent.removeListener(document,L.Draggable.MOVE,this._onMove);L.DomEvent.removeListener(document,L.Draggable.END,this._onUp);if(this._moved){this.fire("dragend")}if(L.Browser.android){this._simulateEvent(e)}},_setMovingCursor:function(){this._bodyCursor=document.body.style.cursor;document.body.style.cursor="move"},_restoreCursor:function(){document.body.style.cursor=this._bodyCursor},_simulateEvent:function(c){var a;switch(c.type){case"touchstart":a="mousedown";break;case"touchmove":a="mousemove";break;case"touchend":a="mouseup"}var b=document.createEvent("MouseEvent");b.initMouseEvent(a,true,true,window,1,c.screenX,c.screenY,c.clientX,c.clientY,false,false,false,false,0,null);c.target.dispatchEvent(b)}});L.Transition=L.Class.extend({includes:L.Mixin.Events,statics:{CUSTOM_PROPS_SETTERS:{position:L.DomUtil.setPosition},implemented:function(){return L.Transition.NATIVE||L.Transition.TIMER}},options:{easing:"ease",duration:0.5},_setProperty:function(c,b){var a=L.Transition.CUSTOM_PROPS_SETTERS;if(c in a){a[c](this._el,b)}else{this._el.style[c]=b}}});L.Transition=L.Transition.extend({statics:(function(){var b=L.DomUtil.TRANSITION,a=(b=="webkitTransition"||b=="OTransition"?b+"End":"transitionend");return{NATIVE:!!b,TRANSITION:b,PROPERTY:b+"Property",DURATION:b+"Duration",EASING:b+"TimingFunction",END:a,CUSTOM_PROPS_PROPERTIES:{position:L.Browser.webkit?L.DomUtil.TRANSFORM:"top, left"}}})(),options:{fakeStepInterval:100},initialize:function(b,a){this._el=b;L.Util.setOptions(this,a);L.DomEvent.addListener(b,L.Transition.END,this._onTransitionEnd,this);this._onFakeStep=L.Util.bind(this._onFakeStep,this)},run:function(b){var d,c=[],a=L.Transition.CUSTOM_PROPS_PROPERTIES;for(d in b){if(b.hasOwnProperty(d)){d=a[d]?a[d]:d;d=d.replace(/([A-Z])/g,function(f){return"-"+f.toLowerCase()});c.push(d)}}this._el.style[L.Transition.DURATION]=this.options.duration+"s";this._el.style[L.Transition.EASING]=this.options.easing;this._el.style[L.Transition.PROPERTY]=c.join(", ");for(d in b){if(b.hasOwnProperty(d)){this._setProperty(d,b[d])}}this._inProgress=true;this.fire("start");if(L.Transition.NATIVE){this._timer=setInterval(this._onFakeStep,this.options.fakeStepInterval)}else{this._onTransitionEnd()}},_onFakeStep:function(){this.fire("step")},_onTransitionEnd:function(){if(this._inProgress){this._inProgress=false;clearInterval(this._timer);this._el.style[L.Transition.PROPERTY]="none";this.fire("step");this.fire("end")}}});L.Transition=L.Transition.NATIVE?L.Transition:L.Transition.extend({statics:{getTime:Date.now||function(){return +new Date()},TIMER:true,EASINGS:{ease:[0.25,0.1,0.25,1],linear:[0,0,1,1],"ease-in":[0.42,0,1,1],"ease-out":[0,0,0.58,1],"ease-in-out":[0.42,0,0.58,1]},CUSTOM_PROPS_GETTERS:{position:L.DomUtil.getPosition},UNIT_RE:/^[\d\.]+(\D*)$/},options:{fps:50},initialize:function(b,a){this._el=b;L.Util.extend(this.options,a);var c=L.Transition.EASINGS[this.options.easing]||L.Transition.EASINGS.ease;this._p1=new L.Point(0,0);this._p2=new L.Point(c[0],c[1]);this._p3=new L.Point(c[2],c[3]);this._p4=new L.Point(1,1);this._step=L.Util.bind(this._step,this);this._interval=Math.round(1000/this.options.fps)},run:function(c){this._props={};var b=L.Transition.CUSTOM_PROPS_GETTERS,a=L.Transition.UNIT_RE;this.fire("start");for(var g in c){if(c.hasOwnProperty(g)){var f={};if(g in b){f.from=b[g](this._el)}else{var d=this._el.style[g].match(a);f.from=parseFloat(d[0]);f.unit=d[1]}f.to=c[g];this._props[g]=f}}clearInterval(this._timer);this._timer=setInterval(this._step,this._interval);this._startTime=L.Transition.getTime()},_step:function(){var c=L.Transition.getTime(),a=c-this._startTime,b=this.options.duration*1000;if(a<b){this._runFrame(this._cubicBezier(a/b))}else{this._runFrame(1);this._complete()}},_runFrame:function(b){var a=L.Transition.CUSTOM_PROPS_SETTERS,f,d,c;for(f in this._props){if(this._props.hasOwnProperty(f)){d=this._props[f];if(f in a){c=d.to.subtract(d.from).multiplyBy(b).add(d.from);a[f](this._el,c)}else{this._el.style[f]=((d.to-d.from)*b+d.from)+d.unit}}}this.fire("step")},_complete:function(){clearInterval(this._timer);this.fire("end")},_cubicBezier:function(o){var k=Math.pow(1-o,3),h=3*Math.pow(1-o,2)*o,g=3*(1-o)*Math.pow(o,2),f=Math.pow(o,3),n=this._p1.multiplyBy(k),m=this._p2.multiplyBy(h),l=this._p3.multiplyBy(g),j=this._p4.multiplyBy(f);return n.add(m).add(l).add(j).y}});L.LatLng=function(b,a,c){if(c!==true){b=Math.max(Math.min(b,90),-90);a=(a+180)%360+(a<-180?180:-180)}this.lat=b;this.lng=a};L.Util.extend(L.LatLng,{DEG_TO_RAD:Math.PI/180,RAD_TO_DEG:180/Math.PI,MAX_MARGIN:1e-9});L.LatLng.prototype={equals:function(b){if(!(b instanceof L.LatLng)){return false}var a=Math.max(Math.abs(this.lat-b.lat),Math.abs(this.lng-b.lng));return a<=L.LatLng.MAX_MARGIN},toString:function(){return"LatLng("+L.Util.formatNum(this.lat)+", "+L.Util.formatNum(this.lng)+")"}};L.LatLngBounds=L.Class.extend({initialize:function(f,c){if(!f){return}var b=(f instanceof Array?f:[f,c]);for(var d=0,a=b.length;d<a;d++){this.extend(b[d])}},extend:function(a){if(!this._southWest&&!this._northEast){this._southWest=new L.LatLng(a.lat,a.lng);this._northEast=new L.LatLng(a.lat,a.lng)}else{this._southWest.lat=Math.min(a.lat,this._southWest.lat);this._southWest.lng=Math.min(a.lng,this._southWest.lng);this._northEast.lat=Math.max(a.lat,this._northEast.lat);this._northEast.lng=Math.max(a.lng,this._northEast.lng)}},getCenter:function(){return new L.LatLng((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new L.LatLng(this._northEast.lat,this._southWest.lng)},getSouthEast:function(){return new L.LatLng(this._southWest.lat,this._northEast.lng)},contains:function(f){var a=this._southWest,d=this._northEast,b,c;if(f instanceof L.LatLngBounds){b=f.getSouthWest();c=f.getNorthEast()}else{b=c=f}return(b.lat>=a.lat)&&(c.lat<=d.lat)&&(b.lng>=a.lng)&&(c.lng<=d.lng)}});L.Projection={};L.Projection.SphericalMercator={MAX_LATITUDE:85.0511287798,project:function(h){var f=L.LatLng.DEG_TO_RAD,b=this.MAX_LATITUDE,c=Math.max(Math.min(b,h.lat),-b),a=h.lng*f,g=c*f;g=Math.log(Math.tan(Math.PI/4+g/2));return new L.Point(a,g)},unproject:function(a,g){var f=L.LatLng.RAD_TO_DEG,b=a.x*f,c=(2*Math.atan(Math.exp(a.y))-Math.PI/2)*f;return new L.LatLng(c,b,g)}};L.Projection.LonLat={project:function(a){return new L.Point(a.lng,a.lat)},unproject:function(a,b){return new L.LatLng(a.y,a.x,b)}};L.Projection.Mercator={MAX_LATITUDE:85.0840591556,R_MINOR:6356752.3142,R_MAJOR:6378137,project:function(c){var j=L.LatLng.DEG_TO_RAD,m=this.MAX_LATITUDE,k=Math.max(Math.min(m,c.lat),-m),a=this.R_MAJOR,n=c.lng*j*a,l=k*j,g=this.R_MINOR/a,f=Math.sqrt(1-g*g),b=f*Math.sin(l);b=Math.pow((1-b)/(1+b),f*0.5);var h=Math.tan(0.5*((Math.PI*0.5)-l))/b;l=-a*Math.log(h);return new L.Point(n,l)},unproject:function(p,g){var m=L.LatLng.RAD_TO_DEG,a=this.R_MAJOR,o=p.x*m/a,j=this.R_MINOR/a,c=Math.sqrt(1-(j*j)),n=Math.exp(-p.y/a),l=Math.PI/2-2*Math.atan(n),f=15,q=1e-7,h=f,k=0.1,b;while((Math.abs(k)>q)&&(--h>0)){b=c*Math.sin(l);k=Math.PI/2-2*Math.atan(n*Math.pow((1-b)/(1+b),0.5*c))-l;l+=k}return new L.LatLng(l*m,o,g)}};L.CRS={latLngToPoint:function(c,b){var a=this.projection.project(c);return this.transformation._transform(a,b)},pointToLatLng:function(a,d,c){var b=this.transformation.untransform(a,d);return this.projection.unproject(b,c)},project:function(a){return this.projection.project(a)}};L.CRS.EPSG3857=L.Util.extend({},L.CRS,{code:"EPSG:3857",projection:L.Projection.SphericalMercator,transformation:new L.Transformation(0.5/Math.PI,0.5,-0.5/Math.PI,0.5),project:function(c){var b=this.projection.project(c),a=6378137;return b.multiplyBy(a)}});L.CRS.EPSG900913=L.Util.extend({},L.CRS.EPSG3857,{code:"EPSG:900913"});L.CRS.EPSG4326=L.Util.extend({},L.CRS,{code:"EPSG:4326",projection:L.Projection.LonLat,transformation:new L.Transformation(1/360,0.5,-1/360,0.5)});L.CRS.EPSG3395=L.Util.extend({},L.CRS,{code:"EPSG:3395",projection:L.Projection.Mercator,transformation:(function(){var a=L.Projection.Mercator,c=a.R_MAJOR,b=a.R_MINOR;return new L.Transformation(0.5/(Math.PI*c),0.5,-0.5/(Math.PI*b),0.5)})()});L.LayerGroup=L.Class.extend({initialize:function(c){this._layers={};if(c){for(var b=0,a=c.length;b<a;b++){this.addLayer(c[b])}}},addLayer:function(a){var b=L.Util.stamp(a);this._layers[b]=a;if(this._map){this._map.addLayer(a)}return this},removeLayer:function(a){var b=L.Util.stamp(a);delete this._layers[b];if(this._map){this._map.removeLayer(a)}return this},clearLayers:function(){this._iterateLayers(this.removeLayer,this);return this},onAdd:function(a){this._map=a;this._iterateLayers(a.addLayer,a)},onRemove:function(a){this._iterateLayers(a.removeLayer,a);delete this._map},_iterateLayers:function(c,b){for(var a in this._layers){if(this._layers.hasOwnProperty(a)){c.call(b,this._layers[a])}}}});L.FeatureGroup=L.LayerGroup.extend({includes:L.Mixin.Events,addLayer:function(a){this._initEvents(a);L.LayerGroup.prototype.addLayer.call(this,a);if(this._popupContent&&a.bindPopup){a.bindPopup(this._popupContent)}},bindPopup:function(b){this._popupContent=b;for(var a in this._layers){if(this._layers.hasOwnProperty(a)&&this._layers[a].bindPopup){this._layers[a].bindPopup(b)}}},_events:["click","dblclick","mouseover","mouseout"],_initEvents:function(c){for(var b=0,a=this._events.length;b<a;b++){c.on(this._events[b],this._propagateEvent,this)}},_propagateEvent:function(a){a.layer=a.target;a.target=this;this.fire(a.type,a)}});L.TileLayer=L.Class.extend({includes:L.Mixin.Events,options:{minZoom:0,maxZoom:18,tileSize:256,subdomains:"abc",errorTileUrl:"",attribution:"",opacity:1,scheme:"xyz",noWrap:false,unloadInvisibleTiles:L.Browser.mobileWebkit,updateWhenIdle:L.Browser.mobileWebkit},initialize:function(b,a){L.Util.setOptions(this,a);this._url=b;if(typeof this.options.subdomains=="string"){this.options.subdomains=this.options.subdomains.split("")}},onAdd:function(a){this._map=a;this._initContainer();this._createTileProto();a.on("viewreset",this._reset,this);if(this.options.updateWhenIdle){a.on("moveend",this._update,this)}else{this._limitedUpdate=L.Util.limitExecByInterval(this._update,100,this);a.on("move",this._limitedUpdate,this)}this._reset();this._update()},onRemove:function(a){this._map.getPanes().tilePane.removeChild(this._container);this._container=null;this._map.off("viewreset",this._reset,this);if(this.options.updateWhenIdle){this._map.off("moveend",this._update,this)}else{this._map.off("move",this._limitedUpdate,this)}},getAttribution:function(){return this.options.attribution},setOpacity:function(a){this.options.opacity=a;this._setOpacity(a);if(L.Browser.webkit){for(i in this._tiles){this._tiles[i].style.webkitTransform+=" translate(0,0)"}}},_setOpacity:function(a){if(a<1){L.DomUtil.setOpacity(this._container,a)}},_initContainer:function(){var a=this._map.getPanes().tilePane;if(!this._container||a.empty){this._container=L.DomUtil.create("div","leaflet-layer",a);this._setOpacity(this.options.opacity)}},_reset:function(){this._tiles={};this._initContainer();this._container.innerHTML=""},_update:function(){var b=this._map.getPixelBounds(),c=this.options.tileSize;var a=new L.Point(Math.floor(b.min.x/c),Math.floor(b.min.y/c)),f=new L.Point(Math.floor(b.max.x/c),Math.floor(b.max.y/c)),d=new L.Bounds(a,f);this._addTilesFromCenterOut(d);if(this.options.unloadInvisibleTiles){this._removeOtherTiles(d)}},_addTilesFromCenterOut:function(h){var c=[],b=h.getCenter();for(var f=h.min.y;f<=h.max.y;f++){for(var g=h.min.x;g<=h.max.x;g++){if((g+":"+f) in this._tiles){continue}c.push(new L.Point(g,f))}}c.sort(function(k,j){return k.distanceTo(b)-j.distanceTo(b)});this._tilesToLoad=c.length;for(var d=0,a=this._tilesToLoad;d<a;d++){this._addTile(c[d])}},_removeOtherTiles:function(d){var c,a,f,b;for(b in this._tiles){if(this._tiles.hasOwnProperty(b)){c=b.split(":");a=parseInt(c[0],10);f=parseInt(c[1],10);if(a<d.min.x||a>d.max.x||f<d.min.y||f>d.max.y){this._tiles[b].src="";if(this._tiles[b].parentNode==this._container){this._container.removeChild(this._tiles[b])}delete this._tiles[b]}}}},_addTile:function(c){var b=this._getTilePos(c),g=this._map.getZoom(),a=c.x+":"+c.y;var f=(1<<g);if(!this.options.noWrap){c.x=((c.x%f)+f)%f}if(c.y<0||c.y>=f){return}var d=this._createTile();L.DomUtil.setPosition(d,b);this._tiles[a]=d;if(this.options.scheme=="tms"){c.y=f-c.y-1}this._loadTile(d,c,g);this._container.appendChild(d)},_getTilePos:function(b){var a=this._map.getPixelOrigin(),c=this.options.tileSize;return b.multiplyBy(c).subtract(a)},getTileUrl:function(c,d){var a=this.options.subdomains,b=this.options.subdomains[(c.x+c.y)%a.length];return this._url.replace("{s}",b).replace("{z}",d).replace("{x}",c.x).replace("{y}",c.y)},_createTileProto:function(){this._tileImg=L.DomUtil.create("img","leaflet-tile");this._tileImg.galleryimg="no";var a=this.options.tileSize;this._tileImg.style.width=a+"px";this._tileImg.style.height=a+"px"},_createTile:function(){var a=this._tileImg.cloneNode(false);a.onselectstart=a.onmousemove=L.Util.falseFn;return a},_loadTile:function(c,a,b){c._layer=this;c.onload=this._tileOnLoad;c.onerror=this._tileOnError;c.src=this.getTileUrl(a,b)},_tileOnLoad:function(b){var a=this._layer;this.className+=" leaflet-tile-loaded";a.fire("tileload",{tile:this,url:this.src});a._tilesToLoad--;if(!a._tilesToLoad){a.fire("load")}},_tileOnError:function(c){var a=this._layer;a.fire("tileerror",{tile:this,url:this.src});var b=a.options.errorTileUrl;if(b){this.src=b}}});L.TileLayer.WMS=L.TileLayer.extend({defaultWmsParams:{service:"WMS",request:"GetMap",version:"1.1.1",layers:"",styles:"",format:"image/jpeg",transparent:false},initialize:function(b,a){this._url=b;this.wmsParams=L.Util.extend({},this.defaultWmsParams);this.wmsParams.width=this.wmsParams.height=this.options.tileSize;for(var c in a){if(!this.options.hasOwnProperty(c)){this.wmsParams[c]=a[c]}}L.Util.setOptions(this,a)},onAdd:function(a){var b=(parseFloat(this.wmsParams.version)>=1.3?"crs":"srs");this.wmsParams[b]=a.options.crs.code;L.TileLayer.prototype.onAdd.call(this,a)},getTileUrl:function(a,l){var k=this.options.tileSize,j=a.multiplyBy(k),g=j.add(new L.Point(k,k)),b=this._map.unproject(j,this._zoom,true),f=this._map.unproject(g,this._zoom,true),c=this._map.options.crs.project(b),d=this._map.options.crs.project(f),h=[c.x,d.y,d.x,c.y].join(",");return this._url+L.Util.getParamString(this.wmsParams)+"&bbox="+h}});L.TileLayer.Canvas=L.TileLayer.extend({options:{async:false},initialize:function(a){L.Util.setOptions(this,a)},_createTileProto:function(){this._canvasProto=L.DomUtil.create("canvas","leaflet-tile");var a=this.options.tileSize;this._canvasProto.width=a;this._canvasProto.height=a},_createTile:function(){var a=this._canvasProto.cloneNode(false);a.onselectstart=a.onmousemove=L.Util.falseFn;return a},_loadTile:function(c,a,b){c._layer=this;this.drawTile(c,a,b);if(!this.options.async){this.tileDrawn()}},drawTile:function(c,a,b){},tileDrawn:function(a){this._tileOnLoad.call(a)}});L.ImageOverlay=L.Class.extend({includes:L.Mixin.Events,initialize:function(a,b){this._url=a;this._bounds=b},onAdd:function(a){this._map=a;if(!this._image){this._initImage()}a.getPanes().overlayPane.appendChild(this._image);a.on("viewreset",this._reset,this);this._reset()},onRemove:function(a){a.getPanes().overlayPane.removeChild(this._image);a.off("viewreset",this._reset,this)},_initImage:function(){this._image=L.DomUtil.create("img","leaflet-image-layer");this._image.style.visibility="hidden";L.Util.extend(this._image,{galleryimg:"no",onselectstart:L.Util.falseFn,onmousemove:L.Util.falseFn,onload:this._onImageLoad,src:this._url})},_reset:function(){var c=this._map.latLngToLayerPoint(this._bounds.getNorthWest()),b=this._map.latLngToLayerPoint(this._bounds.getSouthEast()),a=b.subtract(c);L.DomUtil.setPosition(this._image,c);this._image.style.width=a.x+"px";this._image.style.height=a.y+"px"},_onImageLoad:function(){this.style.visibility=""}});L.Popup=L.Class.extend({includes:L.Mixin.Events,options:{maxWidth:300,autoPan:true,closeButton:true,offset:new L.Point(0,2),autoPanPadding:new L.Point(5,5)},initialize:function(a){L.Util.setOptions(this,a)},onAdd:function(a){this._map=a;if(!this._container){this._initLayout()}this._updateContent();this._container.style.opacity="0";this._map._panes.popupPane.appendChild(this._container);this._map.on("viewreset",this._updatePosition,this);if(this._map.options.closePopupOnClick){this._map.on("preclick",this._close,this)}this._update();this._container.style.opacity="1";this._opened=true},onRemove:function(a){a._panes.popupPane.removeChild(this._container);a.off("viewreset",this._updatePosition,this);a.off("click",this._close,this);this._container.style.opacity="0";this._opened=false},setLatLng:function(a){this._latlng=a;if(this._opened){this._update()}return this},setContent:function(a){this._content=a;if(this._opened){this._update()}return this},_close:function(){if(this._opened){this._map.removeLayer(this)}},_initLayout:function(){this._container=L.DomUtil.create("div","leaflet-popup");this._closeButton=L.DomUtil.create("a","leaflet-popup-close-button",this._container);this._closeButton.href="#close";this._closeButton.onclick=L.Util.bind(this._onCloseButtonClick,this);this._wrapper=L.DomUtil.create("div","leaflet-popup-content-wrapper",this._container);L.DomEvent.disableClickPropagation(this._wrapper);this._contentNode=L.DomUtil.create("div","leaflet-popup-content",this._wrapper);this._tipContainer=L.DomUtil.create("div","leaflet-popup-tip-container",this._container);this._tip=L.DomUtil.create("div","leaflet-popup-tip",this._tipContainer)},_update:function(){this._container.style.visibility="hidden";this._updateContent();this._updateLayout();this._updatePosition();this._container.style.visibility="";this._adjustPan()},_updateContent:function(){if(!this._content){return}if(typeof this._content=="string"){this._contentNode.innerHTML=this._content}else{this._contentNode.innerHTML="";this._contentNode.appendChild(this._content)}},_updateLayout:function(){this._container.style.width="";this._container.style.whiteSpace="nowrap";var a=this._container.offsetWidth;this._container.style.width=(a>this.options.maxWidth?this.options.maxWidth:a)+"px";this._container.style.whiteSpace="";this._containerWidth=this._container.offsetWidth},_updatePosition:function(){var a=this._map.latLngToLayerPoint(this._latlng);this._containerBottom=-a.y-this.options.offset.y;this._containerLeft=a.x-Math.round(this._containerWidth/2)+this.options.offset.x;this._container.style.bottom=this._containerBottom+"px";this._container.style.left=this._containerLeft+"px"},_adjustPan:function(){if(!this.options.autoPan){return}var c=this._container.offsetHeight,a=new L.Point(this._containerLeft,-c-this._containerBottom),g=this._map.layerPointToContainerPoint(a),f=new L.Point(0,0),d=this.options.autoPanPadding,b=this._map.getSize();if(g.x<0){f.x=g.x-d.x}if(g.x+this._containerWidth>b.x){f.x=g.x+this._containerWidth-b.x+d.x}if(g.y<0){f.y=g.y-d.y}if(g.y+c>b.y){f.y=g.y+c-b.y+d.y}if(f.x||f.y){this._map.panBy(f)}},_onCloseButtonClick:function(a){this._close();L.DomEvent.stop(a)}});L.Icon=L.Class.extend({iconUrl:L.ROOT_URL+"images/marker.png",shadowUrl:L.ROOT_URL+"images/marker-shadow.png",iconSize:new L.Point(25,41),shadowSize:new L.Point(41,41),iconAnchor:new L.Point(13,41),popupAnchor:new L.Point(0,-33),initialize:function(a){if(a){this.iconUrl=a}},createIcon:function(){return this._createIcon("icon")},createShadow:function(){return this._createIcon("shadow")},_createIcon:function(b){var c=this[b+"Size"],d=this[b+"Url"],a=this._createImg(d);if(!d){return null}a.className="leaflet-marker-"+b;a.style.marginLeft=(-this.iconAnchor.x)+"px";a.style.marginTop=(-this.iconAnchor.y)+"px";if(c){a.style.width=c.x+"px";a.style.height=c.y+"px"}return a},_createImg:function(b){var a;if(!L.Browser.ie6){a=document.createElement("img");a.src=b}else{a=document.createElement("div");a.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+b+'")'}return a}});L.Marker=L.Class.extend({includes:L.Mixin.Events,options:{icon:new L.Icon(),title:"",clickable:true,draggable:false},initialize:function(b,a){L.Util.setOptions(this,a);this._latlng=b},onAdd:function(a){this._map=a;this._initIcon();a.on("viewreset",this._reset,this);this._reset()},onRemove:function(a){this._removeIcon();a.off("viewreset",this._reset,this)},getLatLng:function(){return this._latlng},setLatLng:function(a){this._latlng=a;this._reset()},setIcon:function(a){this._removeIcon();this._icon=this._shadow=null;this.options.icon=a;this._initIcon()},_initIcon:function(){if(!this._icon){this._icon=this.options.icon.createIcon();if(this.options.title){this._icon.title=this.options.title}this._initInteraction()}if(!this._shadow){this._shadow=this.options.icon.createShadow()}this._map._panes.markerPane.appendChild(this._icon);if(this._shadow){this._map._panes.shadowPane.appendChild(this._shadow)}},_removeIcon:function(){this._map._panes.markerPane.removeChild(this._icon);if(this._shadow){this._map._panes.shadowPane.removeChild(this._shadow)}},_reset:function(){var a=this._map.latLngToLayerPoint(this._latlng).round();L.DomUtil.setPosition(this._icon,a);if(this._shadow){L.DomUtil.setPosition(this._shadow,a)}this._icon.style.zIndex=a.y},_initInteraction:function(){if(this.options.clickable){this._icon.className+=" leaflet-clickable";L.DomEvent.addListener(this._icon,"click",this._onMouseClick,this);var b=["dblclick","mousedown","mouseover","mouseout"];for(var a=0;a<b.length;a++){L.DomEvent.addListener(this._icon,b[a],this._fireMouseEvent,this)}}if(L.Handler.MarkerDrag){this.dragging=new L.Handler.MarkerDrag(this);if(this.options.draggable){this.dragging.enable()}}},_onMouseClick:function(a){L.DomEvent.stopPropagation(a);if(this.dragging&&this.dragging.moved()){return}this.fire(a.type)},_fireMouseEvent:function(a){this.fire(a.type);L.DomEvent.stopPropagation(a)}});L.Marker.include({openPopup:function(){this._popup.setLatLng(this._latlng);this._map.openPopup(this._popup);return this},closePopup:function(){if(this._popup){this._popup._close()}},bindPopup:function(b,a){a=L.Util.extend({offset:this.options.icon.popupAnchor},a);this._popup=new L.Popup(a);this._popup.setContent(b);this.on("click",this.openPopup,this);return this}});L.Path=L.Class.extend({includes:[L.Mixin.Events],statics:(function(){var a="http://www.w3.org/2000/svg",b="createElementNS";return{SVG_NS:a,SVG:!!(document[b]&&document[b](a,"svg").createSVGRect),CLIP_PADDING:0.5}})(),options:{stroke:true,color:"#0033ff",weight:5,opacity:0.5,fill:false,fillColor:null,fillOpacity:0.2,clickable:true,updateOnMoveEnd:false},initialize:function(a){L.Util.setOptions(this,a)},onAdd:function(a){this._map=a;this._initElements();this._initEvents();this.projectLatlngs();this._updatePath();a.on("viewreset",this.projectLatlngs,this);this._updateTrigger=this.options.updateOnMoveEnd?"moveend":"viewreset";a.on(this._updateTrigger,this._updatePath,this)},onRemove:function(a){a._pathRoot.removeChild(this._container);a.off("viewreset",this._projectLatlngs,this);a.off(this._updateTrigger,this._updatePath,this)},projectLatlngs:function(){},getPathString:function(){},setStyle:function(a){L.Util.setOptions(this,a);if(this._path){this._updateStyle()}},_initElements:function(){this._initRoot();this._initPath();this._initStyle()},_initRoot:function(){if(!this._map._pathRoot){this._map._pathRoot=this._createElement("svg");this._map._panes.overlayPane.appendChild(this._map._pathRoot);this._map.on("moveend",this._updateSvgViewport,this);this._updateSvgViewport()}},_updateSvgViewport:function(){this._updateViewport();var d=this._map._pathViewport,f=d.min,b=d.max,g=b.x-f.x,a=b.y-f.y,c=this._map._pathRoot,h=this._map._panes.overlayPane;if(L.Browser.mobileWebkit){h.removeChild(c)}L.DomUtil.setPosition(c,f);c.setAttribute("width",g);c.setAttribute("height",a);c.setAttribute("viewBox",[f.x,f.y,g,a].join(" "));if(L.Browser.mobileWebkit){h.appendChild(c)}},_updateViewport:function(){var f=L.Path.CLIP_PADDING,d=this._map.getSize(),b=L.DomUtil.getPosition(this._map._mapPane),c=b.multiplyBy(-1).subtract(d.multiplyBy(f)),a=c.add(d.multiplyBy(1+f*2));this._map._pathViewport=new L.Bounds(c,a)},_initPath:function(){this._container=this._createElement("g");this._path=this._createElement("path");this._container.appendChild(this._path);this._map._pathRoot.appendChild(this._container)},_initStyle:function(){if(this.options.stroke){this._path.setAttribute("stroke-linejoin","round");this._path.setAttribute("stroke-linecap","round")}if(this.options.fill){this._path.setAttribute("fill-rule","evenodd")}else{this._path.setAttribute("fill","none")}this._updateStyle()},_updateStyle:function(){if(this.options.stroke){this._path.setAttribute("stroke",this.options.color);this._path.setAttribute("stroke-opacity",this.options.opacity);this._path.setAttribute("stroke-width",this.options.weight)}if(this.options.fill){this._path.setAttribute("fill",this.options.fillColor||this.options.color);this._path.setAttribute("fill-opacity",this.options.fillOpacity)}},_updatePath:function(){var a=this.getPathString();if(!a){a="M0 0"}this._path.setAttribute("d",a)},_createElement:function(a){return document.createElementNS(L.Path.SVG_NS,a)},_initEvents:function(){if(this.options.clickable){if(!L.Path.VML){this._path.setAttribute("class","leaflet-clickable")}L.DomEvent.addListener(this._container,"click",this._onMouseClick,this);var b=["dblclick","mousedown","mouseover","mouseout"];for(var a=0;a<b.length;a++){L.DomEvent.addListener(this._container,b[a],this._fireMouseEvent,this)}}},_onMouseClick:function(a){if(this._map.dragging&&this._map.dragging.moved()){return}this._fireMouseEvent(a)},_fireMouseEvent:function(a){if(!this.hasEventListeners(a.type)){return}this.fire(a.type,{latlng:this._map.mouseEventToLatLng(a),layerPoint:this._map.mouseEventToLayerPoint(a)});L.DomEvent.stopPropagation(a)},_redraw:function(){this.projectLatlngs();this._updatePath()}});L.Path.VML=(function(){var b=document.createElement("div"),a;b.innerHTML='<v:shape adj="1"/>';a=b.firstChild;a.style.behavior="url(#default#VML)";return(a&&(typeof a.adj=="object"))})();L.Path=L.Path.SVG||!L.Path.VML?L.Path:L.Path.extend({statics:{CLIP_PADDING:0.02},_createElement:(function(){try{document.namespaces.add("lvml","urn:schemas-microsoft-com:vml");return function(b){return document.createElement("<lvml:"+b+' class="lvml">')}}catch(a){return function(b){return document.createElement("<"+b+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}})(),_initRoot:function(){if(!this._map._pathRoot){this._map._pathRoot=document.createElement("div");this._map._pathRoot.className="leaflet-vml-container";this._map._panes.overlayPane.appendChild(this._map._pathRoot);this._map.on("moveend",this._updateViewport,this);this._updateViewport()}},_initPath:function(){this._container=this._createElement("shape");this._container.className+=" leaflet-vml-shape"+(this.options.clickable?" leaflet-clickable":"");this._container.coordsize="1 1";this._path=this._createElement("path");this._container.appendChild(this._path);this._map._pathRoot.appendChild(this._container)},_initStyle:function(){if(this.options.stroke){this._stroke=this._createElement("stroke");this._stroke.endcap="round";this._container.appendChild(this._stroke)}else{this._container.stroked=false}if(this.options.fill){this._container.filled=true;this._fill=this._createElement("fill");this._container.appendChild(this._fill)}else{this._container.filled=false}this._updateStyle()},_updateStyle:function(){if(this.options.stroke){this._stroke.weight=this.options.weight+"px";this._stroke.color=this.options.color;this._stroke.opacity=this.options.opacity}if(this.options.fill){this._fill.color=this.options.fillColor||this.options.color;this._fill.opacity=this.options.fillOpacity}},_updatePath:function(){this._container.style.display="none";this._path.v=this.getPathString()+" ";this._container.style.display=""}});L.Path.include({bindPopup:function(b,a){if(!this._popup||this._popup.options!==a){this._popup=new L.Popup(a)}this._popup.setContent(b);if(!this._openPopupAdded){this.on("click",this._openPopup,this);this._openPopupAdded=true}return this},_openPopup:function(a){this._popup.setLatLng(a.latlng);this._map.openPopup(this._popup)}});L.Polyline=L.Path.extend({initialize:function(a,b){L.Path.prototype.initialize.call(this,b);this._latlngs=a},options:{smoothFactor:1,noClip:false,updateOnMoveEnd:true},projectLatlngs:function(){this._originalPoints=[];for(var b=0,a=this._latlngs.length;b<a;b++){this._originalPoints[b]=this._map.latLngToLayerPoint(this._latlngs[b])}},getPathString:function(){for(var b=0,a=this._parts.length,c="";b<a;b++){c+=this._getPathPartStr(this._parts[b])}return c},getLatLngs:function(){return this._latlngs},setLatLngs:function(a){this._latlngs=a;this._redraw();return this},addLatLng:function(a){this._latlngs.push(a);this._redraw();return this},spliceLatLngs:function(a,b){var c=[].splice.apply(this._latlngs,arguments);this._redraw();return c},_getPathPartStr:function(d){var b=L.Path.VML;for(var c=0,a=d.length,g="",f;c<a;c++){f=d[c];if(b){f._round()}g+=(c?"L":"M")+f.x+" "+f.y}return g},_clipPoints:function(){var f=this._originalPoints,a=f.length,d,c,g;if(this.options.noClip){this._parts=[f];return}this._parts=[];var h=this._parts,b=this._map._pathViewport,j=L.LineUtil;for(d=0,c=0;d<a-1;d++){g=j.clipSegment(f[d],f[d+1],b,d);if(!g){continue}h[c]=h[c]||[];h[c].push(g[0]);if((g[1]!=f[d+1])||(d==a-2)){h[c].push(g[1]);c++}}},_simplifyPoints:function(){var c=this._parts,d=L.LineUtil;for(var b=0,a=c.length;b<a;b++){c[b]=d.simplify(c[b],this.options.smoothFactor)}},_updatePath:function(){this._clipPoints();this._simplifyPoints();L.Path.prototype._updatePath.call(this)}});L.Polygon=L.Polyline.extend({options:{fill:true},initialize:function(a,b){L.Polyline.prototype.initialize.call(this,a,b);if(a[0] instanceof Array){this._latlngs=a[0];this._holes=a.slice(1)}},projectLatlngs:function(){L.Polyline.prototype.projectLatlngs.call(this);this._holePoints=[];if(!this._holes){return}for(var d=0,a=this._holes.length,f;d<a;d++){this._holePoints[d]=[];for(var c=0,b=this._holes[d].length;c<b;c++){this._holePoints[d][c]=this._map.latLngToLayerPoint(this._holes[d][c])}}},_clipPoints:function(){var d=this._originalPoints,f=[];this._parts=[d].concat(this._holePoints);if(this.options.noClip){return}for(var c=0,b=this._parts.length;c<b;c++){var a=L.PolyUtil.clipPolygon(this._parts[c],this._map._pathViewport);if(!a.length){continue}f.push(a)}this._parts=f},_getPathPartStr:function(a){var b=L.Polyline.prototype._getPathPartStr.call(this,a);return b+(L.Path.SVG?"z":"x")}});(function(){function a(b){return L.FeatureGroup.extend({initialize:function(d,f){this._layers={};for(var g=0,c=d.length;g<c;g++){this.addLayer(new b(d[g],f))}},setStyle:function(d){for(var c in this._layers){if(this._layers.hasOwnProperty(c)&&this._layers[c].setStyle){this._layers[c].setStyle(d)}}}})}L.MultiPolyline=a(L.Polyline);L.MultiPolygon=a(L.Polygon)}());L.Circle=L.Path.extend({initialize:function(c,a,b){L.Path.prototype.initialize.call(this,b);this._latlng=c;this._mRadius=a},options:{fill:true},setLatLng:function(a){this._latlng=a;this._redraw();return this},setRadius:function(a){this._mRadius=a;this._redraw();return this},projectLatlngs:function(){var a=40075017,b=this._map.options.scale(this._map._zoom);this._point=this._map.latLngToLayerPoint(this._latlng);this._radius=(this._mRadius/a)*b},getPathString:function(){var b=this._point,a=this._radius;if(L.Path.SVG){return"M"+b.x+","+(b.y-a)+"A"+a+","+a+",0,1,1,"+(b.x-0.1)+","+(b.y-a)+" z"}else{b._round();a=Math.round(a);return"AL "+b.x+","+b.y+" "+a+","+a+" 0,"+(65535*360)}}});L.CircleMarker=L.Circle.extend({options:{radius:10,weight:2},initialize:function(b,a){L.Circle.prototype.initialize.call(this,b,null,a);this._radius=this.options.radius},projectLatlngs:function(){this._point=this._map.latLngToLayerPoint(this._latlng)},setRadius:function(a){this._radius=a;this._redraw();return this}});L.GeoJSON=L.LayerGroup.extend({includes:L.Mixin.Events,initialize:function(b,a){L.Util.setOptions(this,a);this._geojson=b;this._layers={};if(b){this.addGeoJSON(b)}},addGeoJSON:function(b){if(b.features){for(var d=0,a=b.features.length;d<a;d++){this.addGeoJSON(b.features[d])}return}var f=(b.type=="Feature"),g=(f?b.geometry:b),c=L.GeoJSON.geometryToLayer(g,this.options.pointToLayer);this.fire("featureparse",{layer:c,properties:b.properties,geometryType:g.type,bbox:b.bbox,id:b.id});this.addLayer(c)}});L.Util.extend(L.GeoJSON,{geometryToLayer:function(j,a){var k=j.coordinates,c,b,f,h,g,d=[];switch(j.type){case"Point":c=this.coordsToLatLng(k);return a?a(c):new L.Marker(c);case"MultiPoint":for(f=0,h=k.length;f<h;f++){c=this.coordsToLatLng(k[f]);g=a?a(c):new L.Marker(c);d.push(g)}return new L.FeatureGroup(d);case"LineString":b=this.coordsToLatLngs(k);return new L.Polyline(b);case"Polygon":b=this.coordsToLatLngs(k,1);return new L.Polygon(b);case"MultiLineString":b=this.coordsToLatLngs(k,1);return new L.MultiPolyline(b);case"MultiPolygon":b=this.coordsToLatLngs(k,2);return new L.MultiPolygon(b);case"GeometryCollection":for(f=0,h=j.geometries.length;f<h;f++){g=this.geometryToLayer(j.geometries[f]);d.push(g)}return new L.FeatureGroup(d);default:throw new Error("Invalid GeoJSON object.")}},coordsToLatLng:function(c,b){var d=c[b?0:1],a=c[b?1:0];return new L.LatLng(d,a)},coordsToLatLngs:function(g,f,c){var h,b=[],d,a=g.length;for(d=0;d<a;d++){h=f?this.coordsToLatLngs(g[d],f-1,c):this.coordsToLatLng(g[d],c);b.push(h)}return b}});L.Handler=L.Class.extend({initialize:function(a){this._map=a},enabled:function(){return !!this._enabled}});L.Handler.MapDrag=L.Handler.extend({enable:function(){if(this._enabled){return}if(!this._draggable){this._draggable=new L.Draggable(this._map._mapPane,this._map._container);this._draggable.on("dragstart",this._onDragStart,this);this._draggable.on("drag",this._onDrag,this);this._draggable.on("dragend",this._onDragEnd,this)}this._draggable.enable();this._enabled=true},disable:function(){if(!this._enabled){return}this._draggable.disable();this._enabled=false},moved:function(){return this._draggable._moved},_onDragStart:function(){this._map.fire("movestart");this._map.fire("dragstart")},_onDrag:function(){this._map.fire("move");this._map.fire("drag")},_onDragEnd:function(){this._map.fire("moveend");this._map.fire("dragend")}});L.Handler.TouchZoom=L.Handler.extend({enable:function(){if(!L.Browser.mobileWebkit||this._enabled){return}L.DomEvent.addListener(this._map._container,"touchstart",this._onTouchStart,this);this._enabled=true},disable:function(){if(!this._enabled){return}L.DomEvent.removeListener(this._map._container,"touchstart",this._onTouchStart,this);this._enabled=false},_onTouchStart:function(c){if(!c.touches||c.touches.length!=2||this._map._animatingZoom){return}var d=this._map.mouseEventToLayerPoint(c.touches[0]),b=this._map.mouseEventToLayerPoint(c.touches[1]),a=this._map.containerPointToLayerPoint(this._map.getSize().divideBy(2));this._startCenter=d.add(b).divideBy(2,true);this._startDist=d.distanceTo(b);this._moved=false;this._zooming=true;this._centerOffset=a.subtract(this._startCenter);L.DomEvent.addListener(document,"touchmove",this._onTouchMove,this);L.DomEvent.addListener(document,"touchend",this._onTouchEnd,this);L.DomEvent.preventDefault(c)},_onTouchMove:function(b){if(!b.touches||b.touches.length!=2){return}if(!this._moved){this._map._mapPane.className+=" leaflet-zoom-anim";this._map._prepareTileBg();this._moved=true}var c=this._map.mouseEventToLayerPoint(b.touches[0]),a=this._map.mouseEventToLayerPoint(b.touches[1]);this._scale=c.distanceTo(a)/this._startDist;this._delta=c.add(a).divideBy(2,true).subtract(this._startCenter);this._map._tileBg.style.webkitTransform=[L.DomUtil.getTranslateString(this._delta),L.DomUtil.getScaleString(this._scale,this._startCenter)].join(" ");L.DomEvent.preventDefault(b)},_onTouchEnd:function(g){if(!this._moved||!this._zooming){return}this._zooming=false;var l=this._map.getZoom(),c=Math.log(this._scale)/Math.LN2,f=(c>0?Math.ceil(c):Math.floor(c)),k=this._map._limitZoom(l+f),b=k-l,j=this._centerOffset.subtract(this._delta).divideBy(this._scale),h=this._map.getPixelOrigin().add(this._startCenter).add(j),a=this._map.unproject(h);L.DomEvent.removeListener(document,"touchmove",this._onTouchMove);L.DomEvent.removeListener(document,"touchend",this._onTouchEnd);var d=Math.pow(2,b);this._map._runAnimation(a,k,d/this._scale,this._startCenter.add(j))}});L.Handler.ScrollWheelZoom=L.Handler.extend({enable:function(){if(this._enabled){return}L.DomEvent.addListener(this._map._container,"mousewheel",this._onWheelScroll,this);this._delta=0;this._enabled=true},disable:function(){if(!this._enabled){return}L.DomEvent.removeListener(this._map._container,"mousewheel",this._onWheelScroll);this._enabled=false},_onWheelScroll:function(a){this._delta+=L.DomEvent.getWheelDelta(a);this._lastMousePos=this._map.mouseEventToContainerPoint(a);clearTimeout(this._timer);this._timer=setTimeout(L.Util.bind(this._performZoom,this),50);L.DomEvent.preventDefault(a)},_performZoom:function(){var c=Math.round(this._delta);this._delta=0;if(!c){return}var a=this._getCenterForScrollWheelZoom(this._lastMousePos,c),b=this._map.getZoom()+c;if(this._map._limitZoom(b)==this._map._zoom){return}this._map.setView(a,b)},_getCenterForScrollWheelZoom:function(c,g){var f=this._map.getPixelBounds().getCenter(),d=this._map.getSize().divideBy(2),b=c.subtract(d).multiplyBy(1-Math.pow(2,-g)),a=f.add(b);return this._map.unproject(a,this._map._zoom,true)}});L.Handler.DoubleClickZoom=L.Handler.extend({enable:function(){if(this._enabled){return}this._map.on("dblclick",this._onDoubleClick,this._map);this._enabled=true},disable:function(){if(!this._enabled){return}this._map.off("dblclick",this._onDoubleClick,this._map);this._enabled=false},_onDoubleClick:function(a){this.setView(a.latlng,this._zoom+1)}});L.Handler.ShiftDragZoom=L.Handler.extend({initialize:function(a){this._map=a;this._container=a._container;this._pane=a._panes.overlayPane},enable:function(){if(this._enabled){return}L.DomEvent.addListener(this._container,"mousedown",this._onMouseDown,this);this._enabled=true},disable:function(){if(!this._enabled){return}L.DomEvent.removeListener(this._container,"mousedown",this._onMouseDown);this._enabled=false},_onMouseDown:function(a){if(!a.shiftKey||((a.which!=1)&&(a.button!=1))){return false}L.DomUtil.disableTextSelection();this._startLayerPoint=this._map.mouseEventToLayerPoint(a);this._box=L.DomUtil.create("div","leaflet-zoom-box",this._pane);L.DomUtil.setPosition(this._box,this._startLayerPoint);this._container.style.cursor="crosshair";L.DomEvent.addListener(document,"mousemove",this._onMouseMove,this);L.DomEvent.addListener(document,"mouseup",this._onMouseUp,this);L.DomEvent.preventDefault(a)},_onMouseMove:function(g){var b=this._map.mouseEventToLayerPoint(g),c=b.x-this._startLayerPoint.x,a=b.y-this._startLayerPoint.y;var h=Math.min(b.x,this._startLayerPoint.x),f=Math.min(b.y,this._startLayerPoint.y),d=new L.Point(h,f);L.DomUtil.setPosition(this._box,d);this._box.style.width=(Math.abs(c)-4)+"px";this._box.style.height=(Math.abs(a)-4)+"px"},_onMouseUp:function(c){this._pane.removeChild(this._box);this._container.style.cursor="";L.DomUtil.enableTextSelection();L.DomEvent.removeListener(document,"mousemove",this._onMouseMove);L.DomEvent.removeListener(document,"mouseup",this._onMouseUp);var a=this._map.mouseEventToLayerPoint(c);var b=new L.LatLngBounds(this._map.layerPointToLatLng(this._startLayerPoint),this._map.layerPointToLatLng(a));this._map.fitBounds(b)}});L.Handler.MarkerDrag=L.Handler.extend({initialize:function(a){this._marker=a},enable:function(){if(this._enabled){return}if(!this._draggable){this._draggable=new L.Draggable(this._marker._icon,this._marker._icon);this._draggable.on("dragstart",this._onDragStart,this);this._draggable.on("drag",this._onDrag,this);this._draggable.on("dragend",this._onDragEnd,this)}this._draggable.enable();this._enabled=true},disable:function(){if(!this._enabled){return}this._draggable.disable();this._enabled=false},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(a){this._marker.closePopup();this._marker.fire("movestart");this._marker.fire("dragstart")},_onDrag:function(b){var a=L.DomUtil.getPosition(this._marker._icon);L.DomUtil.setPosition(this._marker._shadow,a);this._marker._latlng=this._marker._map.layerPointToLatLng(a);this._marker.fire("move");this._marker.fire("drag")},_onDragEnd:function(){this._marker.fire("moveend");this._marker.fire("dragend")}});L.Control={};L.Control.Position={TOP_LEFT:"topLeft",TOP_RIGHT:"topRight",BOTTOM_LEFT:"bottomLeft",BOTTOM_RIGHT:"bottomRight"};L.Control.Zoom=L.Class.extend({onAdd:function(a){this._map=a;this._container=L.DomUtil.create("div","leaflet-control-zoom");this._zoomInButton=this._createButton("Zoom in","leaflet-control-zoom-in",this._map.zoomIn,this._map);this._zoomOutButton=this._createButton("Zoom out","leaflet-control-zoom-out",this._map.zoomOut,this._map);this._container.appendChild(this._zoomInButton);this._container.appendChild(this._zoomOutButton)},getContainer:function(){return this._container},getPosition:function(){return L.Control.Position.TOP_LEFT},_createButton:function(f,c,b,a){var d=document.createElement("a");d.href="#";d.title=f;d.className=c;L.DomEvent.disableClickPropagation(d);L.DomEvent.addListener(d,"click",L.DomEvent.preventDefault);L.DomEvent.addListener(d,"click",b,a);return d}});L.Control.Attribution=L.Class.extend({onAdd:function(a){this._container=L.DomUtil.create("div","leaflet-control-attribution");this._map=a;this._prefix='Powered by <a href="http://leaflet.cloudmade.com">Leaflet</a>';this._attributions={};this._update()},getPosition:function(){return L.Control.Position.BOTTOM_RIGHT},getContainer:function(){return this._container},setPrefix:function(a){this._prefix=a},addAttribution:function(a){if(!a){return}this._attributions[a]=true;this._update()},removeAttribution:function(a){if(!a){return}delete this._attributions[a];this._update()},_update:function(){if(!this._map){return}var c=[];for(var a in this._attributions){if(this._attributions.hasOwnProperty(a)){c.push(a)}}var b=[];if(this._prefix){b.push(this._prefix)}if(c.length){b.push(c.join(", "))}this._container.innerHTML=b.join(" &mdash; ")}});L.Map=L.Class.extend({includes:L.Mixin.Events,options:{crs:L.CRS.EPSG3857||L.CRS.EPSG4326,scale:function(a){return 256*(1<<a)},center:null,zoom:null,layers:[],dragging:true,touchZoom:L.Browser.mobileWebkit&&!L.Browser.android,scrollWheelZoom:!L.Browser.mobileWebkit,doubleClickZoom:true,shiftDragZoom:true,zoomControl:true,attributionControl:true,fadeAnimation:L.DomUtil.TRANSITION&&!L.Browser.android,zoomAnimation:L.DomUtil.TRANSITION&&!L.Browser.android,trackResize:true,closePopupOnClick:true},initialize:function(f,b){L.Util.setOptions(this,b);this._container=L.DomUtil.get(f);this._initLayout();if(L.DomEvent){this._initEvents();if(L.Handler){this._initInteraction()}if(L.Control){this._initControls()}}var a=this.options.center,c=this.options.zoom;if(a!==null&&c!==null){this.setView(a,c,true)}var d=this.options.layers;d=(d instanceof Array?d:[d]);this._tileLayersNum=0;this._initLayers(d)},setView:function(a,c,b){this._resetView(a,this._limitZoom(c));return this},setZoom:function(a){return this.setView(this.getCenter(),a)},zoomIn:function(){return this.setZoom(this._zoom+1)},zoomOut:function(){return this.setZoom(this._zoom-1)},fitBounds:function(b){var a=this.getBoundsZoom(b);return this.setView(b.getCenter(),a)},fitWorld:function(){var a=new L.LatLng(-60,-170),b=new L.LatLng(85,179);return this.fitBounds(new L.LatLngBounds(a,b))},panTo:function(a){return this.setView(a,this._zoom)},panBy:function(a){this.fire("movestart");this._rawPanBy(a);this.fire("move");this.fire("moveend");return this},addLayer:function(b){var c=L.Util.stamp(b);if(this._layers[c]){return this}this._layers[c]=b;if(b.options&&!isNaN(b.options.maxZoom)){this._layersMaxZoom=Math.max(this._layersMaxZoom||0,b.options.maxZoom)}if(b.options&&!isNaN(b.options.minZoom)){this._layersMinZoom=Math.min(this._layersMinZoom||Infinity,b.options.minZoom)}if(this.options.zoomAnimation&&L.TileLayer&&(b instanceof L.TileLayer)){this._tileLayersNum++;b.on("load",this._onTileLayerLoad,this)}if(this.attributionControl&&b.getAttribution){this.attributionControl.addAttribution(b.getAttribution())}var a=function(){b.onAdd(this);this.fire("layeradd",{layer:b})};if(this._loaded){a.call(this)}else{this.on("load",a,this)}return this},removeLayer:function(a){var b=L.Util.stamp(a);if(this._layers[b]){a.onRemove(this);delete this._layers[b];if(this.options.zoomAnimation&&L.TileLayer&&(a instanceof L.TileLayer)){this._tileLayersNum--;a.off("load",this._onTileLayerLoad,this)}if(this.attributionControl&&a.getAttribution){this.attributionControl.removeAttribution(a.getAttribution())}this.fire("layerremove",{layer:a})}return this},invalidateSize:function(){this._sizeChanged=true;this.fire("move");clearTimeout(this._sizeTimer);this._sizeTimer=setTimeout(L.Util.bind(function(){this.fire("moveend")},this),200);return this},getCenter:function(b){var a=this.getSize().divideBy(2),c=this._getTopLeftPoint().add(a);return this.unproject(c,this._zoom,b)},getZoom:function(){return this._zoom},getBounds:function(){var b=this.getPixelBounds(),a=this.unproject(new L.Point(b.min.x,b.max.y)),c=this.unproject(new L.Point(b.max.x,b.min.y));return new L.LatLngBounds(a,c)},getMinZoom:function(){return isNaN(this.options.minZoom)?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return isNaN(this.options.maxZoom)?this._layersMaxZoom||Infinity:this.options.maxZoom},getBoundsZoom:function(a){var k=this.getSize(),h=this.getMinZoom(),f=this.getMaxZoom(),c=a.getNorthEast(),g=a.getSouthWest(),j,b,d;do{h++;b=this.project(c,h);d=this.project(g,h);j=new L.Point(b.x-d.x,d.y-b.y)}while((j.x<=k.x)&&(j.y<=k.y)&&(h<=f));return h-1},getSize:function(){if(!this._size||this._sizeChanged){this._size=new L.Point(this._container.clientWidth,this._container.clientHeight);this._sizeChanged=false}return this._size},getPixelBounds:function(){var b=this._getTopLeftPoint(),a=this.getSize();return new L.Bounds(b,b.add(a))},getPixelOrigin:function(){return this._initialTopLeftPoint},getPanes:function(){return this._panes},mouseEventToContainerPoint:function(a){return L.DomEvent.getMousePosition(a,this._container)},mouseEventToLayerPoint:function(a){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(a))},mouseEventToLatLng:function(a){return this.layerPointToLatLng(this.mouseEventToLayerPoint(a))},containerPointToLayerPoint:function(a){return a.subtract(L.DomUtil.getPosition(this._mapPane))},layerPointToContainerPoint:function(a){return a.add(L.DomUtil.getPosition(this._mapPane))},layerPointToLatLng:function(a){return this.unproject(a.add(this._initialTopLeftPoint))},latLngToLayerPoint:function(a){return this.project(a)._subtract(this._initialTopLeftPoint)},project:function(b,a){a=(typeof a=="undefined"?this._zoom:a);return this.options.crs.latLngToPoint(b,this.options.scale(a))},unproject:function(a,b,c){b=(typeof b=="undefined"?this._zoom:b);return this.options.crs.pointToLatLng(a,this.options.scale(b),c)},_initLayout:function(){var b=this._container;b.className+=" leaflet-container";if(this.options.fadeAnimation){b.className+=" leaflet-fade-anim"}var a=L.DomUtil.getStyle(b,"position");if(a!="absolute"&&a!="relative"){b.style.position="relative"}this._initPanes();if(this._initControlPos){this._initControlPos()}},_initPanes:function(){var a=this._panes={};this._mapPane=a.mapPane=this._createPane("leaflet-map-pane",this._container);this._tilePane=a.tilePane=this._createPane("leaflet-tile-pane",this._mapPane);this._objectsPane=a.objectsPane=this._createPane("leaflet-objects-pane",this._mapPane);a.shadowPane=this._createPane("leaflet-shadow-pane");a.overlayPane=this._createPane("leaflet-overlay-pane");a.markerPane=this._createPane("leaflet-marker-pane");a.popupPane=this._createPane("leaflet-popup-pane")},_createPane:function(b,a){return L.DomUtil.create("div",b,a||this._objectsPane)},_resetView:function(c,d,b){var a=(this._zoom!=d);this.fire("movestart");this._zoom=d;this._initialTopLeftPoint=this._getNewTopLeftPoint(c);if(!b){L.DomUtil.setPosition(this._mapPane,new L.Point(0,0))}else{var f=L.DomUtil.getPosition(this._mapPane);this._initialTopLeftPoint._add(f)}this._tileLayersToLoad=this._tileLayersNum;this.fire("viewreset");this.fire("move");if(a){this.fire("zoomend")}this.fire("moveend");if(!this._loaded){this._loaded=true;this.fire("load")}},_initLayers:function(c){this._layers={};for(var b=0,a=c.length;b<a;b++){this.addLayer(c[b])}},_initControls:function(){if(this.options.zoomControl){this.addControl(new L.Control.Zoom())}if(this.options.attributionControl){this.attributionControl=new L.Control.Attribution();this.addControl(this.attributionControl)}},_rawPanBy:function(b){var a=L.DomUtil.getPosition(this._mapPane);L.DomUtil.setPosition(this._mapPane,a.subtract(b))},_initEvents:function(){L.DomEvent.addListener(this._container,"click",this._onMouseClick,this);var b=["dblclick","mousedown","mouseenter","mouseleave","mousemove"];for(var a=0;a<b.length;a++){L.DomEvent.addListener(this._container,b[a],this._fireMouseEvent,this)}if(this.options.trackResize){L.DomEvent.addListener(window,"resize",this.invalidateSize,this)}},_onMouseClick:function(a){if(this.dragging&&this.dragging.moved()){return}this.fire("pre"+a.type);this._fireMouseEvent(a)},_fireMouseEvent:function(b){var a=b.type;a=(a=="mouseenter"?"mouseover":(a=="mouseleave"?"mouseout":a));if(!this.hasEventListeners(a)){return}this.fire(a,{latlng:this.mouseEventToLatLng(b),layerPoint:this.mouseEventToLayerPoint(b)})},_initInteraction:function(){var a={dragging:L.Handler.MapDrag,touchZoom:L.Handler.TouchZoom,doubleClickZoom:L.Handler.DoubleClickZoom,scrollWheelZoom:L.Handler.ScrollWheelZoom,shiftDragZoom:L.Handler.ShiftDragZoom};for(var b in a){if(a.hasOwnProperty(b)&&a[b]){this[b]=new a[b](this);if(this.options[b]){this[b].enable()}}}},_onTileLayerLoad:function(){this._tileLayersToLoad--;if(this._tileLayersNum&&!this._tileLayersToLoad&&this._tileBg){clearTimeout(this._clearTileBgTimer);this._clearTileBgTimer=setTimeout(L.Util.bind(this._clearTileBg,this),500)}},_getTopLeftPoint:function(){if(!this._loaded){throw new Error("Set map center and zoom first.")}var a=L.DomUtil.getPosition(this._mapPane);return this._initialTopLeftPoint.subtract(a)},_getNewTopLeftPoint:function(a){var b=this.getSize().divideBy(2);return this.project(a).subtract(b).round()},_limitZoom:function(c){var b=this.getMinZoom();var a=this.getMaxZoom();return Math.max(b,Math.min(a,c))}});L.Map.include({locate:function(a){var b={timeout:10000};L.Util.extend(b,a);if(navigator.geolocation){navigator.geolocation.getCurrentPosition(L.Util.bind(this._handleGeolocationResponse,this),L.Util.bind(this._handleGeolocationError,this),b)}else{this.fire("locationerror",{code:0,message:"Geolocation not supported."})}return this},locateAndSetView:function(a,b){this._setViewOnLocate=true;this._maxLocateZoom=a||Infinity;return this.locate(b)},_handleGeolocationError:function(a){var d=a.code,b=(d==1?"permission denied":(d==2?"position unavailable":"timeout"));if(this._setViewOnLocate){this.fitWorld();this._setViewOnLocate=false}this.fire("locationerror",{code:d,message:"Geolocation error: "+b+"."})},_handleGeolocationResponse:function(f){var g=180*f.coords.accuracy/40000000,b=g*2,d=f.coords.latitude,h=f.coords.longitude;var j=new L.LatLng(d-g,h-b),c=new L.LatLng(d+g,h+b),a=new L.LatLngBounds(j,c);if(this._setViewOnLocate){var k=Math.min(this.getBoundsZoom(a),this._maxLocateZoom);this.setView(a.getCenter(),k);this._setViewOnLocate=false}this.fire("locationfound",{latlng:new L.LatLng(d,h),bounds:a,accuracy:f.coords.accuracy})}});L.Map.include({openPopup:function(a){this.closePopup();this._popup=a;return this.addLayer(a)},closePopup:function(){if(this._popup){this.removeLayer(this._popup)}return this}});L.Map.include(!(L.Transition&&L.Transition.implemented())?{}:{setView:function(b,f,d){f=this._limitZoom(f);var a=(this._zoom!=f);if(this._loaded&&!d&&this._layers){var g=this._getNewTopLeftPoint(b).subtract(this._getTopLeftPoint());var c=(a?!!this._zoomToIfCenterInView&&this._zoomToIfCenterInView(b,f,g):this._panByIfClose(g));if(c){return this}}this._resetView(b,f);return this},panBy:function(a){if(!this._panTransition){this._panTransition=new L.Transition(this._mapPane,{duration:0.3});this._panTransition.on("step",this._onPanTransitionStep,this);this._panTransition.on("end",this._onPanTransitionEnd,this)}this.fire(this,"movestart");this._panTransition.run({position:L.DomUtil.getPosition(this._mapPane).subtract(a)});return this},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){this.fire("moveend")},_panByIfClose:function(a){if(this._offsetIsWithinView(a)){this.panBy(a);return true}return false},_offsetIsWithinView:function(d,c){var a=c||1,b=this.getSize();return(Math.abs(d.x)<=b.x*a)&&(Math.abs(d.y)<=b.y*a)}});L.Map.include(!L.DomUtil.TRANSITION?{}:{_zoomToIfCenterInView:function(b,d,a){if(this._animatingZoom){return true}if(!this.options.zoomAnimation){return false}var h=d-this._zoom,g=Math.pow(2,h),f=a.divideBy(1-1/g);if(!this._offsetIsWithinView(f,1)){return false}this._mapPane.className+=" leaflet-zoom-anim";var j=this.containerPointToLayerPoint(this.getSize().divideBy(2)),c=j.add(f);this._prepareTileBg();this._runAnimation(b,d,g,c);return true},_runAnimation:function(a,f,h,b){this._animatingZoom=true;this._animateToCenter=a;this._animateToZoom=f;var d=L.DomUtil.TRANSFORM;if(L.Browser.gecko||window.opera){this._tileBg.style[d]+=" translate(0,0)"}var g;if(L.Browser.android){this._tileBg.style[d+"Origin"]=b.x+"px "+b.y+"px";g="scale("+h+")"}else{g=L.DomUtil.getScaleString(h,b)}L.Util.falseFn(this._tileBg.offsetWidth);var c={};c[d]=this._tileBg.style[d]+" "+g;this._tileBg.transition.run(c)},_prepareTileBg:function(){if(!this._tileBg){this._tileBg=this._createPane("leaflet-tile-pane",this._mapPane);this._tileBg.style.zIndex=1}var a=this._tilePane,b=this._tileBg;b.style[L.DomUtil.TRANSFORM]="";b.style.visibility="hidden";b.empty=true;a.empty=false;this._tilePane=this._panes.tilePane=b;this._tileBg=a;if(!this._tileBg.transition){this._tileBg.transition=new L.Transition(this._tileBg,{duration:0.3,easing:"cubic-bezier(0.25,0.1,0.25,0.75)"});this._tileBg.transition.on("end",this._onZoomTransitionEnd,this)}this._stopLoadingBgTiles()},_stopLoadingBgTiles:function(){var b=[].slice.call(this._tileBg.getElementsByTagName("img"));for(var c=0,a=b.length;c<a;c++){if(!b[c].complete){b[c].src="";b[c].parentNode.removeChild(b[c])}}},_onZoomTransitionEnd:function(){this._restoreTileFront();L.Util.falseFn(this._tileBg.offsetWidth);this._resetView(this._animateToCenter,this._animateToZoom,true);this._mapPane.className=this._mapPane.className.replace(" leaflet-zoom-anim","");this._animatingZoom=false},_restoreTileFront:function(){this._tilePane.innerHTML="";this._tilePane.style.visibility="";this._tilePane.style.zIndex=2;this._tileBg.style.zIndex=1},_clearTileBg:function(){if(!this._animatingZoom&&!this.touchZoom._zooming){this._tileBg.innerHTML=""}}});L.Map.include({addControl:function(c){c.onAdd(this);var d=c.getPosition(),b=this._controlCorners[d],a=c.getContainer();L.DomUtil.addClass(a,"leaflet-control");if(d.indexOf("bottom")!=-1){b.insertBefore(a,b.firstChild)}else{b.appendChild(a)}return this},removeControl:function(c){var d=c.getPosition(),b=this._controlCorners[d],a=c.getContainer();b.removeChild(a);if(c.onRemove){c.onRemove(this)}return this},_initControlPos:function(){var c=this._controlCorners={},f="leaflet-",h=f+"top",b=f+"bottom",g=f+"left",d=f+"right",a=L.DomUtil.create("div",f+"control-container",this._container);if(L.Browser.mobileWebkit){a.className+=" "+f+"big-buttons"}c.topLeft=L.DomUtil.create("div",h+" "+g,a);c.topRight=L.DomUtil.create("div",h+" "+d,a);c.bottomLeft=L.DomUtil.create("div",b+" "+g,a);c.bottomRight=L.DomUtil.create("div",b+" "+d,a)}});(function(h){var g={};var a=false;var c=function(k){return h(k._container).parent()};var j=function(n){var k=n.getCenter();var l=n.getZoom();var m="ll="+k.lat.toFixed(3)+","+k.lng.toFixed(3)+"&z="+l;h(".permalink",c(n)).attr("href","/map/?"+m);location.hash="#"+m};var f=function(l){var k=String(l).match(/ll=([-\d\.]+),([-\d\.]+)&z=(\d+)/);if(!k||k.length!=4){return{}}return{lat:Number(k[1]),lng:Number(k[2]),zoom:Number(k[3])}};var b=function(l){var m="";var k="";m=l.properties.title?l.properties.title:l.id;k=l.properties.description;if(l.properties.category=="citycycle"){m="CityCycle Station "+l.id;l.properties.uri="http://citycycle.com/";l.properties.uriText="Subscribe to CityCycle"}if(!l.properties.uriText){l.properties.uriText="Find out more"}if(l.properties.uri){k+='<br /><a href="'+l.properties.uri+'">'+l.properties.uriText+"</a>"}return"<b>"+m+"</b><br /><p>"+k+"</p>"};var d=function(l,m,n){var k="/search.php?o=json&bbox=150,-26.35,154,-28.25&q="+l;h.ajax({url:k,dataType:"json",success:function(q){var p=q[0];var o=new L.LatLng(Number(p.lat),Number(p.lon));if(a){m.removeLayer(a)}a=new L.Marker(o);a.bindPopup(b({properties:p}));m.addLayer(a);var r=parseInt(16-(p.place_weight/70));m.panTo(o);n(true,q)},error:function(){content=h("<p>We couldn't find any places matching "+l+"					. Currently Briscycle Search only supports 					suburbs and localities, so if you've typed an					address, try again with just the suburb name.</p>");n(false,content)}});return false};h.fn.briscycle=function(k){k=h.extend({lat:-27.47,lng:153.025,zoom:13,tileUri:"http://tiles.briscycle.com/cycletiles/{z}/{x}/{y}.png",contourUri:"http://tiles.briscycle.com/contours/{z}/{x}/{y}.png",cityCycleUri:"/themes/briscycle/resources/citycycle.json",maxZoom:17,getFromPermalink:false,features:"slim",geolocate:false,search:false,callback:function(){}},k);if(k.getFromPermalink){if(window.location&&window.location.hash){h.extend(k,f(window.location.hash))}}var l=new L.TileLayer(k.tileUri,k);var n=new L.TileLayer(k.contourUri,k);var m=new L.LatLng(k.lat,k.lng);this.each(function(){if(k.search!==false){var s=h(this).data("map");return(d(k.search,s,k.callback))}h(this).children().remove();var s=new L.Map("map");h(this).data("map",s);s.setView(m,k.zoom).addLayer(l);var r={};if(k.features=="all"||1){if(k.geolocate){s.locateAndSetView(s.zoom)}var q=function(u){j(s);var t=s.getZoom();h.each(r,function(v,w){if(t>w.maxZoom||t<w.minZoom){if(!w.disabled){s.removeLayer(w.layer);w.disabled=true}}else{if(w.disabled==true){s.addLayer(w.layer);w.disabled=false}}})};s.on("moveend",q);j(s);h(this).append('<div class="permalink-container" class="nomobile"><a href="/map/#" class="permalink">Link to this map.</a></div>');var p=h('<p class="layerswitcher"><a href="#contours" title="Toggle Contours">Contours</a></p>').click(function(){var u=h(this);var t="toggle-true";if(u.hasClass(t)){s.removeLayer(n);r.contours=false}else{s.addLayer(n);r.contours={layer:n,minZoom:11,maxZoom:16}}u.toggleClass(t);return false});h(this).children(".permalink-container").before(p);function o(u,v,x,t){var w=function(y){var z=new L.GeoJSON();z.on("featureparse",function(C){var A=C.properties.category;if(typeof g[A]=="undefined"){g[A]=L.Icon.extend({iconUrl:"/themes/briscycle/images/map-icons/"+A+".png",shadowUrl:"/themes/briscycle/images/map-icons/spacer.gif",iconSize:new L.Point(16,16),shadowSize:new L.Point(1,1),iconAnchor:new L.Point(8,8),popupAnchor:new L.Point(0,0)})}var B=new g[A]();C.layer.bindPopup(b(C));C.layer.options.icon=B});z.addGeoJSON(y);s.addLayer(z);r[u]={layer:z,geoJson:y,minZoom:x,maxZoom:t};q()};if(typeof r[u]=="undefined"||r[u].status!=1){r[u]={status:1};h.getJSON(v,w)}else{if(r[u].status!=1){w(r[u].geoJson)}}}o("citycycle","/themes/briscycle/resources/citycycle.json",15,20);o("briscycle","/map/getPointsGeojson",9,20)}});return this}})(jQuery);$(document).ready(function(){var a=$("#GeoSearchForm_SearchForm");var b=false;a.submit(function(){if(b){b.fadeOut(function(){$(this).remove()});b=false}$("#map").briscycle({search:a.find('input[type="text"]').val(),callback:function(d,c){if(!d){b=$(c).addClass("searchResult").click(function(){b=false;$(this).fadeOut(function(){$(this).remove()})});$("#map").append(b.fadeIn())}else{console.log(c)}}});return false})});$(document).ready(function(){var c=function(){$("body").css({height:window.innerHeight?window.innerHeight:document.documentElement.clientHeight+"px",position:"relative"})};$(window).resize(c);c();var b=function(){$("body").addClass("menu-visible")};var a=function(){$("body").removeClass("menu-visible")};var d=function(){$("body").toggleClass("menu-visible");return false};$("#skip-menu a").click(d);$("body").addClass("menu-possible");a()});
