/**
* BF Wol Class
* Wol (Window On Load) Class provides a way to load multiple  
* functions or object methods in the window.onload event.
*
* @author   Andy Burton <andyburton@bfinternet.co.uk>
* @link     http://www.bfinternet.co.uk
*
* @version  1.00
*
* Modifications:
* None
*
* Attributes:
* arrLoad		- Functions and methods to load
*
* Methods:
* constructor ()
* Add (mixed mixFunction)
* Load ()
*/



/*
* Constructor Function
*/


function Wol ()
{
	
	// Set Variables
	
	this.arrLoad	= new Array ();
	
}


/*
* Wol.Add Function
* Add a function to be called on window load
* @param mixed mixFunction Function to be called
*/

Wol.prototype.Add = function (mixFunction)
{
	
	// Add to the load array
	
	this.arrLoad[this.arrLoad.length] = mixFunction;
	
}


/*
* Wol.Load Function
* Execute the wol methods
*/

Wol.prototype.Load = function ()
{
	
	// Foreach value in the load array
	
	for (var i = 0; i < this.arrLoad.length; i++)
	{
		
		// Set value
		
		var mixValue	= this.arrLoad[i];
		
		// If the value is an array
		
		if (mixValue.constructor.toString().indexOf("Array") != -1)
		{
			
			// Execute the method
			
			eval (mixValue[0] + '.' + mixValue[1] + ';');
			
		}
		else
		{
			
			// Otherwise simply eval the value
			
			eval (mixValue + ';');
			
		}
		
	}
	
}

// End Class


// Create WOL object

var objWol	= new Wol ();

// Set window onload event the wol load method

window.onload = function () { objWol.Load (); };