__stormcenter.prototype.loadStormCenter=function(){this.variablesInitialization();this.checkBrowserCompatibility();this.readConfigFromCookies();this.initialiseLayers();this.initialiseVisibilityControl();this.initialiseLayerVisibility(true);this.ensureControlStates();this.initialiseBounds();this.initialiseTimer();this.setMapDivSize();this.setFavoritesOptions();this.tabshow("legend");try{if(window.document.getElementById("token")){var D=window.document.getElementById("token").innerHTML}this.map=new VEMap("map");if(D!=null&&D!=""){this.map.SetClientToken(D)}}catch(G){alert("The map is currently unavailable. Please wait a few moments and refresh your browser window.");return }var E=this.getStartLatLngZoom();var F=new VELatLong(E[0],E[1]);if(this.map.EnableShapeDisplayThreshold){this.map.EnableShapeDisplayThreshold(false)}this.map.SetDashboardSize(VEDashboardSize.Normal);var B=new VEMapOptions();B.EnableBirdseye=false;this.map.LoadMap(F,E[2],iFactor.common.config.map_type,null,null,false,null,B);this.map.AttachEvent("onchangeview",function(){iFactor.StormCenter.onMapPan()});this.map.AttachEvent("onchangemapstyle",function(){iFactor.StormCenter.saveMapState()});this.map.AttachEvent("onmouseover",function(I){iFactor.StormCenter.mouseShapeHandler(I)});this.map.AttachEvent("onmouseout",function(I){iFactor.StormCenter.mouseShapeHandler(I)});this.map.AttachEvent("ontokenexpire",function(I){iFactor.StormCenter.handleTokenExpire(I)});this.map.AttachEvent("ontokenerror",function(I){iFactor.StormCenter.handleTokenError(I)});this.providerChartPanel=null;var A=iFactor.common.getArguments()["x"];var H=iFactor.common.getArguments()["y"];if((A!=null)&&(A!="")&&(H!=null)&&(H!="")){this.zoomToXY(A,H)}else{this.onMapPan()}var C=document.getElementById("MSVE_navAction_topBar");if(C!=null){C.removeChild(document.getElementById("MSVE_navAction_showLabels"));C.removeChild(document.getElementById("MSVE_navAction_separator2"));C.removeChild(document.getElementById("MSVE_navAction_separator3"))}};__stormcenter.prototype.getFullPathDataOverviewFile=function(){return iFactor.common.config.data_directory+"/data.xml"};__stormcenter.prototype.setControlsToActivateFromDataFile=function(C){if(C!=null){var A=C.getElementsByTagName("storm_mode").item(0);var B=iFactor.common.getXMLNodeValue(A);if(B!=null&&B=="y"){this.doSetVisibilityForControl("areascontrol",true,null)}else{this.doSetVisibilityForControl("locationscontrol",true,null)}}else{this.doSetVisibilityForControl("areascontrol",true,null)}this.setVisibilityAccordingToCurrentConfiguration()};__stormcenter.prototype.setCustomVisibilityForInitialPageLoad=function(){var A=parseInt(iFactor.common.config.thematic_threshold);var C=iFactor.common.config.thematic_default_display;var B=this.numOutages;if(C=="on"||(B>=A&&C=="auto")){this.doSetVisibilityForControl("areascontrol",true,null)}else{this.doSetVisibilityForControl("locationscontrol",true,null)}};__stormcenter.prototype.zoomToThematicArea=function(B,A){this.setVisibilityForControl("locationscontrol",true);var C=new VELatLong(B,A);this.map.SetCenterAndZoom(C,10)};__stormcenter.prototype.variablesInitialization=function(){this.outsideBoundsMessage=null;this.howSorted=new Array();this.lastZoomLevel=new Object();this.lastZoomLevelPointLayers=new Object();this.currentIndicesForPointLayers=new Object();this.reloadLayers=new Object();this.lastDateGenerated=null;this.map=null;this.validCharacters="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ,";this.orderedVisibilityControls=new Array()};__stormcenter.prototype.saveMapState=function(){if(iFactor.common.cookiesEnabled()&&this.map!=null){var H=new Object();var C=window.document;H.map_type=this.map.GetMapStyle();var G=this.map;var A=GetCenterLatLong(G);var E=A.Latitude;var F=A.Longitude;var I=GetZoomLevel(G);var D=E+","+F+","+I;H.homepage=D;var B="";for(name in H){if(B!=""){B=B+"|"}B=B+name+":"+H[name]}iFactor.common.createCookie("state",B,365)}};__stormcenter.prototype.clearLayerVisibility=function(){this.currentVisibleLayers=new Object();this.currentPossibleVisibleLayers=new Object()};__stormcenter.prototype.initialiseVisibilityControl=function(){var C;var B;var E;var D=new Array;this.lastControlForGroup=new Object();this.visibilityControl=new Object();for(C=0;C<iFactor.common.configVisibility.length;C=C+1){E=iFactor.common.configVisibility[C];this.visibilityControl[E.name]=E}for(C=0;C<iFactor.common.configVisibility.length;C=C+1){E=iFactor.common.configVisibility[C];for(B=0;B<E.sub_controls.length;B++){var A=E.sub_controls[B];this.visibilityControl[A].parent_control=E.name}}for(C=0;C<iFactor.common.configVisibility.length;C=C+1){E=iFactor.common.configVisibility[C];if(this.isMasterControl(E)){D[D.length]=E.name}}this.getOrderedControls(D,this.orderedVisibilityControls)};__stormcenter.prototype.getOrderedControls=function(E,C){if(E==null||E==""||E.length==0){return[]}var B;var D;var A=new Array();for(B=0;B<E.length;B=B+1){D=this.visibilityControl[E[B]];A[A.length]=D}A.sort(function(G,F){if(G.control_to_change_when_out_of_zoom==F.name){return -1}else{return 1}});for(B=0;B<A.length;B=B+1){D=A[B];C[C.length]=D;listOfSubControlsName=D.sub_controls;this.getOrderedControls(listOfSubControlsName,C)}};__stormcenter.prototype.initialiseLayerVisibility=function(B){if(B==true){this.clearLayerVisibility()}var A;var C;for(A=0;A<iFactor.common.configVisibility.length;A=A+1){C=iFactor.common.configVisibility[A];if(this.isMasterControl(C)){this.doSetInitialVisibilityForControl(C.name)}}this.setVisibilityAccordingToCurrentConfiguration()};__stormcenter.prototype.isMasterControl=function(A){if(A==null){return false}if(A.parent_control==null||A.parent_control==""){return true}else{return false}};__stormcenter.prototype.setVisibilityForControl=function(B,A){this.doSetVisibilityForControl(B,A,null);this.adjustControlsActiveDependingOnZoomLevel(GetZoomLevel(this.map));this.setVisibilityAccordingToCurrentConfiguration();this.updateLegend();this.saveMapState()};__stormcenter.prototype.togglePointLayer=function(A,B){var C=this.pointLayers[B];if(C!=null){if(A){C.Show()}else{C.Hide()}this.saveMapState()}};__stormcenter.prototype.toggleTileLayer=function(A,B){var C=this.tileLayers[B];if(C!=null){if(A){this.map.ShowTileLayer(B)}else{this.map.HideTileLayer(B)}this.saveMapState()}};__stormcenter.prototype.doSetInitialVisibilityForControl=function(D){var C=this.visibilityControl[D];if(C!=null){var B=C.checked_status;var A=C.enabled_status;this.changeGroupIfNecessary(C,B);if(B!=null){this.toggleIfNecessary(C.web_control_name,B);this.doSetInitialVisibilityForSubControls(C)}if(A!=null){this.enableIfNecessary(C.web_control_name,A)}}};__stormcenter.prototype.doSetVisibilityForControl=function(D,B,A){if(D==null||D==""){return }var C=this.visibilityControl[D];if(C!=null){this.changeGroupIfNecessary(C,B);if((B==true)||(A==true&&C.checked_status==true)){this.doSetVisibilityForSubControls(C,null,true)}else{if((B==false)||(A==false)||(A==true&&C.checked_status==false)){this.doSetVisibilityForSubControls(C,null,false)}}if(B!=null){C.checked_status=B;this.toggleIfNecessary(C.web_control_name,B)}if(A!=null&&!C.blocked_status){C.enabled_status=A;this.enableIfNecessary(C.web_control_name,A)}}};__stormcenter.prototype.changeGroupIfNecessary=function(E,B){var D=E.name;var C=E.group_name;if(C!=null&&C!=""&&B==true){var A=this.lastControlForGroup[C];if(A!=null&&A!=D){this.doSetVisibilityForControl(A,false,null)}this.lastControlForGroup[C]=D}};__stormcenter.prototype.doSetInitialVisibilityForSubControls=function(C){var B=C.sub_controls;if(B!=null&&B!=""){var A;for(A=0;A<B.length;A=A+1){this.doSetInitialVisibilityForControl(B[A])}}};__stormcenter.prototype.doSetVisibilityForSubControls=function(E,C,A){var D=E.sub_controls;if(D!=null&&D!=""){var B;for(B=0;B<D.length;B=B+1){this.doSetVisibilityForControl(D[B],C,A)}}};__stormcenter.prototype.setVisibilityAccordingToCurrentConfiguration=function(){var B;var A=new Array();var C=new Array();for(B=0;B<iFactor.common.configVisibility.length;B=B+1){control=iFactor.common.configVisibility[B];if(this.isMasterControl(control)){if(control.checked_status==true){C[C.length]=control}else{A[A.length]=control}}}for(B=0;B<A.length;B=B+1){this.setLayerVisibilityForControl(A[B],false)}for(B=0;B<C.length;B=B+1){this.setLayerVisibilityForControl(C[B],true)}};__stormcenter.prototype.setLayerVisibilityForControl=function(F,A){var D;var B;var C;var E;if(F!=null){if(A==false||A==true&&F.checked_status==false){E=false}else{if(A==true){E=true}}this.setLayerListVisibility(F.layers,E);for(D=0;D<F.sub_controls.length;D=D+1){B=F.sub_controls[D];C=this.visibilityControl[B];this.setLayerVisibilityForControl(C,E)}}};__stormcenter.prototype.setLayerListVisibility=function(C,A){if(C!=null&&C!=""){var B;for(B=0;B<C.length;B=B+1){layerName=C[B];this.setLayerVisibility(layerName,A)}}};__stormcenter.prototype.setLayerVisibility=function(B,A){if(A==null){A=false}if(A){this.currentPossibleVisibleLayers[B]=true;if(this.map!=null){var C=GetZoomLevel(this.map);if(this.pointLayers[B]!=null&&!this.isLayerVisibleAtZoomLevel(B,C)){A=false}}}else{this.currentPossibleVisibleLayers[B]=null}this.setCurrentLayerVisibility(B,A)};__stormcenter.prototype.setCurrentLayerVisibility=function(B,A){if(A==null){A=false}if(A){this.currentVisibleLayers[B]=true}else{this.currentVisibleLayers[B]=null}this.togglePointLayer(A,B);this.toggleTileLayer(A,B)};__stormcenter.prototype.toggleIfNecessary=function(C,A){var B=window.document.getElementById(C);if(A!=null&&B!=null){if(A!=true&&A!=false){A=(A.toLowerCase()=="true")}B.checked=A}};__stormcenter.prototype.enableIfNecessary=function(C,A){var B=window.document.getElementById(C);if(A!=null&&B!=null){if(A!=true&&A!=false){A=(A.toLowerCase()=="true")}B.disabled=!A}};__stormcenter.prototype.initialiseLayers=function(){this.layersDefinition=new Object();this.pointLayerNames=new Array();this.tileLayerNames=new Array();contTileLayers=0;contPointlayers=0;for(i=0;i<iFactor.common.configLayers.length;i=i+1){var B=iFactor.common.configLayers[i];var A=B.layer_name;if(B.type=="tilelayer"){this.tileLayerNames[contTileLayers]=A;contTileLayers=contTileLayers+1}else{if((B.type=="indexvectorlayer")||(B.type=="simplevectorlayer")){this.pointLayerNames[contPointlayers]=A;contPointlayers=contPointlayers+1}}this.layersDefinition[B.layer_name]=B}this.pointLayers=new Object();this.tileLayers=new Object()};__stormcenter.prototype.initialiseBounds=function(){this.lastZoom=new Array(null,null)};__stormcenter.prototype.initialiseTimer=function(){this.timerId=null};__stormcenter.prototype.timerExpired=function(){this.onMapPan()};__stormcenter.prototype.startTimer=function(){var B=function(){iFactor.StormCenter.timerExpired()};var A=parseInt(iFactor.common.config.update_interval)*1000;this.timerId=window.setInterval(B,A)};__stormcenter.prototype.onMapPan=function(){this.cancelTimer();var A=this.ensureZoomLevel();if(A!=GetZoomLevel(this.map)){this.map.SetCenterAndZoom(GetCenterLatLong(this.map),A)}if(this.inAllowableBounds()){this.storeBounds();this.updateStatusArea();this.updateAlertsHeader();this.controlLayerVisibility();this.updateTileLayers();this.updateVectorLayers();this.startTimer()}else{this.returnToLastBounds()}this.saveMapState();this.outsideBoundsMessage=null};__stormcenter.prototype.isLayerVisible=function(A){isVisible=this.currentVisibleLayers[A];if(isVisible==true){return true}else{return false}};__stormcenter.prototype.existOutages=function(){if(this.numOutages!=null&&this.numOutages>0){return true}else{return false}};__stormcenter.prototype.updateTileLayers=function(){var C=true;var A=null;for(i=0;i<this.tileLayerNames.length;i=i+1){var B=this.tileLayerNames[i];A=this.tileLayers[B];if(this.isForcedToReloadLayer(B)){if(A!=null){this.removeTileLayer(B)}this.clearForcedToReloadLayer(B);if(this.isLayerOutageDependent(B)){if(!this.existOutages()){C=false}}}else{if(this.isLayerOutageDependent(B)){if(this.existOutages()){if(A!=null){C=false}}else{if(A!=null){this.removeTileLayer(B)}C=false}}else{if(A!=null){C=false}}}if(C){this.addTileLayer(B)}}};__stormcenter.prototype.loadAllConfiguredTileLayers=function(){for(i=0;i<this.tileLayerNames.length;i=i+1){var A=this.tileLayerNames[i];this.addTileLayer(A)}};__stormcenter.prototype.addTileLayer=function(B){var D=this.getSourceTilesDirectory(B);if(D!=null){var C=new VETileSourceSpecification(B,D+"/%4."+this.extensionOfTileLayer(B));this.setTileSourceSpecification(B,C);var A=this.isLayerVisible(B);this.tileLayers[B]=C;this.map.AddTileLayer(C,A);if(A){this.map.ShowTileLayer(B);this.map.ShowTileLayer(B)}else{this.map.HideTileLayer(B);this.map.HideTileLayer(B)}}};__stormcenter.prototype.getSourceTilesDirectory=function(D){var G=this.layersDefinition[D].source[0].data_directory;var E=iFactor.common.createXMLRequest();var A=G+"/metadata.xml";A=A+iFactor.common.uniqueRequestTag(true);E.open("GET",A,false);E.send(null);if((E.readyState==4)&&(E.status!=404)){var F=E.responseXML;var C=F.getElementsByTagName("directory")[0];var B=iFactor.common.getXMLNodeValue(C);return G+"/"+B}return null};__stormcenter.prototype.getDefinitionProperty=function(D,C,B){var A=B;var E=this.layersDefinition[D];if(E!=null){var F=this.layersDefinition[D][C];if(F!=null&&F!=""&&F!=[]){A=F}}return A};__stormcenter.prototype.setTileSourceSpecification=function(G,N){N.MinZoomLevel=parseInt(this.getDefinitionProperty(G,"min_zoom",iFactor.common.config.max_zoom_level));N.MaxZoomLevel=parseInt(this.getDefinitionProperty(G,"max_zoom",iFactor.common.config.min_zoom_level));var K=this.getDefinitionProperty(G,"zindex",null);if(K!=null&&K!=""){N.ZIndex=parseInt(K)}var L=this.getDefinitionProperty(G,"bounds",null);if(L!=null&&L!=[]){var E;var P=0;var B=new Array();for(E=0;E<L.length;E=E+1){var I=L[E].split(",");if(I.length==4){var A=parseFloat(I[0]);var M=parseFloat(I[1]);var F=parseFloat(I[2]);var C=parseFloat(I[3]);var O=new VELatLong(C,A);var D=new VELatLong(M,F);B[P]=new VELatLongRectangle(O,D);P=P+1}}if(B.length!=0){N.Bounds=B}}var H=this.getDefinitionProperty(G,"opacity",null);if(H!=null&&H!=""){var J=null;if(/MSIE (\d+\.\d+);/.test(navigator.userAgent)){J=new Number(RegExp.$1)}if(J!=6){N.Opacity=parseFloat(H)}}};__stormcenter.prototype.removeTileLayer=function(A){this.map.DeleteTileLayer(A);this.tileLayers[A]=null};__stormcenter.prototype.isLayerOutageDependent=function(A){var B=this.layersDefinition[A].outage_dependent;if(B=="yes"){return true}else{return false}};__stormcenter.prototype.updateVectorLayers=function(){var C;for(C=0;C<this.pointLayerNames.length;C=C+1){var B=this.pointLayerNames[C];if(this.isLayerOutageDependent(B)){if(this.existOutages()){this.readIfNecessaryVectorLayer(B)}else{var A=this.pointLayers[B];if(A!=null){A.DeleteAllShapes()}this.clearForcedToReloadLayer(B)}}else{this.readIfNecessaryVectorLayer(B)}}};__stormcenter.prototype.readIfNecessaryVectorLayer=function(B){var E=GetZoomLevel(this.map);if(this.isAValidVectorLayer(B)){zoomLevelChanged=this.hasZoomLevelChangedForLayer(B,E);if(zoomLevelChanged==false){mapPanningDone=true}else{mapPanningDone=false}forceLayerReload=this.isForcedToReloadLayer(B);this.clearForcedToReloadLayer(B);var A=this.pointLayers[B];if(A==null||forceLayerReload||this.layerNeedToBeLoaded(B,zoomLevelChanged,mapPanningDone)){if(A==null||forceLayerReload||this.layerNeedToBeCleaned(B,zoomLevelChanged,mapPanningDone)){if(A!=null){A.DeleteAllShapes()}this.initialiseIndicesForLayer(B)}var C;for(C=0;C<this.numberOfDataSources(B);C=C+1){var D=this.getDataSource(B,C);if(D!=null){this.readVectorLayer(B,D)}}}this.cacheLastZoomLevelForLayer(B,E)}};__stormcenter.prototype.initialiseIndicesForLayer=function(A){var B=this.typeOfVectorLayer(A);if(B=="indexvectorlayer"){if(this.currentIndicesForPointLayers==null){this.currentIndicesForPointLayers=new Object()}this.currentIndicesForPointLayers[A]=new Object()}};__stormcenter.prototype.readVectorLayer=function(A,D){var C=D.data_directory;if(C!=null){toRequest=C+"/metadata.xml";toRequest=toRequest+iFactor.common.uniqueRequestTag(true);var B=iFactor.common.createXMLRequest();B.onreadystatechange=function(){iFactor.StormCenter.doReadVectorLayer(B,A,D)};B.open("GET",toRequest,true);B.send(null)}};__stormcenter.prototype.doReadVectorLayer=function(D,G,A){if((D.readyState==4)&&(D.status!=404)){var J=D.responseXML;var H=this.typeOfVectorLayer(G);var B=J.getElementsByTagName("directory");var F;for(F=0;F<B.length;F=F+1){var C=B[F];var E=iFactor.common.getXMLNodeValue(C);var I=A.data_directory;var K=I+"/"+E;if(H=="indexvectorlayer"){this.doReadIndexVectorLayer(G,K)}else{if(H=="simplevectorlayer"){this.doReadSimpleVectorLayer(G,K,A.files)}}}}};__stormcenter.prototype.doReadSimpleVectorLayer=function(B,D,E){var C;for(C=0;C<E.length;C=C+1){geoRssName=D+"/"+E[C];var A=this.isLayerVisible(B);this.importPointLayer(geoRssName,B,A)}};__stormcenter.prototype.doReadIndexVectorLayer=function(E,H){var C;var B=null;var A=GetZoomLevel(this.map);var G=this.getMapSpatialIndices(A,E);var D=this.isLayerVisible(E);if(this.getIndicesForLayerSource(E,H)==null){for(C=0;C<G.length;C=C+1){B=H+"/"+G[C]+".xml";this.importPointLayer(B,E,D)}this.setIndicesForLayerSource(E,H,G)}else{for(C=0;C<G.length;C=C+1){var F=G[C];var I=this.existIndexInIndicesForLayerSource(E,H,F);if(!I){B=H+"/"+F+".xml";this.importPointLayer(B,E,D);this.addAtTheEndIndexInIndicesForLayerSource(E,H,F)}}}};__stormcenter.prototype.pointLayerLoaded=function(D,G){var F;var N=D.GetShapeCount();var J=parseInt(this.getDefinitionProperty(G,"min_zoom",iFactor.common.config.max_zoom_level));var C=parseInt(this.getDefinitionProperty(G,"max_zoom",iFactor.common.config.min_zoom_level));var L=this.getDefinitionProperty(G,"zindex_icon",null);var K=this.getDefinitionProperty(G,"zindex_shape",null);if(L!=null){L=parseInt(L)}if(K!=null){K=parseInt(K)}for(F=0;F<N;F=F+1){var M=D.GetShapeByIndex(F);try{M.SetCustomIcon("<img src='"+M.IconId+"'/>")}catch(H){}try{var I=M.IconId;I=I.split("/");I=I[I.length-1];I=I.split(".")[0];var B=this.getStyleProperty(G,I,"area_color");if(B!=null){M.SetFillColor(B)}var E=this.getStyleProperty(G,I,"border_color");if(E!=null){M.SetLineColor(E)}var A=this.getStyleProperty(G,I,"border_width");if(A!=null){M.SetLineWidth(A)}if(L!=null||K!=null){M.SetZIndex(L,K)}}catch(H){}}};__stormcenter.prototype.getStyleProperty=function(B,D,A){var C;C=iFactor.common.configStyles[D+"_"+A];if(C==null){C=iFactor.common.configStyles[B+"_"+A];if(C==null){C=iFactor.common.configStyles["defaultstyle_"+A]}}return C};__stormcenter.prototype.getMapSpatialIndices=function(C,F){var E=this.map.LatLongToPixel(GetCenterLatLong(this.map));var I=this.map.GetLeft();var Q=this.map.GetTop();var N=2*E.x+I;var J=2*E.y+Q;var H=new Array();var M=new Array();H[0]=this.map.PixelToLatLong(new VEPixel(0,0));H[1]=this.map.PixelToLatLong(new VEPixel(0,2*E.y));H[2]=this.map.PixelToLatLong(new VEPixel(2*E.x,0));H[3]=this.map.PixelToLatLong(new VEPixel(2*E.x,2*E.y));var B=6;var P=(H[3].Longitude-H[0].Longitude)/(B-1);var O=(H[0].Latitude-H[3].Latitude)/(B-1);var G=null;var K=null;var A=null;var D=0;var L=this.typeOfIndexGeneratorForLayer(F);for(i=0;i<B;i=i+1){K=H[0].Longitude+i*P;for(j=0;j<B;j++){G=H[3].Latitude+j*O;A=L(K,G,C-1);isNew=true;D=-1;while(isNew&&(D++<M.length)){if(M[D]==A){isNew=false}}if(isNew){M[M.length]=A}}}M=this.getModifiedSpatialIndices(M);return M};__stormcenter.prototype.getSpatialIndicesForPoint=function(E,D){var A=E.Longitude;var C=E.Latitude;var B=this.getSpatialIndexForLngLatZoom(A,C,D);if(B.length>1){B=B.substr(0,B.length-2);for(i=0;i<suffixes.length;i=i+1){for(j=0;j<suffixes.length;j++){indices[indices.length]=B+suffixes[i]+suffixes[j]}}}else{indices=suffixes}indices=this.getModifiedSpatialIndices(indices);return indices};__stormcenter.prototype.getIndicesForLayerSource=function(B,A){var C=this.currentIndicesForPointLayers[B];if(C==null){this.currentIndicesForPointLayers[B]=new Object()}return this.currentIndicesForPointLayers[B][A]};__stormcenter.prototype.setIndicesForLayerSource=function(B,A,D){var C=this.currentIndicesForPointLayers[B];if(C==null){this.currentIndicesForPointLayers[B]=new Object()}this.currentIndicesForPointLayers[B][A]=D};__stormcenter.prototype.existIndexInIndicesForLayerSource=function(C,A,B){var F=this.currentIndicesForPointLayers[C];if(F==null){this.currentIndicesForPointLayers[C]=new Object()}var E=this.currentIndicesForPointLayers[C][A];if(E==null){this.currentIndicesForPointLayers[C][A]=new Array()}var D;for(D=0;D<E.length;D=D+1){if(E[D]==B){return true}}return false};__stormcenter.prototype.addAtTheEndIndexInIndicesForLayerSource=function(D,B,C){var F=this.currentIndicesForPointLayers[D];if(F==null){this.currentIndicesForPointLayers[D]=new Object()}var E=this.currentIndicesForPointLayers[D][B];if(E==null){this.currentIndicesForPointLayers[D][B]=new Array()}var A=E.length;E[A]=C};__stormcenter.prototype.isForcedToReloadLayer=function(A){var B=this.reloadLayers[A];if(B==true){return true}else{return false}};__stormcenter.prototype.forceToReloadLayersOutageDependent=function(){var B;for(B=0;B<this.pointLayerNames.length;B=B+1){var A=this.pointLayerNames[B];if(this.isLayerOutageDependent(A)){this.reloadLayers[A]=true}}};__stormcenter.prototype.clearForcedToReloadLayer=function(A){this.reloadLayers[A]=null};__stormcenter.prototype.numberOfDataSources=function(A){var B=this.layersDefinition[A];if(B==null){return 0}return B.source.length};__stormcenter.prototype.getDataSource=function(A,B){var C=this.layersDefinition[A];if(C==null){return null}return C.source[B]};__stormcenter.prototype.layerNeedToBeLoaded=function(A,F,E){var D=this.layersDefinition[A];if(D==null){return false}var C=D.type;var G=D.map_refresh_event;if(C=="indexvectorlayer"){return true}else{if(C=="simplevectorlayer"){var B;for(B=0;B<G.length;B=B+1){if(G[B]=="zoom"&&F){return true}else{if(G[B]=="pan"&&E){return true}}}}}return false};__stormcenter.prototype.layerNeedToBeCleaned=function(A,F,E){var D=this.layersDefinition[A];if(D==null){return false}var C=D.type;var G=D.map_refresh_event;if(C=="indexvectorlayer"&&F){return true}else{if(C=="simplevectorlayer"){var B;for(B=0;B<G.length;B=B+1){if(G[B]=="zoom"&&F){return true}else{if(G[B]=="pan"&&E){return true}}}}}return false};__stormcenter.prototype.isAValidVectorLayer=function(A){var B=this.layersDefinition[A];if(B==null){return false}if((B.type=="indexvectorlayer")||(B.type=="simplevectorlayer")){return true}return false};__stormcenter.prototype.typeOfVectorLayer=function(A){var B=this.layersDefinition[A];if(B==null){return null}return B.type};__stormcenter.prototype.extensionOfTileLayer=function(A){var B=this.layersDefinition[A];if(B==null){return null}return B.file_extension};__stormcenter.prototype.hasZoomLevelChangedForLayer=function(A,C){var B=true;if(C==this.lastZoomLevelPointLayers[A]){B=false}return B};__stormcenter.prototype.cacheLastZoomLevelForLayer=function(A,B){this.lastZoomLevelPointLayers[A]=B};__stormcenter.prototype.ensureControlStates=function(){var B=this.getFullPathDataOverviewFile();B=B+iFactor.common.uniqueRequestTag(true);B=B.fixUrlSeparator();var E=iFactor.common.createXMLRequest();E.open("GET",B,false);E.send(null);if((E.readyState==4)&&(E.status!=404)){var F=E.responseXML;this.setControlsToActivateFromDataFile(F)}var A=["favoritename","address_value"];var C=0;var G=window.document;var D=null;for(C=0;C<A.length;C=C+1){if(G.getElementById(A[C])!=null){G.getElementById(A[C]).value=""}}};__stormcenter.prototype.controlLayerVisibility=function(){var C=GetZoomLevel(this.map);var B=(this.lastZoomLevel!=C);var A=false;if(B){this.lastZoomLevel=C;if(this.isPageLoaded==null||this.isPageLoaded==false){this.setCustomVisibilityForInitialPageLoad();this.isPageLoaded=true;A=true}A=(this.adjustControlsActiveDependingOnZoomLevel(C)||A);if(A){this.setVisibilityAccordingToCurrentConfiguration()}this.setShapeVisibilityDependingOnZoomLevel(C);this.updateLegend()}};__stormcenter.prototype.adjustControlsActiveDependingOnZoomLevel=function(G){var C;var E;var F;var B;var A=false;var D=new Object();for(C=0;C<this.orderedVisibilityControls.length;C=C+1){E=this.orderedVisibilityControls[C];D[E.name]=(E.checked_status&&this.isParentCheckedAndEnabled(E))}for(C=0;C<this.orderedVisibilityControls.length;C=C+1){E=this.orderedVisibilityControls[C];B=this.isControlAllowedToThisZoomLevel(E,G);if(B){this.doSetVisibilityForControl(E.name,null,true)}else{F=this.getControlToChangeInSameGroup(E,G);if(D[E.name]==true&&F!=null){this.doSetVisibilityForControl(F.name,true,null)}this.doSetVisibilityForControl(E.name,false,false)}}for(C=0;C<this.orderedVisibilityControls.length;C=C+1){E=this.orderedVisibilityControls[C];if(D[E.name]!=(E.checked_status&&this.isParentCheckedAndEnabled(E))){A=true}}return A};__stormcenter.prototype.getControlToChangeInSameGroup=function(C,F){if(C!=null){var E=C.group_name;if(E!=null&&E!=""){var B=C.control_to_change_when_out_of_zoom;if(B!=null&&B!=""){controlToChange=this.visibilityControl[B];if(controlToChange!=null){return controlToChange}}var A;for(A=0;A<iFactor.common.configVisibility.length;A=A+1){var D=iFactor.common.configVisibility[A];if(D.group_name==E&&D.name!=C.name&&this.isControlAllowedToThisZoomLevel(D,F)){return D}}}}return null};__stormcenter.prototype.isControlAllowedToThisZoomLevel=function(A,B){if(A.min_zoom!=null&&A.min_zoom!=""&&B<A.min_zoom){return false}if(A.max_zoom!=null&&A.max_zoom!=""&&B>A.max_zoom){return false}return true};__stormcenter.prototype.isParentCheckedAndEnabled=function(C){var A=C.parent_control;if(A==null||A==""){return true}var B=this.visibilityControl[A];if(B!=null){if(B.checked_status==true&&B.enabled_status==true){return true}else{return false}}else{return true}};__stormcenter.prototype.setShapeVisibilityDependingOnZoomLevel=function(D){var C;for(C=0;C<this.pointLayerNames.length;C=C+1){var B=this.pointLayerNames[C];if(this.currentPossibleVisibleLayers[B]==true){var A=this.isLayerVisibleAtZoomLevel(B,D);this.setCurrentLayerVisibility(B,A)}}};__stormcenter.prototype.isLayerVisibleAtZoomLevel=function(B,D){var C=parseInt(this.getDefinitionProperty(B,"min_zoom",iFactor.common.config.max_zoom_level));var A=parseInt(this.getDefinitionProperty(B,"max_zoom",iFactor.common.config.min_zoom_level));if(D<C||D>A){return false}else{return true}};__stormcenter.prototype.importPointLayer=function(B,C,A){this.doImportPointLayer(null,B,C,A)};__stormcenter.prototype.doImportPointLayer=function(B,C,D,A){var F=D;var E=this.pointLayers[F];if(E==null){E=new VEShapeLayer();this.pointLayers[F]=E}if(!A){E.Hide()}if(iFactor.common.config.disable_map_msg_box==true){this.map.ShowMessageBox=false}aSource=new VEShapeSourceSpecification(VEDataType.GeoRSS,C,E);this.map.ImportShapeLayerData(aSource,function(G){iFactor.StormCenter.pointLayerLoaded(G,D)},false)};__stormcenter.prototype.tabshow=function(D){var F=document.getElementById(D+"_tab");var H=document.getElementById(D+"_content");if(D=="legend"){document.getElementById("legend_radio").style.display="block";if(this.visibilityControl.locationscontrol.checked_status){H=document.getElementById("outages_content")}else{if(this.visibilityControl.areascontrol.checked_status){H=document.getElementById("thematic_content")}}}else{if(D=="summary"||D=="learn"){document.getElementById("legend_radio").style.display="none"}}var E=F.parentNode.getElementsByTagName("LI");var C=E.length;for(var G=0;G<C;G++){if(E[G].id==F.id){E[G].className="on"}else{E[G].className=""}}var B=H.parentNode.getElementsByTagName("DIV");var A=B.length;for(G=0;G<A;G++){if(B[G].className=="showheadlines"){if(B[G].id==H.id){B[G].style.display="block"}else{B[G].style.display="none"}}}};__stormcenter.prototype.setMapDivSize=function(){var A=document.getElementById("content").clientHeight+15;var B=document.getElementById("content").clientWidth-225;if((document.getElementById)&&(!document.all)){A=A+"px";B=B+"px"}window.document.getElementById("map").style.height=A;window.document.getElementById("map").style.width=B};__stormcenter.prototype.mapResize=function(){if(window.innerWidth){myWidth=window.innerWidth}else{if(document.documentElement.clientWidth==0){myWidth=document.body.clientWidth}else{myWidth=document.documentElement.clientWidth}}if(window.innerHeight){myHeight=window.innerHeight}else{if(document.documentElement.clientHeight==0){myHeight=document.body.clientHeight}else{myHeight=document.documentElement.clientHeight}}var A=myHeight-132;var B=myWidth-247;if((document.getElementById)&&(!document.all)){A=A+"px";B=B+"px";window.document.getElementById("map").style.height=A;window.document.getElementById("map").style.width=B}else{this.map.Resize(B,A)}};__stormcenter.prototype.updateStatusArea=function(){var A=this.getFullPathDataOverviewFile();A=A+iFactor.common.uniqueRequestTag(true);A=A.fixUrlSeparator();var F=window.document;var E=iFactor.common.createXMLRequest();E.open("GET",A,false);E.send(null);if((E.readyState==4)&&(E.status!=404)){var C=E.responseXML;var B=C.getElementsByTagName("total_outages").item(0);this.numOutages=iFactor.common.getXMLNodeValue(B);F.getElementById("num_outages_text").innerHTML="<b>Active Outages:</b> "+this.numOutages;B=C.getElementsByTagName("total_customers").item(0);this.numCustomersAffected=iFactor.common.getXMLNodeValue(B);F.getElementById("num_custs_text").innerHTML="<b>Affected Customers:</b> "+this.numCustomersAffected;var D=iFactor.common.getXMLNodeValue(C.getElementsByTagName("date_generated").item(0));if(D!=this.lastDateGenerated){this.lastDateGenerated=D;this.forceToReloadLayersOutageDependent()}}};
