/**
* Assign the view handler
*/

viewHandler = Home;

/**
* Creates a new object with methods used by the Home page
*
* @author				Matt Gifford
* @copyright			2008 Timeshifting Interactive Limited
*/
function Home()
	{
	// Step 1. Define Properties

	var _instance = this;

	var _featuredImages = 3;
	var _currentImage = 1;



	// Step 2. Define Public Methods

	/**
	* Sets up the initial page state and event handlers
	*/
	this.init = function()
		{
		// Call generic page init method
		this.base.init.call(this);

		// Start the featured image rotation
		setTimeout("xhtml.rotateFeaturedImage();", 5000);
		}
	

	/**
	* Rotates the featured image
	*/
	this.rotateFeaturedImage = function()
		{
		// Move to the next image
		_currentImage++;
		if (_featuredImages < _currentImage)
			{
			_currentImage = 1;
			}
		
		// Hide the images
		for (var x = 1; x <= _featuredImages; x++)
			{
			document.getElementById('homeFeatured' + x).className = 'hidden';
			}

		// Show the current image
		document.getElementById('homeFeatured' + _currentImage).className = '';

		// Set timeout for next change
		setTimeout("xhtml.rotateFeaturedImage();", 5000);
		}
	}
