 function initialize() 
    {
      if (GBrowserIsCompatible()) 
      {
        var map = new GMap2(document.getElementById("map"));
        map.addControl(new GLargeMapControl());
        map.addControl(new GMapTypeControl());

        // Create a base icon for all of our markers that specifies the
        // shadow, icon dimensions, etc.
        var baseIcon = new GIcon();
        baseIcon.iconSize = new GSize(34, 34);
        baseIcon.iconAnchor = new GPoint(9, 34);
        baseIcon.infoWindowAnchor = new GPoint(9, 2);
        baseIcon.infoShadowAnchor = new GPoint(18, 25);

        // Creates a marker whose info window displays the letter corresponding
        // to the given index.
        function createMarker(point) 
        {
            // Create a lettered icon for this point using our icon class
            var letteredIcon = new GIcon(baseIcon);
            letteredIcon.image = "/png/marker.png";

            // Set up our GMarkerOptions object
            markerOptions = { icon:letteredIcon };
            
            var marker = new GMarker(point, markerOptions);

            GEvent.addListener(marker, "click", function() 
            {
                window.location = "#" + name;
            });
            
            return marker;
        }
    
        // add marker
        map.setCenter(new GLatLng(0,0));
        var point = new GLatLng(42.278499, -83.741939);map.addOverlay(createMarker(point));        
        map.setCenter(point, 13);
      }
    }
	
function changePage(pageName,objectID) {
	object = document.getElementById('map');
	if (pageName != 'pages/main.htm') {
		object.style.display='none';
	}
	else {
		object.style.display='block';
	}
 fetchData(pageName,null,objectID); 
}

function filterData(pageRequest,objectID){
	if (pageRequest.readyState == 4 && (pageRequest.status==200 || window.location.href.indexOf("http")==-1))
		document.getElementById(objectID).innerHTML=pageRequest.responseText
}

function fetchData(url,dataRequested,objectID){
	if (dataRequested) var dataRequest = "dataRequest="+ dataRequested;
	var pageRequest = false
	if (window.XMLHttpRequest) {
		pageRequest = new XMLHttpRequest()
	}
	else if (window.ActiveXObject){ 
		try {
			pageRequest = new ActiveXObject("Msxml2.XMLHTTP")
		} 
		catch (e) {
			try{
				pageRequest = new ActiveXObject("Microsoft.XMLHTTP")
			}
			catch (e){}
		}
	}
	else return false
	pageRequest.onreadystatechange=function() {
		filterData(pageRequest,objectID)
	}
		if (dataRequested) {		
			pageRequest.open('POST', url, true);
  	  pageRequest.setRequestHeader('Content-Type', '');
    	pageRequest.send(dataRequest);
		}
		else {
			pageRequest.open('GET', url, true)
			pageRequest.send(null)	
		}
	return(null);
}