// Unitybar Class
// Programer: Luc (luctt@von-inc.com) 
// Updated: 04 Dec 2007
function Unitybar()
{
	var arrFunction = new Array();
	var intNumFunction = 0;
	this.addOnload = addOnload;
	this.listFunction = listFunction;
	this.Onload = Onload;
	this.runFunction = runFunction;
	
	
	function addOnload(p_strFunction)
    {
		arrFunction[intNumFunction++] = p_strFunction;
    }//end addOnload
	
	function listFunction()
    {			
		for (i=0;i<intNumFunction;i++)
		{
			var str_temp;
			str_temp = arrFunction[i].replace('(','');
			str_temp = str_temp.replace(')','');
			   
			if (function_exists(str_temp)) 
			{	
				eval(arrFunction[i]);
			}
		}
    }//end listFunction
	
	function runFunction(p_strFunction)
    {
		eval(p_strFunction);
	}//end runFunction
	
	function Onload()
    {	
		window.onload = function()
		{	
			if (function_exists('loadMyMenu'))
				eval('loadMyMenu()');		
			listFunction();
		}
    }//end Onload
	
	function function_exists( p_strFunction ) 
	{
    	if (typeof p_strFunction == 'string')
		{
        	return (typeof window[p_strFunction] == 'function');
    	} 
		else
		{
        	return (p_strFunction instanceof Function);
    	}
	}
}//end class Unitybar
uni_ADN = new Unitybar();
