/**
* Assign the view handler
*/

viewHandler = WhatWeDo;

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

	var _instance = this;
	this.animationReferences = { count: 1 };
	this.timeouts = {
		1: null,
		2: null,
		3: null
		}


	// 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);

		// Add animation to page elements
		this.initFooterAnimation();
		}

	
	/**
	* Adds animation to footer logos
	*/
	this.initFooterAnimation = function()
		{
		// Add animation to footer logos

		// Get the element
		var element = document.getElementById('whatLogos');
		YAHOO.util.Dom.setStyle(element, 'opacity', 0);
		element.style.visibility = 'visible';

		// Add an unique reference id to the element
		element.setAttribute('animationId', 'id' + this.animationReferences.count++);

		// Add event handler for mouse over
		element.onmouseover = function()
			{
			// Try to stop any existing animation on this object
			try { xhtml.animationReferences[this.getAttribute('animationId')].stop(false); } catch (err) {}

			// Animate the image
			xhtml.animationReferences[this.getAttribute('animationId')] = new YAHOO.util.Anim(this, {opacity: { to: 1 }}, 0.5, YAHOO.util.Easing.easeBoth );
			xhtml.animationReferences[this.getAttribute('animationId')].animate();
			}

		// Add event handler for mouse out
		element.onmouseout = function()
			{
			// Try to stop any existing animation on this object
			try { xhtml.animationReferences[this.getAttribute('animationId')].stop(false); } catch (err) {}

			// Animate the image
			xhtml.animationReferences[this.getAttribute('animationId')] = new YAHOO.util.Anim(this, {opacity: { to: 0 }}, 1.25, YAHOO.util.Easing.easeBoth );
			xhtml.animationReferences[this.getAttribute('animationId')].animate();
			}
		}

	}

