
// Filenames for the image rotator on the home page

	var xRotatorImagesOriginal = [ 
		'AdultPunchingPad.jpg' ,
		'BatBreaking.jpg' ,
		'BeachTrainingInWater.jpg' ,
		'BeachTrainingOnLand.jpg' ,
		'JeanetteBreak.jpg' ,
		'KagamiBirakiVSit.jpg' ,
		'KokoroKidsAtPark.jpg' ,
		'LittleKicks.jpg' ,
		'MaribelDoingKataOnKnees.jpg' ,
		'MarieYoungSDStudent.jpg' ,
		'MastersKataWMedals.jpg' ,
		'MaxGasshoASK.jpg' ,
		'OutreachKidsInStreetClothes.jpg' ,
		'PeacemakingDemo.jpg' ,
		'RebeccaPalmHeel.jpg' ,
		'TargetPadPractice2.jpg' ,
		'YouthTeenAtStreetFair.jpg'  
	];
	
	var xRotatorImages = [ 
		'Akinwande1.jpg' ,
		'Annie.jpg' ,
		'GigiWai.jpg' ,
		'Groupkicks2.jpg' ,
		'KatabySahra.jpg' ,
		'Kate.jpg' ,
		'KatherineNichols.jpg' ,
		'Kiai.jpg' ,
		'maliachess.jpg' ,
		'Meditation.jpg' ,
		'NLandSLmedonbeach.jpg' ,
		'Raphaelkick.jpg' ,
		'SamB.jpg' ,
		'SC09KidsRun.jpg' ,
		'SCTristonBreaks.jpg' ,
		'SD1.jpg' ,
		'ShihanNancy.jpg' ,
		'TeenSDPalmHeel.jpg' ,
		'Yesica.jpg' ,
		'ZoeN.jpg' 
	];
	
	function SetRotatorImage() {
		var xRotator = document.getElementById('RotatorImage');
		xRotator.src = 'images/HomeRotator/' + xRotatorImages[Math.floor(Math.random()*(xRotatorImages.length))]
	}


// Hilight the current page in the left-hand blue menu

	function MenuHilight() {
		var sPath = window.location.pathname;
		var sPage = 'Menu' + sPath.substring(sPath.lastIndexOf('/') + 1);
		sPage = sPage.replace('#', '');
		sPage = sPage.replace('.htm', '');
		if (document.getElementById(sPage) != null) {
			document.getElementById(sPage).style.color = '#FFFFFF';
		}
	}



// Show an event detail for the new Calendar of Events page (2010)

	function getDocHeight() {
		var D = document;
		return Math.max(
			Math.max(D.body.scrollHeight, D.documentElement.scrollHeight),
			Math.max(D.body.offsetHeight, D.documentElement.offsetHeight),
			Math.max(D.body.clientHeight, D.documentElement.clientHeight)
		);
	}

	function ShowDetail(pID) {
		
		document.getElementById('DialogContents').innerHTML = document.getElementById(pID).innerHTML;
	
		// Set up the blue background
		var xVideoBlue = document.getElementById('DialogBlue');
		xVideoBlue.style.height = getDocHeight().toString() + 'px';
		xVideoBlue.style.visibility = 'visible';
		
		// Center the video player window
		var xVideoWindow = document.getElementById('DialogWindow');
		xVideoWindow.style.left = ((document.documentElement.clientWidth - 485) / 2).toString() + 'px';
		xVideoWindow.style.top = (document.documentElement.scrollTop + 60).toString() + 'px';
		
		// Show the video player window
		xVideoWindow.style.visibility = 'visible';
	}

	function CloseDialog() {
		document.getElementById('DialogContents').innerHTML = '';
		document.getElementById('DialogWindow').style.visibility = 'hidden';
		document.getElementById('DialogBlue').style.visibility = 'hidden';
	}


// Set up the monthly menus for the Calendar of Events Page

	// show the selected month
	var xSelectedID = '';
	function ShowMonth(pID) {
		if (xSelectedID.length >= 1) {
			document.getElementById(xSelectedID).style.display = 'none';
		}
		document.getElementById(pID).style.display = 'block';
		xSelectedID = pID;
	}

	// write the right-hand menu of calendar months
	function CalendarMonths() {
		var xMonths = document.getElementById('Calendar').getElementsByTagName("TABLE");
		var xCurrentYear = '0';
		for (var i = 0;  i < xMonths.length; i++) {
			var xID = xMonths[i].id;
			var xYear = xID.substr(xID.length - 4, 4);
			var xMonth = xID.substr(0, xID.length - 4);
			if (xYear != xCurrentYear) {
				document.writeln('<p class="Heading1">' + xYear + '</p>');
				document.writeln('<hr />');
				xCurrentYear = xYear
			}
			document.write('<p><a href="javascript:ShowMonth(\'' + xID + '\')">' + xMonth + '</a></p>');
		}
		var m_names = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
		var d = new Date();
		ShowMonth(m_names[d.getMonth()] + d.getFullYear());
	}

	//