var prehomeSifrStyles = function () {
	sIFR.replaceElement("#intro h1" , named({sFlashSrc: BaseUrl+"/Includes/swf/GoudyBold.swf", sColor: "#a8a2a2", sCase: "upper", sWmode: "transparent"}));
	sIFR.replaceElement(".prehomeLangue h3" , named({sFlashSrc: BaseUrl+"/Includes/swf/GoudyOldStyle.swf", sColor: "#454545"}));
	sIFR.replaceElement(".prehomeLangue h4" , named({sFlashSrc: BaseUrl+"/Includes/swf/GoudyOldStyleItalic.swf", sColor: "#454545"}));
}

var navLanguage = function () {

	var navNodes = $$("#deliveryCountry li");
	var langNodes = $$("#language ul");
	var oldNav = -1;
	for (var i=0;i<navNodes.length;i++) {
		
		navNodes[i].id = i+"navLang";
		
		if (langNodes[i]) {
			
			langNodes[i].style.left = navNodes[i].offsetLeft + (navNodes[i].offsetWidth/2) - (langNodes[i].offsetWidth/2) + "px";
			
			navNodes[i].onclick = function () {		
				var currId = this.id.charAt(0);
				
				// Choix de la langue actif uniquement pour la Belgique, France, Italie, Espagne et suisse
				if ((currId >= 0) && (currId < 5))
				{				
					this.className = (currId==0) ?"first on" :"on";
					langNodes[currId].style.visibility = "visible";
					if (oldNav==-1) $$("#language h2")[0].style.visibility = "visible";
					
					if (oldNav!=-1) {
						navNodes[oldNav].className = (oldNav==0) ?"first" :"";
						langNodes[oldNav].style.visibility = "hidden";
					}
					
					oldNav = (currId!=oldNav) ?currId :-1;
					if (oldNav==-1) $$("#language h2")[0].style.visibility = "hidden";			
				}
			}
		
		}
		
	}
}

var onLoadGlobal = new EventsContainer();
onLoadGlobal.add("prehomeSifrStyles");
onLoadGlobal.add("navLanguage");

function init () { onLoadGlobal.init(); }
window.onload = init;