//GO1.1





///////////////////////////////////////

//

//  Generic onload by Brothercake

//  http://www.brothercake.com/

//

///////////////////////////////////////



///////////////////////////////////////

// 	type Class by _Snow

// 	1.11.2009

//	Class OnLoad 

//  Onload.addloader(_function_to_play) 	//instanciation



var OnLoad = function(name){

	

///////////////////////////////

// function addloader

// 1.11.2009

	

	function _onload () {};

//d.debugOn();//d.debugOff();



	

  	this.addloader = function(_function_onload){

		

		// save function 

		_onload = _function_onload;

//d.$('type of this.func :' +  typeof _function_onload );

		

			

		

		//setup onload function

		if(typeof window.addEventListener != 'undefined')

		{

			//.. gecko, safari, konqueror and standard

			window.addEventListener('load', generic, false);

		}

		else if(typeof document.addEventListener != 'undefined')

		{

			//.. opera 7

			document.addEventListener('load', generic, false);

		}

		else if(typeof window.attachEvent != 'undefined')

		{

			//.. win/ie

			window.attachEvent('onload', generic);

		}

		

		//** remove this condition to degrade older browsers

		else

		{

			//.. mac/ie5 and anything else that gets this far

			

			//if there's an existing onload function

			if(typeof window.onload == 'function')

			{

				//store it

				var existing = onload;

				

				//add new onload handler

				window.onload = function()

				{

					//call existing onload function

					existing();

					

					//call generic onload function

					generic();

				};

			}

			else

			{

				//setup onload function

				window.onload = generic;

			}

		}





	};







	function generic()

	{	// if Debug.$=='function'

		

		

		

//d.$('');d.$('Fontion Generic Onload');

		try{

			_onload();

			//onlaod(name);

		}catch(e){

		

//d.$(' --------- no load function -----');
//d.$(' event : ' + e);
//d.each(e);

			alert ('Erreur '+ e); 

			

		}

};









	

	// _prototype function

	//this.newfunc = function(name){};



	return;



};	

