function initializeMap(I){try{OpenLayers.IMAGE_RELOAD_ATTEMPTS=2;OpenLayers.Util.onImageLoadErrorColor="transparent";var E=new OpenLayers.Size(300,300);var C=1;layerSwitcher=new OpenLayers.Control.LayerSwitcher();navControl=new OpenLayers.Control.Navigation();navControl.zoomWheelEnabled=false;zoomControl=new OpenLayers.Control.ZoomBox();navHistory=new OpenLayers.Control.NavigationHistory();navHistoryPanel=new OpenLayers.Control.Panel({div:document.getElementById("navHistoryPanel")});navHistoryPanel.addControls([navHistory.next,navHistory.previous]);var O=new OpenLayers.Bounds(-179,-89,179,89);O=O.transform(new OpenLayers.Projection("EPSG:4326"),new OpenLayers.Projection("EPSG:900913"));var N=[navControl,zoomControl,layerSwitcher,new OpenLayers.Control.PanZoomBar(),new OpenLayers.Control.MousePosition({displayProjection:new OpenLayers.Projection("EPSG:4326")}),new OpenLayers.Control.Scale(),new OpenLayers.Control.ScaleLine()];if(I=="print"){N=[navControl,new OpenLayers.Control.ScaleLine()];}var Q={controls:N,projection:new OpenLayers.Projection("EPSG:900913"),displayProjection:new OpenLayers.Projection("EPSG:4326"),units:"m",numZoomLevels:18,maxResolution:156543.0339,maxExtent:O};currentProjection=new OpenLayers.Projection("EPSG:900913");map=new OpenLayers.Map("map",Q);toggleControl("pan");var G=["http://terraservice.net/ogcmap.ashx?SERVICE=WMS&REQUEST=GetMap&VERSION=1.1.1&format=jpeg&SRS=EPSG:4326&styles=&"];var D=new OpenLayers.Layer.WMS("USGS Topo",G,{layers:"DRG"},{isBaseLayer:true,projection:"EPSG:4326",units:"degrees",maxResolution:1.40625,maxExtent:new OpenLayers.Bounds(-180,-90,180,90)});nexrad_weather=new OpenLayers.Layer.WMS("Precipitation","http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi?",{layers:"nexrad-n0r-m05m",transparent:"true",bgcolor:"0xFFFFFF",format:"image/png"},{opacity:0.65});var B=new OpenLayers.Layer.Google("Google Hybrid",{type:G_HYBRID_MAP,sphericalMercator:true});var L=new OpenLayers.Layer.Google("Google Terrain",{type:G_PHYSICAL_MAP,numZoomLevels:16,sphericalMercator:true});var A=new OpenLayers.Layer.Google("Google Streets",{type:G_NORMAL_MAP,sphericalMercator:true});var H=new OpenLayers.Layer.WMS("NOAA Charts","http://wms.alaskamapped.org/cgi-bin/charts.cgi?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&TRANSPARENT=false&BGCOLOR=0xFFFFFF&FORMAT=image%2Fjpeg&LAYERS=noaa_chart_1000,noaa_chart_485,noaa_chart_350,noaa_chart_210,noaa_chart_155,noaa_chart_150,noaa_chart_140,noaa_chart_120,noaa_chart_110,noaa_chart_100,noaa_chart_95,noaa_chart_85,noaa_chart_80,noaa_chart_70,noaa_chart_50,noaa_chart_40,noaa_chart_35,noaa_chart_30,noaa_chart_20,noaa_chart_15,noaa_chart_10,noaa_chart_5,noaa_chart_1,noaa_chart_0",{isBaseLayer:true});var K=new OpenLayers.Layer.OSM.Mapnik("OpenStreetMap",{displayOutsideMaxExtent:true,wrapDateLine:true});D.setVisibility(false);nexrad_weather.setVisibility(false);map.addLayers([L,B,A,D,K,nexrad_weather]);var F=[];F.push("Google Terrain");F.push("Google Hybrid");F.push("Google Streets");F.push("USGS Topo");if(add_navigation!=null&&add_navigation==true){map.addLayer(H);F.push("NOAA Charts");}graphicsLayer=new OpenLayers.Layer.Vector("Graphics Layer",{styleMap:MARKUP_FEATURE_STYLEMAP});graphicsLayer.displayInLayerSwitcher=false;map.addLayer(graphicsLayer);markersLayer=new OpenLayers.Layer.Markers("Markers Layer");markersLayer.displayInLayerSwitcher=false;map.addLayer(markersLayer);addEditTools();hotspot_markers=new OpenLayers.Layer.Markers("Hotspots");photo_markers=new OpenLayers.Layer.Markers("Photos");if(I!="wizard"){hotspot_markers.setVisibility(false);photo_markers.setVisibility(false);usgs_markers=new OpenLayers.Layer.Markers("USGS Water Data");usgs_markers.setVisibility(false);map.addLayer(usgs_markers);noaa_markers=new OpenLayers.Layer.Markers("NOAA Water Stations");map.addLayer(noaa_markers);location_markers=new OpenLayers.Layer.Markers("Fish Locations");map.addLayer(location_markers);trip_markers=new OpenLayers.Layer.Markers("User Trips");map.addLayer(trip_markers);other_markers=new OpenLayers.Layer.Markers("Amenities");other_markers.setVisibility(false);map.addLayer(other_markers);pano_markers=new OpenLayers.Layer.Markers("Panoramio");pano_markers.setVisibility(false);map.addLayer(pano_markers);}map.addLayer(hotspot_markers);map.addLayer(photo_markers);map.zoomToExtent(O);map.events.register("changebaselayer",map,updateCurrentProjection);map.events.register("moveend",map,updateCurrentExtent);map.events.register("changebaselayer",map,resizeGoogleMap);var M=reprojectObject(new OpenLayers.LonLat(-82,50));hover_popup=new OpenLayers.Popup("hoverPopup",M,new OpenLayers.Size(125,25),"Fish Finder Hover",false);hover_popup.setBorder("1px solid #737373");hover_popup.autoSize=false;hover_popup.minSize=new OpenLayers.Size(110,20);hover_popup.maxSize=new OpenLayers.Size(125,75);hover_popup.setOpacity(0.75);hover_popup.hide();map.addPopup(hover_popup);var P=reprojectObject(new OpenLayers.LonLat(-82,50));map_popup=new OpenLayers.Popup.FramedCloud("mapPopup",P,new OpenLayers.Size(225,160),"Fish Finder Popup",photo_icon,true);map_popup.maxSize=new OpenLayers.Size(550,650);map_popup.minSize=new OpenLayers.Size(250,175);map_popup.autoSize=true;map_popup.setBorder("2px solid #737373");map_popup.hide();map.addPopup(map_popup);tmp_location_marker=new OpenLayers.Marker(new OpenLayers.LonLat(0,0),location_icon.clone());tmp_location_marker.map=map;tmp_location_marker.setOpacity(0.6);tmp_other_marker=new OpenLayers.Marker(new OpenLayers.LonLat(0,0),bait_icon.clone());tmp_other_marker.map=map;tmp_other_marker.setOpacity(0.6);tmp_hot_marker=new OpenLayers.Marker(new OpenLayers.LonLat(0,0),hotspot_icon.clone());tmp_hot_marker.map=map;tmp_hot_marker.setOpacity(0.6);tmp_photo_marker=new OpenLayers.Marker(new OpenLayers.LonLat(0,0),photo_icon.clone());tmp_photo_marker.map=map;tmp_photo_marker.setOpacity(0.6);map.events.register("mousemove",map,function(R){if(startDrag==true){markerToMove.lonlat=map.getLonLatFromPixel(new OpenLayers.Pixel(R.xy.x,R.xy.y-5));if(dragType=="hotspot"){hotspot_markers.drawMarker(markerToMove);}else{photo_markers.drawMarker(markerToMove);}}else{mapMouseX=R.xy.x;mapMouseY=R.xy.y;if(freeze==false){if(currentIcon=="pointicon"){tmp_hot_marker.lonlat=map.getLonLatFromPixel(new OpenLayers.Pixel(R.xy.x,R.xy.y-5));hotspot_markers.drawMarker(tmp_hot_marker);}if(currentIcon=="photoicon"){tmp_photo_marker.lonlat=map.getLonLatFromPixel(new OpenLayers.Pixel(R.xy.x,R.xy.y-5));photo_markers.drawMarker(tmp_photo_marker);}if(currentIcon=="locationicon"){if(tmp_location_marker.icon==null){tmp_location_marker=new OpenLayers.Marker(map.getLonLatFromPixel(new OpenLayers.Pixel(R.xy.x,R.xy.y-5)),location_icon.clone());tmp_location_marker.map=map;tmp_location_marker.setOpacity(0.6);}else{tmp_location_marker.lonlat=map.getLonLatFromPixel(new OpenLayers.Pixel(R.xy.x,R.xy.y-5));}location_markers.drawMarker(tmp_location_marker);}if(currentIcon=="amenityicon"){if(tmp_other_marker.icon==null){tmp_other_marker=new OpenLayers.Marker(map.getLonLatFromPixel(new OpenLayers.Pixel(R.xy.x,R.xy.y-5)),bait_icon.clone());tmp_other_marker.map=map;tmp_other_marker.setOpacity(0.6);}else{tmp_other_marker.lonlat=map.getLonLatFromPixel(new OpenLayers.Pixel(R.xy.x,R.xy.y-5));}other_markers.drawMarker(tmp_other_marker);}}}});map.events.register("mouseup",map,function(R){if(startDrag==true){startDrag=false;markerToMove.lonlat=map.getLonLatFromPixel(new OpenLayers.Pixel(R.xy.x,R.xy.y+5));if(dragType=="hotspot"){hotspot_markers.drawMarker(markerToMove);}else{photo_markers.drawMarker(markerToMove);}map_popup.setSize(new OpenLayers.Size(150,90));map_popup.lonlat=new OpenLayers.LonLat(markerToMove.lonlat.lon,markerToMove.lonlat.lat);map_popup.updatePosition();map_popup.setContentHTML('<table border="0" height="75" cellpadding="1" cellspacing="1"><tr><td class="smallFont"><center>Move marker here?</td></tr><tr><td class="smallFont"><center><a href="javascript:saveMove();" title="Move Marker Here"><b>Yes</b></a>&nbsp;&nbsp;&nbsp;<a href="javascript:moveBack();" title="Cancel Move"><b>No</b></a></center></td></tr></table>');map_popup.show();}});postInitMap();}catch(J){}}function destroyMap(){try{map.destroy();}catch(A){}}function setMapExtent(){if(initialextent_minx==initialextent_maxx&&initialextent_miny==initialextent_maxy){var B=new OpenLayers.LonLat(initialextent_minx,initialextent_miny);B=reprojectObject(B);map.setCenter(B,zoom_scale,false,true);}else{if(zoom_to_extent==true){var D=new OpenLayers.Bounds(initialextent_minx,initialextent_miny,initialextent_maxx,initialextent_maxy);D=reprojectObject(D);map.zoomToExtent(D);if(map.getZoom()>zoom_scale){map.zoomTo(zoom_scale);}else{map.zoomTo(map.getZoom()-1);}}else{var C=((initialextent_maxx-initialextent_minx)/2)+initialextent_minx;var A=((initialextent_miny-initialextent_maxy)/2)+initialextent_maxy;var B=new OpenLayers.LonLat(C,A);map.setCenter(B,initial_zoom,false,true);var D=new OpenLayers.Bounds(initialextent_minx,initialextent_miny,initialextent_maxx,initialextent_maxy);D=reprojectObject(D);map.zoomToExtent(D);}}}function maximizeLayerSwitcher(){layerSwitcher.maximizeControl();}function minimizeLayerSwitcher(){layerSwitcher.minimizeControl();}function addEditTools(){editLayer=new OpenLayers.Layer.Vector("Edit Layer",{styleMap:MODIFY_FEATURE_STYLEMAP});editLayer.onFeatureInsert=promptUser;editLayer.displayInLayerSwitcher=false;map.addLayer(editLayer);var A={handlerOptions:{freehand:false}};drawControls={point:new OpenLayers.Control.DrawFeature(editLayer,OpenLayers.Handler.Point),line:new OpenLayers.Control.DrawFeature(editLayer,OpenLayers.Handler.Path,A),polygon:new OpenLayers.Control.DrawFeature(editLayer,OpenLayers.Handler.Polygon,A),photo:new OpenLayers.Control.DrawFeature(editLayer,OpenLayers.Handler.Point),location:new OpenLayers.Control.DrawFeature(editLayer,OpenLayers.Handler.Point),amenity:new OpenLayers.Control.DrawFeature(editLayer,OpenLayers.Handler.Point)};for(var B in drawControls){map.addControl(drawControls[B]);}}function toggleControl(A){if(A=="point"||A=="photo"||A=="location"||A=="amenity"){if(map.getZoom()<11){alert("You must be zoomed in closer to add data. Please use the slider bar or Zoom In tool to find your area of interest.\r\nDid you know you can also zoom in any time by holding down the SHIFT key while dragging your mouse? It's a quick and easy way to zoom in on the map.");return ;}}for(key in drawControls){var B=drawControls[key];if(A==key){navControl.activate();zoomControl.deactivate();B.activate();map.div.className="olCursorEditingDefault";}else{B.deactivate();}}switch(A){case"pan":navControl.activate();zoomControl.deactivate();map.div.className="olCursorDragDefault";setActiveToolText("Navigate Map");break;case"zoomin":zoomControl.activate();navControl.deactivate();setActiveToolText("Zoom In");break;case"point":if(tmp_hot_marker!=null){hotspot_markers.addMarker(tmp_hot_marker);}setActiveToolText("Add Hotspot");freeze=false;break;case"photo":if(tmp_photo_marker!=null){photo_markers.addMarker(tmp_photo_marker);}setActiveToolText("Add Photo");freeze=false;break;case"location":location_markers.setVisibility(true);if(tmp_location_marker!=null){location_markers.addMarker(tmp_location_marker);}setActiveToolText("Add Location");freeze=false;break;case"amenity":other_markers.setVisibility(true);if(tmp_other_marker!=null){other_markers.addMarker(tmp_other_marker);}setActiveToolText("Add Amenity");freeze=false;break;case"drag":navControl.activate();zoomControl.deactivate();map.div.className="olCursorDragDefault";isDragging=true;setActiveToolText("Move Marker");break;default:break;}if(A!="drag"){isDragging=false;}if(A!="point"&&hotspot_markers){if(tmp_hot_marker!=null&&tmp_hot_marker.lon!=0&&tmp_hot_marker.lat!=0){tmp_hot_marker.lonlat=new OpenLayers.LonLat(0,0);hotspot_markers.drawMarker(tmp_hot_marker);hotspot_markers.removeMarker(tmp_hot_marker);}}if(A!="photo"&&photo_markers){if(tmp_photo_marker!=null&&tmp_photo_marker.lon!=0&&tmp_photo_marker.lat!=0){tmp_photo_marker.lonlat=new OpenLayers.LonLat(0,0);photo_markers.drawMarker(tmp_photo_marker);photo_markers.removeMarker(tmp_photo_marker);}}if(A!="location"&&location_markers){if(tmp_location_marker!=null&&tmp_location_marker.lon!=0&&tmp_location_marker.lat!=0){tmp_location_marker.lonlat=new OpenLayers.LonLat(0,0);location_markers.drawMarker(tmp_location_marker);location_markers.removeMarker(tmp_location_marker);}}if(A!="amenity"&&other_markers){if(tmp_other_marker!=null&&tmp_other_marker.lon!=0&&tmp_other_marker.lat!=0){tmp_other_marker.lonlat=new OpenLayers.LonLat(0,0);other_markers.drawMarker(tmp_other_marker);other_markers.removeMarker(tmp_other_marker);}}if(A+"icon"!=currentIcon){document.getElementById(currentIcon).src=document.getElementById(currentIcon).src.replace("_on.png","_off.png");document.getElementById(A+"icon").src=document.getElementById(A+"icon").src.replace("_off.png","_on.png");}currentIcon=A+"icon";}function promptUser(B){var C;if(B.geometry){C=B.geometry.clone();C=reprojectObject(C,map.getProjection(),"EPSG:4326");}switch(currentIcon){case"pointicon":freeze=true;tmp_hot_marker.moveTo(new OpenLayers.Pixel(tmp_hot_marker.icon.px.x,tmp_hot_marker.icon.px.y+5));var A="add_hotspot.php?x="+C.x+"&y="+C.y+"&tripid="+tripid;popURL=A;popWidth=600;popHeight=500;popTitle="Add Hotspot";setTimeout("delayedPopup()",500);currentFeature=B;clearGraphics();break;case"photoicon":freeze=true;tmp_photo_marker.moveTo(new OpenLayers.Pixel(tmp_photo_marker.icon.px.x,tmp_photo_marker.icon.px.y+5));var A="add_photo.php?x="+C.x+"&y="+C.y+"&tripid="+tripid;popURL=A;popWidth=600;popHeight=500;popTitle="Add Photos";setTimeout("delayedPopup()",500);currentFeature=B;clearGraphics();break;case"locationicon":freeze=true;tmp_location_marker.moveTo(new OpenLayers.Pixel(tmp_location_marker.icon.px.x,tmp_location_marker.icon.px.y+5));var A="add_location.php?x="+C.x+"&y="+C.y;popURL=A;popWidth=600;popHeight=500;popTitle="Add Location";setTimeout("delayedPopup()",500);currentFeature=B;clearGraphics();break;case"amenityicon":freeze=true;tmp_other_marker.moveTo(new OpenLayers.Pixel(tmp_other_marker.icon.px.x,tmp_other_marker.icon.px.y+5));var A="add_other_location.php?x="+C.x+"&y="+C.y;popURL=A;popWidth=600;popHeight=500;popTitle="Add Amenity";setTimeout("delayedPopup()",500);currentFeature=B;clearGraphics();break;default:break;}}function setActiveToolText(A){if(document.getElementById("activeTool")!=null){document.getElementById("activeTool").innerHTML=A;}}function delayedPopup(){showPopUpDiv(popURL,popWidth,popHeight,popTitle);}function clearGraphics(){editLayer.removeFeatures(currentFeature);}function resetMarkers(){if(tmp_hot_marker!=null&&tmp_hot_marker.lon!=0&&tmp_hot_marker.lat!=0){tmp_hot_marker.lonlat=new OpenLayers.LonLat(0,0);hotspot_markers.drawMarker(tmp_hot_marker);hotspot_markers.removeMarker(tmp_hot_marker);}if(tmp_photo_marker!=null&&tmp_photo_marker.lon!=0&&tmp_photo_marker.lat!=0){tmp_photo_marker.lonlat=new OpenLayers.LonLat(0,0);photo_markers.drawMarker(tmp_photo_marker);photo_markers.removeMarker(tmp_photo_marker);}if(tmp_location_marker!=null&&tmp_location_marker.lon!=0&&tmp_location_marker.lat!=0){tmp_location_marker.lonlat=new OpenLayers.LonLat(0,0);location_markers.drawMarker(tmp_location_marker);location_markers.removeMarker(tmp_location_marker);}if(tmp_other_marker!=null&&tmp_other_marker.lon!=0&&tmp_other_marker.lat!=0){tmp_other_marker.lonlat=new OpenLayers.LonLat(0,0);other_markers.drawMarker(tmp_other_marker);other_markers.removeMarker(tmp_other_marker);}}function serialize(B){B.attributes={};var A=prompt("Title for feature?");B.attributes.title=A;s=new XMLSerializer();var C=g.write(B.layer.features);$("gml").value=s.serializeToString(C);alert($("gml").value);}function addTemporaryMarker(D,C,A,H,B){var E;if(B=="hotspot"){E=hotspot_icon.clone();}else{if(B=="photo"){E=photo_icon.clone();}}var G=new OpenLayers.Marker(reprojectObject(new OpenLayers.LonLat(C,A)),E);iconXArr[iconIndx]=C;iconYArr[iconIndx]=A;var F=iconIndx;G.events.register("mousedown",G,function(I){map_popup.setSize(new OpenLayers.Size(205,195));map_popup.lonlat=new OpenLayers.LonLat(G.lonlat.lon,G.lonlat.lat);map_popup.updatePosition();map_popup.setContentHTML(D);if(isDragging==true){startDrag=true;map_popup.hide();G.lonlat=map.getLonLatFromPixel(new OpenLayers.Pixel(mapMouseX,mapMouseY-5));if(B=="hotspot"){hotspot_markers.drawMarker(G);}else{if(B=="photo"){photo_markers.drawMarker(G);}}markerToMove=G;dragId=H;dragType=B;selIconIndx=F;}else{map_popup.show();}selectedMarker=G;Event.stop(I);});iconIndx++;map_popup.setSize(new OpenLayers.Size(205,195));map_popup.lonlat=reprojectObject(new OpenLayers.LonLat(C,A));map_popup.updatePosition();map_popup.setContentHTML(D);map_popup.show();selectedMarker=G;G.icon.imageDiv.style.cursor="pointer";if(B=="hotspot"){hotspot_markers.addMarker(G);}else{if(B=="photo"){photo_markers.addMarker(G);}else{if(B=="location"){location_markers.addMarker(G);}else{if(B=="amenity"){other_markers.addMarker(G);}}}}}function removeSelectedMarker(A){map_popup.hide();if(A=="hotspot"){hotspot_markers.removeMarker(selectedMarker);}else{if(A=="photo"){photo_markers.removeMarker(selectedMarker);}else{if(A=="trip"){trip_markers.removeMarker(selectedMarker);}else{if(A=="location"){location_markers.removeMarker(selectedMarker);}else{if(A=="amenity"){other_markers.removeMarker(selectedMarker);}}}}}}function zoomToXY(B,A,C){var D=new OpenLayers.LonLat(B,A);if(C){D=reprojectObject(D);}map.setCenter(D,13,false,true);}function addStar(B,A,C,D){var E=new OpenLayers.LonLat(B,A);if(C){E=reprojectObject(E);}var F=new OpenLayers.Marker(E,star_icon.clone());F.icon.imageDiv.style.cursor="pointer";markersLayer.clearMarkers(true);markersLayer.addMarker(F);F.events.register("mousedown",F,function(G){map_popup.lonlat=new OpenLayers.LonLat(F.lonlat.lon,F.lonlat.lat);map_popup.updatePosition();map_popup.setContentHTML('<center><table border="0" height="75" cellpadding="1" cellspacing="1"><tr><td colspan="2" class="smallerFont"><b>'+D+"<br>"+B+", "+A+"</b></td></tr></table></center>");map_popup.show();Event.stop(G);});}function reprojectObject(A,C,B){if(C!=null&&B!=null){A=A.transform(new OpenLayers.Projection(C),new OpenLayers.Projection(B));}else{if(currentProjection!=null&&currentProjection.projCode!="EPSG:4326"){A=A.transform(new OpenLayers.Projection("EPSG:4326"),currentProjection);}}return A;}function updateCurrentExtent(A){if(currentProjection.equals(map.getProjectionObject())){currentExtent=map.getExtent();}}function updateCurrentProjection(E){if(map.projection.projCode!=map.baseLayer.projection.projCode){try{map.projection=map.baseLayer.projection;map.maxResolution=map.baseLayer.maxResolution;var C=currentExtent.clone();var D=new OpenLayers.Projection(map.baseLayer.projection.toString());currentExtent.transform(currentProjection,D);}catch(E){}}currentProjection=map.getProjectionObject();var A=new OpenLayers.Projection("EPSG:4326");if(currentProjection.projCode!="EPSG:900913"){A=currentProjection;}map.displayProjection=A;for(var B=0;B<map.controls.length;B++){if(map.controls[B].displayProjection!=null){map.controls[B].displayProjection=A;}}zoomToExtent(currentExtent);}function zoomToExtent(B,C){var A=B.getCenterLonLat();if(C==null){C=map.getZoomForExtent(B);}C=parseInt(C);map.setCenter(A,C);}function resizeGoogleMap(){try{if(map.baseLayer.mapObject){map.baseLayer.onMapResize();map.setCenter(map.getCenter(),map.getZoom()+1);}else{if(map.baseLayer instanceof OpenLayers.Layer.OSM.CycleMap||map.baseLayer instanceof OpenLayers.Layer.OSM.Mapnik){map.setCenter(map.getCenter(),map.getZoom()+1);}}}catch(A){}}function setBaseLayerByName(A){if(map.baseLayer.name.toUpperCase()!=A.toUpperCase()){var C=map.layers;for(var B=0;B<C.length;B++){if(C[B].name.toUpperCase()==A.toUpperCase()){map.setBaseLayer(C[B]);break;}}}}function locPop(K,D,C,I,B,J,F,L,H,E,G){map_popup.lonlat=new OpenLayers.LonLat(D,C);map_popup.updatePosition();var A='<center><table border="0" width="250" cellpadding="1" cellspacing="1"><tr><td colspan="2" class="smallerFont"><b>'+I+"</b></td></tr>";if(H!=null&&H=="true"){A+='<tr><td colspan="2"><center><img src="'+E+'" width="200" height="150" border="0" class="allBorder"></center></td></tr>';}if(G!=null&&G!=""){A+='<tr><td class="smallerFont" colspan="2">'+G+"</td></tr>";}A+='<tr><td class="smallerFont" valign="top"><b>Acreage:</b></td><td class="smallerFont">'+B+'</td></tr><tr><td class="smallerFont" valign="top"><b>County:</b></td><td class="smallerFont">'+J+'</td></tr><tr><td class="smallerFont" valign="top"><b>Species:</b></td><td class="smallerFont">'+F+"</td></tr>";A+='<tr><td class="smallerFont" colspan="2"><center><a href="/view_location.php?locationid='+L+'" title="View More Details"><b>View&nbsp;Details</b></a>&nbsp;&nbsp;<a href="/edit_location_details.php?locationid='+L+'" title="Edit Location"><b>Edit&nbsp;Location</b></a>&nbsp;&nbsp;<img src="images/zoomin.gif" border="0" style="cursor:pointer" onclick="zoomToXY('+D+","+C+');" title="Zoom In"></center></td></tr></table></center>';map_popup.setContentHTML(A);map_popup.show();Event.stop(K);}function USGSPop(C,B,A,E,D){map_popup.lonlat=new OpenLayers.LonLat(B,A);map_popup.updatePosition();map_popup.setContentHTML('<center><table border="0" height="90" cellpadding="1" cellspacing="1"><tr><td colspan="2" class="smallerFont"><b>'+E+'</b></td></tr><tr><td class="smallerFont"><center><a href="javascript:showPopUpDiv(\'load_usgs_water.php?siteid='+D+"&sitetitle="+E+'\',700,550,\'USGS Data\');" title="More Details"><b>View Real Time USGS<br>Streamflow Data</b></a></td><td><img src="images/zoomin.gif" border="0" style="cursor:pointer" onclick="javascript:zoomToXY('+B+","+A+');" title="Zoom In"></td></tr></table></center>');map_popup.show();Event.stop(C);}function NOAAPop(C,B,A,F,E,D){map_popup.lonlat=new OpenLayers.LonLat(B,A);map_popup.updatePosition();map_popup.setContentHTML('<center><table border="0" height="170" cellpadding="1" cellspacing="1"><tr><td colspan="2" class="smallerFont"><b>'+F+'</b><br>Water Level Station</td></tr><tr><td><img src="'+E+'"  width="200" height="150" border="0"></td></tr><tr><td class="smallerFont"><center><a href="javascript:showPopUpDiv(\'load_noaa_water.php?siteid='+D+"&sitetitle="+F+"&siteimg="+E.replace("http://","")+'\',700,550,\'NOAA Tides\');" title="More Details"><b>View Real Time <br>NOAA Tide Data</b></a></td><td><img src="images/zoomin.gif" border="0" style="cursor:pointer" onclick="javascript:zoomToXY('+B+","+A+');" title="Zoom In"></td></tr></table></center>');map_popup.show();Event.stop(C);}function tripPop(M,D,C,I,E,G,B,L,O,H,F){map_popup.lonlat=new OpenLayers.LonLat(D,C);map_popup.updatePosition();var A='<center><table border="0" width="250" cellpadding="1" cellspacing="1"><tr><td colspan="2" class="smallerFont"><b>'+I+'</b><br> by <a href="view_profile.php?u='+E+'" title="View '+E+"'s Profile\">"+E+"</a></td></tr>";if(H!=null&&H=="true"){A+='<tr><td colspan="2"><center><img src="'+F+'"  width="200" height="150" border="0" class="allBorder"></center></td></tr>';}if(B!=""&&B!="-"&&B!=0){B=Math.round(B*10)/10;A+='<tr><td class="smallerFont" valign="top">Avg. Rating:</td><td class="smallerFont" valign="top">';var N=0;var K=0;var N=Math.floor(B);if(B>N){K=1;}var J=5-(N+K);A+='<table border="0" cellpadding="0" cellspacing="0"><tr>';for(var P=0;P<N;P++){A+='<td><img src="images/full_star_small.gif"></td>';}for(var P=0;P<K;P++){A+='<td><img src="images/half_star_small.gif"></td>';}for(var P=0;P<J;P++){A+='<td><img src="images/no_star_small.gif"></td>';}A+="<td>&nbsp;"+B+"</td></tr></table></td></tr>";}A+='<tr><td class="smallerFont"># of Reviews:</td><td class="smallerFont">'+G+'</td></tr><tr><td class="smallerFont"># Views:</td><td class="smallerFont">'+L+"</td></tr>";A+='<tr><td class="smallerFont" colspan="2"><center><a href="/view_trip.php?trip_id='+O+'" title="View Trip Details"><b>View Trip Details...</b></a>&nbsp;&nbsp;<img src="images/zoomin.gif" border="0" style="cursor:pointer" onclick="zoomToXY('+D+","+C+');" title="Zoom To This Trip Area"></center></td></tr></table></center>';map_popup.setContentHTML(A);map_popup.show();Event.stop(M);}function otherPop(C,B,A,G,E,D,F){map_popup.lonlat=new OpenLayers.LonLat(B,A);map_popup.updatePosition();map_popup.setContentHTML('<center><table border="0" height="110" cellpadding="1" cellspacing="1"><tr><td colspan="2" class="smallerFont"><b>'+E+'</b></td></tr><tr><td colspan="2" class="smallerFont">'+D+'</td></tr><tr><td class="smallerFont"><center><a href="javascript:showPopUpDiv(\'view_other_pop.php?id='+G+'\',700,550,\'Amenity Details\');" title="More Details"><b>View Details</a></td><td class="smallerFont"><a href="#" onclick="showPopUpDiv(\'edit_other_details_pop.php?id='+G+'\',600,550,\'Edit Details\');return false;" title="Edit Amenity"><b>Edit Amenity</b></a></td><td><img src="images/zoomin.gif" border="0" style="cursor:pointer" onclick="javascript:zoomToXY('+B+","+A+');" title="Zoom In"></td></tr></table></center>');map_popup.show();Event.stop(C);}function panoPop(D,C,B,H,G,F,A,E){map_popup.lonlat=new OpenLayers.LonLat(C,B);map_popup.updatePosition();map_popup.setContentHTML('<center><table border="0" height="200" cellpadding="1" cellspacing="1"><tr><td colspan="2" class="smallerFont"><b>'+H+'</b></td></tr><tr><td colspan="2"><center><a href="'+F+'" target="_pano"><img src="'+G+'" border="0" width="200" height="150"></a></td></tr><tr><td class="smallerFont"><center>Author: <a href="'+E+'" target="_pano"><b>'+A+'</b></a> from <a href="http://www.panoramio.com" target="_pano">Panoramio.com</a></td><td><img src="images/zoomin.gif" border="0" style="cursor:pointer" onclick="javascript:zoomToXY('+C+","+B+');" title="Zoom In"></td></tr></table></center>');map_popup.show();Event.stop(D);}function hotPop(K,D,C,E,F,B,I,J,G,M,H,L){map_popup.lonlat=new OpenLayers.LonLat(D,C);map_popup.updatePosition();var A='<center><table border="0" height="185" cellpadding="1" cellspacing="1"><tr><td colspan="2" class="smallerFont"><b>'+E+'</b><br> by <a href="view_profile.php?u='+F+'" title="View '+F+"'s Profile\">"+F+"</a></td></tr>";if(I!=null&&I=="true"){A+='<tr><td colspan="2"><center><img src="'+J+'" width="200" height="150" border="0" class="allBorder"></center></td></tr>';}A+='<tr><td class="smallerFont"># Fish Caught:</td><td class="smallerFont">'+B+'</td></tr><tr><td class="smallerFont">Fish Type:</td><td class="smallerFont">'+G+'</td></tr><tr><td class="smallerFont">Water:</td><td class="smallerFont">'+M+'</td></tr><tr><td class="smallerFont">Bait Type:</td><td class="smallerFont">'+H+"</td></tr>";A+='<tr><td class="smallerFont" colspan="2"><center><a href="#" onclick="showPopUpDiv(\'view_hotspot.php?hotspotid='+L+'\',600,550,\'Hotspot Details\');return false;" title="More Details"><b>More Details...</b></a>&nbsp;&nbsp;<img src="images/zoomin.gif" border="0" style="cursor:pointer" onclick="javascript:zoomToXY('+D+","+C+');" title="Zoom In"></center></td></tr></table></center>';map_popup.setContentHTML(A);map_popup.show();Event.stop(K);}function photoPop(C,B,A,F,D,H,E,G){map_popup.lonlat=new OpenLayers.LonLat(B,A);map_popup.updatePosition();map_popup.setContentHTML('<center><table border="0" height="185" cellpadding="1" cellspacing="1"><tr><td colspan="2" class="smallerFont"><b>'+F+'</b><br> by <a href="view_profile.php?u='+D+'" title="View '+D+"'s Profile\">"+D+'</a></td></tr><tr><td class="smallerFont"><center><img src="'+H+'"  width="200" height="150" border="0" class="allBorder"><br><br>'+E+' photo(s) in group</td></tr><tr><td class="smallerFont" colspan="2"><center><a href="#" onclick="showPopUpDiv(\'view_photo.php?photo_group_id='+G+'\',600,550,\'View Photos\');return false;" title="View Photo(s)"><b>View Photo(s)</b></a>&nbsp;&nbsp;<img src="images/zoomin.gif" border="0" style="cursor:pointer" onclick="javascript:zoomToXY('+B+","+A+');" title="Zoom In"></center></td></tr></table></center>');map_popup.show();Event.stop(C);}function updateListCnt(F,D,G,B,A,C){switch(F){case"trip":var E='<table border="0" cellpadding="0" cellspacing="0" width="160"><tr><td width="30"><img src="'+trip_icon_src+'" border="0"></td><td width="130"><font class="smallerFont"> <b>User Trips:</b></td></tr><tr><td colspan="2"><center><font class="smallerFont">';if(A==0){document.getElementById("tripListCnt").innerHTML=E+"0 Trips in View</center></font></td></tr></table>";}else{if((G+1)>1){E+='<a href="#" onclick="nextTrips('+map_extent.left+","+map_extent.bottom+","+map_extent.right+","+map_extent.top+","+(G-B)+","+B+",'"+C+"',true);return false;\"><b>&lt;&lt;</b></a> ";}E+=(G+1)+"-"+(G+D)+" of "+A;if((G+1+D)<A){E+=' <a href="#" onclick="nextTrips('+map_extent.left+","+map_extent.bottom+","+map_extent.right+","+map_extent.top+","+(G+B)+","+B+",'"+C+"',true);return false;\"><b>&gt;&gt;</b></a>";}E+="</center></font></td></tr></table>";document.getElementById("tripListCnt").innerHTML=E;}break;case"location":var E='<table border="0" cellpadding="0" cellspacing="0" width="160"><tr><td width="30"><img src="'+location_icon_src+'" border="0"></td><td width="130"><font class="smallerFont"> <b>Fishing Locations:</b></td></tr><tr><td colspan="2"><center><font class="smallerFont">';if(A==0){document.getElementById("locListCnt").innerHTML=E+"0 Locations in View</center></font></td></tr></table>";}else{if((G+1)>1){E+='<a href="#" onclick="nextLocations('+map_extent.left+","+map_extent.bottom+","+map_extent.right+","+map_extent.top+","+(G-B)+","+B+",'"+C+"',true);return false;\"><b>&lt;&lt;</b></a> ";}E+=(G+1)+"-"+(G+D)+" of "+A;if((G+1+D)<A){E+=' <a href="#" onclick="nextLocations('+map_extent.left+","+map_extent.bottom+","+map_extent.right+","+map_extent.top+","+(G+B)+","+B+",'"+C+"',true);return false;\"><b>&gt;&gt;</b></a>";}E+="</center></font></td></tr></table>";document.getElementById("locListCnt").innerHTML=E;}break;}resizeReadingPane();}function clearList(C){var B=document.getElementById(C);if(B){for(var A=B.getElementsByTagName("li").length-1;A>=0;A--){B.getElementsByTagName("li")[A].parentNode.removeChild(B.getElementsByTagName("li")[A]);B.getElementsByTagName("li")[A]=null;}}}function updateList(E,A,B,C){var D=document.createElement("li");D.marker=A;D.ondblclick=function(){zoomToXY(this.marker.lonlat.lon,this.marker.lonlat.lat);};D.onclick=function(){this.marker.events.triggerEvent("mousedown");};D.onmouseover=function(){this.marker.events.triggerEvent("mouseover");};D.onmouseout=function(){this.marker.events.triggerEvent("mouseout");};document.getElementById(E).appendChild(D);D.innerHTML='<a href="#" onclick="javascript:return false;"><table cellpadding="0" cellspacing="0" width="180" style="cursor:pointer;"><tr><td width="30"><img src="'+C+'" border="0"></td><td>'+B+"</td></tr></table></a>";}function initLM(K,D,B,I,A,J,F,E,H,G){var L=reprojectObject(new OpenLayers.LonLat(D,B));var C=new OpenLayers.Marker(L,location_icon.clone());C.name=I;C.events.register("mousedown",C,function(M){var N=false;isfiring=true;setTimeout("resetFiring()",3000);if(map!=null&&map.zoom>11){N=collisionDetection(C);}if(N==false){locPop(M,C.lonlat.lon,C.lonlat.lat,I,A,J,F,K,E,H,G);}});C.icon.imageDiv.style.cursor="pointer";location_markers.addMarker(C);C.events.register("mouseover",C,function(M){self.status=I;iconHoverOn(M,this.lonlat.lon,this.lonlat.lat,I);var N=this.icon.size;N=new OpenLayers.Size(N.w+3,N.h+3);this.icon.setSize(N);});C.events.register("mouseout",C,function(M){self.status="";iconHoverOff(M);this.icon.setSize(location_size);});if(location_markers.getVisibility()==true){updateList("locList",C,I,location_icon_src);}}function initUM(C,B,A,F){var E=reprojectObject(new OpenLayers.LonLat(B,A));var D=new OpenLayers.Marker(E,usgs_icon.clone());D.events.register("mousedown",D,function(G){isfiring=true;setTimeout("resetFiring()",3000);USGSPop(G,D.lonlat.lon,D.lonlat.lat,F,C);});D.icon.imageDiv.style.cursor="pointer";usgs_markers.addMarker(D);D.events.register("mouseover",D,function(G){self.status=F;iconHoverOn(G,this.lonlat.lon,this.lonlat.lat,F);var H=this.icon.size;H=new OpenLayers.Size(H.w+3,H.h+3);this.icon.setSize(H);});D.events.register("mouseout",D,function(G){self.status="";iconHoverOff(G);this.icon.setSize(usgs_size);});if(usgs_markers.getVisibility()==true){updateList("usgsList",D,F,usgs_icon_src);}}function initTM(K,D,B,I,F,G,A,J,E,H){var L=reprojectObject(new OpenLayers.LonLat(D,B));var C=new OpenLayers.Marker(L,trip_icon.clone());C.events.register("mousedown",C,function(M){isfiring=true;setTimeout("resetFiring()",3000);selectedMarker=C;var N=false;if(map!=null&&map.zoom>11){N=collisionDetection(C);}if(N==false){tripPop(M,C.lonlat.lon,C.lonlat.lat,I,F,G,A,J,K,E,H);}});C.icon.imageDiv.style.cursor="pointer";trip_markers.addMarker(C);C.events.register("mouseover",C,function(M){self.status=I;iconHoverOn(M,this.lonlat.lon,this.lonlat.lat,I+" by <b>"+F+"</b>");var N=this.icon.size;N=new OpenLayers.Size(N.w+3,N.h+3);this.icon.setSize(N);Event.stop(M);});C.events.register("mouseout",C,function(M){self.status="";iconHoverOff(M);this.icon.setSize(trip_size);Event.stop(M);});if(trip_markers.getVisibility()==true){updateList("tripList",C,I+"<br>By <b>"+F+"</b>",trip_icon_src);}}function initOM(H,C,A,G,F,D){var E=null;switch(D){case"BAIT":E=bait_icon.clone();break;case"BOAT":E=boat_icon.clone();break;case"CAMP":E=camp_icon.clone();break;case"PARK":E=park_icon.clone();break;case"FOOD":E=food_icon.clone();break;default:E=bait_icon.clone();break;}var I=reprojectObject(new OpenLayers.LonLat(C,A));var B=new OpenLayers.Marker(I,E);B.events.register("mousedown",B,function(J){isfiring=true;setTimeout("resetFiring()",3000);selectedMarker=B;var K=false;if(map!=null&&map.zoom>11){K=collisionDetection(B);}if(K==false){otherPop(J,B.lonlat.lon,B.lonlat.lat,H,G,F,D);}});B.icon.imageDiv.style.cursor="pointer";other_markers.addMarker(B);B.events.register("mouseover",B,function(J){self.status=G;iconHoverOn(J,this.lonlat.lon,this.lonlat.lat,G);var K=this.icon.size;K=new OpenLayers.Size(K.w+3,K.h+3);this.icon.setSize(K);});B.events.register("mouseout",B,function(J){self.status="";iconHoverOff(J);this.icon.setSize(bait_size);});if(other_markers.getVisibility()==true){updateList("otherList",B,G,E.url);}}function initPano(I,C,A,D,F,E,G,H){var J=reprojectObject(new OpenLayers.LonLat(C,A));var B=new OpenLayers.Marker(J,pano_icon.clone());B.events.register("mousedown",B,function(K){isfiring=true;setTimeout("resetFiring()",3000);selectedMarker=B;panoPop(K,B.lonlat.lon,B.lonlat.lat,D,F,E,G,H);});B.icon.imageDiv.style.cursor="pointer";pano_markers.addMarker(B);B.events.register("mouseover",B,function(K){self.status=D;iconHoverOn(K,this.lonlat.lon,this.lonlat.lat,D);var L=this.icon.size;L=new OpenLayers.Size(L.w+3,L.h+3);this.icon.setSize(L);});B.events.register("mouseout",B,function(K){self.status="";iconHoverOff(K);this.icon.setSize(pano_size);});if(pano_markers.getVisibility()==true){updateList("panoList",B,D,pano_icon_src);}}function initHM(L,D,B,J,E,A,H,I,F,K,G){var M=reprojectObject(new OpenLayers.LonLat(D,B));var C=new OpenLayers.Marker(M,hotspot_icon.clone());C.events.register("mousedown",C,function(N){isfiring=true;setTimeout("resetFiring()",3000);selectedMarker=C;var O=false;if(map!=null&&map.zoom>11){O=collisionDetection(C);}if(O==false){hotPop(N,C.lonlat.lon,C.lonlat.lat,J,E,A,H,I,F,K,G,L);}});C.icon.imageDiv.style.cursor="pointer";hotspot_markers.addMarker(C);C.events.register("mouseover",C,function(N){self.status=J;iconHoverOn(N,this.lonlat.lon,this.lonlat.lat,J+" by <b>"+E+"</b>");var O=this.icon.size;O=new OpenLayers.Size(O.w+3,O.h+3);this.icon.setSize(O);});C.events.register("mouseout",C,function(N){self.status="";iconHoverOff(N);this.icon.setSize(hotspot_size);});if(hotspot_markers.getVisibility()==true){}}function initPM(H,C,A,F,D,E,G){var I=reprojectObject(new OpenLayers.LonLat(C,A));var B=new OpenLayers.Marker(I,photo_icon.clone());B.events.register("mousedown",B,function(J){isfiring=true;setTimeout("resetFiring()",3000);selectedMarker=B;var K=false;if(map!=null&&map.zoom>11){K=collisionDetection(B);}if(K==false){photoPop(J,B.lonlat.lon,B.lonlat.lat,F,D,E,G,H);}});B.icon.imageDiv.style.cursor="pointer";photo_markers.addMarker(B);B.events.register("mouseover",B,function(J){self.status=F;iconHoverOn(J,this.lonlat.lon,this.lonlat.lat,F+" by <b>"+D+"</b>");var K=this.icon.size;K=new OpenLayers.Size(K.w+3,K.h+3);this.icon.setSize(K);});B.events.register("mouseout",B,function(J){self.status="";iconHoverOff(J);this.icon.setSize(photo_size);});if(photo_markers.getVisibility()==true){}}function iconHoverOn(C,B,A,F){var E=new OpenLayers.LonLat(B,A);var D=map.getLayerPxFromLonLat(E);D.x=D.x+7;D.y=D.y+4;if(D){hover_popup.moveTo(D);}if(F.length>40){hover_popup.setSize(new OpenLayers.Size(125,55));}else{if(F.length>20){hover_popup.setSize(new OpenLayers.Size(125,40));}else{hover_popup.setSize(new OpenLayers.Size(125,25));}}hover_popup.setContentHTML('<span style="font-size:10px;">'+F+"</span>");hover_popup.show();Event.stop(C);}function iconHoverOff(A){hover_popup.setContentHTML("");hover_popup.hide();Event.stop(A);}var markersMoved=false;var markersPx=new Array();var markersArr=new Array();function collisionDetection(J){var D=J.icon.px.x;var A=J.icon.px.y;var O=false;var B=0;var H=25+Math.floor(Math.random()*21);var S=35+Math.floor(Math.random()*11);var M=0;var V=25;var C=null;var L=null;var K=new OpenLayers.LonLat(J.lonlat.lon,J.lonlat.lat);if(markersMoved){if(markersArr!=null){for(var T=0;T<markersArr.length;T++){if(markersArr[T]==J){return false;}}}restoreMarkers();}if(map.layers!=null){for(var X=0;X<map.layers.length;X++){C=map.layers[X];if(C!=null&&C.visibility==true&&typeof C.addMarker=="function"){for(var T=0;T<C.markers.length;T++){var N=C.markers[T];if(N.icon!=null&&N.icon.px!=null){var P=N.icon.px.clone();var E=new OpenLayers.Pixel(P.x,P.y);var G=new OpenLayers.LonLat(N.lonlat.lon,N.lonlat.lat);if((P.x<=D+V&&P.x>=D-V)&&(P.y<=A+V&&P.y>=A-V)){if(M==0){P.x=P.x+H;P.y=P.y-S;M=1;}else{if(M==1){P.x=P.x+H;P.y=P.y+S;M=2;}else{if(M==2){P.x=P.x-H;P.y=P.y+S;M=3;}else{if(M==3){P.x=P.x-H;P.y=P.y-S;M=0;H=H+15+Math.floor(Math.random()*16);S=S+15+Math.floor(Math.random()*16);}}}}markersPx[B]=E;markersArr[B]=N;B++;if(N!=J){if(N.icon!=null&&N.map!=null){N.moveTo(P);O=true;markersMoved=true;var R=[];var I=new OpenLayers.Geometry.Point(K.lon,K.lat);var F=new OpenLayers.Geometry.Point(N.lonlat.lon,N.lonlat.lat);R.push(I);R.push(F);var W=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString(R),null,null);graphicsLayer.addFeatures([W]);}}else{L=new OpenLayers.Pixel(P.x,P.y);}}}}if(L!=null&&O==true&&markersMoved==true){if(J.icon!=null&&J.map!=null){J.moveTo(L);var R=[];var I=new OpenLayers.Geometry.Point(K.lon,K.lat);var F=new OpenLayers.Geometry.Point(J.lonlat.lon,J.lonlat.lat);R.push(I);R.push(F);var W=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString(R),null,null);graphicsLayer.addFeatures([W]);for(var X=0;X<map.layers.length;X++){C=map.layers[X];if(C!=null&&C.visibility==true&&typeof C.addMarker=="function"){for(var T=0;T<C.markers.length;T++){var N=C.markers[T];if(N.icon!=null&&N.icon.px!=null){var U=false;for(var Q=0;Q<markersArr.length;Q++){if(N==markersArr[Q]){U=true;N.icon.imageDiv.style.zIndex=10000;break;}}if(U==false){N.icon.setOpacity(0.25);}}}}}}}}}}return O;}function restoreMarkers(){if(markersMoved==true){if(markersArr!=null&&map!=null){for(var C=0;C<markersArr.length;C++){if(markersArr[C].icon!=null){var B=new OpenLayers.Pixel(markersPx[C].x,markersPx[C].y);markersArr[C].moveTo(B);}}for(var A=0;A<map.layers.length;A++){thelayer=map.layers[A];if(thelayer!=null&&thelayer.visibility==true&&typeof thelayer.addMarker=="function"){for(var C=0;C<thelayer.markers.length;C++){var D=thelayer.markers[C];D.icon.setOpacity(1);}}}graphicsLayer.destroyFeatures();}}markersArr=null;markersPx=null;markersArr=[];markersPx=[];markersMoved=false;}function resizeMap(){try{document.getElementById("mapContainer").style.height=getWindowHeight()-189+"px";document.getElementById("map").style.height=getWindowHeight()-210+"px";resizeReadingPane();}catch(A){}}function resizeReadingPane(){var A=getWindowHeight()-200;if(document.getElementById("mapReadingPaneCnt")&&document.getElementById("mapReadingPaneCnt").offsetHeight!=null){A-=document.getElementById("mapReadingPaneCnt").offsetHeight;}document.getElementById("mapReadingPane").style.height=A+"px";}function recenterMap(E,D){if(E>map.getSize().w||D>map.getSize().h){var A=E-map.getSize().w;var C=D-map.getSize().h;var B=map.getPixelFromLonLat(map.getCenter());if(A>0){B.x=B.x+A;}if(C>0){B.y=B.y+C;}map.setCenter(map.getLonLatFromPixel(B),map.zoom);}}function MapResize(){if(MAP_FULL_MODE==true){if(map==null){return ;}var A=0;var B=0;if(typeof (window.innerWidth)=="number"){A=window.innerWidth;B=window.innerHeight;}else{if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){A=document.documentElement.clientWidth;B=document.documentElement.clientHeight;}else{if(document.body&&(document.body.clientWidth||document.body.clientHeight)){A=document.body.clientWidth;B=document.body.clientHeight;}}}document.getElementById("mapContainer").style.width=A-1+"px";document.getElementById("mapContainer").style.height=B-21+"px";document.getElementById("map").style.width=A-1+"px";document.getElementById("map").style.height=B-21+"px";}else{resizeMap();}}function ToggleScreenMode(){if(MAP_FULL_MODE==false){document.getElementById("screenModeText").innerHTML=" Normal Mode";GoFullScreen();}else{document.getElementById("screenModeText").innerHTML=" Fullscreen Mode";GoNormal();}}function GoFullScreen(){MAP_FULL_MODE=true;scroll(0,0);MAP_NORMAL_WIDTH=document.getElementById("map").style.width;document.getElementById("headerDiv").style.display="none";document.getElementById("headerMenuDiv").style.display="none";document.getElementById("normalMode_3").style.display="none";document.getElementById("loclistbox").style.display="none";document.getElementById("mapContainer").style.position="absolute";document.getElementById("mapContainer").style.top="0px";document.getElementById("mapContainer").style.left="0px";document.getElementById("map").style.position="absolute";document.getElementById("map").style.top="20px";document.getElementById("map").style.left="0px";document.getElementById("quickNavMenu").style.top="35px";document.getElementById("quickNavMenu").style.left="60px";MapResize();}function GoNormal(){MAP_FULL_MODE=false;document.getElementById("headerDiv").style.display="block";document.getElementById("headerMenuDiv").style.display="block";document.getElementById("normalMode_3").style.display="block";document.getElementById("loclistbox").style.display="block";document.getElementById("map").style.top="0px";document.getElementById("mapContainer").style.position="relative";document.getElementById("map").style.position="relative";document.getElementById("mapContainer").style.width=MAP_NORMAL_WIDTH;document.getElementById("map").style.width=MAP_NORMAL_WIDTH;MapResize();}function confirmKML(){document.getElementById("confirmKML").style.display="block";}function closeConfirmKML(){document.getElementById("confirmKML").style.display="none";}function toggleLegendVisibility(A){switch(A){case"precipitation":nexrad_weather.setVisibility(!nexrad_weather.getVisibility());break;case"locations":location_markers.setVisibility(!location_markers.getVisibility());if(location_markers.getVisibility()==false){clearList("locList");}break;case"trips":trip_markers.setVisibility(!trip_markers.getVisibility());if(trip_markers.getVisibility()==false){clearList("tripList");}break;case"hotspots":hotspot_markers.setVisibility(!hotspot_markers.getVisibility());break;case"photos":photo_markers.setVisibility(!photo_markers.getVisibility());break;case"other":other_markers.setVisibility(!other_markers.getVisibility());if(other_markers.getVisibility()==false){clearList("otherList");}break;case"usgs":usgs_markers.setVisibility(!usgs_markers.getVisibility());if(usgs_markers.getVisibility()==false){clearList("usgsList");}break;case"noaa":noaa_markers.setVisibility(!noaa_markers.getVisibility());break;case"pano":pano_markers.setVisibility(!pano_markers.getVisibility());if(pano_markers.getVisibility()==false){clearList("panoList");}break;}}function checkLegend(A){document.getElementById("precipitationCheck").src="images/checkbox_"+nexrad_weather.getVisibility()+".gif";document.getElementById("locationsCheck").src="images/checkbox_"+location_markers.getVisibility()+".gif";document.getElementById("tripsCheck").src="images/checkbox_"+trip_markers.getVisibility()+".gif";document.getElementById("hotspotsCheck").src="images/checkbox_"+hotspot_markers.getVisibility()+".gif";document.getElementById("photosCheck").src="images/checkbox_"+photo_markers.getVisibility()+".gif";document.getElementById("otherCheck").src="images/checkbox_"+other_markers.getVisibility()+".gif";document.getElementById("usgsCheck").src="images/checkbox_"+usgs_markers.getVisibility()+".gif";document.getElementById("noaaCheck").src="images/checkbox_"+noaa_markers.getVisibility()+".gif";document.getElementById("panoCheck").src="images/checkbox_"+pano_markers.getVisibility()+".gif";if(A!=null){OpenLayers.Event.stop(A);}}function checkBaseMapSelect(A){}