__stormcenter=function(){this.fullDayNames=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];this.numOutages=null;this.numCustomersAffected=null;this.isPageLoaded=null;this.firstMapLoad=true;this.basicmenu=null;this.oMenu=null};__stormcenter.prototype.loadStormCenter=function(){this.preActions();this.checkBrowserCompatibility();this.readConfigFromCookies();this.initialiseStormCenter();this.ensureControlStates();this.setMapDivSize();this.setFavoritesOptions();this.tabshow("legend");try{this.stormcenterVEMapCreation()}catch(B){alert("The map is currently unavailable. Please wait a few moments and refresh your browser window.");return }this.setMapOptions();this.map.LoadMap(this.startLatLong,this.startInfo[2],iFactor.common.config.map_type,null,null,false,null,this.mapOptions);this.configureVEMapEvents();this.configureVEMapControls();var A=iFactor.common.getArguments()["x"];var C=iFactor.common.getArguments()["y"];if((A!=null)&&(A!="")&&(C!=null)&&(C!="")){this.zoomToXY(A,C)}else{this.onMapPan()}this.postActions()};__stormcenter.prototype.configureVEMapEvents=function(){this.map.AttachEvent("onchangeview",function(){iFactor.StormCenter.onMapPan()});this.map.AttachEvent("onchangemapstyle",function(){iFactor.StormCenter.saveMapState()});this.map.AttachEvent("onmouseover",function(A){iFactor.StormCenter.mouseShapeHandler(A)});this.map.AttachEvent("onmouseout",function(A){iFactor.StormCenter.mouseShapeHandler(A)});this.map.AttachEvent("ontokenexpire",function(A){iFactor.StormCenter.handleTokenExpire(A)});this.map.AttachEvent("ontokenerror",function(A){iFactor.StormCenter.handleTokenError(A)})};__stormcenter.prototype.configureVEMapControls=function(){};__stormcenter.prototype.preActions=function(){};__stormcenter.prototype.postActions=function(){};__stormcenter.prototype.getFullPathDataOverviewFile=function(){return iFactor.common.config.data_directory+"/data.xml"};__stormcenter.prototype.getFullPathCustomerChartFile=function(){return iFactor.common.config.data_directory+"/customerchart.xml"};__stormcenter.prototype.getFullPathProviderChartFile=function(){return iFactor.common.config.data_static_directory+"/providerchart.xml"};__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++){if(G.getElementById(A[C])!=null){G.getElementById(A[C]).value=""}}};__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.visibilitiesHandler.doSetVisibilityForControl("areascontrol",true,null)}else{this.visibilitiesHandler.doSetVisibilityForControl("locationscontrol",true,null)}}else{this.visibilitiesHandler.doSetVisibilityForControl("areascontrol",true,null)}this.visibilitiesHandler.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=this.dataMonitor.getVariableValue("total_outages");if(B==null){B=0}if(C=="on"||(B>=A&&C=="auto")){this.visibilitiesHandler.doSetVisibilityForControl("areascontrol",true,null)}else{this.visibilitiesHandler.doSetVisibilityForControl("locationscontrol",true,null)}};__stormcenter.prototype.zoomToThematicArea=function(B,A){this.visibilitiesHandler.setVisibilityForControl("locationscontrol",true,false);var C=new VELatLong(B,A);this.map.SetCenterAndZoom(C,10)};__stormcenter.prototype.setMapOptions=function(){if(this.map.EnableShapeDisplayThreshold){this.map.EnableShapeDisplayThreshold(false)}this.map.SetDashboardSize(VEDashboardSize.Normal);this.mapOptions=new VEMapOptions();this.mapOptions.EnableBirdseye=false};__stormcenter.prototype.stormcenterVEMapCreation=function(){if(window.document.getElementById("token")){var A=window.document.getElementById("token").innerHTML}this.map=new VEMap("map");if(A!=null&&A!=""){this.map.SetClientToken(A)}};__stormcenter.prototype.initialiseStormCenter=function(){this.outsideBoundsMessage=null;this.howSorted=new Array();this.map=null;this.validCharacters="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ,";this.startInfo=this.getStartLatLngZoom();this.startLatLong=new VELatLong(this.startInfo[0],this.startInfo[1]);this.providerChartPanel=null;this.earthRadius=6378137;this.minLat=-85.05112878;this.maxLat=85.05112878;this.minLng=-180;this.maxLng=180;this.layersHandler=new IFactorLayersHandler(this);this.visibilitiesHandler=new IFactorVisibilitiesHandler(this);this.stylesHandler=new IFactorStylesHandler(this);this.panelsHandler=new IFactorPanelsHandler(this);this.layersHandler.loadLayersConfiguration(this.visibilitiesHandler,this.stylesHandler);this.visibilitiesHandler.loadVisibilitiesConfiguration(this.layersHandler);this.stylesHandler.loadStylesConfiguration();this.panelsHandler.loadPanelsConfiguration();this.visibilitiesHandler.initialiseVisibilityControl();this.visibilitiesHandler.initialiseLayerVisibility(true);this.dataMonitor=new IFactorDataMonitor(this);this.dataMonitor.loadDataMonitorConfiguration(this.layersHandler);this.initialiseBounds();this.initialiseTimer()};__stormcenter.prototype.getStartLatLngZoom=function(){var B=new Array();B[0]=parseFloat(iFactor.common.config.start_lat);B[1]=parseFloat(iFactor.common.config.start_long);B[2]=parseInt(iFactor.common.config.start_zoom);var A=iFactor.common.config.homepage;var C=null;if((A!=null)&&(A!="")){C=A.split(",");B[0]=parseFloat(C[0]);B[1]=parseFloat(C[1]);B[2]=parseInt(C[2])}return B};__stormcenter.prototype.initialiseBounds=function(){this.lastZoom=new Array(null,null,null,null,null)};__stormcenter.prototype.handleTokenExpire=function(B){try{}catch(A){}};__stormcenter.prototype.handleTokenError=function(B){try{}catch(A){}};__stormcenter.prototype.mouseShapeHandler=function(B){if(B.elementID){var A=this.map.GetShapeByID(B.elementID);if(A.GetDescription()&&A.GetType()=="Polygon"){if(B.eventName=="onmouseover"){this.map.HideInfoBox();this.map.ShowInfoBox(A)}}}};__stormcenter.prototype.checkBrowserCompatibility=function(){var A=iFactor.common.getBrowserType();if(A=="Other"){window.location="notsupported.html"}if(A=="Firefox15"){Msn.Drawing.Graphic.CreateGraphic=function(C,B){return new Msn.Drawing.SVGGraphic(C,B)}}};__stormcenter.prototype.readConfigFromCookies=function(){var B=iFactor.common.readCookie("state");var A=0;var C=null;if((B!=null)&&(B!="")){var D=B.split("|");for(A=0;A<D.length;A++){C=D[A].split(":");iFactor.common.config[C[0]]=C[1]}}};__stormcenter.prototype.onMapPan=function(){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.startTimer()}else{this.returnToLastBounds()}this.saveMapState();this.outsideBoundsMessage=null;this.firstMapLoad=false};__stormcenter.prototype.saveMapState=function(){if(iFactor.common.cookiesEnabled()&&this.map!=null){var A=new Object();var H=window.document;A.map_type=this.map.GetMapStyle();var G=this.map;var F=G.GetCenter().Latitude;var D=G.GetCenter().Longitude;var C=G.GetZoomLevel();var E=F+","+D+","+C;A.homepage=E;var B="";for(name in A){if(B!=""){B=B+"|"}B=B+name+":"+A[name]}iFactor.common.createCookie("state",B,365)}};__stormcenter.prototype.ensureZoomLevel=function(){var A;var C;var B;A=parseInt(iFactor.common.config.min_zoom_level);C=parseInt(iFactor.common.config.max_zoom_level);B=parseInt(this.map.GetZoomLevel());if(B>A){return A}else{if(B<C){return C}else{return B}}};__stormcenter.prototype.inAllowableBounds=function(){var J=this.map.GetZoomLevel();var H=this.map.GetCenter().Latitude;var D=this.map.GetCenter().Longitude;var C=parseInt(iFactor.common.config.min_zoom_level);var I=parseInt(iFactor.common.config.max_zoom_level);var E=parseFloat(iFactor.common.config.min_viewable_lat);var G=parseFloat(iFactor.common.config.max_viewable_lat);var F=parseFloat(iFactor.common.config.min_viewable_lng);var A=parseFloat(iFactor.common.config.max_viewable_lng);var B=true;if((J>C)||(J<I)){B=false}if(iFactor.common.config.allow_zoom!=null){B=true;iFactor.common.config.allow_zoom=null}if((H>G)||(H<E)){B=false}if((D>A)||(D<F)){B=false}return B};__stormcenter.prototype.returnToLastBounds=function(){if(this.outsideBoundsMessage!=null){window.alert(this.outsideBoundsMessage);this.outsideBoundsMessage=null}this.map.SetCenterAndZoom(this.lastZoom[0],this.lastZoom[1])};__stormcenter.prototype.storeBounds=function(){this.lastZoom[0]=this.map.GetCenter();this.lastZoom[1]=this.map.GetZoomLevel();var A=this.getMapBoundsParameters();this.lastZoom[2]=A[1];this.lastZoom[3]=A[2];this.lastZoom[4]=A[0]};__stormcenter.prototype.getStoredCenter=function(){return this.lastZoom[0]};__stormcenter.prototype.getStoredZoom=function(){return this.lastZoom[1]};__stormcenter.prototype.getStoredPixelWidthHeight=function(){return[this.lastZoom[2],this.lastZoom[3]]};__stormcenter.prototype.getStoredMapBounds=function(){return this.lastZoom[4]};__stormcenter.prototype.getMapBoundsParameters=function(){var C=this.map.LatLongToPixel(this.map.GetCenter());var B=2*C.x;var A=2*C.y;var E=this.map.PixelToLatLong(new VEPixel(0,0));var D=this.map.PixelToLatLong(new VEPixel(B,A));return[new VELatLongRectangle(E,D),B,A]};__stormcenter.prototype.setAsHomepage=function(){if(iFactor.common.cookiesEnabled()){var F=this.map;var E=F.GetCenter().Latitude;var B=F.GetCenter().Longitude;var A=F.GetZoomLevel();var D=E+","+B+","+A;iFactor.common.createCookie("homepage",D,365);window.alert("The current view has been set as your homepage.");window.document.getElementById("favoritename").value="Home";var C=window.alert;window.alert=function(){};this.addFavorite();window.alert=C;window.document.getElementById("favoritename").value=""}else{window.alert("Cookies are not enabled.  Cookies must be enabled in order to set the homepage.")}};__stormcenter.prototype.updateLayers=function(B,A,C){this.layersHandler.updateTileLayers(C);this.layersHandler.updateVectorLayers(B,A,C)};__stormcenter.prototype.setVisibilityForControl=function(C,B,A){this.visibilitiesHandler.setVisibilityForControl(C,B,A);this.onMapPan()};__stormcenter.prototype.controlLayerVisibility=function(C,B){var A=false;if(B){if(this.isPageLoaded==null||this.isPageLoaded==false){this.setCustomVisibilityForInitialPageLoad();this.isPageLoaded=true;A=true}A=(this.visibilitiesHandler.adjustControlsActiveDependingOnZoomLevel(C)||A);if(A){this.visibilitiesHandler.setVisibilityAccordingToCurrentConfiguration()}this.visibilitiesHandler.setShapeVisibilityDependingOnZoomLevel(C);this.updateLegend()}};__stormcenter.prototype.getMapSpatialIndices=function(C){var I=this.getStoredMapBounds();var G=I.TopLeftLatLong;var E=I.BottomRightLatLong;var B=6;var J=new Array();var L=(E.Longitude-G.Longitude)/(B-1);var K=(G.Latitude-E.Latitude)/(B-1);var F=null;var H=null;var A=null;var D=0;for(i=0;i<B;i++){H=G.Longitude+i*L;for(j=0;j<B;j++){F=E.Latitude+j*K;A=this.getSpatialIndexForLngLatZoom(H,F,C);isNew=true;D=-1;while(isNew&&(D++<J.length)){if(J[D]==A){isNew=false}}if(isNew){J[J.length]=A}}}J=this.getModifiedSpatialIndices(J);return J};__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++){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.clipValue=function(C,A,B){return Math.min(Math.max(C,A),B)};__stormcenter.prototype.mapSize=function(A){return(256<<A)};__stormcenter.prototype.latLongToPixelXYAbsolute=function(F,A,B){var F=this.clipValue(F,this.minLat,this.maxLat);var A=this.clipValue(A,this.minLng,this.maxLng);var H=(A+180)/360;var I=Math.sin(F*Math.PI/180);var G=0.5-Math.log((1+I)/(1-I))/(4*Math.PI);var E=this.mapSize(B);var D=this.clipValue(H*E+0.5,0,E-1);var C=this.clipValue(G*E+0.5,0,E-1);return[D,C]};__stormcenter.prototype.pixelXYToTileXY=function(B,A){var D=B/256;var C=A/256;return[D,C]};__stormcenter.prototype.tileXYToQuadKey=function(E,D,F){var B="";var C;for(C=F;C>0;C--){var G=0;var A=1<<(C-1);if((E&A)!=0){G++}if((D&A)!=0){G++;G++}B=B+G}return B};__stormcenter.prototype.getSpatialIndexForLngLatZoom=function(A,E,F){var D=this.latLongToPixelXYAbsolute(E,A,F);var C=this.pixelXYToTileXY(D[0],D[1]);var B=this.tileXYToQuadKey(C[0],C[1],F);return B};__stormcenter.prototype.getModifiedSpatialIndices=function(A){return A};__stormcenter.prototype.updateLegend=function(){var A=document.getElementById("legend_tab");if(A.className=="on"){this.tabshow("legend")}};__stormcenter.prototype.setLastUpdated=function(){var B=document.getElementById("last_updated");var A=new Date();var C="<b>Last Updated:</b> "+this.reallyShortDateAndTime(A);B.innerHTML=C};__stormcenter.prototype.reallyShortDateAndTime=function(D){var C=this.shortDay(D.getDay())+", ";var B="AM";var A=D.getHours();if(A>12){B="PM";A=A-12}if(A==0){A=12}C=C+A+":";A=D.getMinutes()+"";if(A.length==1){A="0"+A}C=C+A+B;return C};__stormcenter.prototype.shortDay=function(A){var B=this.fullDayNames[A];return B.substring(0,3)};__stormcenter.prototype.zoomToXY=function(A,B){minZoom=iFactor.common.config.min_zoom_level;this.map.SetCenterAndZoom(new VELatLong(A,B),minZoom)};__stormcenter.prototype.zoomToOverview=function(){var A=parseFloat(iFactor.common.config.start_lat);var C=parseFloat(iFactor.common.config.start_long);var B=parseInt(iFactor.common.config.start_zoom);var D=new VELatLong(A,C);this.map.SetCenterAndZoom(D,B)};__stormcenter.prototype.zoomIntoIcon=function(C,B){var E=new VELatLong(C,B);var A=this.map.GetZoomLevel()+3;var D=parseInt(iFactor.common.config.min_zoom_level);if(A>D){A=D}this.map.SetCenterAndZoom(E,A)};__stormcenter.prototype.gotoAreaLatLngWe=function(E,D,C,B){document.getElementById("menuLabel").innerHTML=B;document.getElementById("latLongHidden").value=E+","+D+","+C;var F=window.document.getElementById("areaselect");var H=new VELatLong(E,D);var A=parseInt(C);var G=parseInt(iFactor.common.config.min_zoom_level);if(A>G){A=G}this.map.SetCenterAndZoom(H,A)};__stormcenter.prototype.gotoAreaLatLng=function(){var D=window.document.getElementById("latLongHidden").value.split(",");var C=new VELatLong(D[0],D[1]);var A=parseInt(D[2]);var B=parseInt(iFactor.common.config.min_zoom_level);if(A>B){A=B}this.map.SetCenterAndZoom(C,A)};__stormcenter.prototype.gotoCommunityLatLng=function(){var D=window.document.getElementById("goto_community_input").value.split(",");var C=new VELatLong(D[0],D[1]);var A=parseInt(D[2]);var B=parseInt(iFactor.common.config.min_zoom_level);if(A>B){A=B}this.map.SetCenterAndZoom(C,A)};__stormcenter.prototype.gotoStateLatLng=function(){var C=window.document.getElementById("stateselect");var B=C.options[C.selectedIndex].text;var F=window.document.getElementById("stateselect").value.split(",");var E=new VELatLong(F[0],F[1]);var A=parseInt(F[2]);var D=parseInt(iFactor.common.config.min_zoom_level);if(A>D){A=D}this.map.SetCenterAndZoom(E,A)};__stormcenter.prototype.gotoLatLng=function(C,B){var E=new VELatLong(C,B);var A=parseInt(iFactor.common.config.area_zoom_level);var D=parseInt(iFactor.common.config.min_zoom_level);if(A>D){A=D}this.map.SetCenterAndZoom(E,A)};__stormcenter.prototype.gotoAreaLatLngAreaSelect=function(){var C=window.document.getElementById("areaselect");var B=C.options[C.selectedIndex].text;var F=window.document.getElementById("areaselect").value.split(",");var E=new VELatLong(F[0],F[1]);var A=parseInt(F[2]);var D=parseInt(iFactor.common.config.min_zoom_level);if(A>D){A=D}this.map.SetCenterAndZoom(E,A)};__stormcenter.prototype.gotoLatLngZoom=function(B,A,C){var D=new VELatLong(B,A);this.map.SetCenterAndZoom(D,C)};__stormcenter.prototype.gotoArea=function(){var B=window.document.getElementById("areaselect").value;if(B!="none"){var A=B+", United States";this.map.Find(null,A,null,null,null,null,null,null,null,null,null);this.saveMapState()}};__stormcenter.prototype.latLngLookup=function(){var C=window.document;var B=parseFloat(C.getElementById("goto_lat").value);var A=parseFloat(C.getElementById("goto_lng").value);if(((B+"")!="NaN")&&((A+"")!="NaN")){this.outsideBoundsMessage="The coordinate is outside the area available to be viewed.";var D=new VELatLong(B,A);this.map.SetCenter(D)}else{window.alert("Please enter valid coordinates.")}};__stormcenter.prototype.zoomToForeignXY=function(J,I){var F=iFactor.common.config.servlet_path;F=F+"service=transform";F=F+"&y="+I;F=F+"&x="+J;F=F+"&target=EPSG:32104&source=EPSG:4326&multiplier=1";var D=iFactor.common.createXMLRequest();var C=F+iFactor.common.uniqueRequestTag(false);C=C.fixUrlSeparator();var G=this;D.open("GET",C,false);D.send(null);if((D.readyState==4)&&(D.status!=404)){var B=D.responseXML.getElementsByTagName("coordinate").item(0);var A=iFactor.common.getXMLNodeValue(iFactor.common.getXMLChildNamed(B,"x"));var H=parseFloat(A).toFixed(0);A=iFactor.common.getXMLNodeValue(iFactor.common.getXMLChildNamed(B,"y"));var E=parseFloat(A).toFixed(0)}this.map.SetCenterAndZoom(new VELatLong(E,H),12)};__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.cancelTimer=function(){var A=this.timerId;if(A!=null){window.clearInterval(A);this.timerId=null}};__stormcenter.prototype.showPanel=function(B,A){this.panelsHandler.showPanel(B,A)};__stormcenter.prototype.addressSearch=function(){var A=window.document.getElementById("address_value").value;if(A!=""){iFactor.common.config.allow_zoom="yes";this.map.Find(null,A,null,null,null,null,null,null,null,null,null)}};__stormcenter.prototype.gotoAccount=function(E,F,H){var G=this.map;E=parseFloat(E);F=parseFloat(F);var A=new VELatLong(E,F);var J=this.getAccountIdentifier(H);var B=this.getAccountPopup(H,J);var C=new VEPushpin(J,A,null,"Account",B);try{G.AddPushpin(C)}catch(D){}var I=13;G.SetCenterAndZoom(A,I)};__stormcenter.prototype.getAccountIdentifier=function(A){var D="";var C=A.split("<br/>");var B=0;for(B=0;B<C.length;B++){D=D+C[B]}return D};__stormcenter.prototype.getAccountPopup=function(A,E){var H="";var F=A.split("<br/>");var C=0;var B=null;var D=null;var G=H;for(C=0;C<F.length;C++){G=G+F[C];B=F[C].split(": ");D=B.length;if(D==1){H=H+B[0]}else{if(D==2){H=H+"<b>"+B[0]+": </b>"+B[1]}}H=H+"<br/>"}H=H+"<br>Click <a href='javascript:iFactor.StormCenter.map.DeletePushpin(\""+E+"\")'>here</a> to remove this location.";return H};__stormcenter.prototype.gotoAccountNumber=function(){var A=window.document.getElementById("accountinput").value;this.gotoSpecifiedAccountNumber(A)};__stormcenter.prototype.gotoSpecifiedAccountNumber=function(H){if(H!=""){var K=null;var M=null;var J=iFactor.common.config.servlet_path+"service=account";J=J+"&accountnumber="+H;var F=iFactor.common.createXMLRequest();var E=J+iFactor.common.uniqueRequestTag(false);E=E.fixUrlSeparator();var L=this;F.open("GET",E,false);F.send(null);if((F.readyState==4)&&(F.status!=404)){var C=F.responseXML.getElementsByTagName("account");var G=0;var D=null;var B=null;var A=null;var I=null;if(C.length>0){D=C[0];B=iFactor.common.getXMLNodeValue(iFactor.common.getXMLChildNamed(D,"account_number"));A=iFactor.common.getXMLNodeValue(iFactor.common.getXMLChildNamed(D,"account_name"));I=iFactor.common.getXMLNodeValue(iFactor.common.getXMLChildNamed(D,"address"));K=iFactor.common.getXMLNodeValue(iFactor.common.getXMLChildNamed(D,"lat"));M=iFactor.common.getXMLNodeValue(iFactor.common.getXMLChildNamed(D,"lng"))}}if(K!=null&&M!=null){this.map.DeleteAllPushpins();this.gotoAccountLatLong(K,M,H)}else{alert("There is not an account number as "+H)}}};__stormcenter.prototype.gotoAccountLatLong=function(F,G,D){var H=this.map;F=parseFloat(F);G=parseFloat(G);var A=new VELatLong(F,G);var J="Account:"+D;var B=this.getAccountPopupLatLong(D,J);var C=new VEPushpin(J,A,null,"Account Number",B);try{H.AddPushpin(C)}catch(E){}var I=13;H.SetCenterAndZoom(A,I)};__stormcenter.prototype.getAccountPopupLatLong=function(B,A){var C="";var C="<br><b>Account Number: </b>"+B+"</br>";C=C+"<br></br><br>Click <a href='javascript:iFactor.StormCenter.map.DeletePushpin(\""+A+"\")'>here</a> to remove this location.";return C};__stormcenter.prototype.addFavorite=function(){var C=window.document.getElementById("favoritename");var B=C.value;var A=null;var D=this.map;if(this.nameIsValid(B)){A=B+","+D.GetCenter().Latitude+","+D.GetCenter().Longitude+","+D.GetZoomLevel();cookieTxt=this.deriveFavoritesCookieText(B,A);iFactor.common.createCookie("favorites",cookieTxt,365);this.setFavoritesOptions();window.alert("A Favorite named "+B+" has been added.")}};__stormcenter.prototype.getSortedStrings=function(A){var C=new Array();var F=0;var E=0;var B=null;var G=null;var D=null;for(F=0;F<A.length;F++){D=null;B=A[F];if(C.length==0){C[0]=B}else{for(E=0;E<C.length;E++){if(B<C[E]){D=E;break}}if(D==null){C[C.length]=B}else{C.insertNth(B,D)}}}return C};__stormcenter.prototype.deriveFavoritesCookieText=function(B,A){var D=iFactor.common.readCookie("favorites");var F=null;var E=new Array();E[0]=A;var C=0;var G=null;if((D!=null)&&(D!="")){F=D.split("|");for(C=0;C<F.length;C++){G=F[C];if(G.split(",")[0]!=B){E[E.length]=G}}}D="";E=this.getSortedStrings(E);for(C=0;C<E.length;C++){D=D+E[C];if(C!=(E.length-1)){D=D+"|"}}return D};__stormcenter.prototype.nameIsValid=function(E){var F=0;var D=0;var C=this.validCharacters;var A=null;var B=false;var G=true;for(F=0;F<E.length;F++){A=E.charAt(F);B=false;for(D=0;D<C.length;D++){if(A==C.charAt(D)){B=true;break}}if(!B){G=false;break}}return(G&&(E.length>0))};__stormcenter.prototype.setFavoritesOptions=function(){var E=window.document.getElementById("selectedfavorite");E.innerText="";if(E!=null){E.innerHTML="";E.options[0]=new Option("Select...","",false);var B=iFactor.common.readCookie("favorites");if(B!=null&&B!=""){var D=B.split("|");var A=0;var C=null;for(A=0;A<D.length;A++){C=D[A].split(",");E.options[E.options.length]=new Option(C[0],C[0],false)}}}};__stormcenter.prototype.gotoFavoriteDel=function(){var G=window.document.getElementById("selectedfavorite");var I=G.options;var H=null;var A=null;if(I.length>0){var B=I[G.selectedIndex].value;if(B!=""){A=iFactor.common.readCookie("favorites");var E=A.split("|");var F=0;var D=0;var C=null;H=new Array(E.length);for(k=0;k<E.length;k++){H[k]=E[k]}for(F=0;F<H.length;F++){C=H[F].split(",");if(C[0]==B){H[F]=null;for(D=F;D<H.length-1;D++){H[D]=H[D+1]}}}H.length=H.length-1}}if(H!=null){A="";for(F=0;F<H.length;F++){if(H[F]!=null){A=A+H[F];if(F!=(H.length-1)){A=A+"|"}}}}else{A=""}iFactor.common.createCookie("favorites",A,365);this.setFavoritesOptions()};__stormcenter.prototype.gotoFavorite=function(){var I=window.document.getElementById("selectedfavorite");var L=I.options;if(L.length>0){var C=L[I.selectedIndex].value;if(C!=""){var A=iFactor.common.readCookie("favorites");var E=A.split("|");var F=0;var D=null;var J=null;var K=null;var G=null;for(F=0;F<E.length;F++){D=E[F].split(",");if(D[0]==C){J=parseFloat(D[1]);K=parseFloat(D[2]);G=new VELatLong(J,K);var B=parseInt(iFactor.common.config.min_zoom_level);var H=parseInt(D[3]);if(H>B){H=B}this.map.SetCenterAndZoom(G,H);break}}}}};__stormcenter.prototype.showAlertsTab=function(){var B=iFactor.common.createXMLRequest();var A=iFactor.common.config.alert_file;A=A+iFactor.common.uniqueRequestTag(true);A=A.fixUrlSeparator();B.onreadystatechange=function(){iFactor.StormCenter.doShowAlertsTab(B)};B.open("GET",A,true);B.send(null)};__stormcenter.prototype.doShowAlertsTab=function(D){if((D.readyState==4)&&(D.status!=404)){var A=D.responseXML.getElementsByTagName("alert");var B=window.document.getElementById("alertstable");iFactor.common.clearTable(B);var F=A.length;var E=0;var H=null;var I=null;var J=null;var G=null;var K=null;var C=null;if(F==0){H=B.insertRow(B.rows.length);I=H.insertCell(0);I.className="VE_Pushpin_Popup_Body";I.innerHTML="No alerts."}else{for(E=0;E<F;E++){J=A.item(E);G=iFactor.common.getXMLChildNamed(J,"heading");K=iFactor.common.getXMLChildNamed(J,"date");C=iFactor.common.getXMLChildNamed(J,"text");H=B.insertRow(B.rows.length);I=H.insertCell(0);I.className="alerttitle";I.innerHTML=iFactor.common.getXMLNodeValue(G);H=B.insertRow(B.rows.length);I=H.insertCell(0);I.className="alertdate";I.innerHTML=iFactor.common.getXMLNodeValue(K);H=B.insertRow(B.rows.length);I=H.insertCell(0);I.className="alertbody";I.innerHTML=iFactor.common.getXMLNodeValue(C);H=B.insertRow(B.rows.length);I=H.insertCell(0);I.className="alertbody";I.innerHTML="&nbsp;"}}}};__stormcenter.prototype.highlightAlerts=function(){document.getElementById("alertheader").style.opacity="0.7";if(document.all){document.getElementById("alertheader").style.filter="alpha(opacity=70)"}};__stormcenter.prototype.unHighlightAlerts=function(){document.getElementById("alertheader").style.opacity="0.4";if(document.all){document.getElementById("alertheader").style.filter="alpha(opacity=40)"}};__stormcenter.prototype.updateAlertsHeader=function(){var A=this.getRequestStrForAlertsInFile();var B=iFactor.common.createXMLRequest();B.onreadystatechange=function(){iFactor.StormCenter.doShowAlertsHeader(B)};B.open("GET",A,true);B.send(null)};__stormcenter.prototype.doShowAlertsHeader=function(A){if((A.readyState==4)&&(A.status!=404)){var B=this.getAlertsInfoFromXML(A.responseXML);if(B!=null){if((B.title==null||B.title=="")&&(B.long_text!=null&&B.long_text!="")){B.title="Click Here for Alerts"}if(B.title!=null&&(B.title!=""||B.long_text!="")){document.getElementById("alertheaderline1").innerHTML=B.title;document.getElementById("alertheader").style.display=""}}}};__stormcenter.prototype.getAlertsPanelBodyTxt=function(){res="";var A=this.getRequestStrForAlertsInFile();var B=iFactor.common.createXMLRequest();B.open("GET",A,false);B.send(null);if((B.readyState==4)&&(B.status!=404)){var C=this.getAlertsInfoFromXML(B.responseXML);if(C!=null){if(C.title!=null&&(C.title!=""||C.long_text!="")){res=C.long_text}}}return res};__stormcenter.prototype.getRequestStrForAlertsInFile=function(){var A=iFactor.common.config.alert_file;A=A+iFactor.common.uniqueRequestTag(true);A=A.fixUrlSeparator();return A};__stormcenter.prototype.getAlertsInfoFromXML=function(A){info=null;var B;var F,C,E;var D=A.getElementsByTagName("alert");if(D.length>0){info=new Object();for(i=0;i<D.length;i++){B=D[i];info.title=iFactor.common.getXMLNodeValue(iFactor.common.getXMLChildNamed(B,"title"));info.short_text=iFactor.common.getXMLNodeValue(iFactor.common.getXMLChildNamed(B,"short_text"));info.long_text=iFactor.common.getXMLNodeValue(iFactor.common.getXMLChildNamed(B,"long_text"))}}return info};__stormcenter.prototype.getHostRoot=function(){var E=window.location.href;var C=0;var D="";var B=0;var A=null;for(B=0;B<E.length;B++){A=E.charAt(B);if(A=="/"){C=C+1}if(C==3){break}D=D+A}return D};__stormcenter.prototype.checkEnter=function(C,B){var A;if(C&&C.which){C=C;A=C.which}else{C=event;A=C.keyCode}if(A==13){if(B=="address_value"){iFactor.StormCenter.addressSearch();return false}else{if(B=="communityinput"){iFactor.StormCenter.gotoCommunityLatLng();return false}}}else{return true}};__stormcenter.prototype.keyIsEnter=function(C,B){var A;if(C&&C.which){C=C;A=C.which}else{C=event;A=C.keyCode}if(A==13){return true}else{return false}};__stormcenter.prototype.tabshow=function(B){var A=document.getElementById(B+"_tab");var C=document.getElementById(B+"_content");var G=null;if(/MSIE (\d+\.\d+);/.test(navigator.userAgent)){G=new Number(RegExp.$1)}if(B=="legend"){document.getElementById("legend_radio").style.display="block";if(this.visibilitiesHandler.visibilityControl.locationscontrol.checked_status){C=document.getElementById("outages_content");if(G==6){document.getElementById("newscat").style.height="352px";document.getElementById("catC2").style.top="387px";document.getElementById("rcsB").style.paddingTop="0px"}else{document.getElementById("newscat").style.height="389px";document.getElementById("catC2").style.top="403px";document.getElementById("c1_headlines").style.height="365px"}}else{if(this.visibilitiesHandler.visibilityControl.areascontrol.checked_status){C=document.getElementById("thematic_content");document.getElementById("newscat").style.height="257px";document.getElementById("catC2").style.top="275px";document.getElementById("c1_headlines").style.height="233px"}}}else{if(B=="summary"){document.getElementById("legend_radio").style.display="none";document.getElementById("newscat").style.height="287px";document.getElementById("catC2").style.top="305px";document.getElementById("c1_headlines").style.height="263px"}}var H=A.parentNode.getElementsByTagName("LI");var D=H.length;for(var E=0;E<D;E++){if(H[E].id==A.id){H[E].className="on"}else{H[E].className=""}}var I=C.parentNode.getElementsByTagName("DIV");var F=I.length;for(var E=0;E<F;E++){if(I[E].className=="showheadlines"){if(I[E].id==C.id){I[E].style.display="block"}else{I[E].style.display="none"}}}};__stormcenter.prototype.setMapDivSize=function(){var B=document.documentElement.clientWidth;var A=document.documentElement.clientHeight;var C=A-110;var D=B-250;var E=D-327;if((document.getElementById)&&(!document.all)){C=C+"px";D=D+"px";E=E+"px"}window.document.getElementById("map").style.height=C;window.document.getElementById("map").style.width=D;window.document.getElementById("alertheader").style.width=E;if((document.getElementById)&&(!document.all)){window.document.getElementById("storm_banner").style.width=(B-500)+"px"}else{window.document.getElementById("storm_banner").style.width=B-500}};__stormcenter.prototype.mapResize=function(){var B=document.documentElement.clientWidth;var A=document.documentElement.clientHeight;var C=A-110;var D=B-250;var E=D-327;if((document.getElementById)&&(!document.all)){heightToSetPix=C+"px";widthToSetPix=D+"px";E=E+"px";window.document.getElementById("map").style.height=heightToSetPix;window.document.getElementById("map").style.width=widthToSetPix}this.map.Resize(D,C);window.document.getElementById("alertheader").style.width=E;if((document.getElementById)&&(!document.all)){window.document.getElementById("storm_banner").style.width=(B-500)+"px"}else{window.document.getElementById("storm_banner").style.width=B-500}};__stormcenter.prototype.updateSummaryTab=function(){var D=this.dataMonitor.getVariableValue("storm_mode");var G=this.dataMonitor.getVariableValue("total_outages");var B=this.dataMonitor.getVariableValue("total_customers");var A=this.dataMonitor.getVariableValue("date_generated");var C=this.dataMonitor.getVariableValue("servlet_interval");this.numOutages=G;var F=window.document;if(D!=null&&(D=="y"||D=="p")){F.getElementById("num_outages_text").style.display="none";F.getElementById("last_updated").style.display="none"}if(G==null){G=""}F.getElementById("num_outages_text").innerHTML="<b>Active Outages:</b> "+G;if(B==null){B=""}F.getElementById("num_custs_text").innerHTML="<b>Affected Customers:</b> "+B;if(A==null){A=""}F.getElementById("last_updated").innerHTML="<b>Last Updated:</b> "+A;var E;if(C==null){E=""}else{E="Information is being updated every "+C/60+" minutes"}F.getElementById("servlet_interval").innerHTML=E};iFactor.StormCenter=new __stormcenter();