/*--------------------------------------------------------------------------------------
	JS Document (JavaScript/JScript)

	project:	init.js
	created:	2008-11-01 (yyy-mm-dd)
	version:	1.0
	original:	Dean Edwards, Matthias Miller, John Resig
	author:		Yves Van Goethem
	email:		yvangoethem@digitas.com
	website:	http://www.digitas.fr
	
	summary:	- windowOnload
				- init	-> function
						-> Mozilla / Opera (Browsers whom support DOMContentLoaded)
						-> IE/Win32
						-> Safari (WebKit/KHTML ?)
-------------------------------------------------------------------------------------- */


/*	=Events
-------------------------------------------------------------------------------------- */

	// INSERT ALL FUNCTIONS USED ON THIS WEBSITE HERE !
	
	function windowOnload() {
		printLink(); 	// creats print link
		membersAcces(); // handles member access
		footerLink(); 	// creats back or close link
		toPopup(); 		// handles open-popup class
		handleOffres(); // handle Offres Packs
		formPopup();
		getTel();
		SendPopup();
		 CreateCookie();
		// handle IE PNG Hack
		try {
			ph = PNGHack('/FRONT/EDF_BELGIUM/img/common/spacer.gif');//!\modifier
			ph.remotehost = false;
			ph.crush();
		}catch(e){}
	}

/*	=Init
-------------------------------------------------------------------------------------- */

function init() {
	// quit if this function has already been called
	if (arguments.callee.done) return;

	// flag this function so we don't do the same thing twice
	arguments.callee.done = true;

	// kill the timer
	if (_timer) clearInterval(_timer);

	// do stuff
	windowOnload();
};

/* for Mozilla/Opera9 */
if (document.addEventListener) {
	document.addEventListener("DOMContentLoaded", init, false);
}

/* for Internet Explorer */
/*@cc_on @*/
/*@if (@_win32)
	document.write("<script id=__ie_onload defer src=javascript:void(0)><\/script>");
	var script = document.getElementById("__ie_onload");
	script.onreadystatechange = function() {
		if (this.readyState == "complete") {
			init(); // call the onload handler
		}
	};
/*@end @*/

/* for Safari */
if (/WebKit/i.test(navigator.userAgent)) { // sniff
	var _timer = setInterval(function() {
		if (/loaded|complete/.test(document.readyState)) {
			init(); // call the onload handler
		}
	}, 10);
}

/* for other browsers */
window.onload = init;