<!--

//	Adapted from
//	Content-swapping using the DOM
//	Dave Shuck, www.daveshuck.com
//	19 October 2006

//	Further adapted with fades from
//	Andrew Johnson, http://www.itnewb.com/user/Andrew
//	17 May 2009
//	http://www.itnewb.com/v/Cross-Browser-CSS-Opacity-and-the-JavaScript-Fade-Fading-Effect

var swap = new Array()
swap[0] = "swap-1"
swap[1] = "swap-2"
swap[2] = "swap-3"
swap[3] = "swap-4"
swap[4] = "swap-5"
swap[5] = "swap-6"
swap[6] = "swap-7"
swap[7] = "swap-8"
swap[8] = "swap-9"
swap[9] = "swap-10"
swap[10] = "swap-11"
swap[11] = "swap-12"
swap[12] = "swap-13"
swap[13] = "swap-14"
swap[14] = "swap-15"

//	Define basic functions
function getElm(eID) {
	return document.getElementById(eID);
}
function show(eID) {
	getElm(eID).style.display='block';
}
function hide(eID) {
	getElm(eID).style.display='none';
}
function setObjectOpacity(eID, opacityLevel) {
	var elmStyle = getElm(eID).style;
	elmStyle.opacity = opacityLevel / 100;
	elmStyle.filter = 'progid:DXImageTransform.Microsoft.Alpha(Opacity='+opacityLevel+')';
	elmStyle.filter = 'alpha(opacity='+opacityLevel+')';
}
function fadeIn(eID) {
	setObjectOpacity(eID, 0); show(eID); var timer = 0;
	for (var i=1; i<=100; i++) {
		setTimeout("setObjectOpacity('"+eID+"',"+i+")", timer * 3);
		timer++;
	}
}
function fadeOut(eID) {
	var timer = 0;
	for (var i=100; i>=1; i--) {
		setTimeout("setObjectOpacity('"+eID+"',"+i+")", timer * 5);
		timer++;
	}
	setTimeout("hide('"+eID+"')", 310);
}
//	Set fixed variables
	var eID = "swap";
	var opacityLevel = "50";

//	Send any child objects back into the 'hold' div and fade into view
function writeContent(swap){
	//	Define the containers
	//	This is the display container
	var contentContainer = getElm(eID);
	fadeIn(eID);
	//	This is a repository for divs not currently in the display
	var contentHolding = getElm("hold");
	// Send any children objects currently in the display to the holding div
	while(contentContainer.firstChild) {
		contentHolding.appendChild(contentContainer.firstChild);
	}
	//	This is the active content
	var contentObject = getElm(swap);
	//	Put the active content in the display div
	contentContainer.appendChild(contentObject);
}

//	This function reloads the page in order to reset to the initial state
function reloadPage(){
	window.location.reload()
}
// -->
