__stormcenter.prototype.controlLayerVisibility=function(C,B){var A=false;if(this.isPageLoaded==null||this.isPageLoaded==false){this.setCustomVisibilityAccordingDataFile(true);this.isPageLoaded=true;A=true}else{A=this.setCustomVisibilityAccordingDataFile(false)}A=(this.visibilitiesHandler.adjustControlsActiveDependingOnZoomLevel(C)||A);if(A){this.visibilitiesHandler.setVisibilityAccordingToCurrentConfiguration()}this.visibilitiesHandler.setShapeVisibilityDependingOnZoomLevel(C);this.updateLegend()};__stormcenter.prototype.setCustomVisibilityAccordingDataFile=function(E){var B=false;var A=parseInt(iFactor.common.config.thematic_threshold);var D=this.dataMonitor.getVariableValue("storm_mode");var C=this.numOutages=this.dataMonitor.getVariableValue("total_outages");if(C==null){C=0}if(D=="y"||(D=="p"&&C>=A)){if(E||this.visibilitiesHandler.visibilityControl.areascontrol.checked_status!=true){this.visibilitiesHandler.doSetVisibilityForControl("areascontrol",true,null);B=true}}else{if(E||this.visibilitiesHandler.visibilityControl.locationscontrol.checked_status!=true){this.visibilitiesHandler.doSetVisibilityForControl("locationscontrol",true,null);B=true}}return B};__stormcenter.prototype.updateSummaryTab=function(){var H=this.dataMonitor.getVariableValue("total_outages");var B=this.dataMonitor.getVariableValue("total_customers");var A=this.dataMonitor.getVariableValue("date_generated");var D=this.dataMonitor.getVariableValue("servlet_interval");this.numOutages=H;var G=window.document;if(H==null){H=""}G.getElementById("num_outages_text").innerHTML="<b>Active Outages:</b> "+H;if(B==null){B=""}G.getElementById("num_custs_text").innerHTML="<b>Affected Customers:</b> "+B;if(A==null){A=""}G.getElementById("last_updated").innerHTML="<b>Last Updated:</b> "+A;var F;if(D==null){F=""}else{var E="";var C=D/60;if(C>60&&C%60==0){E=Math.floor(C/60)+" hours."}else{if(C>60){E=Math.floor(C/60)+" hours, "+Math.floor(C%60)+" minutes."}else{E=C+" minutes."}}F="<br/><i>Information is being updated every "+E+"</i>"}G.getElementById("servlet_interval").innerHTML=F};__stormcenter.prototype.zoomToThematicArea=function(B,A){var C=new VELatLong(B,A);this.map.SetCenterAndZoom(C,12)};__stormcenter.prototype.configureVEMapControls=function(){var A=document.getElementById("MSVE_navAction_topBar");if(A!=null){A.removeChild(document.getElementById("MSVE_navAction_showLabels"));A.removeChild(document.getElementById("MSVE_navAction_separator2"));A.removeChild(document.getElementById("MSVE_navAction_separator3"))}var B=document.getElementById("MSVE_navAction_container");if(B!=null){B.style.width="198px"}};__stormcenter.prototype.onMapPan=function(){this.changeMapBGColor();this.cancelTimer();var F=this.ensureZoomLevel();if(F!=this.map.GetZoomLevel()){this.map.SetCenterAndZoom(this.map.GetCenter(),F)}if(this.inAllowableBounds()){var E=this.getStoredZoom();var G=this.getStoredCenter();this.storeBounds();var B=this.getStoredZoom();var A=this.getStoredCenter();var D=false;var C=false;if(E!=B){D=true}else{if(G.Longitude!=A.Longitude||G.Latitude!=A.Latitude){C=true}}if(this.firstMapLoad||this.dataMonitor.operationModeIsMapInteraction()){this.dataMonitor.updateDataMonitor(true)}this.updateSummaryTab();this.updateAlertsHeader();this.controlLayerVisibility(B,D);this.updateLayers(D,C,this.firstMapLoad);this.updateDynamicLegend();this.resizeDynamicLegend();this.startTimer()}else{this.returnToLastBounds()}this.saveMapState();this.outsideBoundsMessage=null;this.firstMapLoad=false};__stormcenter.prototype.updateDynamicLegend=function(){if(document.getElementById("outages_content").style.display=="block"){var D=document.getElementById("d_legend_outages");var R=document.getElementById("d_legend_outages_link")}else{if(document.getElementById("thematic_content").style.display=="block"){var D=document.getElementById("d_legend_thematic");var R=document.getElementById("d_legend_thematic_link")}else{return }}var E=0;var G=IFactorLayersHandler.customLayersIcons.informationarea;if(!G&&G==null){E=0}else{E=G.length}var B=0;var P=IFactorLayersHandler.customLayersIcons.informationpoint;if(!P&&P==null){B=0}else{B=P.length}if((E+B)==0){R.style.display="none";this.dynamicLegendContol("Less","call")}else{R.style.display="block"}var A=E+B;if(A==0){return }var F=D.getElementsByTagName("tbody")[0];D.removeChild(F);var M=document.createElement("tbody");for(var K=0;K<A;K++){if(K<P.length){var O=P[K].split("|")[0];var C=P[K].split("|")[1]}else{var J=K-P.length;var O=G[J].split("|")[0];var C=G[J].split("|")[1]}var H=document.createElement("tr");H.style.height="26px";var I=document.createElement("td");I.align="center";var N=document.createElement("img");N.src=O;I.appendChild(N);var Q=document.createElement("td");Q.valign="middle";var L=document.createTextNode(C);Q.appendChild(L);H.appendChild(I);H.appendChild(Q);M.appendChild(H)}D.appendChild(M)};__stormcenter.prototype.dynamicLegendContol=function(A,C){if(document.getElementById("outages_content").style.display=="block"){var D=document.getElementById("d_legend_outages");var F=document.getElementById("d_legend_control_outages");var E=document.getElementById("d_legend_img_outages")}else{if(document.getElementById("thematic_content").style.display=="block"){var D=document.getElementById("d_legend_thematic");var F=document.getElementById("d_legend_control_thematic");var E=document.getElementById("d_legend_img_thematic")}else{return }}var B=F.title;if(C=="call"){B=A}if(B=="More"){this.updateDynamicLegend();F.title="Less";F.innerHTML="Less...";E.src="images/impl/icon_retract.gif";this.resizeDynamicLegend();D.style.display="block"}else{if(B=="Less"){F.title="More";F.innerHTML="More...";E.src="images/impl/icon_expand.gif";D.style.display="none";this.resizeDynamicLegend()}}};__stormcenter.prototype.resizeDynamicLegend=function(){if(document.getElementById("outages_content").style.display=="block"){var E=document.getElementById("d_legend_control_outages")}else{if(document.getElementById("thematic_content").style.display=="block"){var E=document.getElementById("d_legend_control_thematic")}else{return }}var J=0;var F=IFactorLayersHandler.customLayersIcons.informationarea;if(!F&&F==null){J=0}else{J=F.length}var D=0;var I=IFactorLayersHandler.customLayersIcons.informationpoint;if(!I&&I==null){infoAreaPointIconsLength=0}else{D=I.length}var G=J+D;if(G==0){return }var H=null;if(/MSIE (\d+\.\d+);/.test(navigator.userAgent)){H=new Number(RegExp.$1)}var B;if(H==6){B=30}else{if(H==7){B=28}else{if(H==8){B=30}else{B=30}}}var C=G*3;var A=(G*B)+C;if(E.title=="Less"){this.tabshow("legend",A)}else{if(E.title=="More"){this.tabshow("legend")}}};__stormcenter.prototype.setVisibilityForControl=function(C,B,A){this.dynamicLegendContol("Less","call");this.visibilitiesHandler.setVisibilityForControl(C,B,A);this.onMapPan()};__stormcenter.prototype.setMapDivSize=function(){var B;var A;if(window.innerWidth){B=window.innerWidth}else{if(document.documentElement.clientWidth==0){B=document.body.clientWidth}else{B=document.documentElement.clientWidth}}if(window.innerHeight){A=window.innerHeight}else{if(document.documentElement.clientHeight==0){A=document.body.clientHeight}else{A=document.documentElement.clientHeight}}var C=A-90;var D=B-264;var F=D-197;if(F<0){F=0}if((document.getElementById)&&(!document.all)){C=C+"px";D=D+"px";F=F+"px"}window.document.getElementById(__stormcenter.htmlMapElementName).style.height=C;window.document.getElementById(__stormcenter.htmlMapElementName).style.width=D;var E=window.document.getElementById("alertheader");if(E!=null){E.style.width=F}};__stormcenter.prototype.mapResize=function(){var B;var A;if(window.innerWidth){B=window.innerWidth}else{if(document.documentElement.clientWidth==0){B=document.body.clientWidth}else{B=document.documentElement.clientWidth}}if(window.innerHeight){A=window.innerHeight}else{if(document.documentElement.clientHeight==0){A=document.body.clientHeight}else{A=document.documentElement.clientHeight}}var C=A-90;var D=B-264;var F=D-197;if(F<0){F=0}if((document.getElementById)&&(!document.all)){heightToSetPix=C+"px";widthToSetPix=D+"px";F=F+"px";window.document.getElementById(__stormcenter.htmlMapElementName).style.height=heightToSetPix;window.document.getElementById(__stormcenter.htmlMapElementName).style.width=widthToSetPix}this.map.Resize(D,C);var E=window.document.getElementById("alertheader");if(E!=null){E.style.width=F}};__stormcenter.prototype.highlightAlerts=function(){document.getElementById("alertheader").style.opacity="0.85";if(document.all){document.getElementById("alertheader").style.filter="alpha(opacity=85)"}};__stormcenter.prototype.unHighlightAlerts=function(){document.getElementById("alertheader").style.opacity="0.7";if(document.all){document.getElementById("alertheader").style.filter="alpha(opacity=70)"}};__stormcenter.prototype.getFullPathDataOverviewDistrictFile=function(){return this.dataMonitor.getVariableValue("full_interval_generation_data_directory")+"/"+iFactor.common.config.overviewdistrict_data_file};__stormcenter.prototype.gotoAreaName=function(B){if(B!=null&&B!=""){var A=B+", USA";this.map.Find(null,A,null,null,null,null,null,null,null,null,null);this.saveMapState()}};
