function loadmap(a,e,l,j,n,p,f,m,d,k,o,g){var b=[];for(var c=0;c<d.length;c++){var h=new olwidget.InfoLayer([[d[c],k[c]]],{name:g[c],overlayStyle:{fillColor:o[c],strokeColor:o[c]}});h.transitionEffect="resize";h.displayInLayerSwitcher=false;b.push(h);}search_map=new olwidget.Map(a,b,{layers:e,overlayStyle:{defaultZoom:n,defaultLon:f,defaultLat:m},mapDivStyle:{width:"430px",height:"300px"},mapOptions:{controls:["LayerSwitcher","Navigation","PanZoom","Attribution"]}});search_map.setCenter((new OpenLayers.LonLat(f,m)).transform(new OpenLayers.Projection("EPSG:"+p),map.getProjectionObject()),n);}var search_map;function refresh_counties(){var c=document.getElementsByName("subregion");var a="";for(var b=0;b<c.length;b++){if(c[b].checked){a+="|"+c[b].value;}}$.getJSON("/search/getcounties/",{"subregions":a},function(e){var d="";for(var f=0;f<e.length;f++){d+='<option value="'+e[f].optionValue+'">'+e[f].optionDisplay+"</option>";}$("select#id_county").html(d);});}function refresh_map_withoutzoom(){var b=document.getElementsByName("subregion");for(var a=0;a<b.length;a++){var c=search_map.getLayersByName($.trim(b[a].nextSibling.nodeValue));if(c.length==1){c[0].setVisibility(b[a].checked);}}}function refresh_map_andzoom(){var c=document.getElementsByName("subregion");var e=new OpenLayers.Bounds();var a=0;for(var b=0;b<c.length;b++){var d=search_map.getLayersByName($.trim(c[b].nextSibling.nodeValue));if(d.length==1){d[0].setVisibility(c[b].checked);if(c[b].checked){a+=1;e.extend(d[0].getDataExtent());}}}if(a>0){search_map.zoomToExtent(e);}}function refresh_map(){refresh_map_andzoom();}function refresh_checkboxes(){var b=document.getElementsByName("subregion");for(var a=0;a<b.length;a++){if(b[a].checked){document.getElementById("td_"+b[a].id).style.backgroundColor=b[a].className;}else{document.getElementById("td_"+b[a].id).style.backgroundColor="";}}}
