__stormcenter.prototype.handleSOAPException=function(A){var F=A.description;var I=A.message;var C=iFactor.StormCenter;iFactor.StormCenter.stopLoader();if(F&&F.match("IFTokenExpired")){C.showAlertBox("Your session has expired.  Please refresh your browser.")}else{if(F&&F.match("IFCannotRemoveSoleAdminUser")){C.showAlertBox("You are attempting to remove the sole Administrator for this organization.  That is not allowed.  First assign another user Admin permissions and then try your action again.")}else{if(F&&F.match("IFInsufficientRights")){C.showAlertBox("You do not have sufficient rights for this action.")}else{if(F&&F.match("IFInvalidCredentials")){createCookie("navcheck","true",7);createCookie("clienturl",parent.location.href,7);window.parent.location.href=readCookie("clienturl")}else{if(F&&F.match("IFNoSuchRecordException")){C.showAlertBox("No such record is found.")}else{if(F&&F.match("IFIncidentNotReported")){var I="There was a problem completing your report. <br><br> We have been notified about this issue and will look into the problem shortly, but please feel free to try again.";if(iFactor.common.config.failure_in_submitting_report_form){I=iFactor.common.config.failure_in_submitting_report_form}C.showAlertBox(I)}else{if(F&&F.match("IFOutofBoundsException")){var I="You are attempting to report an incident outside the area served by ";var D=proxies.IFCommonService.GetOrganizationInfoForUserToken;D.func=null;D.onException=iFactor.StormCenter.handleSOAPException;var G=iFactor.StormCenter.GetIFactorWebServicesUserToken();var H=D(G);var B=H.getElementsByTagName("fullname")[0];var E=iFactor.common.getXMLNodeValue(B);iFactor.StormCenter.OrgName=ucfirst(E);if(iFactor.StormCenter.OrgName!=undefined&&iFactor.StormCenter.OrgName!="null"){I=I+"'"+iFactor.StormCenter.OrgName+"'"}else{I=I+"the organization"}if(iFactor.common.config.outside_the_service_area){I=iFactor.common.config.outside_the_service_area}iFactor.StormCenter.showAlertBox(I)}else{if(F&&F.match("IFInvalidEmailAddress")){iFactor.StormCenter.showAlertBox("The Email Address is not in a valid format.")}else{if(F&&F.match("IX_users")){C.showAlertBox("User Account Exists. Please try Again.")}else{if(I&&I.match("Result-Status:0")){}else{}}}}}}}}}}};function RequestParameter(A){var E=iFactor.StormCenter.RequestParameters[A];if(E){return unescape(E)}A=A.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var B="[\\?&]"+A+"=([^&#]*)";var D=new RegExp(B);var C=D.exec(window.location.href);if(C!==null){return unescape(C[1])}}function ucfirst(B){var A=B.substr(0,1);return A.toUpperCase()+B.substr(1)}__stormcenter.prototype.loadStreetLight=function(){if(document.getElementById("ifc_streetlightmapBody")){document.getElementById("ifc_streetlightmapBody").style.display="block";iFactor.StormCenter.overlaySLO()}var A=null;if(/MSIE (\d+\.\d+);/.test(navigator.userAgent)){A=new Number(RegExp.$1)}if((A!=null)&&(A<=8)){document.getElementById("loki").style.display="none"}if(document.searchGrp.search){iFactor.StormCenter.searchRadio_onchange("pole","address")}this.IFactorWebServicesUserToken=RequestParameter("usertoken");if(!this.IFactorWebServicesUserToken){var C=proxies.IFCommonService.GetUserToken;C.func=null;C.onException=iFactor.StormCenter.handleSOAPException;this.IFactorWebServicesUserToken=C(RequestParameter("username"),RequestParameter("password")||"",120)}var B=proxies.IFCommonService.GetStatusNamesByOrg;B.func=null;B.onException=iFactor.StormCenter.handleSOAPException;iFactor.common.config.statusTypes=B(this.IFactorWebServicesUserToken);var F=this;F.TokenChanged();var G=function(J){var H=YAHOO.lang.JSON.parse(J);var K;var I=iFactor.common.config;for(K in H){if(H.hasOwnProperty(K)){I[K]=H[K]}}F.getAllowableBounds()};var D=this.GetIFactorWebServicesUserToken();var E={prepare:function(H){return H},call:function(I){var H=proxies.IFCommonService.GetConfigurations;H.func=this.call.func;H.onException=this.call.onException;H(D)},finish:G,onException:iFactor.StormCenter.handleSOAPException};ajax.Start(E)};__stormcenter.prototype.updateConfigurationFromRequestQueryStringParameters=function(){var A=iFactor.common.config;A.start_lat=RequestParameter("start_lat")?parseFloat(RequestParameter("start_lat")):A.start_lat;A.start_long=RequestParameter("start_long")?parseFloat(RequestParameter("start_long")):A.start_long;A.start_zoom=RequestParameter("start_zoom")?parseInt(RequestParameter("start_zoom"),10):A.start_zoom};__stormcenter.prototype.loadStreetLightAfterConfiguration=function(){this.variablesInitialization();this.checkBrowserCompatibility();this.initialiseLayers();this.initialiseVisibilityControl();this.initialiseLayerVisibility(true);document.getElementById("slLegendStreetlights").src=iFactor.common.config.streetlight_ICON_URL;document.getElementById("slLegendReportedOutage").src=iFactor.common.config.streetlight_reported_outage_ICON_URL;document.getElementById("slHelpStreetLightIcon").src=iFactor.common.config.streetlight_ICON_URL;this.initialiseBounds();this.initialiseTimer();var A;try{if(window.document.getElementById("token")){var F=window.document.getElementById("token").innerHTML}A=this.map=new VEMap("map");if(F!=null&&F!=""){A.SetClientToken(F)}}catch(G){iFactor.StormCenter.showAlertBox("The map is currently unavailable. Please wait a few moments and refresh your browser window.");return }var B=this.getStartLatLngZoom();var C=new VELatLong(B[0],B[1]);if(A.EnableShapeDisplayThreshold){A.EnableShapeDisplayThreshold(false)}A.SetDashboardSize(VEDashboardSize.Normal);var N=new VEMapOptions();N.EnableBirdseye=iFactor.StormCenter.getConfigValueWithDefault("enableBirdsEye",true);A.LoadMap(C,B[2],iFactor.common.config.map_type,null,null,false,null,N);this.isManagementPanel=false;if(RequestParameter("mgmt")=="true"){this.isManagementPanel=true;iFactor.common.config.setZoom=false;var H=document.getElementById("ifc_header");if(H){H.style.visibility="hidden";document.getElementById("map").style.top="0px"}}A.AttachEvent("onchangeview",function(O){iFactor.StormCenter.onMapPan()});A.AttachEvent("onendzoom",function(O){iFactor.StormCenter.onEndZoom(O)});A.AttachEvent("onchangemapstyle",function(O){iFactor.StormCenter.onMapStyle()});if(iFactor.common.config.setZoom){A.AttachEvent("onchangeview",function(O){iFactor.StormCenter.setZoomLevelWarning()})}A.AttachEvent("onchangemapstyle",function(O){iFactor.StormCenter.saveMapState()});A.AttachEvent("ontokenexpire",function(O){iFactor.StormCenter.handleTokenExpire(O)});A.AttachEvent("ontokenerror",function(O){iFactor.StormCenter.handleTokenError(O)});if(this.isManagementPanel){A.AttachEvent("onmouseover",iFactor.StormCenter.mouseShapeHandlerForManagement)}else{A.AttachEvent("onmouseover",iFactor.StormCenter.mouseShapeHandler);A.AttachEvent("onmousedown",iFactor.StormCenter.startIncidentPoint);A.AttachEvent("onmouseup",iFactor.StormCenter.endIncidentPoint1);A.AttachEvent("onmouseout",iFactor.StormCenter.onMouseOutThematicShape)}this.providerChartPanel=null;var M=iFactor.common.getArguments().x;var L=iFactor.common.getArguments().y;if((M!=null)&&(M!="")&&(L!=null)&&(L!="")){this.zoomToXY(M,L)}else{this.onMapPan()}this.singleClick=1;var K=document.getElementById("MSVE_navAction_topBar");if(K!=null){K.removeChild(document.getElementById("MSVE_navAction_showLabels"));K.removeChild(document.getElementById("MSVE_navAction_separator2"));K.removeChild(document.getElementById("MSVE_navAction_separator3"))}this.setThemeStyle(iFactor.common.config.themeInfo);this.addPoweredBy();var J="url("+iFactor.common.config.IFactorStreetlightoutagesURL+"images/tipsy-south.gif)";var I=document.getElementById("help_button");I.style.background=J;I.style.backgroundRepeat="no-repeat";I.style.backgroundPosition="100% 50%";var E=document.getElementById("address_value");var D="Enter Address or Pole Number to Locate";if(iFactor.common.config.addressBoxText){D=iFactor.common.config.addressBoxText}E.value=D;E.onfocus=function(){if(this.value==D||this.value=="Enter Address to Locate"){this.value=""}};this.showIncidentReportDialogOnload();this.addMapHeader();if(readCookie("navcheck")){eraseCookie("navcheck");eraseCookie("clienturl");iFactor.StormCenter.showAlertBox("RPX Login requires you to Login with a different Email Id. The Email Id you logged in is part of the old Login Version. Contact support@ifactorconsulting.com for assistance.")}};__stormcenter.prototype.getConfigValueWithDefault=function(B,A){if(iFactor.common.config.hasOwnProperty(B)){return iFactor.common.config[B]}else{return A}};__stormcenter.prototype.setThemeStyle=function(H){var J=document;var I=J.getElementById("MSVE_navAction_leftBackground");var B=J.getElementById("MSVE_navAction_compassBackground");var F=J.getElementById("MSVE_navAction_topBackground");var A=J.getElementById("Compass");var K=J.getElementById("incidentReportDivDefault");var C=J.getElementById("incidentReportDiv");var E=J.getElementById("reportPanel_h");if(H!=null&&H!=""){if(I&&B&&F&&A){var D=H.compassColor;this.setCellStyle(I.style,D);this.setCellStyle(B.style,D);this.setCellStyle(F.style,D);this.setMapControlImage(A.style,D)}if(K&&C){K.style.color=H.formReportTable}}if(H.compassColor=="green"){var G="url("+iFactor.common.config.IFactorStreetlightoutagesURL+"images/search_green.jpg)";document.getElementById("searchbutton").style.background=G}else{if(H.compassColor=="#ac1a1b"){var G="url("+iFactor.common.config.IFactorStreetlightoutagesURL+"images/search_red.jpg)";document.getElementById("searchbutton").style.background=G}else{if(H.compassColor=="#235087"){var G="url("+iFactor.common.config.IFactorStreetlightoutagesURL+"images/search_blue.jpg)";document.getElementById("searchbutton").style.background=G}else{var G="url("+iFactor.common.config.IFactorStreetlightoutagesURL+"images/search_yellow.jpg)";document.getElementById("searchbutton").style.background=G}}}};__stormcenter.prototype.setCellStyle=function(A,B){if(A&&B){A.backgroundColor=B}};__stormcenter.prototype.setMapControlImage=function(B,D){var C=iFactor.common.config.IFactorStreetlightoutagesURL+"images";var A=C+"/compass_"+D.replace(/\#/g,"%23")+".gif";B.background="transparent url("+A+") no-repeat"};__stormcenter.prototype.addPoweredBy=function(){var C=new YAHOO.widget.Overlay("poweredby",{visible:true,context:["map","tr","tr",,[0,25]]});var B=iFactor.common.config.IFactorStreetlightoutagesURL;var A=null;if(/MSIE (\d+\.\d+);/.test(navigator.userAgent)){A=new Number(RegExp.$1)}if(A<=6){C.setBody('<span class="powered_by_slo" style="width:140px;height:65px;display:inline-block;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='+B+'images/powered_by_slo.png)"><img style="filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);"  src="'+B+'images/powered_by_slo.png" width="140" height="65" border="0" alt=""/></span>')}else{C.setBody('<span class="powered_by_slo" style="width:140px;height:65px;display:inline-block;"><img src="'+B+'images/powered_by_slo.png" width="140" height="65" border="0" alt=""/></span>')}C.render("ifc_content")};__stormcenter.prototype.mouseShapeHandler=function(G){if(G.elementID){var A=iFactor.StormCenter.map;var I=A.GetShapeByID(G.elementID);var F=I.GetShapeLayer();var C=F&&F.GetTitle();var B=null;var L=null;var H=iFactor.StormCenter;var M=false;var O=null;if(H.isLayerVisible("sloutages")||A.GetMapStyle()=="b"||A.GetMapStyle()=="o"){if(C=="ctvThematics"){A.DeleteShapeLayer(F)}if(C==="confirmedIncidents"||C==="reportedIncidents"||C==="reported_rejectedIncidents"||C==="in_progressIncidents"){L=proxies.IFIncidentService.GetDisplayHTML;M=true}else{if(C==="streetlightAssets"){L=proxies.IFAssetService.GetDisplayHTML}}}else{if(C=="stateThematics"){H.onMouseOverThematicShape(G);return true}else{if(C=="countyThematics"||C=="ctvThematics"){H.onMouseOverThematicShape(G);var E=I.GetTitle();if(E&&E!=""){H.setShapeThematicDescription(E)}return true}}}if(!iFactor.common.config.timeZone){O=""}if(L){B=I.GetTitle();if(I.GetDescription()==""){if((G.eventName==="onmouseover"||G.eventName==="onmouseup")&&B){var K=iFactor.StormCenter.getConfigValueWithDefault("tempInfoBoxDescription","<br/><br/><br/><br/><br/>Getting Information...<br/><br/><br/><br/><br/>");I.SetDescription(K);A.ShowInfoBox(I);var J=function(Q){var P=null;if(Q.xml==undefined){P=(new XMLSerializer()).serializeToString(Q)}else{P=Q.xml}I.SetDescription(P);A.ShowInfoBox(I)};var N=iFactor.StormCenter.GetIFactorWebServicesUserToken();var D={prepare:function(P){return P},call:function(P){L.func=this.call.func;L.onException=this.call.onException;if(M){L(N,B)}else{L(N,B)}},finish:J,onException:iFactor.StormCenter.handleSOAPException};ajax.Start(D)}}else{A.ShowInfoBox(I)}}else{if(C=="mappin"){I.SetDescription("<a href=\"javascript:iFactor.StormCenter.deleteMappinShape('"+I.GetID()+"');\">Delete Pin</a>");A.ShowInfoBox(I)}}}return true};__stormcenter.prototype.mouseShapeHandlerForManagement=function(F){if(F.elementID){var A=iFactor.StormCenter.map;var G=A.GetShapeByID(F.elementID);var D=G.GetShapeLayer();var C=D&&D.GetTitle();var B=G.GetTitle();var E=this;var H=null;if(F.eventName==="onmouseover"&&B){if(C==="confirmedIncidents"){var I="This incident has been confirmed.";G.SetDescription(I);A.ShowInfoBox(G)}else{if(C==="reportedIncidents"){var I='<div class="infoboxtitle"><table><tr><td><b> Reported </b></td></tr></table></div>';if(B){I+="<br/>"+iFactor.StormCenter.setShapeDescription(B)}I+='<a href="javascript:iFactor.StormCenter.changeStatusBySLOID('+B+",'"+G.GetID()+"','reported');\">Mark this Complete</a>";G.SetDescription(I);A.ShowInfoBox(G)}else{if(C==="resolvedIncidents"){var I='<div class="infoboxtitle"><table><tr><td><b> Resolved </b></td></tr></table></div>';if(B){I+="<br/>"+iFactor.StormCenter.setShapeDescription(B)}I+='<a href="javascript:iFactor.StormCenter.changeStatusBySLOID('+B+",'"+G.GetID()+"','resolved');\">Mark this Complete</a>";G.SetDescription(I);A.ShowInfoBox(G)}else{if(C==="in_progressIncidents"){var I='<div class="infoboxtitle"><table><tr><td><b> In Progress </b></td></tr></table></div>';if(B){I+="<br/>"+iFactor.StormCenter.setShapeDescription(B)}I+='<a href="javascript:iFactor.StormCenter.changeStatusBySLOID('+B+",'"+G.GetID()+"','in_progress');\">Mark this Complete</a>";G.SetDescription(I);A.ShowInfoBox(G)}else{A.ShowInfoBox(G)}}}}}}return true};__stormcenter.prototype.confirmIncident=function(B){var E=this;var F=function(G){E.showIncidents()};var A=proxies.IFIncidentService.ConfirmIncident;var C=this.GetIFactorWebServicesUserToken();var D={prepare:function(G){return G},call:function(G){A.func=this.call.func;A.onException=this.call.onException;A(C,B)},finish:F,onException:iFactor.StormCenter.handleSOAPException};ajax.start(D)};__stormcenter.prototype.getGuestToken=function(){var C=this;var A=proxies.IFCommonService.GetUserToken;var D=function(E){eraseCookie("fname");eraseCookie("gname");eraseCookie("emailid");C.IFactorWebServicesUserToken=E;C.TokenChanged();C.refreshMap();if(document.getElementById("incidentPanel").style.visibility=="visible"){document.getElementById("incidentPanel").style.visibility="hidden"}};var B={prepare:function(E){return E},call:function(E){A.func=this.call.func;A.onException=this.call.onException;A(RequestParameter("username"),RequestParameter("password")||"",200)},finish:D,onException:iFactor.StormCenter.handleSOAPException};ajax.Start(B)};__stormcenter.prototype.getRPXToken=function(){var D=this;var A=proxies.IFCommonService.GetUserToken;var E=function(F){D.IFactorWebServicesUserToken=F;D.TokenChanged();D.refreshMap()};var B=function(F){};var C={prepare:function(F){return F},call:function(F){A.func=this.call.func;A.onException=this.call.onException;A(readCookie("emailid"),"",200)},finish:E,onException:iFactor.StormCenter.handleSOAPException};ajax.Start(C)};__stormcenter.prototype.startIncidentPoint=function(B){var D=iFactor.StormCenter;var E=D.map;if(!D.isLayerVisible("sloutages")){var C=document.getElementById("countyTitle");if(C){D.deletePanel(C)}}D.incidentCenter=GetCenterLatLong(E);D.incidentZoom=GetZoomLevel(E);var A=new VEPixel(B.mapX,B.mapY);D.incidentPoint=getPixelViewLatLong(A)};__stormcenter.prototype.endIncidentPoint1=function(A){var B=function(){iFactor.StormCenter.endIncidentPoint(A)};setTimeout(B,1)};__stormcenter.prototype.endIncidentPoint=function(D){var J=iFactor.StormCenter;var C=iFactor.common.config;var P=[];var B=J.map;var L=0;if(B.GetMapStyle()=="b"||B.GetMapStyle()=="o"){L=1}if((!J.isLayerVisible("sloutages")&&L==0)||this.panned){this.panned=false;var I=D;var K=function(){iFactor.StormCenter.checkClick(I)};setTimeout(K,50);return }else{var B=J.map;var O=J.incidentCenter;var N=GetCenterLatLong(B);if(O!=null&&O.Latitude!=null&&O.Longitude!=null){var F=N.Latitude-O.Latitude;var G=N.Longitude-O.Longitude}if(D.elementID!=null){P=["ctvThematics","countyThematics"];J.HideLayer(P)}var H=iFactor.StormCenter.mouseCheckHandler(D);if((D.elementID==null||D.elementID=="null")||H==false){if((F===0)&&(G===0)&&(GetZoomLevel(B)===J.incidentZoom)&&(J.incidentPoint!=null)){iFactor.StormCenter.startLoader();var A=function(S){this.warningDialog=new YAHOO.widget.SimpleDialog("confirmationPanel",{width:"360px",fixedcenter:true,modal:false,close:true,draggable:false,visible:false,zIndex:105,constraintoviewport:false,hideaftersumbit:false,buttons:[{text:"Return to Map",handler:function(){this.hide();J.ie6FixDeletePanel()}},{text:"Continue",handler:function(){this.hide();J.ie6FixDeletePanel();J.showIncidentReportDialog(J.incidentPoint)},isDefault:true}],icon:YAHOO.widget.SimpleDialog.ICON_INFO});var R=null;if(/MSIE (\d+\.\d+);/.test(navigator.userAgent)){R=new Number(RegExp.$1)}if(R<=6){this.warningDialog.beforeHideEvent.subscribe(function(){iFactor.StormCenter.ie6FixDeletePanel()})}this.warningDialog.setHeader('<div class="ifc_dialogFont"> Confirmation </div>');if(C.adhoc_location_msg!=undefined){this.warningDialog.setBody('<div class="ifc_dialogFont">'+C.adhoc_location_msg+"</div>")}else{this.warningDialog.setBody('<div class="ifc_dialogFont"> You are reporting a light that is not identified on the map. Please ensure that the location is accurate.</div>')}this.warningDialog.render("ifc_content");this.warningDialog.show();iFactor.StormCenter.stopLoader()};var Q=iFactor.StormCenter.GetIFactorWebServicesUserToken();var M=proxies.IFIncidentService.checkServiceareaBounds;var E={prepare:function(R){return R},call:function(R){M.func=this.call.func;M.onException=this.call.onException;M(Q,iFactor.StormCenter.incidentPoint.Longitude,iFactor.StormCenter.incidentPoint.Latitude)},finish:A,onException:iFactor.StormCenter.handleSOAPException};ajax.Start(E)}}else{iFactor.StormCenter.mouseShapeHandler(D)}}J.incidentCenter=null;J.incidentZoom=null;this.panned=false};__stormcenter.prototype.mouseCheckHandler=function(G){if(G.elementID){var F=iFactor.StormCenter.map;var B=F.GetShapeByID(G.elementID);var C=B.GetShapeLayer();var D=C&&C.GetTitle();var H=null;var A=null;var E=iFactor.StormCenter;if(E.isLayerVisible("sloutages")||F.GetMapStyle()=="b"||F.GetMapStyle()=="o"){if(D==="confirmedIncidents"||D==="reportedIncidents"||D==="reported_rejectedIncidents"||D==="in_progressIncidents"){A=proxies.IFIncidentService.GetDisplayHTML}else{if(D==="streetlightAssets"){A=proxies.IFAssetService.GetDisplayHTML}}}if(A){return true}else{return false}}else{return false}};__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}}var A=myHeight-700;var B=myWidth-300;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.updateLegend=function(){var A=document.getElementById("legend_tab");if(A){if(A.className==="on"){this.tabshow("legend")}}};__stormcenter.prototype.readVectorLayer=function(C,E){if(this.isLayerVisible(C)){var B=""+E.data_directory;if(B){var A=B+"/metadata.xml";A=A+iFactor.common.uniqueRequestTag(true);var D=iFactor.common.createXMLRequest();D.onreadystatechange=function(){iFactor.StormCenter.doReadVectorLayer(D,C,E)};D.open("GET",A,true);D.send(null)}}};__stormcenter.prototype.typeOfIndexGeneratorForLayer=function(C){var B=this.getSpatialIndexForLngLatZoom;var D=this.layersDefinition[C];var A;if(D){A=D.indexgenerator;if(A){B=A}}return B};__stormcenter.prototype.typeOfLayerImporter=function(C){var A=this.importPointLayer;var D=this.layersDefinition[C];var B;if(D){B=D.layerimporter;if(B){A=B}}return A};__stormcenter.prototype.dataFileSuffix=function(B){var D=".xml";var C=this.layersDefinition[B];var A;if(C){A=C.datafilesuffix;if(A){D=A}}return D};__stormcenter.prototype.getSpatialIndexForStreetLightZoomLevel15=function(F,E){var D=this.map;var B=D.IFLatLongToPixelXY(E,F,15);var A=D.IFPixelXYToTileXY(B.pixelx,B.pixely);var C=parseInt(A.tiley,10);var G=parseInt(A.tilex,10);return G+"_"+C};__stormcenter.prototype.getSpatialIndexForStreetLightOutage=function(){return"all"};__stormcenter.prototype.doReadIndexVectorLayer=function(E,H){var C;var B=null;var A=GetZoomLevel(this.map);var G=this.getMapSpatialIndices(A,E);var I=this.dataFileSuffix(E);var J=this.typeOfLayerImporter(E);var D=this.isLayerVisible(E);if(this.getIndicesForLayerSource(E,H)===null){for(C=0;C<G.length;C=C+1){B=G[C]+I;J(H,B,E,D)}this.setIndicesForLayerSource(E,H,G)}else{for(C=0;C<G.length;C=C+1){var F=G[C];var K=this.existIndexInIndicesForLayerSource(E,H,F);if(!K){B=F+I;J(H,B,E,D);this.addAtTheEndIndexInIndicesForLayerSource(E,H,F)}}}};__stormcenter.prototype.getJSONTile=function(D,H,B,A){if(!this.yuiDataSources){this.yuiDataSources={}}var G=this.yuiDataSources[B];if(!G){var F={resultsList:"points",fields:[{key:"id"},{key:"latitude"},{key:"longitude"},{key:"owner"}],metaFields:{iconurl:"iconurl"}};G=new YAHOO.iFactor.XHRDataSource(D+"/");G.responseType=YAHOO.util.XHRDataSource.TYPE_JSON;G.responseSchema=F;G.maxCacheEntries=0;this.yuiDataSources[B]=G}var C=this.pointLayers[B];var E=this.map;if(!C){C=new VEShapeLayer();E.AddShapeLayer(C);C.SetTitle(B);this.pointLayers[B]=C}if(A){C.Show()}else{C.Hide()}if(iFactor.common.config.disable_map_msg_box){E.ShowMessageBox=false}G.sendRequest(H,{success:function(I,K,J){iFactor.StormCenter.JSONLayerLoaded(J.layer,J.layerName)},failure:function(I){},argument:{layerName:B,layer:C},scope:this})};__stormcenter.prototype.JSONLayerLoaded=function(A,B){};__stormcenter.prototype.importPointLayer=function(D,B,C,A){this.doImportPointLayer(null,D+"/"+B,C,A)};__stormcenter.prototype.setZoomLevelWarning=function(){var C=iFactor.common.config;if(!this.cachedDialogs){this.cachedDialogs={}}var D=this.cachedDialogs.zoomLevelWarning;if((GetZoomLevel(this.map)>C.max_ctv_zoom_level)&&(GetZoomLevel(this.map)<C.min_data_zoom_level)){var H=["ctvThematics"];iFactor.StormCenter.HideLayer(H);var B=150;var J=100;if(!D){D=new YAHOO.widget.Panel("zoomlevelwarning",{modal:false,width:B+"px",draggable:false,close:false,zIndex:20});this.cachedDialogs.zoomLevelWarning=D}var A=this.map;var F=this;if(!this.isLayerVisible("sloutages")){D.setBody(iFactor.common.config.zoomLevelWarningBody);D.render("ifc_content");D.show();var G=this.map.mapelement.offsetTop+this.map.mapelement.clientHeight-(J/2)+"px";var I=this.map.mapelement.offsetLeft+(this.map.mapelement.clientWidth/2)-(B/2)+"px";var E=document.getElementById("zoomlevelwarning_c");if(E!=null){E.style.left=I;E.style.top=G}}else{D.hide()}}else{if(D!=null){D.hide()}}};__stormcenter.prototype.zoomToDataLevel=function(){this.map.SetZoomLevel(iFactor.common.config.min_data_zoom_level)};__stormcenter.prototype.EventLayersConfigured=new YAHOO.util.CustomEvent("scLayersConfigured",iFactor.StormCenter,false,YAHOO.util.CustomEvent.LIST);__stormcenter.prototype.beforeApplicationLoad=new YAHOO.util.CustomEvent("scB4AppLoad",iFactor.StormCenter);__stormcenter.prototype.reportIncident=function(I,B,H){var M={};var F;var C;var E=I.assetdbID;for(F in I){if(I.hasOwnProperty(F)){if(F!="incidenttype"&&F!="longitude"&&F!="latitude"){C=I[F];delete I[F];if(C&&C.length>0){M[F]=C}}}}var N=this.GetIFactorWebServicesUserToken();var L=I.incidenttype;var A=I.longitude;var K=I.latitude;var G=YAHOO.lang.JSON.stringify(M);var J=proxies.IFIncidentService.ReportIncident;var D={prepare:function(O){return O},call:function(O){J.func=this.call.func;J.onException=this.call.onException;J(N,L,A,K,G,E)},finish:B,onException:H};ajax.Start(D)};__stormcenter.prototype.GetIFactorWebServicesUserToken=function(){if(!this.IFactorWebServicesUserToken){this.RequestIFactorWebServicesUserToken()}return this.IFactorWebServicesUserToken};__stormcenter.prototype.RequestIFactorWebServicesUserToken=function(){};__stormcenter.prototype.CreateNewUser=function(){var F=this;var H=function(){this.cancel()};var G=function(K){var J=new YAHOO.widget.SimpleDialog("responsePanel",{width:"255px",fixedcenter:true,modal:false,close:false,draggable:false,visible:false,zIndex:500,constraintoviewport:true,hideaftersumbit:false,buttons:[{text:"OK",handler:function(){this.hide()},isDefault:true}],icon:YAHOO.widget.SimpleDialog.ICON_INFO});J.setHeader("New User");J.setBody(K);J.render(document.body);J.show();iFactor.StormCenter.getRPXToken()};var C=function(K){var J=proxies.IFCommonService.GetUserToken;J.func=null;J.onException=iFactor.StormCenter.handleSOAPException;F.IFactorWebServicesUserToken=J(readCookie("emailid"),"",200);F.TokenChanged()};var B=readCookie("gname");var D=readCookie("fname");var A=readCookie("emailid");var F=iFactor.StormCenter;var I=F.GetIFactorWebServicesUserToken();var E={prepare:function(J){return J},call:function(K){var J=proxies.IFCommonService.CreateUser;J.func=this.call.func;J.onException=this.call.onException;J(I,A,"",B,D,A,"")},finish:G,onException:C};ajax.Start(E)};__stormcenter.prototype.ForgotPassword=function(){var E=function(){this.cancel()};var A=function(F){this.submit()};var D=function(H){var J=H.responseXML;var F=J.getElementsByTagName("string")[0];var I=iFactor.common.getXMLNodeValue(F);var G=new YAHOO.widget.SimpleDialog("responsePanel",{width:"300px",fixedcenter:true,modal:true,close:false,draggable:false,visible:false,zIndex:500,constraintoviewport:true,hideaftersumbit:false,buttons:[{text:"OK",handler:function(){this.hide()},isDefault:true}],icon:YAHOO.widget.SimpleDialog.ICON_INFO});G.setHeader("Reset Password");G.setBody(I);G.render(document.body);G.show()};var C=function(F){iFactor.StormCenter.showAlertBox(F.responseText)};var B=new YAHOO.widget.Dialog("forgotPasswordDialog",{width:"300px",fixedcenter:true,modal:true,close:false,draggable:true,visible:false,zIndex:400,constraintoviewport:true,hideaftersumbit:true,buttons:[{text:"Submit",handler:A,isDefault:true},{text:"Cancel",handler:E}]});B.callback.success=D;B.callback.failure=C;B.setHeader(iFactor.common.config.forgotPasswordDialogHeader);B.setBody(iFactor.common.config.forgotPasswordDialogBody);B.render(document.body);B.show()};__stormcenter.prototype.showIncidentReportDialogOnload=function(){var B=290;var G=440;var E=document.getElementById("incidentReportDivDefault");if((E==null)||(E.style.display=="none")){return }this.overlayManager=new YAHOO.widget.OverlayManager();var C=function(J){};var F=function(J){};dialogDefault=new YAHOO.widget.Dialog("incidentReportDivDefault",{width:B+"px",height:G+"px",modal:false,close:false,draggable:false,fixedcenter:false,visible:true,zIndex:0,underlay:"none",hideaftersumbit:true,constraintoviewport:true,buttons:[{text:"Submit",handler:C,disabled:true},{text:"Cancel",handler:F,disabled:true}]});dialogDefault.setHeader(iFactor.common.config.incidentReporterDialogHeaderDock);dialogDefault.setBody(iFactor.common.config.incidentReporterDialogBodyDock);dialogDefault.render("ifc_content");this.dialogDefault=dialogDefault;var D=document.getElementById("incidentReportDivDefault_c");if(D!=null){D.style.left="0px";D.style.top="50px"}var A=document.getElementById("reportHeaderDock");if(A){this.setCellStyle(A.style,iFactor.common.config.themeInfo.formHeaderColor)}var I=window.parent.iFactor.StormCenter.GetIFactorUserToken();if(I==null||I=="undefined"){I=this.GetIFactorWebServicesUserToken()}else{this.loadContactDetails(dialogDefault,I)}iFactor.StormCenter.setCachedValueFromDialog(dialogDefault);this.overlayManager.register([dialogDefault]);dialogDefault.show();var H="";iFactor.StormCenter.formHighlight(dialogDefault,H)};__stormcenter.prototype.loadContactDetails=function(B,A){var D=function(H){var E=YAHOO.lang.JSON.parse(H);var I="";var G=B.form;var J=iFactor.StormCenter.prettify(E.firstname);var F=iFactor.StormCenter.prettify(E.lastname);if(J==null||J==""){I=F}if(J!=null&&J!=""&&F!=null&&F!=""){I=J+" "+F}if(F==null||F=="null"||F==""){I=J}G.contactname.value=I;G.phone.value=E.phone;G.email.value=E.email;iFactor.StormCenter.setCachedValueFromDialog(B)};var C={prepare:function(E){return E},call:function(F){var E=proxies.IFCommonService.GetUserDetailsAsJSON;E.func=this.call.func;E.onException=this.call.onException;E(A)},finish:D,onException:iFactor.StormCenter.handleSOAPException};ajax.Start(C)};__stormcenter.prototype.showIncidentReportDialog=function(L,E){var f=iFactor.common.config;f.dialogDefault=this.dialogDefault;this.GetIFactorWebServicesUserToken();var F=true;var e=document.getElementById("incidentReportDivDefault");if((e==null)||(e.style.display=="none")){F=false}var X;var O;var T=this;var g=this.map;if(this.currentIncidentInfo){this.currentIncidentInfo.tempShapeLayer.Hide();this.currentIncidentInfo.tempShapeLayer.DeleteAllShapes();g.DeleteShapeLayer(this.currentIncidentInfo.tempShapeLayer);this.currentIncidentInfo.tempShapeLayer=null}X=new VEShapeLayer();g.AddShapeLayer(X);if(iFactor.common.config.setClusters){if(E){if(iFactor.common.config.actualAssetCoordinates[E.assetdbID]){var a=iFactor.common.config.actualAssetCoordinates[E.assetdbID].split("|");L.Latitude=a[0];L.Longitude=a[1]}}}var Z=[{latitude:L.Latitude,longitude:L.Longitude}];X.IFAddJSON(Z,iFactor.common.config.streetlight_newly_reported_outage_ICON_URL);O=X.GetShapeByIndex(0);var Y=new YAHOO.widget.Panel("wait",{width:"300px",fixedcenter:true,close:false,draggable:false,zindex:4,modal:true,visible:false});Y.setHeader('<div class="ifc_dialogFont"> Submitting your report... </div>');Y.setBody('<img src="http://us.i1.yimg.com/us.yimg.com/i/us/per/gr/gp/rel_interstitial_loading.gif" align="middle"/>');var K=function(){Y.hide();X.Hide();X.DeleteAllShapes();g.DeleteShapeLayer(X);if(T.currentIncidentInfo){T.currentIncidentInfo.tempShapeLayer.Hide();T.currentIncidentInfo.tempShapeLayer.DeleteAllShapes();g.DeleteShapeLayer(T.currentIncidentInfo.tempShapeLayer)}T.currentIncidentInfo=null;this.cancel()};var W=function(k){var l=true;var s=this.getData();var n={};var r;var p;for(r in s){if(s.hasOwnProperty(r)){p=s[r];if((typeof p==="object")&&(p.constructor===Array)){p=p[0]}n[r]=p}}for(r in s){iFactor.StormCenter.setCachedValue(r,n[r]);if(r=="polenumber"){iFactor.StormCenter.setCachedValue(r,"")}}if(F){iFactor.StormCenter.getCachedValueForDialog(f.dialogDefault)}if((n.polenumber==null||n.polenumber=="")&&n.polenumberHidden!=undefined){n.polenumber=n.polenumberHidden}if(n.polenumberHidden!=undefined){n.polenumberHidden=null}n.latitude=L.Latitude;n.longitude=L.Longitude;var j;var w=0;var u=0;var q=false;var m=false;if(f.required_fields!=undefined){l=iFactor.StormCenter.formValidation(this,f.required_fields);j=f.required_fields.split(",");while(w<j.length){if(j[w]=="email"||j[w]=="verifyemail"){u=1}if(j[w]=="phone"){q=true}w++}if(iFactor.StormCenter.validatePhone(n.phone)){m=true}else{if(!q&&n.phone==""){m=true}else{m=false}}}else{if(iFactor.StormCenter.validatePhone(n.phone)){m=true}else{if(n.phone==""){m=true}else{m=false}}}if(l){if(iFactor.StormCenter.validateCommentsInput(n.comments)&&(n.email.toLowerCase()==n.verifyemail.toLowerCase()&&iFactor.StormCenter.validateEmailInput(n.email.toLowerCase())&&iFactor.StormCenter.validateEmailInput(n.verifyemail.toLowerCase())&&m)||(u==0&&n.email==""&&n.verifyemail==""&&m)){if((n.problemtype=="Other"&&f.commentMandatory_other=="true"&&n.comments!="")||(f.commentMandatory_other==undefined)||(n.problemtype!="Other")){if((f.NotPoleNumber=="true"&&n.polenumber==""&&n.comments!="")||(f.NotPoleNumber==undefined)||(n.polenumber!="")){Y.render(document.body);Y.show();T.showIncidents();X.Hide();X.DeleteAllShapes();g.DeleteShapeLayer(X);if(T.currentIncidentInfo){T.currentIncidentInfo.tempShapeLayer.Hide();T.currentIncidentInfo.tempShapeLayer.DeleteAllShapes();g.DeleteShapeLayer(T.currentIncidentInfo.tempShapeLayer)}T.currentIncidentInfo=null;var v=function(y){Y.hide();T.showIncidents();var o=new YAHOO.widget.SimpleDialog("responseDialog",{width:"350px",fixedcenter:true,modal:true,close:false,draggable:false,visible:false,zIndex:10000,constraintoviewport:true,hideaftersumbit:false,buttons:[{text:"OK",handler:function(){this.hide()},isDefault:true}],icon:YAHOO.widget.SimpleDialog.ICON_INFO});o.setHeader('<div class="ifc_dialogFont"><span style="font-size:13px;"> Thank you </span></div>');message="Your incident report has been submitted.<br/><br/>StreetLightOutages.com appreciates your help in keeping our communities safe by reporting interruptions of service in your area.";if(y!=null&&y.length>0){if(y[1]!=null&&y[1].length>0){message=y[1]}}if(iFactor.common.config.incident_response_dialog_message){message=iFactor.common.config.incident_response_dialog_message}o.setBody('<div class="ifc_dialogFont">'+message+"</div>");o.render(document.body);o.show()};var t=function(y){Y.hide();var AA=y.description;var o=new YAHOO.widget.SimpleDialog("responseDialog",{width:"350px",fixedcenter:true,modal:true,close:false,draggable:false,visible:false,zIndex:10000,constraintoviewport:true,hideaftersumbit:false,buttons:[{text:"OK",handler:function(){iFactor.StormCenter.showIncidents();this.hide()},isDefault:true}],icon:YAHOO.widget.SimpleDialog.ICON_INFO});o.setHeader('<div class="ifc_dialogFont"> Confirmation </div>');var z="There was a problem completing your report. <br><br> We have been notified about this issue and will look into the problem shortly, but please feel free to try again.";if(AA&&AA.match("IFIncidentNotReported")){var AB=AA.split("</>");if(AB.length>0){z=AB[1]}}if(iFactor.common.config.failure_in_submitting_report_form){z=iFactor.common.config.failure_in_submitting_report_form}o.setBody('<div class="ifc_dialogFont">'+z+"<br>"+AA+"</div>");o.render(document.body);o.show()};n.incidenttype="streetlight";if(E){n.assetdbID=E.assetdbID;if(E.Jurisdiction!=null&&E.Jurisdiction.length>0){n.Jurisdiction=E.Jurisdiction}if(E.LOA!=null&&E.LOA.length>0){n.LOA=E.LOA}}else{n.assetdbID=-1;n.Jurisdiction="na"}if(iFactor.common.config.sendEmail){n.sendEmail=iFactor.common.config.sendEmail}iFactor.StormCenter.reportIncident(n,v,t);this.cancel()}else{message="Please enter a pole number or a description of the location of the streetlight.  If entering a location description, please use descriptive details including address, streets, or landmarks. Example: 400 block of Truman and 5th behind red building next to mailbox.";if(iFactor.common.config.failure_in_submitting_report_form){message=iFactor.common.config.no_pole_number_and_comments_field_empty}iFactor.StormCenter.showFormErrorAlert(message)}}else{iFactor.StormCenter.showFormErrorAlert("Please enter a description of the problem or select another problem type.")}}else{if(n.email!=""&&n.verifyemail==""){iFactor.StormCenter.showFormErrorAlert("Please verify your email address by re-entering it again in the Verify Email field.")}else{if(n.email==""&&n.verifyemail!=""){iFactor.StormCenter.showFormErrorAlert("Please enter a valid email address in the Email field.")}else{if(!iFactor.StormCenter.validatePhone(n.phone)){var x=iFactor.StormCenter.validatePhoneMessage(n.phone);iFactor.StormCenter.showFormErrorAlert(x)}else{if(!iFactor.StormCenter.validateCommentsInput(n.comments)){iFactor.StormCenter.showFormErrorAlert("The comments field must not contain more than "+iFactor.StormCenter.maxCommentsSize()+" characters.")}else{if(!iFactor.StormCenter.validateEmailInput(n.email.toLowerCase())||!iFactor.StormCenter.validateEmailInput(n.verifyemail.toLowerCase())){iFactor.StormCenter.showFormErrorAlert("The email address you entered is not a valid format. Please enter a valid email address. ")}else{iFactor.StormCenter.showFormErrorAlert("The email addresses entered do not match. Please try again.")}}}}}}}};var C=290;var Q=440;var d=g.GetWidth();var J=O.IFLocalXYOnMap(g).x;var S=d/2;var B=S-(C/2);var I=S+(C/2);var h=40;var N;var G;if((J<(I+h))&&(J>(B-h))){if(J<S){G=J-(B-h)}else{G=J-(I+h)}B=B+G}var D;var H;var R;if(this.currentIncidentInfo){dialog=this.currentIncidentInfo.dialog}else{if(F){var c=document.getElementById("incidentReportDiv_c");var b=document.getElementById("ifc_content");if(c){b.removeChild(c)}dialog=new YAHOO.widget.Dialog("incidentReportDiv",{width:C+"px",height:Q+"px",modal:false,close:false,draggable:false,fixedcenter:false,visible:true,zIndex:10,constraintoviewport:false,hideaftersumbit:false,underlay:"none",buttons:[{text:"Submit",handler:W},{text:"Cancel",handler:K}]})}else{if(F==false){var c=document.getElementById("incidentReportDiv_c");var b=document.getElementById("ifc_content");if(c){b.removeChild(c)}}dialog=new YAHOO.widget.Dialog("incidentReportDiv",{width:C+"px",modal:false,close:false,draggable:true,visible:false,zIndex:700,constraintoviewport:true,hideaftersumbit:true,buttons:[{text:"Submit",handler:W,isDefault:true},{text:"Cancel",handler:K}]})}if(iFactor.common.config.incidentReportHeader!="undefined"&&iFactor.common.config.incidentReportHeader!=undefined){dialog.setHeader('<div id="reportHeader" syle="width:100%">'+iFactor.common.config.incidentReportHeader+"</div>")}else{dialog.setHeader(iFactor.common.config.incidentReporterDialogHeader)}dialog.setBody(iFactor.StormCenter.getIncidentReporterDialogBodyString("incidentReporterDialogBody"));dialog.render("ifc_content");if(f.required_fields!=undefined&&f.required_fields!="undefined"){iFactor.StormCenter.formHighlight(dialog,f.required_fields)}else{iFactor.StormCenter.formHighlight(dialog,"")}if(F){var c=document.getElementById("incidentReportDiv_c");if(c!=null){c.style.left="0px";c.style.top="50px"}this.overlayManager.register([dialog]);this.overlayManager.bringToTop(dialog)}else{document.getElementById("incidentReportDiv_c").style.left=B+"px";document.getElementById("incidentReportDiv_c").style.top="50px"}var V=dialog.form;if(F){iFactor.StormCenter.getCachedValueForDialog(this.dialogDefault)}if(F){var A=this.dialogDefault.getData();var V=dialog.form;for(aKeyName in A){if(A.hasOwnProperty(aKeyName)){V[aKeyName].value=A[aKeyName]}}}D=dialog.form;H=this.currentUserDetails;for(R in H){if(D[R]){D[R].value=this.prettify(H[R])}}var M=document.getElementById("reportHeader");if(M){this.setCellStyle(M.style,iFactor.common.config.themeInfo.formHeaderColor)}var U=document.getElementById("_slo_location_selection_indicator");var P=iFactor.common.config.IFactorStreetlightoutagesURL;if(U){U.innerHTML="<img src='"+P+"images/checkmark_green.gif'/>"}dialog.show();iFactor.StormCenter.formHighlight(dialog,f.required_fields)}D=dialog.form;if(E){for(R in E){if(D[R]){if(E[R]!=""){D[R].value=E[R]}}}}else{D.polenumber.value=""}iFactor.StormCenter.getCachedValueForDialog(dialog);D.comments.value="";this.currentIncidentInfo={tempShapeLayer:X,dialog:dialog};D.contactname.focus()};__stormcenter.prototype.isLayerVisible=function(C){var B=iFactor.common.config;var A=GetZoomLevel(this.map);if(C=="stateThematics"){return A>=B.min_state_zoom_level&&A<=B.max_state_zoom_level}else{if(C=="countyThematics"){return A>=B.min_county_zoom_level&&A<=B.max_county_zoom_level}else{if(C=="ctvThematics"){return A>=B.min_ctv_zoom_level&&A<=B.max_ctv_zoom_level}else{if(C=="sloutages"){return A>=iFactor.common.config.min_data_zoom_level}else{return false}}}}};__stormcenter.prototype.refreshMap=function(){var A;var B=iFactor.StormCenter;var C=iFactor.StormCenter.map;if(C.GetMapStyle()=="b"||C.GetMapStyle=="o"){document.getElementById("MSVE_navAction_ObliqueMapView").style.width="72px"}if(iFactor.common.config.setrefresh){if((this.pointLayers.polesearchpin)&&(this.pointLayers.polesearchpin!="")&&(iFactor.common.config.setrefresh!=0)){B.deletePoleSearchPin()}}if(this.isManagementPanel){this.showIncidentsforMgmt();if(C.GetMapStyle()=="b"||C.GetMapStyle=="o"){this.otherIncidentsforMgmt()}if(GetZoomLevel(C)>=iFactor.common.config.min_data_zoom_level){this.otherIncidentsforMgmt()}else{var D=["resolvedIncidents","in_progressIncidents"];B.HideLayer(D)}}else{iFactor.StormCenter.setVisibilityControlForZoom()}iFactor.common.config.setrefresh=1};__stormcenter.prototype.showIncidents=function(){var E="";var B;var A=iFactor.common.config;var D=["reported_rejected","reported","in_progress"];if(A.incident_status_types){D=A.incident_status_types.split(",")}for(var C=0;C<D.length;C=C+1){E=D[C];B={extraArguments:["streetlight",E],iconURL:iFactor.common.config.streetlight_reported_outage_ICON_URL,layerName:E+"Incidents",webMethod:proxies.IFIncidentService.GetIncidentsIDAndLocationAsJSONList,zIndex:100};this.helperShowFeatures(B)}};__stormcenter.prototype.showAssets=function(){var A={extraArguments:["streetlight"],iconURL:iFactor.common.config.streetlight_ICON_URL,layerName:"streetlightAssets",webMethod:proxies.IFAssetService.GetAssetsIDAndLocationAsJSONList,zIndex:5};this.helperShowFeatures(A)};__stormcenter.prototype.helperShowFeatures=function(A){iFactor.StormCenter.startLoad();var K=this;var U=iFactor.StormCenter.map;var G=null;if(U.GetMapStyle()=="b"||U.GetMapStyle=="o"){var D=U.GetBirdseyeScene();var G=D.GetOrientation()}var B=getmodifiedMapView(U,G);var O=B.TopLeftLatLong;var H=B.BottomRightLatLong;var F=this.GetIFactorWebServicesUserToken();var L=O.Longitude;var S=O.Latitude;var C=H.Longitude;var T=H.Latitude;var Q=80;var M=100;var N=100;var I=this.map.mapelement.offsetTop+(this.map.mapelement.clientHeight/2)-(M/2)+"px";var J=this.map.mapelement.offsetLeft+(this.map.mapelement.clientWidth/2)-(N/2)+"px";var R=document.getElementById("loader");if(R!=null){R.style.left=J;R.style.top=I}var E=function(W){iFactor.StormCenter.stopLoad();K.helperUpdateFeatureShapeLayer(W,A)};var V=A.extraArguments;var P={prepare:function(W){return W},call:function(X){var W=A.webMethod;W.func=this.call.func;W.onException=this.call.onException;W(F,L,S,C,T,Q,V[0],V[1],V[2],V[3])},finish:E,onException:iFactor.StormCenter.handleSOAPException};ajax.Start(P)};__stormcenter.prototype.helperUpdateFeatureShapeLayer=function(C,L){iFactor.StormCenter.startLoad();var A,Q;var E=this.pointLayers[L.layerName];var B=this.map;if(E){B.DeleteShapeLayer(E)}var J=new VEShapeLayer();J.Hide();B.AddShapeLayer(J);J.SetTitle(L.layerName);J.Show();if(C!=null&&C.length>0){var D=C.length;for(var H=0;H<D;H=H+1){A=C[H];Q=YAHOO.lang.JSON.parse(A);if(this.isManagementPanel){iFactor.common.config.setClusters=false}J.IFAddJSON(Q,L.iconURL,L.zIndex,L.layerName)}if((L.layerName=="streetlightAssets")&&(iFactor.common.assetIDsToHighlight.length>0)){iFactor.StormCenter.deletePoleSearchPin();var P=J.GetShapeCount();var K=[];for(var M=0;M<P;M=M+1){var I=J.GetShapeByIndex(M);var O=parseInt(I.GetTitle());for(var G=0;G<iFactor.common.assetIDsToHighlight.length;G=G+1){var F=iFactor.common.assetIDsToHighlight[G];if(F==O){K.push(I.GetPoints()[0]);break}}}if(K.length>0){iFactor.StormCenter.highlightPoleSearchResults(K)}iFactor.common.assetIDsToHighlight=[]}}if(this.isManagementPanel){if(L.layerName=="resolvedIncidents"){var N=new VEClusteringOptions();N.Callback=iFactor.StormCenter.clusterCallback;J.SetClusteringConfiguration(VEClusteringType.Grid,N)}else{if(L.layerName=="in_progressIncidents"){var N=new VEClusteringOptions();N.Callback=iFactor.StormCenter.clusterCallback_inprogress;J.SetClusteringConfiguration(VEClusteringType.Grid,N)}}}this.pointLayers[L.layerName]=J;iFactor.StormCenter.stopLoad()};__stormcenter.prototype.gotoLatLng=function(H,D,F,G,C){var B=new VELatLong(H,D);var E=this.map;var A=iFactor.common.config;E.SetCenterAndZoom(B,A.min_data_zoom_level)};__stormcenter.prototype.gotoLokiLocation=function(){var A=this;var B=new Boolean();if(navigator.geolocation){B=true;navigator.geolocation.getCurrentPosition(function(C){var E=C.coords.latitude;var D=C.coords.longitude;if(A.insideServiceBounds(E,D)){A.gotoLatLng(E,D)}else{iFactor.StormCenter.showAlertBox("Processing failed. The geolocation is outside the service area.")}},function(){handleNoGeolocation(B)})}else{B=false;handleNoGeolocation(B)}};function handleNoGeolocation(A){if(A==true){alert("Geolocation service failed.")}else{alert("Your browser doesn't support geolocation.")}}__stormcenter.prototype.TokenChanged=function(){var D=this;var E=function(F){var G=YAHOO.lang.JSON.parse(F);if(G.username!=null&&G.username!=""){D.controlStatus(G.username)}D.showLoginInfo(G);D.currentUserDetails=G;D.getDisplayXSLInfo()};var C=this.GetIFactorWebServicesUserToken();var A=proxies.IFCommonService.GetUserDetailsAsJSON;A.func=null;A.onException=iFactor.StormCenter.handleSOAPException;var B=A(C);E(B)};__stormcenter.prototype.prettify=function(A){var B=A.replace(/^\s+|\s+$/g,"");B=B.toLocaleLowerCase();if(B.length>0){var C=B.charAt(0).toLocaleUpperCase();B=C+B.slice(1)}return B};__stormcenter.prototype.showLoginInfo=function(B){var F=document.getElementById("slLogininfo");var E=this.prettify(B.firstname);var D=this.prettify(B.lastname);var H=this.prettify(B.username);var C="";if(E.length>0){C=E}else{C=H}var G="Hello";var A="Logout";if(!readCookie("logintoken")&&H.indexOf("guest")>-1){F.innerHTML='<a href="#" id="nguest" class="closesignin"  style="color:white;text-decoration:none;font-size:8pt;font-family:verdana,arial,sans-serif; font-weight:bold; z-index:120; padding-top:0px; padding-bottom:1px; padding-left:0px; padding-right:12px; opacity:1.0; border-width:1px; border-style:solid; border-color:transparent;" onClick="lbox();" onmouseover="this.style.borderStyle=\'solid\'; this.style.borderColor=\'#8dc2ee\';"  onmouseout="this.style.borderColor=\'transparent\';">Login</a>'}else{F.innerHTML='<a style="color:white;text-decoration:none;font-size:8pt;font-family:verdana,arial,sans-serif; font-weight:bold; z-index:120; padding-top:0px; padding-bottom:1px; padding-left:0px; padding-right:5px; opacity:1.0; border-width:1px; border-style:solid; border-color:transparent;"  onmouseover="this.style.borderStyle=\'solid\'; this.style.borderColor=\'#8dc2ee\';"  onmouseout="this.style.borderColor=\'transparent\';" href="javascript:iFactor.StormCenter.getGuestToken()">Logout</a>'}};function lbox(){iFactor.StormCenter.rpxlogin()}__stormcenter.prototype.getDisplayXSLInfo=function(){var C=this.GetIFactorWebServicesUserToken();var D="streetlight";var E=function(F){iFactor.StormCenter.IFactorIncidentXSL=F};var A=proxies.IFIncidentService.GetDisplayXSL;A.func=null;A.onException=iFactor.StormCenter.handleSOAPException;var B=A(C,D);E(B);E=function(F){iFactor.StormCenter.IFactorAssetXSL=F};A=proxies.IFAssetService.GetDisplayXSL;A.func=null;A.onException=iFactor.StormCenter.handleSOAPException;B=A(C,D);E(B)};__stormcenter.prototype.existIndexInIndicesForLayerSource=function(C,A,B){var F=this.currentIndicesForPointLayers[C];if(!F){this.currentIndicesForPointLayers[C]={}}var E=this.currentIndicesForPointLayers[C][A];if(!E){E=[];this.currentIndicesForPointLayers[C][A]=E}var D;for(D=0;D<E.length;D=D+1){if(E[D]==B){return true}}return false};__stormcenter.prototype.getStartLatLngZoom=function(){var A=[];A[0]=parseFloat(iFactor.common.config.start_lat);A[1]=parseFloat(iFactor.common.config.start_long);A[2]=parseInt(iFactor.common.config.start_zoom,10);return A};__stormcenter.prototype.onMapStyle=function(){if(this.map.GetMapStyle()=="b"||this.map.GetMapStyle()=="o"){this.cstyle=false;this.panned=false}};__stormcenter.prototype.onMapPan=function(){var D=iFactor.StormCenter;var C=[];var B=document.getElementById("countyTitle");if(B){D.deletePanel(B)}var A=0;if((this.map.GetMapStyle()=="b"||this.map.GetMapStyle()=="o")&&this.cstyle){A=1;this.panned=true}this.cstyle=true;if(!D.isLayerVisible("sloutages")){if(typeof (this.singleClick)!="undefined"){this.singleClick=this.singleClick+1}}if(this.inAllowableBounds()){this.storeBounds();this.controlLayerVisibility();this.refreshMap()}else{if(this.outsideBoundsMessage!=null){this.outsideBoundsMessage=null}if(this.map.GetMapStyle()=="b"||this.map.GetMapStyle()=="o"){}else{if(this.lastZoom[0]==null||this.lastZoom[1]==null){alert("incorrect config with allowable bounds!!!")}else{this.map.SetCenterAndZoom(this.lastZoom[0],this.lastZoom[1])}}}this.saveMapState();this.outsideBoundsMessage=null};__stormcenter.prototype.notifyOnRepairComplete=function(B){var A=this.GetIFactorWebServicesUserToken()};__stormcenter.prototype.showAlertBox=function(B){this.dialog=new YAHOO.widget.SimpleDialog("responsePanel",{width:"360px",fixedcenter:true,modal:false,close:true,draggable:false,visible:false,zIndex:1000,constraintoviewport:false,hideaftersumbit:false,buttons:[{text:"OK",handler:function(){this.hide()},isDefault:true}],icon:YAHOO.widget.SimpleDialog.ICON_INFO});var A=null;if(/MSIE (\d+\.\d+);/.test(navigator.userAgent)){A=new Number(RegExp.$1)}if(A<=6){this.dialog.beforeHideEvent.subscribe(function(){iFactor.StormCenter.ie6FixDeletePanel()})}this.dialog.setHeader('<div class="ifc_dialogFont"> Confirmation </div>');this.dialog.setBody('<div class="ifc_dialogFont" align="left"><table><tr><td>'+B+"</td></tr></table></div>");this.dialog.render(document.body);this.dialog.show()};__stormcenter.prototype.showFormErrorAlert=function(B){this.dialog=new YAHOO.widget.SimpleDialog("errorPanel",{width:"360px",fixedcenter:true,modal:false,close:true,draggable:false,visible:false,zIndex:1000,constraintoviewport:false,hideaftersumbit:false,buttons:[{text:"OK",handler:function(){this.hide()},isDefault:true}],icon:YAHOO.widget.SimpleDialog.ICON_INFO});var A=null;if(/MSIE (\d+\.\d+);/.test(navigator.userAgent)){A=new Number(RegExp.$1)}if(A<=6){this.dialog.beforeHideEvent.subscribe(function(){iFactor.StormCenter.ie6FixDeletePanel()})}this.dialog.setHeader('<div class="ifc_dialogFont"> Error </div>');this.dialog.setBody('<div class="ifc_dialogFont" align="left"><table><tr><td>'+B+"</td></tr></table></div>");this.dialog.render(document.body);this.dialog.show()};__stormcenter.prototype.showReportPanel=function(){if(document.getElementById("reportPanel_c")==null||document.getElementById("reportPanel_c").style.visibility=="hidden"){var E=420;var B=389;document.getElementById("reportPanel").style.display="block";var C=document.getElementById("reportPanel_c");if(C){iFactor.StormCenter.deletePanel(C)}this.reportPanel=new YAHOO.widget.Panel("reportPanel",{width:"420px",visible:false,context:["poweredby","tr","tl"],close:true,zIndex:500});this.reportPanel.setHeader(iFactor.common.config.helpHeader);if(iFactor.common.config.helpText!=undefined){this.reportPanel.setBody(iFactor.common.config.helpText)}else{this.reportPanel.setBody(iFactor.common.config.helpBody)}this.reportPanel.render("ifc_content");this.reportPanel.show();var D=document.getElementById("reportPanel_h");D.style.color="white";if("#EEC941"==iFactor.common.config.themeInfo.compassColor){D.style.backgroundColor="#333333"}else{D.style.backgroundColor=iFactor.common.config.themeInfo.compassColor}var F=document.getElementById("help_button");var A="url("+iFactor.common.config.IFactorStreetlightoutagesURL+"images/tipsy-north.gif)";F.style.background=A;F.style.backgroundRepeat="no-repeat";F.style.backgroundPosition="center right";F.style.fontWeight="600";liArray=document.getElementById("reportPanel").childNodes;i=0;if(liArray.length==6){liArray[5].id="containerclose"}else{liArray[2].id="containerclose"}}else{document.getElementById("reportPanel_c").style.visibility="hidden";var F=document.getElementById("help_button");var A="url("+iFactor.common.config.IFactorStreetlightoutagesURL+"images/tipsy-south.gif)";F.style.background=A;F.style.backgroundRepeat="no-repeat";F.style.backgroundPosition="center right";F.style.fontWeight="600";F.style.paddingBottom="2px"}};__stormcenter.prototype.deletePanel=function(B){var A=document.getElementById("ifc_content");if(B!=null){A.removeChild(B)}};__stormcenter.prototype.setPosition=function(C,D,B){var A=(document.getElementById("ifc_content").clientWidth/2)-(D/2)+"px";var E=(document.getElementById("ifc_content").clientHeight/2)-(B/2)+"px";if(C!=null){C.style.left=A;C.style.top=E}};__stormcenter.prototype.overlaySLO=function(){var A=new YAHOO.widget.Overlay("ifc_streetlightmapBody",{visible:true,context:["ifc_streetlightmap","tl","bl",["beforeShow","windowResize"]],visible:false});A.render();A.show()};__stormcenter.prototype.setCachedValueFromDialog=function(C){var A=C.getData();var B=C.form;for(propertyName in A){iFactor.StormCenter.setCachedValue(propertyName,B[propertyName].value);if(propertyName=="polenumber"){iFactor.StormCenter.setCachedValue(propertyName,"")}}};__stormcenter.prototype.setCachedValue=function(A,B){if(iFactor.StormCenter.isCookiesEnabled()){YAHOO.util.Cookie.set(A,B)}else{if(iFactor.StormCenter.dialogValueCache==null){iFactor.StormCenter.dialogValueCache=new Object()}iFactor.StormCenter.dialogValueCache[A]=B}};__stormcenter.prototype.getCachedValueForDialog=function(B){var A=B.getData();var D=iFactor.StormCenter.isCookiesEnabled();if(!D){if(iFactor.StormCenter.dialogValueCache==null){iFactor.StormCenter.dialogValueCache=new Object()}}var C;for(aKeyName in A){if(D){C=YAHOO.util.Cookie.get(aKeyName)}else{C=iFactor.StormCenter.dialogValueCache[aKeyName]}if(C){B.form[aKeyName].value=C}}};__stormcenter.prototype.formValidation=function(G,H){var C=G.getData();var A=H.split(",");var B=iFactor.common.config;for(var I in A){if(A.hasOwnProperty(I)){var D=A[I];if(B.special_required_fields){if(B.special_required_fields[D]&&(C[D]==B.special_required_fields[D])){C[D]=""}}if(C[D]==""){if(B.displayname_required_fields){var F=B.displayname_required_fields[A[I]];var E=A[I];if(B.fieldname_required_fields){E=B.fieldname_required_fields[A[I]]}if(E=="problemtype"){if(B.problemTypeErrorMessage!=undefined){iFactor.StormCenter.showFormErrorAlert(B.problemTypeErrorMessage)}}else{iFactor.StormCenter.showFormErrorAlert("Please enter your "+E+' in the "'+F+'" field.')}}else{iFactor.StormCenter.showFormErrorAlert('Please enter a value for "'+A[I]+'" .')}return false}}}return true};__stormcenter.prototype.setVisibilityControlForZoom=function(){var C=iFactor.StormCenter.map;var A=iFactor.common.config;var D=[];var B=iFactor.StormCenter;if(C.GetMapStyle()=="b"||C.GetMapStyle()=="o"){D=["ctvThematics"];B.HideLayer(D);this.showAssets();this.showIncidents()}else{if(B.isLayerVisible("stateThematics")){D=["countyThematics","ctvThematics"];B.HideLayer(D);if(iFactor.StormCenter.getConfigValueWithDefault("enableStateThematics",true)){B.showStateThematics()}}else{if(B.isLayerVisible("countyThematics")){D=["stateThematics","ctvThematics"];B.HideLayer(D);if(iFactor.StormCenter.getConfigValueWithDefault("enableCountyThematics",true)){B.showCountyThematics()}}else{if(B.isLayerVisible("ctvThematics")){D=["stateThematics","countyThematics","reportedIncidents","confirmedIncidents","streetlightAssets","in_progressIncidents"];B.HideLayer(D);if(iFactor.StormCenter.getConfigValueWithDefault("enableCTVThematics",true)){B.showCTVThematics()}}else{if(B.isLayerVisible("sloutages")||C.GetMapStyle()=="b"||C.GetMapStyle()=="o"){D=["ctvThematics","countyThematics"];B.HideLayer(D);this.showAssets();this.showIncidents()}else{D=["ctvThematics","reportedIncidents","confirmedIncidents","streetlightAssets","in_progressIncidents"];B.HideLayer(D)}}}}}return };__stormcenter.prototype.HideLayer=function(C){var B;for(var A=0;A<C.length;A=A+1){B=this.pointLayers[C[A]];if(B){B.Hide()}}};__stormcenter.prototype.showStateThematics=function(){var A={extraArguments:["streetlight"],layerName:"stateThematics",webMethod:proxies.IFAssetService.GetStateAreaAsJSONList,zIndex:10};this.helperShowFeaturesThematics(A)};__stormcenter.prototype.showCountyThematics=function(){var A={extraArguments:["streetlight"],layerName:"countyThematics",webMethod:proxies.IFAssetService.GetCountyAreaAsJSONList,zIndex:50};this.helperShowFeaturesThematics(A)};__stormcenter.prototype.showCTVThematics=function(){var A={extraArguments:["streetlight"],layerName:"ctvThematics",webMethod:proxies.IFAssetService.GetCTVAreaAsJSONList,zIndex:50};this.helperShowFeaturesThematics(A)};__stormcenter.prototype.showServiceArea=function(){var A={extraArguments:["streetlight"],layerName:"servicearea",webMethod:proxies.IFAssetService.GetServiceAreaAsJSONList,zIndex:2};this.helperShowFeaturesServicearea(A)};__stormcenter.prototype.helperShowFeaturesServicearea=function(A){var D=this;var E=this.map;var B=this.GetIFactorWebServicesUserToken();var F=function(G){D.helperUpdateFeatureShapeLayerThematics(G,A)};var C={prepare:function(G){return G},call:function(H){var G=A.webMethod;G.func=this.call.func;G.onException=this.call.onException;G(B)},finish:F,onException:iFactor.StormCenter.handleSOAPException};ajax.Start(C)};__stormcenter.prototype.helperShowFeaturesThematics=function(J){var H=this;var A=this.map;var B=A.GetMapView();var N=B.TopLeftLatLong;var G=B.BottomRightLatLong;var O=this.GetIFactorWebServicesUserToken();var C=N.Longitude;var K=N.Latitude;var F=G.Longitude;var E=G.Latitude;var L=50;iFactor.StormCenter.startLoad();var I=function(P){iFactor.StormCenter.stopLoad();H.helperUpdateFeatureShapeLayerThematics(P,J)};var M=J.extraArguments;var D={prepare:function(P){return P},call:function(Q){var P=J.webMethod;P.func=this.call.func;P.onException=this.call.onException;P(O,C,K,F,E,M[0],M[1],M[2],M[3])},finish:I,onException:iFactor.StormCenter.handleSOAPException};ajax.Start(D)};__stormcenter.prototype.helperUpdateFeatureShapeLayerThematics=function(E,K){var F=iFactor.common.config;var A,N;var G=this.pointLayers[K.layerName];var B=this.map;if(G){B.DeleteShapeLayer(G)}var J;var D=false;var J=new VEShapeLayer();J.Hide();B.AddShapeLayer(J);J.SetTitle(K.layerName);J.Show();var M=[];try{M=YAHOO.lang.JSON.parse(E)}catch(L){alert("JSON Parse failed!");return }for(var H=0,I=M.length;H<I;++H){var N=M[H];var C=N.id;J.IFAddJSONArea(N,K)}this.pointLayers[K.layerName]=J};__stormcenter.prototype.checkClick=function(H){var F=iFactor.StormCenter;var B=iFactor.common.config;if(this.singleClick==1){if(H.elementID){var G=iFactor.StormCenter.map;var A=G.GetShapeByID(H.elementID);var C=A.GetShapeLayer();var E=C&&C.GetTitle();var D=A.GetTitle();if(E==="stateThematics"){if(D){F.gotoCentroid(D,B.min_county_zoom_level)}}else{if(E==="countyThematics"){if(D){F.gotoCentroid(D,B.min_ctv_zoom_level)}}else{if(E==="ctvThematics"){if(D){F.gotoCentroid(D,B.min_data_zoom_level)}}}}}}this.singleClick=1;return };__stormcenter.prototype.gotoCentroid=function(A,F){var E;var D=this.map;try{var B=YAHOO.lang.JSON.parse(A);if(B.centroid){E=iFactor.StormCenter.centroidToLatLng(B.centroid);if(E&&E.length==2){D.SetCenterAndZoom(new VELatLong(parseFloat(E[1]),parseFloat(E[0])),F)}}}catch(C){alert("Invalid centroid data")}return };__stormcenter.prototype.onEndZoom=function(C){var A=iFactor.StormCenter;var B=iFactor.StormCenter.map;if(!A.isLayerVisible("sloutages")){this.singleClick=this.singleClick-1}return true};__stormcenter.prototype.onMouseOverThematicShape=function(C){if(C.elementID){var B=iFactor.StormCenter.map;var A=B.GetShapeByID(C.elementID);A.SetFillColor(iFactor.common.configStyles.thematic_area_color);A.SetLineColor(iFactor.common.configStyles.thematic_border_color);A.SetLineWidth(iFactor.common.configStyles.thematic_border_width)}};__stormcenter.prototype.setShapeThematicDescription=function(B){var E;var G=iFactor.StormCenter;var C=iFactor.StormCenter.map;try{var H=YAHOO.lang.JSON.parse(B);if(H.centroid){E=G.centroidToLatLng(H.centroid);if(E&&E.length==2){var D=C.LatLongToPixel(new VELatLong(parseFloat(E[1]),parseFloat(E[0])),GetZoomLevel(C));this.countyTitle=new YAHOO.widget.Overlay("countyTitle",{visible:true});this.countyTitle.setBody("<span style='color:#FFFFFF;font-size:12px;font-weight:bold;text-align:center;'>"+H.areaname+"</span>");this.countyTitle.render("ifc_content");this.countyTitle.show();var I=C.mapelement.offsetTop+D.y-5+"px";var J=C.mapelement.offsetLeft+D.x-15+"px";var A=document.getElementById("countyTitle");if(A!=null){A.style.left=J;A.style.top=I}}}}catch(F){alert("Invalid centroid data")}return true};__stormcenter.prototype.onMouseOutThematicShape=function(E){if(E.elementID){var D=iFactor.StormCenter.map;var A=D.GetShapeByID(E.elementID);var B=A.GetShapeLayer();var C=B&&B.GetTitle();if(C=="stateThematics"||C=="countyThematics"||C=="ctvThematics"){A.SetFillColor(iFactor.common.configStyles.thematic_na_area_color);A.SetLineColor(iFactor.common.configStyles.thematic_na_area_color)}else{return }}};__stormcenter.prototype.centroidToLatLng=function(B){var A=null;if(B){if(B.indexOf("POINT")!=-1){B=B.replace("POINT ","");B=B.replace("(","");B=B.replace(")","");A=B.split(" ")}}return A};__stormcenter.prototype.showIncidentPanel=function(){var B=227;var D=281;if(this.incidentPanel==null){this.incidentPanel=new YAHOO.widget.Overlay("incidentPanel",{width:D+"px",height:B+"px",visible:true,zIndex:700,context:["MSVE_navAction_topBackground","tr","br"]});var C=escape(iFactor.StormCenter.GetIFactorWebServicesUserToken()).replace(/\+/g,"%2B");var A=iFactor.common.config.IFactorStreetlightoutagesURL;this.incidentPanel.setBody('<iframe src="'+A+"listIncidents.aspx?userToken="+C+'"scrolling="no" width="100%" height="100%" frameborder="0" />');this.incidentPanel.render("ifc_content");this.incidentPanel.show();var E=document.getElementById("statusL");var A="url("+iFactor.common.config.IFactorStreetlightoutagesURL+"images/tipsy-north.gif)";E.style.background=A;E.style.backgroundRepeat="no-repeat";E.style.backgroundPosition="center right";E.style.fontWeight="600";E.style.backgroundAttachment="scroll";E.style.backgroundColor="transparent"}else{this.incidentPanel.hide();this.incidentPanel=null;var E=document.getElementById("statusL");var A="url("+iFactor.common.config.IFactorStreetlightoutagesURL+"images/tipsy-south.gif)";E.style.background=A;E.style.backgroundRepeat="no-repeat";E.style.backgroundPosition="center right";E.style.fontWeight="600";E.style.paddingbottom="1px"}};__stormcenter.prototype.addMapHeader=function(){var A=new YAHOO.widget.Overlay("mpheader");A.cfg.setProperty("context",["map","tr","tr"]);document.getElementById("MSVE_navAction_toggleGlyphInner").style.visibility="hidden";var C=document.getElementById("MSVE_navAction_container");var B=document.getElementById("MSVE_navAction_toggleGlyphWrapper");C.removeChild(B)};__stormcenter.prototype.controlStatus=function(C){if(document.getElementById("statusLn")){if(C.indexOf("guest")>-1){document.getElementById("statusLn").innerHTML='<a id="statusL" style="color:white;text-decoration:none;font-size:8pt;font-family:verdana,arial,sans-serif; z-index:120; padding-top:0px; padding-bottom:2px; padding-left:0px; padding-right:12px; opacity:1.0; border-width:1px; border-style:solid; border-color:transparent;" onmouseover="this.style.borderStyle=\'solid\'; this.style.borderWidth=\'1px\'; this.style.borderColor=\'#8dc2ee\';"  onmouseout="this.style.borderColor=\'transparent\';" href="javascript:iFactor.StormCenter.rpxlogin();">My Reports</a>';var B=document.getElementById("statusL");var A="url("+iFactor.common.config.IFactorStreetlightoutagesURL+"images/tipsy-south.gif)";B.style.background=A;B.style.backgroundRepeat="no-repeat";B.style.backgroundPosition="center right";B.style.fontWeight="600"}else{document.getElementById("statusLn").innerHTML='<a id="statusL" style="color:white;text-decoration:none;font-size:8pt;font-family:verdana,arial,sans-serif; z-index:120; padding-top:0px; padding-bottom:2px; padding-left:0px; padding-right:12px; opacity:1.0; border-width:1px; border-style:solid; border-color:transparent;" onmouseover="this.style.borderStyle=\'solid\'; this.style.borderWidth=\'1px\'; this.style.borderColor=\'#8dc2ee\';"  onmouseout="this.style.borderColor=\'transparent\';" href="javascript:iFactor.StormCenter.showIncidentPanel();">My Reports</a>';var B=document.getElementById("statusL");var A="url("+iFactor.common.config.IFactorStreetlightoutagesURL+"images/tipsy-south.gif)";B.style.background=A;B.style.backgroundRepeat="no-repeat";B.style.backgroundPosition="center right";B.style.fontWeight="600"}}};__stormcenter.prototype.navcontrol=function(){document.getElementById("MSVE_navAction_topBackground").style.visibility="hidden";document.getElementById("MSVE_navAction_leftBar").style.visibility="hidden";document.getElementById("MSVE_navAction_leftBackground").style.visibility="hidden";document.getElementById("Compass").style.visibility="hidden";document.getElementById("MSVE_navAction_compassBackground").style.visibility="hidden";document.getElementById("MSVE_navAction_styleGroup").style.visibility="hidden";document.getElementById("help_ask_reports").style.visibility="hidden";document.getElementById("mapheader_hidden").style.visibility="visible";document.getElementById("mapheader_hidden").style.backgroundColor=iFactor.common.config.themeInfo.compassColor;var A=new YAHOO.widget.Overlay("mapheader_hidden");A.cfg.setProperty("context",["map","tl","tl"])};__stormcenter.prototype.navcontrolview=function(){document.getElementById("MSVE_navAction_topBackground").style.visibility="visible";document.getElementById("MSVE_navAction_leftBar").style.visibility="visible";document.getElementById("MSVE_navAction_leftBackground").style.visibility="visible";document.getElementById("Compass").style.visibility="visible";document.getElementById("MSVE_navAction_compassBackground").style.visibility="visible";document.getElementById("MSVE_navAction_styleGroup").style.visibility="visible";document.getElementById("help_ask_reports").style.visibility="visible";document.getElementById("mapheader_hidden").style.visibility="hidden"};__stormcenter.prototype.LogInMessage=function(){iFactor.StormCenter.showAlertBox("Please Login First")};__stormcenter.prototype.showResolvedIncidents=function(){var D="";var A;var C=["resolved"];for(var B=0;B<C.length;B=B+1){D=C[B];A={extraArguments:["streetlight",D],iconURL:iFactor.common.config["streetlight_"+D+"_outage_ICON_URL"],layerName:D+"Incidents",webMethod:proxies.IFIncidentService.GetIncidentsIDAndLocationAsJSONList,zIndex:200};this.helperShowFeatures(A)}};__stormcenter.prototype.showInProgressIncidents=function(){var D="";var A;var C=["in_progress"];for(var B=0;B<C.length;B=B+1){D=C[B];A={extraArguments:["streetlight",D],iconURL:iFactor.common.config["streetlight_"+D+"_outage_ICON_URL"],layerName:D+"Incidents",webMethod:proxies.IFIncidentService.GetIncidentsIDAndLocationAsJSONList,zIndex:200};this.helperShowFeatures(A)}};__stormcenter.prototype.clusterCallback=function(E){try{if(E!=null){for(var C=0;C<E.length;C++){var A=E[C];var H=E[C].GetClusterShape();H.SetCustomIcon("<img src='images/cluster.gif'/>");var F='<div class="infoboxtitle"><table><tr><td><b> Cluster </b></td></tr></table></div>';for(var D=0;D<A.Shapes.length;D++){var B=A.Shapes[D];if(B.GetID()!=undefined&&B.Title!=undefined){F+="<br/>"+iFactor.StormCenter.setShapeDescription(B.Title)}F+='<a href="javascript:iFactor.StormCenter.changeStatusBySLOID('+B.Title+",'"+B.GetID()+"','resolved');\">Mark this Complete</a>"}H.SetDescription(F)}}}catch(G){}};__stormcenter.prototype.addressSearch=function(){var D=iFactor.common.config;var I=window.document.getElementById("address_value").value;var B=I;if(I!=""&&I!=D.addressBoxText){I=trimAll(I);var F=this;var A=this.map;var J=this.GetIFactorWebServicesUserToken();iFactor.StormCenter.startLoader();if(D.polesearch_checkbox_exist&&(D.polesearch_checkbox_exist=="true")){iFactor.StormCenter.deletePoleSearchPin();if(D.poleSearch!="true"){D.poleSearch="false";iFactor.StormCenter.bingMapAddressSearch(B);return }else{D.vemapaddressSearch="false"}}else{D.poleSearch="true";D.vemapaddressSearch="true"}if(D.poleSearch=="true"){var G=function(T){var V;var L;var O;if(!T){if(D.vemapaddressSearch=="true"){iFactor.StormCenter.bingMapAddressSearch(B)}else{iFactor.StormCenter.showInvalidPoleMessage()}}else{var S=[];var U=[];var N=[];iFactor.StormCenter.deletePoleSearchPin();iFactor.common.assetIDsToHighlight=[];var P=T.getElementsByTagName("IFPointSimpleStructure");for(i=0;i<P.length;i=i+1){var M=P[i];var R=M.getElementsByTagName("latitude")[0];V=parseFloat(iFactor.common.getXMLNodeValue(R));S.push(V);var K=M.getElementsByTagName("longitude")[0];L=parseFloat(iFactor.common.getXMLNodeValue(K));U.push(L);var Q=M.getElementsByTagName("id")[0];O=parseInt(iFactor.common.getXMLNodeValue(Q));N.push(O)}if(V!=0&&L!=0){if((D.polesearch_checkbox_exist&&D.polesearch_checkbox_exist=="true")||(D.polesearch_highlight&&D.polesearch_highlight=="true")){iFactor.common.assetIDsToHighlight=N}iFactor.StormCenter.gotoLatLng(V,L)}iFactor.StormCenter.stopLoader()}};var C=function(K){if(iFactor.common.config.polesearch_checkbox_exist){iFactor.StormCenter.showInvalidPoleMessage()}else{iFactor.stormCenter.bingMapAddressSearch(B)}};var H=proxies.IFAssetService.GetAssetDetailsAsList;var E={prepare:function(K){return K},call:function(K){H.func=this.call.func;H.onException=this.call.onException;H(I,J)},finish:G,onException:C};ajax.Start(E)}}else{iFactor.StormCenter.showAlertBox("Please enter a value in address text box.")}};__stormcenter.prototype.setShapeDescription=function(G){var F="";var B="";var C="";var E=proxies.IFIncidentService.GetIncidentDetails;E.func=null;xmlDocument=E(iFactor.StormCenter.GetIFactorWebServicesUserToken(),G);var D=xmlDocument.getElementsByTagName("JSONData")[0];var A=iFactor.common.getXMLNodeValue(D);if(D&&A){var H=YAHOO.lang.JSON.parse(A);B=H.sloStreetLightAddress;C=H.polenumber}F+="<br/>Reported Item# "+G;if(C!=""&&C!=undefined&&C!="undefined"){F+=" Pole# "+C}F+="<br/>";if(B!=undefined&&B!="undefined"){if(B.indexOf("Address Not Found")==-1){F+=B+" "}}return F};function createCookie(C,D,E){if(E){var B=new Date();B.setTime(B.getTime()+(E*24*60*60*1000));var A="; expires="+B.toGMTString()}else{var A=""}document.cookie=C+"="+D+A+"; path=/"}function readCookie(B){var D=B+"=";var A=document.cookie.split(";");for(var C=0;C<A.length;C++){var E=A[C];while(E.charAt(0)==" "){E=E.substring(1,E.length)}if(E.indexOf(D)==0){return E.substring(D.length,E.length)}}return null}function eraseCookie(A){createCookie(A,"",-1)}__stormcenter.prototype.PleaseLogInFirst=function(){iFactor.StormCenter.rpxlogin();if(!document.getElementById("PloginDialog_c")||document.getElementById("PloginDialog_c").style.visibility=="hidden"){var H=iFactor.common.config.IFactorStreetlightoutagesURL;var E=this;var I=function(){this.cancel();if(!E.IFactorWebServicesUserToken){iFactor.StormCenter.showAlertBox("You must log in with a valid E-mail to continue.");E.GetIFactorWebServicesUserToken()}};var C=function(M){this.submit()};var A=function(){iFactor.StormCenter.ForgotPassword()};var J=function(){iFactor.StormCenter.CreateNewUser()};var G=function(N){var O=N.responseXML;var M=O.getElementsByTagName("string")[0];iFactor.StormCenter.IFactorWebServicesUserToken=iFactor.common.getXMLNodeValue(M);E.TokenChanged();E.refreshMap()};var B=function(O){iFactor.StormCenter.showAlertBox("Please Check your Username and Password");E.GetIFactorWebServicesUserToken();var N=document.getElementById("nguest");var M="url("+iFactor.common.config.IFactorStreetlightoutagesURL+"images/tipsy-south.gif)";N.style.background=M;N.style.backgroundRepeat="no-repeat";N.style.backgroundPosition="100% 50%"};var F=new YAHOO.widget.Dialog("PloginDialog",{width:"420px",x:625,y:36,context:["MSVE_navAction_topBackground","tr","br"],draggable:false,visible:false,zIndex:250,close:false,constraintoviewport:true,hideaftersumbit:false,underlay:"none"});F.callback.success=G;F.callback.failure=B;var K=iFactor.common.config.IFactorStreetlightoutagesURL;var L=K.split("/");var H="http://streetlightoutages.rpxnow.com/openid/embed?token_url=http%3A%2F%2F"+L[2]+"%2F"+L[3]+"%2Frpx.aspx";F.setHeader('<div class="ifc_dialogFont">Please Login First:</div>');F.setBody(' <iframe src="'+H+'"  scrolling="no"  frameBorder="no"  allowtransparency="true"  style="width:400px;height:240px"></iframe> ');F.render(document.body);F.show();var D=document.getElementById("statusL");var H="url("+iFactor.common.config.IFactorStreetlightoutagesURL+"images/tipsy-north.gif)";D.style.background=H;D.style.backgroundRepeat="no-repeat";D.style.backgroundPosition="center right";D.style.fontWeight="600";D.style.paddingbottom="1px";createCookie("clienturl",parent.location.href,7)}else{document.getElementById("PloginDialog_c").style.visibility="hidden";var D=document.getElementById("statusL");var H="url("+iFactor.common.config.IFactorStreetlightoutagesURL+"images/tipsy-south.gif)";D.style.background=H;D.style.backgroundRepeat="no-repeat";D.style.backgroundPosition="center right";D.style.fontWeight="600";D.style.paddingbottom="1px"}};__stormcenter.prototype.rpxlogin=function(){var C=iFactor.common.config.IFactorStreetlightoutagesURL;var B=C.split("/");var A="http://streetlightoutages.rpxnow.com/openid/embed?token_url=http%3A%2F%2F"+B[2]+"%2F"+B[3]+"%2Frpx.aspx";window.open(A,"Login","width=400,height=240,screenX=500,screenY=400,left=500,top=400,scrollbars=no")};__stormcenter.prototype.returnrpx=function(){var C=iFactor.StormCenter;var B=C.GetIFactorWebServicesUserToken();var D=proxies.IFCommonService.CheckUserExist;D.func=null;D.onException=iFactor.StormCenter.handleSOAPException;var A=D(B,readCookie("emailid"));if(readCookie("logintoken")){eraseCookie("logintoken");if(!A){iFactor.StormCenter.CreateNewUser()}else{iFactor.StormCenter.getRPXToken()}}};function GetCenterLatLong(C){if(C.GetMapStyle()==VEMapStyle.Birdseye||C.GetMapStyle()==VEMapStyle.BirdseyeHybrid){var D=C.GetBirdseyeScene();var B=D.GetWidth()/2;var E=D.GetHeight()/2;var A=D.PixelToLatLong(new VEPixel(B,E),C.GetZoomLevel());return(new _xy1).Decode(A)}else{return C.GetCenter()}}function GetZoomLevel(A){var B=A.GetZoomLevel();if(A.GetMapStyle()==VEMapStyle.Birdseye||A.GetMapStyle()==VEMapStyle.BirdseyeHybrid){B=B+18}return B}function getPixelViewLatLong(M){var G=iFactor.StormCenter;var A=G.map;if(A.GetMapStyle()==VEMapStyle.Birdseye||A.GetMapStyle()==VEMapStyle.BirdseyeHybrid){var F=A.GetBirdseyeScene();var L=F.LatLongToPixel(A.GetCenter(),A.GetZoomLevel());var B=F.GetWidth();var D=F.GetHeight();var K=document.getElementById("map");var I=K.offsetWidth;var E=K.offsetHeight;var H=L.x-(I/2)+M.x;var J=L.y-(E/2)+M.y;var C=F.PixelToLatLong(new VEPixel(H,J),A.GetZoomLevel());return(new _xy1).Decode(C)}else{return(A.PixelToLatLong(M))}}function getLatLongViewPixel(A){var F=iFactor.StormCenter;var B=F.map;if(B.GetMapStyle()==VEMapStyle.Birdseye||B.GetMapStyle()==VEMapStyle.BirdseyeHybrid){var E=B.GetBirdseyeScene();var C=B.GetMapView();var H=C.TopLeftLatLong;var D=E.LatLongToPixel(A,B.GetZoomLevel());var I=E.LatLongToPixel(H,B.GetZoomLevel());var G=new VEPixel(D.x-I.x,D.y-I.y);return G}else{return(B.LatLongToPixel(A))}}function getTopLeftLatLong(C){if(C.GetMapStyle()==VEMapStyle.Birdseye||C.GetMapStyle()==VEMapStyle.BirdseyeHybrid){return(new _xy1).Decode(C.GetMapView().TopLeftLatLong)}else{var A=C.GetMapView();var B=A.TopLeftLatLong;return B}}function getBottomRightLatLong(C){if(C.GetMapStyle()==VEMapStyle.Birdseye||C.GetMapStyle()==VEMapStyle.BirdseyeHybrid){return(new _xy1).Decode(C.GetMapView().BottomRightLatLong)}else{var A=C.GetMapView();var B=A.BottomRightLatLong;return B}}function getLatLong(A){return(new _xy1).Decode(A)}function getmodifiedMapView(G,F){var A;if(G.GetMapStyle()=="b"||G.GetMapStyle=="o"){var D=F.toString();var C=G.GetMapView();var B=getTopLeftLatLong(G);var E=getBottomRightLatLong(G);switch(D){case"North":A=new VELatLongRectangle(B,E,null,null);break;case"East":A=new VELatLongRectangle(new VELatLong(B.Latitude,E.Longitude),new VELatLong(E.Latitude,B.Longitude),null,null);break;case"South":A=new VELatLongRectangle(E,B,null,null);break;case"West":A=new VELatLongRectangle(new VELatLong(E.Latitude,B.Longitude),new VELatLong(B.Latitude,E.Longitude),null,null);break}}else{A=G.GetMapView()}return A}__stormcenter.prototype.formHighlight=function(E,G){if(G!=undefined){var B=G.split(",");var F;var A=0,H=0;var D=(document.all)?true:false;if(document.incidentReportDialog){F=document.incidentReportDialog.elements}else{if(document.incidentReportDialogdock){F=document.incidentReportDialogdock.elements}}while(A<F.length){while(H<B.length){if(B[H]==F[A].name){F[A].className="mandatory";if(D){F[A].attachEvent("onblur",blurHandler)}else{F[A].addEventListener("blur",blurHandler,false)}F[A].onfocus=function(){if(this.className!="verified"){this.className="mandatoryfocus"}};F[A].onblur=function(){if(this.className!="verified"){this.className="mandatory"}}}H++}H=0;A++}A=0;H=0;while(A<F.length){while(H<B.length){if(F[A].className!="mandatory"&&F[A].className!="mandatoryfocus"){F[A].className="normal";F[A].onfocus=function(){if(this.className!="mandatory"){this.className="normalfocus"}};F[A].onblur=function(){if(this.className!="mandatory"){this.className="normal"}}}H++}H=0;A++}var C=iFactor.common.config}};function blurHandler(A){var D=A?A:window.event;var B=D.target?D.target:D.srcElement;var C="";if(document.incidentReportDialog){C=document.incidentReportDialog.elements}else{if(document.incidentReportDialogdock){C=document.incidentReportDialogdock.elements}}if(B.className=="mandatory"||B.className=="mandatoryfocus"){if(B.value!=""){if(B.name=="verifyemail"||B.name=="email"){if(!iFactor.StormCenter.validateEmailInput(B.value.toLowerCase())){B.className="mandatory"}else{B.className="verified"}}else{if(B.name=="phone"){if(!iFactor.StormCenter.validatePhone(B.value)){B.className="mandatory"}else{B.className="verified"}}else{B.className="verified"}}}}else{}if(B.className=="verified"){if(B.value==""){B.className="mandatory"}if(B.name=="verifyemail"||B.name=="email"){if(!iFactor.StormCenter.validateEmailInput(B.value.toLowerCase())){B.className="mandatory"}else{B.className="verified"}}else{if(B.name=="phone"){if(!iFactor.StormCenter.validatePhone(B.value)){B.className="mandatory"}else{B.className="verified"}}}}if(B.value!=""){if(B.name=="verifyemail"||B.name=="email"){if(iFactor.StormCenter.validateEmailInput(B.value.toLowerCase())){if(C.email.value.toLowerCase()==C.verifyemail.value.toLowerCase()){C.verifyemail.className="verified";C.email.className="verified"}else{C.verifyemail.className="mandatory"}}}else{if(B.name=="phone"){if(!iFactor.StormCenter.validatePhone(B.value)){B.className="mandatory"}else{B.className="verified"}}else{B.className="verified"}}}}__stormcenter.prototype.validateCommentsInput=function(A){return(A||"").length<=this.maxCommentsSize()};__stormcenter.prototype.maxCommentsSize=function(){return iFactor.StormCenter.getConfigValueWithDefault("maxCommentsSize",50)};__stormcenter.prototype.validateEmailInput=function(A){var B=false;var C=new RegExp("[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+(?:[A-Z]{2}|com|org|net|gov|mil|biz|info|mobi|name|aero|jobs|museum|edu|us|in)\\b");if(C.test(A)){B=true}return B};__stormcenter.prototype.validatePhone=function(A){var B="";var D=A.replace(/[\(\)\.\-\ ]/g,"");var C=/^\s*\d+\s*$/;if(A==""){B="You didn't enter a phone number.\n";if(iFactor.common.config.phone_field_is_empty){B=iFactor.common.config.phone_field_is_empty}}else{if(String(D).search(C)==-1){B="The phone number contains illegal characters.\n";if(iFactor.common.config.phone_field_is_empty){B=iFactor.common.config.phone_field_is_empty}}else{if(!(D.length==10)){B="The phone number is the wrong length. Make sure you included an area code.\n";if(iFactor.common.config.phone_field_is_empty){B=iFactor.common.config.phone_field_is_empty}}}}if(B==""){return true}else{return false}};__stormcenter.prototype.validatePhoneMessage=function(A){var B="";var D=A.replace(/[\(\)\.\-\ ]/g,"");var C=/^\s*\d+\s*$/;if(A==""){B="You didn't enter a phone number.\n";if(iFactor.common.config.phone_field_is_empty){B=iFactor.common.config.phone_field_is_empty}}else{if(String(D).search(C)==-1){B="The phone number contains illegal characters.\n";if(iFactor.common.config.phone_field_is_empty){B=iFactor.common.config.phone_field_is_empty}}else{if(!(D.length==10)){B="The phone number is the wrong length. Make sure you included an area code.\n";if(iFactor.common.config.phone_field_is_empty){B=iFactor.common.config.phone_field_is_empty}}}}return B};__stormcenter.prototype.showHelpBox=function(A){this.dialog=new YAHOO.widget.SimpleDialog("responsePanel",{width:"360px",fixedcenter:true,modal:true,close:true,draggable:false,visible:false,zIndex:500,constraintoviewport:false,hideaftersumbit:false,buttons:[{text:"OK",handler:function(){this.hide()},isDefault:true}]});this.dialog.setHeader('<div class="ifc_dialogFont"> Help </div>');this.dialog.setBody('<div class="ifc_dialogFont" align="left">'+A+"</div>");this.dialog.render(document.body);this.dialog.show()};__stormcenter.prototype.poletagHelp=function(){var A=iFactor.common.config.IFactorStreetlightoutagesURL;iFactor.StormCenter.showHelpBox('<table><tr><td><img src="'+A+'images/gulfpower/Ptag.jpg" /></td><td>Enter the pole tag number of the streetlight experiencing a problem.</td></tr></table>')};__stormcenter.prototype.setAddressboxText=function(){var A=document.getElementById("address_value");if(A){if(A.value==""){A.value="Enter Address or Pole Number to Locate";if(iFactor.common.config.addressBoxText){A.value=iFactor.common.config.addressBoxText}}}};__stormcenter.prototype.showaddressboxhelp=function(){var A=iFactor.common.config.IFactorStreetlightoutagesURL;if(!this.addressboxhelp){var B=100;this.addressboxhelp=new YAHOO.widget.Panel("addressboxhelp",{width:B+"px",modal:false,draggable:false,close:false,context:["ptagmover","tl","tl",,[0,25]],zIndex:500});this.addressboxhelp.setBody('<img src="'+A+'images/gulfpower/Ptag.jpg" />');this.addressboxhelp.render("ifc_content");this.addressboxhelp.show()}else{this.addressboxhelp.hide();this.addressboxhelp=null}};__stormcenter.prototype.hideaddressboxhelp=function(){if(this.addressboxhelp){this.addressboxhelp.hide();this.addressboxhelp=null}};__stormcenter.prototype.changeStatusBySLOID=function(D,B,I){var G=this;var C=iFactor.common.config;var K=I;var F;if(C.management_status_transition){F=C.management_status_transition[K]}var L=this.GetIFactorWebServicesUserToken();var E=proxies.IFIncidentService.SetIncidentStatusBySLOID;E.func=null;E.onException=iFactor.StormCenter.handleSOAPException;var H=E(L,D,F);if(H){var A=G.map;A.HideInfoBox();if(B!=undefined){var J=A.GetShapeByID(B);A.DeleteShape(J)}iFactor.StormCenter.otherIncidentsforMgmt();window.parent.callManagemnetRefresh()}};__stormcenter.prototype.geocallback=function(T,I,P,U,E){var V=iFactor.common.config;var N=iFactor.StormCenter;var D;if(P==null){N.showInvalidAddressMessage();return }if(P!=null){D=P.length}if(D==1){var C=P[0];var B=C.LatLong;B=getLatLong(B);N.addLocationMarker(B)}else{if(V.polesearch_checkbox_exist){var F="";var J=["High","Medium","Low"];var L=["Interpolated","Rooftop"];var A=10;for(var R=0;R<P.length;R++){var M=P[R];var B=M.LatLong;var H=J[M.MatchConfidence];var G=L[M.Precision];var K=MatchCode(M.MatchCode);var Q=B.Latitude;var O=B.Longitude;var S=new VELatLong(Q,O);if(N.insideServiceBounds(Q,O)){F=F+"<p><a href='javascript:convertToLocation("+Q+","+O+");'>";F=F+" "+M.Name+"</a> </p>"}}if(F!=""){N.showSelectLocationBox(F)}else{N.showInvalidAddressMessage()}}}};__stormcenter.prototype.delayedMapCenterZoom=function(A,B){var C=iFactor.StormCenter.map;C.SetCenterAndZoom(A,config.min_data_zoom_level)};__stormcenter.prototype.deleteMappinShape=function(C){var B=iFactor.StormCenter.map;B.HideInfoBox();if(C!=undefined){var A=B.GetShapeByID(C);B.DeleteShape(A)}};function trimAll(A){while(A.substring(0,1)==" "){A=A.substring(1,A.length)}while(A.substring(A.length-1,A.length)==" "){A=A.substring(0,A.length-1)}A=A.replace(/\s+/g,"");return A}__stormcenter.prototype.clusterCallback_inprogress=function(E){try{if(E!=null){for(var C=0;C<E.length;C++){var A=E[C];var H=E[C].GetClusterShape();H.SetCustomIcon("<img src='images/cluster.gif'/>");var F='<div class="infoboxtitle"><table><tr><td><b> Cluster </b></td></tr></table></div>';for(var D=0;D<A.Shapes.length;D++){var B=A.Shapes[D];if(B.GetID()!=undefined&&B.Title!=undefined){F+="<br/>"+iFactor.StormCenter.setShapeDescription(B.Title)}F+='<a href="javascript:iFactor.StormCenter.changeStatusBySLOID('+B.Title+",'"+B.GetID()+"','in_progress');\">Mark this Complete</a>"}H.SetDescription(F)}}}catch(G){}};__stormcenter.prototype.otherIncidentsforMgmt=function(){var D="";var B;var A=iFactor.common.config;for(var C=0;C<A.statusTypes.length;C=C+1){D=trimAll(A.statusTypes[C]);if((D!="reported")&&(D!="reported_rejected")&&(D!="closed")&&(D!="complete")){B={extraArguments:["streetlight",D],iconURL:iFactor.common.config["streetlight_"+D+"_outage_ICON_URL"],layerName:D+"Incidents",webMethod:proxies.IFIncidentService.GetIncidentsIDAndLocationAsJSONList,zIndex:100};this.helperShowFeatures(B)}}};__stormcenter.prototype.showIncidentsforMgmt=function(){var D="";var A;var C=["reported"];for(var B=0;B<C.length;B=B+1){D=C[B];A={extraArguments:["streetlight",D],iconURL:iFactor.common.config["streetlight_"+D+"_outage_ICON_URL"],layerName:D+"Incidents",webMethod:proxies.IFIncidentService.GetIncidentsIDAndLocationAsJSONList,zIndex:100};this.helperShowFeatures(A)}};__stormcenter.prototype.saddressboxhelp_new=function(){var A=iFactor.common.config.IFactorStreetlightoutagesURL;if(!this.addressboxhelp_new){if(document.getElementById("search_address_polenum_help")){document.getElementById("search_address_polenum_help").style.display="block"}this.addressboxhelp_new=new YAHOO.widget.Panel("search_address_polenum_help",{modal:false,draggable:false,close:false,zIndex:500});this.addressboxhelp_new.setBody('<img src="'+A+'images/nipsco/addressBoxHelp.png" />');this.addressboxhelp_new.render("ifc_content");this.addressboxhelp_new.show();var C=document.getElementById("search_address_polenum_help_c");if(C!=null){C.style.left="340px";C.style.top="50px"}}else{this.addressboxhelp_new.hide();var B=document.getElementById("search_address_polenum_help_c");if(B){iFactor.StormCenter.deletePanel(B)}this.addressboxhelp_new=null}};function MatchCode(B){if(B==VEMatchCode.None){return"No match"}var C="";var A;A=B&VEMatchCode.Good;if(A>0){C+="Good "}A=B&VEMatchCode.Ambiguous;if(A>0){C+="Ambiguous "}A=B&VEMatchCode.UpHierarchy;if(A>0){C+="UpHierarchy "}A=B&VEMatchCode.Modified;if(A>0){C+="Modified "}return(C+"Match")}__stormcenter.prototype.startLoader=function(){var C=this;var A=iFactor.StormCenter.map;var H=130;var B=50;var E=this.map.mapelement.offsetTop+(this.map.mapelement.clientHeight/2)-(H/2);var F=this.map.mapelement.offsetLeft+(this.map.mapelement.clientWidth/2)-(B/2);var G=new YAHOO.widget.Overlay("load_icon",{visible:true,context:["map","tl","tl",,[F,E]]});var D=iFactor.common.config.IFactorStreetlightoutagesURL;G.setBody('<img src="'+D+'images/load.gif" align="middle"/>');G.render("ifc_content");G.show();var I=document.getElementById("load_icon");if(I!=null){I.style.left=F+"px";I.style.top=E+"px"}};__stormcenter.prototype.stopLoader=function(){if(document.getElementById("load_icon")!=null){var B=document.getElementById("load_icon");B.style.visibility="hidden"}var A=null;if(/MSIE (\d+\.\d+);/.test(navigator.userAgent)){A=new Number(RegExp.$1)}if(A<=6){iFactor.StormCenter.deleteLoad()}};__stormcenter.prototype.startLoad=function(){var C=this;var A=iFactor.StormCenter.map;var H=130;var B=50;var E=this.map.mapelement.offsetTop+(this.map.mapelement.clientHeight/2)-(H/2);var F=this.map.mapelement.offsetLeft+(this.map.mapelement.clientWidth/2)-(B/2);var G=new YAHOO.widget.Overlay("loading_icon",{visible:true,context:["map","tl","tl",,[F,E]]});var D=iFactor.common.config.IFactorStreetlightoutagesURL;G.setBody('<img src="'+D+'images/loading.gif" align="middle"/>');G.render("ifc_content");G.show();var I=document.getElementById("loading_icon");if(I!=null){I.style.left=F+"px";I.style.top=E+"px"}};__stormcenter.prototype.stopLoad=function(){var B=document.getElementById("loading_icon");B.style.visibility="hidden";var A=null;if(/MSIE (\d+\.\d+);/.test(navigator.userAgent)){A=new Number(RegExp.$1)}if(A<=6){iFactor.StormCenter.deleteLoad()}};__stormcenter.prototype.getAllowableBounds=function(){var A=function(G){var H=iFactor.StormCenter;var E=YAHOO.lang.JSON.parse(G);var I;var F=iFactor.common.config;for(I in E){if(E.hasOwnProperty(I)){if(E[I]!=""){F[I]=E[I]}}}H.showServiceArea();H.updateConfigurationFromRequestQueryStringParameters();H.loadStreetLightAfterConfiguration()};var C=iFactor.StormCenter.GetIFactorWebServicesUserToken();var B=proxies.IFIncidentService.GetAllowableBounds;var D={prepare:function(E){return E},call:function(E){B.func=this.call.func;B.onException=this.call.onException;B(C)},finish:A,onException:iFactor.StormCenter.handleSOAPException};ajax.Start(D)};__stormcenter.prototype.returnToLastBounds=function(){if(this.outsideBoundsMessage!=null){this.outsideBoundsMessage=null}this.map.SetCenterAndZoom(this.lastZoom[0],this.lastZoom[1])};__stormcenter.prototype.addLocationMarker=function(J){var A=iFactor.StormCenter.map;this.mappin=true;var G=this;var F=new VEShapeLayer();var C="mappin";F.Hide();A.AddShapeLayer(F);F.SetTitle(C);F.Show();var H=iFactor.common.config.IFactorStreetlightoutagesURL+"images/poi_precise_location.gif";var E=function(){iFactor.StormCenter.stopLoader();message="The location you searched for is outside the service area. Please try again by giving a valid location within the service area.";if(iFactor.common.config.outside_the_service_area){message=iFactor.common.config.outside_the_service_area}iFactor.StormCenter.showAlertBox(message)};var B=function(N){var L=null;if(/MSIE (\d+\.\d+);/.test(navigator.userAgent)){L=new Number(RegExp.$1)}if(L<=6){iFactor.StormCenter.deleteLoad()}var M=new VEShape(VEShapeType.Pushpin,J);M.SetZIndex(600);M.SetTitle("Address search");M.SetCustomIcon('<span style="z-index:600;display:inline-block;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='+H+')"><img style="filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);"  src="'+H+'"/></span>');F.AddShape(M);A.SetCenterAndZoom(J,config.min_data_zoom_level);if(config.min_data_zoom_level!=GetZoomLevel(A)){var O=function(){iFactor.StormCenter.delayedMapCenterZoom(J,config.min_data_zoom_level)};setTimeout(O,150)}iFactor.StormCenter.stopLoader()};var K=iFactor.StormCenter.GetIFactorWebServicesUserToken();var I=proxies.IFIncidentService.checkServiceareaBounds;var D={prepare:function(L){return L},call:function(L){I.func=this.call.func;I.onException=this.call.onException;I(K,J.Longitude,J.Latitude)},finish:B,onException:E};ajax.Start(D)};__stormcenter.prototype.highlightPoleSearchResults=function(G){var J=G[0];var A=iFactor.StormCenter.map;this.mappin=true;var F=new VEShapeLayer();var C="polesearchpin";F.Hide();A.AddShapeLayer(F);F.SetTitle(C);F.Show();var H=iFactor.common.config.IFactorStreetlightoutagesURL+"images/nipsco/marker.png";var E=function(){iFactor.StormCenter.stopLoader();message="The location you searched for is outside the service area. Please try again by giving a valid location within the service area.";if(iFactor.common.config.outside_the_service_area){message=iFactor.common.config.outside_the_service_area}iFactor.StormCenter.showAlertBox(message)};var B=function(N){var L=null;if(/MSIE (\d+\.\d+);/.test(navigator.userAgent)){L=new Number(RegExp.$1)}if(L<=6){iFactor.StormCenter.deleteLoad()}for(i=0;i<G.length;i=i+1){var P=G[i];var M=new VEShape(VEShapeType.Pushpin,P);M.SetZIndex(50);M.SetTitle("Pole search");M.SetCustomIcon('<span class="markerie" style="z-index:50;display:inline-block;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='+H+')"><img class="marker" style="filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);"  src="'+H+'"/></span>');F.AddShape(M)}if(config.min_data_zoom_level!=GetZoomLevel(A)){var O=function(){iFactor.StormCenter.delayedMapCenterZoom(J,config.min_data_zoom_level)};setTimeout(O,150)}iFactor.StormCenter.stopLoader()};var K=iFactor.StormCenter.GetIFactorWebServicesUserToken();var I=proxies.IFIncidentService.checkServiceareaBounds;var D={prepare:function(L){return L},call:function(L){I.func=this.call.func;I.onException=this.call.onException;I(K,J.Longitude,J.Latitude)},finish:B,onException:E};ajax.Start(D);this.pointLayers[C]=F};__stormcenter.prototype.deletePoleSearchPin=function(){var B=iFactor.StormCenter.map;if(this.pointLayers.polesearchpin){var A=this.pointLayers.polesearchpin;if(A){B.DeleteShapeLayer(A);this.pointLayers.polesearchpin=""}}};__stormcenter.prototype.bingMapAddressSearch=function(B){var C=this.map;var A=iFactor.common.config;if(C.GetMapStyle()=="b"||C.GetMapStyle=="o"){C.Find(null,B,null,null,null,20,null,null,false,false,iFactor.StormCenter.geocallback)}else{if(A.polesearch_checkbox_exist){C.Find(null,B,null,null,null,20,null,null,false,false,iFactor.StormCenter.geocallback)}else{C.Find(null,B,null,null,null,20,null,null,null,false,iFactor.StormCenter.geocallback)}}};function convertToLocation(F,D){var C=iFactor.StormCenter;C.startLoader();var E=C.map;var B=document.getElementById("selectLocation_c");if(B){iFactor.StormCenter.deletePanel(B)}C.ie6FixDeletePanel();var A=new VELatLong(F,D);A=getLatLong(A);C.addLocationMarker(A)}__stormcenter.prototype.showSelectLocationBox=function(D){var B=document.getElementById("selectLocation_c");iFactor.StormCenter.stopLoader();if(B){iFactor.StormCenter.deletePanel(B)}var C=new YAHOO.widget.SimpleDialog("selectLocation",{width:"280px",fixedcenter:true,modal:false,close:true,draggable:false,visible:false,zIndex:10,constraintoviewport:false,hideaftersumbit:false});var A=null;if(/MSIE (\d+\.\d+);/.test(navigator.userAgent)){A=new Number(RegExp.$1)}if(A<=6){C.beforeHideEvent.subscribe(function(){iFactor.StormCenter.ie6FixDeletePanel()})}C.setHeader('<div class="ifc_panelfonthead">Select a Location </div>');C.setBody('<div class="ifc_panelfontbody" align="left"><table><tr><td>'+D+"</td></tr></table></div>");C.render("ifc_content");C.show()};__stormcenter.prototype.insideServiceBounds=function(I,A){var H=I;var D=A;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 B=parseFloat(iFactor.common.config.max_viewable_lng);var C=true;if((H>G)||(H<E)){C=false}if((D>B)||(D<F)){C=false}return C};__stormcenter.prototype.showInvalidAddressMessage=function(){var A=iFactor.common.config;var B=iFactor.StormCenter;B.stopLoader();message="There were no results for your search. Please check your submission and try again.";if(A.address_search_error_message){message=A.address_search_error_message}B.showAlertBox(message);return };__stormcenter.prototype.showInvalidPoleMessage=function(){var A=iFactor.common.config;var B=iFactor.StormCenter;B.stopLoader();message="There were no results for your search. Please check your submission and try again.";if(A.polesearch_checkbox_exist&&(A.polesearch_checkbox_exist=="true")){if(A.invalid_pole_number){message=A.invalid_pole_number}}B.showAlertBox(message);return };__stormcenter.prototype.searchRadio_onchange=function(F,E){var A=iFactor.common.config;var G=document.getElementById(F+"Lbl");var C=document.getElementById(E+"Lbl");if(G&&C){G.style.color="#000000";C.style.color="gray"}for(i=0;i<document.searchGrp.search.length;i++){if(document.searchGrp.search[i].value==F){document.searchGrp.search[i].checked=true}}var B="Enter Address or Pole Number to Locate";if(F=="pole"){B="Enter Pole Number to Locate";A.poleSearch="true"}else{if(F=="address"){B="Enter Address to Locate";A.poleSearch="false"}}var D=document.getElementById("address_value");if(D){D.value=B;iFactor.common.config.addressBoxText=B}};__stormcenter.prototype.ie6FixDeletePanel=function(){var A=null;var F=iFactor.StormCenter;if(/MSIE (\d+\.\d+);/.test(navigator.userAgent)){A=new Number(RegExp.$1)}if(A<=6){var C=document.getElementById("confirmationPanel_f");if(C){F.deletePanel(C)}var E=document.getElementById("confirmationPanel_c");if(E){F.deletePanel(E)}var B=document.getElementById("selectLocation_f");if(B){F.deletePanel(B)}var D=document.getElementById("selectLocation_c");if(D){F.deletePanel(D)}F.deleteLoad()}};__stormcenter.prototype.deleteLoad=function(){var B=document.getElementById("loading_icon_f");if(B){iFactor.StormCenter.deletePanel(B)}var C=document.getElementById("load_icon_f");if(C){iFactor.StormCenter.deletePanel(C)}var A=document.getElementById("load_icon");if(A){iFactor.StormCenter.deletePanel(A)}};__stormcenter.prototype.isCookiesEnabled=function(){var B=false;var A="streetlightoutages-cookie-test";YAHOO.util.Cookie.set(A,"test");if(YAHOO.util.Cookie.exists(A)){B=true;YAHOO.util.Cookie.remove(A)}return B};__stormcenter.prototype.getIncidentReporterDialogBodyString=function(A){var B="<div style='font-size:10px'><i>* Your browser's cookies are disabled.  To save contact information between sessions, please enable cookies.</i>  <a href='javascript:iFactor.StormCenter.learnMoreAboutCookies();'>Learn more</a></div>";if(iFactor.StormCenter.isCookiesEnabled()){return iFactor.common.config[A]}else{return iFactor.common.config[A]+B}};__stormcenter.prototype.learnMoreAboutCookies=function(){this.cookieDialog=new YAHOO.widget.SimpleDialog("learnMoreAboutCookies",{width:"360px",fixedcenter:true,modal:true,close:true,draggable:true,visible:false,zIndex:500,constraintoviewport:false,hideaftersumbit:false});this.cookieDialog.setHeader('<div class="ifc_dialogFont">Why enable browser cookies?</div>');var A="<b style='color:red'>OFF</b>";if(iFactor.StormCenter.isCookiesEnabled()){A="<b style='color:green'>ON</b>"}this.cookieDialog.setBody("<div class=\"ifc_dialogFont\" align=\"left\"><p>If you are a user that reports many outages, we make life easier for you by saving the contact information that you entered in the outage reporting form to save you typing the same information repeatedly.  This 'saving' feature will always work for your <i>current</i> browser session.</p><p>If you want to take it to the next level and have us save your contact information for the next time you visit our site, you will need to enable cookies in your browser for 'streetlightoutages.com'</p><p>We detect that your cookies are currently turned "+A+"</p></div>");this.cookieDialog.render(document.body);this.cookieDialog.show()};
