function load(a){$(document).ready(function(){jQuery("#list").jqGrid({sortable:true,url:a,datatype:"xml",height:800,width:800,mtype:"GET",colNames:["Date","Type","Details","Comments","Lat","Long","Address","County","State","Zip","Time","Population","Pop. Growth","Pop. Density","Median Age","Median Incom","COL Index","Median Home Age","Median Home Value"],colModel:[{name:"StormDate",index:"StormDate",width:70},{name:"StormType",index:"StormType",width:30},{name:"StormDetails",index:"StormDetails",width:30},{name:"Comments",index:"Comments",width:90},{name:"Latitude",index:"Latitude",width:30,align:"right"},{name:"Longitude",index:"Longitude",width:30,align:"right"},{name:"Address",index:"Address",width:90},{name:"County",index:"County",width:40},{name:"State",index:"State",width:20,align:"right"},{name:"zipcode",index:"zipcode",width:30,align:"right"},{name:"Time",index:"Time",width:40,align:"right"},{name:"population",index:"population",width:40,align:"right"},{name:"pop_growth",index:"pop_growth",width:40,align:"right"},{name:"pop_density",index:"pop_density",width:40,align:"right"},{name:"median_age",index:"median_age",width:40,align:"right"},{name:"median_income",index:"median_income",width:50,align:"right"},{name:"costofliving_index",index:"costofliving_index",width:30,align:"right"},{name:"median_home_age",index:"median_home_age",width:20,align:"right"},{name:"median_home_value",index:"median_home_value",width:50,align:"right"},],pager:"#pager",rowNum:50,gridview:true,rowList:[50,100,150,200],sortname:"StormDate",sortorder:"asc",viewrecords:true,caption:"Storm Reports Data Grid"})})}function BuildLink(k){if(document.getElementById("daterange").value!="Click to Select Date Range..."){if(isValidZipCode(document.getElementById("zipcode").value)){daterange=document.getElementById("daterange").value;daterange_result=daterange.split(" - ");if(!daterange_result[1]){daterange_result[1]=daterange_result[0]}var b=formatDate(new Date(getDateFromFormat(daterange_result[0],"yyyyMMdd")),"MMM d, y");var a=formatDate(new Date(getDateFromFormat(daterange_result[1],"yyyyMMdd")),"MMM d, y");var c=new Array();var l=document.forms.grabdate_form2.elements.states;var g=document.getElementById("zipcode").value;var f=document.getElementById("radius").value;while(l.selectedIndex!=-1){if(l.selectedIndex!=0){c.push(l.options[l.selectedIndex].value)}l.options[l.selectedIndex].selected=false}var j="";for(var d=0;d<c.length;d++){if(d+1==c.length){j+=c[d]}else{j+=c[d]+"-"}}var e=k.showtypes.value;var h="http://www.stormreportmap.com/gridxml.php?daterange="+daterange_result[0]+" - "+daterange_result[1];h+="&showtypes="+e;h+="&states="+j;h+="&zipcode="+g;h+="&radius="+f;jQuery("#list").setGridParam({url:h,page:1}).trigger("reloadGrid")}else{$.prompt("Improperly formatted ZipCode!",{prefix:"cleanblue"})}}else{$.prompt("Please select a specific date or daterange to search with!",{prefix:"cleanblue"})}}function isValidZipCode(b){if(!b){return 1}else{var a=/^\d{5}([\-]\d{4})?$/;return(a.test(b))}};
