/*
 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.dijit.Legend"],["require","dijit._Widget"],["require","dojo.DeferredList"],["require","dojox.html.entities"]],defineResource:function(_4,_5,_6){if(!_4._hasResource["esri.dijit.Legend"]){_4._hasResource["esri.dijit.Legend"]=true;_4.provide("esri.dijit.Legend");_4.require("dijit._Widget");_4.require("dojo.DeferredList");_4.require("dojox.html.entities");(function(){var _7=[_4.moduleUrl("esri.dijit","css/Legend.css")];var _8=document.getElementsByTagName("head").item(0),_9;for(var i=0,il=_7.length;i<il;i++){_9=document.createElement("link");_9.type="text/css";_9.rel="stylesheet";_9.href=_7[i].toString();_8.appendChild(_9);}}());_4.declare("esri.dijit.Legend",[_5._Widget],{widgetsInTemplate:false,layers:null,alignRight:false,_ieTimer:100,constructor:function(_a,_b){_4.mixin(this,esri.bundle.widgets.legend);_a=_a||{};if(!_a.map){console.error("esri.dijit.Legend: unable to find the 'map' property in parameters");return;}if(!_b){console.error("esri.dijit.Legend: must specify a container for the legend");return;}this.map=_a.map;this.layerInfos=_a.layerInfos;this._respectCurrentMapScale=(_a.respectCurrentMapScale===false)?false:true;this.arrangement=(_a.arrangement===esri.dijit.Legend.ALIGN_RIGHT)?esri.dijit.Legend.ALIGN_RIGHT:esri.dijit.Legend.ALIGN_LEFT;if(this.arrangement===esri.dijit.Legend.ALIGN_RIGHT){this.alignRight=true;}this._surfaceItems=[];},startup:function(){this.inherited(arguments);this._initialize();if(_4.isIE){this._repaintItems=_4.hitch(this,this._repaintItems);setTimeout(this._repaintItems,this._ieTimer);}},destroy:function(){this._deactivate();this.inherited(arguments);},refresh:function(_c){if(!this.domNode){return;}if(_c){this.layerInfos=_c;this.layers=[];_4.forEach(this.layerInfos,function(_d){if(this._isSupportedLayerType(_d.layer)){if(_d.title){_d.layer._titleForLegend=_d.title;}this.layers.push(_d.layer);}},this);}else{if(this.useAllMapLayers){this.layerInfos=null;this.layers=null;}}for(var i=this.domNode.children.length-1;i>=0;i--){_4.destroy(this.domNode.children[i]);}this.startup();},_legendUrl:"http://utility.arcgis.com/sharing/tools/legend",_initialize:function(){if(this.layerInfos){this.layers=[];_4.forEach(this.layerInfos,function(_e){if(this._isSupportedLayerType(_e.layer)){if(_e.title){_e.layer._titleForLegend=_e.title;}this.layers.push(_e.layer);}},this);}this.useAllMapLayers=false;if(!this.layers){this.useAllMapLayers=true;this.layers=[];var _f=[];_4.forEach(this.map.layerIds,function(_10){var _11=this.map.getLayer(_10);if(this._isSupportedLayerType(_11)){if(_11.arcgisProps&&_11.arcgisProps.title){_11._titleForLegend=_11.arcgisProps.title;}this.layers.push(_11);}if(_11.declaredClass=="esri.layers.KMLLayer"){_4.forEach(_11.getLayers(),function(_12){_f.push(_12.id);},this);}},this);_4.forEach(this.map.graphicsLayerIds,function(_13){var _14=this.map.getLayer(_13);if(_4.indexOf(_f,_13)==-1){if(this._isSupportedLayerType(_14)&&_14._params&&_14._params.drawMode){if(_14.arcgisProps&&_14.arcgisProps.title){_14._titleForLegend=_14.arcgisProps.title;}this.layers.push(_14);}}},this);}this._createLegend();},_activate:function(){this._deactivate();if(this._respectCurrentMapScale){this._ozeConnect=_4.connect(this.map,"onZoomEnd",this,"_refreshLayers");}if(this.useAllMapLayers){this._olaConnect=_4.connect(this.map,"onLayerAdd",this,"_updateAllMapLayers");this._olrConnect=_4.connect(this.map,"onLayerRemove",this,"_updateAllMapLayers");this._olroConnect=_4.connect(this.map,"onLayersReordered",this,"_updateAllMapLayers");}_4.forEach(this.layers,function(_15){_15.ovcConnect=_4.connect(_15,"onVisibilityChange",this,"_refreshLayers");if(_15.declaredClass==="esri.layers.ArcGISDynamicMapServiceLayer"&&_15.supportsDynamicLayers){_15.odcConnect=_4.connect(_15,"_onDynamicLayersChange",this,"_updateDynamicLayers");}},this);},_deactivate:function(){if(this._ozeConnect){_4.disconnect(this._ozeConnect);}if(this._olaConnect){_4.disconnect(this._olaConnect);}if(this._olroConnect){_4.disconnect(this._olroConnect);}if(this._olrConnect){_4.disconnect(this._olrConnect);}_4.forEach(this.layers,function(_16){if(_16.ovcConnect){_4.disconnect(_16.ovcConnect);}if(_16.odcConnect){_4.disconnect(_16.odcConnect);}},this);},_updateDynamicLayers:function(){this._dynamicLayerChanged=true;this._refreshLayers();},_refreshLayers:function(){this.refresh();},_updateAllMapLayers:function(){this.layers=[];_4.forEach(this.map.layerIds,function(_17){var _18=this.map.getLayer(_17);if(this._isSupportedLayerType(_18)){this.layers.push(_18);}},this);_4.forEach(this.map.graphicsLayerIds,function(_19){var _1a=this.map.getLayer(_19);if(this._isSupportedLayerType(_1a)&&_1a._params&&_1a._params.drawMode){this.layers.push(_1a);}},this);this.refresh();},_createLegend:function(){_4.style(this.domNode,"position","relative");_4.create("div",{id:this.id+"_msg",innerHTML:this.NLS_creatingLegend+"..."},this.domNode);var _1b=[];_4.forEach(this.layers,function(_1c){if(_1c.declaredClass=="esri.layers.KMLLayer"){_4.forEach(_1c.getLayers(),function(_1d){if(_1d.declaredClass=="esri.layers.FeatureLayer"&&_1c._titleForLegend){_1d._titleForLegend=_1c._titleForLegend+" - ";if(_1d.geometryType=="esriGeometryPoint"){_1d._titleForLegend+="Points";}else{if(_1d.geometryType=="esriGeometryPolyline"){_1d._titleForLegend+="Lines";}else{if(_1d.geometryType=="esriGeometryPolygon"){_1d._titleForLegend+="Polygons";}}}_1b.push(_1d);}});}else{_1b.push(_1c);}},this);var _1e=[];_4.forEach(_1b,function(_1f){if(_1f.visible===true&&(_1f.layerInfos||_1f.renderer)){var d=_4.create("div",{id:this.id+"_"+_1f.id,style:"display: none;","class":"esriLegendService"});_4.create("span",{innerHTML:this._getServiceTitle(_1f),"class":"esriLegendServiceLabel"},_4.create("td",{align:(this.alignRight?"right":"")},_4.create("tr",{},_4.create("tbody",{},_4.create("table",{width:"95%"},d)))));_4.place(d,this.id,"first");if(_4.isIE){_4.style(_4.byId(this.id+"_"+_1f.id),"display","none");}if((_1f.legendResponse||_1f.renderer)&&!this._dynamicLayerChanged){this._createLegendForLayer(_1f);}else{_1e.push(this._legendRequest(_1f));}this._dynamicLayerChanged=false;}},this);if(_1e.length===0){_4.byId(this.id+"_msg").innerHTML=this.NLS_noLegend;this._activate();}else{var _20=new _4.DeferredList(_1e);_20.addCallback(_4.hitch(this,function(_21){_4.byId(this.id+"_msg").innerHTML=this.NLS_noLegend;this._activate();}));}},_createLegendForLayer:function(_22){if(_22.legendResponse||_22.renderer){var _23=false;if(_22.legendResponse){_4.forEach(_22.layerInfos,function(_24,i){var f=this._buildLegendItems(_22,_24,i);_23=_23||f;},this);}else{if(_22.renderer){var id;if(!_22.url){id="fc_"+_22.id;}else{id=_22.url.substring(_22.url.lastIndexOf("/")+1,_22.url.length);}var _25={id:id,name:null,subLayerIds:null,parentLayerId:-1};_23=this._buildLegendItems(_22,_25,0);}}if(_23){_4.style(_4.byId(this.id+"_"+_22.id),"display","block");_4.style(_4.byId(this.id+"_msg"),"display","none");}}},_legendRequest:function(_26){if(!_26.loaded){_4.connect(_26,"onLoad",_4.hitch(this,"_legendRequest"));return;}if(_26.version>=10.01){return this._legendRequestServer(_26);}else{return this._legendRequestTools(_26);}},_legendRequestServer:function(_27){var url=_27.url;var pos=url.indexOf("?");if(pos>-1){url=url.substring(0,pos)+"/legend"+url.substring(pos);}else{url+="/legend";}var _28=_4.hitch(this,"_processLegendResponse");var _29={};_29.f="json";if(_27._params.dynamicLayers){_29.dynamicLayers=_27._params.dynamicLayers;if(_29.dynamicLayers==="[{}]"){_29.dynamicLayers="[]";}}var _2a=esri.request({url:url,content:_29,callbackParamName:"callback",load:function(_2b,_2c){_28(_27,_2b,_2c);},error:esriConfig.defaults.io.errorHandler});return _2a;},_legendRequestTools:function(_2d){var p=_2d.url.toLowerCase().indexOf("/rest/");var _2e=_2d.url.substring(0,p)+_2d.url.substring(p+5,_2d.url.length);var url=this._legendUrl+"?soapUrl="+escape(_2e);if(!_4.isIE){url+="&returnbytes=true";}var _2f=_4.hitch(this,"_processLegendResponse");var _30={};_30.f="json";var _31=esri.request({url:url,content:_30,callbackParamName:"callback",load:function(_32,_33){_2f(_2d,_32,_33);},error:esriConfig.defaults.io.errorHandler});return _31;},_processLegendResponse:function(_34,_35){if(_35&&_35.layers){_34.legendResponse=_35;this._createLegendForLayer(_34);}else{console.log("Legend could not get generated for "+_34.url+": "+_4.toJson(_35));}},_buildLegendItems:function(_36,_37,pos){var _38=false;var _39=_4.byId(this.id+"_"+_36.id);var _3a=_37.subLayerIds;var _3b=_37.parentLayerId;if(_3a){var _3c=_4.create("div",{id:this.id+"_"+_36.id+"_"+_37.id+"_group",style:"display: none;","class":(_3b==-1)?((pos>0)?"esriLegendGroupLayer":""):(this.alignRight?"esriLegendRight":"esriLegendLeft")},(_3b==-1)?_39:_4.byId(this.id+"_"+_36.id+"_"+_3b+"_group"));if(_4.isIE){_4.style(_4.byId(this.id+"_"+_36.id+"_"+_37.id+"_group"),"display","none");}_4.create("td",{innerHTML:_37.name.replace(/[\<]/g,"&lt;").replace(/[\>]/g,"&gt;"),align:(this.alignRight?"right":"")},_4.create("tr",{},_4.create("tbody",{},_4.create("table",{width:"95%","class":"esriLegendLayerLabel"},_3c))));}else{if(_36.visibleLayers&&(","+_36.visibleLayers+",").indexOf(","+_37.id+",")==-1){return _38;}var d=_4.create("div",{id:this.id+"_"+_36.id+"_"+_37.id,style:"display:none;","class":(_3b>-1)?(this.alignRight?"esriLegendRight":"esriLegendLeft"):""},(_3b==-1)?_39:_4.byId(this.id+"_"+_36.id+"_"+_3b+"_group"));if(_4.isIE){_4.style(_4.byId(this.id+"_"+_36.id+"_"+_37.id),"display","none");}_4.create("td",{innerHTML:(_37.name)?_37.name.replace(/[\<]/g,"&lt;").replace(/[\>]/g,"&gt;"):"",align:(this.alignRight?"right":"")},_4.create("tr",{},_4.create("tbody",{},_4.create("table",{width:"95%","class":"esriLegendLayerLabel"},d))));if(_36.legendResponse){_38=_38||this._buildLegendItems_Tools(_36,_37,d);}else{if(_36.renderer){_38=_38||this._buildLegendItems_Renderer(_36,_37,d);}}}return _38;},_buildLegendItems_Tools:function(_3d,_3e,_3f){var _40=_3e.parentLayerId;var _41=esri.geometry.getScale(this.map);var _42=false;if(!this._respectCurrentMapScale||(this._respectCurrentMapScale&&this._isLayerInScale(_3d,_3e,_41))){for(var i=0;i<_3d.legendResponse.layers.length;i++){if(_3e.id==_3d.legendResponse.layers[i].layerId){var _43=_3d.legendResponse.layers[i].legend;if(_43.length==3&&_43[0].label.replace(/\s+/g,"").indexOf(":Band_")>-1){}else{var _44=_4.create("tbody",{},_4.create("table",{cellpadding:0,cellspacing:0,width:"95%","class":"esriLegendLayer"},_3f));_4.forEach(_43,function(_45){if((_45.url&&_45.url.indexOf("http")===0)||(_45.imageData&&_45.imageData.length>0)){_42=true;this._buildRow_Tools(_45,_44,_3d,_3e.id);}},this);}break;}}}if(_42){_4.style(_4.byId(this.id+"_"+_3d.id+"_"+_3e.id),"display","block");if(_40>-1){_4.style(_4.byId(this.id+"_"+_3d.id+"_"+_40+"_group"),"display","block");this._findParentGroup(_3d.id,_3d,_40);}}return _42;},_buildRow_Tools:function(_46,_47,_48,_49){var tr=_4.create("tr",{},_47);var _4a;var _4b;if(this.alignRight){_4a=_4.create("td",{align:"right"},tr);_4b=_4.create("td",{align:"right",width:35},tr);}else{_4b=_4.create("td",{width:35},tr);_4a=_4.create("td",{},tr);}var src=_46.url;if(!_4.isIE&&_46.imageData&&_46.imageData.length>0){src="data:image/png;base64,"+_46.imageData;}else{if(_46.url.indexOf("http")!==0){src=_48.url+"/"+_49+"/images/"+_46.url;}}var img=_4.create("img",{src:src,border:0,style:"opacity:"+_48.opacity},_4b);_4.create("td",{innerHTML:_46.label.replace(/[\<]/g,"&lt;").replace(/[\>]/g,"&gt;"),align:(this.alignRight?"right":"")},_4.create("tr",{},_4.create("tbody",{},_4.create("table",{width:"95%",dir:"ltr"},_4a))));if(_4.isIE<9){img.style.filter="alpha(opacity="+(_48.opacity*100)+")";}},_buildLegendItems_Renderer:function(_4c,_4d,_4e){var _4f=_4d.parentLayerId;var _50=esri.geometry.getScale(this.map);var _51=false;if(!this._respectCurrentMapScale||this._isLayerInScale(_4c,_4d,_50)){var _52;if(_4c.renderer instanceof esri.renderer.UniqueValueRenderer){if(_4c.renderer.infos&&_4c.renderer.infos.length>0){_51=true;_52=_4.create("tbody",{},_4.create("table",{cellpadding:0,cellspacing:0,width:"95%","class":"esriLegendLayer"},_4e));_4.forEach(_4c.renderer.infos,function(_53,_54){var _55=null;if(_4c._editable&&_4c.types){_55=this._getTemplateFromTypes(_4c.types,_53.value);}var _56=_53.label;if(!_56||_56.length===0){_56=_53.value;}this._buildRow_Renderer(_4c,_53.symbol,_56,_55,_52);},this);}}if(_4c.renderer instanceof esri.renderer.ClassBreaksRenderer){if(_4c.renderer.infos&&_4c.renderer.infos.length>0){_51=true;_52=_4.create("tbody",{},_4.create("table",{cellpadding:0,cellspacing:0,width:"95%","class":"esriLegendLayer"},_4e));_4.forEach(_4c.renderer.infos,function(_57,_58){var _59=_57.label;if(!_59||_59.length===0){_59=_57.minValue+" - "+_57.maxValue;}this._buildRow_Renderer(_4c,_57.symbol,_59,null,_52);},this);}}if(_4c.renderer instanceof esri.renderer.SimpleRenderer){_51=true;_52=_4.create("tbody",{},_4.create("table",{cellpadding:0,cellspacing:0,width:"95%","class":"esriLegendLayer"},_4e));var _5a=null;if(_4c._editable&&_4c.templates&&_4c.templates.length>0){_5a=_4c.templates[0];}this._buildRow_Renderer(_4c,_4c.renderer.symbol,_4c.renderer.label,_5a,_52);}if(_4c.renderer.defaultSymbol){_51=true;_52=_4.create("tbody",{},_4.create("table",{cellpadding:0,cellspacing:0,width:"95%","class":"esriLegendLayer"},_4e));this._buildRow_Renderer(_4c,_4c.renderer.defaultSymbol,_4c.renderer.defaultLabel?_4c.renderer.defaultLabel:"others",null,_52);}}if(_51){_4.style(_4.byId(this.id+"_"+_4c.id+"_"+_4d.id),"display","block");if(_4f>-1){_4.style(_4.byId(this.id+"_"+_4c.id+"_"+_4f+"_group"),"display","block");this._findParentGroup(_4c.id,_4f);}}return _51;},_buildRow_Renderer:function(_5b,_5c,_5d,_5e,_5f){var tr=_4.create("tr",{},_5f);var _60;var _61;if(this.alignRight){_60=_4.create("td",{align:"right"},tr);_61=_4.create("td",{align:"right",width:35},tr);}else{_61=_4.create("td",{width:35},tr);_60=_4.create("td",{},tr);}var _62=30;if(_5c.type=="simplemarkersymbol"){_62=Math.min(Math.max(_62,_5c.size+12),125);}else{if(_5c.type=="picturemarkersymbol"){_62=Math.min(Math.max(_62,_5c.width),125);}}var div=_4.create("div",{style:"width:"+_62+"px;height:"+_62+"px;"},_61);_4.create("td",{innerHTML:_5d?_5d.replace(/[\<]/g,"&lt;").replace(/[\>]/g,"&gt;").replace(/^#/,""):"",align:(this.alignRight?"right":"")},_4.create("tr",{},_4.create("tbody",{},_4.create("table",{width:"95%"},_60))));var _63=this._drawSymbol(div,_5c,_62,_62,_5e,_5b.opacity);this._surfaceItems.push(_63);},_drawSymbol:function(_64,sym,_65,_66,_67,_68){var _69=esri.symbol.fromJson(sym.toJson());if(_69.type==="simplelinesymbol"||_69.type==="cartographiclinesymbol"||_69.type==="textsymbol"){var _6a=_69.color.toRgba();_6a[3]=_6a[3]*_68;_69.color.setColor(_6a);}else{if(_69.type==="simplemarkersymbol"||_69.type==="simplefillsymbol"){var _6a=_69.color.toRgba();_6a[3]=_6a[3]*_68;_69.color.setColor(_6a);if(_69.outline){_6a=_69.outline.color.toRgba();_6a[3]=_6a[3]*_68;_69.outline.color.setColor(_6a);}}else{if(_69.type==="picturemarkersymbol"){_64.style.opacity=_68;_64.style.filter="alpha(opacity=("+_68*100+"))";}}}var _6b=_6.gfx.createSurface(_64,_65,_66);if(_4.isIE){var _6c=_6b.getEventSource();_4.style(_6c,"position","relative");_4.style(_6c.parentNode,"position","relative");}var _6d=this._getDrawingToolShape(_69,_67)||esri.symbol.getShapeDescriptors(_69);var _6e;try{_6e=_6b.createShape(_6d.defaultShape).setFill(_6d.fill).setStroke(_6d.stroke);}catch(e){_6b.clear();_6b.destroy();return;}var dim=_6b.getDimensions();var _6f={dx:dim.width/2,dy:dim.height/2};var _70=_6e.getBoundingBox(),_71=_70.width,_72=_70.height;if(_71>_65||_72>_66){var _73=_71>_72?_71:_72;var _74=_65<_66?_65:_66;var _75=(_74-5)/_73;_4.mixin(_6f,{xx:_75,yy:_75});}_6e.applyTransform(_6f);return _6b;},_getDrawingToolShape:function(_76,_77){var _78,_79=_77?_77.drawingTool||null:null;switch(_79){case "esriFeatureEditToolArrow":_78={type:"path",path:"M 10,1 L 3,8 L 3,5 L -15,5 L -15,-2 L 3,-2 L 3,-5 L 10,1 E"};break;case "esriFeatureEditToolTriangle":_78={type:"path",path:"M -10,14 L 2,-10 L 14,14 L -10,14 E"};break;case "esriFeatureEditToolRectangle":_78={type:"path",path:"M -10,-10 L 10,-10 L 10,10 L -10,10 L -10,-10 E"};break;case "esriFeatureEditToolCircle":_78={type:"circle",cx:0,cy:0,r:10};break;case "esriFeatureEditToolEllipse":_78={type:"ellipse",cx:0,cy:0,rx:10,ry:5};break;default:return null;}return {defaultShape:_78,fill:_76.getFill(),stroke:_76.getStroke()};},_repaintItems:function(){_4.forEach(this._surfaceItems,function(_7a){this._repaint(_7a);},this);},_repaint:function(_7b){if(!_7b){return;}if(_7b.getStroke&&_7b.setStroke){_7b.setStroke(_7b.getStroke());}try{if(_7b.getFill&&_7b.setFill){_7b.setFill(_7b.getFill());}}catch(e){}if(_7b.children&&_4.isArray(_7b.children)){_4.forEach(_7b.children,this._repaint,this);}},_getTemplateFromTypes:function(_7c,_7d){for(var i=0;i<_7c.length;i++){if(_7c[i].id==_7d&&_7c[i].templates&&_7c[i].templates.length>0){return _7c[i].templates[0];}}return null;},_findParentGroup:function(_7e,_7f,_80){var _81=_7f.layerInfos;for(var k=0;k<_81.length;k++){if(_80==_81[k].id){if(_81[k].parentLayerId>-1){_4.style(_4.byId(this.id+"_"+_7e+"_"+_81[k].parentLayerId+"_group"),"display","block");this._findParentGroup(_7e,_7f,_81[k].parentLayerId);}break;}}},_isLayerInScale:function(_82,_83,_84){var _85=true;if(_82.legendResponse&&_82.legendResponse.layers){for(var i=0;i<_82.legendResponse.layers.length;i++){var _86=_82.legendResponse.layers[i];if(_83.id==_86.layerId){if(_86.minScale==0&&_82.tileInfo){_86.minScale=_82.tileInfo.lods[0].scale+1;}if(_86.maxScale==0&&_82.tileInfo){_86.maxScale=_82.tileInfo.lods[_82.tileInfo.lods.length-1].scale-1;}if((_86.minScale>0&&_86.minScale<_84)||_86.maxScale>_84){_85=false;}break;}}}else{if(_82.minScale||_82.maxScale){if((_82.minScale&&_82.minScale<_84)||_82.maxScale&&_82.maxScale>_84){_85=false;}}}return _85;},_getServiceTitle:function(_87){var _88=_87._titleForLegend;if(!_88){_88=_87.url;if(!_87.url){_88="";}else{if(_87.url.indexOf("/MapServer")>-1){_88=_87.url.substring(0,_87.url.indexOf("/MapServer"));_88=_88.substring(_88.lastIndexOf("/")+1,_88.length);}else{if(_87.url.indexOf("/ImageServer")>-1){_88=_87.url.substring(0,_87.url.indexOf("/ImageServer"));_88=_88.substring(_88.lastIndexOf("/")+1,_88.length);}else{if(_87.url.indexOf("/FeatureServer")>-1){_88=_87.url.substring(0,_87.url.indexOf("/FeatureServer"));_88=_88.substring(_88.lastIndexOf("/")+1,_88.length);}}}}if(_87.name){if(_88.length>0){_88+=" - "+_87.name;}else{_88=_87.name;}}}return _6.html.entities.encode(_88);},_isSupportedLayerType:function(_89){if(_89&&(_89.declaredClass==="esri.layers.ArcGISDynamicMapServiceLayer"||_89.declaredClass==="esri.layers.ArcGISTiledMapServiceLayer"||_89.declaredClass==="esri.layers.FeatureLayer"||_89.declaredClass=="esri.layers.KMLLayer")){return true;}return false;}});_4.mixin(esri.dijit.Legend,{ALIGN_LEFT:0,ALIGN_RIGHT:1});}}};});