/*
 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
 */

if(!dojo._hasResource["esri.utils"]){dojo._hasResource["esri.utils"]=true;dojo.provide("esri.utils");dojo.require("dojo.io.script");dojo.require("esri.graphic");dojo.requireLocalization("esri","jsapi",null,"ROOT,ar,de,es,fr,it,ja,ko,nl,pl,pt-br,ro,ru,sv,zh");dojo.addOnLoad(function(){esri.bundle=dojo.i18n.getLocalization("esri","jsapi");});esri.show=function(_1){_1.style.display="block";};esri.hide=function(_2){_2.style.display="none";};esri.toggle=function(_3){_3.style.display=_3.style.display==="none"?"block":"none";};esri.valueOf=function(_4,_5){var i;for(i in _4){if(_4[i]==_5){return i;}}return null;};esri.substitute=(function(){var _6="${*}",_7=["NumberFormat","DateString","DateFormat"];function _8(_9){return esri._isDefined(_9)?_9:"";};function _a(_b,_c,_d){var _e=_d.match(/([^\(]+)(\([^\)]+\))?/i);var _f=dojo.trim(_e[1]);var _10=dojo.fromJson((_e[2]?dojo.trim(_e[2]):"()").replace(/^\(/,"({").replace(/\)$/,"})"));var _11=_c[_b];if(dojo.indexOf(_7,_f)===-1){var ref=dojo.getObject(_f);if(dojo.isFunction(ref)){_11=ref(_11,_b,_c);}}else{if(typeof _11==="number"||(typeof _11==="string"&&_11&&!isNaN(Number(_11)))){_11=Number(_11);switch(_f){case "NumberFormat":if(dojo.getObject("dojo.number.format")){return dojo.number.format(_11,_10);}break;case "DateString":var _12=new Date(_11);if(_10.local||_10.systemLocale){if(_10.systemLocale){return _12.toLocaleDateString()+(_10.hideTime?"":(" "+_12.toLocaleTimeString()));}else{return _12.toDateString()+(_10.hideTime?"":(" "+_12.toTimeString()));}}else{_12=_12.toUTCString();if(_10.hideTime){_12=_12.replace(/\s+\d\d\:\d\d\:\d\d\s+(utc|gmt)/i,"");}return _12;}break;case "DateFormat":if(dojo.getObject("dojo.date.locale.format")){return dojo.date.locale.format(new Date(_11),_10);}break;}}}return _8(_11);};return function(_13,_14,_15){var _16,_17,_18;if(esri._isDefined(_15)){if(dojo.isObject(_15)){_16=_15.first;_17=_15.dateFormat;_18=_15.numberFormat;}else{_16=_15;}}if(!_14||_14===_6){var s=[],val,i;for(i in _13){val=_13[i];if(_17&&dojo.indexOf(_17.properties||"",i)!==-1){val=_a(i,_13,_17.formatter||"DateString");}else{if(_18&&dojo.indexOf(_18.properties||"",i)!==-1){val=_a(i,_13,_18.formatter||"NumberFormat");}}s.push(i+" = "+_8(val)+"<br/>");if(_16){break;}}return s.join("");}else{return dojo.replace(_14,dojo.hitch({obj:_13},function(_19,key){var _1a=key.split(":");if(_1a.length>1){key=_1a[0];_1a.shift();return _a(key,this.obj,_1a.join(":"));}else{if(_17&&dojo.indexOf(_17.properties||"",key)!==-1){return _a(key,this.obj,_17.formatter||"DateString");}if(_18&&dojo.indexOf(_18.properties||"",key)!==-1){return _a(key,this.obj,_18.formatter||"NumberFormat");}}return _8(this.obj[key]);}),/\$\{([^\}]+)\}/g);}};}());esri.documentBox=dojo.isIE?{w:document.documentElement.clientWidth,h:document.documentElement.clientHeight}:{w:window.innerWidth,h:window.innerHeight};esri.urlToObject=function(url){var iq=url.indexOf("?");if(iq===-1){return {path:url,query:null};}else{return {path:url.substring(0,iq),query:dojo.queryToObject(url.substring(iq+1))};}};esri._getProxyUrl=function(_1b){var _1c=esri.config.defaults.io.proxyUrl,_1d,_1e,_1f;if(!_1c){console.log(esri.bundle.io.proxyNotSet);throw new Error(esri.bundle.io.proxyNotSet);}if(_1b&&window.location.href.toLowerCase().indexOf("https:")!==0){_1e=_1c;if(_1e.toLowerCase().indexOf("http")!==0){_1e=esri._getAbsoluteUrl(_1e);}_1e=_1e.replace(/^http:/i,"https:");if(esri._canDoXOXHR(_1e)){_1c=_1e;_1f=1;}}_1d=esri.urlToObject(_1c);_1d._xo=_1f;return _1d;};esri._getProxiedUrl=function(url){if(esri.config.defaults.io.alwaysUseProxy){var _20=esri._getProxyUrl(),_21=esri.urlToObject(url);url=_20.path+"?"+_21.path;var _22=dojo.objectToQuery(dojo.mixin(_20.query||{},_21.query));if(_22){url+=("?"+_22);}}return url;};esri._hasSameOrigin=function(_23,_24,_25){_23=_23.toLowerCase();_24=_24.toLowerCase();var _26=window.location.href.toLowerCase();_23=_23.indexOf("http")===0?new dojo._Url(_23):(_26=new dojo._Url(_26));_24=_24.indexOf("http")===0?new dojo._Url(_24):(dojo.isString(_26)?new dojo._Url(_26):_26);return ((_25||(_23.scheme===_24.scheme))&&_23.host===_24.host&&_23.port===_24.port);};esri._canDoXOXHR=function(url){var _27=false,_28=esri._hasSameOrigin,_29=esri.config.defaults.io.corsEnabledServers,_2a;if(esri._hasCors&&_29&&_29.length){_27=dojo.some(_29,function(_2b){_2a=(dojo.trim(_2b).toLowerCase().indexOf("http")!==0);return _28(url,_2a?("http://"+_2b):_2b)||(_2a&&_28(url,"https://"+_2b));});}return _27;};esri.request=function(req,_2c){var dfd,_2d=req.form,_2e=_2d&&dojo.some(_2d.elements,function(el){return el.type==="file";}),_2f=(req.url.toLowerCase().indexOf("token=")!==-1||(req.content&&req.content.token)||(_2e&&dojo.some(_2d.elements,function(el){return el.name==="token";})))?1:0;if(req._usrDfd){dfd=req._usrDfd;}else{dfd=new dojo.Deferred(esri._dfdCanceller);var ld=req.load,_30=req.error;if(ld){dfd.addCallback(function(_31){var _32=dfd._pendingDfd,_33=_32&&_32.ioArgs,_34=_33&&_33.args;return ld.call(_34,_31,_33);});}if(_30){dfd.addErrback(function(_35){var _36=dfd._pendingDfd,_37=_36&&_36.ioArgs,_38=_37&&_37.args;return _30.call(_38,_35,_37);});}}var _39=_2c&&_2c.disableIdentityLookup;if(esri.id&&!_2f&&!req._token&&!esri.id._isPublic(req.url)&&!_39&&esri.id.findServerInfo(req.url)){dfd._pendingDfd=esri.id.getCredential(req.url);dfd._pendingDfd.addCallback(function(_3a){req._token=_3a.token;req._usrDfd=dfd;esri.request(req,_2c);}).addErrback(function(_3b){req._usrDfd=null;dfd.errback(_3b);dfd._pendingDfd=null;});}else{dfd._pendingDfd=esri._request(req,_2c,_2e);if(!dfd._pendingDfd){dfd.ioArgs=dfd._pendingDfd&&dfd._pendingDfd.ioArgs;var err=new Error("Deferred object is missing");err.log=dojo.config.isDebug;req._usrDfd=null;dfd.errback(err);dfd._pendingDfd=null;return dfd;}dfd._pendingDfd.addCallback(function(_3c){dfd.ioArgs=dfd._pendingDfd&&dfd._pendingDfd.ioArgs;req._usrDfd=null;dfd.callback(_3c);dfd._pendingDfd=null;}).addErrback(function(_3d){if(esri.id&&dojo.indexOf(esri.id._errorCodes,_3d.code)!==-1&&!esri.id._isPublic(req.url)&&!_39){dfd._pendingDfd=esri.id.getCredential(req.url,req._token);dfd._pendingDfd.addCallback(function(_3e){req._token=_3e.token;req._usrDfd=dfd;esri.request(req,_2c);}).addErrback(function(_3f){req._usrDfd=null;dfd.errback(_3f);dfd._pendingDfd=null;});return;}dfd.ioArgs=dfd._pendingDfd&&dfd._pendingDfd.ioArgs;req._usrDfd=null;dfd.errback(_3d);dfd._pendingDfd=null;});}return dfd;};esri._request=function(req,_40,_41){var _42=false,_43=false;if(esri._isDefined(_40)){if(dojo.isObject(_40)){_42=!!_40.useProxy;_43=!!_40.usePost;}else{_42=!!_40;}}req=dojo.mixin({},req);var _44=req.content,_45=req.url,_46=_41&&req.form,_47=esri.config.defaults.io;req.load=function(_48){var err;if(_48&&_48.error){err=dojo.mixin(new Error(),_48.error);err.log=dojo.config.isDebug;}return err||_48;};req.error=function(_49,io){if(io&&io.xhr){io.xhr.abort();}if(!(_49 instanceof Error)){_49=dojo.mixin(new Error(),_49);}_49.log=dojo.config.isDebug;_47.errorHandler(_49,io);return _49;};if(req._token){req.content=req.content||{};req.content.token=req._token;}var len=0;if(_44&&_45){len=dojo.objectToQuery(_44).length+_45.length+1;}req.timeout=esri._isDefined(req.timeout)?req.timeout:_47.timeout;req.handleAs=req.handleAs||"json";try{var _4a,_4b,_4c=esri._reqPreCallback,_4d,_4e=(_43||_41||len>_47.postLength)?true:false,_4f=(req.handleAs.indexOf("json")!==-1&&req.callbackParamName&&!_41)?true:false,_50=(_47.alwaysUseProxy||_42||((!_4f||_4e)&&!esri._hasSameOrigin(req.url,window.location.href)&&!(_4d=esri._canDoXOXHR(req.url))))?true:false;if(_41&&!esri._hasFileUpload&&!_50&&_4d){_50=true;}if(_50){_4a=esri._getProxyUrl(dojo.trim(_45).toLowerCase().indexOf("https:")===0);_4b=_4a.path;if(_4a._xo){_4d=true;}if(!_4e&&(_4b.length+1+len)>_47.postLength){_4e=true;}req.url=_4b+"?"+_45;if(_4e){req.content=dojo.mixin(_4a.query||{},_44);}else{var _51=dojo.objectToQuery(dojo.mixin(_4a.query||{},_44));if(_51){req.url+=("?"+_51);}req.content=null;}}if(_4f&&!_4e){if(!esri._isDefined(req.isAsync)&&dojo.isFF<4){req.isAsync=true;}return dojo.io.script.get(_4c?_4c(req):req);}else{var _52=req.headers;if(_4d&&(!_52||!_52.hasOwnProperty("X-Requested-With"))){_52=req.headers=(_52||{});_52["X-Requested-With"]=null;}if(_41){var _53=req.callbackParamName||"callback.html",_54=req.callbackElementName||"textarea",_55,_56,_57,i,il=_46.elements.length,el;_44=req.content;if(_44){for(_55 in _44){_57=_44[_55];if(esri._isDefined(_57)){_56=null;for(i=0;i<il;i++){el=_46.elements[i];if(el.name===_55){_56=el;break;}}if(_56){_56.value=_57;}else{_46.appendChild(dojo.create("input",{type:"hidden",name:_55,value:_57}));}}}}if(esri._hasFileUpload){dojo.forEach(_46.elements,function(el){if(el.name===_53){_46.removeChild(el);}});req.contentType=false;req.postData=new FormData(_46);delete req.form;}else{_46.enctype="multipart/form-data";if(dojo.isIE<9){_46.encoding="multipart/form-data";}_46.method="post";if(!dojo.some(_46.elements,function(el){return el.name===_53;})){_46.appendChild(dojo.create("input",{type:"hidden",name:_53,value:_54}));}if(_45.toLowerCase().indexOf("addattachment")!==-1||_45.toLowerCase().indexOf("updateattachment")!==-1){req.url=_45+((_45.indexOf("?")===-1)?"?":"&")+_53+"="+_54;if(_50){req.url=_4b+"?"+req.url;}}delete req.content;}}req=_4c?_4c(req):req;if(_4e){if(_41&&!esri._hasFileUpload){return dojo.io.iframe.send(req);}else{return dojo.rawXhrPost(req);}}else{return dojo.xhrGet(req);}}}catch(e){var dfd=new dojo.Deferred();dfd.errback(req.error(e));return dfd;}};esri.setRequestPreCallback=function(_58){esri._reqPreCallback=_58;};esri._getParts=function(arr,obj,cb){return [dojo.isString(arr)?arr.split(""):arr,obj||dojo.global,dojo.isString(cb)?new Function("item","index","array",cb):cb];};esri.filter=function(arr,_59,_5a){var _5b=esri._getParts(arr,_5a,_59),_5c={},i;arr=_5b[0];for(i in arr){if(_5b[2].call(_5b[i],arr[i],i,arr)){_5c[i]=arr[i];}}return _5c;};esri.TileUtils=(function(){function _5d(map,ti,_5e){var wd=map.width,ht=map.height,ew=_5e.xmax-_5e.xmin,eh=_5e.ymax-_5e.ymin,ed=-1,_5f=ti.lods,i,il=_5f.length,abs=Math.abs,lod,cl,ced;for(i=0;i<il;i++){cl=_5f[i];ced=ew>eh?abs(eh-(ht*cl.resolution)):abs(ew-(wd*cl.resolution));if(ed<0||ced<=ed){lod=cl;ed=ced;}else{break;}}return lod;};function _60(map,_61,lod){var res=lod.resolution,cx=(_61.xmin+_61.xmax)/2,cy=(_61.ymin+_61.ymax)/2,_62=(map.width/2)*res,_63=(map.height/2)*res;return new esri.geometry.Extent(cx-(_62),cy-(_63),cx+(_62),cy+(_63),_61.spatialReference);};function _64(map,ti,_65,lod){var res=lod.resolution,tw=ti.width,th=ti.height,to=ti.origin,mv=map.__visibleDelta,_66=Math.floor,tmw=tw*res,tmh=th*res,tr=_66((to.y-_65.y)/tmh),tc=_66((_65.x-to.x)/tmw),_67=to.x+(tc*tmw),_68=to.y-(tr*tmh),oX=_66(Math.abs((_65.x-_67)*tw/tmw))+mv.x,oY=_66(Math.abs((_65.y-_68)*th/tmh))+mv.y;return {point:_65,coords:{row:tr,col:tc},offsets:{x:oX,y:oY}};};return {_addFrameInfo:function(_69,_6a){var _6b,_6c,_6d=2*_6a.origin[1],_6e=_6a.origin[0],_6f=_69.origin.x,_70=_69.width,_71;dojo.forEach(_69.lods,function(lod){_6b=Math.round(_6d/lod.resolution);_6c=Math.ceil(_6b/_70);_71=Math.floor((_6e-_6f)/(_70*lod.resolution));if(!lod._frameInfo){lod._frameInfo=[_6c,_71,_71+_6c-1,_6b];}});},getContainingTileCoords:function(ti,_72,lod){var to=ti.origin,res=lod.resolution,tmw=ti.width*res,tmh=ti.height*res,tc=Math.floor((_72.x-to.x)/tmw),tr=Math.floor((to.y-_72.y)/tmh);return {row:tr,col:tc};},getCandidateTileInfo:function(map,ti,_73){var lod=_5d(map,ti,_73),adj=_60(map,_73,lod),ct=_64(map,ti,new esri.geometry.Point(adj.xmin,adj.ymax,_73.spatialReference),lod);return {tile:ct,lod:lod,extent:adj};},getTileExtent:function(ti,_74,row,col){var to=ti.origin,lod=ti.lods[_74],res=lod.resolution,tw=ti.width,th=ti.height;return new esri.geometry.Extent(((col*res)*tw)+to.x,to.y-((row+1)*res)*th,(((col+1)*res)*tw)+to.x,to.y-((row*res)*th),ti.spatialReference);}};}());esri.graphicsExtent=function(_75){var g=_75[0].geometry,_76=g.getExtent(),ext,i,il=_75.length;if(_76===null){_76=new esri.geometry.Extent(g.x,g.y,g.x,g.y,g.spatialReference);}for(i=1;i<il;i++){ext=(g=_75[i].geometry).getExtent();if(ext===null){ext=new esri.geometry.Extent(g.x,g.y,g.x,g.y,g.spatialReference);}_76=_76.union(ext);}if(_76.getWidth()<=0&&_76.getHeight()<=0){return null;}return _76;};esri.getGeometries=function(_77){return dojo.map(_77,function(_78){return _78.geometry;});};esri._encodeGraphics=function(_79,_7a){var _7b=[],_7c,enc,_7d;dojo.forEach(_79,function(g,i){_7c=g.toJson();enc={};if(_7c.geometry){_7d=_7a&&_7a[i];enc.geometry=_7d&&_7d.toJson()||_7c.geometry;}if(_7c.attributes){enc.attributes=_7c.attributes;}_7b[i]=enc;});return _7b;};esri._serializeLayerDefinitions=function(_7e){var _7f=[],_80=false,re=/[:;]/;if(_7e){dojo.forEach(_7e,function(_81,i){if(_81){_7f.push([i,_81]);if(!_80&&re.test(_81)){_80=true;}}});if(_7f.length>0){var _82;if(_80){_82={};dojo.forEach(_7f,function(_83){_82[_83[0]]=_83[1];});_82=dojo.toJson(_82);}else{_82=[];dojo.forEach(_7f,function(_84){_82.push(_84[0]+":"+_84[1]);});_82=_82.join(";");}return _82;}}return null;};esri._serializeTimeOptions=function(_85,ids){if(!_85){return;}var _86=[];dojo.forEach(_85,function(_87,i){if(_87){var _88=_87.toJson();if(ids&&dojo.indexOf(ids,i)!==-1){_88.useTime=false;}_86.push("\""+i+"\":"+dojo.toJson(_88));}});if(_86.length){return "{"+_86.join(",")+"}";}};esri._isDefined=function(_89){return (_89!==undefined)&&(_89!==null);};esri._sanitize=function(obj){var _8a;for(_8a in obj){if(obj.hasOwnProperty(_8a)){if(obj[_8a]===undefined){delete obj[_8a];}}}return obj;};esri._dfdCanceller=function(dfd){dfd.canceled=true;var _8b=dfd._pendingDfd;if(dfd.fired===-1&&_8b&&_8b.fired===-1){_8b.cancel();}dfd._pendingDfd=null;};esri._fixDfd=function(dfd){var _8c=dfd.then;dfd.then=function(_8d,b,c){if(_8d){var _8e=_8d;_8d=function(_8f){if(_8f&&_8f._argsArray){return _8e.apply(null,_8f);}return _8e(_8f);};}return _8c.call(this,_8d,b,c);};return dfd;};esri._resDfd=function(dfd,_90,_91){var _92=_90.length;if(_92===1){if(_91){dfd.errback(_90[0]);}else{dfd.callback(_90[0]);}}else{if(_92>1){_90._argsArray=true;dfd.callback(_90);}else{dfd.callback();}}};esri._createWrappers=function(_93){var _94=dojo.getObject(_93+".prototype");dojo.forEach(_94.__msigns,function(sig){var _95=_94[sig.n];_94[sig.n]=function(){var _96=this,_97=[],i,_98=new dojo.Deferred(esri._dfdCanceller);if(sig.f){esri._fixDfd(_98);}for(i=0;i<sig.c;i++){_97[i]=arguments[i];}var _99={dfd:_98};_97.push(_99);var _9a,_9b=[],_9c;if(_96.normalization&&!_96._isTable){_9a=esri._disassemble(_97,sig.a);dojo.forEach(_9a,function(_9d){_9b=_9b.concat(_9d.value);});if(_9b.length){var sr=_9b[0].spatialReference;if(sr&&sr._isWrappable()){_9c=esri.geometry.normalizeCentralMeridian(_9b,esri.config.defaults.geometryService);}}}if(_9c){_98._pendingDfd=_9c;_9c.addCallbacks(function(_9e){if(_98.canceled){return;}_99.assembly=esri._reassemble(_9e,_9a);_98._pendingDfd=_95.apply(_96,_97);},function(err){var _9f=_96.declaredClass;if(_9f&&_9f.indexOf("FeatureLayer")!==-1){_96._resolve([err],null,_97[sig.e],_98,true);}else{_96._errorHandler(err,_97[sig.e],_98);}});}else{_98._pendingDfd=_95.apply(_96,_97);}return _98;};});};esri._disassemble=function(_a0,_a1){var _a2=[];dojo.forEach(_a1,function(_a3){var _a4=_a3.i,arg=_a0[_a4],_a5=_a3.p,_a6;if(!dojo.isObject(arg)||!arg){return;}if(_a5){if(_a5[0]==="*"){for(_a6 in arg){if(arg.hasOwnProperty(_a6)){esri._addToBucket(arg[_a6],_a2,_a4,_a6);}}}else{dojo.forEach(_a5,function(_a7){esri._addToBucket(dojo.getObject(_a7,false,arg),_a2,_a4,_a7);});}}else{esri._addToBucket(arg,_a2,_a4);}});return _a2;};esri._addToBucket=function(_a8,_a9,_aa,_ab){var _ac=false,_ad;if(dojo.isObject(_a8)&&_a8){if(dojo.isArray(_a8)){if(_a8.length){_ad=_a8[0]&&_a8[0].declaredClass;if(_ad&&_ad.indexOf("Graphic")!==-1){_a8=dojo.map(_a8,function(_ae){return _ae.geometry;});_a8=dojo.filter(_a8,esri._isDefined);_ac=_a8.length?true:false;}else{if(_ad&&_ad.indexOf("esri.geometry.")!==-1){_ac=true;}}}}else{_ad=_a8.declaredClass;if(_ad&&_ad.indexOf("FeatureSet")!==-1){_a8=dojo.map(_a8.features||[],function(_af){return _af.geometry;});_a8=dojo.filter(_a8,esri._isDefined);_ac=_a8.length?true:false;}else{if(_ad&&_ad.indexOf("esri.geometry.")!==-1){_ac=true;}}}}if(_ac){_a9.push({index:_aa,property:_ab,value:_a8});}};esri._reassemble=function(_b0,_b1){var idx=0,_b2={};dojo.forEach(_b1,function(_b3){var _b4=_b3.index,_b5=_b3.property,_b6=_b3.value,len=_b6.length||1;var _b7=_b0.slice(idx,idx+len);if(!dojo.isArray(_b6)){_b7=_b7[0];}idx+=len;delete _b3.value;if(_b5){_b2[_b4]=_b2[_b4]||{};_b2[_b4][_b5]=_b7;}else{_b2[_b4]=_b7;}});return _b2;};esri.setScrollable=function(_b8){var _b9=0,_ba=0,_bb=0,_bc=0,_bd=0,_be=0;return [dojo.connect(_b8,"ontouchstart",function(evt){_b9=evt.touches[0].screenX;_ba=evt.touches[0].screenY;_bb=_b8.scrollWidth;_bc=_b8.scrollHeight;_bd=_b8.clientWidth;_be=_b8.clientHeight;}),dojo.connect(_b8,"ontouchmove",function(evt){evt.preventDefault();var _bf=_b8.firstChild;if(_bf instanceof Text){_bf=_b8.childNodes[1];}var _c0=_bf._currentX||0,_c1=_bf._currentY||0;_c0+=(evt.touches[0].screenX-_b9);if(_c0>0){_c0=0;}else{if(_c0<0&&(Math.abs(_c0)+_bd)>_bb){_c0=-1*(_bb-_bd);}}_bf._currentX=_c0;_c1+=(evt.touches[0].screenY-_ba);if(_c1>0){_c1=0;}else{if(_c1<0&&(Math.abs(_c1)+_be)>_bc){_c1=-1*(_bc-_be);}}_bf._currentY=_c1;dojo.style(_bf,{"-webkit-transition-property":"-webkit-transform","-webkit-transform":"translate("+_c0+"px, "+_c1+"px)"});_b9=evt.touches[0].screenX;_ba=evt.touches[0].screenY;})];};esri._getAbsoluteUrl=function(url){if(dojo.isString(url)&&url.indexOf("http://")===-1&&url.indexOf("https://")===-1){if(url.indexOf("//")===0){return window.location.protocol+url;}else{if(url.indexOf("/")===0){return window.location.protocol+"//"+window.location.host+url;}else{return esri._appBaseUrl+url;}}}return url;};esri._getDefaultVisibleLayers=function(_c2){var _c3=[],i;for(i=0;i<_c2.length;i++){if(_c2[i].parentLayerId>=0&&dojo.indexOf(_c3,_c2[i].parentLayerId)===-1){continue;}if(_c2[i].defaultVisibility){_c3.push(_c2[i].id);}}return _c3;};esri._getLayersForScale=function(_c4,_c5){var _c6=[];if(_c4>0&&_c5){var i;for(i=0;i<_c5.length;i++){if(_c5[i].parentLayerId>=0&&dojo.indexOf(_c6,_c5[i].parentLayerId)===-1){continue;}if(_c5[i].id>=0){var _c7=true,_c8=_c5[i].maxScale,_c9=_c5[i].minScale;if(_c8>0||_c9>0){if(_c8>0&&_c9>0){_c7=_c8<=_c4&&_c4<=_c9;}else{if(_c8>0){_c7=_c8<=_c4;}else{if(_c9>0){_c7=_c4<=_c9;}}}}if(_c7){_c6.push(_c5[i].id);}}}}return _c6;};}