    function loadMap( longitude, latitude) 
    {
      if (GBrowserIsCompatible() ) 
      {
        var map = new GMap2(document.getElementById("inlinemap"));

		map.addMapType(G_PHYSICAL_MAP);
		map.removeMapType(G_HYBRID_MAP);
		
 		var control = new GMapTypeControl();
		map.addControl(control);
		map.addControl(new GScaleControl());
		map.addControl(new GOverviewMapControl());
 		map.addControl(new GLargeMapControl());
		
		var l1 = latitude * 1.0;
		var l2 = longitude * 1.0;
		
        map.setCenter(new GLatLng(l2, l1), 12);
        var point = new GLatLng(l2, l1);
        
        var marker = new GMarker(point);
        map.addOverlay(marker);
		
		//marker.openInfoWindowHtml("<? echo $site->name." ".$site->getSiteType();?>");

		
		}
    }

	
	function showMap( longitude, latitude)
	{
		document.getElementById('inlinemapinstructions').style.display='none';
		document.getElementById('inlinemap').style.display='block';
		
		loadMap( longitude, latitude);
	}		
			
	function hideMap()
	{
		$("#inlinemap1").slideUp(500);
		$("#inlinemapinstructions").show();
	}
			
	function showMap2( id, distance )
	{
		$("#inlinemapinstructions").hide();
		$("#inlinemap2").slideDown(500);
		$("#inlinemap1").slideDown(500);
		
		loadMap2( id, distance );
	}
			
	var liveMapReq = false;
	
	if (window.XMLHttpRequest) 
	{
		liveMapReq = new XMLHttpRequest();
	}
	
	function loadMap2( id, distance )
	{
		var urlstr;
		if( distance != 10 )
			urlstr="/inline_gmap.php?site_id="+id+"&distance="+distance;
		else
		{
			urlstr="/inline_gmap10.php?site_id="+id+"&amp;distance=10";
		
		}
//		urlstr="/index.php";
		if (liveMapReq && liveMapReq.readyState < 4) 
		{
			liveMapReq.abort();
		}
		if (window.XMLHttpRequest) 
		{
			liveMapReq = new XMLHttpRequest();
		} else if (window.ActiveXObject) 
		{
			liveMapReq = new ActiveXObject("Microsoft.XMLHTTP");
		}
		
		liveMapReq.onreadystatechange = liveReqResponse;
			liveMapReq.open('GET', urlstr , true);
			liveMapReq.send(null);
	}

	function liveReqResponse()
	{
		if (liveMapReq.readyState == 4) 
		{
			document.getElementById('inlinemap2').innerHTML = liveMapReq.responseText;
		}
	}
	
	function setParentUrl( url )
	{
		parent.document.location = url;
	}