window["geobase_client_build"]="1/5/2010 5:05:20 PM";(function(){(function(){window.offscreenBuffer=true;var AL=document.createElement("meta");AL.setAttribute("http-equiv","imagetoolbar");AL.setAttribute("content","no");document.getElementsByTagName("head")[0].appendChild(AL)})();var E,x,AK,AD,O,s,M,AC,j,AI,T,D,Z,t,m,AG,J,N,AB,G,V,L,f,I,S,Q,e,AH,q,AE,o,d,X,AJ,z,p,n,F,R,AF,B,P,AA,l,K,g,Y,w,U,C,H,b,k,a,y,r,A,v,c,u,i,h,W;(function(){window.Telogis={};N=Telogis.GeoBase={destroy:function(){E.destroyInstances();R.destroyInstances();AB.destroy();o.freeHandlers(N);f.Events.flush()},getCopyright:function(AM){var AL=function(AN){AM("Copyright \xA9"+AN)};AB.invoke(AB.SETTINGS_PAGE,"GetCopyrightString",null,AL)},setAuthToken:function(AL,AM){AB.register(AL);if(!isNaN(AM)){setTimeout(function(){N.AuthExpiry.trigger()},AM)}},setService:function(AL){f.serviceURLs=f.getServiceSet(AL)}}})();(function(){AG=Telogis.GeoBase.Errors={};var AL=function(AM){var AP=function(AQ){this.message=""+AQ};var AN=y||Error;var AO=new AN();AM+="Error";AO.name="Telogis.GeoBase.Errors."+AM;AO.toString=function(){return this.name+": "+this.message};AP.prototype=AO;AG[AM]=AP;return AP};y=AL("GeoBase");U=AL("AJAX");C=AL("ArgumentType");H=AL("Auth");b=AL("Class");k=AL("Configuration");a=AL("EnumValue");r=AL("JSON");A=AL("Layout");v=AL("NotReady");c=AL("RPC");u=AL("Scope");i=AL("ShapeMetric");AF=AL("TimeOut");h=AL("XML")})();(function(){O=N.Arrays=function(){var AM,AL,AN;return{contains:function(AO,AQ){if(!AO){return }var AP=AM(AO,AQ);if(!isNaN(AP)){return AP!==-1}},count:function(AO){if(typeof (AO)!=="object"){return }var AQ=0;for(var AP in AO){if(AO.hasOwnProperty(AP)){AQ++}}return AQ},indexOf:AM=function(AO,AQ){if(!(AO instanceof Array)){return }if(AO.indexOf){return AO.indexOf(AQ)}else{for(var AP=0,AR=AO.length;AP<AR;AP++){if(AO[AP]===AQ){return AP}}return -1}},intersection:function(){var AV=arguments[0],AX;if(!(AV instanceof Array)){return }for(var AT=0,AO=arguments.length;AT<AO;AT++){AX=[];var AU=arguments[AT];if(!(AU instanceof Array)){break}var AR=AV.length,AQ=AU.length;for(var AS=0;AS<AR;AS++){var AW=AV[AS];for(var AP=0;AP<AQ;AP++){if(AW===AU[AP]){AX.push(AW)}}}AV=AX}return AN(AX)},move:function(AP,AT,AS){if(!(AP instanceof Array)){return }if(isNaN(AT)||isNaN(AS)){return }var AO=AP.slice(),AR=AP.length;if(AT<0||AT>=AR){return AO}if(AS<0||AS>=AR){return AO}var AQ=AP[AT];AO.splice(AT,1);AO.splice(AS,0,AQ);return AO},place:function(AP,AS,AQ){if(!(AP instanceof Array)){return }var AO=AP.slice(),AR=AL(AO,AS,AQ);AO.splice(AR,0,AS);return AO},query:function(AO,AR){if(!(AO instanceof Array)){return }if(typeof (AR)!=="function"){return }var AQ=AO.length;for(var AP=0;AP<AQ;AP++){if(AR(AO[AP])){return AP}}return -1},search:AL=function(AO,AS,AP){if(!(AO instanceof Array)){return }AP=AP||function(AV,AU){return AV-AU};var AQ=AO.length,AT=-1;while(AQ-AT>1){var AR=AQ+AT>>1;if(AP(AO[AR],AS)<0){AT=AR}else{AQ=AR}}return AQ},swap:function(AP,AT,AS){if(!(AP instanceof Array)){return }var AO=AP.slice(),AR=AO[AT],AQ=AO[AS];if(typeof (AR)==="undefined"){return AO}if(typeof (AQ)==="undefined"){return AO}AO[AT]=AQ;AO[AS]=AR;return AO},toSet:AN=function(AP){if(!(AP instanceof Array)){return }var AO=[],AS=AP.length;for(var AR=0;AR<AS;AR++){for(var AQ=AR+1;AQ<AS;AQ++){if(AP[AR]===AP[AQ]){AQ=++AR}}AO.push(AP[AR])}return AO},toString:function(AO){if(!(AO instanceof Array)){return }var AS="",AR="",AQ=AO.length;for(var AP=0;AP<AQ;AP++){AS+=AR+AO[AP];AR=", "}return"["+AS+"]"}}}()})();(function(){o=N.Objects={freeHandlers:function(AM){for(var AL in AM){if(AM.hasOwnProperty(AL)){if(AM[AL] instanceof J){o.freeProperty(AM,AL)}}}},freeProperty:function(AP,AM){var AN=f.DOM;if(typeof (AP[AM])==="undefined"){Z.warn("could not free '"+AM+"' property: not found.");return }if(AP[AM] instanceof Array){for(var AL=AP[AM].length-1;AL>=0;AL--){if(AP[AM][AL]){o.freeProperty(AP[AM],AL);AP[AM].splice(AL,1)}}}else{if(typeof (AP[AM])==="object"&&AP[AM]){if(o.isElement(AP[AM])){AN.detach(AP[AM])}else{if(typeof (AP[AM].destroy)==="function"){AP[AM].destroy()}}}}try{delete AP[AM]}catch(AQ){try{AP[AM]=null}catch(AO){Z.warn("could not free '"+AM+"' property: access denied.")}}},isElement:function(AM){if(!AM||typeof (AM)!=="object"){return false}var AL=AM.nodeType,AN=AM.nodeName;return(typeof (AL)==="number"||(AL instanceof Number))&&(typeof (AN)==="string"||(AN instanceof String))},lookupObject:function(AM,AL){AL=AL||window;var AO=AM.split(".");for(var AQ=AO.length,AN=0;AN<AQ;AN++){var AP=AO[AN];if(AP===""){continue}if(typeof (AL)!=="object"){AL=null;break}else{AL=AL[AP]}}return AL},parse:function(AO,AT,AL){if(typeof (AO)!=="object"){AO={}}AT=(AT instanceof Array)?AT:[AT];var AN=AT[0];if(typeof (AN)!=="string"&&!(AN instanceof String)){return }if(typeof (AO[AN])==="undefined"){for(var AP=1;AP<AT.length;AP++){var AS=AT[AP];var AR=AO[AS];if(typeof (AS)!=="string"&&!(AS instanceof String)){return }if(typeof (AR)!=="undefined"){AO[AN]=AR}}}if(typeof (AO[AN])==="undefined"){AO[AN]=AL}var AQ=AO[AN];if(typeof (AQ)==="object"&&typeof (AL)==="object"&&AL&&typeof (AL.hasOwnProperty)==="function"){for(var AM in AL){if(AL.hasOwnProperty(AM)){if(typeof (AQ[AM])==="undefined"){AQ[AM]=AL[AM]}}}}return AQ}}})();(function(){Z=N.Console=function(){var AN,AR,AM,AQ=function(AS){if(typeof (console)==="object"){console.log(""+AS)}},AP=AQ,AO=null,AL=0;return{WARNING_PREFIX:AN="** warning: ",getWarningCount:function(){return AL},off:function(){AO=AP;AR(null)},on:function(){if(AO){AP=AO}},redirect:AR=function(AT){var AS=typeof (AT);if(AS==="undefined"){AP=AQ}else{if(AS!=="function"){AP=null}else{AP=function(AU){AT(""+AU)}}}},resetWarningCount:function(){AL=0},warn:function(AS){AL++;AM(AN+AS)},writeLine:AM=function(AS){if(typeof (AS)==="undefined"){AS=""}if(AP){AP(AS)}}}}()})();(function(){f=function(){var AL=0,AM=1;return{getGUID:function(){return AM++},getServiceSet:function(AN){var AQ=(AN instanceof Array)?AN.slice():[AN];for(var AP=0,AR=AQ.length;AP<AR;AP++){var AO=AQ[AP];if(AO.charAt(AO.length-1)!=="/"){AQ[AP]+="/"}}return AQ},getServiceURL:function(){var AN=f.serviceURLs;AL=(AL+1)%AN.length;return AN[AL]},lookup:function(AR,AP,AU){var AQ=null;AU=(AU instanceof Array)?AU:[AU];for(var AO=0,AT=AU.length;AO<AT&&!AQ;AO++){var AN=AU[AO];if(AP instanceof AN){AQ=AP}else{var AS=AR[AP];if(AS instanceof AN){AQ=AS}}}return AQ},serviceURLs:["http://localhost/geostream/"],USE_IE:(navigator.appName.indexOf("Microsoft")!==-1),USE_FF2:(navigator.userAgent.indexOf("Firefox/2")!==-1),ZIndices:{TILE_TRANSITION:10,TILE:20,PATH:30,REGION:40,FENCE:50,CANVAS_LAYER:60,OBJECT:70,BALLOON:80,BALLOON_RAISED:85,ACTIVE_TILE_TRANSITION:90,COPYRIGHT:100,MAP_CONTROL:110,MENU:120,TOP:9999999}}}()})();(function(){D=N.Class=function(){var AO=f.getGUID,AU={},AV="__serialID",AL={},AR={},AY={},AM={},AW={},AT,AN=function(AZ){var Aa=AZ[AV];if(!Aa){Aa=AZ[AV]=AO();AL[Aa]=AZ}return Aa},AQ=function(AZ,Ab){for(var Aa in AZ){if(AZ.hasOwnProperty(Aa)){if(!Ab.validConfigs[Aa]){throw new k("unrecognised configuration property: "+Aa)}}}},AS=function(AZ){var Aa=function(Ab){return function(){var Ac=arguments[0];if(Ac===AU){return }if(!(this instanceof Aa)){throw new u("invalid managed class instance. Did you forget 'new'?")}if(Ab.validConfigs&&typeof (Ac)==="object"){AQ(Ac,Ab)}Ab.apply(this,arguments)}}(AZ.init);return Aa},AX=function(Ae,Ab,Ad){var Ac=Ad[AN(Ae)],AZ=null;if(Ac){AZ=Ac[Ab]}if(!AZ){var Aa=Ae.Base;AZ=Aa?AX(Aa,Ab,Ad):Ab}return AZ},AP=function(Aa,Ad){for(var AZ=0,Ac=Aa.length;AZ<Ac;AZ++){var Ab=Aa[AZ];if(!Ad.hasOwnProperty(Ab)){throw new b("incomplete implementation of abstract class: missing property '"+Ab+"'.")}}};return{configure:function(Af,Ag){Ag=Ag||[];var Aj=Af.prototype.init;var AZ=Aj.validConfigs||{};for(var Ab=0,Ae=Ag.length;Ab<Ae;Ab++){var Ak=Ag[Ab];if(Ak instanceof Array){for(var Aa=0,Ad=Ak.length;Aa<Ad;Aa++){AZ[Ak[Aa]]=true}}else{AZ[Ag[Ab]]=true}}var Ac=Af.Base;if(Ac){var Ah=Ac.prototype.init.validConfigs;if(typeof (Ah)==="object"){for(var Ai in Ah){if(Ah.hasOwnProperty(Ai)){AZ[Ai]=true}}}}Aj.validConfigs=AZ},create:function(AZ,Aa){return AT(null,AZ,Aa)},extend:AT=function(Ab,AZ,Ae){if(typeof (Ab)==="undefined"){throw new b("undefined base class")}AZ=AZ||{};Ae=Ae||{};AZ.init=AZ.init||(Ab?function(){Ab.prototype.init.apply(this,arguments)}:function(){});var Af=AS(AZ);Af.Derived=[];if(Ab){Af.Base=Ab;Ab.Derived.push(Af);Af.prototype=new Ab(AU);Af.prototype.constructor=Af;var Ac=Ab.virtualProps;if(Ac){AP(Ac,AZ)}}else{Af.Base=null}var Aa,Ad=Af.prototype;for(Aa in AZ){if(AZ.hasOwnProperty(Aa)){Ad[Aa]=AZ[Aa]}}for(Aa in Ae){if(Ae.hasOwnProperty(Aa)){Af[Aa]=Ae[Aa]}}if(AZ.hasOwnProperty("toString")){Ad.toString=AZ.toString}return Af},getDNClassDesc:function(AZ){return AR[AN(AZ)]||null},getDNPropName:function(Aa,AZ){return AX(Aa,AZ,AM)},getJSClass:function(Aa){var Ab=AY[Aa[1]];if(Ab){var AZ=Ab[Aa[0]];if(AZ){return AL[AZ]}}else{return null}},getJSPropName:function(Aa,AZ){return AX(Aa,AZ,AW)},serializeAs:function(Ab,Aa,AZ){if(!AZ){Aa="Telogis.GeoBase."+Aa;AZ="geobase.net"}var Ac=AN(Ab);var Ad=AY[AZ]=AY[AZ]||{};Ad[Aa]=Ac;AR[Ac]=[Aa,AZ]},serializeWith:function(AZ,Ad){var Ah=AN(AZ);var Ab=AW[Ah]=AW[Ah]||{};var Ag=AM[Ah]=AM[Ah]||{};for(var Ac=0,Aa=Ad.length;Ac<Aa;Ac++){var Ae=Ad[Ac];if(Ae.length!==2){throw new b("invalid serialization property alias: "+Ae)}var Ai=Ae[0];var Af=Ae[1];Ab[Af]=Ai;Ag[Ai]=Af}},virtualize:function(Aa,AZ){var Ac=Aa.virtualProps=Aa.virtualProps||[];for(var Ab=0,Ad=AZ.length;Ab<Ad;Ab++){Ac.push(AZ[Ab])}}}}()})();(function(){var AO=D.create;var AM=D.serializeAs;var AN=D.serializeWith;var AL=function(AQ){var AP;if(AQ){AP=AQ._items||[];delete AQ._items;delete AQ._size}else{AP=[]}return AP};AM(AL,"System.Collections.ArrayList","mscorlib");T=N.Color=AO({r:0,g:0,b:0,a:1,init:function(AS,AR,AP,AQ){if(isNaN(AS)){if(typeof (AS)==="object"){this.init(AS.r,AS.g,AS.b,AS.a)}}else{this.r=AS;if(!isNaN(AR)){this.g=Math.round(AR)}if(!isNaN(AP)){this.b=Math.round(AP)}if(!isNaN(AQ)){this.a=AQ}}},fromCSSHex:function(AP){var AQ=AP.search("#");if(AQ!==-1){AP=AP.substr(AQ+1)}var AR=+("0x"+AP);this.r=Math.floor(AR/65536);AR-=this.r*65536;this.g=Math.floor(AR/256);AR-=this.g*256;this.b=Math.floor(AR)},fromHSV:function(AV,Aa,AZ){var AP,AW,AY;if(!Aa){AP=AZ;AW=AZ;AY=AZ}else{var AU=AV/60;var AX=Math.floor(AU);var AS=AU-AX;var AT=AZ*(1-Aa);var AR=AZ*(1-Aa*AS);var AQ=AZ*(1-Aa*(1-AS));switch(AX){case 1:AP=AR;AW=AZ;AY=AT;break;case 2:AP=AT;AW=AZ;AY=AQ;break;case 3:AP=AT;AW=AR;AY=AZ;break;case 4:AP=AQ;AW=AT;AY=AZ;break;case 5:AP=AZ;AW=AT;AY=AR;break;default:AP=AZ;AW=AQ;AY=AT;break}}this.r=Math.round(AP*255);this.g=Math.round(AW*255);this.b=Math.round(AY*255)},toCSSHex:function(){var AS=this.b+256*this.g+65536*this.r;var AR=AS.toString(16);var AQ="#";var AP;for(AP=0;AP<6-AR.length;AP++){AQ+="0"}for(AP=0;AP<AR.length;AP++){AQ+=AR.charAt(AP)}return AQ},toCSSRGBA:function(){return"rgba("+this.r+","+this.g+","+this.b+","+this.a+")"}});t=N.DistanceUnit={FEET:"ft",KILOMETERS:"km",KNOTS:"kt",METERS:"m",MILES:"mi",RADIANS:"rad",YARDS:"yd"};N.FeatureInfo=function(){var AP=AO({toString:function(){return this._offset+"_"+this._file}});AM(AP,"FeatureInfo");AN(AP,[["_offset","offset"],["_file","file"]]);return AP}();I=N.LatLon=function(){var AP=function(AR,AS){if(!isNaN(AR)&&!isNaN(AS)){this.lat=+AR;this.lon=+AS}else{if(typeof (AR)==="object"){if(!isNaN(AR.lat)&&!isNaN(AR.lon)){this.lat=+AR.lat;this.lon=+AR.lon}}}};var AQ=AP.prototype;AQ.lat=0;AQ.lon=0;AQ.distanceTo=function(AR,AS){return q.distance(this,AR,AS)};AQ.equals=function(AR,AS){if(isNaN(AS)){AS=0}var AU=this.wrap();var AT=AR.wrap();return Math.abs(AU.lat-AT.lat)<=AS&&Math.abs(AU.lon-AT.lon)<=AS};AQ.toString=function(AR){if(typeof (AR)!=="number"){AR=6}if(-180<=this.lon&&this.lon<=180){return"("+this.lat.toPrecision(AR)+", "+this.lon.toPrecision(AR)+")"}else{return this.wrap().toString(AR)}};AQ.wrap=function(){return new AP(this.lat,q.positiveModulo(this.lon+180,360)-180)};AP.SERIAL_DP=9;AM(AP,"LatLon");AN(AP,[["lat","Lat"],["lon","Lon"]]);return AP}();N.POI=function(){var AP=AO({_foodType:null,_loc:null,_name:null,_phoneNumber:null,_type:null,getFoodType:function(){return this._foodType},getLocation:function(){return new I(this._loc)},getName:function(){return this._name},getPhoneNumber:function(){return this._phoneNumber},getType:function(){return this._type},toString:function(){var AR=this._name,AQ=this._phoneNumber;if(AQ){AR+=" ("+AQ+")"}return AR}});AM(AP,"Poi");AN(AP,[["_foodType","FoodType"],["_loc","Location"],["_name","Name"],["_phoneNumber","Phone"],["_type","Type"]]);return AP}();N.POIType={AIRPORT:4581,AMUSEMENT_PARK:7996,ATM:3578,AUTOMOBILE_CLUB:8699,BANK:6000,BOOK_STORE:9995,BORDER_CROSSING:9999,BOWLING_CENTER:7933,BRITISH_RAIL:10001,BUS_STATION:4170,BUSINESS:5000,BUSINESS_SERVICE:9994,CAR_DEALER:5511,CAR_REPAIR:7538,CASINO:7985,CEMETERY:9591,CHURCH:9992,CINEMA:7832,CITY_HALL:9121,COFFEE_SHOP:9996,CONVENTION_CENTER:7990,COMMUNITY_CENTER:7994,COMMUTER_RAIL_STATION:4100,COURT_HOUSE:9211,FERRY_TERMINAL:4482,FIRE_STATION:7392,GOLF_COURSE:7992,GROCERY_STORE:5400,HIGHER_EDUCATION:8200,HOSPITAL:8060,HOTEL_MOTEL:7011,ICE_SKATING_RINK:7998,LIBRARY:8231,LONDON_UNDERGROUND:10002,MARINA:4493,MONUMENT:5999,MOTORCYCLE_DEALERSHIP:5571,MUSEUM:8410,NIGHTLIFE:5913,PARK:7947,PARK_AND_RIDE:7522,PARKING_GARAGE:7521,PARKING_LOT:7520,PERFORMING_ARTS:7929,PETROL_STATION:5540,PHARMACY:9997,POLICE_STATION:9221,PUBLIC_SPORT_AIRPORT:4580,RENTAL_CAR:7510,REST_AREA:7897,RESTAURANT:5800,SCHOOL:8211,SHOPPING:6512,SKI_RESORT:7012,SPORTS_CENTER:7997,SPORTS_COMPLEX:7940,TOURIST_ATTRACTION:7999,TOURIST_INFORMATION:7389,TRAIN_STATION:4013,UNKNOWN:0,WINERY:2084};X=N.Point=function(){var AQ=function(AR,AS){if(!isNaN(AR)){this.x=+AR;this.y=+(!isNaN(AS)?AS:AR)}else{if(AR){if(o.isElement(AR)){if(AR.offsetLeft||AR.offsetTop){this.x=AR.offsetLeft;this.y=AR.offsetTop}else{if(AR.left&&AR.top){this.x=AR.left;this.y=AR.top}else{if(AR.style.left&&AR.style.top){this.x=parseInt(AR.style.left);this.y=parseInt(AR.style.top)}}}}else{if(!isNaN(AR.x)&&!isNaN(AR.y)){this.x=AR.x;this.y=AR.y}else{if(!isNaN(AR.width)&&!isNaN(AR.height)){this.x=AR.width;this.y=AR.height}}}}}};var AP=AQ.prototype;AP.x=0;AP.y=0;AP.add=function(AR){this.x+=AR.x;this.y+=AR.y;return this};AP.distSqr=function(AR){var AS=new AQ(this.x-AR.x,this.y-AR.y);return AS.x*AS.x+AS.y*AS.y};AP.equals=function(AR,AS){if(isNaN(AS)){AS=0}return Math.abs(this.x-AR.x)<=AS&&Math.abs(this.y-AR.y)<=AS};AP.midPoint=function(AR){return new AQ(Math.round((this.x+AR.x)/2),Math.round((this.y+AR.y)/2))};AP.multiply=function(AR){this.x*=AR;this.y*=AR;return this};AP.round=function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this};AP.subtract=function(AR){this.x-=AR.x;this.y-=AR.y;return this};AP.toString=function(){return"("+this.x+", "+this.y+")"};return AQ}();N.Rectangle=function(){var AP=AO({init:function(){this.x1=0;this.x2=0;this.y1=0;this.y2=0}});AM(AP,"Rectangle");return AP}();N.RemoteStreetLink=function(){var AP=AO({toString:function(){return this._street.toString()}});AM(AP,"RemoteStreetLink");AN(AP,[["_firstNumberLeft","LAddrRef"],["_firstNumberRight","RAddrRef"],["_flags","Flags"],["_lastNumberLeft","LAddrNRef"],["_lastNumberRight","RAddrNRef"],["_linkID","linkid"],["_linkNumber","linkno"],["_names","Names"],["_points","Points"],["_postcodeLeft","LPostcode"],["_postcodeRight","RPostcode"],["_street","Street"],["_zLevelEnd","Z_End"],["_zLevelStart","Z_Start"]]);return AP}();F=N.Size=AO({init:function(AQ,AP){if(typeof (AQ)==="number"||(AQ instanceof Number)){this.width=AQ;this.height=((typeof (AP)==="number"||(AP instanceof Number))?AP:AQ)}else{if(typeof (AQ)==="object"){if(AQ instanceof F){this.width=AQ.width;this.height=AQ.height}else{if(AQ instanceof X){this.width=AQ.x;this.height=AQ.y}else{if(AQ.style){W(AQ,this)}}}}}},width:0,height:0,isNonZero:function(){return(this.width!==0||this.height!==0)},multiply:function(AP){this.width*=AP;this.height*=AP;return this},toString:function(){return""+this.width+"x"+this.height}});N.Street=function(){var AP=AO({toString:function(){var AR="";var AQ=0;while(!this._points[AQ]&&AQ<this._points.length){AQ++}if(this._points[AQ]){AR+=new I(this._points[AQ]).toString();if(this._points[this._points.length-1]){AR+=" -> ";AR+=new I(this._points[this._points.length-1]).toString()}}if(this._linkID){if(this._points[AQ]){AR+=": "}AR+=this._linkID.toString()}return AR}});AM(AP,"Street");AN(AP,[["_flags","Flags"],["_linkID","link_id"],["_links","m_links"],["_names","names"],["_linkCount","num_links"],["_points","Points"],["_zipLeft","leftzip"],["_zipRight","rightzip"]]);return AP}();AC=N.BoundingBox=function(){var AP=function(){var AS=this.getSW();var AR=this.getNE();delete this._items;this.add(AS);this.add(AR)};var AQ=AO({init:function(AS,AR){if(AS){this.add(AS);if(AR){this.add(AR)}}},_items:null,add:function(AU){if(AU instanceof AQ){this.add(AU.getSW());this.add(AU.getNE())}else{if(AU instanceof I){var AR=this._items,AS=AU.lat,AT=AU.lon;if(!AR){this._items=[AS,AT,AS,AT]}else{if(AS<AR[0]){AR[0]=AS}else{if(AS>AR[2]){AR[2]=AS}}if(AT<AR[1]){AR[1]=AT}else{if(AT>AR[3]){AR[3]=AT}}}}}},getCenter:function(){var AR=this._items;return new I((AR[0]+AR[2])/2,(AR[1]+AR[3])/2)},contains:function(AR){if(AR instanceof I){var AS=this._items;return AS&&AS[0]<=AR.lat&&AR.lat<=AS[2]&&AS[1]<=AR.lon&&AR.lon<=AS[3]}else{if(AR instanceof AQ){return this.contains(AR.getSW())&&this.contains(AR.getNE())}}},getNE:function(){var AR=this._items;return new I(AR[2],AR[3])},getSW:function(){var AR=this._items;return new I(AR[0],AR[1])},inflate:function(AS){var AR=this._items;AR[0]-=AS;AR[1]-=AS;AR[2]+=AS;AR[3]+=AS;AP.call(this)},inflateBy:function(AV){var AU=this._items,AW=AU[3]-AU[1],AR=AU[2]-AU[0],AT=AW*(AV-1)/2,AS=AR*(AV-1)/2;AU[0]-=AS;AU[1]-=AT;AU[2]+=AS;AU[3]+=AT;AP.call(this)},intersects:function(AR){var AS=this._items,AT=AR._items;return AS&&AS[0]<=AT[2]&&AS[1]<=AT[3]&&AS[2]>=AT[0]&&AS[3]>=AT[1]}});AM(AQ,"BoundingBox");return AQ}()})();(function(){J=N.EventHandler=function(){var AM=O.contains,AL=O.indexOf;var AN="__once";return D.create({init:function(){this._callbacks=[];this._transients=[]},_callbacks:null,_enabled:true,_transients:null,append:function(AO){this._callbacks.push(AO)},appendOnce:function(AO){AO[AN]=true;this._callbacks.push(AO)},appendTransient:function(AP,AO){if(AO){this._transients=[AP]}else{this._transients.push(AP)}},disable:function(){this._enabled=false},destroy:function(){delete this._callbacks;delete this._transients},enable:function(){this._enabled=true},isRegistered:function(AO){return AM(this._callbacks,AO)||AM(this._transients,AO)},remove:function(AO){this._callbacks.splice(AL(this._callbacks,AO),1)},replace:function(AO){this.appendTransient(AO,true)},trigger:function(){var AR=this._callbacks,AQ=this._transients;if(!this._enabled||!AR){return }var AP,AS,AO=arguments;if(AQ.length>0){AS=AQ.shift();AS.apply(window,AO)}else{for(AP=0;AP<AR.length;AP++){if((AR=this._callbacks)&&AR[AP]){AS=AR[AP];if(AS[AN]){AR.splice(AP--,1)}AS.apply(window,AO)}}}}})}();N.AuthExpiry=new J()})();(function(){f.DOM=function(){var AR=f.USE_FF2,AQ,AO,AS,AN,AT,AW,AP="__naturalZIndex",AM=(typeof (getComputedStyle)==="function"),AV={},AX=null,AL=function(Ae){var Ad=Ae,Aa=0,Ag=0;while(Ad){var Ab=AM?getComputedStyle(Ad,null):Ad.currentStyle,Af=parseInt(AM?Ab.getPropertyValue("border-left-width"):Ab.borderLeftWidth),Ac=parseInt(AM?Ab.getPropertyValue("border-top-width"):Ab.borderTopWidth);if(!isNaN(Af)){Aa+=Af}if(!isNaN(Ac)){Ag+=Ac}Ad=Ad.offsetParent}return new N.Point(Aa,Ag)},AU=function(Ad){var Ac=Ad,Aa=0,Af=0;while(Ac){var Ae=Ac.offsetLeft,Ab=Ac.offsetTop;if(!isNaN(Ae)){Aa+=Ae}if(!isNaN(Ab)){Af+=Ab}Ac=Ac.offsetParent}return new N.Point(Aa,Af)},AZ={absMousePos:AQ=function(Af){var Ae,Ac,Ad,Ah=0,Ag=0;if(Ac=Af.pageX,Ad=Af.pageY,(Ac||Ad)&&!AR){Ah=Ac;Ag=Ad}else{if((Ae=Af.currentTarget)===window){Ah=Af.screenX+Ae.pageXOffset;Ag=Af.screenY+Ae.pageYOffset}else{if(Ac=Af.clientX,Ad=Af.clientY,Ac||Ad){var Ab=document.body,Aa=document.documentElement;Ah=Ac+Ab.scrollLeft+Aa.scrollLeft;Ag=Ad+Ab.scrollTop+Aa.scrollTop}}}return new N.Point(Ah,Ag)},applyStyle:function(Ad,Ac){var Aa=Ad.style;for(var Ab in Ac){if(Ac.hasOwnProperty(Ab)){Aa[Ab]=Ac[Ab]}}},bordersOutside:function(){if(typeof (AW)==="undefined"){var Ab=document.createElement("div"),Aa=Ab.style;Aa.position="absolute";Aa.left="-20px";Aa.top="0px";Aa.width="10px";Aa.height="10px";Aa.border="5px solid black";document.body.appendChild(Ab);AW=(Ab.offsetWidth>10);document.body.removeChild(Ab)}return AW},clearPosition:function(Ab){var Aa=Ab.style;Aa.position="absolute";Aa.left=Aa.right=Aa.top=Aa.bottom=""},createElement:function(Ab,Ac,Af,Ae){var Ad=null,Aa=false;if(Af){Ad=document.getElementById(Af)}if(!Ad){Ad=document.createElement(Ab);Aa=true;AO(Ad);if(Af){Ad.id=Af}}if(typeof (Ae)==="function"){Ae(Ad)}if(Aa){if(typeof (Ac)==="string"||(Ac instanceof String)){Ac=document.getElementById(Ac)}if(Ac){Ac.appendChild(Ad)}}return Ad},detach:function(Ab){var Ac="geobase_garbage";if(!Ab){return }var Aa=document.getElementById(Ac);if(!Aa){Aa=document.createElement("div");Aa.id=Ac;Aa.style.display="none";document.body.appendChild(Aa)}AT(Ab);if(Ab.id===Ac){Ab.parentNode.removeChild(Ab)}else{Aa.appendChild(Ab);Aa.innerHTML=""}},disableSelection:AO=function(Aa){Aa.select=Aa.selectstart=function(Ab){if(Ab.preventDefault){Ab.preventDefault()}Ab.returnValue=false;return false};Aa.unselectable="on";Aa.style.MozUserSelect="none"},enableTranslucency:function(Ab){var Aa=Ab.style;if(Ab&&("filters" in Aa)){var Ac=Aa.filter||"";Ac+=" progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+Ab.src+"');";Aa.filter=Ac}},getImageSize:function(Ab,Ac){if(Ab in AV){Ac(AV[Ab])}else{var Aa=new Image();Aa.onload=function(){Aa.onload=null;var Ad=new F(Aa);AV[Ab]=Ad;Ac(Ad)};Aa.src=Ab}},makeInert:function(Ab){var Aa=f.Events.nothing;Ab.onmousedown=Aa;Ab.ondragstart=Aa;Ab.oncontextmenu=Aa},mouseInside:function(Ae,Ad){var Aa=AN(Ae,Ad),Ac=Aa.x,Ab=Aa.y;return(0<=Ac&&Ac<=Ad.offsetWidth&&0<=Ab&&Ab<=Ad.offsetHeight)},opposite:function(Aa){switch(Aa){case"left":return"right";case"right":return"left";case"top":return"bottom";case"bottom":return"top"}},popFromTop:AS=function(Ab){var Aa=Ab[AP];if(typeof (Aa)==="number"||(Aa instanceof Number)){Ab.style.zIndex=Aa;Ab[AP]=undefined}},preLoad:function(Aa){(new Image()).src=Aa},pushToTop:function(Ab,Ac){if(AX){AS(AX)}AX=Ab;var Aa=Ab.style;Ab[AP]=Aa.zIndex;Aa.zIndex=isNaN(Ac)?f.ZIndices.TOP:Ac},relMousePos:AN=function(Ad,Ab){var Ae=AQ(Ad),Aa=AU(Ab),Ac=AL(Ab);Ae.x-=Aa.x+Ac.x;Ae.y-=Aa.y+Ac.y;return Ae},setOpacity:function(Ae,Af){var Ab=Ae.style;if(Ae.filters){var Aa=Ab.filter,Ad=/alpha\([.]*\)/g,Ac="alpha(opacity="+Af*100+")";Ae.contentEditable="false";Aa=Aa.match(Ad)?Aa.replace(Ad,Ac):Ac;Ab.filter=Aa}else{Ab.opacity=Af}},stripScripts:AT=function(Ac){if(typeof (Ac)!=="object"){return }var Ab=Ac.childNodes;for(var Aa=0,Ad=Ab.length;Aa<Ad;Aa++){AT(Ab[Aa])}f.Events.remove(Ac);if(Ac.select){Ac.select=null}if(Ac.selectstart){Ac.selectstart=null}}};var AY=function(Ad,Ab,Ag){if(Ad[Ab]){return Ad[Ab]}else{if(Ad[Ag]){return Ad[Ag]}else{var Aa=AM?getComputedStyle(Ad,null):Ad.currentStyle;var Af=AM?Aa.getPropertyValue(Ag):Aa[Ag];if(Af){var Ac=Af.substr(Af.search(/[^0-9]+/)),Ae=parseInt(Af);if(Ac!=="%"){return Ae}else{if(Ad.parentNode){return AY(Ad.parentNode,Ab,Ag)*Ae/100}else{return 0}}}else{if(Ad.parentNode){return AY(Ad.parentNode,Ab,Ag)}else{return 0}}}}};W=function(Ab,Aa){if(!Aa){Aa=new F()}Aa.width=AY(Ab,"offsetWidth","width");Aa.height=AY(Ab,"offsetHeight","height");return Aa};return AZ}()})();(function(){var AL=N.destroy,AM;f.Events=function(){var AT=f.DOM.absMousePos,AQ,AS,AR,AP="__eventID",AN=[],AO=function(AW,AV,Ad,AX){var AZ,AY,Ae,Ac=typeof (AW);if(Ac==="number"||(AW instanceof Number)){Ae=AN[AW];if(Ae){var Ab=Ae[0];if(Ab){AW=Ab.elem}}}else{if(Ac==="function"){for(AZ=AN.length-1;AZ>=0;AZ--){AY=AO(AZ,AW,AX);if(!isNaN(AY)){return AY}}}else{if(Ac==="object"&&AW){var Aa=typeof (AV);Ad=(Aa==="function"?AV:Ad);AV=(Aa==="string"||(AV instanceof String)?AV:undefined);AY=AW[AP];Ae=AN[AY];if(Ae){for(AZ=Ae.length-1;AZ>=0;AZ--){var AU=Ae[AZ];if(AV&&AV!==AU.name){continue}if(Ad&&Ad!==AU.callback){continue}if(AX(Ae,AZ)){return AY}}}}}}};return{add:AM=function(AX,AV,AZ){if(AX&&(typeof (AX)==="string"||(AX instanceof String))){AX=document.getElementById(AX)}if(!AX){return }var AU="on"+AV;if(AX.addEventListener){AX.addEventListener(AV,AZ,false)}else{if(AX.attachEvent){AX.attachEvent(AU,AZ)}else{AX[AU]=AZ}}var AY=AX[AP];if(isNaN(AY)){AY=AX[AP]=AN.length}var AW=AN[AY];if(!AW){AW=AN[AY]=[]}AW.push({elem:AX,name:AV,callback:AZ})},addFocal:function(AW,AU,AV,AY){var AX=false;AM(AW,"mouseover",function(){AX=true});AM(AW,"mouseout",function(){AX=false});AM(AV,AU,function(AZ){if(AX){return AY(AZ)}})},beginDrag:function(AW,AZ,AY){var AX=null,AV=function(Aa){if(AX){var Ab=AT(Aa);AZ.call(AW,Ab.subtract(AX),Aa)}AX=AT(Aa);return AQ(Aa)},AU=function(Aa){if(AY){AY.call(AW)}AS(document,"mouseup",AU);AS(document,"mousemove",AV)};AM(document,"mousemove",AV);AM(document,"mouseup",AU)},flush:function(){if(!AN){return }for(var AW=AN.length-1;AW>=0;AW--){var AV=AN[AW];if(AV){var AU=AV[0];if(AU){var AX=AU.elem;if(AX&&AX[AP]){AS(AX)}}}}},maskUI:function(AW){var AU=["click","contextmenu","dblclick","mousedown","mouseup"];for(var AV=0,AX=AU.length;AV<AX;AV++){AM(AW,AU[AV],AR)}},nothing:AQ=function(AU){if(AU){if(AU.preventDefault){AU.preventDefault()}AU.returnValue=false}return false},onMouseOut:function(Ad,Ae){if(!(Ad instanceof Array)){Ad=[Ad]}var Ac=[],AX=[],AZ=function(){for(var Af=0,Ai=Ad.length;Af<Ai;Af++){var Ah=Ad[Af],Ag=AX[Af];AS(Ah,"mouseout",Ag.out);AS(Ah,"mouseover",Ag.over)}Ae()},AU=function(){setTimeout(function(){var Af=false;for(var Ag=0,Ah=Ac.length;Ag<Ah;Ag++){if(Ac[Ag]){Af=true;break}}if(!Af){AZ()}},50)};for(var Aa=0,AV=Ad.length;Aa<AV;Aa++){var AW=Ad[Aa],Ab=function(Af){return function(){Ac[Af]=true}}(Aa),AY=function(Af){return function(){Ac[Af]=false;AU()}}(Aa);Ac[Aa]=(Aa===0);AX[Aa]={over:Ab,out:AY};AM(AW,"mouseover",Ab);AM(AW,"mouseout",AY)}},registered:function(AW,AV,AX){var AU=false;AO(AW,AV,AX,function(){AU=true;return true});return AU},remove:AS=function(AV,AU,AX){var AW=AO(AV,AU,AX,function(Aa,AZ){var Ac=Aa[AZ],Ad=Ac.callback,Ab=Ac.elem,AY=Ac.name;if(Ab.removeEventListener){Ab.removeEventListener(AY,Ad,false)}else{if(AY.substring(0,2)!=="on"){AY="on"+AY}if(Ab.detachEvent){Ab.detachEvent(AY,Ad)}else{if(Ab[AY]){Ab[AY]=null}}}Aa.splice(AZ,1)});if(!isNaN(AW)&&AN[AW].length===0){AN[AW]=undefined}},terminate:AR=function(AU){if(AU.stopPropagation){AU.stopPropagation()}else{AU.cancelBubble=true}}}}();AM(window,"unload",function(){AL()})})();(function(){f.HTTPClient=function(){var AN=D.create,AP=Z.writeLine,AU=[],AS=["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.3.0","Msxml2.XMLHTTP","Microsoft.XMLHTTP"],AL=function(){var AZ=null;if(typeof (XMLHttpRequest)!=="undefined"){AZ=new XMLHttpRequest()}else{if(typeof (ActiveXObject)!=="undefined"){var AV=0,AY=AS.length;while(!AZ&&AV<AY){try{var AW=AS[AV];AZ=new ActiveXObject(AW);if(AZ){AS=[AW]}}catch(AX){}AV++}}}if(!AZ){throw new U("could not find an XHR constructor")}return AZ},AM=function(){if(AU.length>0){return AU.pop()}else{return AL()}},AT=function(AV){AV.onreadystatechange=function(){};AU.push(AV)},AO=function(AV){var AX=AV.status,AW=(200<=AX)&&(AX<300);return(!AX||AW||(AX===304))},AQ=function(AZ,AX,AV){var AW=this;AP("opening an HTTP "+AZ+" request for "+AX+"...");var AY=AM();AY.onreadystatechange=function(){if(AY.readyState===4){AP("response received from "+AX+".");var Aa=AY.status,Ab=AY.responseText;if(AO(AY)){AW.Load.trigger(Aa,Ab,AY.responseXML)}else{AW.Error.trigger(Aa,Ab)}AT(AY)}};AY.open(AZ,AX,true);AY.send(AV)},AR=AN({init:function(){this.Load=new J();this.Error=new J()},Error:null,Load:null,get:function(AV){AQ.call(this,"GET",AV,null)},post:function(AW,AV){AQ.call(this,"POST",AW,AV)}});return AR}()})();(function(){f.JSON=function(){var AQ=I.SERIAL_DP,AN=D.getDNClassDesc,AS=D.getDNPropName,AX=D.getJSClass,AL=D.getJSPropName,AU="_class",AO="__json",AP=AO+"RRefs",AW=AO+"Visited",AV=function(Ai,Ag,Aj){if(Ai instanceof I){Aj=AQ}var Ae=Ag.objects,Af=Ag.strings,Aa=typeof (Ai),Ab="",Al="",Ad=-1,Ak,Ac;if(Aa==="undefined"||Ai===null){return"null"}else{if(Aa==="number"||(Ai instanceof Number)){Al+=(isNaN(Aj)?Ai:Ai.toFixed(Aj))}else{if(Aa==="boolean"||(Ai instanceof Boolean)){Al+=Ai}else{if(Aa==="string"||(Ai instanceof String)){Ad=Af[Ai];if(typeof (Ad)!=="undefined"){Al+="{_ref:"+Ad+"}"}else{Af[Ai]=Ad=Ag.nextID++;Al+="_["+Ad+']="'+Ai+'"'}}else{if(Aa==="object"){var AZ;for(Ak=0,Ac=Ae.length;Ak<Ac;Ak++){if(Ae[Ak]===Ai){Ad=Ak}}if(Ad!==-1){Al+="{_ref:"+Ad+"}"}else{Ad=Ag.nextID++;Ae[Ad]=Ai;if(Ai instanceof Array){Al+="[";for(Ak=0,Ac=Ai.length;Ak<Ac;Ak++){AZ=Ai[Ak];if(typeof (AZ)!=="function"){Al+=Ab+AV(AZ,Ag,Aj);Ab=","}}Al+="]"}else{var Ah=AN(Ai.constructor);if(!Ah){throw new r("unknown type of "+Aa+" encountered while serializing.")}Ai[AU]=Ah;Al+="{";for(Ak in Ai){AZ=Ai[Ak];if(typeof (AZ)!=="function"){Al+=Ab;Ak=AS(Ai.constructor,Ak);if(/^[a-zA-Z_\$][a-zA-Z0-9_\$]*$/.test(Ak)){Al+=Ak}else{Al+='"'+Ak+'"'}Al+=":"+AV(AZ,Ag,Aj);Ab=","}}Al+="}";delete Ai[AU]}Al="_["+Ad+"]="+Al}}}}}}return Al},AR=function(Ab,AZ){for(var Ac=0,Aa=AZ.nextID;Ac<Aa;Ac++){if(Ab.search("{_ref:"+Ac+"}")<0){Ab=Ab.replace("_["+Ac+"]=","")}}return Ab},AY=function(Ab){if(typeof (Ab)==="object"&&Ab&&!Ab[AW]){var Ah;if(Ab[AU]){var Ae=AX(Ab[AU]);if(Ae){var Ai=new Ae(Ab);for(Ah in Ab){if(Ab.hasOwnProperty(Ah)){var Af=AL(Ae,Ah);if(Ah!==AU&&!Ah.indexOf(AO)!==0){Ai[Af]=Ab[Ah]}}}var Ag=Ab[AP];if(Ag){for(var Ac=0,Aa=Ag.length;Ac<Aa;Ac++){var Ad=Ag[Ac];Ad[0][Ad[1]]=Ai}}Ab=Ai;Ab[AW]=true}}for(Ah in Ab){if(Ah.indexOf(AO)!==0){var AZ=Ab[Ah];if(typeof (AZ)!=="function"){Ab[Ah]=AY(AZ)}}}}return Ab},AT=function(Ab,Aa){var Ae=[Ab];while(Ae.length>0){var Ag=Ae.pop();if(typeof (Ag)==="object"){for(var Ah in Ag){if(Ag.hasOwnProperty(Ah)&&Ah!==AP){var AZ=Ag[Ah],Ac=typeof (AZ);if(AZ!==null&&(Ac==="object"||Ac==="string")){if(typeof (AZ._ref)!=="undefined"){var Ad=Aa[AZ._ref],Af=Ad[AP];if(!Af){Af=Ad[AP]=[]}Af.push([Ag,Ah]);Ag[Ah]=Ad}else{Ae.push(AZ)}}}}}}},AM=function(Ac){var AZ=(Ac instanceof Array);if(typeof (Ac)==="object"&&Ac&&(Ac[AW]||AZ)){delete Ac[AP];delete Ac[AW];if(AZ){for(var Ab=0,Ad=Ac.length;Ab<Ad;Ab++){AM(Ac[Ab])}}else{for(var Aa in Ac){if(Ac.hasOwnProperty(Aa)){AM(Ac[Aa])}}}}};return{CLASS_TAG:AU,deserialize:function(Aa){if(Aa){window["_"]={};var AZ=window["eval"]("("+Aa+")");AT(AZ,window["_"]);AZ=AY(AZ);AM(AZ);return AZ}},serialize:function(Ab){var AZ={nextID:1,strings:{},objects:[]},Aa=AV(Ab,AZ);return AR(Aa,AZ)}}}()})();(function(){var AL=D.create;n=f.RTreeRect=AL({init:function(AT,AN){if(AT instanceof n){this._min=new I(AT._min);this._max=new I(AT._max)}else{if(!AN){AN=AT}var AO=this._min=new I(),AM=this._max=new I(),AQ=AT.lon,AP=AN.lon,AS=AT.lat,AR=AN.lat;AO.lat=Math.min(AS,AR);AO.lon=Math.min(AQ,AP);AM.lat=Math.max(AS,AR);AM.lon=Math.max(AQ,AP)}},_min:null,_max:null,addPoint:function(AQ){var AP=AQ.lon,AO=AQ.lat,AN=this._min,AM=this._max;if(AO<AN.lat){AN.lat=AO}else{if(AO>AM.lat){AM.lat=AO}}if(AP<AN.lon){AN.lon=AP}else{if(AP>AM.lon){AM.lon=AP}}},area:function(){var AN=this._min,AM=this._max;return(AM.lat-AN.lat)*(AM.lon-AN.lon)},contains:function(AN){var AP=this._min,AQ=AN._min,AM=this._max,AO=AN._max;return AP.lat<=AO.lat&&AM.lat>=AQ.lat&&AP.lon<=AO.lon&&AM.lon>=AQ.lon},intersection:function(AO){var AN=new n(this),AQ=AN._min,AR=AO._min,AM=AN._max,AP=AO._max;AQ.lat=Math.max(AQ.lat,AR.lat);AQ.lon=Math.max(AQ.lon,AR.lon);AM.lat=Math.min(AM.lat,AP.lat);AM.lon=Math.min(AM.lon,AP.lon);return AN},intersects:function(AN){var AP=this._min,AQ=AN._min,AM=this._max,AO=AN._max;return AP.lat<=AO.lat&&AM.lat>=AQ.lat&&AP.lon<=AO.lon&&AM.lon>=AQ.lon},union:function(AO){var AN=new n(this),AQ=AN._min,AR=AO._min,AM=AN._max,AP=AO._max;AQ.lat=Math.min(AQ.lat,AR.lat);AQ.lon=Math.min(AQ.lon,AR.lon);AM.lat=Math.max(AM.lat,AP.lat);AM.lon=Math.max(AM.lon,AP.lon);return AN}});p=f.RTreeNode=function(){var AO=10,AS=function(AT){var AV=this._rect,AU=this._parent;if(AV){this._rect=AV.union(AT)}else{this._rect=new n(AT)}if(AU){AS.call(AU,AT)}},AR=function(){var AV=this._children,AT=AV.length,AW=null;if(AT){AW=new n(AV[0]._rect);for(var AU=1;AU<AT;AU++){AW=AW.union(AV[AU]._rect)}}return AW},AN=function(){var AU=this._children,AY=AU.length,AW=-Infinity,Ac=[-1,-1];for(var AZ=0,AV=AY-1;AZ<AV;AZ++){for(var AX=AZ+1;AX<AY;AX++){var Aa=AU[AZ]._rect,AT=AU[AX]._rect,Ab=Aa.union(AT).area()-Aa.area()-AT.area();if(Ab>AW){Ac[0]=AZ;Ac[1]=AX;AW=Ab}}}return Ac},AM=function(AY){var AV=this._children,AX=Infinity,Ac=null;for(var AZ=0,AW=AV.length;AZ<AW;AZ++){var AU=AV[AZ],Ab=AU._rect,Ad=Ab.area(),AT=Ab.union(AY).area()-Ad,Aa;if(AT<=AX){if(AT<AX||Ad<Aa){Ac=AU;Aa=Ac._rect.area()}AX=AT}}return Ac},AQ=function(){this._rect=AR.call(this);var AT=this._parent;if(AT){AQ.call(AT)}},AP=AL({init:function(AT){this._tree=AT;this._children=[]},data:null,_isLeaf:true,_children:null,_tree:null,_parent:null,_rect:null,addChild:function(AY){var AV=this._children,AT=AV.length,AU=AY._rect;if(AT<AO){AV.push(AY);if(!this._isLeaf){AY._parent=this}AS.call(this,AU)}else{this.split();var AW=this._parent,AX;if(this._isLeaf){AX=AW.findTarget(AU)}else{AX=AM.call(AW,AU)}AX.addChild(AY)}},findTarget:function(AT){if(this._isLeaf){return this}else{return AM.call(this,AT).findTarget(AT)}},query:function(AV,AX){var AU=this._children;for(var AT=0;AT<AU.length;AT++){var AW=AU[AT];if(AW._rect.intersects(AV)){if(this._isLeaf){AX(AW)}else{AW.query(AV,AX)}}}},queryAll:function(AW){var AU=this._children;for(var AT=AU.length-1;AT>=0;AT--){var AV=AU[AT];if(this._isLeaf){AW(AV)}else{AV.queryAll(AW)}}},remove:function(AW,AY){var AU=this._children,AV=this._parent;for(var AT=0,Aa=AU.length;AT<Aa;AT++){var AZ=AU[AT],AX=AZ.data;if(AX&&AX===AW.data){AU.splice(AT,1);if(AU.length===0&&AV){AV.remove(this,true)}else{AQ.call(this)}return true}else{if(!this._isLeaf&&!AY&&AZ._rect.contains(AW._rect)){if(AZ.remove(AW,false)){return true}}}}return false},split:function(){var Ae=this._parent,Aj=this._tree;if(!Ae){Ae=new AP(Aj);Aj._root=Ae;Ae._isLeaf=false;Ae.addChild(this)}var Ag=AN.call(this),Af=Ag[0],AU=Ag[1],Ac=this._children,Ab=new AP(Aj),Ai=this._children=[],AW=Ab._children;this._rect=null;Ab._isLeaf=this._isLeaf;this.addChild(Ac[Af]);Ac[Af]=null;Ab.addChild(Ac[AU]);Ac[AU]=null;for(var AZ=0,AV=Ac.length;AZ<AV;AZ++){var AT=Ac[AZ];if(!AT){continue}var Aa=AT._rect,Ah=this._rect,AY=Ab._rect,AX=Ah.union(Aa).area()-Ah.area(),Ad=AY.union(Aa).area()-AY.area();if(AX<Ad){this.addChild(AT)}else{if(Ad<AX){Ab.addChild(AT)}else{if(Ai.length<AW.length){this.addChild(AT)}else{Ab.addChild(AT)}}}}Ae.addChild(Ab)}});return AP}();z=f.RTree=AL({init:function(){this._root=new p(this)},_root:null,insert:function(AO,AP){var AN=new p(this),AM=new n(AP);AN.data=AO;AN._rect=AM;this._root.findTarget(AM).addChild(AN)},query:function(AM,AN){this._root.query(AM,AN)},queryAll:function(AM){this._root.queryAll(AM)},remove:function(AN,AP){var AM=this._root;if(AN instanceof p){return AM.remove(AN,false)}else{var AO=false;AM.query(new n(AP),function(AQ){if(AQ.data===AN){AM.remove(AQ,false);AO=true}});return AO}}})})();(function(){AB=N.GeoStream=function(){var AS=f.JSON,Ad=f.USE_IE,Ai=D.create,Ae=AS.deserialize,AO=o.freeProperty,Al=o.freeHandlers,AV=f.getGUID,Ak=f.getServiceURL,Aa=AS.serialize,AP=D.serializeAs,AZ=D.serializeWith,AQ=Z.writeLine,Ag,AT,Am,AN,AY,AR,AL,Ac="AuthenticationRequiredException",AM="GeoStream.",AX=2083,Ah=30000,AU=[],Aj=[],AW=0,Af=false,Ab=function(Aq){var Ap=[[/%7b/gi,"{"],[/%7d/gi,"}"],[/%5b/gi,"["],[/%5d/gi,"]"],[/%3a/gi,":"],[/%3d/gi,"="],[/%2c/gi,","],[/%22/g,'"'],[/%20/g,"+"]];Aq=encodeURIComponent(Aq);for(var Ao=0,Ar=Ap.length;Ao<Ar;Ao++){var An=Ap[Ao];Aq=Aq.replace(An[0],An[1])}return Aq};return{DATAQUERY_PAGE:"dataquery.ashx",GEOCODER_PAGE:"geocoder.ashx",ROUTING_PAGE:"route.ashx",SETTINGS_PAGE:"settings.ashx",TRAFFIC_PAGE:"traffic.ashx",REGISTER_PAGE:Am="register.aspx",REQUEST_TIMEOUT:Ag=60000,callback:function(Ao){var An=AU[Ao];if(An){if(!Af){AQ("received GeoStream '"+An.method+"' invocation #"+Ao+".")}AO(AU,Ao);return function(As){var Ap=Ae(As);if(Ap.failed()){var Au=Ap.getError(),At=(Au.getInnerException()||Au).getType(),Ar;if(At===Ac){Ar=new H("authentication failed for request #"+Ao+".")}else{Ar=new c("a "+At+" was thrown by the GeoStream server: "+Au)}var Aq=An.errorCallback;if(Aq){Aq(Ar)}}else{An.callback(Ap.getResult())}}}else{return function(){}}},destroy:function(){Al(this)},invoke:function(Au,An,Ar,Aw,At,Av){var Ap=AW++,As=new AT(An,(Ar instanceof Array)?Ar:[Ar]),Ax=Ab(Aa(As));AU[Ap]={callback:Aw,errorCallback:At,method:An,json:Ax,timeout:Av,type:Au};if(!Af){AQ("invoking GeoStream function '"+An+"' #"+Ap+" from '"+Au+"'...")}var Ao=Ak()+Au,Aq=Ao+"?c=Telogis.GeoBase.GeoStream.callback("+Ap+")&p="+Ax;if(Aq.length>AX){throw new U("maximum URL length exceeded for request #"+Ap+".")}else{AL(function(){AY(Aq,null,function(Ay){AO(AU,Ap);if(At){At(new AF("request #"+Ap+" timed out ("+Ay+"ms)."))}},Av)})}},JSONRequest:function(){AT=Ai({init:function(Ao,An){this._id=AV();this._method=Ao;this._params=An.slice()},_id:0,_method:"",_params:null});AP(AT,AM+"JSONRequest");AZ(AT,[["_id","id"],["_method","method"],["_params","params"]]);return AT}(),JSONResponse:function(){var An=Ai({_error:null,_result:null,failed:function(){return !!this._error},getError:function(){return this._error},getResult:function(){return this._result}});AP(An,AM+"JSONResponse");AZ(An,[["_error","error"],["_id","id"],["_result","result"]]);return An}(),register:function(Aq){var At=f.serviceURLs,As=At.length,Ao=0,Au=function(){Ao++;if(Ao===As){for(var Av=0;Av<Aj.length;Av++){Aj[Av]()}Aj=null}};for(var Ap=0;Ap<As;Ap++){var Ar=At[Ap]+Am+"?a="+Aq;var An=new Image();An.onload=Au;An.src=Ar}},runScript:AY=function(Av,Au,As,Aq){if(!Av){return }var Ar=document.getElementsByTagName("head")[0],Aw=Ar.appendChild(document.createElement("script")),An=0,Ao=function(){Aw.onload=Aw.onreadystatechange=null;if(An){clearTimeout(An)}setTimeout(function(){Ar.removeChild(Aw);if(!Af){var Ax=Av.search(/i=/);if(Ax>=0){var Az=Av.substring(Ax+2);var Ay=Az.indexOf("&");if(Ay>=0){Az=Az.substring(0,Ay)}AQ("cleaned up request #"+Az+".")}}},Ah)},Ap=function(){if(Au){Au()}Ao()},At=function(){if(As){As(Aq)}Ao()};if(Ad){Aw.onreadystatechange=function(){var Ax=this.readyState;if(Ax==="loaded"){Ap()}}}else{Aw.onload=Ap}if(As){if(isNaN(Aq)){Aq=Ag}An=setTimeout(At,Aq)}Aw.setAttribute("type","text/javascript");Aw.setAttribute("src",Av)},ServerExceptionInfo:function(){AN=Ai({getInnerException:function(){return this._innerException},getType:function(){return this._type},toString:function(){return this._message}});AP(AN,"Internal.ServerExceptionInfo");AZ(AN,[["_innerException","InnerException"],["_message","Message"],["_source","Source"],["_stackTrace","RemoteStackTrace"],["_type","OriginalExceptionType"]]);return AN}(),setVerbosity:AR=function(An){Af=!!An},silence:function(){AR(false)},unsilence:function(){AR(true)},whenRegistered:AL=function(An){if(Aj){Aj.push(An)}else{An()}}}}()})();(function(){Y=N.XMLDoc=function(){var AM=D.create,AU=o.isElement,AV=1,AS=3,AO=4,AY=8,AQ=9,AN=["Msxml2.DOMDocument.6.0","Msxml2.DOMDocument.3.0"],AL=function(AZ){var Aa=null;if(typeof (ActiveXObject)!=="undefined"){Aa=new ActiveXObject("Msxml2.FreeThreadedDOMDocument.3.0");Aa.async=true;Aa.resolveExternals=true;Aa.loadXML(AZ.xml)}return Aa},AT=function(Aa,Ac){var AZ=null;if(typeof (ActiveXObject)!=="undefined"){var Ab=new ActiveXObject("Msxml2.XSLTemplate.3.0");Ab.stylesheet=AL(Aa);AZ=Ab.createProcessor();AZ.input=Ac}return AZ},AP=function(Ab){var Aa=Ab.childNodes;for(var AZ=0,Ae=Aa.length;AZ<Ae;AZ++){var Ad=Aa[AZ];if(Ad.tagName==="parsererror"){return Ad}else{var Ac=AP(Ad);if(Ac){return Ac}}}return null},AW=function(Ad,Ac,AZ){if(typeof (AZ)==="undefined"){AZ=true}var Ae=null;if(typeof (Ad.importNode)!=="undefined"){Ae=Ad.importNode(Ac,AZ)}else{switch(Ac.nodeType){case AV:var Ab,Af;Ae=Ad.createElement(Ac.nodeName);for(Ab=0,Af=Ac.attributes.length;Ab<Af;Ab++){var Aa=Ac.attributes[Ab].nodeName;Ae.setAttribute(Aa,Ac.getAttribute(Aa))}if(AZ){for(Ab=0,Af=Ac.childNodes.length;Ab<Af;Ab++){Ae.appendChild(AW(Ad,Ac.childNodes[Ab],AZ))}}break;case AS:case AO:case AY:Ae=Ad.createTextNode(Ac.nodeValue);break}}return Ae},AX=function(Af){var Ae=this.doc(),AZ=[],Aa;if(typeof (XPathEvaluator)!=="undefined"){var Ac=new XPathEvaluator();Aa=Ac.evaluate(Af,Ae,null,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null);if(Aa){var Ad=Aa.iterateNext();while(Ad){AZ.push(Ad);Ad=Aa.iterateNext()}}}else{if(typeof (Ae.selectNodes)!=="undefined"){Aa=Ae.selectNodes(Af);for(var Ab=0,Ag=Aa.length;Ab<Ag;Ab++){AZ[Ab]=Aa[Ab]}}}return AZ},AR=function(Ad){var Ac=this.doc(),Ab=null;if(typeof (XPathEvaluator)!=="undefined"){var Aa=new XPathEvaluator(),AZ=Aa.evaluate(Ad,Ac,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null);Ab=AZ.singleNodeValue}else{if(typeof (Ac.selectSingleNode)!=="undefined"){Ab=Ac.selectSingleNode(Ad)}}return Ab};return AM({init:function(Ab){var AZ=null,Aa=null;if(Ab!==null){var Ac=typeof (Ab);if(Ac==="string"||Ab instanceof String){Aa=Ab;AZ=null}else{if(Ac==="object"){if(Ab instanceof Y){Aa=Ab._text;AZ=Ab._doc}else{if(Ab.namespaces){Aa=null;AZ=Ab}else{if(Ab.xmlVersion){Aa=null;AZ=Ab}else{if(Ab.xml){Aa=Ab.xml;AZ=null}else{if(AU(Ab)){Aa=null;AZ=Ab}}}}}}}}if(AZ&&AZ.ownerDocument===null&&typeof (AZ.setProperty)!=="undefined"){AZ.setProperty("SelectionLanguage","XPath")}this._text=Aa;this._doc=AZ},appendChild:function(Ac){var Ab=new Y(Ac).root();if(Ab){var AZ=this.root(),Aa=AZ.ownerDocument;AZ.appendChild(AW(Aa,Ab));this._text=null}return this},doc:function(){if(!this._doc&&this._text){var AZ;if(typeof (DOMParser)!=="undefined"){var Ag=new DOMParser();this._doc=Ag.parseFromString(this._text,"text/xml");AZ=AP(this._doc);if(AZ){var Ac=AZ.textContent;this._doc=null;throw new h(Ac)}}else{if(typeof (ActiveXObject)!=="undefined"){var Aa=0,Af=AN.length,Ad;while(!Ad&&Aa<Af){try{var Ab=AN[Aa];Ad=new ActiveXObject(Ab);if(Ad){AN=[Ab]}}catch(Ae){}Aa++}Ad.async=false;Ad.loadXML(this._text);this._doc=Ad;if(this._doc.parseError){if(this._doc.parseError.errorCode!==0){AZ=this._doc.parseError;this._doc=null;throw new h("XML parsing error @"+AZ.line+":"+AZ.linepos+" -- "+AZ.reason+"\r\n"+AZ.srcText)}}}}}return this._doc},getAttribute:function(AZ){return this.root().getAttribute(AZ)},getTagName:function(){return this.root().tagName},parentNode:function(){return this.doc().parentNode},selectNodes:function(Ac){var Aa=[],AZ=AX.call(this,Ac);for(var Ab=0,Ad=AZ.length;Ab<Ad;Ab++){Aa[Ab]=new Y(AZ[Ab])}return Aa},selectSingleNode:function(Aa){var Ab=AR.call(this,Aa),AZ=new Y(Ab);return AZ.doc()?AZ:null},setAttribute:function(AZ,Aa){this.root().setAttribute(AZ,Aa);this._text=null;return this},replaceNode:function(Ad,Ab){var Ac=AR.call(this,Ad);if(Ac){var Aa=Ab.root(),AZ=Ac.ownerDocument;Ac.parentNode.appendChild(AW(AZ,Aa));Ac.parentNode.removeChild(Ac);return Ab}else{return null}},root:function(){var AZ=this.doc();if(AZ&&AZ.nodeType===AQ){return AZ.firstChild}else{return AZ}},text:function(){var Ac=this._doc;if(!this._text&&Ac){if(typeof (XMLSerializer)!=="undefined"){var Ab=new XMLSerializer();this._text=Ab.serializeToString(Ac)}else{var Aa=Ac.nodeTypeString;if(typeof (Aa)==="string"||(Aa instanceof String)){if(Aa==="attribute"||Aa==="element"){this._text=Ac.text}else{this._text=Ac.xml}}else{var AZ=this.root(),Ad=document.createElement("div");Ad.appendChild(AW(document,AZ));this._text=Ad.innerHTML}}}return this._text},transformXSL:function(Ad,Ae){var Ah,Af;var Aj="";if(typeof (XSLTProcessor)!=="undefined"){Ad=new Y(Ad).doc();Af=new XSLTProcessor();Af.importStylesheet(Ad);if(Ae){for(Ah in Ae){if(Ae.hasOwnProperty(Ah)){Af.setParameter(null,Ah,Ae[Ah])}}}var Ag=Af.transformToDocument(this.doc());var Ai=Ag.firstChild;if(Ai){if(Ai.tagName==="transformiix:result"){Aj=Ai.textContent}else{var Ab=Ag.getElementsByTagName("html");if(Ab&&Ab[0]){var AZ=Ab[0].getElementsByTagName("body");if(AZ&&AZ[0]){var Ac=AZ[0].getElementsByTagName("pre");if(Ac&&Ac[0]){Aj=Ac[0].textContent}}}}}}else{if(typeof (ActiveXObject)!=="undefined"){Ad=new Y(Ad);if(!Ae){return new Y(this.doc().transformNode(Ad.doc()))}else{Af=AT(Ad.doc(),this.doc());for(Ah in Ae){if(Ae.hasOwnProperty(Ah)){var Aa=Ae[Ah];if(typeof (Aa)!=="function"){Af.addParameter(Ah,Aa)}}}Af.transform();Aj=Af.output}}}return Aj}},{encodeXML:function(Aa){var AZ=Aa;AZ=AZ.replace("&","&amp;");AZ=AZ.replace("<","&lt;");AZ=AZ.replace(">","&gt;");AZ=AZ.replace('"',"&quot;");AZ=AZ.replace("'","&#39;");return AZ}})}()})();(function(){N.GeoCoder=function(){var AL=AB.GEOCODER_PAGE,AQ=D.create,AN=D.extend,AM=AB.invoke,AO=D.serializeAs,AP=D.serializeWith,AS=function(){var AT=AQ({_components:null,_confidence:0,_confidenceScores:null,_country:"",_matchType:"",_maxNumber:-1,_minNumber:-1,_number:-1,getCity:function(){return this.getComponent(1)},getComponent:function(AU){var AW=this._components;if(AW instanceof Array){var AV=AW[AU];if(typeof (AV)!=="undefined"){return""+AV}}},getConfidence:function(){return this._confidence},getConfidenceScores:function(){return this._confidenceScores},getCountry:function(){return this._country},getLocation:function(){return new I(this._loc)},getMatchType:function(){return this._matchType},getMaxNumber:function(){return +this._maxNumber},getMinNumber:function(){return +this._minNumber},getNumber:function(){return +this._number},getPostalCode:function(){return this.getComponent(3)},getRegion:function(){return this.getComponent(2)},getStreet:function(){return this.getComponent(0)},toString:function(){var AV=this._components,AU=this.getNumber(),AW="";if(AU>0){AW+=AU+" "}if(AV instanceof Array){AW+=this._components.join(", ").replace(/^[, ]+/,"")}return AW}});AO(AT,"GeocodeAddress");AP(AT,[["_components","m_values"],["_confidence","Confidence"],["_confidenceScores","m_confidenceScores"],["_country","Country"],["_loc","Location"],["_matchType","MatchType"],["_maxNumber","MaxNumber"],["_minNumber","MinNumber"],["_number","Number"]]);return AT}(),AR=function(){var AT=AQ({_city:"",_country:"",_number:-1,_postalCode:"",_region:"",_regions:null,_streetNames:null,getCity:function(){var AU=this._city;if(!AU){var AV=this._regions;if(AV){AU=AV[0]}}return AU||""},getCounty:function(){var AU=this._regions;if(AU){return AU[AU.length-2]||""}else{return""}},getCountry:function(){return this._country},getNumber:function(){return +this._number},getPostalCode:function(){return this._postalCode},getRegion:function(){var AU=this._region;if(!AU){var AV=this._regions;if(AV){AU=AV[AV.length-1]}}return AU||""},getStreet:function(){return this._streetNames[0]},toString:function(){var Ae="";var Af="";var AV=this._country;var Ab=this._streetNames;var AY=this._number;var AX=this._regions;var AU=this._postalCode;if(AY>0){Ae+=AY+" "}if(Ab.length>0&&Ab[0].length>0){Ae+=Ab[0];Af=", "}if(!AX){var AZ=this._city;var Ad=this._region;if(AZ&&AZ.length>0){Ae+=Af+AZ;Af=", "}if(Ad&&Ad.length>0){Ae+=Af+Ad;Af=", "}}else{for(var Aa=0,Ac=AX.length;Aa<Ac;Aa++){var AW=AX[Aa];if(AW){Ae+=Af+AW;Af=", "}}}if(AU&&AU.length>0){Ae+=Af+AU;Af=", "}if(AV!=="TrinidadTobago"&&AV!=="Unknown"){Ae+=Af+AV}return Ae}});AO(AT,"Address");AP(AT,[["_city","city"],["_country","country"],["_streetNames","names"],["_number","number"],["_postalCode","postalcode"],["_region","region"],["_regions","regions"]]);return AT}();return{Address:AR,CanadaGeoCodeAddress:function(){var AT=AN(AS,{getState:function(){return this.getComponent(2)}});AO(AT,"CanadaGeocodeAddress");return AT}(),GeoCodeAddress:AS,GeoCodeFull:function(){var AT=AQ({_address:null,_crossStreet:null,_crossStreetFound:false,_heading:0,_intersection:null,getAddress:function(){return this._address},getCrossStreet:function(){return this._crossStreet},getIntersection:function(){return new I(this._intersection)},getStreetLink:function(){return this._streetLink},toString:function(){return this._address+" (closest to intersection "+this._intersection+" on "+this._streetLink+")"}});AO(AT,"GeoCodeFull");AP(AT,[["_address","Address"],["_heading","heading"],["_crossStreet","crossStreet"],["_crossStreetFound","crossStreetFound"],["_intersection","Intersection"],["_streetLink","StreetLink"]]);return AT}(),HMMGeoCodeAddress:function(){var AT=AN(AS);AO(AT,"Internal.HMMGeocodeAddress");return AT}(),USGeoCodeAddress:function(){var AT=AN(AS,{getState:function(){return this.getComponent(2)},getZIPCode:function(){return this.getComponent(3)}});AO(AT,"USGeocodeAddress");return AT}(),geoCode:function(AT,AV,AW,AU){AM(AL,"GeoCode",[AT,AV],AW,AU)},geoCodeExtended:function(AT,AY,AW,AV,AX,AZ,AU){AM(AL,"GeoCodeExtended",[AT,AY,AW,AV,AX],AZ,AU)},reverseGeoCode:function(AU,AV,AT){AM(AL,"ReverseGeoCode",AU,AV,AT)},reverseGeoCodeFull:function(AU,AV,AT){AM(AL,"ReverseGeoCodeFull",AU,AV,AT)}}}()})();(function(){K=N.Transitions=function(){var AL=D.create;return{log:function(AM){return Math.pow(AM,0.8)},sine:function(AM){return(Math.cos(Math.PI*(1-AM))+1)/2},TimeLine:AL({init:function(){this.running=false;this.interval=1000/30;this.transitions=[];this.pending=[]},append:function(AO){var AM=this;var AN=new Date().getTime();if(AO.start+AO.duration<AN){return }if(AO.start>AN){this.pending.push(AO)}else{this.transitions.push(AO)}if(!this.running){this.running=true;this.tick.id=setInterval(function(){AM.tick()},this.interval)}return AO},replace:function(AO){var AM=this;var AN=new Date().getTime();if(AO.start+AO.duration<AN){return }if(AO.start>AN){this.pending=[AO];this.transitions=[]}else{this.transitions=[AO];this.pending=[]}if(!this.running){this.running=true;this.tick.id=setInterval(function(){AM.tick()},this.interval)}return AO},tick:function(){if(!this.running){clearInterval(this.tick.id);return }var AO=[];var AQ=[];var AT=this.pending.length;var AP=this.transitions.length;var AR=new Date().getTime();var AS;var AN,AM;for(AN=0;AN<AP;AN++){AS=this.transitions[AN];if(!AS){continue}if(AS.start+AS.duration<=AR){AS.tick(1)}else{AM=(AR-AS.start)/AS.duration;AS.tick(AM);AQ.push(AS)}}this.transitions=AQ;for(AN=0;AN<AT;AN++){AS=this.pending[AN];if(!AS){continue}if(AS.start<AR){AM=(AR-AS.start)/AS.duration;AS.tick(AM);this.transitions.push(AS)}else{AO.push(AS)}}this.pending=AO;if(this.transitions.length===0&&this.pending.length===0){this.running=false;clearInterval(this.tick.id)}}}),Transition:AL({init:function(AN,AO,AM){this.start=new Date().getTime();this.duration=AN;this.tick=AO;this.modifier=AM},tick:function(AM){if(this.modifier){AM=this.modifier(AM)}this.tick(AM)}})}}()})();(function(){q=N.MathUtil=function(){var AR;var AL;var AO;var AM;var AQ=function(AS){return Math.asin(Math.max(-1,Math.min(AS,1)))};var AN=function(AT,AS){if(AS===t.RADIANS){return AT}var AU=AT*180*60/Math.PI;switch(AS){case t.KNOTS:return AU;case t.FEET:return AU*6076.11549;case t.YARDS:return AU*2025.37183;case t.MILES:return AU*1.15077945;case t.METERS:return AU*1852;case t.KILOMETERS:return AU*1.852}};var AP=function(AT,AS){var AU=0;switch(AS){case t.RADIANS:return AT;case t.KNOTS:AU=AT;break;case t.FEET:AU=AT/6076.11549;break;case t.YARDS:AU=AT/2025.37183;break;case t.MILES:AU=AT/1.15077945;break;case t.METERS:AU=AT/1852;break;case t.KILOMETERS:AU=AT/1.852;break}return AU/(180*60/Math.PI)};return{bearing:function(AY,AX){var AW=AM(AY.lat);var AT=AM(AY.lon);var AU=AM(AX.lat);var AS=AM(AX.lon);var AV=Math.atan2(Math.sin(AS-AT)*Math.cos(AU),Math.cos(AW)*Math.sin(AU)-Math.sin(AW)*Math.cos(AU)*Math.cos(AS-AT));return(AO(AV)+360)%360},bearingToCompass:function(AS){var AT=Math.round(AL(AS,360)/45)%8;return["N","NE","E","SE","S","SW","W","NW","N"][AT]},convertUnits:AR=function(AU,AS,AT){return AN(AP(AU,AS),AT)},displace:function(AZ,AY,Ab,AX){var AU=AM(Ab);var Aa=AP(AY,AX);var AT=AM(AZ.lat);var AW=AM(AZ.lon);var AS=AQ(Math.sin(AT)*Math.cos(Aa)+Math.cos(AT)*Math.sin(Aa)*Math.cos(AU));var AV=AW+Math.atan2(Math.cos(AT)*Math.sin(Aa)*Math.sin(AU),Math.cos(Aa)-Math.sin(AT)*Math.sin(AS));return new I(AO(AS),AO(AV))},distance:function(AZ,Aa,AX){var AU=AM(AZ.lat);var AW=AM(AZ.lon);var AT=AM(Aa.lat);var AV=AM(Aa.lon);var Ab=Math.sin((AT-AU)/2);var AS=Math.sin((AV-AW)/2);var AY=Ab*Ab+Math.cos(AU)*Math.cos(AT)*AS*AS;var Ac=2*Math.atan2(Math.sqrt(AY),Math.sqrt(1-AY));return AR(Ac,t.RADIANS,AX||t.MILES)},positiveModulo:AL=function(AU,AT){var AS=AU%AT;return AS<0?AS+Math.abs(AT):AS},toRadians:AM=function(AS){return AS/180*Math.PI},toDegrees:AO=function(AS){return AS*180/Math.PI}}}()})();(function(){f.Projection=function(){var AO=D.create,AM=q.toRadians,AR,AN=function(AV){if(!AV){return new X(0,0)}var AT=this.worldWidthPixels(),AU=AT/(2*Math.PI),AS=AT/2+AM(AV.lon)/(2*Math.PI)*AT,AW=AT/2-(AU*Math.log(Math.tan(Math.PI/4+AM(AV.lat)/2)));return new X(AS,AW)},AL=function(){return AN.call(this,this._center)},AQ=function(AU){var AS=this.worldWidthPixels()/2,AW=AS/Math.PI,AT=(AS-AU.y)/AW,AV=(AU.x-AS)/AW;AV=AV*180/Math.PI;AT=Math.atan((Math.exp(AT)-Math.exp(-AT))/2)*180/Math.PI;return new I(AT,AV)},AP=function(AS){var AT=this._zoomLevels;if(0<=AS&&AS<AT.length){this._zoomIndex=AS;this._zoomLevel=AT[AS]}};return AO({init:function(AW,AU,AT,AV,AS){this._origin=new X(0,0);this._zoomLevels=AW.slice();this._tilesPerSuperTile=AT;this._tileSize=AU;this._dims=AS;this._center=new I(0,0);AP.call(this,AV)},_center:null,_dims:null,_origin:null,_tilesPerSuperTile:4,_tileSize:300,_zoomIndex:0,_zoomLevel:1,_zoomLevels:null,getCenter:function(){return this.getLatLon(this.getCenterXY())},getCenterXY:function(){var AS=this._dims;return new X(Math.round(AS.width/2),Math.round(AS.height/2))},getColCount:function(){return Math.ceil(this._dims.width/this._tileSize)+1},getLatLon:function(AU){var AV=this._dims,AT=this._origin,AS=AL.call(this);AS.x+=AU.x-AV.width/2-AT.x;AS.y+=AU.y-AV.height/2-AT.y;return AQ.call(this,AS)},getMaxZoomIndex:function(){return this._zoomLevels.length-1},getMinZoomIndex:function(){return 0},getOrigin:function(){return new X(this._origin)},getRowCount:function(){return Math.ceil(this._dims.height/this._tileSize)+1},getStartCol:function(){var AS=this.getTileOffset();return Math.floor(-(this._origin.x+AS.x)/this._tileSize)},getStartRow:function(){var AS=this.getTileOffset();return Math.floor(-(this._origin.y+AS.y)/this._tileSize)},getTileLocation:function(AV,AS){var AU=this.getTileOffset(),AT=this._tileSize;AU.x+=AS*AT;AU.y+=AV*AT;return AU},getTileCoords:function(AX,AS){var AW=this._dims,AU=this._tileSize,AV=this._tilesPerSuperTile*this._zoomLevel/2,AT=AL.call(this);AT.x=Math.floor((AT.x-(AW.width/2))/AU)+AS-AV;AT.y=Math.floor((AT.y-(AW.height/2))/AU)+AX-AV;if(AT.x<-AV){AT.x+=2*AV}if(AT.x>=AV){AT.x-=2*AV}return AT},getTileOffset:function(){var AU=this._dims,AS=this._tileSize,AT=AN.call(this,this._center).round();AT.x=-((AT.x-Math.floor(AU.width/2))%AS);AT.y=-((AT.y-Math.floor(AU.height/2))%AS);if(AT.x>0){AT.x-=AS}if(AT.y>0){AT.y-=AS}return AT},getTileSize:function(){return this._tileSize},getTilesPerSuperTile:function(){return this._tilesPerSuperTile},getXY:function(AT){var AV=this._dims,AU=this._origin,AS=AL.call(this),AW=AN.call(this,AT);AW.x+=AU.x-AS.x+AV.width/2;AW.y+=AU.y-AS.y+AV.height/2;return AW},getZoomIndex:function(){return this._zoomIndex},getZoomLevel:function(AS){return isNaN(AS)?this._zoomLevel:this._zoomLevels[AS]},pan:AR=function(AS){this._origin=new X(0,0);if(("lat" in AS)&&("lon" in AS)){this._center=new I(AS)}else{if(("x" in AS)&&("y" in AS)){this._center=this.getLatLon(AS)}}},setCenter:AR,setSize:function(AS){this._dims=new F(AS)},setOrigin:function(AS){this._origin=new X(AS)},setZoomIndex:function(AS){this.setCenter(this.getCenter());AP.call(this,AS)},worldWidthPixels:function(){return this._tilesPerSuperTile*this._tileSize*this._zoomLevel}})}()})();(function(){AJ=N.Routing=function(){var AT=t.MILES,Ah=t.RADIANS,Aq=AB.ROUTING_PAGE,AR=D.configure,AX=q.convertUnits,An=D.create,Aj=D.extend,Ap=AB.invoke,AV=o.parse,AO=D.serializeAs,Ab=D.serializeWith,Al="Routing.",AY,AM,Ai,AZ,Ad,Af,Ao,Ac,AU,Ak,Aa,Am,Ag,Ae,AL=function(){var Ar,As=An({_event:null,getDistance:function(At){var Au=this._event;return(Au?Au.getDistance(At):0)},getHeading:function(){var At=this._event;return(At?At.getHeading():0)},getInstructions:Ar=function(){var At=this._event;return(At?At._englishDirections+". ":"")},toString:Ar,getLocation:function(){var At=this._event;return(At?At.getLocation():null)},getNotes:function(){var At=this._event;return(At?At.getNotes():[])},getPoints:function(){var At=this._event;return(At?At.getPoints():[])},getStreet:function(){var At=this._event;return(At?At.getTargetStreet():"")},getTime:function(){var At=this._event;return(At?At.getTime():0)},isArrival:function(){return(this._event instanceof Ai)},isDeparture:function(){return(this._event instanceof Ad)}});AO(As,Al+"Direction");Ab(As,[["_event","dir"]]);return As}(),AW=function(){var Ar,As=An({_distance:0,_englishDirections:"",_heading:0,_lastStreet:"",_loc:null,_notes:null,_points:null,_renderPoints:null,_targetStreet:"",_time:0,getDistance:function(At){return AX(this._distance,Ah,At||AT)},getEnglishDirections:Ar=function(){return this._englishDirections},toString:Ar,getHeading:function(){return this._heading},getLastStreet:function(){return this._lastStreet},getLocation:function(){return this._loc},getNotes:function(){var At=this._notes;if(!At){this._notes=At=[]}return At},getPoints:function(){return this._renderPoints||this._points},getTargetStreet:function(){return this._targetStreet},getTime:function(){return this._time}});AO(As,Al+"DrivingEvent");Ab(As,[["_distance","distance"],["_heading","heading"],["_lastStreet","last_street"],["_loc","location"],["_notes","notes"],["_points","points_cache"],["_renderPoints","renderPoints"],["_targetStreet","_t_street"],["_time","Time"]]);return As}(),AS=function(){var Ar=Aj(AW,{_distance:0,_loc:null,getDistance:function(){return this._distance},getLocation:function(){return new I(this._loc)}});AO(Ar,Al+"DrivingNote");Ab(Ar,[["_loc","Loc"],["_distance","noteDistance"]]);return Ar}(),AP=function(){var Ar=Aj(AW,{_type:0,getType:function(){return this._type}});AO(Ar,Al+"MovementEvent");Ab(Ar,[["_type","m_type"]]);return Ar}(),AN=function(){var Ar=Aj(AP,{_exitNumber:"",_isLeftExit:false,exitNumber:function(){return this._exitNumber},isLeftExit:function(){return this._isLeftExit}});AO(Ar,Al+"RampMovement");Ab(Ar,[["_exitNumber","ExitNumber"],["_isLeftExit","LeftExit"]]);return Ar}(),AQ={ArriveEvent:AM=Aj(AW),ArrivalMovement:Ai=Aj(AP),DepartEvent:AZ=Aj(AW),DepartureMovement:Ad=Aj(AP),Direction:AL,Directions:function(){var Ar,As=An({getDirection:function(At){return this._directs[At]},getLength:function(){return this._directs.length},getInstructions:Ar=function(){var Av="",Au=this._directs;for(var At=0,Aw=Au.length;At<Aw;At++){Av+=Au[At].getInstructions()}return Av},toString:Ar,getPoints:function(){return this._points}});AO(As,Al+"Directions");Ab(As,[["_directs","directs"],["_points","points_cache"],["_totalDistance","totalDistance"],["_totalTime","totalTime"],["_violations","m_Violations"]]);return As}(),DrivingEvent:AW,DrivingNote:AS,FFRampMovement:Af=Aj(AN),FSRampMovement:Ao=Aj(AN),Movement:function(){var Ar=Aj(AL,{_stop:null,_type:"",getStop:function(){return this._stop},getType:function(){return this._type}});AO(Ar,Al+"Movement");Ab(Ar,[["_stop","stop"],["_type","type"]]);return Ar}(),MovementEvent:AP,NameChangeNote:Ac=Aj(AS),Note:function(){var Ar=Aj(AL,{_type:0,getType:function(){return this._type}});AO(Ar,Al+"Note");Ab(Ar,[["_type","noteType"]]);return Ar}(),RoadCrossingBehavior:{ALLOWED:AY="Allowed",DISCOURAGED:"Discouraged",FORBIDDEN:"Forbidden"},Route:function(){var At=16,As=function(){var Au=this._stops.length;if(this._start){Au++}if(this._end){Au++}if(Au<2){throw new v("not enough stops in routing request")}if(Au>At){throw new U("too many stops in routing request")}},Ar=An({init:function(Au){this._start=null;this._end=null;this._strategy=AV(Au,"strategy",new Aa());this._stops=[];this.appendStops(AV(Au,"stops",[]));this.useTraffic({})},_end:null,_start:null,_stops:null,_strategy:null,_trafficSource:null,_time:null,useTraffic:function(Au){this._trafficSource=AV(Au,"source",null);this._time=AV(Au,"time",new Date());if(typeof (this._time)!=="string"){function Aw(Ax){Ax=""+Ax;while(Ax.length<2){Ax="0"+Ax}return Ax}var Av=this._time;this._time=Av.getFullYear()+"-"+Aw(Av.getMonth()+1)+"-"+Aw(Av.getDate())+"T"+Aw(Av.getHours())+":"+Aw(Av.getMinutes())+":"+Aw(Av.getSeconds())}},appendStop:function(Au){this._stops.push(new AU(Au))},addStopAt:function(Av,Au){this._stops.splice(Au,0,new AU(Av))},appendStops:function(Av){for(var Au=0;Au<Av.length;Au++){this.appendStop(Av[Au])}},getDirections:function(Av,Au){As.call(this);Ap(Aq,"GetDirectionsStateless",this,Av,Au)},getEnd:function(){return this._end.getLocation()},getStart:function(){return this._start.getLocation()},getStop:function(Au){return this._stops[Au].getLocation()},getStopCount:function(){return this._stops.length},optimize:function(Ax,Av){As.call(this);var Au=this;var Aw=function(Az){Au._stops=[];for(var Ay=0;Ay<Az.length;Ay++){Au.appendStop(Az[Ay].getLocation())}if(typeof (Ax)==="function"){Ax()}};Ap(Aq,"OptimizeStateless",this,Aw,Av)},setEnd:function(Au){this._end=new AU(Au)},setStart:function(Au){this._start=new AU(Au)},setStrategy:function(Au){this._strategy=Au}},{MAX_STOP_COUNT:At});AR(Ar,["stops","strategy"]);AO(Ar,Al+"Route");Ab(Ar,[["_end","End"],["_start","Start"],["_stops","Stops"],["_strategy","Strategy"],["_time","CurrentTime"],["_trafficSource","TrafficSource"]]);return Ar}(),RouteStop:AU=function(){var Ar=An({init:function(As){if(typeof (As)==="object"){if(("lat" in As)&&("lon" in As)){this._loc=new I(As)}else{if("_loc" in As){this._loc=new I(As._loc)}}}},_loc:null,getAverageTime:function(){return this._averageTime},getDescription:function(){return this._desc||""},getHeading:function(){var As=this._heading;return isNaN(As)?NaN:As},getLocation:function(){return new I(this._loc)},getRoadIntersection:function(){var As=this._roadIntersection;return As?new I(this._roadIntersection):null},getStopNumber:function(){return this._stopNumber},getWindowEnd:function(){return this._windowStart},getWindowStart:function(){return this._windowStart},isEnd:function(){return this._isEnd},isStart:function(){return this._isStart}});AO(Ar,"RouteStop");Ab(Ar,[["_averageTime","AverageTime"],["_desc","Description"],["_heading","Heading"],["_isEnd","m_End"],["_isStart","m_Start"],["_loc","Location"],["_point","m_Point"],["_roadIntersection","RoadIntersection"],["_stopNumber","StopNumber"],["_tag","Tag"],["_windowEnd","WindowEnd"],["_windowStart","WindowStart"],["_dontLoadBefore","DontLoadBefore"],["_incompatibleLoads","IncompatibleLoads"],["_load","Load"],["_penalty","Penalty"],["_skillsRequired","SkillsRequired"]]);return Ar}(),RoutingStrategy:function(){Ak=An({init:function(Ar){if(Ar){this._allowUTurns=AV(Ar,"allowUTurns",this._allowUTurns);this._decomposeSuperLinks=AV(Ar,"decomposeSuperLinks",this._decomposeSuperLinks);this._roadCrossingBehavior=AV(Ar,"roadCrossingBehavior",this._roadCrossingBehavior);this._useTollRoads=AV(Ar,"useTollRoads",this._useTollRoads)}},_allowUTurns:false,_decomposeSuperLinks:false,_roadCrossingBehavior:AY,_useTollRoads:true,getAllowUTurns:function(){return this._allowUTurns},getDecomposeSuperLinks:function(){return this._decomposeSuperLinks},getRoadCrossingBehavior:function(){return this._roadCrossingBehavior},getUseTollRoads:function(){return this._useTollRoads},setAllowUTurns:function(Ar){this._allowUTurns=Ar},setDecomposeSuperLinks:function(Ar){this._decomposeSuperLinks=Ar},setRoadCrossingBehavior:function(Ar){this._roadCrossingBehavior=Ar},setUseTollRoads:function(Ar){this._useTollRoads=Ar}});AR(Ak,["allowUTurns","decomposeSuperLinks","roadCrossingBehavior","useTollRoads"]);Ab(Ak,[["_allowUTurns","AllowUTurns"],["_decomposeSuperLinks","DecomposeSuperLinks"],["_roadCrossingBehavior","RoadCrossingBehavior"],["_useTollRoads","UseTollRoads"]]);return Ak}(),RoutingStrategyFastest:Aa=Aj(Ak),RoutingStrategyShortest:Am=Aj(Ak),SFRampMovement:Ag=Aj(AP),SplitMovement:Ae=Aj(AP),TurnMovement:function(){var Ar=Aj(AP,{_isEndOfStreet:false,_isLeftTurn:false,_isRightTurn:false,_prevLeft:"",_prevLeftCount:-1,_prevRight:"",_prevRightCount:-1,getPrevLeft:function(){return this._prevLeft||""},getPrevLeftCount:function(){var As=this._prevLeftCount;return isNaN(As)?-1:As},getPrevRight:function(){return this._prevRight||""},getPrevRightCount:function(){var As=this._prevRightCount;return isNaN(As)?-1:As},isEndOfStreet:function(){return this._isEndOfStreet},isLeftTurn:function(){return this._isLeftTurn},isRightTurn:function(){return this._isRightTurn}});AO(Ar,Al+"TurnMovement");Ab(Ar,[["_isEndOfStreet","m_EndOfStreet"],["_isLeftTurn","TurnLeft"],["_isRightTurn","TurnRight"],["_prevLeft","PrevLeft"],["_prevLeftCount","NumLefts"],["_prevRight","PrevRight"],["_prevRightCount","NumRights"]]);return Ar}()};AO(AM,Al+"ArriveEvent");AO(Ai,Al+"ArrivalMovement");AO(AZ,Al+"DepartEvent");AO(Ad,Al+"DepartureMovement");AO(Af,Al+"FFRampMovement");AO(Ao,Al+"FSRampMovement");AO(Ac,Al+"NameChangeNote");AO(Aa,Al+"RoutingStrategyFastest");AO(Am,Al+"RoutingStrategyShortest");AO(Ag,Al+"SFRampMovement");AO(Ae,Al+"SplitMovement");return AQ}()})();(function(){N.DataQuery=function(){var AM=AB.DATAQUERY_PAGE,AL=AB.invoke;return{queryPOI:function(AR,AP,AO){var AQ=0;while(typeof (arguments[AQ])!=="function"){AQ++}var AS=arguments[AQ];var AN=arguments[AQ+1];if(!(AP instanceof Array)){AP=null}if(typeof (AO)!=="string"&&!(AO instanceof String)){AO=""}AL(AM,"QueryPoi",[AR,AP,AO],AS,AN)}}}()})();(function(){var AL=f.DOM;N.Skin=function(){R=D.create({init:function(AM){this._images={};this._sizes={};this.Load=new J()},_images:null,_sizes:null,_initImageDiv:function(AP,AN){var AM=this._sizes[AN],AO=AP.style;AO.width=AM.width+"px";AO.height=AM.height+"px";AO.backgroundImage="url("+this._images[AN]+")";AO.backgroundPosition="center center";AO.padding="0px";return AP},destroy:function(){o.freeHandlers(this)},isLoaded:function(){var AN=true,AM=this._images,AP=this._sizes;for(var AO in AM){if(AM.hasOwnProperty(AO)){if(!AP[AO]){AN=false;break}}}return AN},load:function(){var AO=this,AN=this._images,AQ=this.Load,AR=this._sizes;var AM=function(AS){return function(AT){AR[AS]=AT;if(AO.isLoaded()){AQ.trigger()}}};for(var AP in AN){if(AN.hasOwnProperty(AP)){AL.getImageSize(AN[AP],AM(AP))}}},whenLoaded:function(AM){if(this.isLoaded()){AM()}else{this.Load.appendOnce(AM)}}},{destroyInstances:function(){for(var AP=0;AP<R.Derived.length;AP++){var AN=R.Derived[AP];for(var AO in AN){var AM=AN[AO];if(AM instanceof AN){AM.destroy()}}}}});return R}()})();(function(){var AL=f.Events,AN=AL.add,AO=AL.remove,AM=D.configure,AP=D.virtualize;N.AbstractDOMEntity=function(){var AR=Z.writeLine,AU=f.getGUID,Ac=f.DOM,AT=Ac.disableSelection,AX=Ac.popFromTop,AS=Ac.pushToTop,AV=o.freeProperty,AY=o.freeHandlers,AW=o.parse,Aa="id",AZ="silent",AQ={},Ab=function(Ad){return document.createElement("div")};E=D.create({init:function(Ae,Ad){this.id=AW(Ae,Aa,"anonymous_"+AU());this._silent=AW(Ae,AZ,false);var Ag=this.id;this.log("constructing...");AQ[Ag]=this;if(!Ad){Ad=Ab}var Af=this.elem=Ad.call(this,Ae);if(!Af.id){Af.id=Ag+"_elem"}AT(Af);this.Hide=new J();this.Show=new J()},_silent:false,_visibility:0,elem:null,Hide:null,id:"",Show:null,addEvent:function(Ad,Ae){AN(this.elem,Ad,Ae)},destroy:function(){this.log("destroying...");delete AQ[this.id];AV(this,"elem");AY(this)},hide:function(Af){var Ae=this.elem,Ad=this._visibility=0;if(Ae){Ae.style.display="none";if(!Af){this.Hide.trigger(Ad)}}},hideCumulative:function(Af){var Ae=this.elem,Ad=--this._visibility;if(Ae&&Ad<=0){Ae.style.display="none";if(!Af){this.Hide.trigger(Ad)}}},isVisible:function(){var Ad=this.elem;return Ad?(Ad.style.display!=="none"):false},log:function(Ad){if(!this._silent){AR(this.id+": "+Ad)}},popFromTop:function(){var Ad=this.elem;if(Ad){AX(Ad)}},pushToTop:function(Ae){var Ad=this.elem;if(Ad){AS(Ad,Ae)}},removeEvent:function(Ad,Ae){AO(this.elem,Ad,Ae)},setVisibility:function(Ad){if(Ad){this.show()}else{this.hide()}},show:function(Af){var Ae=this.elem,Ad=this._visibility=1;if(Ae){Ae.style.display="block";if(!Af){this.Show.trigger(Ad)}}},showCumulative:function(Af){var Ae=this.elem,Ad=++this._visibility;if(Ae&&Ad>0){Ae.style.display="block";if(!Af){this.Show.trigger(Ad)}}},toggleVisibility:function(){this.setVisibility(!this.isVisible())},toString:function(){return this.id},whenVisible:function(Ad){if(this.isVisible()){Ad()}else{this.Show.appendOnce(Ad)}}},{destroyInstances:function(){for(var Ad in AQ){if(AQ.hasOwnProperty(Ad)){AQ[Ad].destroy()}}AQ=[]}});AM(E,[Aa,AZ]);AP(E,["destroy"]);return E}();N.HandledDOMEntity=function(){var AT=AL.nothing,AS=E.prototype,AQ=AS.init,AR=AS.destroy;G=D.extend(E,{init:function(AW,AU){AQ.call(this,AW,AU);var AV=this,AX=this.elem;AN(AX,"mousedown",AT);AN(AX,"contextmenu",AT);this.Click=new J();AN(AX,"click",function(AY){AV.Click.trigger(AY)});this.DoubleClick=new J();AN(AX,"dblclick",function(AY){AV.DoubleClick.trigger(AY)});this.MouseDown=new J();AN(AX,"mousedown",function(AY){AV.MouseDown.trigger(AY)});this.MouseMove=new J();AN(AX,"mousemove",function(AY){AV.MouseMove.trigger(AY)});this.MouseIn=new J();AN(AX,"mouseover",function(AY){AV.MouseIn.trigger(AY)});this.MouseOut=new J();AN(AX,"mouseout",function(AY){AV.MouseOut.trigger(AY)});this.MouseUp=new J();AN(AX,"mouseup",function(AY){AV.MouseUp.trigger(AY)});this.RightClick=new J();AN(AX,"contextmenu",function(AY){AV.RightClick.trigger(AY)})},Click:null,DoubleClick:null,MouseDown:null,MouseMove:null,MouseIn:null,MouseOut:null,MouseUp:null,RightClick:null,destroy:function(){AR.call(this)}});AM(G);AP(G,["destroy"]);return G}()})();(function(){j=N.Canvas=function(){var AY=f.DOM.createElement,AN=o.freeProperty,AS=o.parse,AL=4,AO=2,AT=1,AM=1,Ad=2,AR=function(){var Ae=document.createElement("canvas");return typeof (Ae.getContext)==="function"}(),AX=AR?AM:Ad,AP=AX===AM,Ab="lineWidth",Aa="parent",Ac="size",AQ=["fillColor","fillColour"],AZ=["lineColor","lineColour"],AW=function(){if(AX===AM){var Af=this._container.getContext("2d"),Ae=this._size;Af.clearRect(0,0,Ae.width,Ae.height)}},AU=E.prototype,AV=D.extend(E,{init:function(Ag,Ae){var Al=this;Ag=Ag||{};AU.init.call(this,Ag,function(An){var Ao=AS(An,Aa,document.body);return AY("div",Ao,Al.id,function(Ar){var Aq=Ar.style;Aq.overflow="hidden";Aq.position="absolute";var Ap=AY(AX===AM?"canvas":"div",Ar),As=Ap.style;As.position="absolute";As.left="0px";As.top="0px";Al._container=Ap;if(Ae){Ae(Ar)}})});var Aj=!!AS(Ag,AZ,true),Ak=!!AS(Ag,AQ,false);this._lineWidth=AS(Ag,Ab,1);this._lineColor=!Aj?Aj:AS(Ag,AZ,new T(0,0,0));this._fillColor=!Ak?Ak:AS(Ag,AQ,new T(255,255,255));this._offset=new X(0,0);this._shapes=[];var Am,Af=Ag[Ac];if(Af){Am=new F(Af)}else{var Ah=this.elem,Ai=Ah.style;if(Ai.width||Ai.height){Am=new F(Ah)}else{Am=new F(Ah.parentNode)}}this.setSize(Am)},_container:null,_fillColor:null,_lineColor:null,_lineWidth:1,_locked:false,_offset:null,_shapes:null,_size:null,circle:function(Af,Ae){return this.ellipse(Af,Ae,Ae)},destroy:function(){this._locked=true;var Ae=this._shapes,Ag=Ae.length;AU.destroy.call(this);AN(this,"_container");for(var Af=Ag-1;Af>=0;Af--){Ae[Af].destroy()}},ellipse:function(Ae,Ah,Ag){var Af=new AV.Shapes.Ellipse(this);Af.center=new X(Ae);Af.radiusX=isNaN(Ah)?0:Ah;Af.radiusY=isNaN(Ag)?0:Ag;return Af},getFillColor:function(){var Ae=this._fillColor;return(Ae?new T(Ae):null)},getHeight:function(){return this._size.height},getLineColor:function(){var Ae=this._lineColor;return(Ae?new T(Ae):null)},getLineWidth:function(){return this._lineWidth},getSize:function(){return new F(this._size)},getWidth:function(){return this._size.width},line:function(Af,Ae){return this.polyline([Af,Ae])},path:function(Af){var Ae=[],Am=new AV.Shapes.Path(this);if(Af){var Ak=Af.length;for(var Ah=0;Ah<Ak;Ah++){var Aj=Af[Ah],Ai=Aj.length,Al=[Aj[0]];for(var Ag=1;Ag<Ai;Ag++){Al[Ag]=new X(Aj[Ag])}Ae[Ah]=Al}}Am.commands=Ae;return Am},polyline:function(Ah,Af){var Aj=[],Ae=new AV.Shapes.PolyLine(this);if(Ah){var Ai=Ah.length;for(var Ag=0;Ag<Ai;Ag++){Aj[Ag]=new X(Ah[Ag])}}Ae.points=Aj;Ae.closed=Af;return Ae},rect:function(Ag,Af){var Ae=new AV.Shapes.Rect(this);Ae.p1=new X(Ag);Ae.p2=new X(Af);return Ae},setFillColor:function(Ae){this._fillColor=(Ae?new T(Ae):null)},setLineColor:function(Ae){this._lineColor=(Ae?new T(Ae):null)},setLineWidth:function(Ae){this._lineWidth=Ae},setSize:function(Am){if(!Am||typeof (Am)!=="object"){Am=this._size||new F()}var Af=Math.round(Am.width),Ak=Math.round(Am.height);if(!Af||!Ak){throw new A("no dimensions available for "+this.id)}Am=new F(Af,Ak);var Ah=this.elem.style;Ah.width=Af+"px";Ah.height=Ak+"px";if(AX===AM){var Ae=this._container;Ae.width=Af;Ae.height=Ak}else{var Aj=this._container.style;Aj.width=Af+"px";Aj.height=Ak+"px"}var Ag=this._shapes,Al=Ag.length;for(var Ai=0;Ai<Al;Ai++){Ag[Ai]._setSize(Am)}this._size=Am;this.update()},update:function(){var Ae=this._shapes,Ag=Ae.length;if(AP){AW.call(this)}for(var Af=0;Af<Ag;Af++){Ae[Af].draw()}}},{API:AX,COMMAND_BEZIER:AL,BEZIER_ARC_APPROX:0.2761423749154*2,API_CANVAS:AM,COMMAND_LINE:AO,COMMAND_MOVE:AT,USE_RASTER:AP,API_VML:Ad});D.configure(AV,[AQ,AZ,Ab,Aa,Ac]);return AV}()})();(function(){var AM=j.API,AP=j.API_CANVAS,AL=j.API_VML;j.Shapes=function(){var AU=j.COMMAND_BEZIER,AR=j.COMMAND_LINE,AQ=j.COMMAND_MOVE,AV=f.DOM.createElement,AT=D.extend,AX=o.freeProperty,AW=function(Ac,Aa){var Ab=Aa._offset,AZ=Math.round(Ac.x+Ab.x),AY=Math.round(Ac.y+Ab.y);return new X(AZ,AY)},AS=function(){var AY=D.create({_canvas:null,fillColor:null,lineColor:null,lineWidth:1,init:function(Ac){if(!(Ac instanceof j)){throw new C("shape created without a valid canvas")}var AZ=Ac._shapes,Ab=AZ.length;AZ[Ab]=this;this._index=Ab;this._canvas=Ac;this.fillColor=Ac.getFillColor();this.lineColor=Ac.getLineColor();this.lineWidth=Ac.getLineWidth();if(AM===AL){var Aa=this;this.elem=AV("vml:shape",Ac._container,null,function(Ae){var Ad=Ae.style;Ae.coordOrigin="0 0";Ad.backgroundColor="transparent";Ad.position="absolute";Ad.left="0px";Ad.top="0px";Aa._fillElem=AV("vml:fill",Ae);Aa._pathElem=AV("vml:path",Ae);var Af=AV("vml:stroke",Ae);Af.joinstyle="round";Af.endcap="round";Aa._strokeElem=Af})}this._setSize(Ac.getSize())},_setSize:function(Ab){if(AM===AL){var Ad=this.elem,Aa=Ad.style,Ac=Ab.width,AZ=Ab.height;Ad.coordsize=Ac+" "+AZ;Aa.width=Ac+"px";Aa.height=AZ+"px"}},destroy:function(){this._canvas._shapes.splice(this._index,1);if(this.elem){AX(this,"elem")}if(this._fillElem){AX(this,"_fillElem")}if(this._pathElem){AX(this,"_pathElem")}if(this._strokeElem){AX(this,"_strokeElem")}delete this._canvas},draw:function(){var Aa=this._validate();if(Aa){throw new i("invalid '"+Aa+"' specification for shape")}var Af=this.fillColor,Ae=this.lineColor;switch(AM){case AP:var Ab=this._canvas._container.getContext("2d");if(Ae instanceof T){Ab.strokeStyle=Ae.toCSSRGBA()}if(Af instanceof T){Ab.fillStyle=Af.toCSSRGBA()}Ab.lineWidth=this.lineWidth;Ab.lineJoin="round";Ab.lineCap="round";this._draw(Ab);if(Af){Ab.fill()}if(Ae){Ab.stroke()}break;case AL:var Ac=this.elem.style,AZ=this._fillElem,Ad=this._strokeElem;Ac.display="none";AZ.on=(Af?"true":"false");Ad.on=(Ae?"true":"false");if(Ae){Ad.color=Ae.toCSSHex();Ad.opacity=Ae.a}if(Af){AZ.color=Af.toCSSHex();AZ.opacity=Af.a}Ad.weight=this.lineWidth+"px";this._pathElem.v=this._draw()||"e";Ac.display="block";break}}});D.virtualize(AY,["_draw","_validate"]);return AY}();return{Ellipse:AT(AS,{center:null,radiusX:0,radiusY:0,_draw:function(Ab){var Aj,AY=AW(this.center,this._canvas),Ag=AY.x,Af=AY.y,Ad=this.radiusX,Ac=this.radiusY,Aa=Math.round(Ad),AZ=Math.round(Ac);switch(AM){case AP:var Ai=j.BEZIER_ARC_APPROX,Ae=Math.round(Ai*Ad),Ah=Math.round(Ai*Ac);Ab.beginPath();Ab.moveTo(Ag-Aa,Af);Ab.bezierCurveTo(Ag-Aa,Af-Ah,Ag-Ae,Af-AZ,Ag,Af-AZ);Ab.bezierCurveTo(Ag+Ae,Af-AZ,Ag+Aa,Af-Ah,Ag+Aa,Af);Ab.bezierCurveTo(Ag+Aa,Af+Ah,Ag+Ae,Af+AZ,Ag,Af+AZ);Ab.bezierCurveTo(Ag-Ae,Af+AZ,Ag-Aa,Af+Ah,Ag-Aa,Af);break;case AL:Aj="ar ";Aj+=(Ag-Aa)+","+(Af-AZ)+",";Aj+=(Ag+Aa)+","+(Af+AZ)+",";Aj+=(Ag-Aa)+","+(Af)+",";Aj+=(Ag-Aa)+","+(Af)+" e";break}return Aj},_validate:function(){var AY=this.center;if(typeof (AY)!=="object"){return"center"}if(isNaN(AY.x)){return"center.x"}if(isNaN(AY.y)){return"center.y"}if(isNaN(this.radiusX)){return"radiusX"}if(isNaN(this.radiusY)){return"radiusY"}}}),Path:AT(AS,{commands:null,_draw:function(AY){var Al,AZ=this._canvas,Aj=this.commands,Ai=Aj.length;if(AM===AP){AY.beginPath()}for(var Ac=0;Ac<Ai;Ac++){var Ad=[],Aa=Aj[Ac],Af=Aa[0],Ak=Aa.length;for(var Ab=1;Ab<Ak;Ab++){Ad[Ab-1]=AW(Aa[Ab],AZ)}var Ah=Ad[0],Ag=Ad[1],Ae=Ad[2];switch(AM){case AP:switch(Af){case AQ:AY.moveTo(Ah.x,Ah.y);break;case AR:AY.lineTo(Ah.x,Ah.y);break;case AU:AY.bezierCurveTo(Ah.x,Ah.y,Ag.x,Ag.y,Ae.x,Ae.y);break}break;case AL:switch(Af){case AQ:Al+="m "+Ah.x+","+Ah.y+" ";break;case AR:Al+="l "+Ah.x+","+Ah.y+" ";break;case AU:Al+="c "+Ah.x+","+Ah.y+","+Ag.x+","+Ag.y+","+Ae.x+","+Ae.y+" ";break}break}}return Al},_validate:function(){var Af=this.commands;if(!(Af instanceof Array)){return"commands"}var Ad=Af.length;for(var Ab=0;Ab<Ad;Ab++){var AZ=Af[Ab],Ac="commands ["+Ab+"]";if(!(AZ instanceof Array)){return Ac}var Ae;switch(AZ[0]){case AQ:case AR:Ae=2;break;case AU:Ae=4;break;default:return Ac+"[0]"}if(AZ.length!==Ae){return Ac+".length"}for(var Aa=1;Aa<Ae;Aa++){var Ag=AZ[Aa],AY=Ac+"["+Aa+"]";if(typeof (Ag)!=="object"){return AY}if(isNaN(Ag.x)){return AY+".x"}if(isNaN(Ag.y)){return AY+".y"}}}}}),PolyLine:AT(AS,{closed:false,points:null,_draw:function(AY){var Ah=this.points,Ag=Ah.length;if(Ag<2){return }var Ad,AZ=this._canvas,Ab=[];for(Ad=0;Ad<Ag;Ad++){Ab[Ad]=AW(Ah[Ad],AZ)}var Af=Ab[0],Ac=Af.x,Aa=Af.y,Ai,Ae;switch(AM){case AP:AY.beginPath();AY.moveTo(Ac,Aa);for(Ad=1;Ad<Ag;Ad++){Ae=Ab[Ad];AY.lineTo(Ae.x,Ae.y)}if(this.closed){AY.lineTo(Ac,Aa)}break;case AL:Ai="m "+Ac+","+Aa+" l ";for(Ad=1;Ad<Ag;Ad++){Ae=Ab[Ad];Ai+=Ae.x+","+Ae.y+" "}if(this.closed){Ai+=Ac+","+Aa+" e"}break}return Ai},_validate:function(){var Ab=this.points,Ac=Ab.length;if(!(Ab instanceof Array)){return"points"}for(var Aa=0;Aa<Ac;Aa++){var AZ="points["+Aa+"]",AY=Ab[Aa];if(typeof (AY)!=="object"){return AZ}if(isNaN(AY.x)){return AZ+".x"}if(isNaN(AY.y)){return AZ+".y"}}}}),Rect:AT(AS,{p1:null,p2:null,_draw:function(AZ){var Aa=this._canvas,Af=AW(this.p1,Aa),Ad=AW(this.p2,Aa),Ab=Af.x,Ac=Af.y,Ae=Ad.x,AY=Ad.y,Ag;switch(AM){case AP:AZ.beginPath();AZ.rect(Ab,Ac,Ae-Ab,AY-Ac);break;case AL:Ag="m "+Ab+","+Ac+" l ";Ag+=Ae+","+Ac+" ";Ag+=Ae+","+AY+" ";Ag+=Ab+","+AY+" ";Ag+=Ab+","+Ac+" e";break}return Ag},_validate:function(){var AZ=this.p1,AY=this.p2;if(typeof (AZ)!=="object"){return"p1"}if(typeof (AY)!=="object"){return"p2"}if(isNaN(AZ.x)){return"p1.x"}if(isNaN(AZ.y)){return"p1.y"}if(isNaN(AY.x)){return"p2.x"}if(isNaN(AY.y)){return"p2.y"}}})}}();if(AM===AL){var AN=document.namespaces;if(!AN.vml){AN.add("vml","urn:schemas-microsoft-com:vml")}var AO=document.createStyleSheet();AO.cssText="vml\\:shape, vml\\:fill, vml\\:stroke, vml\\:path {behavior:url(#default#VML)}"}})();(function(){j.Util=function(){var AR,AP,AM,AL=function(AS,AT){return(AS[0]*AT.x+AS[1]*AT.y+AS[2]>=0)},AQ=function(Ac,Ab){var AV=Ac[0],AT=Ac[1],AS=Ac[2],Aa=Ab[0],AZ=Ab[1],AX=Ab[2],AU=AV*AZ-AT*Aa,AY=Math.round((AT*AX-AS*AZ)/AU),AW=Math.round((AS*Aa-AV*AX)/AU);return new X(AY,AW)},AO=function(AV,AX,AU,AW){var AT=AX-AW,AS=AU-AV,AY=-AT*AV-AS*AX;return[AT,AS,AY]},AN=function(AS,AT,AW){var AX=AS.length;if(AX<1){return }var AZ,AV=0;if(!AW){AZ=AS[0];if(!AL(AT,AZ)){AS.splice(0,1)}else{AV++}}else{AZ=AS[AX-1]}for(;AV<AS.length;AV++){var AY=AS[AV],AU=AL(AT,AZ),Aa=AL(AT,AY);if(AU&&!Aa){AS.splice(AV,1,AQ(AT,AO(AY.x,AY.y,AZ.x,AZ.y)))}else{if(!AU&&Aa){AS.splice(AV,0,AQ(AT,AO(AZ.x,AZ.y,AY.x,AY.y)));AV++}else{if(!AU&&!Aa){AS.splice(AV,1);AV--}}}AZ=AY}};return{clipPath:function(AV,AU,AT,AS){if(typeof (AS)==="undefined"){AS=true}AN(AV,AO(AU.x,AT.y,AU.x,AU.y),AS);AN(AV,AO(AU.x,AU.y,AT.x,AU.y),AS);AN(AV,AO(AT.x,AU.y,AT.x,AT.y),AS);AN(AV,AO(AT.x,AT.y,AU.x,AT.y),AS);return AM(AV,AS)},pathsEqual:function(AX,AW,AS,AV){var AU=AX.length;if(AU!==AW.length){return false}for(var AT=0;AT<AU;AT++){if(!AX[AT].equals(AW[AT],AS)){return false}}return true},polysEqual:function(AT,AY,AU){var AW=AT.length;if(AW!==AY.length){return false}for(var AX=0;AX<AW;AX++){var AS=true;for(var AV=0;AV<AW;AV++){if(!AT[(AV+AX)%AW].equals(AY[AV],AU)){AS=false;break}}if(AS){return true}}return AW===0},reducePath:function(AU,AT,AS){if(typeof (AS)==="undefined"){AS=128}return(AU.length<AS?AR:AP)(AU,AT)},reducePathByAltitude:AR=function(){var AS=function(AX,AV,AT){var Ak=Infinity;if(AX&&AT){var Ah=AX.x,Ag=AX.y,AW=AV.x,AU=AV.y,AZ=AT.x,AY=AT.y;if(Ah===AZ){Ak=AW-Ah;Ak*=Ak}else{if(Ag===AY){Ak=AU-Ag;Ak*=Ak}else{var Af=(Ag-AY)/(Ah-AZ),Aa=-1/Af,Aj=Ag-Ah*Af,Ai=AU-Aa*AW,Ae=(Aj-Ai)/(Aa-Af),Ad=Aa*Ae+Ai,Ac=AW-Ae,Ab=AU-Ad;Ak=Ac*Ac+Ab*Ab}}}return Ak};return function(Ab,AX){var AY=Ab.length,Aa=Math.max(2,Math.round(AY*AX));if(AY>=2){var AW;for(AW=0;AW<Ab.length;AW++){Ab[AW].cost=AS(Ab[AW-1],Ab[AW],Ab[AW+1])}while((AY=Ab.length)>Aa){var AU=0,AV=Ab[AU].cost;for(AW=1;AW<AY;AW++){if(Ab[AW].cost<AV){AU=AW;AV=Ab[AU].cost}}Ab.splice(AU,1);var AZ=Ab[AU-1],AT=Ab[AU];AZ.cost=AS(Ab[AU-2],AZ,AT);AT.cost=AS(AZ,AT,Ab[AU+1])}for(AW=0;AW<AY;AW++){delete Ab[AW].cost}}return Ab}}(),reducePathUniformly:AP=function(AU,AT){var AV=1/(1-AT);for(var AS=AV;AS<AU.length-1;AS+=AV){AU.splice(AS,1);AS--}return AU},removeRepeatedPoints:AM=function(AX,AT,AS){var AW,AV=AT?AX[AX.length-1]:AX[0];for(var AU=(AT?0:1);AU<AX.length;AU++){while((AW=AX[AU])&&AW.equals(AV,AS)){AX.splice(AU,1)}AV=AW}return AX},splitPath:function(Ad,AY,AX){var AV,Ac=[];for(AV=0;AV<Ad.length-1;AV++){var Ab=Ad[AV],Aa=Ad[AV+1],AW=Ab.x,AU=Ab.y,AT=Aa.x,AS=Aa.y;var AZ=(AW===AY.x&&AT===AY.x)||(AU===AY.y&&AS===AY.y)||(AW===AX.x&&AT===AX.x)||(AU===AX.y&&AS===AX.y);if(AZ){Ac.push(Ad.slice(0,AV+1));Ad=Ad.slice(AV+1);AV=-1}}Ac.push(Ad);for(AV=0;AV<Ac.length;AV++){if(Ac[AV].length<2){Ac.splice(AV,1);AV--}}return Ac}}}()})();(function(){AH=N.MapLayers={}})();(function(){x=AH.AbstractLayer=function(){var AP=f.lookup,AL=o.parse,AO=["map","parent"],AM=E.prototype,AN=D.extend(E,{init:function(AQ,AR){AM.init.call(this,AQ);this.Added=new J();this.Removed=new J();this.Update=new J();if(typeof (AR)==="function"){AR(this.elem)}if(("show" in AQ)&&!AQ.show){this._keepHidden=true}this.hide(true);this.setMap(AL(AQ,AO,null));AH[this.id]=this},Added:null,map:null,Removed:null,Update:null,destroy:function(){var AQ=this.map;if(AQ){this.setMap(null)}delete AH[this.id];AM.destroy.call(this)},setMap:function(AS){var AQ=this,AT=this.map,AR=this.elem;if(AS!==AT){if(AT){AT.container.removeChild(this.elem);AT.removeListener(this);this.Removed.trigger(AT)}this.map=AS=(AS?AP(g,AS,Q):null)}if(AS){AS.whenVisible(function(){if(!AQ._keepHidden){AQ.show(true)}AR.style.width=AS.getWidth()+"px";AR.style.height=AS.getHeight()+"px";AS.container.appendChild(AQ.elem);AS.addListener(AQ);AQ.Added.trigger(AS);if(!AQ._keepHidden){AQ.Show.trigger();AQ.update(Q.UPDATE_FULL)}else{delete AQ._keepHidden}})}},whenAdded:function(AQ){if(this.map){AQ()}else{this.Added.appendOnce(AQ)}}});D.configure(AN,[AO,"show"]);D.virtualize(AN,["destroy","update"]);return AN}()})();(function(){AK=AH.AbstractObject=function(){var Af=f.DOM,AZ=f.Events,AQ=f.ZIndices.OBJECT,Ad=AZ.add,Ac=Af.createElement,AR=AZ.beginDrag,AM=o.freeProperty,Ah=f.lookup,AW=o.parse,AO,Ak="anchorPoint",AP="balloonConfig",AV="dragEnabled",AX=["layer","map","parent"],Ae="location",AT="show",Ag="size",Aa="implicit_objects",AS="pointer",Ab=function(){var An=this.elem,Ao=this.id,Am=this.layer,Al=Am._rtree;if(Al){Al.insert(this,this._loc);Am[Ao]=this;Am.update(N.Widgets.Map.UPDATE_PAN)}this.setPosition();if(An){Am.elem.appendChild(An)}this.log("added to "+Am.id+".");this.Added.trigger(Am)},AU=function(Al){Al.id=this.id+"_balloon";Al[AX[0]]=this.layer;Al[Ae]=this._loc;if(!(AT in Al)){Al[AT]=false}var Am=this._balloon=new AH.Balloon(Al);Am.setBehavior(this.elem)},Aj=function(){var Al=this;Ad(this.elem,"mousedown",function(An){if(Al._dragEnabled){var Am=Al.layer.map;Am.Drag.disable();AR(Al,Al.moveBy,function(){Am.Drag.enable();Al.EndDrag.trigger()});Al.Drag.trigger(An)}})},Ai=function(Ao){var An=null;if(Ao){An=Ah(AH,Ao,[AE,w]);if(!An){var Ap=Ah(g,Ao,Q);if(Ap){var Am=Ap.id,Al=Am+"_"+Aa;if(!Ap[Al]){An=new AE({id:Al,parent:Ap})}else{An=Ap[Al]}}}}return An},AN=function(){var Ao=this.elem,Ap=this.id,Am=this.layer,Al=Am._rtree;this.layer=null;if(Al){Al.remove(this,this._loc);delete Am[Ap]}if(Ao){var An=Ao.parentNode;if(An){An.removeChild(Ao)}}this.log("removed from "+Am.id+".");this.Removed.trigger(Am)},AY=G.prototype,AL=D.extend(G,{init:function(Am,Ao){var Al=this;AY.init.call(this,Am,function(Ap){var Aq=Ac("div",null,Al.id,function(As){var Ar=As.style;Ar.position="absolute";Ar.zIndex=AQ;Al.setVisibility(AW(Ap,AT,true))});if(Ao){Ao(Aq)}return Aq});this.Added=new J();this.Drag=new J();this.EndDrag=new J();this.Move=new J();this.Removed=new J();this._dragEnabled=AW(Am,AV,false);Aj.call(this);this.setSize(AW(Am,Ag,new F()));this.setAnchorPoint(AW(Am,Ak,new X(0.5)));this.setLocation(AW(Am,Ae,new I()));this.setLayer(AW(Am,AX,null));var An=Am[AP];if(An){AU.call(this,An)}},_anchorPoint:null,_balloon:null,_dragEnabled:false,_loc:null,_size:null,Added:null,Drag:null,EndDrag:null,Move:null,layer:null,Removed:null,destroy:function(){if(this._balloon){AM(this,"_balloon")}if(this.layer){this.setLayer(null)}AY.destroy.call(this)},disableDrag:function(){this.setDragEnabled(false)},enableDrag:function(){this.setDragEnabled(true)},getAnchorPixels:function(){var Al=this._anchorPoint,Am=this._size;return new X(Al.x*(Am.width-1),Al.y*(Am.height-1))},getAnchorPoint:function(){return new X(this._anchorPoint)},getBalloon:function(){return this._balloon},getLocation:function(){return new I(this._loc)},getSize:function(){return new F(this._size)},hide:function(){var Al=this._balloon;if(Al&&Al.isVisible()){Al.hide();this.Show.appendOnce(function(){Al.show()})}AY.hide.call(this)},isDragEnabled:function(){return this._dragEnabled},moveBy:function(An){var Al=new X(An);var Am=this.layer.map.getXY(this._loc);Al.x+=Am.x;Al.y+=Am.y;this.setPosition(Al)},setAnchorPoint:function(Al){this._anchorPoint=new X(Al);this.setPosition()},setDragEnabled:function(Al){this._dragEnabled=Al;this.elem.style.cursor=Al?AS:""},setLayer:function(An){if(this.layer){AN.call(this)}if(An){this.layer=Ai(An)}var Al=this,Am=this.layer;if(Am){Am.whenVisible(function(){Ab.call(Al)})}var Ao=Al._balloon;if(Ao){Ao.setLayer(Am)}},setPosition:AO=function(At){var Ap=this.elem,Ar=this.layer,An=Ar?Ar.map:null,Ao=this._loc,As;if(!At){As=Ao;if(An){At=An.getXY(As)}}else{if(!isNaN(At.lat)&&!isNaN(At.lon)){As=At;if(An){At=An.getXY(At)}}else{if(!isNaN(At.x)&&!isNaN(At.y)&&An){As=An.getLatLon(At)}}}if(An&&Ap){var Aq=this._anchorPoint,Au=An.getOrigin(),Aw=this._size,Am=Ap.style;Am.left=(At.x-Aq.x*(Aw.width-1)-Au.x)+"px";Am.top=(At.y-Aq.y*(Aw.height-1)-Au.y)+"px"}if(As){this._loc=As;if(Ar&&As!==Ao){var Al=Ar._rtree;if(Al){Al.remove(this,Ao);Al.insert(this,As)}}var Av=this._balloon;if(Av){Av.setPosition(As)}if(As!==Ao){this.Move.trigger(Ao,As)}}},setLocation:AO,setSize:function(Al){if(Al){this._size=new F(Al)}var Am=this._size,Ao=this.elem;if(Ao){var An=Ao.style;An.width=Am.width+"px";An.height=Am.height+"px"}this.setPosition()},update:function(Al){},whenAdded:function(Al){if(this.layer){Al()}else{this.Added.appendOnce(Al)}}},{setDragCursor:function(Al){AS=Al||"pointer"}});D.virtualize(AL,["destroy"]);D.configure(AL,[Ak,AP,AV,AX,Ae,AT,Ag]);return AL}()})();(function(){S=AH.LayerCollection=function(){var AL=o.parse,AR=o.freeProperty,AN=f.getGUID,AQ=f.lookup,AP="id",AM="layers",AO=D.create({_layers:null,id:"",init:function(AS){AS=AS||{};this.id=AL(AS,"id","anonymous_"+AN());this._layers=[];var AU=AS.layers;if(AU){for(var AT=0,AV=AU.length;AT<AV;AT++){this.addLayer(AU[AT])}}AH[this.id]=this},add:function(AS){var AT=AQ(AH,AS,x);if(AT){this._layers.push(AT)}return AT},destroy:function(){AR(this,"_layers");delete AH[this.id]},update:function(AS){var AU=this._layers;for(var AT=0,AV=AU.length;AT<AV;AT++){AU[AT].update(AS)}}});D.configure(AO,[AP,AM]);return AO}()})();(function(){s=AH.Balloon=function(){var Ab=f.DOM,At=f.Events,AP=f.ZIndices,AX=AP.BALLOON,AR=AP.BALLOON_RAISED,AS=At.add,Af=Ab.createElement,Ah=Ab.clearPosition,Aw=At.beginDrag,AO=o.freeProperty,AN=At.onMouseOut,AQ=o.parse,Aj=Ab.relMousePos,AL=At.remove,Ap,Ad=1,Ae=2,Aa=4,Av=8,Am=16,Ak=1,Ac=2,AV=4,Ag=8,AY=16,Ai=32,AM=64,AZ=["behavior","behaviour"],AW="content",Ao="hAlign",As="skin",Aq="vAlign",Ar=function(){var A4=this._vAlign;if(!A4){return }var A2=this._body,A6=A2.style,BC=this._tag,A1=BC.style,A7=this._bodySize.width,BA=this._skin,A5=this._xOffset,Az=BA.getTagSize(),Ay=Az.height-BA.getTagOverlap(),Ax=(A2.offsetLeft<-A7/2)?Aa:Av,A0=BA.getTagAnchorPixels(Ax,A4),BB=A0.x,A9=A0.y,A8=-BB-A7+Az.width,A3=-BB;Ah(A2);Ah(BC);if(A4===Ad){A6.top=Ay+"px";A1.top=A9+"px"}else{if(A4===Am){A6.bottom=Ay+"px";A1.bottom=Ay-A9+"px"}}A5=Math.min(A5,A3);A5=Math.max(A5,A8);A6.left=A5+"px";A1.left=A3+"px";BC.src=BA.getTagSrc(Ax,A4)},Au=function(Ax,Ay,A3){if(!(Ax instanceof Array)){Ax=[Ax]}var A1=this._behaviorEvents;for(var Az=0,A2=Ax.length;Az<A2;Az++){var A0=Ax[Az];AS(A0,Ay,A3);A1.push({elem:A0,name:Ay,callback:A3})}},AU=function(){if(!this.isVisible()){return }var A7=10,BF=this._bodySize,BB=this.elem,BC=this.layer.map,Ax=BC.getSize(),A9=this._skin.getTagSize(),A3=this._vAlign,BE=this._xOffset,A5=BF.height+A9.height-1,A6=BF.width,Ay=(this._body.offsetLeft<-A6/2)?Aa:Av,A2=this._skin.getTagAnchorPixels(Ay,A3),BD=BC.getOrigin(),A0=new X(BB.offsetLeft+BD.x+A2.x,BB.offsetTop+BD.y+A2.y),A4=new X(A0.x+BE,A0.y-A5),A1=new X(A0.x+BE+A6,A0.y+A5),A8=new X(A7,A7),BA=new X(Ax.width-A7,Ax.height-A7),Az=false;if(A4.x<A8.x){this._xOffset=A8.x-A0.x;Az=true}else{if(A1.x>=BA.x){this._xOffset=BA.x-A0.x-A6;Az=true}}if(A3===Am&&A4.y<A8.y){this._vAlign=Ad;Az=true}else{if(A3===Ad&&A1.y>=BA.y){this._vAlign=Am;Az=true}}if(Az){Ar.call(this)}},An=function(){var Ay=this,Ax=this._tag;Au.call(this,this._body,"mousedown",function(){if(Ay._suspended){return }var A1=Ay.layer.map;A1.Drag.disable();Ay._suspended=true;var A0=function(A3,A2){Ay._xOffset+=A3.x;if(Aj(A2,Ax).y>=Ay._skin.getTagSize().height){Ay._vAlign=Ad}else{if(Aj(A2,Ax).y<0){Ay._vAlign=Am}}Ar.call(Ay)};var Az=function(){A1.Drag.enable();Ay._suspended=false;Ay.Unsuspend.trigger()};Aw(Ay.elem,A0,Az)})},AT=AK.prototype,Al=D.extend(AK,{init:function(Az){var A1=AH.BalloonSkin,Ay=this;Az.anchorPoint=new X(0,0);AQ(Az,"show",false);AT.init.call(this,Az,function(A4){var A3=A4.style,A6=Ay.id,A2=Az[As],A5=Ay._skin=(A2 instanceof A1)?A2:A1.standard;if(!A5){throw new k("no skin available for "+A6+".")}Ay._body=Af("div",A4,A6+"_body",function(A7){A5.applyBodyStyle(A7);A7.style.position="absolute"}),Ay._tag=Af("img",A4,A6+"_tag",function(A7){A7.style.position="absolute"});A3.zIndex=AX;A3.width="0px";A3.height="0px"});this._behavior=AQ(Az,AZ,Ag);this._content=AQ(Az,AW,this._loc.toString());this._bodySize=new F();this._behaviorEvents=[];this.Unsuspend=new J();AS(this.elem,"mouseover",function(){Ay.pushToTop(AR)});this.hide();this.setContent();var Ax=AQ(Az,Ao,Av),A0=AQ(Az,Aq,Am);this.setAlignment(Ax,A0);if(Az.show){this.show()}},_behavior:0,_behaviorEvents:null,_body:null,_bodySize:null,_skin:null,_static:false,_suspended:false,_tag:null,_target:null,_vAlign:0,_xOffset:0,Unsuspend:null,clearBehavior:function(){var Ay=this._behaviorEvents;if(Ay){for(var Ax=0,A0=Ay.length;Ax<A0;Ax++){var Az=Ay[Ax];AL(Az.elem,Az.name,Az.callback)}}this._behaviorEvents=[]},destroy:function(){this.clearBehavior();delete this._target;AO(this,"_body");AO(this,"_tag");AT.destroy.call(this)},hide:function(){if(!this._static){if(!this._suspended){AT.hide.call(this)}else{var Ax=this;this.Unsuspend.appendOnce(function(){Ax.hide()})}}},setAlignment:function(Ay,Az){var Ax=this;this.whenVisible(function(){if(!Az){Az=Ax._vAlign}var A0=Ax._bodySize.width,A5=Ax._skin,A2,A1=A5.getTagSize(),A6=(Ax._body.offsetLeft<-A0/2)?Aa:Av,A4=A5.getTagAnchorPixels(A6,Az),A3=-A4.x-A0+A1.width;switch(Ay){case Aa:A2=A3;break;case Ae:A2=Math.round(A3/2);break;case Av:A2=0;break}Ax._vAlign=Az;Ax._xOffset=A2;Ar.call(Ax)})},setBehavior:function(Ay,Az){var Ax=this;this.whenAdded(function(){if(isNaN(Ay)){Az=Ay;Ay=0}if(Ay){Ax._behavior=Ay}if(Az){Ax._target=Az}Ay=Ax._behavior;Az=Ax._target;var A2=Ax._body;var A1=Ax._tag;var A3=function(){Ax.hide()};var A0=function(){Ax.toggleVisibility()};Ax.clearBehavior();if(Ay&Ak){Au.call(Ax,[A2,A1],"click",A3)}if(Ay&Ac){Au.call(Ax,[A2,A1],"contextmenu",A3)}if(Ay&Ai){Au.call(Ax,Az,"click",A0)}if(Ay&AM){Au.call(Ax,Az,"contextmenu",A0)}if(Ay&Ag){Ax._hovering=false;Au.call(Ax,Az,"mouseover",function(){if(!Ax._hovering){Ax._hovering=true;Ax.show();AN([Az,A2,A1],function(){A3();Ax._hovering=false})}})}if(Ay&AV){An.call(Ax)}})},setContent:function(Ay){var Ax=this;this.whenVisible(function(){if(typeof (Ay)==="string"||(Ay instanceof String)){Ax._content=Ay}if(Ax._body){Ax._body.innerHTML=Ax._content;Ax._bodySize=new F(Ax._body)}Ar.call(this)})},setPosition:Ap=function(Ax){AT.setPosition.call(this,Ax);if(this._behavior&AY){AU.call(this)}},setLocation:Ap,show:function(){if(!this._static){if(!this._suspended){AT.show.call(this);if(this._behavior&AY){AU.call(this)}}else{var Ax=this;this.Unsuspend.appendOnce(function(){Ax.show()})}}},toggle:function(){if(this.isVisible()&&this._static){this.toggleOut()}else{this.toggleIn()}},toggleIn:function(){this.show();this._static=true},toggleOut:function(){this._static=false;this.hide()},update:function(Ax){if(this._behavior&AY&&Ax&N.Widgets.Map.UPDATE_PAN){AU.call(this)}}},{ALIGN_BOTTOM:Ad,ALIGN_LEFT:Aa,ALIGN_CENTER:Ae,ALIGN_RIGHT:Av,ALIGN_TOP:Am,BALLOON_LEFT_CLICK_HIDE:Ak,BALLOON_RIGHT_CLICK_HIDE:Ac,DRAGGABLE:AV,REALIGN_TO_VIEWPORT:AY,HOVER_ACTIVE:Ag,LEFT_CLICK_TOGGLE:Ak|Ai,MANUAL_TOGGLE:0,RIGHT_CLICK_TOGGLE:Ac|AM,TARGET_LEFT_CLICK_TOGGLE:Ai,TARGET_RIGHT_CLICK_TOGGLE:AM});D.configure(Al,[AZ,AW,Ao,As,Aq]);return Al}()})();(function(){M=AH.BalloonSkin=function(){var AV=f.DOM.applyStyle,AS=o.parse,AR="bodyStyle",AP="folder",AN="tagAnchorPoint",AW="tagOverlap",AO="bottomLeftTagSrc",AU="bottomRightTagSrc",AT="topLeftTagSrc",AM="topRightTagSrc",AQ=R.prototype,AL=D.extend(R,{init:function(AX){AQ.init.call(this);var AY=AS(AX,AP,"");if(AY&&AY.charAt(AY.length-1)!=="/"){AY+="/"}this._images={topRightTag:AY+AS(AX,AM,"tag-top-right.png"),topLeftTag:AY+AS(AX,AT,"tag-top-left.png"),bottomRightTag:AY+AS(AX,AU,"tag-bottom-right.png"),bottomLeftTag:AY+AS(AX,AO,"tag-bottom-left.png")};this.load();this._tagOverlap=AS(AX,AW,1);this._bodyStyle=AS(AX,AR,{});this._tagAnchorPoint=AS(AX,AN,new X(0,1))},_bodyStyle:null,_tagAnchorPoint:null,_tagOverlap:1,applyBodyStyle:function(AX){AV(AX,this._bodyStyle)},getTagAnchorPixels:function(AX,Aa){var AZ=this._sizes.topRightTag;if(!AZ){return new X(0,0)}else{var AY=this.getTagAnchorPoint(AX,Aa);return new X(AY.x*(AZ.width-1),AY.y*(AZ.height-1))}},getTagAnchorPoint:function(AX,Aa){var AZ=AH.Balloon,AY=new X(this._tagAnchorPoint);if(AX===AZ.ALIGN_LEFT){AY.x=1-AY.x}if(Aa===AZ.ALIGN_BOTTOM){AY.y=1-AY.y}return AY},getTagOverlap:function(){return this._tagOverlap},getTagSize:function(){return new F(this._sizes.topRightTag)},getTagSrc:function(AY,Ac){var Aa=AH.Balloon,Ab=(AY===Aa.ALIGN_LEFT),AX=(Ac===Aa.ALIGN_BOTTOM),AZ=(AX?"bottom":"top")+(Ab?"Left":"Right")+"Tag";return this._images[AZ]}});D.configure(AL,[AR,AP,AN,AW,AO,AU,AT,AM]);return AL}()})();(function(){AI=AH.CanvasLayer=function(){var AL=f.ZIndices.CANVAS_LAYER,AT=D.configure,AO=D.extend,AP=o.freeProperty,AS=o.parse,AN=["fillColor","fillColour"],AM=["lineColor","lineColour"],AQ="lineWidth",AV=1,AU=1,AX=function(){var AZ=this._canvas;if(!AZ){return }var Aq=this.map,Ah=this.getPadding(),Aj=Aq.getPan(),Aa=Aq.getSize(),Ad=AZ.elem,At=Ad.style,Ac=AZ._offset,Af=new X(Ad),Ap=Aj.x,As=Af.x,Ao=Aj.y,Ar=Af.y,Am=Ah.width,An=Aa.width,Al=Ah.height,Ak=Aa.height,AY=Ap>=-As,Ab=Ao>=-Ar,Ag=Ap<=-As-2*Am,Ai=Ao<=-Ar-2*Al,Ae=AY||Ag||Ab||Ai;if(AY){Af.x=As=An*Math.ceil(-Ap/An)-Am}if(Ab){Af.y=Ar=Ak*Math.ceil(-Ao/Ak)-Al}if(Ag){Af.x=As=An*Math.floor(-Ap/An)-Am}if(Ai){Af.y=Ar=Ak*Math.floor(-Ao/Ak)-Al}if(Ae){At.display="none"}At.left=As+"px";At.top=Ar+"px";Ac.x=-As-Ap;Ac.y=-Ar-Ao;return Ae},AR=x.prototype,AW=AO(x,{init:function(AZ,Aa){this._fillColor=AS(AZ,AN,new T(255,255,255));this._lineColor=AS(AZ,AM,new T(0,0,0));this._lineWidth=AS(AZ,AQ,1);AR.init.call(this,AZ);var AY=this;this.whenAdded(function(){if(!AY._canvas){var Ad=AY.getPadding(),Ab=AY.getPaddedSize(),Ac={id:AY.id+"_canvas",parent:AY.elem,size:Ab};AY._canvas=new j(Ac,function(Af){var Ae=Af.style;Ae.position="absolute";Ae.left=-Ad.width+"px";Ae.top=-Ad.height+"px";Ae.zIndex=isNaN(Aa)?AL:+Aa})}})},_canvas:null,_fillColor:null,_lineWidth:null,_lineColor:null,_draw:function(){},destroy:function(){AP(this,"_canvas");AR.destroy.call(this)},getFillColor:function(){var AY=this._fillColor;return(AY?new T(AY):null)},getLineColor:function(){var AY=this._lineColor;return(AY?new T(AY):null)},getLineWidth:function(){return this._lineWidth},getPaddedLR:function(){var Aa=this._canvas,AY=this.getPaddedSize(),Ab=AY.width,AZ=AY.height;if(Aa){var Ac=Aa._offset;Ab-=Ac.x;AZ-=Ac.y}return new X(Ab,AZ)},getPaddedSize:function(){var AZ=this.map,AY=AZ?AZ.getSize():new F();AY.width*=2*AV+1;AY.height*=2*AU+1;return AY},getPaddedUL:function(){var AY=this._canvas,Aa=0,AZ=0;if(AY){var Ab=AY._offset;Aa-=Ab.x;AZ-=Ab.y}return new X(Aa,AZ)},getPadding:function(){var AZ=this.map,AY=AZ?AZ.getSize():new F();AY.width*=AV;AY.height*=AU;return AY},setFillColor:function(AY){this._fillColor=(AY?new T(AY):null);this._draw()},setLineColor:function(AY){this._lineColor=(AY?new T(AY):null);this._draw()},setLineWidth:function(AY){this._lineWidth=AY;this._draw()},update:function(AZ){var Aa=this._canvas;if(!Aa){return }var AY=Aa.elem.style,Ab=false;if(AZ&Q.UPDATE_PAN){Ab=AX.call(this)}if(AZ&Q.UPDATE_ZOOM){AY.display="none";Ab=true}if(AZ&Q.UPDATE_SIZE){Aa.setSize(this.getPaddedSize());AX.call(this);Ab=true}if(Ab){this._draw();AY.display="block"}this.Update.trigger(AZ)}},{BUFFERING:new X(AV,AU),define:function(AY){var AZ=AW.prototype;var Aa=AO(AW,{init:function(Ab){AZ.init.call(this,Ab);this.update(N.Widgets.Map.UPDATE_REDRAW)},_draw:function(){AY.call(this,this._canvas)}});AT(Aa);return Aa}});D.virtualize(AW,["_draw"]);AT(AW,[AN,AM,AQ]);return AW}()})();(function(){var AN=D.configure,AM=D.extend,AL=o.parse;var AO=AH.GeoFence=function(){var AR=f.ZIndices.FENCE,AP=AI.prototype,AQ=AM(AI,{init:function(AS){AL(AS,["lineColor","lineColour"],new T(0,0,0,0.8));AL(AS,["fillColor","fillColour"],new T(0,0,0,0.2));AL(AS,"lineWidth",1);AP.init.call(this,AS,AR)},_draw:null,contains:null});AN(AQ);D.virtualize(AQ,["_draw","contains"]);return AQ}();AH.CircleFence=function(){var AS=q.displace,AR=t.MILES,AQ=["center","centre"],AV="radius",AW="units",AT=function(){var AY=this.map,AX=this._center,Ae=this._radius,Af=this._units,Aa=AS(AX,Ae,270,Af),Ab=AS(AX,Ae,0,Af),AZ=AY.getXY(AX),Ac=AY.getXY(Aa),Ad=AY.getXY(Ab);return new X(Math.abs(AZ.x-Ac.x),Math.abs(AZ.y-Ad.y))},AP=AO.prototype,AU=AM(AO,{init:function(AX){AP.init.call(this,AX);this._center=AL(AX,AQ,null);this._radius=AL(AX,AV,0);this._units=AL(AX,AW,AR);this.update(N.Widgets.Map.UPDATE_REDRAW)},_center:null,_radius:0,_units:AR,_draw:function(){var AX=this._canvas,AZ=this._center;if(!AX||isNaN(this._radius)||!AZ){return }var Ab=this.map.getXY(AZ),Aa=AT.call(this),AY=this._circle;if(!AY){AY=this._circle=AX.ellipse()}AY.fillColor=this._fillColor;AY.lineColor=this._lineColor;AY.lineWidth=this._lineWidth;AY.center=Ab;AY.radiusX=Aa.x;AY.radiusY=Aa.y;AX.update()},contains:function(Aa){var AY=this._center,AX=this._radius,AZ=this._units;return AX&&AY&&AZ&&Aa.distanceTo(AY,AZ)<=AX},getCenter:function(){return new I(this._center)},getDistance:function(){return this._radius},getUnits:function(){return this._units},setCenter:function(AX){this._center=AX;this.update(N.Widgets.Map.UPDATE_REDRAW)},setRadius:function(AY,AX){this._units=(AX?AX:AR);this._radius=AY;this.update(N.Widgets.Map.UPDATE_REDRAW)}});AN(AU,[AQ,AV,AW]);return AU}();AH.PolygonFence=function(){var AT=j.Util.clipPath,AQ="points",AW="vertexRadius",AS=function(AZ){var AY=this.getPaddedUL(),AX=this.getPaddedLR(),Aa=(new Date()).getTime();AT(AZ,AY,AX);this.log("clipping to viewport ("+((new Date()).getTime()-Aa)+"ms).")},AP=function(Af){var AX=this._canvas,Ad=this._lineColor,Ac=this._vertices,Ae=this._vertexRadius,Aa,AY;if(!Ac){Ac=this._vertices=[]}for(Aa=0,AY=Af.length;Aa<AY;Aa++){var Ab=Ac[Aa];if(!Ab){Ab=AX.circle();Ab.lineWidth=1}Ab.center=Af[Aa];Ab.radiusX=Ae;Ab.radiusY=Ae;Ab.fillColor=Ad;Ab.lineColor=Ad;Ac[Aa]=Ab}for(var AZ=Ac.length-1;AZ>=Aa;AZ--){Ac[AZ].destroy();Ac.splice(AZ,1)}},AV=function(){var Aa=this.map;if(!Aa){return }var AZ=this._points,AX=[];for(var AY=0,Ab=AZ.length;AY<Ab;AY++){AX[AY]=Aa.getXY(AZ[AY])}return AX},AR=AO.prototype,AU=AM(AO,{init:function(AX){AR.init.call(this,AX);this._points=AL(AX,AQ,[]);this._vertexRadius=AL(AX,AW,0);this.update(N.Widgets.Map.UPDATE_REDRAW)},_boundingBox:null,_points:null,_vertexRadius:0,_draw:function(){var AX=this._canvas;if(!AX||!this._points){return }var AZ=AV.call(this);AS.call(this,AZ);var AY=this._polygon;if(!AY){AY=this._polygon=AX.polyline();AY.closed=true}if(this._vertexRadius){AP.call(this,AZ)}AY.fillColor=this._fillColor;AY.lineColor=this._lineColor;AY.lineWidth=this._lineWidth;AY.points=AZ;AX.update()},appendPoint:function(AY){this._points.push(AY);var AX=this._boundingBox;if(!AX){AX=this._boundingBox=new AC()}AX.add(AY);this.update(N.Widgets.Map.UPDATE_REDRAW)},contains:function(Ad){var AZ=this._boundingBox,Aj=this._points;if(!AZ||!Aj){return false}var Ai=Aj.length;if(Ai<=2||!AZ.contains(Ad)){return false}var Ag=0,Af=null,Ab=Aj[0],Ah=Ad.lat,AX=Ad.lon;for(var Aa=0;Aa<Ai;Aa++){Af=Ab;Ab=Aj[(Aa+1)%Ai];var Ac=Af.lat,Ae=Ab.lat,Ak=Af.lon,Al=Ab.lon;if(Ac===Ah&&Ak===AX){return false}if((Ac<=Ah&&Ae>Ah)||(Ac>Ah&&Ae<=Ah)){var AY=(Ah-Ac)/(Ae-Ac);if(AX<Ak+AY*(Al-Ak)){Ag++}}}return(Ag%2)===1},getPoints:function(){return this._points.slice()}});AN(AU,[AQ,AW]);return AU}();AH.FenceCollection=function(){var AQ=S.prototype,AP=AM(S,{init:function(AR){AQ.init.call(this,AR)},contains:function(AT){var AS=this._layers;for(var AR=0,AU=AS.length;AR<AU;AR++){if(AS[AR].contains(AT)){return true}}return false}});AN(AP);return AP}()})();(function(){V=AH.ImageObject=function(){var AT=f.DOM,AS=f.ZIndices.OBJECT,AN=AT.createElement,AL=AT.enableTranslucency,AP=o.freeProperty,AM=AT.getImageSize,AR="src",AQ=AK.prototype,AO=D.extend(AK,{_img:null,init:function(AV,AX){var AU=this;AQ.init.call(this,AV,function(AY){AU._img=AN("img",AY,AU.id+"_image",function(AZ){var Aa=AZ.style;Aa.height="100%";Aa.position="absolute";Aa.width="100%";Aa.zIndex=AS;AL(AZ)});if(AX){AX(AY)}});var AW=AV[AR];if(AW){this.setImage(AW)}},destroy:function(){AP(this,"_img");AQ.destroy.call(this)},getImage:function(){return this._img.src},setImage:function(AX){var AV=this._img;if(!AV){return }if(AX){AV.src=AX}else{AX=AV.src}var AW=this._size;if(!AW.width&&!AW.height){var AU=this;AM(AX,function(AY){AU.setSize(AY)})}}});D.configure(AO,[AR]);return AO}()})();(function(){L=AH.IndexedImageObject=function(){var AV=f.DOM,AR=f.ZIndices.OBJECT+1,AU=AV.applyStyle,AN=AV.createElement,AO=o.freeProperty,AQ=o.parse,AS="index",AM="indexOffset",AT="indexStyle",AP=V.prototype,AL=D.extend(V,{_indexElem:null,init:function(AX){var AW=this;AP.init.call(this,AX,function(AY){var Aa=AQ(AX,AM,new X(0,0)),AZ=AQ(AX,AT,{backgroundColor:"#ffffff",bottom:-Aa.y+"px",fontSize:"10px",fontWeight:"bold",padding:"0px 1px 0px 1px",position:"absolute",right:-Aa.x+"px",zIndex:AR});AW._indexElem=AN("div",AY,AW.id+"_index",function(Ab){AU(Ab,AZ)})});this.setIndex(AQ(AX,AS,0))},destroy:function(){AO(this,"_indexElem");AP.destroy.call(this)},getIndex:function(){return this._index},setIndex:function(AW){this._index=AW;this._indexElem.innerHTML=AW}});D.configure(AL,[AS,AM,AT]);return AL}()})();(function(){AE=AH.ObjectLayer=function(){var AN=o.freeProperty,AM=x.prototype,AL=D.extend(x,{init:function(AO){this._rtree=new z();AM.init.call(this,AO)},_rtree:null,clear:function(){this._rtree.queryAll(function(AO){AO.data.setLayer(null)})},destroy:function(){var AO=this._rtree;if(AO){AO.queryAll(function(AP){AP.data.setLayer(null)});AN(this,"_rtree")}AM.destroy.call(this)},update:function(AQ){var AV=this.map;if(!AV){return }var AT=this.elem,AS=AV.getSize(),AO=function(AX){var AW=AX.data.elem;if(AW.parentNode===AT){AT.removeChild(AW)}},AR=function(AX){var AY=AX.data,AW=AY.elem;AY.setPosition();if(AW.parentNode!==AT){AT.appendChild(AW)}AY.update(AQ)};if(AQ&Q.UPDATE_ZOOM||AQ&Q.UPDATE_SIZE){this._rtree.queryAll(AO)}var AP=AV.getLatLon(new X(0,0)),AU=AV.getLatLon(new X(AS));this._rtree.query(new n(AP,AU),AR);this.Update.trigger(AQ)}});D.configure(AL);return AL}()})();(function(){d=AH.RegionShadeLayer=function(){var Aa=f.DOM,AP=Aa.createElement,AO=Aa.setOpacity,AU=f.ZIndices.REGION,AM=Aa.bordersOutside,AS=o.freeProperty,AW=o.parse,AX="borderType",AN="borderWidth",AQ="nw",AR="se",AT="viewport",AZ=["color","colour"],AY=function(){var As=this._shade,Am=this._border,Ap=this.map;if(!Ap||!Am||!As){return }var An=this._color,Aj=An.toCSSHex(),Ar=this._borderWidth,Ae=AM()?2*Ar:0,Aq=Ap.getOrigin(),Ah=Ap.getXY(this._nw),Ag=Ap.getXY(this._se),Ad=Ah.x,Af=Ah.y,Ak=Ad-Aq.x+"px",Ab=Af-Aq.y+"px",Al=Ag.x-Ad,Ai=Ag.y-Af,Ao=As.style,Ac=Am.style;Ao.backgroundColor=Aj;Ao.left=Ak;Ao.top=Ab;Ao.width=Al+Ae+"px";Ao.height=Ai+Ae+"px";AO(As,An.a);Ac.border=Ar+"px "+this._borderType+" "+Aj;Ac.left=Ak;Ac.top=Ab;Ac.width=Math.max(0,Al)+"px";Ac.height=Math.max(0,Ai)+"px"},AV=x.prototype,AL=D.extend(x,{init:function(Ad){this._nw=AW(Ad,AQ,new I());this._se=AW(Ad,AR,new I());this._color=AW(Ad,AZ,new T(0,0,0,0.2));this._borderWidth=AW(Ad,AN,1);this._borderType=AW(Ad,AX,"solid");var Ac=this;AV.init.call(this,Ad,function(Ae){var Af=Ac.id;Ac._border=AP("div",Ae,Af+"_border",function(Ah){var Ag=Ah.style;Ag.backgroundColor="transparent";Ag.fontSize="0px";Ag.position="absolute";Ag.zIndex=AU+1});Ac._shade=AP("div",Ae,Af+"_shade",function(Ag){var Ah=Ag.style;Ah.fontSize="0px";Ah.position="absolute";Ah.zIndex=AU})});var Ab=Ad[AT];if(Ab){this.setCorners(Ab)}else{this.setCorners()}},_borderType:"solid",_borderWidth:1,_color:null,_nw:null,_se:null,destroy:function(){AS(this,"_border");AS(this,"_shade");AV.destroy.call(this)},setCorners:function(Ab,Ac){if(typeof (Ab)!=="undefined"){if(Ab instanceof Q){var Ad=Ab.getSize();this._nw=Ab.getLatLon(new X(0,0));this._se=Ab.getLatLon(new X(Ad))}else{if(typeof (Ac)!=="undefined"){this._nw=new I(Ab);this._se=new I(Ac)}}}AY.call(this)},setMap:function(Ab){AV.setMap.call(this,Ab);AY.call(this)},update:function(Ab){if(Ab&Q.UPDATE_ZOOM||Ab&Q.UPDATE_SIZE){this.setCorners()}}});D.configure(AL,[AX,AN,AZ,AQ,AR,AT]);return AL}()})();(function(){AH.RouteLayer=function(){var AW=j.COMMAND_LINE,AM=j.COMMAND_MOVE,AN=j.Util,AR=AN.clipPath,AZ=AN.reducePath,AU=AN.splitPath,AQ=f.ZIndices.PATH,AP=o.parse,AX="directions",AL="points",AT="renderDetail",AV=function(){var Ad=this.map,Ac=this._points;if(!Ad||!Ac){return }var Ab=[];for(var Aa=0,Ae=Ac.length;Aa<Ae;Aa++){Ab[Aa]=Ad.getXY(Ac[Aa])}return Ab},AS=function(Ad){var Af=this.map;if(!Af){return }var Ac=this.getPaddedUL(),Ab=this.getPaddedLR(),Aa=Ad.length,Ah=(new Date()).getTime();AR(Ad,Ac,Ab,false);var Ag=Ad.length;this.log("clipping from "+Aa+" to "+Ag+" points ("+((new Date()).getTime()-Ah)+"ms).");Ah=(new Date()).getTime();AZ(Ad,Math.min(this._renderDetail,Ag)/Ag);var Ae=AU(Ad,Ac,Ab);this.log("simplifying from "+Ag+" to "+Ad.length+" points ("+((new Date()).getTime()-Ah)+"ms).");return Ae},AO=AI.prototype,AY=D.extend(AI,{init:function(Aa){AP(Aa,["lineColor","lineColour"],new T(0,0,128,0.5));AP(Aa,"lineWidth",8);AO.init.call(this,Aa,AQ);this._renderDetail=AP(Aa,AT,this._renderDetail);var Ab=Aa[AL];if(!Ab){var Ac=Aa[AX];if(Ac){Ab=Ac.getPoints()}else{Ab=[]}}this.setPoints(Ab)},_points:null,_renderDetail:256,_draw:function(){var Ac=this._canvas;if(!Ac||!this._points){return }var Ai=AV.call(this),Ag=AS.call(this,Ai);var Aj=this._path;if(!Aj){Aj=this._path=Ac.path();Aj.fillColor=null}var Ad=[];for(var Af=0,Aa=Ag.length;Af<Aa;Af++){var Ah=Ag[Af];Ad.push([AM,Ah[0]]);for(var Ae=1,Ab=Ah.length;Ae<Ab;Ae++){Ad.push([AW,Ah[Ae]])}}Aj.lineColor=this._lineColor;Aj.lineWidth=this._lineWidth;Aj.commands=Ad;Ac.update()},setPoints:function(Ab){var Ac=[];for(var Aa=0,Ad=Ab.length;Aa<Ad;Aa++){Ac[Aa]=new I(Ab[Aa])}this._points=Ac;this.update(Q.UPDATE_REDRAW)}});D.configure(AY,[AX,AL,AT]);return AY}()})();(function(){B=AH.Tile=function(){var AW=f.ZIndices.TILE,Ae=f.DOM,Af=Ae.applyStyle,Ab=Ae.createElement,AV=Ae.makeInert,AL=AB.whenRegistered,AR=o.parse,AU="args",Ac="parent",AY="map",AX="satellite",AZ="serverPage",AN="style",Ad=2000,AT=3,Aa=null,AM=function(){return Aa||f.serviceURLs},AQ=function(){if(!this._isActive){return }if(this._reloadAttempts>0){var Ah=this,Ai=0;this._reloadAttempts--;var Ag=Math.floor((AT-this._reloadAttempts)/AM().length);if(Ag>0){Ai=Math.pow(2,Ag-1)*Ad}this._reloadID=setTimeout(function(){Ah.load()},Ai)}else{Z.warn("failed to load tile at "+this._coords+".");var Aj=this.Error;if(Aj){Aj.trigger()}}},AS=function(){if(!this._isActive){return }this._img.style.display="block";var Ag=this.Load;if(Ag){Ag.trigger()}},AP=function(Ai,Aj,Ah){var Ag=this;return Ab("img",Ai,null,function(Al){var Ak=Al.style,Am=Aj.getTileSize();Al.setAttribute("galleryimg","no");Ak.zIndex=AW;var An=Ah;if(typeof (An)==="object"){Af(Al,An)}Ak.display="none";Ak.position="absolute";Ak.width=Am+"px";Ak.height=Am+"px";AV(Al);Al.onerror=Al.onabort=function(){AQ.call(Ag)};Al.onload=function(){AS.call(Ag)}})},AO=D.create({init:function(Ah){var Aj=function(An){throw new k('no valid "'+An+'" configuration property found for tile.')},Am=Ah[AY],Ak=Ah[Ac];if(!Am){Aj(AY)}if(!Ak){Aj(Ac)}this.Load=new J();this.Error=new J();var Ag=AR(Ah,AU,{});if(Ah.hasOwnProperty(AX)){if(Ah[AX]){Ag.satellite="on"}else{if(Ag.satellite){delete Ag.satellite}}}var Al="";for(var Ai in Ag){if(Ag.hasOwnProperty(Ai)){Al+="&"+Ai+"="+Ag[Ai]}}this._args=Al;this._serverPage=AR(Ah,AZ,AO.MAP_SERVER_PAGE);this._map=Am;this._img=AP.call(this,Ak,Am,Ah[AN])},_args:"",_img:null,_isActive:false,_map:null,_reloadAttempts:AT,_reloadID:0,_serverPage:"",_coords:null,Load:null,Error:null,destroy:function(){var Ag=this._img;Ag.onload=null;Ag.onerror=null;Ag.onabort=null;o.freeProperty(this,"_img");o.freeHandlers(this)},load:function(Ai){var Ao=this._img,As=this._coords;if(!Ao||!As){return }if(Ai){this._map=Ai}Ai=this._map;this._isActive=true;var Ak=As.x,Au=As.y,Am=Ai.getZoomLevel();if(Au<-2*Am||Au>=2*Am){Ao.style.display="none";this.Load.trigger()}else{var Ar=this._args,An=this._reloadAttempts,Al=Ai.getTilesPerSuperTile(),Aq=Al*Am,Ah=((Aq/2+Ak)*(Aq+1)+(Aq/2+Au)),At=AM(),Ap=(Ah+An)%At.length,Aj=At[Ap]+this._serverPage,Ag=Aj+"t="+Ak+","+Au+","+Ai.getTileSize()+","+Al+","+Am;if(Ar){Ag+=Ar}if(An<AT){Ag+="&r="+An}Ao.style.display="none";AL(function(){Ao.src=Ag})}},isActive:function(){return this._isActive},setCoords:function(Ai){var Ah=this._coords,Ag=this._reloadID;if(!Ah||(Ai.x!==Ah.x||Ai.y!==Ah.y)){this._reloadAttempts=AT}if(Ag){clearTimeout(Ag);this._reloadID=0}this._coords=new X(Ai);this.unload()},setPosition:function(Ah){var Ag=this._img.style;Ag.top=Ah.y+"px";Ag.left=Ah.x+"px"},unload:function(){this._isActive=false;this._img.style.display="none"}},{BASE_RELOAD_WAIT:Ad,MAP_SERVER_PAGE:"tile.aspx?",RELOAD_ATTEMPTS:AT,setService:function(Ag){Aa=f.getServiceSet(Ag)}});D.configure(AO,[AU,Ac,AY,AX,AZ,AN]);return AO}()})();(function(){P=AH.TileLayer=function(){var AT=Z.warn,AP=o.freeProperty,AS=o.parse,AM="buffering",AO="tileConfig",AU="transitionConfig",AL="zoomTransition",AR=function(){if(this._tiles){AP(this,"_tiles")}},AN=function(){var AV=this._tileConfig;AV.parent=this.elem;AV.map=this.map;return new B(AV)},AQ=x.prototype;P=D.extend(x,{init:function(AV){this._tiles=[];this._buffering=AS(AV,AM,new X(0,0));this._tileConfig=AS(AV,AO,{});this.Load=new J();AQ.init.call(this,AV);var AW=AS(AV,AL,null);if(AW&&!AV[AU]){AV[AU]={}}else{if(AW===false){AV[AU]=null}}if(AV[AU]){AH.TileZoom.setup(this,AS(AV,AU,{}))}},_buffering:null,_lastStartRow:0,_lastStartCol:0,_tileConfig:null,_tiles:null,Load:null,destroy:function(){AR.call(this);AQ.destroy.call(this)},reconfigureTiles:function(AV){this._tileConfig=AS({prop:AV},"prop",this._tileConfig);this.update(N.Widgets.Map.UPDATE_SIZE)},update:function(AZ){var Ab=this,Ah=this.map,An=this._tiles,Aq=AZ&Q.UPDATE_SIZE,Aj=Ah.getPan(),Ar=Ah.getSize(),Az=this._buffering,Aw=Az.x,Av=Az.y,A0=Ar.width+2*Aw,AV=Ar.height+2*Av,Ap=Aj.x+Aw,Ao=Aj.y+Av;Ah._projection.setSize(new F(A0,AV));var Ax=Ah.getTileCoords(0,0),A1=Ah.getTileOffset(),Af=Ah.getTileSize(),Ad=Ah.getColCount(),Ac=Ah.getRowCount(),Am=Ah.getStartCol(),Ay=Ah.getStartRow(),At=A1.x-Aw,As=A1.y-Av,Ag=Ax.x,Al=Ax.y;Ah._projection.setSize(Ar);var Ai=function(A5,A6){return new X(Ag+Am+A5,Al+Ay+A6)},AX=function(A5,A6){return new X(At+(Am+A5)*Af,As+(Ay+A6)*Af)},Au=function(A5){var A7=A5.x+Ap,A6=A5.y+Ao;return(A7>=-Af&&A7<A0&&A6>=-Af&&A6<AV)},Ak=function(){AR.call(Ab);An=[];for(var A5=0;A5<Ad;A5++){var A6=(An[A5]=[]);for(var A7=0;A7<Ac;A7++){A6[A7]=AN.call(Ab)}}Ab._tiles=An},A4=function(){var A6=Ad*Ac,BC=[];for(var A8=0;A8<A6;A8++){BC[A8]=1}Ab.log("(re-)loading tiles...");var A7=function(BE,BG,BF){return function(){BC[BE*Ac+BG]=0;if(+BC.join("")===0){Ab.log("finished (re-)loading tiles.");Ab.Load.trigger()}}};for(var A5=0;A5<Ad;A5++){for(var BD=0;BD<Ac;BD++){var A9=An[A5][BD];if(!A9){AT("null tile encountered at ("+A5+", "+BD+").")}else{var BA=AX(A5,BD),BB=A7(A5,BD,A9);A9.setCoords(Ai(A5,BD));A9.setPosition(BA);if(Au(BA)){A9.Load.appendOnce(BB);A9.load(Ah)}else{BB()}}}}},A3=function(A5,A8){if(A5!==0||A8!==0){var BA=An;An=[];for(var A6=0;A6<Ad;A6++){An[A6]=[];for(var A9=0;A9<Ac;A9++){var A7;if((-A5<=A6&&A6+A5<Ad)&&(-A8<=A9&&A9+A8<Ac)){A7=BA[A6+A5][A9+A8]}else{A7=BA[Ad-1-A6][Ac-1-A9];var BB=AX(A6,A9);A7.setCoords(Ai(A6,A9));A7.setPosition(BB);if(Au(BB)){A7.load(Ah)}}An[A6][A9]=A7}}Ab._tiles=An}};if(Aq){Ak()}if(AZ&Q.UPDATE_ZOOM||Aq){A4();this._lastStartRow=Ay;this._lastStartCol=Am}else{for(var Aa=0;Aa<Ad;Aa++){for(var Ae=0;Ae<Ac;Ae++){var AY=An[Aa][Ae];if(!AY.isActive()&&Au(AX(Aa,Ae))){AY.load(Ah)}}}var AW=Am-this._lastStartCol,A2=Ay-this._lastStartRow;A3(AW,A2);this._lastStartRow=Ay;this._lastStartCol=Am}this.Update.trigger(AZ)}});D.configure(P,[AM,AO,AU,AL]);return P}()})();(function(){AA=AH.TrafficLayer=function(){var AL=o.parse,AQ,AP="time",AM="source",AO=P.prototype,AN=D.extend(P,{init:function(AR){AO.init.call(this,AR);this.reconfigureTraffic(AR)},_time:null,_source:null,_timeoutHandle:null,_refreshLoop:function(){var AR=this._timeoutHandle;if(AR){clearTimeout(AR)}var AS=this,AT=this._refreshTiles();AB.invoke(AB.TRAFFIC_PAGE,"TrafficExpires",[this._source,AT],function(AU){AS._timeoutHandle=setTimeout(function(){AS._refreshLoop()},AU*1000)},function(AU){if(AU instanceof AF){AS._refreshLoop()}},5*60*1000)},_refreshTiles:function(){function AS(AT){AT=""+AT;while(AT.length<2){AT="0"+AT}return AT}var AR=this._time;if(AR===AQ){AR=new Date()}if(typeof (AR)!=="string"){AR=AR.getFullYear()+"-"+AS(AR.getMonth()+1)+"-"+AS(AR.getDate())+"T"+AS(AR.getHours())+":"+AS(AR.getMinutes())+":"+AS(AR.getSeconds())}this.reconfigureTiles({serverPage:"trafficoverlay.aspx?source="+this._source+"&time="+AR+"&"});return AR},reconfigureTraffic:function(AR){this._time=AL(AR,AP,AQ);this._source=AL(AR,AM,"default");this._refreshLoop()}},{REAL_TIME:AQ="realtime"});D.configure(AN,[AP,AM]);return AN}()})();(function(){var AN=f.DOM;var AL=f.Events;var AM=f.ZIndices;l=AH.TileZoom=function(){var AO=x.prototype;var AP=D.extend(x,{_stepCount:null,_tileDiv:null,_tileLayer:null,Done:null,init:function(AQ){AO.init.call(this,AQ);this._active=false;this._origin=new X();this.Done=new J();var AR=AN.createElement("div",this.elem,this.id+"_tiles");AR.style.position="absolute";AR.onmousedown=AL.nothing;AR.ondragstart=AL.nothing;AR.oncontextmenu=AL.nothing;this._tileDiv=AR;this._stepCount=o.parse(AQ,"stepCount",5);this._tileLayer=o.parse(AQ,"tileLayer",null)},clear:function(){var AQ=this._tileDiv.childNodes.length;for(var AR=AQ-1;AR>=0;AR--){var AS=this._tileDiv.childNodes[AR];AN.detach(AS)}},run:function(AW,AR){if(!this._tileLayer){return }var AQ=this;var AV=this.map.getTileSize();this._size=AV;this._lastSize=AV;var AU=AV*AW;var AT=Math.round((AU-this._size)/this._stepCount);this._origin=(AR?new X(AR):this.map.getCenterXY()).subtract(this.map._lastPan);this._tileDiv.innerHTML=this._tileLayer.elem.innerHTML;this._tileDiv.style.left=this.map._lastPan.x+"px";this._tileDiv.style.top=this.map._lastPan.y+"px";this._tileDiv.style.zIndex=AM.ACTIVE_TILE_TRANSITION;this._active=true;this.show();var AS=setInterval(function(){AQ.setSize(AQ._lastSize+AT);if((AQ._size>=AU&&AW>1)||(AQ._size<=AU&&AW<1)){clearInterval(AS);AQ._tileDiv.style.zIndex=AM.TILE_TRANSITION;AQ._active=false;AQ.Done.trigger()}},20)},destroy:function(){this.clear();o.freeProperty(this,"_tileDiv");o.freeProperty(this,"Done");AO.destroy.call(this)},isActive:function(){return this._active},setSize:function(AT){this._lastSize=this._size;if(!AT){AT=this._size}this._size=AT;var AS=this._tileDiv.childNodes;for(var AR=0;AR<AS.length;AR++){var AU=AS[AR].style;var AQ=AT/this._lastSize;AU.left=Math.round((parseInt(AU.left)-this._origin.x)*AQ+this._origin.x)+"px";AU.top=Math.round((parseInt(AU.top)-this._origin.y)*AQ+this._origin.y)+"px";AU.width=AT+"px";AU.height=AT+"px";AU.zIndex=""}},update:function(AQ){this.Update.trigger(AQ)}},{setup:function(AV,AR){var AU;AR.tileLayer=AV;if(typeof (AR.silent)==="undefined"){AR.silent=AV._silent}if(typeof (AR.id)==="undefined"){AR.id=AV.id+"_transition"}var AQ=function(AX){var AY=AV.map.getZoomLevel()/AV.map.getLastZoomLevel();if(AY!==1&&0.25<=AY&&AY<=4){AU.run(AY,AX)}};var AT=function(){var AX=function(){AU.hide();AU.clear()};if(AU.isActive()){AU.Done.appendOnce(AX)}else{AX()}};var AW=function(){AR.map=AV.map;AU=new AP(AR);AU.hide();AV.map.Zoom.append(AQ)};var AS=function(){if(AU.map){AU.map.Zoom.remove(AQ)}AU.destroy()};AV.Load.append(AT);if(AV.map){AW()}AV.Added.append(AW);AV.Removed.append(AS)}});D.configure(AP,["stepCount","tileLayer"]);return AP}()})();(function(){var AM=f.HTTPClient;var AL=o.parse;w=AH.XSLTObjectLayer=function(){var AO;var AS;var AR;var AQ;var AN=function(){var AV=function(AW,AX){return'<xsl:param name="'+AW+'">'+AX+"</xsl:param>"},AU=function(AW){return"$LAT_XPATH &gt; $"+AW+"MinLat and $LAT_XPATH &lt; $"+AW+"MaxLat and $LON_XPATH &gt; $"+AW+"MinLon and $LON_XPATH &lt; $"+AW+"MaxLon"};return'<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:output method="text" />'+AV("queryMinLat",-90)+AV("queryMaxLat",90)+AV("queryMinLon",-180)+AV("queryMaxLon",180)+AV("vpMinLat",-90)+AV("vpMaxLat",90)+AV("vpMinLon",-180)+AV("vpMaxLon",180)+'<xsl:template match="/">var GeoBase=Telogis.GeoBase,LatLon=GeoBase.LatLon,MapLayers=GeoBase.MapLayers,Balloon=MapLayers.Balloon,Internal=GeoBase.Internal,DOM=Internal.DOM,ZINDEX=Internal.ZIndices.OBJECT,layer=MapLayers["$ID"],anchor=layer._anchorPoint,balloonCfg=layer._balloonConfig,balloonContentFunc=layer._balloonContentFunc,container=layer.elem,imgSrcFunc=layer._imgSrcFunc,size=layer._size,cssWidth=size.width+"px",cssHeight=size.height+"px",origin=layer.map.getOrigin(),offsetX=-origin.x-anchor.x*(size.width-1),offsetY=-origin.y-anchor.y*(size.height-1);<xsl:apply-templates select="//$OBJ_TAG_NAME['+AU("query")+' and ($QUERY_FILTERS)]"></xsl:apply-templates></xsl:template><xsl:template match="$OBJ_TAG_NAME">var id,loc,pos,data={loc:loc=new LatLon(+"<xsl:value-of select="$LAT_XPATH"/>",+"<xsl:value-of select="$LON_XPATH"/>"),pos:pos=layer.map.getXY(loc),id:(loc.lat+"_"+loc.lon).replace (".","_"),src:"$IMG_SRC"};$ED_INSTRUCTIONSid=data.id;<xsl:choose><xsl:when test="'+AU("vp")+'">var img=document.getElementById(data.id),style;if(!img){img=document.createElement("img");img.id=id;style=img.style;style.position="absolute";style.width=cssWidth;style.height=cssHeight;style.zIndex=ZINDEX;container.appendChild(img);layer[id]={elem:img};}img.src=imgSrcFunc(data);style=img.style;style.left=(pos.x+offsetX)+"px";style.top=(pos.y+offsetY)+"px";USE_BALLOON?var obj=layer[id],balloon=obj.balloon;if(!balloon){var cfg=balloonCfg;cfg.id=id+"_balloon";obj.balloon=balloon=new Balloon(cfg);balloon.setBehavior(img);}balloon.setContent(balloonContentFunc(data));balloon.setLocation(data.loc);?USE_BALLOON</xsl:when><xsl:otherwise>var obj=layer[id];if(obj){var balloon=obj.balloon,elem=obj.elem;if(balloon)balloon.destroy();if(elem)DOM.detach(elem);delete layer[id];}</xsl:otherwise></xsl:choose></xsl:template></xsl:stylesheet>'}();AS=function(AV){if(typeof (AV)!=="object"){AV={}}var AX=AL(AV,"queryFilters","true()");var Aa=AL(AV,"imgPath","");var AY=AL(AV,"imgXPath","@src");var AZ=AL(AV,"latXPath","@lat");var AW=AL(AV,"lonXPath","@lon");var Ab=AL(AV,"objTagName","p");var Ac=AQ(o.parse(AV,"extraData",{}),"data");var AU=AN;if(this._balloonConfig){AU=AU.replace(/USE_BALLOON\?/g,"").replace(/\?USE_BALLOON/g,"")}else{AU=AU.replace(/USE_BALLOON\?.*?\?USE_BALLOON/g,"")}AU=AU.replace(/\$ID/g,this.id);AU=AU.replace(/\$QUERY_FILTERS/g,AX);AU=AU.replace(/\$IMG_SRC/g,Aa||('<xsl:value-of select="'+AY+'" />'));AU=AU.replace(/\$ED_INSTRUCTIONS/g,Ac);AU=AU.replace(/\$LAT_XPATH/g,AZ);AU=AU.replace(/\$LON_XPATH/g,AW);AU=AU.replace(/\$OBJ_TAG_NAME/g,Ab);this._objTagName=Ab;this._xslt=new Y(AU)};AR=function(){var Ab=this;var Ac=this.map.getSize();var AZ=this._size.width/2;var AW=this._size.height/2;var Aa=this.map.getLatLon(new X(-AZ,Ac.height-1+AW));var AV=this.map.getLatLon(new X(AZ+Ac.width-1,-AW));var AU=new I((AV.lat-Aa.lat)/this._cellCount.y,(AV.lon-Aa.lon)/this._cellCount.x);clearTimeout(this._loadID);var AX={};var AY=function(Ad){var Ae=Ad.lat+"_"+Ad.lon;if(Ad.lat>AV.lat){Ab.Load.trigger()}else{if(Ad.lon>AV.lon){return AY(new I(Ad.lat+AU.lat,Aa.lon))}else{if(!AX[Ae]){var Af=Ab._xml.transformXSL(Ab._xslt,{"vpMinLat":Aa.lat,"vpMinLon":Aa.lon,"vpMaxLat":AV.lat,"vpMaxLon":AV.lon,"queryMinLat":Ad.lat,"queryMinLon":Ad.lon,"queryMaxLat":Ad.lat+AU.lat,"queryMaxLon":Ad.lon+AU.lon});N.Internal=f;window["eval"](Af);delete N.Internal;AX[Ae]=true;Ab._loadID=setTimeout(function(){AY(new I(Ad.lat,Ad.lon+AU.lon))},0)}}}};setTimeout(function(){AY(Aa)},0)};AQ=function(AX,AV){var AU="";for(var AW in AX){if(AX.hasOwnProperty(AW)){var AY=AX[AW];if(typeof (AY)==="string"||(AY instanceof String)){AU+=AV+"."+AW+'="<xsl:value-of select="'+AY+'"/>";'}}}return AU};var AP=x.prototype;var AT=D.extend(x,{_anchorPoint:null,_balloonConfig:null,_balloonContentFunc:null,_cellCount:null,_imgSrcFunc:null,_loaded:false,_loadID:0,_objTagName:"p",_size:null,_xml:null,_xslt:null,Load:null,init:function(AV){var AU=this;AP.init.call(this,AV);this._anchorPoint=AL(AV,"anchorPoint",new X(0.5));this._balloonContentFunc=AL(AV,"balloonContentFunc",function(AY,AX){return""+AY.loc.toString()});this._cellCount=AL(AV,"cellCount",new X(3,3));this._imgSrcFunc=AL(AV,"imgSrcFunc",function(AX){return AX.src});this._size=AL(AV,"size",AO);var AW=AL(AV,"balloonConfig",null);if(AW){AW.layer=this;AW.silent=true}this._balloonConfig=AW;AS.call(this,AV);this.Load=new J();this.Load.append(function(){AU._loaded=true});if(AV.xml){this.loadXML(AV.xml)}else{if(AV.src){this.loadXMLFromFile(AV.src)}}},destroy:function(){var AU=this;if(!this._loaded){this.Load.append(function(){AU.destroy()})}else{AP.destroy.call(this)}},isLoaded:function(){return this._loaded},loadXML:function(AU){this._loaded=false;this._xml=new Y(AU);this.update(Q.UPDATE_ZOOM)},loadXMLFromFile:function(AW){var AU=this;var AV=new AM();AV.Load.append(function(AX,AZ,AY){AU.loadXML(AY)});AV.get(AW)},update:function(AU){if(!this.map||!this._xml){return }var AW=(AU&Q.UPDATE_ZOOM||AU&Q.UPDATE_SIZE);if(AW){this.elem.innerHTML="";this._lastPan=this.map.getPan()}var AV=(AU&Q.UPDATE_PAN&&!this.map.isDragging())||AU&Q.UPDATE_END_PAN;if(AV||AW){AR.call(this)}this.Update.trigger(AU)},updateXML:function(AY,AW){if(!this._xml){return }AW=AW||function(Ab){return'@id="'+Ab.getAttribute("id")+'"'};AY=new Y(AY);var Aa=AY.selectNodes("//"+this._objTagName);var AU=Aa.length;for(var AX=0;AX<AU;AX++){var AV=Aa[AX];var AZ=this._xml.replaceNode("//"+this._objTagName+"["+AW(AV)+"]",AV);if(!AZ){this._xml.appendChild(AV)}}AR.call(this)},updateXMLFromFile:function(AX,AV){var AU=this;var AW=new AM();AW.Load.append(function(AY,Aa,AZ){AU.updateXML(AZ,AV)});AW.get(AX)}},{DEFAULT_SIZE:AO=new F(16)});D.configure(AT,["anchorPoint","balloonConfig","balloonContentFunc","buffering","cellCount","extraData","imgPath","imgSrcFunc","imgXPath","latXPath","lonXPath","objTagName","queryFilters","size","src","xml"]);return AT}()})();(function(){g=N.Widgets={}})();(function(){AD=g.AbstractWidget=function(){var AL=f.DOM.createElement,AS=f.Events,AT=AS.addFocal,AN=AS.nothing,AP=o.parse,AQ=function(AU){var AV=AP(AU,"parent",null);return AL("div",AV,this.id)},AR=function(){var AV=this,AW=this.elem,AU=function(AZ){var AY=AZ.keyCode||AZ.which;if(AY){AV.Key.trigger(AY,AZ)}},AX=function(AY){var AZ,Aa=0;if(AZ=AY.wheelDelta){Aa=AZ/120;if(window.opera){Aa=-Aa}}else{if(AZ=AY.detail){Aa=-AZ/3}}if(Aa){AV.MouseWheel.trigger(Aa,AY)}return AN(AY)};AT(AW,"keyup",document,AU);AT(AW,"mousewheel",document,AX);AT(AW,"mousewheel",window,AX);AT(AW,"DOMMouseScroll",window,AX)},AO=G.prototype,AM=D.extend(G,{init:function(AU){AO.init.call(this,AU,AQ);this.Key=new J();this.MouseWheel=new J();AR.call(this);g[this.id]=this},Key:null,MouseWheel:null,destroy:function(){delete g[this.id];AO.destroy.call(this)}});D.configure(AM,["parent"]);return AM}()})();(function(){if(typeof (Ext)!=="undefined"){var AL=(N.Widgets.ExtWrapper=function(AN,AO,AP){var AM=this;if(typeof (AO)!=="object"){AO={}}if(typeof (AP)!=="object"){AP={}}AL.superclass.constructor.call(this,AP);this.on("resize",function(AR,AU,AS,AQ,AT){if(typeof (this.widget.setSize)==="function"){this.widget.setSize(new F(2+AU,2+AS))}});this.onRender=function(AR,AQ){AL.superclass.onRender.call(this,AR,AQ);if(!AM.el){AM.el=AR.createChild({id:AM.id},AQ)}AO.parent=AM.el;AM.widget=new AN(AO)}});Ext.extend(AL,Ext.BoxComponent,{})}})();(function(){var AO=f.DOM,AL=f.Events,AP=f.Projection,AN=f.ZIndices,AM=O.indexOf;Q=g.Map=function(){var AY=1,AW=2,Ac=1,AZ=2,AQ=4,AU=8,Aa="crosshair",AR="default",Ab="pointer",AV="pointer",Ad,Ae=function(Aj){var Am=AO.createElement("div",Aj,this.id+"_copyright_row");Am.style.position="absolute";Am.style.bottom="0px";Am.style.width=this._size.width+"px";Am.style.margin="0px 0px 0px 0px";Am.style.padding="0px 0px 0px 0px";Am.style.zIndex=AN.COPYRIGHT;var Al=AO.createElement("div",Am,this.id+"_copyright_div");Al.setAttribute("align","right");var Ah=AO.createElement("table",Al,this.id+"_copyright_table");Ah.setAttribute("cellpadding","0");Ah.setAttribute("cellspacing","0");Ah.style.backgroundColor="#bbddff";Ah.style.borderWidth="0px 0px 0px 0px";Ah.style.padding="0px 0px 0px 0px";var Af=AO.createElement("tbody",Ah,this.id+"_copyright_tbody");var Ai=AO.createElement("tr",Af,this.id+"_copyright_tr");var Ak=AO.createElement("td",Ai,this.id+"_copyright_td");Ak.style.margin="0px 0px 0px 0px";Ak.style.padding="0px 0px 0px 0px";var Ag=AO.createElement("div",Ak,this.id+"_copyright_content");Ag.style.color="#0000ff";Ag.style.fontFamily="verdana, sans-serif";Ag.style.fontSize="10px";Ag.style.padding="1px 2px 1px 2px";N.getCopyright(function(An){Ag.innerHTML=An});this._copyrightRow=Am;this._copyrightContent=Ag},AT=function(){var Af=this,Ag=this.elem,Ah=this.id;Ag.style.overflow="hidden";this.frame=AO.createElement("div",Ag,Ah+"_frame",function(Aj){var Ai=Aj.style;Ai.position="absolute";Ai.overflow="hidden";Af.container=AO.createElement("div",Aj,Ah+"_container",function(Ak){var Al=Ak.style;Al.overflow="visible";Al.position="absolute";Al.top="0px";Al.left="0px"});Ae.call(Af,Aj)})},AX=AD.prototype,AS=D.extend(AD,{init:function(Ag){if(typeof (Ag)!=="object"){Ag={}}o.parse(Ag,"parent",document.body);AX.init.call(this,Ag);this._copyrightOffset=new X();this._timeLine=new K.TimeLine();var Ah=null;if(Ag.size){Ah=Ag.size}else{var Aj=this.elem,Ai=Aj.parentNode;Ah=new F(Aj);if(!Ah.width||!Ah.height){Ah=new F(Ai)}if(!Ah.width||!Ah.height){Ah=new F(240,240)}}this._size=Ah;AT.call(this);var Af=o.parse(Ag,"backgroundColor","#ffffff");if(Af instanceof T){Af=Af.toCSSHex()}this.frame.style.backgroundColor=Af;this._listeners=[];this._projection=new AP([1,2,4,8,16,32,64,128,192,256,384,512,1024,2048,4096,8192,16384,32768,75536,124688],300,4,8,this._size);this._projection.setCenter(o.parse(Ag,["center","centre"],new I(34,-118)));this._minZoom=o.parse(Ag,"minZoomIndex",this._projection.getMinZoomIndex());this._maxZoom=o.parse(Ag,"maxZoomIndex",this._projection.getMaxZoomIndex());this._uiEnabled=o.parse(Ag,"uiEnabled",true);this.Drag=new J();this.Pan=new J();this.Resize=new J();this.Update=new J();this.Zoom=new J();this._initEvents();this.setDragBehavior(o.parse(Ag,"dragMode",AY));this.setSize(this._size,true);if(o.parse(Ag,"createTiles",true)){new P(o.parse(Ag,"tileLayerConfig",{id:this.id+"_tiles",parent:this}))}},_copyrightOffset:null,_copyrightRow:null,_dragBehavior:AY,_dragging:false,_listeners:null,_maxZoom:0,_minZoom:0,_projection:null,_size:null,_timeLine:null,_uiEnabled:true,container:null,Drag:null,frame:null,Pan:null,Resize:null,Update:null,Zoom:null,_drag:function(Ag){var Af=this;if(!this._uiEnabled){return true}this._dragging=true;switch(this._dragBehavior){case AY:this.elem.style.cursor=AV;AL.beginDrag(this.elem,function(Ah){Af.panBy(Ah)},function(){Af._dragging=false;Af.elem.style.cursor=Ab;Af.update(AU)});break;case AW:this.elem.style.cursor=Aa;this._zoomBox.orig=this.getLatLon(this.mouseXY(Ag));this._zoomBox.nw=this._zoomBox.orig;this._zoomBox.se=this._zoomBox.orig;AL.beginDrag(this,this._updateZoomBox,function(){Af._dragging=false;Af._zoomBoxLayer.hide();var Ai=Af._projection.getXY(Af._zoomBox.nw);var Ah=Af._projection.getXY(Af._zoomBox.se);if(Ah.x-Ai.x>5&&Ah.y-Ai.y>5){Af.zoomTo(new AC(this._zoomBox.nw,this._zoomBox.se))}Af._zoomBox.nw=new I();Af._zoomBox.se=new I();Af.elem.style.cursor=AR});break}},_initEvents:function(){var Af=this;this.MouseDown.append(function(Ag){Af.Drag.trigger(Ag)});this.DoubleClick.append(function(Ag){Af.slowPan(Ag)});this.Drag.append(function(Ag){Af._drag(Ag)});this.RightClick.append(AL.nothing);this.MouseWheel.append(function(Ah,Ag){if(!Af._uiEnabled){return true}Af._wheelZoom(Ah,Af.mouseXY(Ag))})},_updateZoomBox:function(Ah,Ag){this._zoomBoxLayer.show();var Af=this.getLatLon(this.mouseXY(Ag));this._zoomBox.nw=new I(Math.max(this._zoomBox.orig.lat,Af.lat),Math.min(this._zoomBox.orig.lon,Af.lon));this._zoomBox.se=new I(Math.min(this._zoomBox.orig.lat,Af.lat),Math.max(this._zoomBox.orig.lon,Af.lon));this._zoomBoxLayer.setCorners(this._zoomBox.nw,this._zoomBox.se)},_wheelZoom:function(Al,Aj){var Ai=this._projection.getZoomIndex();if(Al>0){Al=1;Ai++}else{Al=-1;Ai--}if(Ai>this._maxZoom||Ai<this._minZoom){return }var Ah=this.getPan();var Af=this._projection.getCenterXY().subtract(Aj);var Ak=this._projection.getZoomLevel(this._projection.getZoomIndex()+Al)/this._projection.getZoomLevel();var Ag=new X(Af.x/Ak,Af.y/Ak).add(Aj);this.hideLayers();this.pan(Ag,true);this.setZoomIndex(Ai,true);this._lastPan=Ah;this.Pan.trigger();this.Zoom.trigger(Aj);this.update(AZ|AQ);this.showLayers();this._lastPan=new X(0,0)},addListener:function(Ag){if(typeof (Ag.update)!=="function"){throw new C("map listener does not specify an update() method.")}this._listeners.push(Ag);var Af=Ag.id;if(Af){this[Af]=Ag;this.log("added "+Af+".")}},bind:function(Af,Ai){if(!(Af instanceof AS)){throw new C("invalid GeoBase map binding")}if(!Ai){Ai=0}var Ag=this;var Aj=function(){if(!Ag.getCenter().equals(Af.getCenter())){Af.pan(Ag.getCenter())}};var Ah=function(){var Ak=Ag.getZoomIndex()-Ai;if(Ak<0){Ak=0}if(Ak>Af.getMaxZoomIndex()){Ak=Af.getMaxZoomIndex()}if(Af.getZoomIndex()!=Ak){Af.setZoomIndex(Ak)}Aj()};this.Pan.append(Aj);Aj();this.Zoom.append(Ah);Ah()},changeSize:function(Af){this.setSize(new F(this._size.width+Af.width,this._size.height+Af.height))},destroy:function(){var Ag=this._listeners;for(var Af=Ag.length-1;Af>=0;Af--){Ag[Af].setMap(null)}AX.destroy.call(this)},disableUI:function(){this.setUIEnabled(false)},enableUI:function(){this.setUIEnabled(true)},getCenter:function(){return this._projection.getCenter()},getCenterXY:function(){return this._projection.getCenterXY().round()},getColCount:function(){return this._projection.getColCount()},getHeight:function(){return this._size.height},getLastZoomIndex:function(){return this._lastZoomIndex},getLastZoomLevel:function(){return this._projection.getZoomLevel(this._lastZoomIndex)},getLatLon:function(Af){return this._projection.getLatLon(Af)},getMaxZoomIndex:function(){return this._maxZoom},getMinZoomIndex:function(){return this._minZoom},getOrigin:function(){return this._projection.getOrigin()},getPan:function(){return new X(parseInt(this.container.style.left),parseInt(this.container.style.top))},getRowCount:function(){return this._projection.getRowCount()},getSize:function(){return new F(this._size)},getStartCol:function(){return this._projection.getStartCol()},getStartRow:function(){return this._projection.getStartRow()},getTileCoords:function(Ag,Af){return this._projection.getTileCoords(Ag,Af)},getTileLayer:function(){var Ag=this._listeners;for(var Af=0,Ai=Ag.length;Af<Ai;Af++){var Ah=Ag[Af];if(Ah instanceof P){return Ah}}return null},getTileLayers:function(){var Ag=this._listeners,Aj=[];for(var Af=0,Ai=Ag.length;Af<Ai;Af++){var Ah=Ag[Af];if(Ah instanceof P){Aj.push(Ah)}}return Aj},getTileOffset:function(){return this._projection.getTileOffset()},getTileSize:function(){return this._projection.getTileSize()},getTilesPerSuperTile:function(){return this._projection.getTilesPerSuperTile()},getWidth:function(){return this._size.width},getXY:function(Af){return this._projection.getXY(Af).round()},getZoomIndex:function(){return this._projection.getZoomIndex()},getZoomLevel:function(Af){return this._projection.getZoomLevel(Af)},hideCopyright:function(){this._copyright.style.display="none"},hideLayers:function(Af){for(var Ag=0;Ag<this._listeners.length;Ag++){var Ah=this._listeners[Ag];if(Ah instanceof x){if(Af&&Af(Ah)){Ah.hideCumulative()}else{Ah.hideCumulative()}}}},isDragging:function(){return this._dragging},isUIEnabled:function(){return this._uiEnabled},mouseLatLon:function(Af){return this._projection.getLatLon(this.mouseXY(Af),true)},mouseXY:function(Af){return AO.relMousePos(Af,this.frame)},panBy:function(Ai,Ah){var Af=new X(Ai),Ag=this.container.style;Af.x+=parseInt(Ag.left);Af.y+=parseInt(Ag.top);this.panToCorner(Af,Ah)},pan:Ad=function(Af,Ai){if(Af instanceof I){return this.pan(this._projection.getXY(Af))}var Ag=new X(Af),Ah=this._size;Ag.x=Ah.width/2-Ag.x;Ag.y=Ah.height/2-Ag.y;this.panBy(Ag,Ai)},setCenter:Ad,panToCorner:function(Am,Ag){var Ak=this._projection,Ah=this.container.style,Ai=Ah.left=Math.round(Am.x)+"px",Al=Ah.top=Math.round(Am.y)+"px",Aj=false;if(Ah.left!==Ai||Ah.top!==Al){if(!Ag){this.hideLayers()}var An=this._size;var Af=new X(An.width/2-Am.x,An.height/2-Am.y);Ak.setCenter(Ak.getLatLon(Af));this.resetOrigin();Aj=true}else{Ak.setOrigin(Am)}if(!Ag){this.Pan.trigger();this.update(Aj?(AQ|AZ):AQ);if(Aj){this.showLayers()}}},removeListener:function(Ah){var Ag=this._listeners;Ag.splice(AM(Ag,Ah),1);var Af=Ah.id;if(Af){delete this[Af];this.log("removed "+Af+".")}},resetOrigin:function(){var Af=this.container.style;Af.left="0px";Af.top="0px"},setSize:function(Af,Ag){if(this._size.width!==Af.width||this._size.height!==Af.height||Ag){this._size=new F(Af);this.elem.style.width=this._size.width+"px";this.elem.style.height=this._size.height+"px";this.frame.style.width=this._size.width+"px";this.frame.style.height=this._size.height+"px";this.setCopyrightOffset();this.hideLayers();this._projection.setSize(Af);this.Resize.trigger();this.update(Ac);this.showLayers()}},setBackColor:function(Af){this.frame.style.background=Af},setCopyrightOffset:function(Af){if(Af){this._copyrightOffset=new X(Af)}this._copyrightRow.style.width=this._size.width-this._copyrightOffset.x+"px";this._copyrightRow.style.bottom=this._copyrightOffset.y+"px"},setCursor:function(Ag){var Af=this.elem.style,Ah=Af.cursor;Af.cursor=Ag;return Ah},setDragBehavior:function(Af){switch(Af){case AW:this._dragBehavior=AW;if(this._uiEnabled){this.elem.style.cursor=AR}this._zoomBox={orig:new I(),nw:new I(),se:new I()};if(!this._zoomBoxLayer){this._zoomBoxLayer=new d({borderType:"dashed",borderWidth:1,color:new T(0,0,128,0.2),id:this.id+"_zoombox",parent:this});this._zoomBoxLayer.hide()}break;case AY:this._dragBehavior=AY;if(this._zoomBox){delete this._zoomBox}if(this._zoomBoxLayer){this._zoomBoxLayer.destroy();delete this._zoomBoxLayer}if(this._uiEnabled){this.elem.style.cursor=Ab}break;default:throw new a("unrecognised dragging behavior #"+Af+' for map "'+this.id+'".')}},setHeight:function(Af){this.setSize(new F(this._size.width,Af))},setMaxZoomIndex:function(Af){Af=Math.min(Af,this._projection.getMaxZoomIndex());this._maxZoom=Af;if(this.getZoomIndex()>Af){this.setZoomIndex(Af)}},setMinZoomIndex:function(Af){Af=Math.max(Af,this._projection.getMinZoomIndex());this._minZoom=Af;if(this.getZoomIndex()<Af){this.setZoomIndex(Af)}},setUIEnabled:function(Af){this._uiEnabled=Af;if(!Af){this.elem.style.cursor=AR}},setWidth:function(Af){this.setSize(new F(Af,this._size.height))},setZoomIndex:function(Af,Ag){if(Af<this._minZoom||Af>this._maxZoom){return }var Ah=this.getZoomIndex();if(Ah===Af){return }this._lastZoomIndex=Ah;this._lastPan=this.getPan();if(!Ag){this.hideLayers()}this.resetOrigin();this._projection.setZoomIndex(Af);if(!Ag){this.Pan.trigger();this.Zoom.trigger(this._projection.getCenterXY());this.update(AZ|AQ);this.showLayers()}this._lastPan=new X(0,0)},shade:function(Af,Ah){if(!(Af instanceof AS)){throw new C("cannot place a layer on an object that is not a map.")}if(typeof (Ah)!=="object"){Ah={}}var Ag=this;Ah.parent=Af;Ah.viewport=this;var Ai=new d(Ah);var Aj=function(){Ai.setCorners(Ag)};this.Resize.append(Aj);this.Pan.append(Aj);this.Zoom.append(Aj)},showCopyright:function(){this._copyrightRow.style.display="block"},showLayers:function(Af){for(var Ag=0;Ag<this._listeners.length;Ag++){var Ah=this._listeners[Ag];if(Ah instanceof x){if(Af){if(Af(Ah)){Ah.showCumulative()}}else{Ah.showCumulative()}}}},slowPan:function(Aj,Ai){if(!this._uiEnabled){return true}var Al=0;var Af=this;var Ag=this.mouseXY(Aj);var Ak=new X((this._size.width/2)-Ag.x,(this._size.height/2)-Ag.y);var Ah=function(Am){var An=new X(Math.round((Am-Al)*Ak.x),Math.round((Am-Al)*Ak.y));Al=Am;Af.panBy(An)};this._timeLine.append(new K.Transition(500,Ah,K.sine))},update:function(Af){var Ah=this._listeners;for(var Ag=0,Ai=Ah.length;Ag<Ai;Ag++){Ah[Ag].update(Af)}this.Update.trigger()},worldWidthPixels:function(){return this._projection.worldWidthPixels()},zoomIn:function(){if(this._projection.getZoomIndex()<this._maxZoom){this.setZoomIndex(this._projection.getZoomIndex()+1)}},zoomOut:function(){if(this._projection.getZoomIndex()>this._minZoom){this.setZoomIndex(this._projection.getZoomIndex()-1)}},zoomTo:function(Aq){var Al=this.getPan();var Ap=this.getZoomIndex();var Ai;for(Ai=this._maxZoom;Ai>=0;Ai--){this.setZoomIndex(Ai,true);var At=this._projection.getXY(Aq.getSW());var Ao=this._projection.getXY(Aq.getNE());var Au=Ao.x-At.x;var Ar=At.y-Ao.y;if(Au<this._size.width&&Ar<this._size.height){break}}this._lastZoomIndex=Ap;this._lastPan=Al;var Ay=new X();var An=this._lastZoomIndex-Ai;if(An){var Av=this._projection.getCenterXY();var Ag=this._projection.getXY(Aq.getCenter());var Az=Math.pow(2,An);var As=this.getSize();var Af=new F(As).multiply(Az);var Am=new X(Av.x-As.width/2,Av.y+As.height/2);var Ak=new X(Av.x+As.width/2,Av.y-As.height/2);var Ax=new X(Ag.x-Af.width/2,Ag.y+Af.height/2);var Aw=new X(Ag.x+Af.width/2,Ag.y-Af.height/2);var Aj=(Am.y-Ax.y)/(Am.x-Ax.x);var Ah=(Ak.y-Aw.y)/(Ak.x-Aw.x);Ay.x=(Aj*Am.x-Ah*Ak.x-Am.y+Ak.y)/(Aj-Ah);Ay.y=Aj*(Ay.x-Am.x)+Am.y;Ay.x=Math.round(Av.x+(Ay.x-Av.x)*Az);Ay.y=Math.round(Av.y+(Ay.y-Av.y)*Az);this.hideLayers()}else{Ay=null}this.resetOrigin();this._projection.setCenter(Aq.getCenter());this.Pan.trigger();if(Ay){this.Zoom.trigger(Ay)}this.update(AZ|AQ);if(An){this.showLayers()}this._lastPan=new X(0,0)}},{DRAG_PAN:AY,DRAG_ZOOM:AW,UPDATE_SIZE:Ac,UPDATE_ZOOM:AZ,UPDATE_PAN:AQ,UPDATE_END_PAN:AU,UPDATE_REDRAW:AZ|AQ,UPDATE_FULL:Ac|AZ|AQ,getBoxingCursor:function(){return Aa},getDefaultCursor:function(){return AR},getPanCursor:function(){return Ab},getPanningCursor:function(){return AV},setBoxingCursor:function(Af){Aa=Af||"crosshair"},setDefaultCursor:function(Af){AR=Af||"default"},setPanCursor:function(Af){Ab=Af||"pointer"},setPanningCursor:function(Af){AV=Af||"pointer"}});D.configure(AS,["backgroundColor","center","centre","createTiles","dragMode","maxZoomIndex","minZoomIndex","size","tileLayerConfig","uiEnabled"]);return AS}()})();(function(){e=g.MapControl=function(){var AQ=f.DOM,AL=f.Events,AP=f.ZIndices,AM=Q.UPDATE_FULL,AS=f.lookup,AR=AL.maskUI,AO=AD.prototype,AN=D.extend(AD,{_skin:null,Added:null,map:null,Removed:null,init:function(AT){var AU=g.Map;if(!AT){AT={}}this.map=f.lookup(g,AT.map,AU);if(!AT.parent&&this.map){AT.parent=this.map.frame}AO.init.call(this,AT);this.elem.style.position="absolute";this.elem.style.zIndex=AP.MAP_CONTROL;this.elem.style.cursor=AU.getDefaultCursor();AR(this.elem);this.Added=new J();this.Removed=new J();this.setPosition(o.parse(AT,"position",new X(0,0)))},destroy:function(){this.setMap(null);AO.destroy.call(this)},setMap:function(AU,AT,AW){var AV=this.map;if(AU!==AV){if(AV){AV.removeListener(this);if(AW){AW(AV)}this.Removed.trigger(AV)}this.map=AU=(AU?AS(g,AU,Q):null)}if(AU){AU.addListener(this);if(AT){AT(AU)}this.Added.trigger(AU);this.update(AM)}},setPosition:function(AT){if(this.elem){AQ.clearPosition(this.elem);this.elem.style.left=AT.x+"px";this.elem.style.top=AT.y+"px"}this.update()},update:function(AT){},whenAdded:function(AT){if(this.map){AT()}else{this.Added.appendOnce(AT)}}});D.configure(AN,["map","position"]);D.virtualize(AN,["getSize","update"]);return AN}()})();(function(){var AO=f.DOM;var AL=f.Events;var AN=f.ZIndices;var AM=Q.UPDATE_SIZE;var AP=AL.maskUI;g.Dock=function(){var AU;var AQ;AU=function(AW,AZ,Aa,AY){var AX=g.Map;if(Aa<=0){return }if(!this._fills[this._fills.top]){this._fills[this._fills.top]=AQ.call(this)}var Ab=this._fills[this._fills.top++];var AV=this.isVertical();AO.clearPosition(Ab);Ab.style.display="block";Ab.style.cursor=AX.getDefaultCursor();Ab.style[AV?"top":"left"]=AW+"px";Ab.style[AV?"left":"top"]=AZ+"px";Ab.style[AV?"height":"width"]=Aa+"px";Ab.style[AV?"width":"height"]=AY+"px"};AQ=function(){var AV=this.elem.appendChild(this._skin.createFill("widget_dock_fill_"+f.getGUID()));AV.style.zIndex=AN.MAP_CONTROL;AP(AV);return AV};var AT=function(AX){var AW=this,AV=!isNaN(AX),AY=AV?this._items[AX]:AX;AY.control.getSize(function(Aa){if(!AV){AW._items.push(AY)}AW.elem.appendChild(AY.control.elem);var AZ=AW.isVertical();if(AZ){AY.thickness=Aa.width;AY.length=Aa.height}else{AY.thickness=Aa.height;AY.length=Aa.width}AW.update(AM)})};var AS=e.prototype;var AR=D.extend(e,{init:function(AW){if(!AW){AW={}}AS.init.call(this,AW);var AV=o.parse(AW,"items",[]);this._align=o.parse(AW,"align","bottom");this._items=[];this._fills=[];this._fills.top=0;this._skin=(AW.skin instanceof m)?AW.skin:m.standard;if(!this._skin){throw new k("no skin available for "+this.id+".")}this.elem.style.overflow="hidden";this.elem.style.zIndex=AN.MAP_CONTROL-1;this.setMap(AW.map||AW.parent||null);for(var AX=0;AX<AV.length;AX++){this.add(AV[AX])}},_align:"bottom",_fills:null,_items:null,_skin:null,map:null,add:function(AW){AW.hide();if(this.map){AW.setMap(this.map)}this.elem.appendChild(AW.elem);var AV={control:AW};AT.call(this,AV)},destroy:function(){AS.destroy.call(this)},getLength:function(){return this.map?(this.isVertical()?this.map.getHeight():this.map.getWidth()):0},getSize:function(AY){var AX=this.getLength();var AW=this.getThickness();var AV=this.isVertical();AY(AV?new F(AW,AX):new F(AX,AW))},getThickness:function(){var AV=this._items;var AX=0;for(var AW=0;AW<this._items.length;AW++){var AY=AV[AW].thickness;if(AY>AX){AX=AY}}return AX},isVertical:function(){return(this._align==="left"||this._align==="right")},setMap:function(Aa){var AW=this,AX=this.elem,AV=this._items,AZ=AV.length,AY=function(Ad){Ad.frame.appendChild(AX);if(AV){for(var Ac=0;Ac<AZ;Ac++){AV[Ac].control.setMap(Ad);AT.call(AW,Ac)}}},Ab=function(Ad){Ad.frame.removeChild(AW.elem);if(AV){for(var Ac=0;Ac<AZ;Ac++){AV[Ac].control.setMap(null)}}};AS.setMap.call(this,Aa,AY,Ab)},update:function(Aj){if(Aj&AM){if(!this.map||!this._skin){return }var Ac=AO.opposite(this._align);var AZ=this.isVertical();var AV=this.getLength();var Af=this.getThickness();var Ab;var AW=0;for(Ab=0;Ab<this._items.length;Ab++){AW+=this._items[Ab].length}AO.clearPosition(this.elem);this.elem.style[this._align]="0px";this.elem.style[AZ?"height":"width"]=AV+"px";this.elem.style[AZ?"width":"height"]=Af+"px";this._skin.applyBorder(this.elem,Ac);this._fills.top=0;for(Ab=0;Ab<this._fills.length;Ab++){this._fills[Ab].style.display="none"}var Ai=this;var Ah=function(Ak,Ao){var An=Ak.control;AO.clearPosition(An.elem);An.elem.style[AZ?"top":"left"]=Ao+"px";An.elem.style[Ac]="0px";An.elem.style.display="block";var Am=Af-Ak.thickness;if(Am>0){var Al=Am/2;AU.call(Ai,Ao,0,Ak.length,Al);AU.call(Ai,Ao,Af-Al,Ak.length,Al);An.elem.style[AZ?"left":"top"]=Al+"px"}};if(this._items.length>1){var Aa=0;var AX=AV-AW;var Ad=Math.round(AX/(this._items.length-1));for(Ab=0;Ab<this._items.length;Ab++){Ah(this._items[Ab],Aa);Aa+=this._items[Ab].length;if(Aa<AV){AU.call(this,Aa,0,Ad,Af)}Aa+=Ad}}else{if(this._items.length===1){var AY=(AV-this._items[0].length)/2;var Ag=AY+this._items[0].length;Ah(this._items[0],AY);AU.call(this,0,0,AY,Af);AU.call(this,Ag,0,AY,Af)}else{AU.call(this,0,0,AV,Af)}}if(this._align==="bottom"||this._align==="right"){var Ae=new X();Ae[AZ?"x":"y"]=Af;this.map.setCopyrightOffset(Ae)}}}});D.configure(AR,["align","items","map"]);return AR}()})();(function(){var AL=f.DOM;m=N.Widgets.DockSkin=function(){var AN=R.prototype;var AM=D.extend(R,{_border:"",init:function(AO){AN.init.call(this);this._border=o.parse(AO,"border","1px solid black");this._images={background:o.parse(AO,"background","")};this.load()},applyBorder:function(AP,AO){var AQ="border"+AO.charAt(0).toUpperCase()+AO.substring(1);AP.style[AQ]=this._border},createFill:function(AP){var AO=AL.createElement("div",null,AP);AO.style.backgroundImage="url("+this._images.background+")";return AO}});D.configure(AM,["background","border"]);return AM}()})();(function(){var AM=f.DOM;var AL=f.ZIndices;g.Scale=function(){var AS;var AN;var AR;var AQ;AS=function(AU){var AT=this;var AW=function(Aa){var Ab=Math.floor(AU/AT._scales[Aa]);return Math.abs(Ab-AT._markCount)};var AV=0;var AZ=AW(AV);for(var AY=1;AY<this._scales.length;AY++){var AX=AW(AY);if(AX<AZ){AV=AY;AZ=AX}}this._activeScale=this._scales[AV]};AN=function(){var AT=this;AT._skin.whenLoaded(function(){AT._skin.initBody(AT.elem);var AV=AM.createElement("div",AT.elem,AT.id+"_scale_indicator");var AU=AM.createElement("div",AT.elem,AT.id+"_unit_indicator");AV.style.zIndex=AL.MAP_CONTROL+1;AU.style.zIndex=AL.MAP_CONTROL+1;AT._skin.applyScaleLabelStyle(AV);AT._skin.applyUnitLabelStyle(AU);AV.style.position="absolute";AU.style.position="absolute";AT._scaleLabel=AV;AT._unitLabel=AU})};AR=function(){var AT;for(AT=this._markElements.length;AT<this._markPositions.length;AT++){var AU=this.elem.appendChild(this._skin.createMark(this.id+"_mark_"+AT));AU.style.zIndex=AL.MAP_CONTROL+1;this._markElements[AT]=AU}for(AT=0;AT<this._markElements.length;AT++){this._markElements[AT].style.display="none"}};AQ=function(){var Aa=new X(this.elem);var AU=new X(this.map.elem);var Ac=new X(Aa.x-AU.x,Aa.y-AU.y);var Ad=this._skin.getBarStart().add(Ac);var AX=this._skin.getBarEnd().add(Ac);var AV=this.map.getLatLon(Ad);var AY=this.map.getLatLon(AX);var Ab=AV.distanceTo(AY,this._unit);var AW=this._skin.getBarLength();AS.call(this,Ab);var AT=Math.round(this._activeScale*AW/Ab);this._markPositions=[];for(var AZ=0;AZ<AW;AZ+=AT){this._markPositions.push(AZ)}AR.call(this)};var AP=e.prototype;var AO=D.extend(e,{_activeScale:0,_markCount:6,_markElements:null,_markPositions:null,_scales:null,_unit:t.KILOMETERS,init:function(AU){var AV=g.ScaleSkin;var AT=this;if(!AU){AU={}}AP.init.call(this,AU);this._skin=AU.skin||AV.standard;if(!this._skin){throw new k('no skin available for scale "'+this.id+'".')}this._markCount=o.parse(AU,"markCount",5)+1;this._unit=o.parse(AU,["unit","units"],t.KILOMETERS);this._markElements=[];this._markPositions=[];if(AU.scales){this._scales=AU.scales}else{this._scales=[0.1,0.2,0.5,0.8,1,2,5,8,10,20,50,80,100,200,500,800,1000,2000,5000,8000]}AN.call(this);this._skin.whenLoaded(function(){AT.setMap(AT.map)})},getSize:function(AU){var AT=this;this._skin.whenLoaded(function(){AU(AT._skin.getSize())})},setMap:function(AT){AP.setMap.call(this,AT)},update:function(AT){if(!this._skin){return }var AU=this;this._skin.whenLoaded(function(){AQ.call(AU);for(var AV=0;AV<AU._markPositions.length;AV++){AU._skin.placeMark(AU._markElements[AV],AU._markPositions[AV]);AU._markElements[AV].style.display="block"}AU._unitLabel.innerHTML=AU._unit;AU._scaleLabel.innerHTML="x"+AU._activeScale})}});D.configure(AO,["markCount","scales","skin","unit","units"]);return AO}()})();(function(){var AM=f.DOM;var AL=1;var AN=2;g.ScaleSkin=function(){var AP=R.prototype;var AO=D.extend(R,{_barDepth:0,_barEnd:0,_barStart:0,_labelStyle:null,_layout:0,_scaleLabelStyle:null,_unitLabelStyle:null,init:function(AQ){AP.init.call(this);var AR=o.parse(AQ,"folder","");if(AR&&AR.charAt(AR.length-1)!=="/"){AR+="/"}this._images={body:AR+o.parse(AQ,"bodySrc","body.png"),mark:AR+o.parse(AQ,"markSrc","mark.png")};this.load();this._layout=o.parse(AQ,"layout",AL);this._barDepth=o.parse(AQ,"barDepth",0);this._barStart=o.parse(AQ,"barStart",0);this._barEnd=o.parse(AQ,"barEnd",0);this._labelStyle=o.parse(AQ,"labelStyle",{});this._scaleLabelStyle=o.parse(AQ,"scaleLabelStyle",{});this._unitLabelStyle=o.parse(AQ,"unitLabelStyle",{})},applyScaleLabelStyle:function(AQ){AM.applyStyle(AQ,this._labelStyle);AM.applyStyle(AQ,this._scaleLabelStyle)},applyUnitLabelStyle:function(AQ){AM.applyStyle(AQ,this._labelStyle);AM.applyStyle(AQ,this._unitLabelStyle)},createMark:function(AR){var AQ=AM.createElement("img",null,AR);AQ.setAttribute("src",this._images.mark);return AQ},getBarEnd:function(){if(this._layout===AN){return new X(this._barDepth,this._barEnd)}else{return new X(this._barEnd,this._barDepth)}},getBarStart:function(){if(this._layout===AN){return new X(this._barDepth,this._barStart)}else{return new X(this._barStart,this._barDepth)}},getBarLength:function(){return this._barEnd-this._barStart},getSize:function(){return new F(this._sizes.body)},initBody:function(AQ){this._initImageDiv(AQ,"body")},placeMark:function(AS,AU){var AR=this._layout===AN;var AT=Math.floor(this._sizes.mark[AR?"height":"width"]/2);var AQ=Math.floor(this._sizes.mark[AR?"width":"height"]/2);AM.clearPosition(AS);AS.style[AR?"top":"left"]=this._barStart-AT+AU+"px";AS.style[AR?"left":"top"]=this._barDepth-AQ+"px"}},{HORIZONTAL:AL,VERTICAL:AN});D.configure(AO,["barDepth","barEnd","barStart","bodySrc","folder","labelStyle","layout","markSrc","scaleLabelStyle","unitLabelStyle"]);return AO}()})();(function(){var AN=f.DOM;var AL=f.Events;var AM=Q.UPDATE_ZOOM;g.Slider=function(){var AR=function(AU,AT,AV){AL.add(AU,AT,AV);this._events.push({elem:AU,name:AT,callback:AV})};var AO=function(){var AT=this;this._skin.whenLoaded(function(){if(!AT._cells){var AX=AT._skin.getSize(AT._tickCount);AT.elem.style.width=AX.width;AT.elem.style.height=AX.height;AT.elem.innerHTML="";var AW=AN.createElement("table",AT.elem,AT.id+"_table");var AU=AN.createElement("tbody",AW,AT.id+"_table_body");AW.style.borderCollapse="collapse";AW.style.padding="0px 0px 0px 0px";AT._cells=AT._skin.createCells(AT.id,AU,AT._tickCount);for(var AV=0;AV<AT._cells.length;AV++){AT._cells[AV].style.cursor="pointer"}}})};var AS=function(){var AT=this;if(!this._cells){return }var AY=false;var AW=function(AZ){return function(){if(AY){AT.map.setZoomIndex(AT.map.getMinZoomIndex()+AZ);AY=false}}};var AV,AU=this._events,AX=AU.length;for(AV=0;AV<AX;AV++){AL.remove(AU[AV].elem,AU[AV].name,AU[AV].callback)}this._events=[];AR.call(this,this.elem,"mousedown",function(){AY=true});for(AV=0;AV<AT._cells.length-2;AV++){AR.call(this,AT._cells[AV+1],"mouseup",AW(AV))}AR.call(this,AT._cells[0],"mouseup",function(){AT.map.zoomOut()});AR.call(this,AT._cells[AT._cells.length-1],"mouseup",function(){AT.map.zoomIn()})};var AP=e.prototype;var AQ=D.extend(e,{init:function(AV){var AU=g.SliderSkin;var AT=this;if(!AV){AV={}}AP.init.call(this,AV);this._skin=AV.skin||AU.standard;if(!this._skin){throw new k('no skin available for slider "'+this.id+'".')}this._events=[];this._skin.whenLoaded(function(){AT.setMap(AT.map)})},_cells:null,_events:null,_tickCount:0,getSize:function(AU){var AT=this;this._skin.whenLoaded(function(){AU(AT._skin.getSize(AT._tickCount))})},setMap:function(AV){var AT=this,AU=function(AX){AT._tickCount=AT.map.getMaxZoomIndex()-AT.map.getMinZoomIndex()+1;AO.call(AT);AS.call(AT)},AW=function(AX){AN.detach(AT.elem.firstChild);AT._cells=null};AP.setMap.call(this,AV,AU,AW)},update:function(AT){if(!this.map){return }if(!this._cells){return }if(AT&AM){var AU=this.map.getMinZoomIndex();var AV=this.map.getLastZoomIndex();if(!isNaN(AV)){this._skin.unselectTick(this._cells[AV-AU+1])}this._skin.selectTick(this._cells[this.map.getZoomIndex()-AU+1])}}});D.configure(AQ,["skin"]);return AQ}()})();(function(){var AM=f.DOM;var AL=1;var AN=2;g.SliderSkin=function(){var AP=R.prototype;var AO=D.extend(R,{_layout:AL,init:function(AQ){AP.init.call(this);var AR=o.parse(AQ,"folder","");if(AR&&AR.charAt(AR.length-1)!=="/"){AR+="/"}this._images={leftButton:AR+o.parse(AQ,"leftButtonSrc","left-button.png"),rightButton:AR+o.parse(AQ,"rightButtonSrc","right-button.png"),selTick:AR+o.parse(AQ,"selTickSrc","tick-sel.png"),tick:AR+o.parse(AQ,"tickSrc","tick.png")};this.load();this._layout=o.parse(AQ,"layout",AL)},createCells:function(AX,AU,AR){var AT=this._layout===AN;var AW=AT?AU:AM.createElement("tr",AU,AX+"_row");var AQ=function(AZ){var AY=(AT?AM.createElement("tr",AW,AZ+"_row"):AW);return AM.createElement("td",AY,AZ)};var AS=[];AS.push(this._initImageDiv(AQ(AX+"_left"),"leftButton"));for(var AV=0;AV<AR;AV++){AS.push(this._initImageDiv(AQ(AX+"_tick_"+AV),"tick"))}AS.push(this._initImageDiv(AQ(AX+"_right"),"rightButton"));return AS},getSize:function(AQ){var AV=this._sizes,AR=this._layout===AN,AT=(AR?"height":"width"),AW=(AR?"width":"height"),AU=AV.tick[AT]+AV.selTick[AT]*(AQ-1)+AV.leftButton[AT]+AV.rightButton[AT],AS=Math.max(AV.tick[AW],AV.selTick[AW],AV.leftButton[AW],AV.rightButton[AW]);return AR?new F(AS,AU):new F(AU,AS)},selectTick:function(AQ){this._initImageDiv(AQ,"selTick")},unselectTick:function(AQ){this._initImageDiv(AQ,"tick")}},{HORIZONTAL:AL,VERTICAL:AN});D.configure(AO,["folder","layout"]);return AO}()})()})()