// JavaScript Document
	
	//Set an ID to collect data against for callback
	var fadeHandlerID = 0;
	var viewHandlerID = 0;
	
	// Set to fully viewable
	var currentOpacity = 10;

	// To change the opacity of a layer
	function setOpacity(item_name, direction, value) {
		
		// Make the CSS change
		document.getElementById(item_name).style.opacity = value/10;
		document.getElementById(item_name).style.filter = 'alpha(opacity=' + value*10 + ')';
		
		// Is it fade out?
		if(direction == 'out') {
			// If we are fading out
			if(value == 0) {
				// Ckear the interval
				clearTimeout(fadeHandlerID);
				
				// Now its invisible, swap the layer content over with the new content
				document.getElementById(item_name).innerHTML = document.getElementById('buffer_load').innerHTML;
				
				// Now tell it to bring it in to focus
				viewTimer(item_name);
			}
			else {
				// Set the opacity back -1
				currentOpacity = value-1;
				
				// Send the opacity down
				setTimeout("setOpacity('"+ item_name +"','out','"+ currentOpacity +"');",150);
			}
		}//END fade out
		
		// Fade in version
		if(direction == 'in') {
			// If we are fading in
			if(value == 10) {
				// Ckear the interval
				clearTimeout(viewHandlerID);
				
				// Set to fully viewable
				currentOpacity = 10;
				
				// Start the timeout to fade it out again
				fadeTimer(item_name);
			}
			else {
				// Set the opacity back -1
				currentOpacity = (value*1)+1;
				
				// Send the opacity down
				setTimeout("setOpacity('"+ item_name +"','in','"+ currentOpacity +"');",100);
			}
		}//END fade in
		
	}
	
	// Starts the fading of a layer
	function fadeTimer(layer) {
		// Run this to start us off
		var fadeHandlerID = setTimeout("setOpacity('"+ layer +"','out','"+ currentOpacity +"');",6000);
		
		// Get the page ID
		var pageID = document.getElementById('my_page_id').value;
		
		// Load the next content layer into a temp box
		loadContent(pageID,currentContentID);
	}
	
	//Starts the visibility of a layer
	function viewTimer(layer) {

		// Run this to start us off
		var viewHandlerID = setTimeout("setOpacity('"+ layer +"','in','"+ currentOpacity +"');",0);
	}
