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=(!F||!this.tileset||(F==this.tileset));var G=(!this.minzoom||D>=this.minzoom)&&(!this.maxzoom||D<=this.maxzoom);var E=false;for(var B=0;B<this.boxes.length;++B){if(this.boxes[B].contains(A)){E=true;break}}return E&&G&&C};function DSCopyrightSet(){this.copyrights=[]}DSCopyrightSet.prototype.getCopyright=function(A,D,E){var C=[];if(A&&D){for(var B=0;B<this.copyrights.length;++B){if(this.copyrights[B].contains(A,D,E)){C.push(this.copyrights[B].text)}}}return C.join(" - ")};DSCopyrightSet.prototype.addCopyright=function(A){this.copyrights.push(A)};function DSMapDecoratorCollection(){this.init()}LMI.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(){for(i=0,iLen=this.element.childNodes.length;i<iLen;++i){var A=this.element.childNodes[i];if(!YAHOO.util.Dom.hasClass(A,"skip")){return A}}};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}LMI.Lang.extend(B,TypeError);function A(F){this.name="InvalidLngException";this.message=F}LMI.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 C=[];for(var 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 M=C-2*Math.atan(N);if(O===0){return M}var J,L,K,I;for(J=0;J<=15;++J){L=Math.sin(M);K=O*L;I=C-2*Math.atan(N*Math.pow((1-K)/(1+K),0.5*O))-M;M+=I;if(Math.abs(I)<=B){return M}}}function G(J,I){this.center_lon=J;this.center_lat=I;this.setRadius(F)}G.prototype={setRadius:function(K,L){var J;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;var 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(){function A(C,B){this.init(C,B)}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:LMI.Mapping.MercatorMapProjection,projectionOptions:{isEllipsoidal:true},tileUrlStrategy:LMI.Mapping.TileUrl,tileUrlOptions:{},bufferRows:1,bufferCols:1,tileWidth:256,tileHeight:256};A.prototype={init:function(C,B){this.tiles=[];this.parentEl=C;this.grids=[];this.initOptions(B);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(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;this.tileUrls.setMapWidth(this.mapWidth)},setMapHeight:function(B){this.mapHeight=B;this.tileUrls.setMapHeight(this.mapHeight)},setLocale:function(B){this.locale=B;this.tileUrls.setLocale(B)},setZoomLevel:function(B){this.setScale(1);this.zoomLevel=B},getZoomLevel:function(B){B=B||this.zoomLevel||1;B=this.options.invertLevels?this.options.totalLevels-B+1:B;return Math.max(1,Math.min(B,this.options.totalLevels))},getScaledZoomLevel:function(B){B=B||this.zoomLevel||1;return this.options.invertLevels?this.tileLevels[this.options.totalLevels-B]:this.tileLevels[B-1]},getZoomLevelIndex:function(C){var B;C=C||this.zoomLevel||0;for(B=0;B<this.maxLevel;B++){if(C<=this.tileLevels[B]){if(this.options.invertLevels){return this.options.totalLevels-B}else{return B}}}if(this.options.invertLevels){return this.minLevel}else{return this.maxLevel}},setCenterPoint:function(B){this.center=B},getCenterPoint:function(){return this.center},remove:function(){this.tileLayer.parentNode.removeChild(this.tileLayer);this.map=null},add:function(B){B.tileLayer.appendChild(this.tileLayer);this.map=B},createTiles:function(){var E,D,G,B=this.tileWidth,F=this.tileHeight;this.rows=Math.ceil(this.mapHeight/F)+1+this.options.bufferRows;this.columns=Math.ceil(this.mapWidth/B)+1+this.options.bufferCols;this.tileLayer=LMI.Element.create("div",null,{className:"tileLayer"});this.width=this.columns*B;this.height=this.rows*F;var C=this.getTileOptions();for(E=0;E<this.rows;++E){for(D=0;D<this.columns;++D){G=new LMI.Mapping.Tile(this,C);G.onLoad.subscribe(this.tileLoaded,this);this.tiles.push(G)}}},getTileOptions:function(){var B={width:this.tileWidth,height:this.tileHeight};if("brokenTile" in this.options){B.brokenTile=this.options.brokenTile}return B},appendRow:function(){var E=this.rows++,D=this.getTileOptions();for(var C=0;C<this.columns;++C){var B=new LMI.Mapping.Tile(this,D);B.onLoad.subscribe(this.tileLoaded,this);if(this.offsets){B.setSrc(this.tileUrls.getUrl(this.getGrid().restrictGridX(this.getGridLeft()+C),this.getGridTop()+E,this.tileLevels[this.getZoomLevel()-1]))}this.tiles.push(B);this.positionTile(this.tiles.length-1)}},removeRow:function(){this.rows--;var C=this.tiles.length-this.columns;while(this.tiles.length>C){var B=this.tiles.length-1;this.tiles[B].removeFromDom();this.tiles.splice(B,1)}},appendColumn:function(){var F=this.columns++,D=this.getTileOptions();for(var C=0;C<this.rows;++C){var E=(F*(1+C))+C;var B=new LMI.Mapping.Tile(this,D);B.onLoad.subscribe(this.tileLoaded,this);if(this.offsets){B.setSrc(this.tileUrls.getUrl(this.getGrid().restrictGridX(this.getGridLeft()+F),this.getGridTop()+C,this.tileLevels[this.getZoomLevel()-1]))}this.tiles.splice(E,0,B);this.positionTile(E)}},removeColumn:function(){var C=this.columns--;for(var B=this.tiles.length-1;B>0;B-=C){this.tiles[B].removeFromDom();this.tiles.splice(B,1)}},resizeTileLayer:function(){var B=Math.ceil(this.mapHeight/this.tileHeight)+1+this.options.bufferRows,C=Math.ceil(this.mapWidth/this.tileWidth)+1+this.options.bufferCols;while(C>this.columns){this.appendColumn()}while(C<this.columns){this.removeColumn()}while(B>this.rows){this.appendRow()}while(B<this.rows){this.removeRow()}this.width=this.columns*this.tileWidth;this.height=this.rows*this.tileHeight},mapResizeHandler:function(C,B){this.setMapWidth(C);this.setMapHeight(B);if(this.offsets){this.calculateCenterPoint()}this.resizeTileLayer()},setCenterOffset:function(B,C){this.centerOffset={x:B,y:C}},getCenterOffset:function(){return{x:(this.centerOffset.x*this.scale)+this.offsets.x,y:(this.centerOffset.y*this.scale)+this.offsets.y}},getPosition:function(D){var B,C;if(this.offsets){B=this.getGrid();C=B.toXY(D);return{x:C.x-B.gridToX(this.getGridLeft(),-this.offsets.x),y:C.y-B.gridToY(this.getGridTop(),-this.offsets.y)}}return null},getPointByPosition:function(B,D){var C=this.getGrid();if(this.offsets){return C.toLL(C.gridToX(this.getGridLeft(),B-this.offsets.x),C.gridToY(this.getGridTop(),D-this.offsets.y))}return null},wrapNorth:function(){var C,B,D=this.getZoomLevel();this.offsets.y-=this.tileHeight;this.setGridTop(this.getGridTop()-1);for(C=0;C<this.columns;++C){B=this.tiles.pop();this.tiles.unshift(B);B.setSrc(this.tileUrls.getUrl(this.getGrid().restrictGridX(this.getGridLeft()+((this.columns-1)-C)),this.getGridTop(),this.tileLevels[D-1]))}for(C=0;C<this.columns;++C){this.positionTile(C)}},wrapSouth:function(){var D,B,C,E=this.getZoomLevel();this.offsets.y+=this.tileHeight;for(D=0;D<this.columns;++D){C=this.tiles.shift();this.tiles.push(C);C.setSrc(this.tileUrls.getUrl(this.getGrid().restrictGridX(this.getGridLeft()+D),this.getGridTop()+this.rows,this.tileLevels[E-1]))}for(D=this.columns*(this.rows-1),B=this.tiles.length;D<B;++D){this.positionTile(D)}this.setGridTop(this.getGridTop()+1)},wrapWest:function(){var D,C,B,E=this.getZoomLevel();this.offsets.x-=this.tileWidth;this.setGridLeft(this.getGridLeft()-1);for(D=1;D<=this.rows;++D){B=this.columns*D-1;C=this.tiles.splice(B,1)[0];B-=this.columns-1;this.tiles.splice(B,0,C);C.setSrc(this.tileUrls.getUrl(this.getGrid().restrictGridX(this.getGridLeft()),this.getGridTop()+D-1,this.tileLevels[E-1]));this.positionTile(B)}},wrapEast:function(){var D,C,B,E=this.getZoomLevel();this.offsets.x+=this.tileWidth;for(D=0;D<this.rows;++D){B=this.columns*D;C=this.tiles.splice(B,1)[0];B+=this.columns-1;this.tiles.splice(B,0,C);C.setSrc(this.tileUrls.getUrl(this.getGrid().restrictGridX(this.getGridLeft()+this.columns),this.getGridTop()+D,this.tileLevels[E-1]));this.positionTile(B)}this.setGridLeft(this.getGridLeft()+1)},calculateCenterPoint:function(){if(this.offsets){var B=this.getGrid();this.setCenterPoint(B.toLL(B.gridToX(this.getGridLeft(),-(this.mapOffsets.x+this.offsets.x)+(this.mapWidth/2)),B.gridToY(this.getGridTop(),-(this.mapOffsets.y+this.offsets.y)+(this.mapHeight/2))))}},getZoomByBounds:function(B,D,K){var G,C,E,J,H=this.tileLevels.length,F=B.upper,I=B.lower;D=D||this.mapWidth;K=K||this.mapHeight;for(G=1;G<H;++G){C=this.getGrid(G);E=C.toXY(F);J=C.toXY(I);if(Math.abs(E.x-J.x)<D&&Math.abs(E.y-J.y)<K){return G}}return H},getBoundsAndCentroid:function(I){var L,D,E,F,J,H,B,K,G,C=this.getGrid().projection;LMI.Lang.forEach(I,function(M){L=C.forward(M.lngAsRad(),M.latAsRad());if(!D){D=E=L.y;F=J=L.x;H=B=M.lat;K=G=M.lng}else{if(L.y>D){D=L.y;H=M.lat}else{if(L.y<E){E=L.y;B=M.lat}}if(L.x>F){F=L.x;K=M.lng}else{if(L.x<J){J=L.x;G=M.lng}}}});L=C.inverse((J+F)/2,(E+D)/2);return{centroid:LMI.Mapping.Point.fromRadians(L.y,L.x),upper:new LMI.Mapping.Point(H,K),lower:new LMI.Mapping.Point(B,G),upperGrid:{x:F,y:D},lowerGrid:{x:J,y:E}}},setMapOffsets:function(B,C){this.mapOffsets={x:B,y:C}},updateMap:function(){var B=this.offsets.x+this.mapOffsets.x,C=this.offsets.y+this.mapOffsets.y;if(B>-this.bufferWidth){this.wrapWest()}else{if(B+this.width-this.mapWidth<this.bufferWidth){this.wrapEast()}}if(C>-this.bufferHeight){this.wrapNorth()}else{if(C+this.height-this.mapHeight<this.bufferHeight){this.wrapSouth()}}this.calculateCenterPoint();this.updateCenterOffset()},setOffsets:function(B,C){this.offsets={x:B,y:C}},positionTile:function(C){var B=this.tiles[C];if(this.offsets){B.setSize(this.tileWidth,this.tileHeight);B.setLeft(((C%this.columns)*B.getWidth()+this.offsets.x)+"px");B.setTop((Math.floor(C/this.columns)*B.getHeight()+this.offsets.y)+"px")}},getScale:function(){var D=this.getCenterPoint(),C=this.getGrid(),B=C.getScale();if(C.projection instanceof LMI.Mapping.MercatorMapProjection){B*=Math.cos(D.latAsRad())}return B},getCopyrightString:function(){return this.options.copyright},updateTiles:function(){var C,B;for(C=0;C<this.tiles.length;++C){this.positionTile(C)}},setScale:function(B){this.scale=B;this.tileWidth=this.options.tileWidth*B;this.tileHeight=this.options.tileHeight*B},previewZoomLevel:function(D,L){var G=Math.floor(D),N=G+1,M=D-G,B=this.getGrid(),C=this.getGrid(G),E=this.getGrid(N),I=C.gridWidth+((E.gridWidth-C.gridWidth)*M),J=I/B.gridWidth,H=this,K=J-1,F;if(L){F=new YAHOO.util.Anim(this.viewport,{},0.25);F.onTween.subscribe(function(P,O){H.setScale(1+(K*(O[0].currentFrame/F.totalFrames)));H.updateTiles();H.map.positionMap()});F.onComplete.subscribe(L);F.animate();return F}else{this.setScale(J);this.updateTiles();this.map.positionMap();return null}},getGrid:function(B){var C=this.getZoomLevel(B)-1;if(!this.grids[C]){this.grids[C]=this.projection.getGridCS(this.tileLevels[C],this.projectionOptions)}return this.grids[C]},setGridLeft:function(B){this.gridLeft=B},getGridLeft:function(){return this.gridLeft},setGridTop:function(B){this.gridTop=B},getGridTop:function(){return this.gridTop},updateCenterOffset:function(){var C=this.getGrid(),E=this.getCenterPoint(),D=C.toXY(E),B={x:C.gridToX(this.getGridLeft()),y:C.gridToY(this.getGridTop())};this.setCenterOffset(D.x-B.x,D.y-B.y)},calculateGridPosition:function(){var C=this.getGrid(),D=this.getCenterPoint(),B=C.getUpperLeftPoint(D,this.mapWidth,this.mapHeight),E=C.grid(B);this.setGridLeft(E.x);this.setGridTop(E.y);this.updateCenterOffset()},tileLoaded:function(C,B,D){D.numLoadedTiles++;if(D.numLoadedTiles==D.tiles.length){D.triggerEvent("loadedTiles")}},loadTiles:function(){var F,E,G,I,C,D,H=0,J=this.getZoomLevel(),B=this.getGrid();this.numLoadedTiles=0;this.setMapOffsets(0,0);this.setOffsets(0,0);this.calculateGridPosition();G=this.getGridTop();C=G+this.rows;D=this.getGridLeft();I=D+this.columns;for(F=G;F<C;++F){for(E=D;E<I;++E){this.tiles[H].setSrc(this.tileUrls.getUrl(B.restrictGridX(E),F,this.tileLevels[J-1]));this.positionTile(H++)}}},getTileParent:function(){return this.tileLayer}};LMI.Lang.importFunctions(A,LMI.Event);return A})();(function(){var A=LMI.Mapping.TileManager.prototype;A.getCopyrightString=function(){var D=this.options.copyrights,B=this.getCenterPoint(),E;if(B){for(var C=0;C<D.length;C++){E=D[C].box;if(!E||(B.lat>E[0]&&B.lng>E[1]&&B.lat<E[2]&&B.lng<E[3])){return D[C].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.prototype={setZoomLevel:function(I,H){var G=this.tileManager;if(I<G.minLevel){I=G.minLevel}else{if(I>G.maxLevel){I=G.maxLevel}}if(H&&!H.equals(this.getCenterPoint())){this.tileManager.setCenterPoint(H)}this.zoomLevel=I;this.tileManager.setZoomLevel(I);this.loadMap();this.triggerEvent("zoom",this.getEventObject(),this)},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){P=I.getProperty("zoomLevel");if(P){P=this.tileManager.getZoomLevelIndex(P)}else{P=this.getOption("singleZoom")}this.centerAndZoom(N[0],P)}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 H=D(G);if(!H){throw new Error('Map: unable to find container: "'+G+'"')}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");var J=new Date().getYear();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(this.tileLayer,{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.tileManager.add(this);this.tileManager.setMapWidth(this.width);this.tileManager.setMapHeight(this.height);if(H){this.tileManager.setCenterPoint(H);this.setZoomLevel(this.zoomLevel)}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 G=this.decorators.getLength();for(var 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},getGridLeft:function(){alert("XXX: in getGridLeft -- should fix that");return null},getGridTop:function(){alert("XXX: in getGridTop -- should fix that");return null},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"},updateScale:function(){if(!this.getOption("enableScales")){return }var K=100,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(G){var H=this.objects.add(G);G.element.style.position="absolute";G.z=5+G.zOffset;G.element.style.zIndex=G.z;this.positionObject(G);this.mapLayer.appendChild(G.element);G.add(this);return H},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 K=-1;if(typeof J==="object"){for(var H=new DSMapObject_Iterator(this.objects);H.hasNext();){var G=H.next();if(G===J){K=H.getId();break}}}else{K=J}var I=this.objects.getById(K);if(I){I.remove(this);this.mapLayer.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;this.viewport.removeChild(this.mapLayer);for(var 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(){if(!this.dataCopyright){var H=F.create("div",null,{textValue:" ",className:"dataCopyright"});var 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.decoratorLayer.style.height=this.height+"px";this.decoratorLayer.style.width=this.width+"px"},initContainer:function(){var H,G;this.decoratorLayer=F.create("div",this.container,{"class":"decLayer"});this.viewport=F.create("div",this.decoratorLayer,{"class":"viewport"});this.mapLayer=F.create("div",this.viewport,{"class":"mapLayer"});this.tileLayer=F.create("div",this.mapLayer,{"class":"tileLayer"});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.desiredRows;this.desiredColumns;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,C=A.init,F=A.updateScale,E=A.initContainer,D=10,B=LMI.Element.getOne;A.init=function(G,H){C.call(this,G,H);this.bindEvent("recenter",this,function(){this.setCopyright(this.getTileManager().getCopyrightString())})};A.updateScale=function(){var G;F.call(this);if(this.scaleBackground){G=Math.max(this.stdScale.offsetWidth,this.metricScale.offsetWidth);this.scaleBackground.style.width=G+D+"px"}};A.initContainer=function(){E.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 D=new Date().getYear(),E=LMI.Mapping.Point;if(D<1000){D+=1900}var 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))]);var 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))]);var 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;switch(B){case"click":YAHOO.util.Dom.setStyle(this.element,"cursor","pointer");case"mouseout":case"mouseover":if(this.getListeners(B).length===0){C=this;YAHOO.util.Event.on(this.element,B,function(E){C.triggerEvent(B,E,C)})}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(){function B(E,F){this.init(E,F)}LMI.Lang.extend(B,LMI.Mapping.MapObject);var C=B.prototype,D=B.superclass;C.init=function(E,G){this.option=G;var F=LMI.Element.create("img");YAHOO.util.Event.on(F,"error",A,this,true);D.init.call(this,E,F);this.setIconSrc(this.getRecommendedIconSrc());this.setXOffset(27);this.setYOffset(32)};C.getIconSrc=function(){return LMI.Element.getImageSrc(this.element)};C.setIconSrc=function(E){LMI.Element.setImageSrc(this.element,E)};C.getRecommendedIconSrc=function(){var G=parseInt(this.option,10),F="abcdefghijklmnopqrstuvwxyz",E=(G>=0&&G<F.length?F.charAt(G):"blank");return"img/nodes/red/map_icon_"+E+".png"};C.getHeight=function(){return 32};C.getWidth=function(){return 27};C.getDefaultIcon=function(){var E=this.getIconSrc();return E.replace(/((?:https?:\/\/)?(?:[^\/]+\/)*)[^\/]+/,"$1map_icon_blank.png")};function A(F){var E=this.element,G=this.getDefaultIcon();if(LMI.Element.getImageSrc(E).match(G)){E.alt="X"}else{LMI.Element.setImageSrc(E,G)}}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.Urls.getImg(LMI.Data.Urls.defaultIcon)},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];switch(D){case"click":YAHOO.util.Dom.setStyle(this.element,"cursor","pointer");YAHOO.util.Dom.setStyle(this.labelElement,"cursor","pointer");case"mouseout":case"mouseover":if(this.getListeners(D).length===0){YAHOO.util.Event.on(C,D,function(G){E.triggerEvent(D,G,E)})}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,{getRecommendedIconSrc:function(){return this.option?LMI.Urls.getImg("mapping/map_node_faded_star.png"):LMI.Urls.getImg("mapping/map_node_red_star.png")}});return A})();if(DWREngine==null){var DWREngine={}}DWREngine.setErrorHandler=function(A){DWREngine._errorHandler=A};DWREngine.setWarningHandler=function(A){DWREngine._warningHandler=A};DWREngine.setTimeout=function(A){DWREngine._timeout=A};DWREngine.setPreHook=function(A){DWREngine._preHook=A};DWREngine.setPostHook=function(A){DWREngine._postHook=A};DWREngine.XMLHttpRequest=1;DWREngine.IFrame=2;DWREngine.setMethod=function(A){if(A!=DWREngine.XMLHttpRequest&&A!=DWREngine.IFrame){DWREngine._handleError("Remoting method must be one of DWREngine.XMLHttpRequest or DWREngine.IFrame");return }DWREngine._method=A};DWREngine.setVerb=function(A){if(A!="GET"&&A!="POST"){DWREngine._handleError("Remoting verb must be one of GET or POST");return }DWREngine._verb=A};DWREngine.setOrdered=function(A){DWREngine._ordered=A};DWREngine.setAsync=function(A){DWREngine._async=A};DWREngine.setTextHtmlHandler=function(A){DWREngine._textHtmlHandler=A};DWREngine.defaultMessageHandler=function(A){if(typeof A=="object"&&A.name=="Error"&&A.description){alert("Error: "+A.description)}else{if(A.toString().indexOf("0x80040111")==-1){alert(A)}}};DWREngine.beginBatch=function(){if(DWREngine._batch){DWREngine._handleError("Batch already started.");return }DWREngine._batch={map:{callCount:0},paramCount:0,ids:[],preHooks:[],postHooks:[]}};DWREngine.endBatch=function(B){var A=DWREngine._batch;if(A==null){DWREngine._handleError("No batch in progress.");return }if(B&&B.preHook){A.preHooks.unshift(B.preHook)}if(B&&B.postHook){A.postHooks.push(B.postHook)}if(DWREngine._preHook){A.preHooks.unshift(DWREngine._preHook)}if(DWREngine._postHook){A.postHooks.push(DWREngine._postHook)}if(A.method==null){A.method=DWREngine._method}if(A.verb==null){A.verb=DWREngine._verb}if(A.async==null){A.async=DWREngine._async}if(A.timeout==null){A.timeout=DWREngine._timeout}A.completed=false;DWREngine._batch=null;if(!DWREngine._ordered){DWREngine._sendData(A);DWREngine._batches[DWREngine._batches.length]=A}else{if(DWREngine._batches.length==0){DWREngine._sendData(A);DWREngine._batches[DWREngine._batches.length]=A}else{DWREngine._batchQueue[DWREngine._batchQueue.length]=A}}};DWREngine._errorHandler=DWREngine.defaultMessageHandler;DWREngine._warningHandler=null;DWREngine._preHook=null;DWREngine._postHook=null;DWREngine._batches=[];DWREngine._batchQueue=[];DWREngine._handlersMap={};DWREngine._method=DWREngine.XMLHttpRequest;DWREngine._verb="POST";DWREngine._ordered=false;DWREngine._async=true;DWREngine._batch=null;DWREngine._timeout=0;DWREngine._DOMDocument=["Msxml2.DOMDocument.6.0","Msxml2.DOMDocument.5.0","Msxml2.DOMDocument.4.0","Msxml2.DOMDocument.3.0","MSXML2.DOMDocument","MSXML.DOMDocument","Microsoft.XMLDOM"];DWREngine._XMLHTTP=["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.5.0","Msxml2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"];DWREngine._execute=function(N,D,L,K){var H=false;if(DWREngine._batch==null){DWREngine.beginBatch();H=true}var J=[];for(var G=0;G<arguments.length-3;G++){J[G]=arguments[G+3]}if(DWREngine._batch.path==null){DWREngine._batch.path=N}else{if(DWREngine._batch.path!=N){DWREngine._handleError("Can't batch requests to multiple DWR Servlets.");return }}var F;var C;var E=J[0];var M=J[J.length-1];if(typeof E=="function"){C={callback:J.shift()};F=J}else{if(typeof M=="function"){C={callback:J.pop()};F=J}else{if(M!=null&&typeof M=="object"&&M.callback!=null&&typeof M.callback=="function"){C=J.pop();F=J}else{if(E==null){if(M==null&&J.length>2){DWREngine._handleError("Ambiguous nulls at start and end of parameter list. Which is the callback function?")}C={callback:J.shift()};F=J}else{if(M==null){C={callback:J.pop()};F=J}else{DWREngine._handleError("Missing callback function or metadata object.");return }}}}}var B=Math.floor(Math.random()*10001);var A=(B+"_"+new Date().getTime()).toString();var I="c"+DWREngine._batch.map.callCount+"-";DWREngine._batch.ids.push(A);if(C.method!=null){DWREngine._batch.method=C.method;delete C.method}if(C.verb!=null){DWREngine._batch.verb=C.verb;delete C.verb}if(C.async!=null){DWREngine._batch.async=C.async;delete C.async}if(C.timeout!=null){DWREngine._batch.timeout=C.timeout;delete C.timeout}if(C.preHook!=null){DWREngine._batch.preHooks.unshift(C.preHook);delete C.preHook}if(C.postHook!=null){DWREngine._batch.postHooks.push(C.postHook);delete C.postHook}if(C.errorHandler==null){C.errorHandler=DWREngine._errorHandler}if(C.warningHandler==null){C.warningHandler=DWREngine._warningHandler}DWREngine._handlersMap[A]=C;DWREngine._batch.map[I+"scriptName"]=D;DWREngine._batch.map[I+"methodName"]=L;DWREngine._batch.map[I+"id"]=A;for(G=0;G<F.length;G++){DWREngine._serializeAll(DWREngine._batch,[],F[G],I+"param"+G)}DWREngine._batch.map.callCount++;if(H){DWREngine.endBatch()}};DWREngine._sendData=function(F){if(F.map.callCount==0){return }for(var E=0;E<F.preHooks.length;E++){F.preHooks[E]()}F.preHooks=null;if(F.timeout&&F.timeout!=0){F.interval=setInterval(function(){DWREngine._abortRequest(F)},F.timeout)}var H;if(F.map.callCount==1){H=F.map["c0-scriptName"]+"."+F.map["c0-methodName"]+".dwr"}else{H="Multiple."+F.map.callCount+".dwr"}if(F.method==DWREngine.XMLHttpRequest){if(window.XMLHttpRequest){F.req=new XMLHttpRequest()}else{if(window.ActiveXObject&&!(navigator.userAgent.indexOf("Mac")>=0&&navigator.userAgent.indexOf("MSIE")>=0)){F.req=DWREngine._newActiveXObject(DWREngine._XMLHTTP)}}}var K="";var A;if(F.req){F.map.xml="true";if(F.async){F.req.onreadystatechange=function(){DWREngine._stateChange(F)}}var B=navigator.userAgent.indexOf("Safari/");if(B>=0){var I=navigator.userAgent.substring(B+7);if(parseInt(I,10)<400){F.verb=="GET"}}if(F.verb=="GET"){F.map.callCount=""+F.map.callCount;for(A in F.map){var D=encodeURIComponent(A);var L=encodeURIComponent(F.map[A]);if(L==""){DWREngine._handleError("Found empty qval for qkey="+D)}K+=D+"="+L+"&"}try{var C=F.path;if(C.indexOf(";")>=0){C=C.replace(/(;.*)/,"/exec/"+H+"?"+K+"$1")}else{C+="/exec/"+H+"?"+K}F.req.open("GET",C,F.async);F.req.send(null);if(!F.async){DWREngine._stateChange(F)}}catch(J){DWREngine._handleMetaDataError(null,J)}}else{for(A in F.map){if(typeof F.map[A]!="function"){K+=A+"="+F.map[A]+"\n"}}var C=F.path;if(C.indexOf(";")>=0){C=C.replace(/(;.*)/,"/exec/"+H+"$1")}else{C+="/exec/"+H}try{F.req.open("POST",C,F.async);F.req.setRequestHeader("Content-Type","text/plain");F.req.send(K);if(!F.async){DWREngine._stateChange(F)}}catch(J){DWREngine._handleMetaDataError(null,J)}}}else{F.map.xml="false";var G="dwr-if-"+F.map["c0-id"];F.div=document.createElement("div");F.div.innerHTML="<iframe src='javascript:void(0)' frameborder='0' width='0' height='0' id='"+G+"' name='"+G+"'></iframe>";document.body.appendChild(F.div);F.iframe=document.getElementById(G);F.iframe.setAttribute("style","width:0px; height:0px; border:0px;");if(F.verb=="GET"){for(A in F.map){if(typeof F.map[A]!="function"){K+=encodeURIComponent(A)+"="+encodeURIComponent(F.map[A])+"&"}}K=K.substring(0,K.length-1);F.iframe.setAttribute("src",F.path+"/exec/"+H+"?"+K);document.body.appendChild(F.iframe)}else{F.form=document.createElement("form");F.form.setAttribute("id","dwr-form");F.form.setAttribute("action",F.path+"/exec"+H);F.form.setAttribute("target",G);F.form.target=G;F.form.setAttribute("method","POST");for(A in F.map){var M=document.createElement("input");M.setAttribute("type","hidden");M.setAttribute("name",A);M.setAttribute("value",F.map[A]);F.form.appendChild(M)}document.body.appendChild(F.form);F.form.submit()}}};DWREngine._stateChange=function(batch){if(!batch.completed&&batch.req.readyState==4){try{var reply=batch.req.responseText;if(reply==null||reply==""){DWREngine._handleMetaDataWarning(null,"No data received from server")}else{var contentType=batch.req.getResponseHeader("Content-Type");if(!contentType.match(/^text\/plain/)&&!contentType.match(/^text\/javascript/)){if(DWREngine._textHtmlHandler&&contentType.match(/^text\/html/)){DWREngine._textHtmlHandler()}else{DWREngine._handleMetaDataWarning(null,"Invalid content type from server: '"+contentType+"'")}}else{if(reply.search("DWREngine._handle")==-1){DWREngine._handleMetaDataWarning(null,"Invalid reply from server")}else{eval(reply)}}}DWREngine._clearUp(batch)}catch(ex){if(ex==null){ex="Unknown error occured"}DWREngine._handleMetaDataWarning(null,ex)}finally{if(DWREngine._batchQueue.length!=0){var sendbatch=DWREngine._batchQueue.shift();DWREngine._sendData(sendbatch);DWREngine._batches[DWREngine._batches.length]=sendbatch}}}};DWREngine._handleResponse=function(E,D){var A=DWREngine._handlersMap[E];DWREngine._handlersMap[E]=null;if(A){try{if(A.callback){A.callback(D)}}catch(C){DWREngine._handleMetaDataError(A,C)}}if(DWREngine._method==DWREngine.IFrame){var B=DWREngine._batches[DWREngine._batches.length-1];if(B.map["c"+(B.map.callCount-1)+"-id"]==E){DWREngine._clearUp(B)}}};DWREngine._handleServerError=function(C,B){var A=DWREngine._handlersMap[C];DWREngine._handlersMap[C]=null;if(B.message){DWREngine._handleMetaDataError(A,B.message,B)}else{DWREngine._handleMetaDataError(A,B)}};DWREngine._eval=function(script){return eval(script)};DWREngine._abortRequest=function(B){if(B&&!B.completed){clearInterval(B.interval);DWREngine._clearUp(B);if(B.req){B.req.abort()}var A;for(var C=0;C<B.ids.length;C++){A=DWREngine._handlersMap[B.ids[C]];DWREngine._handleMetaDataError(A,"Timeout")}}};DWREngine._clearUp=function(A){if(A.completed){DWREngine._handleError("Double complete");return }if(A.div){A.div.parentNode.removeChild(A.div)}if(A.iframe){A.iframe.parentNode.removeChild(A.iframe)}if(A.form){A.form.parentNode.removeChild(A.form)}if(A.req){delete A.req}for(var B=0;B<A.postHooks.length;B++){A.postHooks[B]()}A.postHooks=null;for(var B=0;B<DWREngine._batches.length;B++){if(DWREngine._batches[B]==A){DWREngine._batches.splice(B,1);break}}A.completed=true};DWREngine._handleError=function(B,A){if(DWREngine._errorHandler){DWREngine._errorHandler(B,A)}};DWREngine._handleWarning=function(B,A){if(DWREngine._warningHandler){DWREngine._warningHandler(B,A)}};DWREngine._handleMetaDataError=function(A,C,B){if(A&&typeof A.errorHandler=="function"){A.errorHandler(C,B)}else{DWREngine._handleError(C,B)}};DWREngine._handleMetaDataWarning=function(A,C,B){if(A&&typeof A.warningHandler=="function"){A.warningHandler(C,B)}else{DWREngine._handleWarning(C,B)}};DWREngine._serializeAll=function(B,D,C,A){if(C==null){B.map[A]="null:null";return }switch(typeof C){case"boolean":B.map[A]="boolean:"+C;break;case"number":B.map[A]="number:"+C;break;case"string":B.map[A]="string:"+encodeURIComponent(C);break;case"object":if(C instanceof String){B.map[A]="String:"+encodeURIComponent(C)}else{if(C instanceof Boolean){B.map[A]="Boolean:"+C}else{if(C instanceof Number){B.map[A]="Number:"+C}else{if(C instanceof Date){B.map[A]="Date:"+C.getTime()}else{if(C instanceof Array){B.map[A]=DWREngine._serializeArray(B,D,C,A)}else{B.map[A]=DWREngine._serializeObject(B,D,C,A)}}}}}break;case"function":break;default:DWREngine._handleWarning("Unexpected type: "+typeof C+", attempting default converter.");B.map[A]="default:"+C;break}};DWREngine._lookup=function(E,C,A){var D;for(var B=0;B<E.length;B++){if(E[B].data==C){D=E[B];break}}if(D){return"reference:"+D.name}E.push({data:C,name:A});return null};DWREngine._serializeObject=function(C,H,G,B){var F=DWREngine._lookup(H,G,B);if(F){return F}if(G.nodeName&&G.nodeType){return DWREngine._serializeXml(C,H,G,B)}var E="Object:{";var D;for(D in G){C.paramCount++;var A="c"+DWREngine._batch.map.callCount+"-e"+C.paramCount;DWREngine._serializeAll(C,H,G[D],A);E+=encodeURIComponent(D)+":reference:"+A+", "}if(E.substring(E.length-2)==", "){E=E.substring(0,E.length-2)}E+="}";return E};DWREngine._serializeXml=function(C,F,E,B){var D=DWREngine._lookup(F,E,B);if(D){return D}var A;if(window.XMLSerializer){A=new XMLSerializer().serializeToString(E)}else{A=E.toXml}return"XML:"+encodeURIComponent(A)};DWREngine._serializeArray=function(C,H,G,B){var F=DWREngine._lookup(H,G,B);if(F){return F}var E="Array:[";for(var D=0;D<G.length;D++){if(D!=0){E+=","}C.paramCount++;var A="c"+DWREngine._batch.map.callCount+"-e"+C.paramCount;DWREngine._serializeAll(C,H,G[D],A);E+="reference:";E+=A}E+="]";return E};DWREngine._unserializeDocument=function(A){var C;if(window.DOMParser){var E=new DOMParser();C=E.parseFromString(A,"text/xml");if(!C.documentElement||C.documentElement.tagName=="parsererror"){var B=C.documentElement.firstChild.data;B+="\n"+C.documentElement.firstChild.nextSibling.firstChild.data;throw B}return C}else{if(window.ActiveXObject){C=DWREngine._newActiveXObject(DWREngine._DOMDocument);C.loadXML(A);return C}else{var D=document.createElement("div");D.innerHTML=A;return D}}};DWREngine._newActiveXObject=function(A){var D;for(var C=0;C<A.length;C++){try{D=new ActiveXObject(A[C]);break}catch(B){}}return D};if(typeof window.encodeURIComponent==="undefined"){DWREngine._utf8=function(B){B=""+B;var E;var D;var A="";var C=0;while(C<B.length){E=B.charCodeAt(C++);if(E>=56320&&E<57344){continue}if(E>=55296&&E<56320){if(C>=B.length){continue}D=B.charCodeAt(C++);if(D<56320||E>=56832){continue}E=((E-55296)<<10)+(D-56320)+65536}if(E<128){A+=String.fromCharCode(E)}else{if(E<2048){A+=String.fromCharCode(192+(E>>6),128+(E&63))}else{if(E<65536){A+=String.fromCharCode(224+(E>>12),128+(E>>6&63),128+(E&63))}else{A+=String.fromCharCode(240+(E>>18),128+(E>>12&63),128+(E>>6&63),128+(E&63))}}}}return A};DWREngine._hexchars="0123456789ABCDEF";DWREngine._toHex=function(A){return DWREngine._hexchars.charAt(A>>4)+DWREngine._hexchars.charAt(A&15)};DWREngine._okURIchars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-";window.encodeURIComponent=function(C){C=DWREngine._utf8(C);var D;var A="";for(var B=0;B<C.length;B++){if(DWREngine._okURIchars.indexOf(C.charAt(B))==-1){A+="%"+DWREngine._toHex(C.charCodeAt(B))}else{A+=C.charAt(B)}}return A}}if(typeof Array.prototype.splice==="undefined"){Array.prototype.splice=function(C,B){if(arguments.length==0){return C}if(typeof C!="number"){C=0}if(C<0){C=Math.max(0,this.length+C)}if(C>this.length){if(arguments.length>2){C=this.length}else{return[]}}if(arguments.length<2){B=this.length-C}B=(typeof B=="number")?Math.max(0,B):0;removeArray=this.slice(C,C+B);endArray=this.slice(C+B);this.length=C;for(var A=2;A<arguments.length;A++){this[this.length]=arguments[A]}for(A=0;A<endArray.length;A++){this[this.length]=endArray[A]}return removeArray}}if(typeof Array.prototype.shift==="undefined"){Array.prototype.shift=function(C){var B=this[0];for(var A=1;A<this.length;++A){this[A-1]=this[A]}this.length--;return B}}if(typeof Array.prototype.unshift==="undefined"){Array.prototype.unshift=function(){var B=unshift.arguments.length;for(var A=this.length-1;A>=0;--A){this[A+B]=this[A]}for(A=0;A<B;++A){this[A]=unshift.arguments[A]}}}if(typeof Array.prototype.push==="undefined"){Array.prototype.push=function(){var B=this.length;for(var A=0;A<push.arguments.length;++A){this[B]=push.arguments[A];B++}}}if(typeof Array.prototype.pop==="undefined"){Array.prototype.pop=function(){var A=this[this.length-1];this.length--;return A}}LMI.AjaxController=(function(){function G(I,H){if(typeof D==="function"){D.apply(this,arguments)}}var F,B,E,D,C="mapping",A={getNearestRouteSegment:function(J,H,I){DWREngine._execute(F,C,"getNearestRouteSegment",J,H.lat,H.lng,I,B,E)},findClosestPoint:function(L,H,I){var K=[],J=[];LMI.Lang.forEach(I,function(M){K.push(M.lat);J.push(M.lng)});DWREngine._execute(F,C,"findClosestPoint",L,{lat:H.lat,lng:H.lng,lats:K,lngs:J},B,E)},editListingNote:function(J,I,H){DWREngine._execute(F,C,"editListingNote",J,I,H,B,E)},saveSavedLocation:function(L,K,I,H,J){DWREngine._execute(F,C,"saveSavedLocation",L,K,I,H,J,B,E)},saveSavedLocationLatLng:function(N,M,J,H,L,I,K){DWREngine._execute(F,C,"saveSavedLocation",N,M,J,H,L,I,K,B,E)},getSearchCount:function(M,J,L,H,K,I){DWREngine._execute(F,C,"getSearchCount",M,J,L,H,K,I,B,E)},getNeighborhoodSearchCount:function(J,I,H){DWREngine._execute(F,C,"getNeighborhoodSearchCount",J,{what:I,neighborhood:H},B,E)},getMapSearchCount:function(P,N,L,M,O,H,J,K,I){I=I||-1;DWREngine._execute(F,C,"getMapSearchCount",P,N,L,M,O,H,J,K,I,B,E)},getSearchResults:function(I,H){DWREngine._execute(F,C,"getSearchResults",I,H,B,E)},getListingDetails:function(I,H){DWREngine._execute(F,C,"getListingDetails",I,H,B,E)},addToMyList:function(J,H,I){DWREngine._execute(F,C,"addToMyList",J,H,I,B,E)},getPois:function(J,H,I){DWREngine._execute(F,C,"getPois",J,H,I,B,E)},getNearbySavedLocations:function(I,H){DWREngine._execute(F,C,"getNearbySavedLocations",I,H,B,E)},getRouteImageUrl:function(L,J,I,H,K){DWREngine._execute(F,C,"getRouteImageUrl",L,J,I,H,K,B,E,"png")},getPrintRouteImageUrl:function(L,J,I,H,K){DWREngine._execute(F,C,"getRouteImageUrl",L,J,I,H,K,B,E,"gif")},removeSavedLocations:function(I,H){DWREngine._execute(F,C,"removeSavedLocations",I,H,B,E)},submitReview:function(I,H){DWREngine._execute(F,C,"submitReview",I,H,B,E)},reportAbuse:function(I,H){DWREngine._execute(F,C,"reportAbuse",I,H,B,E)},getNeighborhoodData:function(I,H){DWREngine._execute(F,C,"getNeighborhoodData",I,{name:H},B,E)},setVisitorPreference:function(K,H,I,J){DWREngine._execute(F,C,"setVisitorPreference",K,B,E,H,I,(J?"SESSION":"VISITOR"))},validateUniqueSavedLocationName:function(I,H){DWREngine._execute(F,C,"validateUniqueSavedLocationName",I,H,B,E)},saveItinerary:function(M,L,I,H,K,J){DWREngine._execute(F,C,"saveItinerary",M,L,I,H,K,J,B,E)},getPath:function(){return F},getClassName:function(){return C},setMessageHandler:function(H){D=H},handleMessage:G};LMI.Init.addFunction(function(){F=LMI.Data.Urls.dwr;B=LMI.Lang.getObject("LMI.Data.state.visitorVO.uid");E=LMI.Lang.getObject("LMI.Data.state.visitorVO.passwordToken");DWREngine.setErrorHandler(G);DWREngine.setWarningHandler(G)});return A})();(function(){var B=LMI.AjaxController,F,C,E,D="mapping";LMI.Init.addFunction(function(){F=LMI.Data.Urls.dwr;C=LMI.Lang.getObject("LMI.Data.state.visitorVO.uid");E=LMI.Lang.getObject("LMI.Data.state.visitorVO.passwordToken")});B.getSearchResults=function(G,A){DWREngine._execute(F,D,"getSearchResultsED",G,A,C,E)};B.getPois=function(I,A,G){var H={category:[A],boundingBox:{bottomLeftLatitude:G[0],bottomLeftLongitude:G[1],topRightLatitude:G[2],topRightLongitude:G[3]}};DWREngine._execute(F,D,"getMapPois",I,H,C,E)};B.reverseGeocode=function(I,H,A){var G={latitude:H,longitude:A};DWREngine._execute(F,D,"reverseGeocode",I,G,C,E)}})();