//GO1.1


///////////////////////////////////////
//
//  Generic onload by Brothercake
//  http://www.brothercake.com/
//
///////////////////////////////////////



//onload function
function generic()
{
	//PS customised this function to center map and add popup marker
	var map = new GMap2(document.getElementById("map"));
	map.setCenter(new GLatLng(-33.865, 151.226), 14);	

	var marker = new GMarker(new GLatLng(-33.861, 151.228));
	GEvent.addListener(marker, "click", function() {
		marker.openInfoWindowHtml("<img src='http://www.metoc.gov.au/new_dom/images/gi-buildthumb.jpg' /><br />Bld 89/90, Garden Island.");
	});
	
	map.addOverlay(marker);

}



//setup onload function
if(typeof window.addEventListener != 'undefined')
{
	//.. gecko, safari, konqueror and standard
	window.addEventListener('load', generic, false);
}
else if(typeof document.addEventListener != 'undefined')
{
	//.. opera 7
	document.addEventListener('load', generic, false);
}
else if(typeof window.attachEvent != 'undefined')
{
	//.. win/ie
	window.attachEvent('onload', generic);
}

//** remove this condition to degrade older browsers
else
{
	//.. mac/ie5 and anything else that gets this far
	
	//if there's an existing onload function
	if(typeof window.onload == 'function')
	{
		//store it
		var existing = onload;
		
		//add new onload handler
		window.onload = function()
		{
			//call existing onload function
			existing();
			
			//call generic onload function
			generic();
		};
	}
	else
	{
		//setup onload function
		window.onload = generic;
	}
}

