(function(){LMI.Animation=function(){this.init();};LMI.Animation.prototype={init:function(){this.thread=null;this.currentFrame=0;this.totalFrames=0;this.fps=24;this.duration=1;this.delay=1;this.initEvents('tween','end');},setDuration:function(d){this.duration=d;},start:function(){if(this.thread===null){this.totalFrames=Math.ceil(this.fps*this.duration);this.currentFrame=0;this.skip=false;this.droppedFrames=0;var o=this;this.thread=setInterval(function(){o.run();},o.delay);this.start=new Date().getTime();}},stop:function(){if(this.thread!==null){clearInterval(this.thread);this.thread=null;var o=this.getEventObject();this.triggerEvent('end',o,this);}},skipToEnd:function(){this.skip=true;},catchUp:function(){var time=new Date().getTime()-this.start,adjust=0,d=this.duration*1000,t=this.totalFrames,f=this.currentFrame;var expected=t*(time/d);if(time>d||this.skip){adjust=t-f;}else if(expected>f){adjust=Math.ceil(expected-f);}
if(adjust>0){adjust=this.currentFrame+adjust<t?adjust:t-f;this.droppedFrames+=adjust;this.currentFrame+=adjust;}},run:function(){if(this.currentFrame<this.totalFrames){this.catchUp();this.doFrame();this.currentFrame++;}else{this.doFrame();this.stop();}},doFrame:function(){this.triggerEvent('tween',{currentFrame:this.currentFrame,totalFrames:this.totalFrames},this);},getEventObject:function(){return{dropped:this.droppedFrames,endedEarly:this.skip};}};LMI.Lang.importFunctions(LMI.Animation,LMI.Event);})();(function(){LMI.Animation.Motion=function(element,start,end){this.init(element,start,end);};LMI.Lang.extend(LMI.Animation.Motion,LMI.Animation);var L=LMI.Animation.Motion,proto=L.prototype,superclass=L.superclass;proto.init=function(element,start,end){superclass.init.call(this);this.element=element;this.startPos=start;this.endPos=end;this.easingMethod=LMI.Animation.Easing.easeOutStrong;};proto.setEasingMethod=function(method){this.easingMethod=method;};proto.doFrame=function(){var t=this.easingMethod(this.currentFrame,1,100,this.totalFrames)/100;var b=LMI.Animation.Bezier.getPosition([this.startPos,this.endPos],t);this.setProperties(b);superclass.doFrame.call(this);};proto.setProperties=function(p){this.element.style.left=Math.floor(p.x)+'px';this.element.style.top=Math.floor(p.y)+'px';};})();(function(){LMI.Animation.Size=function(element,start,end){this.init(element,start,end);};LMI.Lang.extend(LMI.Animation.Size,LMI.Animation.Motion);var L=LMI.Animation.Size,proto=L.prototype;proto.setProperties=function(p){this.element.style.width=Math.floor(p.x)+'px';this.element.style.height=Math.floor(p.y)+'px';};})();(function(){LMI.Animation.Fade=function(element,start,end){this.init(element,{x:start,y:0},{x:end,y:0});};LMI.Lang.extend(LMI.Animation.Fade,LMI.Animation.Motion);var L=LMI.Animation.Fade,proto=L.prototype,superclass=L.superclass;proto.setProperties=function(p){LMI.StyleSheet.setOpacity(this.element,p.x);};})();LMI.Animation.Bezier=(function(){return{getPosition:function(coords,t){var i,j,n=coords.length,r=[];for(i=0;i<n;++i){r.push({x:coords[i].x,y:coords[i].y});}
for(j=1;j<n;++j){for(i=0;i<n-j;++i){r[i].x=(1-t)*r[i].x+t*r[i+1].x;r[i].y=(1-t)*r[i].y+t*r[i+1].y;}}
return r[0];}};})();LMI.Animation.Easing=(function(){return{easeOut:function(t,b,c,d){return-c*(t/=d)*(t-2)+b;},easeOutStrong:function(t,b,c,d){return-c*((t=t/d-1)*t*t*t-1)+b;},easeBothStrong:function(t,b,c,d){if((t/=d/2)<1){return c/2*t*t*t*t+b;}
return-c/2*((t-=2)*t*t*t-2)+b;},bounceOut:function(t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b;}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+0.75)+b;}else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+0.9375)+b;}else{return c*(7.5625*(t-=(2.625/2.75))*t+0.984375)+b;}},elasticOut:function(t,b,c,d,a,p){if(t===0){return b;}
if((t/=d)==1){return b+c;}
if(!p){p=d*0.5;}
if(!a||a<Math.abs(c)){a=c;var s=p/4;}
else{s=p/(2*Math.PI)*Math.asin(c/a);}
return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b;}};})();(function(){var M=LMI.Mapping;M.InteractiveMap=function(container,options){this.init(container,options);};LMI.Lang.extend(M.InteractiveMap,M.Map);var proto=M.InteractiveMap.prototype,superclass=M.InteractiveMap.superclass;M.InteractiveMap.Defaults={'enableOverview':true,'enableResize':true,'overviewWidth':150,'overviewHeight':150};proto.init=function(){superclass.init.apply(this,arguments);this.scales=M.Map.getScales();this.easingMethod=LMI.Animation.Easing.easeOutStrong;this.animationDuration=1;if(this.getOption('enableResize')){if(LMI.Browser.browser==='Explorer'&&LMI.Browser.version<7){this.container.style.overflow='hidden';}
LMI.BrowserEvent.bind(window,'resize',this,this.resizeLayers);}};proto.initOptions=function(options){var i,o=M.InteractiveMap.Defaults;if(options){for(i in options){o[i]=options[i];}}
superclass.initOptions.call(this,o);};proto.initContainer=function(){superclass.initContainer.apply(this,arguments);this.mapDragger=new DSInteraction.Drag(this.mapLayer,{disable:true});this.mapDragger.bindEvent('startDrag',this,this.startDrag);this.mapDragger.bindEvent('drag',this,this.drag);this.mapDragger.bindEvent('endDrag',this,this.endDrag);};proto.initSlideObject=function(){if(this.slideObject){this.slideObject.skipToEnd();}};proto.getSlideObject=function(b,e){var l=this.mapLayer,s=l.style,a=new LMI.Animation.Motion(l,b,e);this.slideObject=a;a.bindEvent('tween',this,this.checkWrap);a.setDuration(this.animationDuration);a.setEasingMethod(this.easingMethod);return a;};proto.isSlideDistanceValid=function(b,e){var xLimit=this.width*3,yLimit=this.height*3;return(Math.abs(b.x-e.x)<xLimit)&&(Math.abs(b.y-e.y)<yLimit);};proto.slideToPoint=function(p){this.initSlideObject();var c=this.getCenterPoint();if(c&&!p.equals(c)){var oldxy=this.getMapLayerCenterXY();var newxy=this.getMapLayerXYByPoint(p);var b=this.getMapLayerULXY();var e=new Coord(b.x-(newxy.x-oldxy.x),b.y-(newxy.y-oldxy.y));if(this.isSlideDistanceValid(b,e)){this.prepareEventObject();this.setCenterPoint(p);var a=this.getSlideObject(b,e);a.bindEvent('end',this,this.endSlide);a.start();}else{this.centerOnPoint(p);}}};proto.slideBy=function(x,y){this.initSlideObject();var l=this.mapLayer,s=l.style,b=this.getMapLayerULXY();e=new Coord(b.x+x,b.y+y);var a=this.getSlideObject(b,e);a.bindEvent('end',this,this.endSlideBy);a.start();};proto.endSlide=function(e){this.slideObject=null;var o=this.getEventObject();if(e.endedEarly){o.endedEarly=true;}
this.triggerEvent('recenter',o,this);};proto.endSlideBy=function(e){this.recalculateCenterPoint();this.endSlide(e);};proto.setEasingMethod=function(method){this.easingMethod=method;};proto.enableDragging=function(){LMI.StyleSheet.addClass(this.container,'dsMapDraggable');this.mapDragger.enable();if(!this.dblclick){this.dblclick=LMI.BrowserEvent.bind(this.viewport,'dblclick',this,this.centerOnClick);}};proto.startDrag=function(){this.recalcCenter=false;LMI.StyleSheet.addClass(this.container,'dsMapDragging');this.prepareEventObject();};proto.endDrag=function(){if(this.recalcCenter){this.recalculateCenterPoint();}
LMI.StyleSheet.removeClass(this.container,'dsMapDragging');var o=this.getEventObject();this.triggerEvent('recenter',o,this);};proto.drag=function(){this.recalcCenter=true;this.checkWrap();};proto.centerOnClick=function(e){if(e.getCtrlKey()&&e.getAltKey()){this.setEasingMethod(LMI.Animation.Easing.bounceOut);if(this.overviewMap){this.overviewMap.setEasingMethod(LMI.Animation.Easing.bounceOut);}}
var xy=LMI.Element.getOffsets(this.viewport);this.slideBy((this.width/2)-(e.getPageX()-xy.x),(this.height/2)-(e.getPageY()-xy.y));e.stopPropagation();};proto.addControls=function(type){var o,t,el,s,i,p;if(!type){type=M.Controls.getLargeControls(this.getOption('imageBase'));}
if(type.zoom){t=type.zoom.zoomIn;this.addDecorator(new DSMapControl(this,t[0],t[1],'zoom','Zoom In',t[2]));t=type.zoom.zoomOut;this.zoomOut=new DSMapControl(this,t[0],t[1],'zoom','Zoom Out',t[2]);this.addDecorator(this.zoomOut);el=this.zoomOut.getElement();this.zoomOut.origTop=parseFloat(LMI.StyleSheet.getStyle(el,'top'));this.zoomOut.origBottom=this.zoomOut.origTop+el.offsetHeight;if(type.zoom.slider&&type.zoom.thumb){t=type.zoom.slider;s=new DSMapDecorator(this,LMI.Element.create('img',null),t[1],'zoom','Zoom Slider');LMI.Element.setImageSrc(s.getElement(),t[0]);t=type.zoom.thumb;i=new DSMapDecorator(this,LMI.Element.create('img',null),t[1],'zoom','Zoom Thumb');LMI.Element.setImageSrc(i.getElement(),t[0]);this.zoomSlider=new DSControls.DSSlider(s.getElement(),i.getElement());this.zoomSlider.decorators=[s,i];this.zoomSlider.bindEvent('slide',this,this.scaleMap);this.zoomSlider.bindEvent('startSlide',this,this.startZoom);this.zoomSlider.bindEvent('endSlide',this,this.endZoom);if(this.viewport.offsetHeight-this.getOption('controlBuffer')>this.zoomOut.origBottom){this.addDecorator(s);this.addDecorator(i);this.zoomSlider.shown=true;}else{this.zoomOut.getElement().style.top=s.position.top+'px';}}}
p=type.misc;for(var j=0;j<p.length;++j){this.addDecorator(new DSMapControl(this,p[j][0],p[j][3],p[j][1],p[j][2],p[j][4]));}
o=type.options;if(o){if(o.dragging){this.enableDragging();}
if(this.getOption('enableOverview')&&o.overview){this.overviewMap=new M.OverviewMap(this,this.options);}}};proto.startZoom=function(e){this.zooming={mapCenter:this.getCenterPoint(),left:parseInt(this.mapLayer.style.left,10),top:parseInt(this.mapLayer.style.top,10),leftAdjusted:this.getMapLeft(),topAdjusted:this.getMapTop()};LMI.StyleSheet.addClass(this.zoomSlider.decorators[1].element,'dsMapDragging');this.hideObjects();this.scaleMap(e);};proto.endZoom=function(e){var p=e.position;this.showObjects();LMI.StyleSheet.removeClass(this.zoomSlider.decorators[1].element,'dsMapDragging');this.setZoomLevel(Math.round(p*(this.scales.length-1))+1,this.zooming.mapCenter);this.zooming=null;};proto.zoomIn=function(){this.setZoomLevel(this.zoomLevel-1);};proto.zoomOut=function(){this.setZoomLevel(this.zoomLevel+1);};proto.panNorth=function(){this.slideBy(0,0.45*this.height);};proto.panNorthEast=function(){this.slideBy(-0.45*this.width,0.45*this.height);};proto.panNorthWest=function(){this.slideBy(0.45*this.width,0.45*this.height);};proto.panSouth=function(){this.slideBy(0,-0.45*this.height);};proto.panSouthEast=function(){this.slideBy(-0.45*this.width,-0.45*this.height);};proto.panSouthWest=function(e){this.slideBy(0.45*this.width,-0.45*this.height);};proto.panEast=function(){this.slideBy(-0.45*this.width,0);};proto.panWest=function(){this.slideBy(0.45*this.width,0);};proto.wrapNorth=function(){this.mlOffsetTop-=this.getOption('tileHeight');this.setGridTop(this.getGridTop()-1);for(var i=0;i<this.columns;++i){var t=this.tiles.pop();this.tiles.unshift(t);t.setUrl(this.tileUrlFactory.getUrl(this.getGridLeft()+((this.columns-1)-i),this.getGridTop(),this.zoomLevel));}
this.updateMap();};proto.wrapSouth=function(){this.mlOffsetTop+=this.getOption('tileHeight');for(var i=0;i<this.columns;++i){var t=this.tiles.shift();this.tiles.push(t);t.setUrl(this.tileUrlFactory.getUrl(this.getGridLeft()+i,this.getGridTop()+this.rows,this.zoomLevel));}
this.setGridTop(this.getGridTop()+1);this.updateMap();};proto.wrapWest=function(){this.mlOffsetLeft-=this.getOption('tileWidth');this.setGridLeft(this.getGridLeft()-1);for(var i=1;i<=this.rows;++i){var c=this.columns*i-1;var t=this.tiles.splice(c,1)[0];this.tiles.splice(c-this.columns+1,0,t);t.setUrl(this.tileUrlFactory.getUrl(this.getGridLeft(),this.getGridTop()+(i-1),this.zoomLevel));}
this.updateMap();};proto.wrapEast=function(){this.mlOffsetLeft+=this.getOption('tileWidth');for(var i=0;i<this.rows;++i){var c=this.columns*i;var t=this.tiles.splice(c,1)[0];this.tiles.splice(c+this.columns-1,0,t);t.setUrl(this.tileUrlFactory.getUrl(this.getGridLeft()+this.columns,this.getGridTop()+i,this.zoomLevel));}
this.setGridLeft(this.getGridLeft()+1);this.updateMap();};proto.checkWrap=function(){var self=this;window.setTimeout(function(){var l=self.getMapLeft();var t=self.getMapTop();var tw2=self.getOption('tileWidth')/2;var th2=self.getOption('tileHeight')/2;if(t>-th2){self.wrapNorth();}else if((t+self.mapLayerHeight-self.height)<th2){self.wrapSouth();}
if(l>-tw2){self.wrapWest();}else if((l+self.mapLayerWidth-self.width)<tw2){self.wrapEast();}},0);};proto.resizeLayers=function(){var o={oldWidth:this.width,oldHeight:this.height,zoomLevel:this.zoomLevel};this.sizeLayers();if(o.oldWidth!=this.width||o.height!=this.height){var p=this.recalculateCenterPoint();o.center=this.getCenterPoint();o.newWidth=this.width;o.newHeight=this.height;while(this.desiredColumns>this.columns){this.appendColumn();}
while(this.desiredColumns<this.columns){this.removeColumn();}
while(this.desiredRows>this.rows){this.appendRow();}
while(this.desiredRows<this.rows){this.removeRow();}
this.triggerEvent('resize',o,this);this.updateTiles();this.resizeControls();}};proto.resizeControls=function(){var size=this.viewport.offsetHeight-this.getOption('controlBuffer');if(this.zoomSlider){if(!this.zoomSlider.shown&&size>this.zoomOut.origBottom){this.zoomOut.getElement().style.top=this.zoomOut.position.top+'px';this.addDecorator(this.zoomSlider.decorators[0]);this.addDecorator(this.zoomSlider.decorators[1]);this.zoomSlider.shown=true;this.zoomSlider.setPosition(((this.zoomLevel-1)/(this.scales.length-1)));}else if(this.zoomSlider.shown&&size<=this.zoomOut.origBottom){this.removeDecorator(this.zoomSlider.decorators[0]);this.removeDecorator(this.zoomSlider.decorators[1]);this.zoomOut.getElement().style.top=this.zoomSlider.decorators[0].position.top+'px';this.zoomSlider.shown=false;}}};proto.appendRow=function(){var r=this.rows++;for(var i=0;i<this.columns;++i){var t=new M.Tile(this,this.tileLayer);t.setUrl(this.tileUrlFactory.getUrl(this.getGridLeft()+i,this.getGridTop()+r,this.zoomLevel));this.tiles.push(t);}};proto.removeRow=function(){this.rows--;var c=this.tiles.length-this.columns;while(this.tiles.length>c){var i=this.tiles.length-1;this.tiles[i].removeFromDom();this.tiles.splice(i,1);}};proto.appendColumn=function(){var c=this.columns++;for(var i=0;i<this.rows;++i){var n=(c*(1+i))+i;var t=new M.Tile(this,this.tileLayer);t.setUrl(this.tileUrlFactory.getUrl(this.getGridLeft()+c,this.getGridTop()+i,this.zoomLevel));this.tiles.splice(n,0,t);}};proto.removeColumn=function(){var c=this.columns--;for(var i=this.tiles.length-1;i>0;i-=c){this.tiles[i].removeFromDom();this.tiles.splice(i,1);}};proto.showObjects=function(){for(var it=new DSMapObject_Iterator(this.objects);it.hasNext();){var o=it.next();o.element.style.visibility='visible';}};proto.hideObjects=function(){for(var it=new DSMapObject_Iterator(this.objects);it.hasNext();){var o=it.next();o.element.style.visibility='hidden';}};proto.scaleMap=function(e){var p=e.position;var lvl=(p*(this.scales.length-1))+1;var intLvl=Math.round(lvl+0.5);var decLvl=lvl-intLvl;var nl=intLvl-1>0?intLvl-1:1;var ns=this.scales[intLvl-1]+((this.scales[intLvl-1]-this.scales[nl-1])*decLvl);if(ns>0){var h=this.getOption('tileHeight');var w=this.getOption('tileWidth');var r=this.scale/ns;var th=Math.round(h*r);var tw=Math.round(w*r);var ol=((Math.abs(this.zooming.leftAdjusted)+(this.width/2))/w);var ot=((Math.abs(this.zooming.topAdjusted)+(this.height/2))/h);this.mapLayer.style.left=Math.round(this.zooming.left+((w-tw)*ol))+'px';this.mapLayer.style.top=Math.round(this.zooming.top+((h-th)*ot))+'px';for(var i=0;i<this.tiles.length;++i){this.tiles[i].setSize(tw,th);this.positionTile(i);}}};})();function DSMapControl(map,src,pos,type,name,events){var i=LMI.Element.create('img',null,{title:name,alt:name});LMI.StyleSheet.addClass(i,'control');LMI.Element.setImageSrc(i,src);DSMapControl.superclass.init.call(this,map,i,pos,type,name);this.events=events;this.addEventHandlers();};LMI.Lang.extend(DSMapControl,DSMapDecorator);DSMapControl.prototype.addEventHandlers=function(){for(var i in{click:'',dblclick:'',mousedown:''}){if(typeof this.events[i]=='function'){if(i==='click'){LMI.StyleSheet.addClass(this.element,'dsMapClickable');}
LMI.BrowserEvent.bind(this.element,i,this.map,this.events[i]);}else{LMI.BrowserEvent.preventEvent(this.element,i);}}};LMI.Mapping.Controls={};LMI.Mapping.Controls.getLargeControls=function(imageBase){if(typeof imageBase=='undefined'){imageBase=LMI.Mapping.Map.Defaults.imageBase;}
var M=LMI.Mapping.InteractiveMap.prototype,o={left:10,top:10,zIndex:100};return{zoom:{zoomIn:[imageBase+'map_zoom_in.png',{left:o.left+25,top:o.top+86,zIndex:o.zIndex,width:24,height:23},{click:M.zoomIn}],zoomOut:[imageBase+'map_zoom_out.png',{left:o.left+25,top:o.top+277,zIndex:o.zIndex,width:24,height:22},{click:M.zoomOut}],slider:[imageBase+'map_zoom_slider.png',{left:o.left+25,top:o.top+111,zIndex:o.zIndex,width:24,height:162}],thumb:[imageBase+'map_zoom_thumb.png',{left:o.left+21,top:o.top+205,zIndex:o.zIndex+1,width:30,height:17}]},misc:[[imageBase+'map_pan_n.png','pan','Pan North',{left:o.left+26,top:o.top,zIndex:o.zIndex,width:19,height:27},{click:M.panNorth}],[imageBase+'map_pan_ne.png','pan','Pan North-East',{left:o.left+45,top:o.top+8,zIndex:o.zIndex,width:19,height:19},{click:M.panNorthEast}],[imageBase+'map_pan_nw.png','pan','Pan North-West',{left:o.left+7,top:o.top+8,zIndex:o.zIndex,width:19,height:19},{click:M.panNorthWest}],[imageBase+'map_pan_s.png','pan','Pan South',{left:o.left+26,top:o.top+46,zIndex:o.zIndex,width:19,height:29},{click:M.panSouth}],[imageBase+'map_pan_se.png','pan','Pan South-East',{left:o.left+44,top:o.top+46,zIndex:o.zIndex,width:19,height:19},{click:M.panSouthEast}],[imageBase+'map_pan_sw.png','pan','Pan South-West',{left:o.left+9,top:o.top+46,zIndex:o.zIndex,width:17,height:17},{click:M.panSouthWest}],[imageBase+'map_pan_e.png','pan','Pan East',{left:o.left+45,top:o.top+27,zIndex:o.zIndex,width:28,height:19},{click:M.panEast}],[imageBase+'map_pan_w.png','pan','Pan West',{left:o.left,top:o.top+27,zIndex:o.zIndex,width:26,height:19},{click:M.panWest}],[imageBase+'map_pan_center.png','pan','Best Fit',{left:o.left+26,top:o.top+27,zIndex:o.zIndex,width:19,height:19},{click:LMI.Mapping.Map.prototype.bestFit}]],options:{overview:true,dragging:true}};};LMI.Mapping.Controls.getSmallControls=function(imageBase){if(typeof imageBase=='undefined'){imageBase=LMI.Mapping.Map.Defaults.imageBase;}
var M=LMI.Mapping.InteractiveMap.prototype,o={left:10,top:10,zIndex:100};return{zoom:{zoomIn:[imageBase+'small_map_controls/map_zoom_in.gif',{left:o.left+19,top:o.top+63,zIndex:o.zIndex,width:15,height:14},{click:M.zoomIn}],zoomOut:[imageBase+'small_map_controls/map_zoom_out.gif',{left:o.left+19,top:o.top+197,zIndex:o.zIndex,width:15,height:14},{click:M.zoomOut}],slider:[imageBase+'small_map_controls/map_zoom_slider.gif',{left:o.left+19,top:o.top+82,zIndex:o.zIndex,width:15,height:110}],thumb:[imageBase+'small_map_controls/map_zoom_thumb.png',{left:o.left+15,top:o.top+193,zIndex:o.zIndex+1,width:21,height:11}]},misc:[[imageBase+'small_map_controls/map_pan_n.gif','pan','Pan North',{left:o.left+19,top:o.top,zIndex:o.zIndex,width:15,height:19},{click:M.panNorth}],[imageBase+'small_map_controls/map_pan_ne.gif','pan','Pan North-East',{left:o.left+33,top:o.top+8,zIndex:o.zIndex,width:12,height:12},{click:M.panNorthEast}],[imageBase+'small_map_controls/map_pan_nw.gif','pan','Pan North-West',{left:o.left+8,top:o.top+8,zIndex:o.zIndex,width:12,height:12},{click:M.panNorthWest}],[imageBase+'small_map_controls/map_pan_s.gif','pan','Pan South',{left:o.left+19,top:o.top+34,zIndex:o.zIndex,width:15,height:19},{click:M.panSouth}],[imageBase+'small_map_controls/map_pan_se.gif','pan','Pan South-East',{left:o.left+33,top:o.top+33,zIndex:o.zIndex,width:12,height:12},{click:M.panSouthEast}],[imageBase+'small_map_controls/map_pan_sw.gif','pan','Pan South-West',{left:o.left+8,top:o.top+33,zIndex:o.zIndex,width:12,height:12},{click:M.panSouthWest}],[imageBase+'small_map_controls/map_pan_e.gif','pan','Pan East',{left:o.left+34,top:o.top+19,zIndex:o.zIndex,width:19,height:15},{click:M.panEast}],[imageBase+'small_map_controls/map_pan_w.gif','pan','Pan West',{left:o.left,top:o.top+19,zIndex:o.zIndex,width:19,height:15},{click:M.panWest}],[imageBase+'small_map_controls/map_pan_center.gif','pan','Best Fit',{left:o.left+19,top:o.top+19,zIndex:o.zIndex,width:15,height:15},{click:LMI.Mapping.Map.prototype.bestFit}]],options:{overview:false,dragging:true}};};(function(){var M=LMI.Mapping;M.OverviewMap=function(map,options){this.init(map,options);};LMI.Lang.extend(M.OverviewMap,M.InteractiveMap);var proto=M.OverviewMap.prototype,superclass=M.OverviewMap.superclass;M.OverviewMap.Defaults={};proto.init=function(map,options){this.parentMap=map;options.enableResize=false;var w=options.overviewWidth;var h=options.overviewHeight;this.gutter=LMI.Element.create('div',map.decoratorLayer,{style:'width:'+(w+7)+'px;height:'+(h+7)+'px'});LMI.StyleSheet.addClass(this.gutter,'gutter');var mapCont=LMI.Element.create('div',this.gutter,{style:'width:'+w+'px;height:'+h+'px'});superclass.init.call(this,mapCont,options);LMI.StyleSheet.addClass(mapCont,'dsOverview');this.setCopyright('');this.initEvents('collapse','expand');this.watchParent();this.expanded=true;this.addControls(M.Controls.getOverviewControls(this.getOption('imageBase')));this.collapseControl=this.decorators.getByType('collapse')[0];this.bindEvent('recenter',this,this.updateParent);};proto.initOptions=function(options){var i,o=M.OverviewMap.Defaults;if(options){for(i in options){o[i]=options[i];}}
superclass.initOptions.call(this,o);};proto.watchParent=function(){if(this.parentMap.getCenterPoint()){this.update();}
if(!this.parentEvents){this.parentEvents={};}
for(var e in{recenter:1,zoom:1,resize:1}){if(!this.parentEvents[e]){this.parentEvents[e]=this.parentMap.bindEvent(e,this,this.update);}}};proto.stopWatchingParent=function(){if(this.parentEvents){for(var e in this.parentEvents){if(this.parentEvents[e]){this.parentMap.removeEventListener(this.parentEvents[e]);this.parentEvents[e]=null;}}}};proto.updateDataCopyright=function(){};proto.update=function(e){var w,h,o,m=this.parentMap,l=m.zoomLevel,s=m.getScale(l),fitFactor=0.4;while(++l<=this.scales.length){var r=s/this.getScale(l);w=m.width*r;h=m.height*r;if(w<(this.width*fitFactor)&&h<(this.height*fitFactor)){break;}}
if(w&&h&&l<=this.scales.length){if(this.outline){this.outline.setWidth(w);this.outline.setHeight(h);this.positionObject(this.outline,m.getULPoint());}else{o=this.outline=new DSOutline(m.getULPoint(),w,h);this.outlineDragger=new DSInteraction.Drag(this.outline.element);this.outlineDragger.bindEvent('startDrag',this,this.outlineGrab);this.outlineDragger.bindEvent('endDrag',this,this.outlineDrop);}}else{if(this.outline){this.removeObject(this.outline);this.outline=null;}
l=this.scales.length;}
if(l!==this.zoomLevel||(typeof e!=='undefined'&&e.endedEarly)||this.getCenterPoint()===null){this.centerAndZoom(m.getCenterPoint(),l);}else if(!m.getCenterPoint().equals(this.getCenterPoint())){this.slideToPoint(m.getCenterPoint());}
if(o){this.addObject(o);}};proto.updateParent=function(e){this.parentMap.slideToPoint(e.center);};proto.outlineGrab=function(dragEvt,e){var el=e.element;LMI.StyleSheet.addClass(el,'dsMapDragging');};proto.outlineDrop=function(dragEvt,e){var el=e.element;LMI.StyleSheet.removeClass(el,'dsMapDragging');var xy=new Coord(dragEvt.elementEndPosition.x,dragEvt.elementEndPosition.y),p=this.getPointByMapLayerXY(xy.x,xy.y);this.positionObject(this.outline,p);xy.x+=parseInt(LMI.StyleSheet.getStyle(this.outline.element,'width'),10)/2;xy.y+=parseInt(LMI.StyleSheet.getStyle(this.outline.element,'height'),10)/2;this.parentMap.slideToPoint(this.getPointByMapLayerXY(xy.x,xy.y));};proto.getSizeObject=function(b,e){var a;if(this.sizeAnimation){this.sizeAnimation.bindEvent('end',this,this.toggleExpandState);this.sizeAnimation.skipToEnd();return null;}
a=this.sizeAnimation=new LMI.Animation.Size(this.container,b,e);a.bindEvent('tween',this,this.resizing);a.bindEvent('end',this,this.endSizing);a.setEasingMethod(this.expanded?LMI.Animation.Easing.bounceOut:LMI.Animation.Easing.elasticOut);return a;};proto.resizing=function(e){var pos=e.currentFrame/e.totalFrames,gap=this.expanded?Math.floor(pos*7):7-Math.floor(pos*7);this.gutter.style.width=(this.container.offsetWidth+gap)+'px';this.gutter.style.height=(this.container.offsetHeight+gap)+'px';this.viewport.style.width=this.decoratorLayer.style.width=LMI.StyleSheet.getStyle(this.container,'width');this.viewport.style.height=this.decoratorLayer.style.height=LMI.StyleSheet.getStyle(this.container,'height');};proto.endSizing=function(){this.sizeAnimation=null;if(!this.expanded){LMI.StyleSheet.addClass(this.gutter,'collapsed');}else{var w=LMI.StyleSheet.getStyle(this.container,'width'),h=LMI.StyleSheet.getStyle(this.container,'height');this.gutter.style.width=(parseInt(w,10)+7)+'px';this.gutter.style.height=(parseInt(h,10)+7)+'px';this.viewport.style.width=this.decoratorLayer.style.width=w;this.viewport.style.height=this.decoratorLayer.style.height=h;}};proto.toggleExpandState=function(){var b,e,evt;if(this.expanded){b=new Coord(this.width,this.height);e=new Coord(12,12);LMI.Element.setImageSrc(this.collapseControl.getElement(),this.getOption('imageBase')+'map_expand.png');evt='collapse';this.stopWatchingParent();}else{LMI.StyleSheet.removeClass(this.gutter,'collapsed');e=new Coord(this.width,this.height);b=new Coord(12,12);LMI.Element.setImageSrc(this.collapseControl.getElement(),this.getOption('imageBase')+'map_collapse.png');evt='expand';this.watchParent();}
var a=this.getSizeObject(b,e);if(a){a.start();this.expanded=!this.expanded;this.triggerEvent(evt,{},this);}};M.Controls.getOverviewControls=function(imageBase){if(typeof imageBase==='undefined'){imageBase=LMI.Mapping.Map.Defaults.imageBase;}
return{misc:[[imageBase+'map_collapse.png','collapse','Expand/Collapse',{right:0,top:0,zIndex:100,width:11,height:11},{click:proto.toggleExpandState}]],options:{overview:false,dragging:true}};};})();