function DSRange(A,B){this.low=A;this.high=B}DSRange.prototype.contains=function(A){return A>=this.low&&A<=this.high};DSRange.prototype.limitNumber=function(A){A=Math.max(parseFloat(A),this.low);return Math.min(A,this.high)};function DSCircle(A,B){this.low=A;this.high=B}DSCircle.prototype.limitNumber=function(A){A=parseFloat(A);while(A>this.high){A-=this.high-this.low}while(A<this.low){A+=this.high-this.low}return A};function DSCircleSegment(C,A,B){this.circle=C;this.low=A;this.high=B}DSCircleSegment.prototype.contains=function(A){var B=this.circle.limitNumber(A);if(this.low>this.high){return(B>=this.low&&B<=this.circle.high)||(B>=this.circle.low&&B<=this.high)}else{return B>=this.low&&B<=this.high}};var DSLatitude=new DSRange(-90,90);var DSLongitude=new DSCircle(-180,180);function DSBoundingBox(A,B){this.lower=A;this.upper=B;this.width=new DSCircleSegment(DSLongitude,A.lng,B.lng);this.height=new DSRange(A.lat,B.lat)}DSBoundingBox.prototype.contains=function(A){return this.width.contains(A.lng)&&this.height.contains(A.lat)};function DSCopyright(E,C,A,B,D){this.text=E;this.boxes=(typeof C.length==="undefined"?[C]:C);this.minzoom=A;this.maxzoom=B;this.tileset=D}DSCopyright.prototype.contains=function(A,D,F){var C,B=(!F||!this.tileset||(F===this.tileset)),G=(!this.minzoom||D>=this.minzoom)&&(!this.maxzoom||D<=this.maxzoom),E=false;for(C=0;C<this.boxes.length;++C){if(this.boxes[C].contains(A)){E=true;break}}return E&&G&&B};function DSCopyrightSet(){this.copyrights=[]}DSCopyrightSet.prototype.getCopyright=function(A,D,E){var C,B=[];if(A&&D){for(C=0;C<this.copyrights.length;++C){if(this.copyrights[C].contains(A,D,E)){B.push(this.copyrights[C].text)}}}return B.join(" - ")};DSCopyrightSet.prototype.addCopyright=function(A){this.copyrights.push(A)};function DSMapDecoratorCollection(){this.init()}YAHOO.lang.extend(DSMapDecoratorCollection,DSCollection);DSMapDecoratorCollection.prototype.getByType=function(C){var B=new DSIterator(this),A=[],D;while((D=B.next())){if(D.type===C){A.push(D)}}return A};DSMapDecoratorCollection.prototype.getByName=function(A){var B=new DSIterator(this),C;while((C=B.next())){if(C.name===A){return C}}return null};function DSMapDecorator(D,C,E,B,A){this.init(D,C,E,B,A)}DSMapDecorator.prototype.init=function(D,C,E,B,A){this.map=D;this.element=C;this.position=E;this.type=B;this.name=A;this.updatePosition()};DSMapDecorator.prototype.getElement=function(){return this.element};DSMapDecorator.prototype.getFirstElement=function(){var B,A,C;for(B=0,A=this.element.childNodes.length;B<A;++B){C=this.element.childNodes[B];if(!YAHOO.util.Dom.hasClass(C,"skip")){return C}}};DSMapDecorator.prototype.updatePosition=function(){this.element.style.position="absolute";if(typeof this.position.left!=="undefined"){this.element.style.left=parseInt(this.position.left,10)+"px"}if(typeof this.position.right!=="undefined"){this.element.style.right=parseInt(this.position.right,10)+"px"}if(typeof this.position.top!=="undefined"){this.element.style.top=parseInt(this.position.top,10)+"px"}if(typeof this.position.bottom!=="undefined"){this.element.style.bottom=parseInt(this.position.bottom,10)+"px"}for(var A in {width:"",height:""}){if(typeof this.position[A]!=="undefined"){this.element.style[A]=parseInt(this.position[A],10)+"px"}}if(typeof this.position.zIndex!=="undefined"){this.element.style.zIndex=parseInt(this.position.zIndex,10)}};DSMapDecorator.prototype.setPosition=function(B){for(var A in B){if(B.hasOwnProperty(A)){this.position[A]=B[A]}}this.updatePosition()};DSMapDecorator.prototype.getPosition=function(){return this.position};(function(){function B(F){this.name="InvalidLatException";this.message=F}YAHOO.lang.extend(B,TypeError);function A(F){this.name="InvalidLngException";this.message=F}YAHOO.lang.extend(A,TypeError);function D(F){return F*(180/Math.PI)}function C(F){return F*(Math.PI/180)}var E=LMI.Lang.getObject("LMI.Mapping",true);E.Point=function(G,F){this.init(G,F)};E.Point.prototype={init:function(G,F){this.setLat(G);this.setLng(F)},latAsRad:function(){return C(this.lat)},lngAsRad:function(){return C(this.lng)},equals:function(F){return F&&this.lat===F.lat&&this.lng===F.lng},limitLat:function(F){return DSLatitude.limitNumber(F)},limitLng:function(F){return DSLongitude.limitNumber(F)},toString:function(){return"LMI.Mapping.Point("+this.lat+","+this.lng+")"},setLat:function(G){var F=parseFloat(G);if(F!=G||isNaN(F)){throw new B("Invalid latitude: "+G)}this.lat=Math.round(this.limitLat(F)*100000)/100000},setLng:function(G){var F=parseFloat(G);if(F!=G||isNaN(F)){throw new A("Invalid longitude: "+G)}this.lng=Math.round(this.limitLng(F)*100000)/100000},setLatFromRad:function(F){this.setLat(D(F))},setLngFromRad:function(F){this.setLng(D(F))}};E.Point.fromRadians=function(G,F){return new E.Point(D(G),D(F))};E.Point.getPointsFromString=function(G){var M,F,P,O,H=0,I=G.length,K=0,L=0,N=[];try{while(H<I){F=P=0;do{M=G.charCodeAt(H++)-63;P|=(M&31)<<F;F+=5}while(M>=32);O=((P&1)?~(P>>1):(P>>1));K+=O;F=P=0;do{M=G.charCodeAt(H++)-63;P|=(M&31)<<F;F+=5}while(M>=32);O=((P&1)?~(P>>1):(P>>1));L+=O;N.push(new LMI.Mapping.Point(K*0.00001,L*0.00001))}}catch(J){}return N}})();function DSMapObject_Iterator(A,B){this.coll=A;this.pos=(B?B:0)}function DSMapObject_HasNext(){if(this.coll&&(this.pos+1)<=this.coll.order.length){return true}this.pos=0;return false}function DSMapObject_Next(){return(this.coll.objects[this.coll.order[this.pos++]])}function DSMapObject_GetId(){return this.coll.order[this.pos-1]}function DSMapObject_SetIteratorOffset(A){this.pos=A}function DSMapObject_GetIteratorOffset(){return this.pos}function DSMapObject_Add(A){this.objects[this.currIdx]=A;this.order.push(this.currIdx);return this.currIdx++}function DSMapObject_Remove(C){var B,A;if(this.objects[C]){delete this.objects[C];for(B=0,A=this.order.length;B<A;++B){if(this.order[B]===C){this.order.splice(B,1)}}return true}return false}function DSMapObject_RemoveAll(){this.objects={};this.order=[];this.currPos=this.currIdx=0}function DSMapObject_GetByIndex(A){return this.objects[this.order[A]]}function DSMapObject_GetById(A){return this.objects[A]?this.objects[A]:null}function DSMapObject_Size(){return this.order.length}function DSMapObject_GetByProperty(A,C){for(var B=0;B<this.order.length;++B){if(this.objects[this.order[B]].getProperty(A)===C){return this.objects[this.order[B]]}}return null}function DSMapObject_GetIdsByProperty(A,D){var B,C=[];for(B=0;B<this.order.length;++B){if(this.objects[this.order[B]].getProperty(A)===D){C.push(this.order[B])}}return C}function DSMapObject_Collection(){this.objects={};this.order=[];this.currPos=this.currIdx=0}DSMapObject_Collection.prototype.add=DSMapObject_Add;DSMapObject_Collection.prototype.remove=DSMapObject_Remove;DSMapObject_Collection.prototype.getById=DSMapObject_GetById;DSMapObject_Collection.prototype.getByIndex=DSMapObject_GetByIndex;DSMapObject_Collection.prototype.size=DSMapObject_Size;DSMapObject_Collection.prototype.getByProperty=DSMapObject_GetByProperty;DSMapObject_Collection.prototype.getIdsByProperty=DSMapObject_GetIdsByProperty;DSMapObject_Collection.prototype.removeAll=DSMapObject_RemoveAll;DSMapObject_Iterator.prototype.next=DSMapObject_Next;DSMapObject_Iterator.prototype.getId=DSMapObject_GetId;DSMapObject_Iterator.prototype.hasNext=DSMapObject_HasNext;DSMapObject_Iterator.prototype.setOffset=DSMapObject_SetIteratorOffset;DSMapObject_Iterator.prototype.getOffset=DSMapObject_GetIteratorOffset;LMI.Mapping.EquiRectangularMapProjection=(function(){var A=6378245,C=Math.PI/2;function B(E){if(E<-Math.PI){return E-(Math.floor(E/Math.PI)*Math.PI)}else{if(E>Math.PI){return -(Math.PI-E+(Math.floor(E/Math.PI)*Math.PI))}}return E}function D(F,E){this._center_lon=F;this._center_lat=E;this._cos_center_lat=Math.cos(E);this._R=A}D.prototype={setRadius:function(E){this._R=E},getEarthRadius:function(){return A},setOrigin:function(G,F){this.translations=null;var E=this.forward(G,F);this.translations={x:-E.x,y:-E.y}},forward:function(G,F){var E={x:this._R*B(G-this._center_lon)*this._cos_center_lat,y:this._R*F};if(this.translations){E.x+=this.translations.x;E.y+=this.translations.y}return E},inverse:function(E,F){if(this.translations){E-=this.translations.x;F-=this.translations.y}return{x:B(this._center_lon+E/(this._R*this._cos_center_lat)),y:Math.min(F/this._R,C)}}};D.getGridCS=function(J,I){I=I||{};if(!("standardParallel" in I)){I.standardParallel=40}if(!("scales" in I)){I.scales=[1.7021276,3.4042553,6.80851064,13.61702128,27.23404256,54.46808512,108.93617024,217.87234048,435.74468096,871.48936192,1742.97872384,3485.95744768,6971.9148953,13943.82979072]}var G=new LMI.Mapping.Point(I.standardParallel,0),H=new LMI.Mapping.Point(90,-180),F=new D(G.lngAsRad(),G.latAsRad()),E=new LMI.Mapping.GridCS(F,J),K=I.scales[J-1];E.setGridWidth(((2*Math.PI*A)/K)/E.tileSize);F.setRadius(E.radius);F.setOrigin(H.lngAsRad(),H.latAsRad());return E};return D})();LMI.Mapping.GridCS=(function(){function A(D){var C=Math.floor(D);if(Math.abs(D-C)!==0.5){return Math.round(D)}return(C%2===0?C:C+1)}function B(C,E,D){this.projection=C;this.tileSize=D||256;this.setGridWidth(A(Math.pow(2,E)))}B.prototype={setGridWidth:function(C){this.gridWidth=C;this.radius=(C*this.tileSize)/(2*Math.PI)},getScale:function(){return this.projection.getEarthRadius()/this.radius},gridX:function(C){return Math.floor(C/this.tileSize)},gridY:function(C){return Math.floor(C/this.tileSize)},grid:function(C,D){if(arguments.length===1){D=C.y;C=C.x}return{x:this.gridX(C),y:this.gridY(D)}},offsetX:function(C){return C%this.tileSize},offsetY:function(C){return C%this.tileSize},restrictGridX:function(C){if(C<0||C>=this.gridWidth){C-=Math.floor(this.gridWidth*Math.floor(C/this.gridWidth))}return C},offset:function(C,D){if(arguments.length===1){D=C.y;C=C.x}return{x:this.offsetX(C),y:this.offsetY(D)}},gridToX:function(C){var D=(arguments.length===2?arguments[1]:0);return(C*this.tileSize)+D},gridToY:function(C){var D=(arguments.length===2?arguments[1]:0);return(C*this.tileSize)+D},toXY:function(D){var C=this.projection.forward(D.lngAsRad(),D.latAsRad());C.y=-C.y;return C},toLL:function(C,E){var D=this.projection.inverse(C,-E);return LMI.Mapping.Point.fromRadians(D.y,D.x)},getUpperLeftPoint:function(D,E,C){var F=this.toXY(D);return{x:F.x-(E/2),y:F.y-(C/2)}},getLowerRightPoint:function(D,E,C){var F=this.toXY(D);return{x:F.x+(E/2),y:F.y+(C/2)}},getLowerLeftPoint:function(D,E,C){var F=this.toXY(D);return{x:F.x-(E/2),y:F.y+(C/2)}},getUpperRightPoint:function(D,E,C){var F=this.toXY(D);return{x:F.x+(E/2),y:F.y-(C/2)}},processBoundingBox:function(G,E,D){var C=this.grid(this.toXY(E)),F=this.grid(this.toXY(D));this.processArea2(G,C.x,C.y,F.x,F.y)},processArea:function(H,E,F,D){var C=this.grid(this.getUpperLeftPoint(E,F,D)),G=this.grid(this.getLowerRightPoint(E,F,D));this.processArea2(H,C.x,C.y,G.x,G.y)},processArea2:function(J,G,F,C,L){var H,E,I,D=G,K=Math.max(0,F);while(G>C){G-=this.gridWidth}while(D<0){D+=this.gridWidth}for(I=K;I<=L;++I){for(E=D;E<=C;++E){H=this.restrictGridX(E);J.processArea(H,I,E-D,I-K,C-D,L,K)}}}};return B})();LMI.Mapping.MercatorMapProjection=(function(){var F=6378137,H=298.257223563,C=Math.PI/2,B=1e-10;function A(I){if(I<-Math.PI){return I-(Math.floor(I/Math.PI)*Math.PI)}else{if(I>Math.PI){return -(Math.PI-I+(Math.floor(I/Math.PI)*Math.PI))}}return I}function E(M,L,K){var J,I=(1+K)/(1-K);if(M!==0){J=M*K;I*=Math.pow((1-J)/(1+J),M)}return I}function D(O,N){var J,M,K,I,L=C-2*Math.atan(N);if(O===0){return L}for(J=0;J<=15;++J){M=Math.sin(L);K=O*M;I=C-2*Math.atan(N*Math.pow((1-K)/(1+K),0.5*O))-L;L+=I;if(Math.abs(I)<=B){return L}}}function G(J,I){this.center_lon=J;this.center_lat=I;this.setRadius(F)}G.prototype={setRadius:function(K,L){var J,I;this.R=K;if(arguments.length===1){this.r=K;this.es=0;this.e=0;this.m1=Math.cos(this.center_lat)}else{J=L/K;I=Math.sin(this.center_lat);this.r=L;this.es=1-(J*J);this.e=Math.sqrt(this.es);this.m1=Math.cos(this.center_lat)/Math.sqrt(1-this.es*I*I)}},getEarthRadius:function(){return F},forward:function(J,I){if(Math.abs(Math.abs(I)-C)<=B){throw"transformation cannot be computed at the poles"}return{x:this.falseEasting+this.R*this.m1*A(J-this.center_lon),y:this.falseNorthing+this.R*this.m1*0.5*Math.log(E(this.e,I,Math.sin(I)))}},inverse:function(I,J){I-=this.falseEasting;J-=this.falseNorthing;return{x:A(this.center_lon+I/(this.R*this.m1)),y:D(this.e,Math.exp(-J/(this.R*this.m1)))}}};G.getGridCS=function(M,L){var K=new G(0,0),J=new LMI.Mapping.GridCS(K,M),I=J.radius;if("isEllipsoidal" in L&&L.isEllipsoidal){K.setRadius(I,I-(I/H))}else{K.setRadius(I)}K.falseEasting=I*Math.PI;K.falseNorthing=-I*Math.PI;return J};return G})();LMI.Mapping.TileUrl=(function(){function A(B){this.init(B)}A.defaults={baseUrl:"http://mapping-dev.corp.localmatters.com/tiles/mercator-ellipsoid/",extension:".png",suffix:"",locale:""};A.prototype={init:function(B){this.initOptions(B);this.base=this.options.baseUrl;this.suffix=this.options.suffix;this.post=this.options.extension+"?";this.setLocale(this.options.locale)},initOptions:function(B){this.options=LMI.Lang.mergeObjects({},A.defaults);if("config" in A){LMI.Lang.mergeObjects(this.options,A.config)}LMI.Lang.mergeObjects(this.options,B)},setMapWidth:function(B){this.mapWidth=B},setMapHeight:function(B){this.mapHeight=B},setManager:function(B){this.manager=B},setLocale:function(B){this.locale=B},getPre:function(){return this.base+(this.locale.length?this.locale+"/":"")},getPost:function(){return this.post+"w="+this.mapWidth+"&h="+this.mapHeight+this.suffix},getUrl:function(B,D,C){return this.getPre()+C+"/"+B+"/"+D+this.getPost()}};return A})();LMI.Mapping.TileManager=(function(){var B=LMI.Mapping;function A(C){this.trackTiles=true;this.init(C)}A.defaults={minLevel:1,maxLevel:14,tileLevels:[1,2,3,4,5,6,7,8,9,10,11,12,13,14],totalLevels:14,invertLevels:true,projection:B.MercatorMapProjection,projectionOptions:{isEllipsoidal:true},tileUrlStrategy:B.TileUrl,tileUrlOptions:{},bufferRows:1,bufferCols:1,tileWidth:256,tileHeight:256};A.prototype={init:function(C){this.tiles=[];this.grids=[];this.initOptions(C);this.tileWidth=this.options.tileWidth;this.tileHeight=this.options.tileHeight;this.scale=1;this.minLevel=this.options.minLevel;this.maxLevel=this.options.maxLevel;this.tileLevels=this.options.tileLevels;this.zoomLevels=this.options.totalLevels;this.bufferWidth=this.tileWidth/2;this.bufferHeight=this.tileHeight/2;this.projection=this.options.projection;this.projectionOptions=this.options.projectionOptions;this.tileUrls=new this.options.tileUrlStrategy(this.options.tileUrlOptions);this.tileUrls.setManager(this);if("width" in this.options){this.setMapWidth(this.options.width)}if("height" in this.options){this.setMapHeight(this.options.height)}if("locale" in this.options){this.setLocale(this.options.locale)}this.createTiles();this.initEvents("loadedTiles")},initOptions:function(C){this.options=LMI.Lang.mergeObjects({},A.defaults);if("config" in A){LMI.Lang.mergeObjects(this.options,A.config)}LMI.Lang.mergeObjects(this.options,C)},setMapWidth:function(C){this.mapWidth=C;this.tileUrls.setMapWidth(this.mapWidth)},setMapHeight:function(C){this.mapHeight=C;this.tileUrls.setMapHeight(this.mapHeight)},setLocale:function(C){this.locale=C;this.tileUrls.setLocale(C)},setZoomLevel:function(C){this.setScale(1);this.zoomLevel=C},getZoomLevel:function(C){C=C||this.zoomLevel||1;C=this.options.invertLevels?this.options.totalLevels-C+1:C;return Math.max(1,Math.min(C,this.options.totalLevels))},getScaledZoomLevel:function(C){C=C||this.zoomLevel||1;return this.options.invertLevels?this.tileLevels[this.options.totalLevels-C]:this.tileLevels[C-1]},getZoomLevelIndex:function(D){var C;D=D||this.zoomLevel||0;for(C=0;C<this.maxLevel;C++){if(D<=this.tileLevels[C]){if(this.options.invertLevels){return this.options.totalLevels-C}else{return C}}}if(this.options.invertLevels){return this.minLevel}else{return this.maxLevel}},setCenterPoint:function(C){this.center=C},getCenterPoint:function(){return this.center},remove:function(){this.tileLayer.parentNode.removeChild(this.tileLayer);this.map=null},add:function(C){C.tileLayer.appendChild(this.tileLayer);this.map=C},createTiles:function(){var F,E,H,D,C=this.tileWidth,G=this.tileHeight;this.rows=Math.ceil(this.mapHeight/G)+1+this.options.bufferRows;this.columns=Math.ceil(this.mapWidth/C)+1+this.options.bufferCols;this.tileLayer=LMI.Element.create("div",null,{className:"tileLayer"});this.width=this.columns*C;this.height=this.rows*G;D=this.getTileOptions();for(F=0;F<this.rows;++F){for(E=0;E<this.columns;++E){H=new B.Tile(this,D);H.onLoad.subscribe(this.tileLoaded,this);this.tiles.push(H)}}},getTileOptions:function(){var C={width:this.tileWidth,height:this.tileHeight};if("brokenTile" in this.options){C.brokenTile=this.options.brokenTile}return C},appendRow:function(){var D,C,F=this.rows++,E=this.getTileOptions();for(D=0;D<this.columns;++D){C=new B.Tile(this,E);C.onLoad.subscribe(this.tileLoaded,this);if(this.offsets){C.setSrc(this.tileUrls.getUrl(this.getGrid().restrictGridX(this.getGridLeft()+D),this.getGridTop()+F,this.tileLevels[this.getZoomLevel()-1]))}this.tiles.push(C);this.positionTile(this.tiles.length-1)}},removeRow:function(){this.rows--;var C,D=this.tiles.length-this.columns;while(this.tiles.length>D){C=this.tiles.length-1;this.tiles[C].removeFromDom();this.tiles.splice(C,1)}},appendColumn:function(){var D,G,C,F=this.columns++,E=this.getTileOptions();for(D=0;D<this.rows;++D){G=(F*(1+D))+D;C=new B.Tile(this,E);C.onLoad.subscribe(this.tileLoaded,this);if(this.offsets){C.setSrc(this.tileUrls.getUrl(this.getGrid().restrictGridX(this.getGridLeft()+F),this.getGridTop()+D,this.tileLevels[this.getZoomLevel()-1]))}this.tiles.splice(G,0,C);this.positionTile(G)}},removeColumn:function(){var C,D=this.columns--;for(C=this.tiles.length-1;C>0;C-=D){this.tiles[C].removeFromDom();this.tiles.splice(C,1)}},resizeTileLayer:function(){var C=Math.ceil(this.mapHeight/this.tileHeight)+1+this.options.bufferRows,D=Math.ceil(this.mapWidth/this.tileWidth)+1+this.options.bufferCols;while(D>this.columns){this.appendColumn()}while(D<this.columns){this.removeColumn()}while(C>this.rows){this.appendRow()}while(C<this.rows){this.removeRow()}this.width=this.columns*this.tileWidth;this.height=this.rows*this.tileHeight},mapResizeHandler:function(D,C){this.setMapWidth(D);this.setMapHeight(C);if(this.offsets){this.calculateCenterPoint()}this.resizeTileLayer()},setCenterOffset:function(C,D){this.centerOffset={x:C,y:D}},getCenterOffset:function(){return{x:(this.centerOffset.x*this.scale)+this.offsets.x,y:(this.centerOffset.y*this.scale)+this.offsets.y}},getPosition:function(E){var C,D;if(this.offsets){C=this.getGrid();D=C.toXY(E);return{x:D.x-C.gridToX(this.getGridLeft(),-this.offsets.x),y:D.y-C.gridToY(this.getGridTop(),-this.offsets.y)}}return null},getPointByPosition:function(C,E){var D=this.getGrid();if(this.offsets){return D.toLL(D.gridToX(this.getGridLeft(),C-this.offsets.x),D.gridToY(this.getGridTop(),E-this.offsets.y))}return null},wrapNorth:function(){var D,C,E=this.getZoomLevel();this.offsets.y-=this.tileHeight;this.setGridTop(this.getGridTop()-1);for(D=0;D<this.columns;++D){C=this.tiles.pop();this.tiles.unshift(C);C.setSrc(this.tileUrls.getUrl(this.getGrid().restrictGridX(this.getGridLeft()+((this.columns-1)-D)),this.getGridTop(),this.tileLevels[E-1]))}for(D=0;D<this.columns;++D){this.positionTile(D)}},wrapSouth:function(){var E,C,D,F=this.getZoomLevel();this.offsets.y+=this.tileHeight;for(E=0;E<this.columns;++E){D=this.tiles.shift();this.tiles.push(D);D.setSrc(this.tileUrls.getUrl(this.getGrid().restrictGridX(this.getGridLeft()+E),this.getGridTop()+this.rows,this.tileLevels[F-1]))}for(E=this.columns*(this.rows-1),C=this.tiles.length;E<C;++E){this.positionTile(E)}this.setGridTop(this.getGridTop()+1)},wrapWest:function(){var E,D,C,F=this.getZoomLevel();this.offsets.x-=this.tileWidth;this.setGridLeft(this.getGridLeft()-1);for(E=1;E<=this.rows;++E){C=this.columns*E-1;D=this.tiles.splice(C,1)[0];C-=this.columns-1;this.tiles.splice(C,0,D);D.setSrc(this.tileUrls.getUrl(this.getGrid().restrictGridX(this.getGridLeft()),this.getGridTop()+E-1,this.tileLevels[F-1]));this.positionTile(C)}},wrapEast:function(){var E,D,C,F=this.getZoomLevel();this.offsets.x+=this.tileWidth;for(E=0;E<this.rows;++E){C=this.columns*E;D=this.tiles.splice(C,1)[0];C+=this.columns-1;this.tiles.splice(C,0,D);D.setSrc(this.tileUrls.getUrl(this.getGrid().restrictGridX(this.getGridLeft()+this.columns),this.getGridTop()+E,this.tileLevels[F-1]));this.positionTile(C)}this.setGridLeft(this.getGridLeft()+1)},calculateCenterPoint:function(){if(this.offsets){var C=this.getGrid();this.setCenterPoint(C.toLL(C.gridToX(this.getGridLeft(),-(this.mapOffsets.x+this.offsets.x)+(this.mapWidth/2)),C.gridToY(this.getGridTop(),-(this.mapOffsets.y+this.offsets.y)+(this.mapHeight/2))))}},getZoomByBounds:function(C,E,L){var H,D,F,K,I=this.tileLevels.length,G=C.upper,J=C.lower;E=E||this.mapWidth;L=L||this.mapHeight;for(H=1;H<I;++H){D=this.getGrid(H);F=D.toXY(G);K=D.toXY(J);if(Math.abs(F.x-K.x)<E&&Math.abs(F.y-K.y)<L){return H}}return I},getBoundsAndCentroid:function(J){var M,E,F,G,K,I,C,L,H,D=this.getGrid().projection;LMI.Lang.forEach(J,function(N){M=D.forward(N.lngAsRad(),N.latAsRad());if(!E){E=F=M.y;G=K=M.x;I=C=N.lat;L=H=N.lng}else{if(M.y>E){E=M.y;I=N.lat}else{if(M.y<F){F=M.y;C=N.lat}}if(M.x>G){G=M.x;L=N.lng}else{if(M.x<K){K=M.x;H=N.lng}}}});M=D.inverse((K+G)/2,(F+E)/2);return{centroid:B.Point.fromRadians(M.y,M.x),upper:new B.Point(I,L),lower:new B.Point(C,H),upperGrid:{x:G,y:E},lowerGrid:{x:K,y:F}}},setMapOffsets:function(C,D){this.mapOffsets={x:C,y:D}},updateMap:function(){var C=this.offsets.x+this.mapOffsets.x,D=this.offsets.y+this.mapOffsets.y;if(C>-this.bufferWidth){this.wrapWest()}else{if(C+this.width-this.mapWidth<this.bufferWidth){this.wrapEast()}}if(D>-this.bufferHeight){this.wrapNorth()}else{if(D+this.height-this.mapHeight<this.bufferHeight){this.wrapSouth()}}this.calculateCenterPoint();this.updateCenterOffset()},setOffsets:function(C,D){this.offsets={x:C,y:D}},positionTile:function(D){var C=this.tiles[D];if(this.offsets){C.setSize(this.tileWidth,this.tileHeight);C.setLeft(((D%this.columns)*C.getWidth()+this.offsets.x)+"px");C.setTop((Math.floor(D/this.columns)*C.getHeight()+this.offsets.y)+"px")}},getScale:function(){var E=this.getCenterPoint(),D=this.getGrid(),C=D.getScale();if(D.projection instanceof B.MercatorMapProjection){C*=Math.cos(E.latAsRad())}return C},getCopyrightString:function(){return this.options.copyright},updateTiles:function(){var D,C;for(D=0,C=this.tiles.length;D<C;++D){this.positionTile(D)}},setScale:function(C){this.scale=C;this.tileWidth=this.options.tileWidth*C;this.tileHeight=this.options.tileHeight*C},previewZoomLevel:function(E,M){var H=Math.floor(E),O=H+1,N=E-H,C=this.getGrid(),D=this.getGrid(H),F=this.getGrid(O),J=D.gridWidth+((F.gridWidth-D.gridWidth)*N),K=J/C.gridWidth,I=this,L=K-1,G;if(M){G=new YAHOO.util.Anim(this.viewport,{},0.25);G.onTween.subscribe(function(Q,P){I.setScale(1+(L*(P[0].currentFrame/G.totalFrames)));I.updateTiles();I.map.positionMap()});G.onComplete.subscribe(M);G.animate();return G}else{this.setScale(K);this.updateTiles();this.map.positionMap();return null}},getGrid:function(C){var D=this.getZoomLevel(C)-1;if(!this.grids[D]){this.grids[D]=this.projection.getGridCS(this.tileLevels[D],this.projectionOptions)}return this.grids[D]},setGridLeft:function(C){this.gridLeft=C},getGridLeft:function(){return this.gridLeft},setGridTop:function(C){this.gridTop=C},getGridTop:function(){return this.gridTop},updateCenterOffset:function(){var D=this.getGrid(),F=this.getCenterPoint(),E=D.toXY(F),C={x:D.gridToX(this.getGridLeft()),y:D.gridToY(this.getGridTop())};this.setCenterOffset(E.x-C.x,E.y-C.y)},calculateGridPosition:function(){var D=this.getGrid(),E=this.getCenterPoint(),C=D.getUpperLeftPoint(E,this.mapWidth,this.mapHeight),F=D.grid(C);this.setGridLeft(F.x);this.setGridTop(F.y);this.updateCenterOffset()},tileLoaded:function(D,C,E){E.numLoadedTiles++;if(E.numLoadedTiles===E.tiles.length){E.triggerEvent("loadedTiles")}},loadTiles:function(){var G,F,H,J,D,E,I=0,K=this.getZoomLevel(),C=this.getGrid();this.numLoadedTiles=0;this.setMapOffsets(0,0);this.setOffsets(0,0);this.calculateGridPosition();H=this.getGridTop();D=H+this.rows;E=this.getGridLeft();J=E+this.columns;for(G=H;G<D;++G){for(F=E;F<J;++F){this.tiles[I].setSrc(this.tileUrls.getUrl(C.restrictGridX(F),G,this.tileLevels[K-1]));this.positionTile(I++)}}},getTileParent:function(){return this.tileLayer}};LMI.Lang.importFunctions(A,LMI.Event);return A})();(function(){var B=LMI.Mapping.TileManager.prototype;function A(J,I){var D=0,F=0,G=I.length,C,L=I[0],K,E=Math.min,H=Math.max;for(;F<G;F++){K=I[F%G];if(J.lat>E(L[0],K[0])){if(J.lat<=H(L[0],K[0])){if(J.lng<=H(L[1],K[1])){if(L[0]!==K[0]){C=(J.lat-L[0])*(K[1]-L[1])/(K[0]-L[0])+L[1];if(L[1]===K[1]||J.lng<=C){D++}}}}}L=K}return(D%2>0)}B.getCopyrightString=function(){var F=this.options.copyrights,D=this.getCenterPoint(),G,E=0,C=F.length;if(D){for(;E<C;E++){G=F[E].box;if(G&&LMI.Lang.isArray(G[0])&&A(D,G)){return F[E].text}else{if(!G||(D.lat>G[0]&&D.lng>G[1]&&D.lat<G[2]&&D.lng<G[3])){return F[E].text}}}}}})();LMI.Mapping.Map=(function(){var E=YAHOO.util,B=E.Dom,F=LMI.Element,D=F.getOne;function A(H){var G=1;while(G*10<H){G*=10}if(G*5<H){G*=5}if(G*2<H){G*=2}return G}function C(G,H){this.init(G,H)}C.onCreate=new E.CustomEvent("create");C.prototype={setZoomLevel:function(K,I,H){var J=false,G=this.tileManager;if(K<G.minLevel){K=G.minLevel}else{if(K>G.maxLevel){K=G.maxLevel}}if(I&&(H||!I.equals(this.getCenterPoint()))){J=true;this.tileManager.setCenterPoint(I)}if(H||J||this.zoomLevel!==K){this.zoomLevel=K;this.tileManager.setZoomLevel(K);this.loadMap();this.triggerEvent("zoom",this.getEventObject(),this)}else{this.tileManager.setScale(1);this.tileManager.updateTiles();this.positionMap()}},bestFit:function(M,K){var H,O,N=[],G,P,I,L,J;if(typeof M==="number"){this.factor=M}else{if(typeof this.factor==="number"){M=this.factor}else{this.factor=M=0.9}}K=K||this.objects;J=new DSMapObject_Iterator(K);while(J.hasNext()){I=J.next();if(!I.isIncludedInBestFit()){continue}L=I.getBoundingBox();if(L){N.push(L.lower,L.upper)}else{if(I.getPoint()){N.push(I.getPoint())}}}if(N.length===0){if(this.getOption("defaultLat")&&this.getOption("defaultLng")&&this.getOption("emptyZoom")){this.centerAndZoom(new LMI.Mapping.Point(this.getOption("defaultLat"),this.getOption("defaultLng")),this.getOption("emptyZoom"))}}else{if(N.length===1){this.centerAndZoom(N[0],this.getOption("singleZoom"))}else{H=this.width*M;O=this.height*M;G=this.tileManager.getBoundsAndCentroid(N);P=this.tileManager.getZoomByBounds(G,H,O);this.centerAndZoom(G.centroid,P)}}},bestFitEventHandler:function(){this.bestFit()},centerOnPoint:function(G){if(!G.equals(this.getCenterPoint())){this.prepareEventObject();this.tileManager.setCenterPoint(new LMI.Mapping.Point(G.lat,G.lng));this.loadMap();var H=this.getEventObject();this.triggerEvent("recenter",H,this)}},centerAndZoom:function(G,I){this.prepareEventObject();this.setZoomLevel(I,G);var H=this.getEventObject();this.triggerEvent("recenter",H,this)},init:function(G,I){var J=new Date().getYear(),H=D(G);if(!H){throw new Error('Map: unable to find container: "'+G+'"')}this.onSetTileManager=new E.CustomEvent("setTileManager");C.onCreate.fire(this);if(!H.id){B.generateId(H)}this.id=H.id;this.container=H;B.addClass(H,"dsMap");this.initOptions(I);this.decorators=new DSMapDecoratorCollection();this.centerPoint=null;this.zoomLevel=1;this.locale=this.getOption("defaultLocale");if(J<1000){J+=1900}this.copyrightTxt="\xa9"+J+" Local Matters, Inc.";this.copyrightSet=DSMapCopyrightSet;if(typeof (this.options.mapScales)==="undefined"){this.setOption("mapScales",["std","metric"])}this.initContainer();this.setTileManager(new LMI.Mapping.TileManager({width:this.width,height:this.height}));this.objects=new DSMapObject_Collection();this.messages=[];this.initEvents("zoom","recenter","resize")},initOptions:function(G){this.options=LMI.Lang.mergeObjects({},C.Defaults);if("config" in C){LMI.Lang.mergeObjects(this.options,C.config)}LMI.Lang.mergeObjects(this.options,G)},setTileManager:function(I){var H=this.getCenterPoint(),G;if(this.tileManager){this.tileManager.remove(this)}this.tileManager=I;if(this.tileManager){this.onSetTileManager.fire(this,I);this.tileManager.add(this);this.tileManager.setMapWidth(this.width);this.tileManager.setMapHeight(this.height);if(H){this.setZoomLevel(this.zoomLevel,H,true)}else{this.tileManager.setZoomLevel(this.zoomLevel)}this.tileManager.setMapWidth(this.width);this.tileManager.setMapHeight(this.height);this.tileManager.resizeTileLayer();if(!this.parentMap){G=this.tileManager.getCopyrightString();if(G){this.setCopyright(G)}}}},getTileManager:function(G){return this.tileManager},setLocale:function(G){this.locale=G;this.tileManager.setLocale(G)},setOption:function(G,H){this.options[G]=H},getOption:function(G){return this.options[G]||""},addDecorator:function(G){this.decorators.push(G);this.decoratorLayer.appendChild(G.getElement())},removeDecorator:function(I){var H,G=this.decorators.getLength();for(H=0;H<G;++H){if(this.decorators.getByIndex(H)===I){this.decorators.remove(H);this.decoratorLayer.removeChild(I.getElement());return }}},prepareEventObject:function(){this.beforeEvent={previousLeft:this.getMapLeft(true),previousTop:this.getMapTop(true),previousZoomLevel:this.zoomLevel,previousCenter:this.getCenterPoint()}},getEventObject:function(){var G=this.beforeEvent;this.beforeEvent={};G.zoomLevel=this.zoomLevel;G.center=this.getCenterPoint();G.left=this.getMapLeft(true);G.top=this.getMapTop(true);return G},setCopyright:function(G){this.copyright.getElement().firstChild.nodeValue=this.copyrightTxt=G},positionFlyoutLayer:function(){this.flyoutLayer.style.left=this.mapLayer.style.left;this.flyoutLayer.style.top=this.mapLayer.style.top},positionMap:function(){var G=this.tileManager.getCenterOffset();this.mapLayer.style.left=Math.round((this.width/2)-G.x)+"px";this.mapLayer.style.top=Math.round((this.height/2)-G.y)+"px";this.positionFlyoutLayer()},updateScale:function(){if(!this.getOption("enableScales")){return }var K=110,M=this.tileManager.getScale(),L=M*K,G="km",N=L/1000,H="mi",I=L/1609.344,J;if(I<1){I=L*3.2808399;H="ft"}if(N<1){N=L;G="m"}if(this.stdScale){J=A(I);this.stdScale.style.width=Math.round(K*J/I)+"px";this.stdScaleText.innerHTML=J+" "+H}if(this.metricScale){J=A(N);this.metricScale.style.width=Math.round(K*J/N)+"px";this.metricScaleText.innerHTML=J+" "+G}},loadMap:function(){this.tileManager.loadTiles();this.positionMap();this.updateObjects();this.updateScale()},updateObjects:function(){for(var G=new DSMapObject_Iterator(this.objects);G.hasNext();){this.positionObject(G.next())}},getGridCoordinates:function(G){return this.tileManager.getGrid().toXY(G)},getPointByXY:function(G,H){return this.tileManager.getPointByPosition(G-this.getMapLeft(true),H-this.getMapTop(true))},getCenterPoint:function(){return this.tileManager?this.tileManager.getCenterPoint():null},getURPoint:function(){return this.getPointByXY(this.width,0)},getLLPoint:function(){return this.getPointByXY(0,this.height)},getULPoint:function(){return this.getPointByXY(0,0)},getLRPoint:function(){return this.getPointByXY(this.width,this.height)},positionObject:function(I,G){var H;if(G){I.setPoint(G)}G=I.getPoint();if(G){H=this.tileManager.getPosition(I.point);if(H){I.element.style.left=Math.round(H.x-I.xOffset)+"px";I.element.style.top=Math.round(H.y-I.yOffset)+"px"}}I.update(this)},addObject:function(H,G){var I=this.objects.add(H);H.element.style.position="absolute";H.z=5+H.zOffset;H.element.style.zIndex=H.z;this.positionObject(H);this[G?"flyoutLayer":"mapLayer"].appendChild(H.element);H.add(this);return I},batchAddObjects:function(I){var H,G;this.viewport.removeChild(this.mapLayer);for(H=0,G=I.length;H<G;++H){this.addObject(I[H])}this.viewport.appendChild(this.mapLayer)},removeObject:function(J){var I,H,G,K=-1;if(typeof J==="object"){for(H=new DSMapObject_Iterator(this.objects);H.hasNext();){G=H.next();if(G===J){K=H.getId();break}}}else{K=J}I=this.objects.getById(K);if(I){I.remove(this);I.element.parentNode.removeChild(I.element);this.objects.remove(K)}},batchRemoveObjects:function(I){var H,G;this.viewport.removeChild(this.mapLayer);for(H=0,G=I.length;H<G;++H){this.removeObject(I[H])}this.viewport.appendChild(this.mapLayer)},removeAll:function(){var H,G;this.viewport.removeChild(this.mapLayer);for(G=new DSMapObject_Iterator(this.objects);G.hasNext();){H=G.next();H.remove(this);H.element.parentNode.removeChild(H.element)}this.objects.removeAll();this.viewport.appendChild(this.mapLayer)},updateDataCopyright:function(){var H,G;if(!this.dataCopyright){H=F.create("div",null,{textValue:" ",className:"dataCopyright"});G={zIndex:100,bottom:0};if(this.width>=250){G.right=0}else{G.left=0}this.dataCopyright=new DSMapDecorator(this,H,G,"copyright","data copyright");this.addDecorator(this.dataCopyright)}this.dataCopyright.getElement().firstChild.nodeValue=this.copyrightSet.getCopyright(this.getCenterPoint(),this.zoomLevel)},addCopyright:function(){var G=F.create("div",null,{textValue:this.copyrightTxt});B.addClass(G,"copyright");this.copyright=new DSMapDecorator(this,G,{bottom:this.width>=250?0:10},"copyright","main copyright");this.addDecorator(this.copyright);this.updateDataCopyright()},sizeLayers:function(){this.width=parseInt(this.container.clientWidth,10);this.height=parseInt(this.container.clientHeight,10);this.desiredRows=Math.ceil(this.height/this.getOption("tileHeight"))+2;this.desiredColumns=Math.ceil(this.width/this.getOption("tileWidth"))+2;this.mapLayerWidth=this.desiredColumns*this.getOption("tileWidth");this.mapLayerHeight=this.desiredRows*this.getOption("tileHeight");this.mapLayer.style.height=this.mapLayerHeight+"px";this.mapLayer.style.width=this.mapLayerWidth+"px";this.wrapper.style.height=this.height+"px";this.wrapper.style.width=this.width+"px"},initContainer:function(){var H,G;this.wrapper=F.create("div",this.container,{"class":"mapWrapper"});this.decoratorLayer=F.create("div",this.wrapper,{"class":"decLayer"});this.viewport=F.create("div",this.wrapper,{"class":"viewport"});this.mapLayer=F.create("div",this.viewport,{"class":"mapLayer"});this.tileLayer=F.create("div",this.mapLayer,{"class":"tileLayer"});this.flyoutLayer=F.create("div",this.wrapper,{"class":"flyoutLayer"});if(this.getOption("enableScales")){H=this.getOption("mapScales");G=H.length;while(G--){if(H[G]==="std"){this.stdScale=F.create("div",this.decoratorLayer,{"class":"mapScale stdScale"});this.stdScaleText=F.create("span",this.stdScale)}else{if(H[G]==="metric"){this.metricScale=F.create("div",this.decoratorLayer,{"class":"mapScale metricScale"});this.metricScaleText=F.create("span",this.metricScale)}}}}if(!this.getOption("controlBuffer")){this.setOption("controlBuffer",0)}this.sizeLayers();this.addCopyright()},getMapLeft:function(){var G=parseInt(B.getStyle(this.mapLayer,"left"),10);return G},getMapTop:function(){var G=parseInt(B.getStyle(this.mapLayer,"top"),10);return G},addMessage:function(G){this.messages.push(G)},getMessages:function(G){return this.messages}};LMI.Lang.importFunctions(C,LMI.Event);return C})();LMI.Mapping.Map.Defaults={singleZoom:3,emptyZoom:14,defaultLat:39.73926,defaultLng:-104.98478,defaultLocale:"",enableScales:true,imageBase:"img/",pixelUrl:"img/pixel_trans.gif",brokenUrl:"img/map_unavailable.gif",tileBase:"http://localhost/tiles/",tileExtension:".png",tileSuffix:"",tileWidth:256,tileHeight:256,tileAttempts:1,standardParallel:40};(function(){var A=LMI.Mapping.Map.prototype,B=A.init,E=A.updateScale,D=A.initContainer,C=10;A.init=function(F,G){B.call(this,F,G);this.bindEvent("recenter",this,function(){this.setCopyright(this.getTileManager().getCopyrightString())})};A.updateScale=function(){var F;E.call(this);if(this.scaleBackground){F=Math.max(this.stdScale.offsetWidth,this.metricScale.offsetWidth);this.scaleBackground.style.width=F+C+"px"}};A.initContainer=function(){D.call(this);if(this.getOption("enableScales")){this.scaleBackground=LMI.Element.create("div",this.decoratorLayer,{className:"mapScaleBackground",children:[{tag:"div",className:"bgMid"},{tag:"div",className:"bgRight"}]})}}})();LMI.Mapping.Tile=(function(){var B=YAHOO.util,A=YAHOO.env.ua.ie,F=B.Dom,E=B.Event,J=LMI.Element,H={};function D(K,L){if(K.style.filter.match(/progid:DXImageTransform.Microsoft.AlphaImageLoader\(src=\"(.*)\"\)/)){K.style.filter=K.style.filter.replace(/progid:DXImageTransform.Microsoft.AlphaImageLoader\(src=\"(.*)\"\)/,'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+L+'")')}else{K.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+L+'")'+K.style.filter}K.src=LMI.Urls.getImg("pixel_trans.gif")}function C(K,M,L){if(!A||A>=7||!L){F.setStyle(K,"opacity",M)}else{if(K.style.filter.match(/progid:DXImageTransform.Microsoft.Alpha\(opacity=\d+\.*\d*\)/)){K.style.filter=K.style.filter.replace(/progid:DXImageTransform.Microsoft.Alpha\(opacity=\d+\.*\d*\)/,"progid:DXImageTransform.Microsoft.Alpha(opacity="+(M*100)+")")}else{K.style.filter+="progid:DXImageTransform.Microsoft.Alpha(opacity="+(M*100)+")"}}}function G(K,L){if(A&&(A>=7||!L)){K.style.filter=""}else{if(A){K.style.filter=K.style.filter.replace(/progid:DXImageTransform.Microsoft.Alpha\(opacity=\d+\.*\d*\)/,"")}else{F.setStyle(K,"opacity",1)}}}function I(L,K){this.init(L,K)}I.defaults={defaultTile:"/img/pixel_trans.gif",brokenTile:"/img/map_unavailable.gif",maxAttempts:1,width:256,height:256,transparent:false};I.onCreate=new B.CustomEvent("create");I.prototype={init:function(M,L){var K;this.tileManager=M;this.initOptions(L);K=!this.options.transparent||navigator.platform.match(/Mac/)?"":"noprint";this.onError=new B.CustomEvent("error");this.onLoad=new B.CustomEvent("load");this.onSetSrc=new B.CustomEvent("setSrc");I.onCreate.fire(this);this.src=this.options.defaultTile;this.img=J.create("img",M.getTileParent(),{src:this.src,style:"position: absolute;",galleryImg:"no",className:K});E.on(this.img,"load",this.load,this,true);E.on(this.img,"error",this.error,this,true);this.setSize(this.options.width,this.options.height);C(this.img,0,this.options.transparent)},initOptions:function(K){this.options=LMI.Lang.mergeObjects({},I.defaults);if("config" in I){LMI.Lang.mergeObjects(this.options,I.config)}LMI.Lang.mergeObjects(this.options,K)},error:function(){var L,K=this.img;this.onError.fire(this);if(!H[K.src]){H[K.src]=1}if(!K.src.match(this.options.brokenTile)){if(H[K.src]++>=this.options.maxAttempts){K.src=this.src=this.options.brokenTile}else{L=K.src;K.src=this.options.defaultTile;K.src=this.src=L}}},load:function(){var K,L=this.img,M=this.options.transparent;if("Anim" in B){if(!A||A>=7||!M){K=new B.Anim(L,{opacity:{to:1}},0.75)}else{K=new B.Anim(L,{},0.75);K.onTween.subscribe(function(O,N){var P=N[0].currentFrame/K.totalFrames;C(L,P,true)})}if(A){K.onComplete.subscribe(function(){G(L,M)})}K.animate()}else{G(L,M)}this.onLoad.fire(this)},removeFromDom:function(){J.destroy(this.img)},setSize:function(L,K){this.width=this.img.width=L;this.height=this.img.height=K},getWidth:function(){return this.width},getHeight:function(){return this.height},setLeft:function(K){this.img.style.left=K},setTop:function(K){this.img.style.top=K},setSrc:function(K,M){var L=this,N=K||this.options.defaultTile;if(this.src===N){if(!M){return }}else{this.onSetSrc.fire(this,N);this.previousSrc=this.src}this.src=N;if(this.loadTimeout){window.clearTimeout(this.loadTimeout);this.loadTimeout=null}if(typeof this.img.complete!=="undefined"&&!this.img.complete){this.loadTimeout=window.setTimeout(function(){L.loadTimeout=null;L.setSrc(N,true)},1000);return }if(this.src!==this.previousSrc){C(this.img,0,this.options.transparent);this.setImgSrc()}},setImgSrc:function(){var K=this;window.setTimeout(function(){var L=K.img,M=K.src;if(A&&A<7){if(K.options.transparent&&M.match(/\.png(;|$|\?)/)){D(L,M)}else{if(L.src!==M){L.src=M}}}else{if(L){L.src=M}}},0)}};I.getErrors=function(){return H};return I})();var DSMapCopyrightSet=new DSCopyrightSet();(function(){var C,B,A,D=new Date().getYear(),E=LMI.Mapping.Point;if(D<1000){D+=1900}C=new DSCopyright("\xa9"+D+" NAVTEQ",[new DSBoundingBox(new E(10,-135),new E(70,-60)),new DSBoundingBox(new E(48,-180),new E(75,-124)),new DSBoundingBox(new E(16.860777,-161.283172),new E(24.219651,-153.424705)),new DSBoundingBox(new E(12.5,-78.6),new E(33,-50))]);B=new DSCopyright("\xa9"+D+" TeleAtlas",[new DSBoundingBox(new E(48.478825,1.322422),new E(52.521175,7.677558)),new DSBoundingBox(new E(31,-10),new E(44,5)),new DSBoundingBox(new E(48,-0.6),new E(56,11.5)),new DSBoundingBox(new E(46,-20),new E(61,4.7))]);A="\xa9"+D+" Terralink Intl Ltd";DSMapCopyrightSet.addCopyright(C);DSMapCopyrightSet.addCopyright(B);DSMapCopyrightSet.addCopyright(new DSCopyright(A,new DSBoundingBox(new E(-70,133),new E(-11,180))))})();LMI.Mapping.MapObject=(function(){function A(B,C){this.init(B,C)}A.prototype={init:function(B,C){this.element=C;this.properties={};this.setPoint(B);this.setXOffset(0);this.setYOffset(0);this.setZOffset(0);this.setIncludedInBestFit(true);this.initEvents("click","mouseout","mouseover","add","remove")},setPoint:function(B){this.point=B},getPoint:function(){return this.point},getBoundingBox:function(){if("boundingBox" in this){return this.boundingBox}return null},getWidth:function(){return this.element.offsetWidth},getHeight:function(){return this.element.offsetHeight},setXOffset:function(B){this.xOffset=B},getXOffset:function(){return this.xOffset},setYOffset:function(B){this.yOffset=B},getYOffset:function(){return this.yOffset},setZOffset:function(B){this.zOffset=B},getZOffset:function(){return this.zOffset},setProperty:function(B,C){this.properties[B]=C},setProperties:function(){var B,C;if(typeof arguments[0]==="object"){C=arguments[0];for(B in C){if(C.hasOwnProperty(B)){this.setProperty(B,C[B])}}}else{C=arguments.length;for(B=0;B<C;++B){this.properties[arguments[B]]=arguments[++B]}}return this},getProperty:function(B){return(B&&B in this.properties?this.properties[B]:"")},setIncludedInBestFit:function(B){this.includedInBestFit=!!B},isIncludedInBestFit:function(){return this.includedInBestFit},setZIndex:function(B){this.element.style.zIndex=B},add:function(B){this.shownOnMap=true;this.map=B;this.triggerEvent("add",{map:B},this)},update:function(B){},remove:function(B){this.triggerEvent("remove",{map:B},this);this.shownOnMap=false;this.map=null}};LMI.Lang.importFunctions(A,LMI.Event);A.prototype._addEventListener=A.prototype.addEventListener;A.prototype.addEventListener=function(B,D){var C=this;function E(){if(C.getListeners(B).length===0){YAHOO.util.Event.on(C.element,B,function(F){C.triggerEvent(B,F,C)})}}switch(B){case"click":YAHOO.util.Dom.setStyle(this.element,"cursor","pointer");E();break;case"mouseout":case"mouseover":E();break}return this._addEventListener(B,D)};A.prototype.bindEvent=function(C,F,D,B){var E=function(G,H){D.call(F,G,H,B)};return this.addEventListener(C,E)};return A})();LMI.Mapping.Icon=(function(){var G=YAHOO.util,C=G.Event,D=G.Dom,E,H;function B(I,J){this.init(I,J)}YAHOO.lang.extend(B,LMI.Mapping.MapObject);E=B.prototype;H=B.superclass;function F(J){var I=this.element;C.removeListener(I,"load",F);D.removeClass(I,"notTransparent");LMI.Element.setImageSrc(I,I.src)}function A(J){var I=this.element,K=this.getDefaultIcon();if(LMI.Element.getImageSrc(I).match(K)){I.alt="X"}else{LMI.Element.setImageSrc(I,K)}}E.init=function(I,K){this.option=K;var J=LMI.Element.create("img");YAHOO.util.Event.on(J,"error",A,this,true);H.init.call(this,I,J);this.setIconSrc(this.getRecommendedIconSrc());this.setXOffset(19);this.setYOffset(24)};E.getIconSrc=function(){return LMI.Element.getImageSrc(this.element)};E.setIconSrc=function(J){var I=this.element;D.addClass(I,"notTransparent");C.on(I,"load",F,this,true);LMI.Element.setImageSrc(this.element,J)};E.getRecommendedIconSrc=function(){var K=parseInt(this.option,10),J="abcdefghijklmnopqrstuvwxyz",I=(K>=0&&K<J.length?J.charAt(K):"blank");return"img/nodes/red/map_icon_"+I+".png"};E.getHeight=function(){return 32};E.getWidth=function(){return 27};E.getDefaultIcon=function(){var I=this.getIconSrc();return I.replace(/((?:https?:\/\/)?(?:[^\/]+\/)*)[^\/]+/,"$1map_icon_blank.png")};return B})();LMI.Mapping.DSIcon=(function(){var B=LMI.Element;function A(D,C){this.init(D,C)}YAHOO.lang.extend(A,LMI.Mapping.Icon,{init:function(E,C){var D=new LMI.Mapping.Point(E.latitude,E.longitude);this.option=C;this.createLabelElement();A.superclass.init.call(this,D,C);if(E){this.setListing(E)}},setListing:function(D){var C=this;LMI.Lang.forEach(["name","streetAddress"],function(E){if(E in D){C.setProperty(E,D[E])}})},getRecommendedIconSrc:function(){return LMI.Mapping.IconUrls["default"]},createLabelElement:function(){if(!this.labelElement&&this.option){this.labelElement=B.create("div",null,{text:this.option,className:"DSIconLabel"})}},add:function(){A.superclass.add.apply(this,arguments);if(this.labelElement){this.element.parentNode.appendChild(this.labelElement)}},update:function(){A.superclass.update.apply(this,arguments);if(this.labelElement){this.labelElement.style.left=this.element.style.left;this.labelElement.style.top=this.element.style.top;this.labelElement.style.zIndex=this.element.style.zIndex}},remove:function(){A.superclass.remove.apply(this,arguments);if(this.labelElement){this.element.parentNode.removeChild(this.labelElement)}},setZIndex:function(C){this.element.style.zIndex=C;if(this.labelElement){this.labelElement.style.zIndex=C}},addEventListener:function(D,F){var E=this,C=[this.element,this.labelElement];function G(){if(E.getListeners(D).length===0){YAHOO.util.Event.on(C,D,function(H){E.triggerEvent(D,H,E)})}}switch(D){case"click":YAHOO.util.Dom.setStyle(this.element,"cursor","pointer");YAHOO.util.Dom.setStyle(this.labelElement,"cursor","pointer");G();break;case"mouseout":case"mouseover":G();break}return this._addEventListener(D,F)}});return A})();LMI.Mapping.CenterIcon=(function(){function A(C,D){var B=new LMI.Mapping.Point(C.latitude,C.longitude);this.init(B,D)}YAHOO.lang.extend(A,LMI.Mapping.Icon,{init:function(){A.superclass.init.apply(this,arguments);YAHOO.util.Dom.addClass(this.element,"smallMapBubbleImg");this.setXOffset(10);this.setYOffset(28)},getRecommendedIconSrc:function(){return LMI.Urls.getImg("mapping/blk_mapMarker_withCircle.png")}});return A})();(function(){var A=LMI.Mapping.Map,B=A.prototype,D=LMI.Element,C=B.initContainer;B.initContainer=function(){C.call(this);var E;this.shadowPieces=[];E=this.shadowPieces;LMI.Lang.forEach(["T","TR","R","BR","B","BL","L","TL"],function(F){E.push(D.create("div",this.decoratorLayer,{className:"innerShadow innerShadow"+F}))},this)}})();
