IFactorLayersHandler.customLayersIcons=new Object();IFactorLayersHandler.prototype.doImportVectorLayer=function(B,C,D,G,A,E){if(!A){E.Hide()}if(iFactor.common.config.disable_map_msg_box==true||iFactor.common.config.disable_map_msg_box=="true"){this.stormCenter.map.ShowMessageBox=false}this.readCustomLayersIconsForDynamicLegend(C,D);var F=D.loadCraftily;if(!F){this.doImportVectorLayerAutomatically(C,D,G,E)}else{this.doImportVectorLayerCraftily(C,D,G,E)}};IFactorLayersHandler.prototype.readCustomLayersIconsForDynamicLegend=function(A,D){if(D.layerName=="informationpoint"){var C=this.getCustomLayerIconsAndDesc(A);IFactorLayersHandler.customLayersIcons[D.layerName]=C}else{if(D.layerName=="informationarea"){var C=this.getCustomLayerIconsAndDesc(A);if(C!=null){for(var B=0;B<C.length;B++){C[B]=C[B].replace(/.ico/,".gif")}}IFactorLayersHandler.customLayersIcons[D.layerName]=C}}};IFactorLayersHandler.prototype.getCustomLayerIconsAndDesc=function(E){if(E!=null){var C=iFactor.common.createXMLRequest();var B=E;B=B+iFactor.common.uniqueRequestTag(true);C.open("GET",B,false);C.send(null);if((C.readyState==4)&&(C.status!=404)){var F,D;var I;var L=[];var K=C.responseXML;var H=K.getElementsByTagName("item");for(F=0;F<H.length;F++){var A=H[F];var I=this.getCustomLayerIcon(A);var J=this.getCustomLayerDescription(A);var G=new Boolean(true);for(D=0;D<L.length;D++){if(I==L[D].split("|")[0]){G=false;break}}if(G){L[L.length]=I+"|"+J}}return L}}return null};IFactorLayersHandler.customlayersExternalNames={"informationarea_1.ico":"ETR Severity 1","informationarea_2.ico":"ETR Severity 2","informationarea_3.ico":"ETR Severity 3","informationpoint_1.gif":"Dry Ice Distribution","informationpoint_2.gif":"Outreach Center","informationpoint_3.gif":"Emergency Shelter"};IFactorLayersHandler.prototype.getCustomLayerDescription=function(C){var B=C.getElementsByTagName("icon")[0];var A=iFactor.common.getXMLNodeValue(B);var E=A.split("/");var D=E[E.length-1];var F=IFactorLayersHandler.customlayersExternalNames[D];if(F==null){F="Not found"}return F};IFactorLayersHandler.prototype.getCustomLayerIcon=function(B){var A=B.getElementsByTagName("icon")[0];var C=iFactor.common.getXMLNodeValue(A);return C};
