__stormcenter=function(){this.appConfig={initialTab:"legend",mapWidthGap:260,mapHeightGap:87};this.fullDayNames=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];this.mapLoadTrials=0};__stormcenter.prototype.loadStormCenter=function(){this.beforeApplicationLoad.fire();this.outsideBoundsMessage=null;this.howSorted=new Array();this.checkBrowserCompatibility();this.readConfigFromCookies();this.ensureControlStates();var A=iFactor.common.getArguments()["x"];var H=iFactor.common.getArguments()["y"];var G=parseInt(iFactor.common.config.opacity)/100;this.current_outage_indices=new Array();this.current_outage_level=0;this.simpleAreasRendered=new Array();this.setMapDivSize();this.lastZoom=new Array(null,null);this.validCharacters="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ,";this.radioLayerNames=[];this.toggleLayerNames=[];this.timerId=null;this.setFavoritesOptions();this.configureLayers();this.pointLayers=new Object();this.tabshow(this.appConfig.initialTab);this.zoomLevelPointLayers=null;try{if(window.document.getElementById("token")){var C=window.document.getElementById("token").innerHTML}this.map=new VEMap("map");if(C!=null&&C!=""){this.map.SetClientToken(C)}}catch(F){this.mapLoadTrials=this.mapLoadTrials+1;if(this.mapLoadTrials>4){alert("The map is currently unavailable. Please wait a few moments and refresh your browser window...");return }else{setTimeout("iFactor.StormCenter.loadStormCenter()",1000)}}var D=this.getStartLatLngZoom();var E=new VELatLong(D[0],D[1]);if(this.map.EnableShapeDisplayThreshold){this.map.EnableShapeDisplayThreshold(false)}this.map.SetDashboardSize(VEDashboardSize.Normal);var B=new VEMapOptions();B.EnableBirdseye=false;this.map.LoadMap(E,D[2],iFactor.common.config.map_type,null,null,false,null,B);this.loadTileLayers(false,G);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;if((A!=null)&&(A!="")&&(H!=null)&&(H!="")){this.zoomToForeignXY(A,H)}else{this.onMapPan()}this.applicationLoad.fire()};__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.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.loadTileLayers=function(D,E){var C=0;var B=null;var A=E;if(A==null){A=this.getOpacity()}if(!D){this.tileLayers=new Array();for(C=0;C<this.toggleLayerNames.length;C++){B=this.toggleLayerNames[C];this.addTileLayer(B,0.5,iFactor.common.getToggleValue(B))}}for(C=0;C<this.radioLayerNames.length;C++){B=this.radioLayerNames[C];this.addTileLayer(B,A,iFactor.common.isRadioButtonSelected(B,this.radioName))}};__stormcenter.prototype.getOpacity=function(){return(this.slider.getValue()/100)};__stormcenter.prototype.addTileLayer=function(B,D,E){var C=new VETileSourceSpecification(B,"images/tiles/"+B+"/%4.png");var F=parseInt(iFactor.common.config.min_tile_zoom_level);var A=parseInt(iFactor.common.config.max_tile_zoom_level);C.Opacity=D;C.ZIndex=100;C.MaxZoom=A;C.MinZoom=F;this.tileLayers[B]=C;this.map.AddTileLayer(C);this.toggleTileLayer(E,B)};__stormcenter.prototype.toggleTileLayer=function(A,B){if(A){this.map.ShowTileLayer(B)}else{this.map.HideTileLayer(B)}this.saveMapState()};__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.ensureControlStates=function(){this.toggleIfNecessary("showoutages","true");this.toggleIfNecessary("showthematic","true");this.toggleIfNecessary("showserviceareas","true");var A=["favoritename","address_value"];var B=0;var D=window.document;var C=null;for(B=0;B<A.length;B++){if(D.getElementById(A[B])!=null){D.getElementById(A[B]).value=""}}};__stormcenter.prototype.toggleIfNecessary=function(C,A){var B=window.document.getElementById(C);if(A!=null&&B!=null){A=(A.toLowerCase()=="true");B.checked=A}};__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.setMapDivSize=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}}if((document.getElementById)&&(document.getElementById("rightcontent"))){var B=document.getElementById("rightcontent");hDelta=87;wDelta=B.clientWidth+25}else{hDelta=this.appConfig.mapHeightGap;wDelta=this.appConfig.mapWidthGap}var A=myHeight-hDelta;var C=myWidth-wDelta;if((document.getElementById)&&(!document.all)){A=A+"px";C=C+"px"}window.document.getElementById("map").style.height=A;window.document.getElementById("map").style.width=C};__stormcenter.prototype.mapResize=function(){var D;var E;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}}if((document.getElementById)&&(document.getElementById("rightcontent"))){var B=document.getElementById("rightcontent");hDelta=87;E=B.clientWidth+25}else{hDelta=this.appConfig.mapHeightGap;E=this.appConfig.mapWidthGap}var A=myHeight-hDelta;var C=myWidth-E;if((document.getElementById)&&(!document.all)){A=A+"px";C=C+"px";window.document.getElementById("map").style.height=A;window.document.getElementById("map").style.width=C}else{this.map.Resize(C,A)}};__stormcenter.prototype.tabshow=function(D){var F=document.getElementById(D+"_tab");var H=document.getElementById(D+"_content");if(D=="legend"){if(window.document.getElementById("showthematic").checked){H=document.getElementById("thematic_content")}}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(var G=0;G<A;G++){if(B[G].className.indexOf("showheadlines")!=-1){if(B[G].id==H.id){B[G].style.display="block"}else{B[G].style.display="none"}}}};__stormcenter.prototype.showCustomerChartPanel=function(){var A="<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' width='560px' height='585px' id='customerfusionchart'>";A=A+"<param name='movie' value='flashcharts/FC_2_3_MSColumnLine_DY_2D.swf'/>";A=A+"<param name='FlashVars' value='&dataURL="+iFactor.common.config.data_directory+"/customerchart.xml&chartWidth=560&chartHeight=585'/>";A=A+"<param name='quality' value='high'/>";A=A+"<param name='bgcolor' value='#FFFFFF'/>";A=A+"<embed src='flashcharts/FC_2_3_MSColumnLine_DY_2D.swf' flashvars='&dataURL="+iFactor.common.config.data_directory+"/customerchart.xml' quality='high' bgcolor='#FFFFFF' width='560px' height='585px' name='customerfusionchart' type='application/x-shockwave-flash' pluginspace='http://www.macromedia.com/go/getflashplayer'></embed>";A=A+"</object>";if(this.customerChartPanel==null){this.customerChartPanel=this.getNewChart("customerchart")}this.customerChartPanel.setBody(A);this.customerChartPanel.render();this.customerChartPanel.show()};__stormcenter.prototype.getNewChart=function(C){window.document.getElementById(C).style.display="";var A=iFactor.common.getBrowserType();var B=null;var E=null;var G=null;var F=null;var H=iFactor.common.getInnerWindowDimensions();var D=null;if(window.XMLHttpRequest){B=460;E=370}else{B=600;E=640}G=Math.round((H[1]-E)/2);F=Math.round((H[0]-B)/2);if(G<=10){G=10}B=B+"px";E=E+"px";D=new YAHOO.widget.Panel(C,{width:B,height:E,x:F,y:G,close:true,zIndex:20000});return D};__stormcenter.prototype.onMapPan=function(){this.cancelTimer();var A=this.ensureZoomLevel();if(A!=this.map.GetZoomLevel()){this.map.SetCenterAndZoom(this.map.GetCenter(),A)}if(this.inAllowableBounds()){this.storeBounds();this.updateStatusArea();this.showAlerts();this.updatePointLayers();this.controlLayerVisibility();this.startTimer()}else{this.returnToLastBounds()}this.saveMapState();this.outsideBoundsMessage=null};__stormcenter.prototype.controlLayerVisibility=function(){var H=iFactor.common.config.thematic_default_display;var F=parseInt(iFactor.common.config.thematic_threshold);var K=parseInt(iFactor.common.config.thematic_min_zoom);var B=parseInt(iFactor.common.config.thematic_max_zoom);var I=parseInt(iFactor.common.config.service_area_border_min_zoom);var A=parseInt(iFactor.common.config.service_area_border_max_zoom);var G=window.document;var C=G.getElementById("num_outages_text").innerHTML;var E=parseInt(C.split(" ")[2]);var J=this.map.GetZoomLevel();var D=(J>=K)&&(J<=B);if(D&&(H=="on"||(H=="auto"&&E>=F))){this.toggleIfNecessary("showthematic","true");this.toggleIfNecessary("showoutages","false");this.showHideSafely("thematic","show");this.showHideSafely("outages","hide")}else{this.toggleIfNecessary("showthematic","false");this.toggleIfNecessary("showoutages","true");this.showHideSafely("thematic","hide");this.showHideSafely("outages","show")}this.updateLegend();if((J>=I)&&(J<=A)){this.toggleIfNecessary("showserviceareas","true");this.showHideSafely("serviceareas","show")}else{this.toggleIfNecessary("showserviceareas","false");this.showHideSafely("serviceareas","hide")}};__stormcenter.prototype.updateLegend=function(){var A=document.getElementById("legend_tab");if(A.className=="on"){this.tabshow("legend")}};__stormcenter.prototype.showHideSafely=function(A,B){if(this.pointLayers[A]!=null){if(B=="show"){this.pointLayers[A].Show()}else{this.pointLayers[A].Hide()}}};__stormcenter.prototype.configureLayers=function(){var C={timeout:5000,success:function(D){if(D.responseText){this.layersSetupLayers(D.responseText)}},failure:function(D){this.layerNames=[{name:"outages"},{name:"thematic"},{name:"serviceareas"}]},scope:this};this.layerNames=[];var B=iFactor.common.config.layer_data_file;var A=YAHOO.util.Connect.asyncRequest("GET",B,C)};__stormcenter.prototype.layersSetupLayers=function(B){try{this.layerNames=YAHOO.lang.JSON.parse(B)}catch(A){alert("Invalid site layers configuration")}this.layersSetLegend();this.updatePointLayers(true)};__stormcenter.prototype.layersSetLegend=function(){var A=document.getElementById("legend_table");if(!A){return }var C=this.layerNames;var H=0;var J;for(var D=0;D<C.length;D=D+1){J=C[D];var E=J.legend;if(E=="false"||E==null){continue}if(E=="auto"){continue}var G=J.icon_url;var B=J.external_name;var I=A.insertRow(A.rows.length);var F=I.insertCell(0);F.innerHTML='<img class="legend_entry" src="'+G+'"/>';F=I.insertCell(1);F.innerHTML=B}};__stormcenter.prototype.layersDynamicLegend=function(H,F){var A=document.getElementById("legend_table");if(!A){return }var D=F[0];var L=D.IFdescriptor;var C=L.legend;var J=this.baseRows;var E;if(!J){J=A.lastChild.rows.length}if(C=="auto"&&(!L.legendEntry)){if(D.GetShapeCount()>0){var I=L.icon_url;var B=L.external_name;var K=A.insertRow(A.rows.length);K.className="legend_entry";var G=K.insertCell(0);G.className="legend_entry";G.innerHTML='<img class="legend_entry" src="'+I+'"/>';G=K.insertCell(1);G.innerHTML=B;L.legendEntry=K;if(window.innerWidth){A.setAttribute("cellSpacing","0");A.setAttribute("cellPadding","0")}else{A.setAttribute("cellSpacing","0");A.setAttribute("cellPadding","1")}}}};__stormcenter.prototype.readTileLayer=function(D){var E=D.name;var B=iFactor.common.config.layer_data_dir;var C=null;var A=D.visible;if(window.document.getElementById("show"+E)){A=window.document.getElementById("show"+E).checked}var F=new VETileSourceSpecification(D.name,D.dirSpecification);F.Opacity=D.opacity;F.ZIndex=100;F.MaxZoom=D.maxZoomLevel;F.MinZoom=D.minZoomlevel;this.tileLayers[name]=F;this.map.AddTileLayer(F)};__stormcenter.prototype.readLayer=function(D){var E=D.name;var B=iFactor.common.config.layer_data_dir;var C=null;var A=D.visible;if(window.document.getElementById("show"+E)){A=window.document.getElementById("show"+E).checked}C=B+"/"+E+".xml";this.importPointLayer(C,E,A)};__stormcenter.prototype.updateLayer=function(A){var B=A.name;var C=A.VElayer;var E=true;if(!C){return }var D=this.map.GetZoomLevel();var F=this.layerUserVisible(B);if((D>A.maxZoomLevel)||(D<A.minZoomLevel)){E=false}else{E=F}if(E){if(A.type=="tile"){this.map.HideTileLayer(A.name)}else{C.Show()}}else{if(A.type=="tile"){this.map.ShowTileLayer(A.name)}else{C.Hide()}}};__stormcenter.prototype.updatePointLayers=function(F){var B=null;var D=0;var C=null;var E;var A;if(this.isZoomLevelChanged()){this.zoomLevelPointLayers=new Array()}for(D=0;D<this.layerNames.length;D=D+1){A=this.layerNames[D];B=A.name;E=A.type;if(E=="pointlayer"){this.readPointLayer(B)}else{if(E=="layer"){if(F){this.readLayer(A)}else{this.updateLayer(A)}}else{if(E=="tile"){if(F){this.readTileLayer(A)}else{this.updateLayer(A)}}else{if(E=="simplepointlayer"){this.readSimplePointLayer(B)}else{if(E=="staticpointlayer"){this.readStaticPointLayer(B)}}}}}}};__stormcenter.prototype.readPointLayer=function(A){var D=this.pointLayers[A];var B=0;var E=null;if((D!=null)&&(this.isZoomLevelChanged()||!this.isLayerRendered(A))){D.DeleteAllShapes()}toRequest=iFactor.common.config.data_directory+"/"+A+"/metadata.xml";toRequest=toRequest+iFactor.common.uniqueRequestTag(true);var C=iFactor.common.createXMLRequest();C.onreadystatechange=function(){iFactor.StormCenter.doReadPointLayer(C,A)};C.open("GET",toRequest,true);C.send(null)};__stormcenter.prototype.readSimplePointLayer=function(A){var D=this.pointLayers[A];var B=0;var E=null;toRequest=iFactor.common.config.data_directory+"/"+A+"/metadata.xml";toRequest=toRequest+iFactor.common.uniqueRequestTag(true);var C=iFactor.common.createXMLRequest();C.onreadystatechange=function(){iFactor.StormCenter.doReadSimplePointLayer(C,A)};C.open("GET",toRequest,true);C.send(null)};__stormcenter.prototype.isZoomLevelChanged=function(){var A=true;if(this.map!=null&&this.map.GetZoomLevel()==this.current_outage_indices_zoomlevel){A=false}return A};__stormcenter.prototype.isLayerRendered=function(A){var B=false;for(i=0;i<this.zoomLevelPointLayers.length;i++){if(this.zoomLevelPointLayers[i]==A){B=true}}return B};__stormcenter.prototype.readStaticPointLayer=function(A){if(this.pointLayers[A]==null){toRequest=iFactor.common.config.data_static_directory+"/"+A+"/metadata.xml";toRequest=toRequest+iFactor.common.uniqueRequestTag(true);var B=iFactor.common.createXMLRequest();B.onreadystatechange=function(){iFactor.StormCenter.doReadStaticPointLayer(B,A)};B.open("GET",toRequest,true);B.send(null)}};__stormcenter.prototype.doReadPointLayer=function(C,H){if((C.readyState==4)&&(C.status!=404)){var A=C.responseXML.getElementsByTagName("directory")[0];var M=iFactor.common.getXMLNodeValue(A);var F=0;var D=null;var E=null;var N=null;var G=true;try{G=window.document.getElementById("show"+H).checked}catch(J){}var L=new Array();var B=this.map.GetZoomLevel();M=iFactor.common.config.data_directory+"/"+H+"/"+M+"/";var P=this.getLayerDescriptor(H);L=this.getMapSpatialIndices(B,P);var O=false;if(this.isZoomLevelChanged()||!this.isLayerRendered(H)){for(F=0;F<L.length;F++){D=M+L[F]+".xml";this.importPointLayer(D,H,G)}this.current_outage_indices=L;this.current_outage_indices.length=B;this.zoomLevelPointLayers[this.zoomLevelPointLayers.length]=H}else{var I=this.current_outage_indices.length;var K=0;for(F=0;F<L.length;F++){var O=false;for(j=0;j<I;j++){if(this.current_outage_indices[j]==L[F]){O=true}}if(!O){D=M+L[F]+".xml";this.importPointLayer(D,H,G);K+=1;this.current_outage_indices[I+K]=L[F]}}}this.current_outage_indices_zoomlevel=this.map.GetZoomLevel()}};__stormcenter.prototype.doReadSimplePointLayer=function(D,I){if((D.readyState==4)&&(D.status!=404)){if(!this.simpleAreasRendered[I]&&I!="thematic"){var C=D.responseXML.getElementsByTagName("directory")[0];var B=iFactor.common.getXMLNodeValue(C);var G=0;var K=iFactor.common.config.data_directory+"/"+I+"/"+B+"/";var E=null;var F=null;var J=null;var H=window.document.getElementById("show"+I).checked;E=K+"thematic_areas.xml";this.importPointLayer(E,I,H);this.simpleAreasRendered[I]=true}if(I=="thematic"){var C=D.responseXML.getElementsByTagName("directory")[0];var B=iFactor.common.getXMLNodeValue(C);var G=0;var K=iFactor.common.config.data_directory+"/"+I+"/"+B+"/";var E=null;var F=null;var J=null;var H=window.document.getElementById("show"+I).checked;var A=this.pointLayers[I];if(A!=null){A.DeleteAllShapes()}E=K+"thematic_areas.xml";this.importPointLayer(E,I,H);this.simpleAreasRendered[I]=true}}};__stormcenter.prototype.doReadStaticPointLayer=function(C,H){if((C.readyState==4)&&(C.status!=404)){var B=C.responseXML.getElementsByTagName("directory")[0];var A=iFactor.common.getXMLNodeValue(B);var F=0;dirNameStatic=iFactor.common.config.data_static_directory+"/"+H+"/"+A+"/";var D=null;var E=null;var I=null;var G=window.document.getElementById("show"+H).checked;if(H=="serviceareas"){D=dirNameStatic+"serviceareas.xml";this.importPointLayer(D,H,G)}}};__stormcenter.prototype.importPointLayer=function(C,D,A){var B=iFactor.common.createXMLRequest();B.onreadystatechange=function(){iFactor.StormCenter.doImportPointLayer(B,C,D,A)};B.open("GET",C,true);B.send(null)};__stormcenter.prototype.doImportPointLayer=function(B,C,D,A){if((B.readyState==4)&&(B.status!=404)){var F=D;var E=this.pointLayers[F];if(E==null){E=new VEShapeLayer();this.pointLayers[F]=E}if(!A){E.Hide()}aSource=new VEShapeSourceSpecification(VEDataType.GeoRSS,C,E);this.map.ShowMessageBox=false;this.map.ImportShapeLayerData(aSource,function(G){iFactor.StormCenter.pointLayerLoaded(G,D)},false)}};__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.gotoAreaLatLng=function(){var C=window.document.getElementById("areaselect");var B=C.options[C.selectedIndex].text;if(window.document.getElementById("areaselect").value!=null){var F=window.document.getElementById("areaselect").value.split(",");var E=new VELatLong(F[0],F[1]);var A=parseInt(iFactor.common.config.area_zoom_level);if(B=="Westchester"){A=A-1}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);if(C==41.01){A=A-1}var D=parseInt(iFactor.common.config.min_zoom_level);if(A>D){A=D}this.map.SetCenterAndZoom(E,A)};__stormcenter.prototype.zoomToThematicArea=function(B,A){var C=new VELatLong(B,A);this.map.SetCenterAndZoom(C,12)};__stormcenter.prototype.pointLayerLoaded=function(B,D){var M=B.GetShapeCount();var C=0;var K=null;var F=null;var I=null;var L=null;var J=false;this.map.ShowMessageBox=true;var G=this.getLayerDescriptor(D);if(G){B.IFdescriptor=G;B.IFmaxzoom=G.maxzoom;B.IFminzoom=G.minzoom;G.VElayer=B;J=G.transparent;this.updateLayer(G)}this.afterLayerLoaded.fire(B);for(C=0;C<M;C=C+1){K=B.GetShapeByIndex(C);if(J){H=new VEColor(0,0,0,0);K.SetCustomIcon("<div style='width:20px;height:20px;'><img src='/images.blank.png'/></div>");K.SetLineColor(H);K.SetFillColor(H);continue}try{K.SetCustomIcon("<img src='"+K.IconId+"'/>")}catch(E){}try{L=K.IconId;L=L.split(".")[0];L=L.split("/")[1];I=iFactor.common.config[L+"_color"];if(I!=null){I=iFactor.common.convertHex2DecRGB(I);var H=new VEColor(parseInt(I[0]),parseInt(I[1]),parseInt(I[2]),0.5);if(L=="thematic_0"){H=new VEColor(255,255,255,0)}K.SetFillColor(H);if(D=="serviceareas"){var A=parseInt(iFactor.common.config.service_area_border_width);H=new VEColor(parseInt(I[0]),parseInt(I[1]),parseInt(I[2]),0.5);K.SetLineWidth(A)}else{if(D=="thematic"){I=iFactor.common.convertHex2DecRGB(iFactor.common.config.thematic_border_color);H=new VEColor(parseInt(I[0]),parseInt(I[1]),parseInt(I[2]),0.5);K.SetLineColor(H);parseInt(iFactor.common.config.thematic_border_width);var A=parseInt(iFactor.common.config.thematic_border_width);K.SetLineWidth(A)}else{H=new VEColor(100,100,100,0.4);K.SetLineColor(H);K.SetLineWidth(1)}}}}catch(E){}}};__stormcenter.prototype.getLayerDescriptor=function(B){var A;for(A=0;A<this.layerNames.length;A=A+1){if(this.layerNames[A].name==B){return this.layerNames[A]}}};__stormcenter.prototype.getSpatialIndexForLngLatZoom=function(K,J,B){var C=-85.05112878;var H=85.05112878;var E=-180;var I=180;var L="";var G=null;var A=0;var F=0;var D=0;var N=new Array();var M=["0","1","2","3"];for(F=0;F<B;F++){A=0;if(J<((H+C)/2)){A=A+2;H=(H+C)/2}else{C=(H+C)/2}if(K>((I+E)/2)){A=A+1;E=(I+E)/2}else{I=(I+E)/2}L=L+A}return L};__stormcenter.prototype.getSpatialIndicesForPoint=function(E,B){var C=-85.05112878;var I=85.05112878;var F=-180;var J=180;var K=E.Latitude;var L=E.Longitude;var M="";var H=null;var A=0;var G=0;var D=0;var O=new Array();var N=["0","1","2","3"];for(G=0;G<B;G++){A=0;if(K<((I+C)/2)){A=A+2;I=(I+C)/2}else{C=(I+C)/2}if(L>((J+F)/2)){A=A+1;F=(J+F)/2}else{J=(J+F)/2}M=M+A}if(M.length>1){M=M.substr(0,M.length-2);for(G=0;G<N.length;G++){for(D=0;D<N.length;D++){O[O.length]=M+N[G]+N[D]}}}else{O=N}O=this.getModifiedSpatialIndices(O);return O};__stormcenter.prototype.getModifiedSpatialIndices=function(A){var B=null;if(A.length>0){B=A[0];if(B.length==6){A=new Array();A[0]="xxxxxx"}else{if(B.length==7){A=new Array();A[0]="xxxxxxx"}}}return A};__stormcenter.prototype.getMapSpatialIndices=function(H,M){var Q=this.map;var L=this.map.LatLongToPixel(this.map.GetCenter());var D=H;try{if(M.hasOwnProperty("baseZoomLevel")){D=parseInt(M.baseZoomLevel)}}catch(O){}var J=this.map.GetLeft();var N=this.map.GetTop();var R=2*L.x-J;var A=2*L.y-N;var P=new Array();var B=new Array();P[0]=this.map.PixelToLatLong(new VEPixel(J,N));P[1]=this.map.PixelToLatLong(new VEPixel(J,A));P[2]=this.map.PixelToLatLong(new VEPixel(R,N));P[3]=this.map.PixelToLatLong(new VEPixel(R,A));var I=6;var G=(P[3].Longitude-P[0].Longitude)/(I-1);var F=(P[0].Latitude-P[3].Latitude)/(I-1);var C=null;var S=null;var E=null;var K=0;for(i=0;i<I;i++){S=P[0].Longitude+i*G;for(j=0;j<I;j++){C=P[3].Latitude+j*F;E=this.getSpatialIndexForLngLatZoom(S,C,D-1);isNew=true;K=-1;while(isNew&&(K++<B.length)){if(B[K]==E){isNew=false}}if(isNew){B[B.length]=E}}}B=this.getModifiedSpatialIndices(B);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.storeBounds=function(){this.lastZoom[0]=this.map.GetCenter();this.lastZoom[1]=this.map.GetZoomLevel()};__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.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.updateStatusArea=function(){var F=iFactor.common.createXMLRequest();var A=iFactor.common.config.data_directory+"/data.xml";var G=window.document;A=A+iFactor.common.uniqueRequestTag(true);A=A.fixUrlSeparator();F.open("GET",A,false);F.send(null);if((F.readyState==4)&&(F.status!=404)){var D=F.responseXML;var C=D.getElementsByTagName("total_outages").item(0);G.getElementById("num_outages_text").innerHTML="<b>Active Outages:</b> "+iFactor.common.getXMLNodeValue(C);C=D.getElementsByTagName("total_customers").item(0);G.getElementById("num_custs_text").innerHTML="<b>Affected Customers:</b> "+iFactor.common.getXMLNodeValue(C);C=D.getElementsByTagName("date_generated").item(0);G.getElementById("footer_updated").innerHTML="<center><b>Last Updated:</b> "+iFactor.common.getXMLNodeValue(C)+"</center>";C=D.getElementsByTagName("servlet_interval").item(0);var E="";var B=parseInt(iFactor.common.getXMLNodeValue(C))/60;if(B>60&&B%60==0){E=Math.floor(B/60)+" hours."}else{if(B>60){E=Math.floor(B/60)+" hours, "+Math.floor(B%60)+" minutes."}else{E=B+" minutes."}}G.getElementById("footer_frequency").innerHTML=" <br/><center><i>Information is updated<br/>every "+E+"</i></center>"}};__stormcenter.prototype.cancelTimer=function(){var A=this.timerId;if(A!=null){window.clearInterval(A);this.timerId=null}};__stormcenter.prototype.startTimer=function(){var B=function(){iFactor.StormCenter.onMapPan()};var A=parseInt(iFactor.common.config.update_interval)*1000;this.timerId=window.setInterval(B,A)};__stormcenter.prototype.zoomToForeignXY=function(J,I){var F=iFactor.common.getServletPath();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.showHelpPanel=function(){if(this.helpPanel==null){window.document.getElementById("helppanel").style.display="";var E=iFactor.common.getInnerWindowDimensions();var A=460;var B=370;var D=Math.round((E[1]-B)/2);var C=Math.round((E[0]-A)/2);if(D<=10){D=10}A=A+"px";B=B+"px";this.helpPanel=new YAHOO.widget.Panel("helppanel",{width:A,x:C,y:D,draggable:true,visible:false,close:true,zIndex:20000})}this.helpPanel.render();this.helpPanel.show()};__stormcenter.prototype.showCustomerTablePanel=function(C){if(this.customerTablePanel==null){var B=window.document.getElementById("areatablescroll");B.style.width="540px";var B=window.document.getElementById("subareatablescroll");B.style.width="540px";B.style.height="144px";window.document.getElementById("customertable").style.display="";var G=iFactor.common.getInnerWindowDimensions();var A=560;var D=465;var F=Math.round((G[1]-D)/2);var E=Math.round((G[0]-A)/2);if(F<=10){F=10}A=A+"px";D=D+"px";this.customerTablePanel=new YAHOO.widget.Panel("customertable",{width:A,x:E,y:F,close:true,zIndex:20000})}this.populateCustomerTable(C);this.populateCustomerTableSubArea(C);this.customerTablePanel.render();this.customerTablePanel.show()};__stormcenter.prototype.populateCustomerTable=function(B){var C=iFactor.common.createXMLRequest();var A=iFactor.common.config.data_directory+"/data.xml";A=A+iFactor.common.uniqueRequestTag(true);A=A.fixUrlSeparator();C.open("GET",A,false);C.send(null);if((C.readyState==4)&&(C.status!=404)){this.setCustomerTableData(C.responseXML,B)}};__stormcenter.prototype.populateCustomerTableSubArea=function(B){var C=iFactor.common.createXMLRequest();var A=iFactor.common.config.data_directory+"/"+B+".xml";A=A+iFactor.common.uniqueRequestTag(true);A=A.fixUrlSeparator();C.open("GET",A,false);C.send(null);if((C.readyState==4)&&(C.status!=404)){this.setCustomerTableSubAreaData(C.responseXML)}};__stormcenter.prototype.setCustomerTableData=function(G,F){var A=G.getElementsByTagName("area");var C=window.document.getElementById("data_grid");var E=0;var D=true;var B=new Array(0,0);while(D){try{C.deleteRow(0)}catch(H){D=false}}var I="";for(E=0;E<A.length;E++){if(F=="westchester"){if(iFactor.common.getXMLNodeValue(iFactor.common.getXMLChildNamed(A[E],"area_name"))=="Westchester"){I=I+this.tableRowForArea(A[E],C);this.addMoreTotals(A[E],B)}}else{if(iFactor.common.getXMLNodeValue(iFactor.common.getXMLChildNamed(A[E],"area_name"))!="Westchester"){I=I+this.tableRowForArea(A[E],C);this.addMoreTotals(A[E],B)}}}this.sortCustomerTable("data_grid",0);this.sortCustomerTable("data_grid",0)};__stormcenter.prototype.setCustomerTableSubAreaData=function(D){var C=D.getElementsByTagName("area");var G=window.document.getElementById("subarea_grid");var F=0;var B=true;var E=new Array(0,0);while(B){try{G.deleteRow(0)}catch(H){B=false}}var A="";for(F=0;F<C.length;F++){A=A+this.tableRowForSubArea(C[F],G);this.addMoreTotals(C[F],E)}this.sortCustomerTable("subarea_grid",0);this.sortCustomerTable("subarea_grid",0)};__stormcenter.prototype.addMoreTotals=function(A,C){var B=parseInt(iFactor.common.getXMLNodeValue(iFactor.common.getXMLChildNamed(A,"custs_out")));var D=parseInt(iFactor.common.getXMLNodeValue(iFactor.common.getXMLChildNamed(A,"total_custs")));C[0]=C[0]+B;C[1]=C[1]+D};__stormcenter.prototype.tableRowForArea=function(B,D){var F=D.insertRow(D.length);var A=F.insertCell(0);this.setCellStyle(A.style,"124px");A.innerHTML='<a href="javascript:;" onclick="javascript:iFactor.StormCenter.gotoLatLng('+iFactor.common.getXMLNodeValue(iFactor.common.getXMLChildNamed(B,"latitude"))+","+iFactor.common.getXMLNodeValue(iFactor.common.getXMLChildNamed(B,"longitude"))+'); return false">'+iFactor.common.getXMLNodeValue(iFactor.common.getXMLChildNamed(B,"area_name"))+"</a>";A=F.insertCell(1);this.setCellStyle(A.style,"124px");var C=iFactor.common.getXMLNodeValue(iFactor.common.getXMLChildNamed(B,"custs_out"));A.innerHTML=C;A=F.insertCell(2);this.setCellStyle(A.style,"124px");var E=iFactor.common.getXMLNodeValue(iFactor.common.getXMLChildNamed(B,"total_custs"));A.innerHTML=E;A=F.insertCell(3);this.setCellStyle(A.style,"150px");var G=iFactor.common.getXMLNodeValue(iFactor.common.getXMLChildNamed(B,"etr"));if(G==null){G="&nbsp;"}A.innerHTML=G};__stormcenter.prototype.tableRowForSubArea=function(B,D){var F=D.insertRow(D.length);var A=F.insertCell(0);this.setCellStyle(A.style,"124px");A.innerHTML=iFactor.common.getXMLNodeValue(iFactor.common.getXMLChildNamed(B,"area_name"));A=F.insertCell(1);this.setCellStyle(A.style,"120px");var C=iFactor.common.getXMLNodeValue(iFactor.common.getXMLChildNamed(B,"custs_out"));A.innerHTML=C;A=F.insertCell(2);this.setCellStyle(A.style,"120px");var E=iFactor.common.getXMLNodeValue(iFactor.common.getXMLChildNamed(B,"total_custs"));A.innerHTML=E;A=F.insertCell(3);this.setCellStyle(A.style,"135px");var G=iFactor.common.getXMLNodeValue(iFactor.common.getXMLChildNamed(B,"etr"));if(G==null){G="&nbsp;"}A.innerHTML=G};__stormcenter.prototype.setCellStyle=function(A,B){A.width=B;A.padding="2px 0px 2px 3px";A.margin="0px";A.borderBottom="1px solid #b8b8b8";A.borderRight="1px solid #b8b8b8";A.height="16px";A.overflow="hidden";A.fontSize="11px";A.fontFamily="verdana, arial, helvetica, sans-serif";A.lineHeight="12px";A.backgroundColor="#ffffff"};__stormcenter.prototype.sortCustomerTable=function(I,E){var B=this.howToSort(E);this.howSorted[E]=B;var A=window.document.getElementById(I);var K=A.rows;var F=0;var D=0;var J=null;var H=null;var G=new Array();var C=null;for(F=0;F<K.length;F++){J=K.item(F).cells;H=new Array();for(D=0;D<J.length;D++){H[D]=J.item(D).innerHTML}if((H.length>0)&&(H[0].toLowerCase()=="<b>totals</b>")){C=H}else{this.addSorted(H,E,G)}}if(B){G.reverse()}if(C!=null){G[G.length]=C}for(F=0;F<G.length;F++){H=G[F];J=K.item(F).cells;for(D=0;D<J.length;D++){J.item(D).innerHTML=H[D]}}this.setColumnHeader(E,B,I)};__stormcenter.prototype.addSorted=function(B,C,A){var E=0;var F=false;var G="";var D="";for(E=0;E<A.length;E++){G=A[E][C].split(" ");D=B[C].split(" ");if(C==1||C==2){G=parseInt(G);D=parseInt(D)}if(G>D){F=true;A.insertNth(B,E);break}}if(!F){A[A.length]=B}};__stormcenter.prototype.setColumnHeader=function(C,D,I){var G="&nbsp";var B="&nbsp";var E=null;var A=null;if(D){G="&uarr"}else{G="&darr"}var H=window.document.getElementById(I+"_header").rows[0].childNodes;var F=0;for(F=0;F<H.length;F++){A=H[F].childNodes[0];if(A!=null){E=A.innerHTML;if(F==C){E=this.newHeaderString(E,G)}else{E=this.newHeaderString(E,B)}A.innerHTML=E}}};__stormcenter.prototype.newHeaderString=function(A,D){var C=A.split("&nbsp;");var B=C[0].concat("&nbsp;",D,";");return B};__stormcenter.prototype.howToSort=function(A){var B=this.howSorted[A];if(B==null){B=true}else{B=!B}return B};__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.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.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.showAccountQueryPanel=function(){if(this.accountPanel==null){var A=235;var B=400;var D=null;var C=null;var E=iFactor.common.getInnerWindowDimensions();D=Math.round((E[1]-B)/2.5);C=Math.round((E[0]-A)/1.5);if(D<=10){D=10}A=A+"px";B=B+"px";window.document.getElementById("account").style.display="";this.accountPanel=new YAHOO.widget.Panel("account",{close:true,width:A,x:C,y:D,height:B,zIndex:20000,draggable:true})}this.accountPanel.render();this.accountPanel.show()};__stormcenter.prototype.doAccountLookup=function(){var Z=window.document;var K=Z.getElementById("firstname").value;var M=Z.getElementById("lastname").value;var S=Z.getElementById("phonenumber").value;var Q=Z.getElementById("accountnumber").value;var P=iFactor.common.getServletPath();var P=P+"service=account&firstname="+K+"&lastname="+M+"&phonenumber="+S+"&accountnumber="+Q;var E=window.document.getElementById("account_results");var O=E.rows;var C=O.length;while(E.rows.length>0){E.deleteRow(0)}var A=E.insertRow(E.rows.length);var D=A.insertCell(A.cells.length);D.innerHTML="Searching for customers.  Please wait...";var F=iFactor.common.createXMLRequest();var B=P+iFactor.common.uniqueRequestTag(false);B=B.fixUrlSeparator();var W=this;F.open("GET",B,false);F.send(null);if((F.readyState==4)&&(F.status!=404)){var N=F.responseXML.getElementsByTagName("account");var R=0;var I=null;var G="";var H=null;var Y=null;var V=null;var L=null;var K=null;var M=null;var S=null;var U=null;var H=null;var Y=null;var E=window.document.getElementById("account_results");var O=E.rows;var C=O.length;for(R=0;R<C;R++){try{E.deleteRow(R)}catch(T){E.deleteRow(-1)}}if(N.length>0){for(R=0;R<N.length;R++){I=N[R];K=iFactor.common.getXMLNodeValue(iFactor.common.getXMLChildNamed(I,"first_name"));M=iFactor.common.getXMLNodeValue(iFactor.common.getXMLChildNamed(I,"last_name"));S=iFactor.common.getXMLNodeValue(iFactor.common.getXMLChildNamed(I,"phone_number"));U=iFactor.common.getXMLNodeValue(iFactor.common.getXMLChildNamed(I,"area_code"));H=iFactor.common.getXMLNodeValue(iFactor.common.getXMLChildNamed(I,"lat"));Y=iFactor.common.getXMLNodeValue(iFactor.common.getXMLChildNamed(I,"lng"));G="Name: "+K+" "+M+"<br/>";G=G+"Phone: "+U+"-"+S;mycurrent_row=E.insertRow(E.rows.length);mycurrent_cell=document.createElement("td");var J=document.createElement("a");J.setAttribute("href","javascript:iFactor.StormCenter.gotoAccount("+H+","+Y+",'"+G+"');");J.className="hlink";var X=document.createElement("b");currenttext=document.createTextNode(M+", "+K);X.appendChild(currenttext);J.appendChild(X);mycurrent_cell.appendChild(J);mycurrent_row.appendChild(mycurrent_cell);mycurrent_cell=document.createElement("td");phone=document.createTextNode(U+"-"+S);mycurrent_cell.width="85px";mycurrent_cell.appendChild(phone);mycurrent_row.appendChild(mycurrent_cell)}}else{mycurrent_row=document.createElement("tr");mycurrent_cell=document.createElement("td");currenttext=document.createTextNode("No records found...");mycurrent_cell.appendChild(currenttext);mycurrent_row.appendChild(mycurrent_cell);E.tBodies[0].appendChild(mycurrent_row)}}};__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+"Click <a href='javascript:iFactor.StormCenter.map.DeletePushpin(\""+E+"\")'>here</a> to remove this location.";return H};__stormcenter.prototype.layerUserVisible=function(B){var D=this.getLayerVisibleOverride(B);if(D==null){D=true}var C=window.document.getElementById("show"+B);if(!C){return D}var A=C.checked;if(typeof A=="string"){A=A.toLowerCase()=="true"}return(A&&D)};__stormcenter.prototype.getLayerVisibleOverride=function(A){if(!this.hasOwnProperty("layerVisibleOverride")){this.layerVisibleOverride={}}return this.layerVisibleOverride[A]};__stormcenter.prototype.setLayerVisibleOverride=function(A,B){if(!this.hasOwnProperty("layerVisibleOverride")){this.layerVisibleOverride={}}this.layerVisibleOverride[A]=B};__stormcenter.prototype.togglePointLayer=function(A){var C=this.pointLayers[A];var B=null;B=window.document.getElementById("show"+A);if(B.checked){this.pointLayers[A].Show()}else{this.pointLayers[A].Hide()}this.saveMapState()};__stormcenter.prototype.saveMapState=function(){if(iFactor.common.cookiesEnabled()){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(A.hasOwnProperty(name)){if(B!=""){B=B+"|"}B=B+name+":"+A[name]}}iFactor.common.createCookie("state",B,365)}};__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.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.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");if(E!=null){E.innerHTML="";E.options[0]=new Option("Select...","",false);var B=iFactor.common.readCookie("favorites");if(B!=null){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.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.showAlerts=function(){var B=iFactor.common.createXMLRequest();var A=iFactor.common.config.data_static_directory+"/"+iFactor.common.config.alert_file;A=A+iFactor.common.uniqueRequestTag(true);A=A.fixUrlSeparator();B.onreadystatechange=function(){iFactor.StormCenter.doShowAlerts(B)};B.open("GET",A,true);B.send(null)};__stormcenter.prototype.doShowAlerts=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.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.accountLookup=function(){var I=window.document;var H=I.getElementById("firstname").value;var E=I.getElementById("lastname").value;var A=I.getElementById("phonenumber").value;var D=I.getElementById("accountnumber").value;var G=iFactor.common.getServletPath();var G=srtr+"service=account&firstname="+H+"&lastname="+E+"&phonenumber="+A+"&accountnumber="+D;var C=xmlUtil.createXMLRequest();var B=G+xmlUtil.uniqueRequestTag(false);B=B.fixUrlSeparator();var F=this;C.onreadystatechange=function(){F.doAccountLookup(C)};C.open("GET",B,true);C.send(null)};__stormcenter.prototype.showProviderChartPanel=function(){var A="<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' width='560px' height='585px' id='wholesalechart'>";A=A+"<param name='movie' value='flashcharts/FC_2_3_Column2D.swf'/>";A=A+"<param name='FlashVars' value='&dataURL=datastatic/providerchart.xml&chartWidth=560&chartHeight=585'/>";A=A+"<param name='quality' value='high'/>";A=A+"<param name='bgcolor' value='#FFFFFF'/>";A=A+"<embed src='flashcharts/FC_2_3_Column2D.swf' flashvars='&dataURL=datastatic/providerchart.xml' quality='high' bgcolor='#FFFFFF' width='560px' height='585px' name='wholesalechart' type='application/x-shockwave-flash' pluginspace='http://www.macromedia.com/go/getflashplayer'></embed>";A=A+"</object>";if(this.providerChartPanel==null){this.providerChartPanel=this.getNewChart("providerchart")}this.providerChartPanel.setBody(A);this.providerChartPanel.render();this.providerChartPanel.show()};__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.applicationLoad=new YAHOO.util.CustomEvent("scAppLoad",this);__stormcenter.prototype.beforeApplicationLoad=new YAHOO.util.CustomEvent("scB4AppLoad",this);__stormcenter.prototype.afterLayerLoaded=new YAHOO.util.CustomEvent("scAfterLayerLoaded",iFactor.StormCenter,false,YAHOO.util.CustomEvent.LIST);__stormcenter.prototype.layerLoadFile=new YAHOO.util.CustomEvent("scLayerLoadFile",iFactor.StormCenter,false,YAHOO.util.CustomEvent.LIST);__stormcenter.prototype.layerConfigure=new YAHOO.util.CustomEvent("scLayerConfigure",iFactor.StormCenter,false,YAHOO.util.CustomEvent.LIST);iFactor.StormCenter=new __stormcenter();iFactor.StormCenter.afterLayerLoaded.subscribe(iFactor.StormCenter.layersDynamicLegend);