/*
 COPYRIGHT 2009 ESRI

 TRADE SECRETS: ESRI PROPRIETARY AND CONFIDENTIAL
 Unpublished material - all rights reserved under the
 Copyright Laws of the United States and applicable international
 laws, treaties, and conventions.

 For additional information, contact:
 Environmental Systems Research Institute, Inc.
 Attn: Contracts and Legal Services Department
 380 New York Street
 Redlands, California, 92373
 USA

 email: contracts@esri.com
 */

window[esri._dojoScopeName||"dojo"]._xdResourceLoaded(function(_1,_2,_3){return {depends:[["provide","esri.map"],["require","esri._coremap"],["require","esri.touchcontainer"],["require","dijit.form.HorizontalSlider"],["require","dijit.form.VerticalSlider"],["require","dijit.form.HorizontalRule"],["require","dijit.form.VerticalRule"],["require","dijit.form.HorizontalRuleLabels"],["require","dijit.form.VerticalRuleLabels"],["require","esri.layers.agsdynamic"],["require","esri.layers.agstiled"],["require","esri.layers.agsimageservice"]],defineResource:function(_4,_5,_6){if(!_4._hasResource["esri.map"]){_4._hasResource["esri.map"]=true;_4.provide("esri.map");_4.require("esri._coremap");if(esri.isTouchEnabled){_4.require("esri.touchcontainer");}else{_4.declare("esri._MapContainer",esri._CoreMap,(function(){var dc=_4.connect,_7=_4.disconnect,dh=_4.hitch,_8=_4.mixin,_9=_4.isMozilla,_a=_4.stopEvent,_b=_4.fixEvent,_c=esri.geometry.Point;var _d=navigator.userAgent.indexOf("Macintosh")!==-1?1:3,_e=_4.isChrome<2?360:120,_f=1,_10=1,_11=300;return {constructor:function(_12){_8(this,{_dragEnd:false,_clickDuration:_11,_downCoords:null,_clickTimer:null,_onKeyDown_connect:null,_onKeyUp_connect:null,_onMouseDragHandler_connect:null});var _13=this.__container,_14=this._connects;_14.push(dc(_13,"onselectstart",function(evt){_a(evt);return false;}),dc(_13,"ondragstart",function(evt){_a(evt);return false;}));if(_9){_4.style(_13,"MozUserSelect","none");}_14.push(dc(_13,"onmouseenter",this,"_onMouseEnterHandler"),dc(_13,"onmouseleave",this,"_onMouseLeaveHandler"),dc(_13,"onmousedown",this,"_onMouseDownHandler"),dc(_13,"onclick",this,"_onClickHandler"),dc(_13,"ondblclick",this,"_onDblClickHandler"));this.enableMouseWheel(false);this._onMouseMoveHandler_connect=dc(_13,"onmousemove",this,"_onMouseMoveHandler");this._onMouseUpHandler_connect=dc(_13,"onmouseup",this,"_onMouseUpHandler");this._processEvent=dh(this,this._processEvent);this._fireClickEvent=dh(this,this._fireClickEvent);},_cleanUp:function(){_7(this._onMouseMoveHandler_connect);_7(this._onMouseUpHandler_connect);_7(this._onMouseDragHandler_connect);_7(this._scrollHandle);var _15=this._connects,i;for(i=_15.length;i>=0;i--){_7(_15[i]);delete _15[i];}this.inherited("_cleanUp",arguments);},_processEvent:function(evt){evt=_b(evt,evt.target);if(evt.type==="DOMMouseScroll"&&_4.isFF<3){evt.screenPoint=new _c(window.scrollX+evt.screenX-this.position.x,window.scrollY+evt.screenY-this.position.y);}else{evt.screenPoint=new _c(evt.pageX-this.position.x,evt.pageY-this.position.y);}evt.mapPoint=this.extent?this.toMap(evt.screenPoint):new _c();return evt;},_onMouseEnterHandler:function(evt){_7(this._onKeyDown_connect);_7(this._onKeyUp_connect);this._onKeyDown_connect=dc(document,"onkeydown",this,"_onKeyDownHandler");this._onKeyUp_connect=dc(document,"onkeyup",this,"_onKeyUpHandler");this.onMouseOver(this._processEvent(evt));},_onMouseLeaveHandler:function(evt){_7(this._onKeyDown_connect);_7(this._onKeyUp_connect);this.onMouseOut(this._processEvent(evt));},_onMouseMoveHandler:function(evt){if(this._dragEnd){this._dragEnd=false;return;}this.onMouseMove(this._processEvent(evt));},_onMouseDownHandler:function(evt){_7(this._onMouseMoveHandler_connect);var _16=this.__container;if(_16.setCapture){_16.setCapture(false);}this._onMouseDragHandler_connect=dc(document,"onmousemove",this,"_onMouseDragHandler");evt=this._processEvent(evt);this._downCoords=evt.screenPoint.x+","+evt.screenPoint.y;this.onMouseDown(evt);},_onMouseUpHandler:function(evt){var _17=this.__container;if(_17.releaseCapture){_17.releaseCapture();}evt=this._processEvent(evt);_7(this._onMouseDragHandler_connect);_7(this._onMouseMoveHandler_connect);this._onMouseMoveHandler_connect=dc(_17,"onmousemove",this,"_onMouseMoveHandler");this.onMouseUp(evt);},_onMouseDragHandler:function(evt){_7(this._onMouseDragHandler_connect);this._onMouseDragHandler_connect=dc(document,"onmousemove",this,"_onMouseDraggingHandler");_7(this._onMouseUpHandler_connect);this._onMouseUpHandler_connect=dc(document,"onmouseup",this,"_onDragMouseUpHandler");this._docLeaveConnect=dc(document,"onmouseout",this,"_onDocMouseOut");this.onMouseDragStart(this._processEvent(evt));},_onDocMouseOut:function(evt){var _18=evt.relatedTarget,_19=evt.relatedTarget&&evt.relatedTarget.nodeName.toLowerCase();if(!_18||(_4.isChrome&&_19==="html")){this._onDragMouseUpHandler(evt);}},_onMouseDraggingHandler:function(evt){this.onMouseDrag(this._processEvent(evt));_4.stopEvent(evt);},_onDragMouseUpHandler:function(evt){var _1a=this.__container;if(_1a.releaseCapture){_1a.releaseCapture();}this._dragEnd=true;evt=this._processEvent(evt);this.onMouseDragEnd(evt);_7(this._docLeaveConnect);_7(this._onMouseDragHandler_connect);_7(this._onMouseUpHandler_connect);this._onMouseMoveHandler_connect=dc(_1a,"onmousemove",this,"_onMouseMoveHandler");this._onMouseUpHandler_connect=dc(_1a,"onmouseup",this,"_onMouseUpHandler");this.onMouseUp(evt);},_onClickHandler:function(evt){evt=this._processEvent(evt);if(this._downCoords!==(evt.screenPoint.x+","+evt.screenPoint.y)){return;}clearTimeout(this._clickTimer);this._clickEvent=_8({},evt);this._clickTimer=setTimeout(this._fireClickEvent,this._clickDuration);},_fireClickEvent:function(){clearTimeout(this._clickTimer);if(_4.isIE<9){var GL=esri.layers.GraphicsLayer;this._clickEvent.graphic=GL._clicked;delete GL._clicked;}this.onClick(this._clickEvent);},_onDblClickHandler:function(evt){clearTimeout(this._clickTimer);this.onDblClick(this._processEvent(evt));},_onMouseWheelHandler:function(evt){if(this.__canStopSWEvt()){_4.stopEvent(evt);}evt=this._processEvent(evt);var _1b=_4.isIE||_4.isWebKit?evt.wheelDelta/_e:-evt.detail/_d,_1c=Math.abs(_1b);if(_1c<=_f){_1c=_f;}else{_1c=_10;}evt.value=_1b<0?-_1c:_1c;this.onMouseWheel(evt);},__canStopSWEvt:function(){},_onKeyDownHandler:function(evt){this.onKeyDown(evt);},_onKeyUpHandler:function(evt){this.onKeyUp(evt);},__setClickDuration:function(dur){this._clickDuration=dur;},__resetClickDuration:function(){this._clickDuration=_11;},enableMouseWheel:function(_1d){_7(this._scrollHandle);this._scrollHandle=dc(this.__container,(_4.isFF||_9)?(_1d?"MozMousePixelScroll":"DOMMouseScroll"):"onmousewheel",this,this._onMouseWheelHandler);},onMouseOver:function(){},onMouseMove:function(){},onMouseOut:function(){},onMouseDown:function(){},onMouseDragStart:function(){},onMouseDrag:function(){},onMouseDragEnd:function(){},onMouseUp:function(){},onClick:function(){},onDblClick:function(){},onMouseWheel:function(){},onKeyDown:function(){},onKeyUp:function(){}};}()));}_4.require("dijit.form.HorizontalSlider");_4.require("dijit.form.VerticalSlider");_4.require("dijit.form.HorizontalRule");_4.require("dijit.form.VerticalRule");_4.require("dijit.form.HorizontalRuleLabels");_4.require("dijit.form.VerticalRuleLabels");_4.declare("esri.Map",esri._MapContainer,(function(){var _1e=30,_1f=100,_20=30,_21=10,_22=1,_23=-1,_24=_4.mouseButtons.LEFT,_25={up:"panUp",right:"panRight",down:"panDown",left:"panLeft"},_26={upperRight:"panUpperRight",lowerRight:"panLowerRight",lowerLeft:"panLowerLeft",upperLeft:"panUpperLeft"};var dc=_4.connect,ddc=_4.disconnect,dcr=_4.create,ds=_4.style,dh=_4.hitch,abs=Math.abs,_27=_4.coords,_28=_4.deprecated,dk=_4.keys,_29=_4.mixin,_2a=esri.geometry.Rect,_2b=esri.geometry.Point,_2c=esri.geometry.Extent;var _2d=[dk.NUMPAD_PLUS,61,dk.NUMPAD_MINUS,dk.UP_ARROW,dk.NUMPAD_8,dk.RIGHT_ARROW,dk.NUMPAD_6,dk.DOWN_ARROW,dk.NUMPAD_2,dk.LEFT_ARROW,dk.NUMPAD_4,dk.PAGE_UP,dk.NUMPAD_9,dk.PAGE_DOWN,dk.NUMPAD_3,dk.END,dk.NUMPAD_1,dk.HOME,dk.NUMPAD_7];return {constructor:function(_2e,_2f){_29(this,{_dragOrigin:null,_slider:null,_navDiv:null,_zoomRect:null,_mapParams:_29({slider:true,nav:false,logo:true,sliderStyle:"default"},_2f||{}),_zoom:0,_keyboardPanDx:0,_keyboardPanDy:0});_29(this,{_onLoadHandler_connect:null,_panHandler_connect:null,_panStartHandler_connect:null,_upPanHandler_connect:null,_dblClickZoomHandler_connect:null,_recenterZoomHandler_connect:null,_recenterHandler_connect:null,_downPanHandler_connect:null,_downZoomHandler_connect:null,_keyNavigatingHandler_connect:null,_keyNavigationEndHandler_connect:null,_scrollZoomHandler_connect:null,_zoomHandler_connect:null,_upZoomHandler_connect:null});_29(this,{isDoubleClickZoom:false,isShiftDoubleClickZoom:false,isClickRecenter:false,isScrollWheelZoom:false,isPan:false,isRubberBandZoom:false,isKeyboardNavigation:false,isPanArrows:false,isZoomSlider:false});if(_4.isFunction(esri._css)){esri._css=esri._css(this._mapParams.force3DTransforms);this.force3DTransforms=this._mapParams.force3DTransforms;}var _30=(esri._hasTransforms&&esri._hasTransitions);this.navigationMode=this._mapParams.navigationMode||(_30&&"css-transforms")||"classic";if(this.navigationMode==="css-transforms"&&!_30){this.navigationMode="classic";}this.fadeOnZoom=esri._isDefined(this._mapParams.fadeOnZoom)?this._mapParams.fadeOnZoom:(this.navigationMode==="css-transforms");if(this.navigationMode!=="css-transforms"){this.fadeOnZoom=false;}this._zoomRect=new esri.Graphic(null,new esri.symbol.SimpleFillSymbol(esri.config.defaults.map.zoomSymbol));this.setMapCursor("default");this.smartNavigation=_2f&&_2f.smartNavigation;if(!esri._isDefined(this.smartNavigation)&&_4.isMac&&!esri.isTouchEnabled&&!(_4.isFF<=3.5)){var _31=navigator.userAgent.match(/Mac\s+OS\s+X\s+([\d]+)(\.|\_)([\d]+)\D/i);if(_31&&esri._isDefined(_31[1])&&esri._isDefined(_31[3])){var _32=parseInt(_31[1],10),_33=parseInt(_31[3],10);this.smartNavigation=((_32>10)||(_32===10&&_33>=6));}}this._onLoadHandler_connect=dc(this,"onLoad",this,"_onLoadInitNavsHandler");if(this._mapParams.logo){var _34={right:(this._mapParams.nav?"25px":"")};if(_4.isIE===6){_34.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled='true', sizingMethod='crop', src='"+_4.moduleUrl("esri","../../images/map/logo-med.png")+"')";}var _35=this._ogol=dcr("div",{style:_34},this.root);if((this.root.clientWidth*this.root.clientHeight)<250000){_4.addClass(_35,"logo-sm");}else{_4.addClass(_35,"logo-med");}if(!esri.isTouchEnabled){this._ogol_connect=dc(_35,"onclick",this,"_openLogoLink");}}if(esri.isTouchEnabled){this._panInitEvent="onTouchStart";this._zoomInitEvent="onGestureStart";}else{this._panInitEvent="onMouseDown";this._zoomInitEvent="onMouseDown";}},_cleanUp:function(){this.disableMapNavigation();var i;for(i=this._connects.length;i>=0;i--){ddc(this._connects[i]);delete this._connects[i];}ddc(this._slider_connect);ddc(this._ogol_connect);var _36=this._slider;if(_36&&_36.destroy){_36.destroy();}var _37=this._navDiv;if(_37){_4.destroy(_37);}this.inherited("_cleanUp",arguments);},_normalizeRect:function(evt){var xy=evt.screenPoint,dx=this._dragOrigin.x,dy=this._dragOrigin.y,_38=new _2a((xy.x<dx?xy.x:dx)-this.__visibleRect.x,(xy.y<dy?xy.y:dy)-this.__visibleRect.y,abs(xy.x-dx),abs(xy.y-dy));if(_38.width===0){_38.width=1;}if(_38.height===0){_38.height=1;}return _38;},_downZoomHandler:function(evt){if(evt.button===_24&&evt.shiftKey&&this.isRubberBandZoom){this._dragOrigin=_29({},evt.screenPoint);this.setCursor("crosshair");this._zoomHandler_connect=dc(this,"onMouseDrag",this,"_zoomHandler");this._upZoomHandler_connect=dc(this,"onMouseUp",this,"_upZoomHandler");if(evt.ctrlKey){this._zoom=_23;}else{this._zoom=_22;}if(_4.isChrome){evt.preventDefault();}}},_zoomHandler:function(evt){var _39=this._normalizeRect(evt).offset(this.__visibleRect.x,this.__visibleRect.y),g=this.graphics,_3a=this._zoomRect;if(!_3a.geometry){this.setCursor("crosshair");}if(_3a.geometry){g.remove(_3a,true);}var tl=this.toMap(new _2b(_39.x,_39.y)),br=this.toMap(new _2b(_39.x+_39.width,_39.y+_39.height));_39=new _2a(tl.x,tl.y,br.x-tl.x,tl.y-br.y);_39._originOnly=true;_3a.setGeometry(_39);g.add(_3a,true);},_upZoomHandler:function(evt){var _3b=this._zoomRect;ddc(this._zoomHandler_connect);ddc(this._upZoomHandler_connect);if(this._canZoom(this._zoom)&&_3b.getDojoShape()){this.graphics.remove(_3b);_3b.geometry=null;var _3c=this._normalizeRect(evt);_3c.x+=this.__visibleRect.x;_3c.y+=this.__visibleRect.y;var _3d;if(this._zoom===_23){var _3e=this.extent.getWidth(),_3f=(_3e*this.width)/_3c.width,_40=(_3f-_3e)/2,ext=this.extent;_3d=new _2c(ext.xmin-_40,ext.ymin-_40,ext.xmax+_40,ext.ymax+_40,this.spatialReference);}else{var min=this.toMap({x:_3c.x,y:(_3c.y+_3c.height)}),max=this.toMap({x:(_3c.x+_3c.width),y:_3c.y});_3d=new _2c(min.x,min.y,max.x,max.y,this.spatialReference);}this._extentUtil(null,null,_3d);}if(_3b.getDojoShape()){this.graphics.remove(_3b,true);}this._zoom=0;this.resetMapCursor();},_downPanHandler:function(evt){if(evt.button===_24&&!evt.shiftKey&&this.isPan){this._dragOrigin=new _2b(0,0);_29(this._dragOrigin,evt.screenPoint);this._panHandler_connect=dc(this,"onMouseDrag",this,"_panHandler");this._panStartHandler_connect=dc(this,"onMouseDragStart",this,"_panStartHandler");this._upPanHandler_connect=dc(this,"onMouseUp",this,"_upPanHandler");if(_4.isChrome){evt.preventDefault();}}},_panStartHandler:function(evt){this.setCursor("move");this.__panStart(evt.screenPoint.x,evt.screenPoint.y);},_panHandler:function(evt){this.__pan(evt.screenPoint.x-this._dragOrigin.x,evt.screenPoint.y-this._dragOrigin.y);},_upPanHandler:function(evt){ddc(this._panHandler_connect);ddc(this._panStartHandler_connect);ddc(this._upPanHandler_connect);if(this.__panning){this.__panEnd(evt.screenPoint.x-this._dragOrigin.x,evt.screenPoint.y-this._dragOrigin.y);this.resetMapCursor();}},_isPanningOrZooming:function(){return this.__panning||this.__zooming;},_recenterHandler:function(evt){if(evt.shiftKey&&!this._isPanningOrZooming()){this.centerAt(evt.mapPoint);}},_recenterZoomHandler:function(evt){if(evt.shiftKey&&!this._isPanningOrZooming()){evt.value=evt.ctrlKey?-1:1;this._scrollZoomHandler(evt,true);}},_dblClickZoomHandler:function(evt){if(!this._isPanningOrZooming()){evt.value=1;this._scrollZoomHandler(evt,true);}},_canZoom:function(_41){if(!this.__tileInfo){return true;}var _42=this.getLevel(),_43=this.getNumLevels();if((_42===0&&_41<0)||(_42===_43-1&&_41>0)){return false;}return true;},_scrollZoomHandler:function(evt,_44){if(!_44){if(this.smartNavigation&&!evt.shiftKey&&!this._isPanningOrZooming()){this.disableScrollWheelZoom();this._setScrollWheelPan(true);this._scrollPanHandler(evt);return;}var _45=evt.timeStamp;if(!esri._isDefined(_45)||_45<=0){_45=(new Date()).getTime();}var _46=this._ts?(_45-this._ts):_45;if(_46<_1f){return;}this._ts=_45;}if(!this._canZoom(evt.value)){return;}this._extentUtil({numLevels:evt.value,mapAnchor:evt.mapPoint,screenAnchor:evt.screenPoint});},_scrollPanHandler:function(evt){if(evt.shiftKey&&!this._isPanningOrZooming()){this._setScrollWheelPan(false);this.enableScrollWheelZoom();this._scrollZoomHandler(evt);return;}var dx=0,dy=0;if(_4.isFF){if(evt.axis===evt.HORIZONTAL_AXIS){dx=-evt.detail;}else{dy=-evt.detail;}}else{dx=evt.wheelDeltaX;dy=evt.wheelDeltaY;}this.translate(dx,dy);},_keyNavigatingHandler:function(evt){var kc=evt.keyCode;if(_4.indexOf(_2d,kc)!==-1){if(kc===dk.NUMPAD_PLUS||kc===61){this._extentUtil({numLevels:1});}else{if(kc===dk.NUMPAD_MINUS){this._extentUtil({numLevels:-1});}else{if(!this.__panning){this.__panStart(0,0);}switch(kc){case dk.UP_ARROW:case dk.NUMPAD_8:this._keyboardPanDy+=_21;break;case dk.RIGHT_ARROW:case dk.NUMPAD_6:this._keyboardPanDx-=_21;break;case dk.DOWN_ARROW:case dk.NUMPAD_2:this._keyboardPanDy-=_21;break;case dk.LEFT_ARROW:case dk.NUMPAD_4:this._keyboardPanDx+=_21;break;case dk.PAGE_UP:case dk.NUMPAD_9:this._keyboardPanDx-=_21;this._keyboardPanDy+=_21;break;case dk.PAGE_DOWN:case dk.NUMPAD_3:this._keyboardPanDx-=_21;this._keyboardPanDy-=_21;break;case dk.END:case dk.NUMPAD_1:this._keyboardPanDx+=_21;this._keyboardPanDy-=_21;break;case dk.HOME:case dk.NUMPAD_7:this._keyboardPanDx+=_21;this._keyboardPanDy+=_21;break;default:return;}this.__pan(this._keyboardPanDx,this._keyboardPanDy);}}_4.stopEvent(evt);}},_keyNavigationEndHandler:function(evt){if(this.__panning&&(evt.keyCode!==dk.SHIFT)){this.__panEnd(this._keyboardPanDx,this._keyboardPanDy);this._keyboardPanDx=this._keyboardPanDy=0;}},_onLoadInitNavsHandler:function(){this.enableMapNavigation();this._createNav();if(this._mapParams.sliderStyle==="small"||!this._createSlider){this._createSimpleSlider();}else{this._createSlider();}ddc(this._onLoadHandler_connect);},_createNav:function(){if(this._mapParams.nav){var div,v,i,_47=_4.addClass,id=this.id;this._navDiv=dcr("div",{id:id+"_navdiv"},this.root);_47(this._navDiv,"navDiv");var w2=this.width/2,h2=this.height/2,wh;for(i in _25){v=_25[i];div=dcr("div",{id:id+"_pan_"+i},this._navDiv);_47(div,"fixedPan "+v);if(i==="up"||i==="down"){wh=parseInt(_27(div).w,10)/2;ds(div,{left:(w2-wh)+"px",zIndex:_1e});}else{wh=parseInt(_27(div).h,10)/2;ds(div,{top:(h2-wh)+"px",zIndex:_1e});}this._connects.push(dc(div,"onclick",dh(this,this[v])));}this._onMapResizeNavHandler_connect=dc(this,"onResize",this,"_onMapResizeNavHandler");for(i in _26){v=_26[i];div=dcr("div",{id:id+"_pan_"+i,style:{zIndex:_1e}},this._navDiv);_47(div,"fixedPan "+v);this._connects.push(dc(div,"onclick",dh(this,this[v])));}this.isPanArrows=true;}},_onMapResizeNavHandler:function(_48,wd,ht){var id=this.id,w2=wd/2,h2=ht/2,_49=_4.byId,i,div,wh;for(i in _25){div=_49(id+"_pan_"+i);if(i==="up"||i==="down"){wh=parseInt(_27(div).w,10)/2;ds(div,"left",(w2-wh)+"px");}else{wh=parseInt(_27(div).h,10)/2;ds(div,"top",(h2-wh)+"px");}}},_createSimpleSlider:function(){if(this._mapParams.slider){var _4a=(this._slider=dcr("div",{id:this.id+"_zoom_slider","class":"esriSimpleSlider",style:"z-index: "+_20+";"}));_4.addClass(_4a,esri.config.defaults.map.slider.width?"esriSimpleSliderHorizontal":"esriSimpleSliderVertical");var _4b=dcr("div",{"class":"esriSimpleSliderIncrementButton"},_4a);_4b.innerHTML="+";var _4c=dcr("div",{"class":"esriSimpleSliderDecrementButton"},_4a);_4c.innerHTML="-";if(_4.isIE<8){_4.addClass(_4c,"dj_ie67Fix");}this._connects.push(dc(_4b,"onclick",this,this._simpleSliderChangeHandler));this._connects.push(dc(_4c,"onclick",this,this._simpleSliderChangeHandler));this.root.appendChild(_4a);this.isZoomSlider=true;}},_simpleSliderChangeHandler:function(evt){var _4d=(evt.currentTarget.className.indexOf("IncrementButton")!==-1)?true:false;this._extentUtil({numLevels:_4d?1:-1});},_createSlider:function(){if(this._mapParams.slider){var div=dcr("div",{id:this.id+"_zoom_slider"},this.root),_4e=esri.config.defaults.map,_4f=_4e.slider.width,_50=_4f?_5.form.HorizontalSlider:_5.form.VerticalSlider,_51=_4.toJson(_29({position:"absolute"},_4e.slider)),_52=this.getNumLevels(),_53=_5.form,i,il,_54;_51=_51.substring(1,_51.length-1).split("\"").join("").split(",").join(";");if(_52>0){var _55,_56,_57,_58,_59,_5a=_4e.sliderLabel;if(_5a){var _5b=_4f?_53.HorizontalRule:_53.VerticalRule,_5c=_4f?_53.HorizontalRuleLabels:_53.VerticalRuleLabels,_5d=_4f?"topDecoration":"rightDecoration",_5e=_4f?"height:"+_5a.tick+"px":"width:"+_5a.tick+"px";_59=_5a.labels;if(_59===null){_59=[];for(i=0,il=_52;i<il;i++){_59[i]="";}}_55=dcr("div");div.appendChild(_55);_56=new _5b({container:_5d,count:_52,style:_5e},_55);_57=dcr("div");div.appendChild(_57);_58=new _5c({container:_5d,count:_52,labels:_59,style:_5a.style},_57);_55=_57=null;}_54=(this._slider=new _50({id:div.id,minimum:0,maximum:_52-1,discreteValues:_52,value:this.getLevel(),clickSelect:true,intermediateChanges:true,style:_51+"; z-index:"+_20+";"},div));_54.startup();if(_5a){_56.startup();_58.startup();}this._slider_connect=dc(_54,"onChange",this,"_onSliderChangeHandler");this._connects.push(dc(this,"onExtentChange",this,"_onExtentChangeSliderHandler"));this._connects.push(dc(_54._movable,"onFirstMove",this,"_onSliderMoveStartHandler"));}else{_54=(this._slider=new _50({id:div.id,minimum:0,maximum:2,discreteValues:3,value:1,clickSelect:true,intermediateChanges:_4e.sliderChangeImmediate,style:_51+" height:100px; z-index:"+_20+";"},div));var _5f=_54.domNode.firstChild.childNodes;for(i=1;i<=3;i++){ds(_5f[i],"visibility","hidden");}_54.startup();this._slider_connect=dc(_54,"onChange",this,"_onDynSliderChangeHandler");this._connects.push(dc(this,"onExtentChange",this,"_onExtentChangeDynSliderHandler"));}_4.forEach(_54._connects,function(_60){var _61=_60[0],_62=_61&&_61[0],_63=_62&&_62.className;if(_63&&(_63.indexOf("dijitSliderIncrementIcon")>=0||_63.indexOf("dijitSliderDecrementIcon")>=0)){_4.forEach(_60,ddc);}});var _64=_54.incrementButton,_65=_54.decrementButton;_64.style.outline="none";_65.style.outline="none";_54._connects.push([dc(_64,"onmousedown",_54,function(e){this._typematicCallback(1,_64,e);}),dc(_65,"onmousedown",_54,function(e){this._typematicCallback(1,_65,e);})]);_54.sliderHandle.style.outline="none";_54._onKeyPress=function(){};var _66=_54._movable;if(_66){var _67=_66.onMouseDown;_66.onMouseDown=function(e){if(_4.isIE<9&&e.button!==1){return;}_67.apply(this,arguments);};}this.isZoomSlider=true;}},_onSliderMoveStartHandler:function(){ddc(this._slider_connect);ddc(this._slidermovestop_connect);this._slider_connect=dc(this._slider,"onChange",this,"_onSliderChangeDragHandler");this._slidermovestop_connect=dc(this._slider._movable,"onMoveStop",this,"_onSliderMoveEndHandler");},_onSliderChangeDragHandler:function(_68){this._extentUtil({targetLevel:_68});},_onSliderMoveEndHandler:function(){ddc(this._slider_connect);ddc(this._slidermovestop_connect);},_onSliderChangeHandler:function(_69){this.setLevel(_69);},_updateSliderValue:function(_6a,_6b){ddc(this._slider_connect);var _6c=this._slider;var _6d=_6c._onChangeActive;_6c._onChangeActive=false;_6c.set("value",_6a);_6c._onChangeActive=_6d;this._slider_connect=dc(_6c,"onChange",this,_6b);},_onExtentChangeSliderHandler:function(_6e,_6f,_70,lod){ddc(this._slidermovestop_connect);this._updateSliderValue(lod.level,"_onSliderChangeHandler");},_onDynSliderChangeHandler:function(_71){this._extentUtil({numLevels:_71>0?1:-1});},_onExtentChangeDynSliderHandler:function(){this._updateSliderValue(1,"_onDynSliderChangeHandler");},_openLogoLink:function(evt){window.open(esri.config.defaults.map.logoLink,"_blank");_4.stopEvent(evt);},enableMapNavigation:function(){this.enableDoubleClickZoom();this.enableClickRecenter();this.enablePan();this.enableRubberBandZoom();this.enableKeyboardNavigation();if(this.smartNavigation){this._setScrollWheelPan(true);}else{this.enableScrollWheelZoom();}},disableMapNavigation:function(){this.disableDoubleClickZoom();this.disableClickRecenter();this.disablePan();this.disableRubberBandZoom();this.disableKeyboardNavigation();this.disableScrollWheelZoom();if(this.smartNavigation){this._setScrollWheelPan(false);}},enableDoubleClickZoom:function(){if(!this.isDoubleClickZoom){this._dblClickZoomHandler_connect=dc(this,"onDblClick",this,"_dblClickZoomHandler");this.isDoubleClickZoom=true;}},disableDoubleClickZoom:function(){if(this.isDoubleClickZoom){ddc(this._dblClickZoomHandler_connect);this.isDoubleClickZoom=false;}},enableShiftDoubleClickZoom:function(){if(!this.isShiftDoubleClickZoom){_28(this.declaredClass+": "+esri.bundle.map.deprecateShiftDblClickZoom,null,"v2.0");this._recenterZoomHandler_connect=dc(this,"onDblClick",this,"_recenterZoomHandler");this.isShiftDoubleClickZoom=true;}},disableShiftDoubleClickZoom:function(){if(this.isShiftDoubleClickZoom){_28(this.declaredClass+": "+esri.bundle.map.deprecateShiftDblClickZoom,null,"v2.0");ddc(this._recenterZoomHandler_connect);this.isShiftDoubleClickZoom=false;}},enableClickRecenter:function(){if(!this.isClickRecenter){this._recenterHandler_connect=dc(this,"onClick",this,"_recenterHandler");this.isClickRecenter=true;}},disableClickRecenter:function(){if(this.isClickRecenter){ddc(this._recenterHandler_connect);this.isClickRecenter=false;}},enablePan:function(){if(!this.isPan){this._downPanHandler_connect=dc(this,this._panInitEvent,this,"_downPanHandler");this.isPan=true;}},disablePan:function(){if(this.isPan){ddc(this._downPanHandler_connect);this.isPan=false;}},enableRubberBandZoom:function(){if(!this.isRubberBandZoom){this._downZoomHandler_connect=dc(this,this._zoomInitEvent,this,"_downZoomHandler");this.isRubberBandZoom=true;}},disableRubberBandZoom:function(){if(this.isRubberBandZoom){ddc(this._downZoomHandler_connect);this.isRubberBandZoom=false;}},enableKeyboardNavigation:function(){if(!this.isKeyboardNavigation){this._keyNavigatingHandler_connect=dc(this,"onKeyDown",this,"_keyNavigatingHandler");this._keyNavigationEndHandler_connect=dc(this,"onKeyUp",this,"_keyNavigationEndHandler");this.isKeyboardNavigation=true;}},disableKeyboardNavigation:function(){if(this.isKeyboardNavigation){ddc(this._keyNavigatingHandler_connect);ddc(this._keyNavigationEndHandler_connect);this.isKeyboardNavigation=false;}},enableScrollWheelZoom:function(){if(!this.isScrollWheelZoom){this._scrollZoomHandler_connect=dc(this,"onMouseWheel",this,"_scrollZoomHandler");this.isScrollWheelZoom=true;}},__canStopSWEvt:function(){return this.isScrollWheelZoom||this.isScrollWheelPan;},disableScrollWheelZoom:function(){if(this.isScrollWheelZoom){ddc(this._scrollZoomHandler_connect);this.isScrollWheelZoom=false;}},_setScrollWheelPan:function(_72){this.isScrollWheelPan=_72;this.enableMouseWheel(_72);ddc(this._mwMacHandle);if(_72){this._mwMacHandle=dc(this,"onMouseWheel",this,this._scrollPanHandler);}},showPanArrows:function(){if(this._navDiv){esri.show(this._navDiv);this.isPanArrows=true;}},hidePanArrows:function(){if(this._navDiv){esri.hide(this._navDiv);this.isPanArrows=false;}},showZoomSlider:function(){if(this._slider){ds(this._slider.domNode||this._slider,"visibility","visible");this.isZoomSlider=true;}},hideZoomSlider:function(){if(this._slider){ds(this._slider.domNode||this._slider,"visibility","hidden");this.isZoomSlider=false;}}};}()));_4.require("esri.layers.agsdynamic");_4.require("esri.layers.agstiled");_4.require("esri.layers.agsimageservice");if(esri.isTouchEnabled){_4.extend(esri.Map,(function(){var dc=_4.connect,ddc=_4.disconnect,_73=esri.geometry.Point,_74=esri.geometry.getLength,_75=esri.TileUtils.getCandidateTileInfo;return {_multiTouchTapZoomHandler:function(evt){if(!this._isPanningOrZooming()){evt.value=-1;this._scrollZoomHandler(evt,true);}},_downPanHandler:function(evt){var _76=this._zoomAnim||this._panAnim;if(_76&&_76._active){_76.stop();_76._fire("onEnd",[_76.node]);}this._dragOrigin=new _73(0,0);_4.mixin(this._dragOrigin,evt.screenPoint);ddc(this._panHandler_connect);ddc(this._upPanHandler_connect);this._panHandler_connect=dc(this,"onTouchMove",this,this._panHandler);this._upPanHandler_connect=dc(this,"onTouchEnd",this,this._upPanHandler);},_panHandler:function(evt){evt.preventDefault();if(this.__panning){this._panX=evt.screenPoint.x;this._panY=evt.screenPoint.y;this.__pan(evt.screenPoint.x-this._dragOrigin.x,evt.screenPoint.y-this._dragOrigin.y);}else{this.setCursor("move");this.__panStart(evt.screenPoint.x,evt.screenPoint.y);}},_upPanHandler:function(evt){ddc(this._panHandler_connect);ddc(this._upPanHandler_connect);if(this.__panning){this.__panEnd(evt.screenPoint.x-this._dragOrigin.x,evt.screenPoint.y-this._dragOrigin.y);this.resetMapCursor();}},_downZoomHandler:function(evt){var _77=this._zoomAnim||this._panAnim;if(_77&&_77._active){_77.stop();_77._fire("onEnd",[_77.node]);}else{if(this.__panning){evt.screenPoint=new _73(this._panX,this._panY);evt.mapPoint=this.toMap(evt.screenPoint);this._upPanHandler(evt);}}ddc(this._zoomHandler_connect);ddc(this._upZoomHandler_connect);this._zoomHandler_connect=dc(this,"onGestureChange",this,this._zoomHandler);this._upZoomHandler_connect=dc(this,"onGestureEnd",this,this._upZoomHandler);},_zoomHandler:function(evt){if(evt.screenPoints){evt.preventDefault();this.currLength=_74(evt.screenPoints[0],evt.screenPoints[1]);if(this.__zooming){var _78=this.currLength/this._length;this._zoomStartExtent=this.__scaleExtent(this.extent,_78,this._dragOrigin);this.__zoom(this._zoomStartExtent,_78,this._dragOrigin);}else{this._dragOrigin=new _73((evt.screenPoints[0].x+evt.screenPoints[1].x)/2,(evt.screenPoints[0].y+evt.screenPoints[1].y)/2);this._length=this.currLength;this.__zoomStart(this.extent,this._dragOrigin);}this._fireOnScale(this.currLength/this._length,this._dragOrigin,true);}},_upZoomHandler:function(evt){ddc(this._zoomHandler_connect);ddc(this._upZoomHandler_connect);if(evt.processMultiTouchTap){this._multiTouchTapZoomHandler(evt);evt.preventDefault();}else{if(this.__zooming&&this._zoomAnim===null){var _79=this.currLength/this._length,_7a=this.extent.getWidth();this._zoomAnimAnchor=this.toMap(this._dragOrigin);this._zoomStartExtent=this.__scaleExtent(this.extent,1/_79,this._zoomAnimAnchor);if(this.__tileInfo){var ct=_75(this,this.__tileInfo,this._zoomStartExtent),_7b=this.__getExtentForLevel(ct.lod.level,this._zoomAnimAnchor),_7c=this.getNumLevels()-1,_7d=_7b.extent,_7e=_7b.lod,_7f=_7a/_7d.getWidth(),_80=ct.lod.level;if(_79<1){if(_7f>_79){_80--;}}else{if(_7f<_79){_80++;}}if(_80<0){_80=0;}else{if(_80>_7c){_80=_7c;}}if(_80!==ct.lod.level){_7b=this.__getExtentForLevel(_80,this._zoomAnimAnchor);_7d=_7b.extent;_7e=_7b.lod;}this._zoomEndExtent=_7d;this._zoomEndLod=_7e;this._zoomAnim=esri.fx.animateRange({range:{start:(_7a/this._zoomStartExtent.getWidth()),end:_7f},duration:esri.config.defaults.map.zoomDuration,rate:esri.config.defaults.map.zoomRate,onAnimate:_4.hitch(this,"_adjustZoomHandler"),onEnd:_4.hitch(this,"_adjustZoomEndHandler")}).play();this._fireOnScale(this.extent.getWidth()/this._zoomEndExtent.getWidth(),this._dragOrigin);}else{this._zoomEndExtent=this._zoomStartExtent;this._fireOnScale(this.extent.getWidth()/this._zoomEndExtent.getWidth(),this._dragOrigin);this._adjustZoomEndHandler();}}}},_adjustZoomHandler:function(_81){var _82=this.__scaleExtent(this.extent,_81,this._zoomAnimAnchor);this.__zoom(_82,_81,this._dragOrigin);},_adjustZoomEndHandler:function(){var _83=this.extent.getWidth()/this._zoomEndExtent.getWidth(),_84=this.__scaleExtent(this.extent,1/_83,this._zoomAnimAnchor);this.__zoomEnd(_84,_83,this._dragOrigin,this._zoomEndLod,true);this._zoomStartExtent=this._zoomEndExtent=this._zoomEndLod=this._dragOrigin=this._zoomAnim=this._zoomAnimAnchor=null;}};}()));}}}};});