function prepGoogleMaps(sDivID){
	var iLat = 51.894424;
	var iLong = -8.501079;
	var iZoom = 14;
	if (document.getElementById(sDivID) != null){
		// Load the map
		loadGoogleMaps(sDivID, iLat, iLong, iZoom);
		
		// Register the unload function	
		$(window).unload( function () { GUnload(); } );
	}
}

function loadGoogleMaps(sDivID, iLat, iLong, iZoom){
	if (GBrowserIsCompatible()) {
		var gMap = new GMap2(document.getElementById(sDivID));
		var icon = new GIcon();
		var sPointHTML = '<p>Mardyke Arena (UCC)<br />Mardyke Walk<br />Western Road<br />Cork<br />Ireland<br /><br /><strong>Tel:</strong> +353 (0)21 4904751<br /><strong>Fax:</strong> +353 (0)21 4904774<br /><strong>Email:</strong> <a title="Email the Mardyke Arena" href="mailto:mardykearena@ucc.ie">mardykearena@ucc.ie</a></p>';
		var marker;
		
		point = new GLatLng(iLat,iLong);
		marker = createMarker(point,sPointHTML);
		
		gMap.addControl(new GSmallMapControl());
		gMap.addControl(new GMapTypeControl());
		gMap.setCenter(new GLatLng(iLat, iLong), iZoom);
		gMap.addOverlay(marker);
	}
}

function createMarker(point,html){
	var oMarker = new GMarker(point);
	GEvent.addListener(oMarker, "click", function() {
	oMarker.openInfoWindowHtml(html);});
	return oMarker;
}

function hideElement(sElementID){
	var oElement = document.getElementById(sElementID);
	if (oElement != null){
		oElement.style.display = 'none';
	}
}
function showElement(sElementID){
	var oElement = document.getElementById(sElementID);
	if (oElement != null){
		oElement.style.display = '';
	}
}

function showHideExcessDaysCourses(iStartRow, bShow, bHide){
	var i;
	for (i=iStartRow;i<=99;i++){
		if (bShow){
			showElement('trThisDaysCoursesRow'+i);
		}else if (bHide){
			hideElement('trThisDaysCoursesRow'+i);
		}
	}
}
function showExcessDaysCourses(){
	showHideExcessDaysCourses(1, true, false);
	hideElement('dvThisDaysCoursesExcessNotification');
}
function hideExcessDaysCourses(){
	showHideExcessDaysCourses(5, false, true);
	showElement('dvThisDaysCoursesExcessNotification');
}
function setFontSizeSmall(){
	changeBodyFontSize('1');
}
function setFontSizeMedium(){
	changeBodyFontSize('1.25');
}
function setFontSizeLarge(){
	changeBodyFontSize('1.5');
}
function changeBodyFontSize(dNewEmSize){
	$('#dvBodyContent').css('font-size', dNewEmSize+'em');
	// Fix bug with IE6 where footer wouldnt sit in proper position after changing font size
	$('#dvTemplateFooter').css('clear', '');
	$('#dvTemplateFooter').css('clear', 'both');
}