function load(){
/*
if ( typeof GBrowserIsCompatible == 'undefined' ) {
      var browser=navigator.appName;
      var b_version=navigator.appVersion;
      var version=parseFloat(b_version);
      if ((browser=="Microsoft Internet Explorer") && (version>=4))  {  }     
}*/
}

$(document).ready(function(){
         if (GBrowserIsCompatible()) {
	          	map = new GMap2(document.getElementById("map"));			
                        map.addControl(new GMapTypeControl());
			map.addControl(new GLargeMapControl());
			map.setCenter(new GLatLng(39.63954,-96.85547), 4);//51.72703,-113.90625),3);
			map.enableScrollWheelZoom(); 
            var mt = map.getMapTypes();
			for (var i=0; i < mt.length; i++) {mt[i].getMaximumResolution = function(){ return 11;}}
	  	    
			tooltip = document.createElement("div");
			document.getElementById("map").appendChild(tooltip);
			tooltip.style.visibility="hidden";			
			loadState();			
			
 			GEvent.addListener(map, "zoomend", function(oldLevel, newLevel){preLevel = oldLevel; curLevel = map.getZoom(); });		
			GEvent.addListener(map, "moveend", function() {updateMarkers();});
			GEvent.addListener(map, "click", function(ol) {	 if(map.getZoom() > cutLevel ){ if(ol ==null){ removeExpand(hideMarker);}}});
			GEvent.addListener(map, "click", function() { closeFilters('all');});
			GEvent.addListener(map, "mouseout", function() {  if(map.getZoom() <= cutLevel )  removeHighightSt();});
	        map.addControl(new GOverviewMapControl(new GSize(175,155)));
	        var jump_bt_html=placePNG();
			var control=new HtmlControl(jump_bt_html);
			map.addControl(control, new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(78,5)));
	        
		}
		else {
			document.write('<table width="500" cellpadding="10" bgcolor="#CCCCCC" id="noCSS"><tr><td align="center"><br/><font size="+1"><strong>Google Maps may not be compatible with your browser.</strong></font></td></tr><tr><td align="center"><a href="iframe_data.jsp?deptCode='+deptCode+(deptFilter?'&deptFilter=true':'')+'"><font size="+1">Please click here to view the text version of the map data.</font></a><br/><br/></td></tr></table>');
		}   
 }); 
 

function zoomto_close(){
		closeFilters('zoomto');
}

function placePNG(){
	if (browserIE()) {
		var loader1 = "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/bt_jumpto_ext.png', sizingMethod='scale');";
		var loader2 = "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/bt_jumpto_ext_dn.png', sizingMethod='scale');";
		return '<div class="htmlControl" id="bt_zoomto" style="height:22px; width:134px; ' +loader1+ '" alt="Go to other geographic locations which have received ARRA funding." title="Go to other geographic locations which have received ARRA funding." onclick="zoomToMenu();"></div><div class="htmlControl" id="btDis_zoomto" style="height:22px; width:134px; display: none; ' +loader2+ '" alt="Jump to other geographic locations which have received ARRA funding." alt="Go to other geographic locations which have received ARRA funding." title="Go to other geographic locations which have received ARRA funding."  onclick="zoomto_close(); zoomToLocation();"></div>';
		
	} else {
		return '<img class="htmlControl" id="bt_zoomto" src="images/bt_jumpto_ext.png" alt="Go to other geographic locations which have received ARRA funding." title="Go to other geographic locations which have received ARRA funding." onclick="zoomToMenu();" width="134" height="22"/><img class="htmlControl" id="btDis_zoomto" src="images/bt_jumpto_ext_dn.png" style="display: none;" onclick="zoomto_close(); zoomToLocation();" alt="Go to other geographic locations which have received ARRA funding." title="Go to other geographic locations which have received ARRA funding." width="134" height="22"/>';
	}
}	

  