function OpacityControl(a){this.overlay=a}OpacityControl.prototype=new GControl();OpacityControl.prototype.setSlider=function(b){var a=Math.round((58*b));this.slide.left=a;this.knob.style.left=a+"px";this.knob.style.top="0px"};OpacityControl.prototype.setOpacity=function(){var a=this.slide.left/58;setO("precip_img"+active,a)};OpacityControl.prototype.initialize=function(f){var e=this;this.map=f;var c=navigator.userAgent.toLowerCase();if((c.indexOf("msie")>-1)&&(c.indexOf("opera")<1)){this.ie=true}else{this.ie=false}var d=document.createElement("div");d.style.width="70px";d.style.height="21px";if(this.ie){var a="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/opacity-label2.png', sizingMethod='crop');";d.innerHTML='<div style="height:20px; width:70px; '+a+'" ></div>'}else{d.innerHTML='<div style="height:20px; width:70px; background-image: url(images/opacity-label2.png)" ></div>'}var b=document.createElement("div");b.style.width="70px";b.style.height="21px";if(this.ie){var a="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/opacity-slider.png', sizingMethod='crop');";b.innerHTML='<div style="height:21px; width:70px; '+a+'" ></div>'+d.innerHTML}else{b.innerHTML='<div style="height:21px; width:70px; background-image: url(images/opacity-slider.png)" ></div>'+d.innerHTML}if(this.ie){var a="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/opacity-slider.png', sizingMethod='crop');";this.knob=document.createElement("div");this.knob.style.height="21px";this.knob.style.width="13px";this.knob.style.overflow="hidden";this.knob_img=document.createElement("div");this.knob_img.style.height="21px";this.knob_img.style.width="83px";this.knob_img.style.filter=a;this.knob_img.style.position="relative";this.knob_img.style.left="-70px";this.knob.appendChild(this.knob_img)}else{this.knob=document.createElement("div");this.knob.style.height="21px";this.knob.style.width="13px";this.knob.style.backgroundImage="url(images/opacity-slider.png)";this.knob.style.backgroundPosition="-70px 0px"}b.appendChild(this.knob);this.slide=new GDraggableObject(this.knob,{container:b});this.slide.setDraggableCursor("pointer");this.slide.setDraggingCursor("pointer");this.container=b;f.getContainer().appendChild(b);this.setSlider(0.5);GEvent.addListener(this.slide,"drag",function(){e.setOpacity()});return b};OpacityControl.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_TOP_RIGHT,new GSize(7,47))};var overlaySwitch;function OverlayControl(){}OverlayControl.prototype=new GControl();OverlayControl.prototype.initialize=function(a){overlaySwitch=document.createElement("div");overlaySwitch.id="overlaySwitch";overlaySwitch.style.overflow="auto";overlaySwitch.style.backgroundColor="#ffffff";overlaySwitch.style.borderColor="black";overlaySwitch.style.borderWidth="1px";overlaySwitch.style.borderStyle="solid";overlaySwitch.innerHTML='<div style="padding-right: 2px; border-style: solid; border-color: white rgb(176, 176, 176) rgb(176, 176, 176) white; border-width: 1px; font-size: 10px;"><form style="display:inline; font-size: 12px;" name="weather"><INPUT TYPE="checkbox" style="height:12px; width:12px; margin:1px 2px;" ID = "precip_check" NAME="PrecipCheck" VALUE="0" onClick="precipClick()">NWS Precip Image<span id="zoom_out" style="font-size: 11px; color: #666; display:none"> (zoom out to view)</span></form></div>';a.getContainer().appendChild(overlaySwitch);return overlaySwitch};OverlayControl.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_TOP_RIGHT,new GSize(100,7))};var Icon=new GIcon();var side_bar_html="";side_bar_html='<table id="myTable" class="tablesorter"><thead>';side_bar_html+="<tr><th>Station</th>";side_bar_html+='<th class="col1">3 <br> Hr</th>';side_bar_html+='<th class="col2">6 <br> Hr</th>';side_bar_html+='<th class="col3">12 <br> Hr</th>';side_bar_html+='<th class="col4">24 <br> Hr</th>';side_bar_html+='<th class="col5">48 <br> Hr</th>';side_bar_html+='<th class="col6">7 <br> D</th>';side_bar_html+='<th class="col7">30 <br> D</th></tr></thead><tbody>';var rowcolor="";var gmarkers=[];var htmls=[];var i=0;var icons=[];var total=0;var total3=0;var total6=0;var total12=0;var total24=0;var total48=0;var total168=0;var total720=0;var popup_html="";var tooltip_text="";var precip_data=new Array(7);for(var j=0;j<7;j++){precip_data[j]=new Array()}var precip_overlay=[];var active=3;var hidden=false;var titles=["3 Hour","6 Hour","12 Hour","24 Hour","48 Hour","7 Day","30 Day"];var overlays=["http://www.srh.noaa.gov/rfcshare/p_images_hourly/latest/stil_last3_obs.gif","http://www.srh.noaa.gov/rfcshare/p_images_hourly/latest/stil_last6_obs.gif","http://www.srh.noaa.gov/rfcshare/p_images_hourly/latest/stil_last12_obs.gif","http://www.srh.noaa.gov/rfcshare/p_images_hourly/latest/stil_last24_obs.gif","http://www.srh.noaa.gov/rfcshare/p_images_hourly/latest/stil_last48_obs.gif","http://www.srh.noaa.gov/rfcshare/p_images_new/cur/stil_7_obs.gif","http://www.srh.noaa.gov/rfcshare/p_images_new/cur/stil_30_obs.gif"];var sorting=[[[1,1]],[[2,1]],[[3,1]],[[4,1]],[[5,1]],[[6,1]],[[7,1]]];function createMarker(a,c,e,d,f){Icon.image=e;Icon.printImage=e;Icon.mozPrintImage=e;Icon.printShadow="";Icon.shadow="";Icon.iconSize=new GSize(16,16);Icon.iconAnchor=new GPoint(8,8);Icon.infoWindowAnchor=new GPoint(16,0);tooltip_text=c;var b=new PdMarker(a,Icon);b.title=c;b.tooltip='<div class="tooltip" style="width:150px">'+c+"<br><nobr><em>Last Data Update:</em></nobr><br><nobr>"+f+" CST</nobr><br>";b.tooltip2='<nobr><span id="tooltip_text'+i+'"><em>24 Hour Total:</em></nobr><br><nobr>'+total24+" inches</span</nobr></div>";b.setTooltip(b.tooltip+b.tooltip2);b.setOpacity(100);GEvent.addListener(b,"click",function(){b.openInfoWindowHtml(d)});gmarkers[i]=b;htmls[i]=popup_html;icons[i]=e;side_bar_html+='<tr><td><a href="javascript:myclick('+i+')"  onmouseover="gmarkers['+i+'].blink(true,250)" onmouseout="gmarkers['+i+'].blink(false,0)">'+c+"</a><br></td>";side_bar_html+='<td class="col1" align="right">'+total3+"</td>";precip_data[0][i]=total3;side_bar_html+='<td class="col2" align="right">'+total6+"</td>";precip_data[1][i]=total6;side_bar_html+='<td class="col3" align="right">'+total12+"</td>";precip_data[2][i]=total12;side_bar_html+='<td class="col4" align="right">'+total24+"</td>";precip_data[3][i]=total24;side_bar_html+='<td class="col5" align="right">'+total48+"</td>";precip_data[4][i]=total48;side_bar_html+='<td class="col6" align="right">'+total168+"</td>";precip_data[5][i]=total168;side_bar_html+='<td class="col7" align="right">'+total720+"</td></tr>";precip_data[6][i]=total720;i++;map.addOverlay(b)}function myclick(a){GEvent.trigger(gmarkers[a],"click")}function restrictZoom(d,a){var b=map.getMapTypes();for(var c=0;c<b.length;c++){b[c].getMinimumResolution=function(){return d};b[c].getMaximumResolution=function(){return a}}}function setO(e,c){var b=document.getElementById(e);var a=Math.round(c*100);if(typeof(b.style.filter)=="string"){b.style.filter="alpha(opacity:"+a+")"}if(typeof(b.style.KHTMLOpacity)=="string"){b.style.KHTMLOpacity=a/100}if(typeof(b.style.MozOpacity)=="string"){b.style.MozOpacity=a/100}if(typeof(b.style.opacity)=="string"){b.style.opacity=a/100}}function precipClick(){if(document.getElementById("precip_check").checked==true){setO("precip_img"+active,0.5);$("#precip_img"+active).show();map.addControl(slider)}else{setO("precip_img"+active,0);map.removeControl(slider)}}function changeIcons(b){if(b!=active){document.getElementById("link"+b).style.backgroundColor="#000000";document.getElementById("link"+b).style.color="#FFFFFF";document.getElementById("link"+active).style.backgroundColor="";document.getElementById("link"+active).style.color=""}else{document.getElementById("link"+b).style.backgroundColor="#000000";document.getElementById("link"+b).style.color="#FFFFFF"}for(var a=0;a<gmarkers.length;a++){gmarkers[a].setImage(getIcon(a,b));gmarkers[a].tooltip2='<nobr><span id="tooltip_text'+a+'"><em>'+titles[b]+" Total:</em></nobr><br><nobr>"+precip_data[b][a]+" inches</span</nobr></div>";gmarkers[a].setTooltip(gmarkers[a].tooltip+gmarkers[a].tooltip2);gmarkers[a].iconSize=new GSize(16,16)}$("table").trigger("sorton",[sorting[b]]);if(active>=5&&b<5){document.getElementById("legend").innerHTML='<table border=0 width="100%" cellspacing="0"><tr align="center"><td colspan="17" bgcolor="#cdcdcd"><font class="table_row_header">Legend (inches)</font></td></tr><tr align="center"><td><img src="markers/m20.png" align="absmiddle" alt="map color"><br>no data </td> <td> <img src="markers/m00.png" align="absmiddle" alt="map color"> <br>&lt;=0.01* </td> <td align="center"> <img src="markers/m01.png" align="absmiddle" alt="map color"> <br>&lt;=0.10 </td> <td align="center"> <img src="markers/m02.png" align="absmiddle" alt="map color"> <br>&lt;=0.25 </td> <td align="center"> <img src="markers/m03.png" align="absmiddle" alt="map color"> <br>&lt;=0.5 </td> <td align="center"> <img src="markers/m04.png" align="absmiddle" alt="map color"> <br>&lt;=0.75 </td> <td align="center"> <img src="markers/m05.png" align="absmiddle" alt="map color"> <br>&lt;=1.0 </td> <td align="center"> <img src="markers/m06.png" align="absmiddle" alt="map color"> <br>&lt;=1.5 </td> <td align="center"> <img src="markers/m07.png" align="absmiddle" alt="map color"> <br>&lt;=2.0 </td> <td align="center"> <img src="markers/m08.png" align="absmiddle" alt="map color"> <br>&lt;=2.5 </td> <td align="center"> <img src="markers/m09.png" align="absmiddle" alt="map color"> <br>&lt;=3.0 </td> <td align="center"> <img src="markers/m10.png" align="absmiddle" alt="map color"> <br>&lt;=4.0 </td> <td align="center"> <img src="markers/m11.png" align="absmiddle" alt="map color"> <br>&lt;=5.0 </td> <td align="center"> <img src="markers/m12.png" align="absmiddle" alt="map color"> <br>&lt;=6.0 </td> <td align="center"> <img src="markers/m13.png" align="absmiddle" alt="map color"> <br>&lt;=8.0 </td> <td align="center"> <img src="markers/m14.png" align="absmiddle" alt="map color"> <br>&lt;=10 </td> <td align="center"> <img src="markers/m15.png" align="absmiddle" alt="map color"> <br>&gt;10 </td> </tr><tr class="noprint" align=center> <td bgcolor="#cdcdcd" colspan=17><span style="font-size: 11px; text-align: center;">*(applies to both gage and image data except for <=0.01, where the gage color is light gray and the image is transparent)</span></td></tr>  </table>';document.getElementById("xml_update_time2").innerHTML=ValidName}else{if(active<5&&b>=5){document.getElementById("legend").innerHTML='<table border=0 width="100%" cellspacing="0"><tr align="center"><td colspan="17" bgcolor="#cdcdcd"><font class="table_row_header">Legend (inches)</font></td></tr><tr align="center"> <td> <img src="markers/m20.png" align="absmiddle" alt="map color"> <br>no data </td> <td> <img src="markers/m00.png" align="absmiddle" alt="map color"> <br>&lt;=0.01* </td> <td align="center"> <img src="markers/m01.png" align="absmiddle" alt="map color"> <br>&lt;=0.10 </td> <td align="center"> <img src="markers/m02.png" align="absmiddle" alt="map color"> <br>&lt;=0.25 </td> <td align="center"> <img src="markers/m03.png" align="absmiddle" alt="map color"> <br>&lt;=0.5 </td> <td align="center"> <img src="markers/m04.png" align="absmiddle" alt="map color"> <br>&lt;=1.0 </td> <td align="center"> <img src="markers/m05.png" align="absmiddle" alt="map color"> <br>&lt;=1.5 </td> <td align="center"> <img src="markers/m06.png" align="absmiddle" alt="map color"> <br>&lt;=2.0 </td> <td align="center"> <img src="markers/m07.png" align="absmiddle" alt="map color"> <br>&lt;=3.0 </td> <td align="center"> <img src="markers/m08.png" align="absmiddle" alt="map color"> <br>&lt;=4.0 </td> <td align="center"> <img src="markers/m09.png" align="absmiddle" alt="map color"> <br>&lt;=5.0 </td> <td align="center"> <img src="markers/m10.png" align="absmiddle" alt="map color"> <br>&lt;=6.0 </td> <td align="center"> <img src="markers/m11.png" align="absmiddle" alt="map color"> <br>&lt;=8.0 </td> <td align="center"> <img src="markers/m12.png" align="absmiddle" alt="map color"> <br>&lt;=10 </td> <td align="center"> <img src="markers/m13.png" align="absmiddle" alt="map color"> <br>&lt;=15 </td> <td align="center"> <img src="markers/m14.png" align="absmiddle" alt="map color"> <br>&lt;=20 </td> <td align="center"> <img src="markers/m15.png" align="absmiddle" alt="map color"> <br>&gt;20 </td> </tr><tr class="noprint" align=center> <td bgcolor="#cdcdcd" colspan=17><span style="font-size: 11px; text-align: center;">*(applies to both gage and image data except for <=0.01, where the gage color is light gray and the image is transparent)</span></td></tr>  </table>';document.getElementById("xml_update_time2").innerHTML=ValidName2}}$("#precip_img"+active).hide();active=b;document.getElementById("last_update").innerHTML=titles[active]+"s ";document.getElementById("last_update2").innerHTML=titles[active]+"s ";precipClick()}function toggleCol(){var b=active+1;for(var a=1;a<8;a++){if(a!=b){hidden?showCol("col"+a):hideCol("col"+a)}}hidden?hidden=false:hidden=true;document.getElementById("sidebarwrap").style.width="250px";document.getElementById("myTable").style.width="250px";document.getElementById("main").style.marginRight="250px"}function hideCol(b){var a=getElementsByClass(b);for(i=0;i<a.length;i++){a[i].style.display="none"}}function showCol(b){var a=getElementsByClass(b);for(i=0;i<a.length;i++){a[i].style.display=""}}function getElementsByClass(e,d,b){if(d==null){d=document}if(b==null){b="*"}var c=new Array();var a=d.getElementsByTagName(b);var g=" "+e+" ";for(i=0,j=0;i<a.length;i++){var f=" "+a[i].className+" ";if(f.indexOf(g)!=-1){c[j++]=a[i]}}return c}function getIcon(a,c){if(typeof document.body.style.maxHeight=="undefined"){var b="gif"}else{var b="png"}if(c<5){if(precip_data[c][a]==""){return"markers/m20s."+b}else{if(precip_data[c][a]<=0.01){return"markers/m00s."+b}else{if(precip_data[c][a]<=0.1){return"markers/m01s."+b}else{if(precip_data[c][a]<=0.25){return"markers/m02s."+b}else{if(precip_data[c][a]<=0.5){return"markers/m03s."+b}else{if(precip_data[c][a]<=0.75){return"markers/m04s."+b}else{if(precip_data[c][a]<=1){return"markers/m05s."+b}else{if(precip_data[c][a]<=1.5){return"markers/m06s."+b}else{if(precip_data[c][a]<=2){return"markers/m07s."+b}else{if(precip_data[c][a]<=2.5){return"markers/m08s."+b}else{if(precip_data[c][a]<=3){return"markers/m09s."+b}else{if(precip_data[c][a]<=4){return"markers/m10s."+b}else{if(precip_data[c][a]<=5){return"markers/m11s."+b}else{if(precip_data[c][a]<=6){return"markers/m12s."+b}else{if(precip_data[c][a]<=8){return"markers/m13s."+b}else{if(precip_data[c][a]<=10){return"markers/m14s."+b}else{return"markers/m15s."+b}}}}}}}}}}}}}}}}}else{if(precip_data[c][a]==""){return"markers/m20s."+b}else{if(precip_data[c][a]<=0.01){return"markers/m00s."+b}else{if(precip_data[c][a]<=0.1){return"markers/m01s."+b}else{if(precip_data[c][a]<=0.25){return"markers/m02s."+b}else{if(precip_data[c][a]<=0.5){return"markers/m03s."+b}else{if(precip_data[c][a]<=1){return"markers/m04s."+b}else{if(precip_data[c][a]<=1.5){return"markers/m05s."+b}else{if(precip_data[c][a]<=2){return"markers/m06s."+b}else{if(precip_data[c][a]<=3){return"markers/m07s."+b}else{if(precip_data[c][a]<=4){return"markers/m08s."+b}else{if(precip_data[c][a]<=5){return"markers/m09s."+b}else{if(precip_data[c][a]<=6){return"markers/m10s."+b}else{if(precip_data[c][a]<=8){return"markers/m11s."+b}else{if(precip_data[c][a]<=10){return"markers/m12s."+b}else{if(precip_data[c][a]<=15){return"markers/m13s."+b}else{if(precip_data[c][a]<=20){return"markers/m14s."+b}else{return"markers/m15s."+b}}}}}}}}}}}}}}}}}};