﻿	
	// JavaScript Document

	//----------------------------------------------------------------------------------------------------
	// Fonctions relatives au menu international
	//----------------------------------------------------------------------------------------------------
	
	function MenuInter (){	
		var onclick, itemEl;
		var menuEl = document.getElementById("navinter");
		YAHOO.util.Event.addListener(menuEl, "mouseover", 	setMenuInterOn, 		menuEl, true ); 
    	YAHOO.util.Event.addListener(menuEl, "mouseout", 	unsetMenuInterOn, 		menuEl, true );
	}
	
	function setMenuInterOn(){
		var itemEl = document.getElementById("navsubmenu");
		YAHOO.util.Dom.addClass(itemEl, "visible");
		return false;
	}
	
	function unsetMenuInterOn(){
		var itemEl = document.getElementById("navsubmenu");
		YAHOO.util.Dom.removeClass(itemEl, "visible");
		return false;
	}
	
	//----------------------------------------------------------------------------------------------------
	// Fonctions relatives au menu marque
	//----------------------------------------------------------------------------------------------------
	
	function MenuBrand (){	
		var onclick, itemEl;
		var menuEl = document.getElementById("m-lego");
		YAHOO.util.Event.addListener(menuEl, "mouseover", 	setMenuBrandOn, 		menuEl, true ); 
    	YAHOO.util.Event.addListener(menuEl, "mouseout", 	unsetMenuBrandOn, 		menuEl, true );
	}
	
	function setMenuBrandOn(){
		var itemEl = document.getElementById("navsubmenu-m-lego");
		YAHOO.util.Dom.addClass(itemEl, "visible");
		return false;
	}
	
	function unsetMenuBrandOn(){
		var itemEl = document.getElementById("navsubmenu-m-lego");
		YAHOO.util.Dom.removeClass(itemEl, "visible");
		return false;
	}
	
	//----------------------------------------------------------------------------------------------------
	// Fonctions relatives au menu gamme
	//----------------------------------------------------------------------------------------------------
	
	function MenuGamme (){	
		var onclick, itemEl;
		var el=0;
		while (document.getElementById("gamme"+el)){
			menuEl = document.getElementById("gamme"+el);
			YAHOO.util.Event.addListener(menuEl, "mouseover", 	setMenuGammeOn, 		el, true ); 
    		YAHOO.util.Event.addListener(menuEl, "mouseout", 	unsetMenuGammeOn, 		el, true );
    		el++;
    	}
	}
	
	function setMenuGammeOn(){
		var itemEl = document.getElementById("navsubmenu-gamme"+this);
		YAHOO.util.Dom.addClass(itemEl, "visible");
		return false;
	}
	
	function unsetMenuGammeOn(){
		var itemEl = document.getElementById("navsubmenu-gamme"+this);
		YAHOO.util.Dom.removeClass(itemEl, "visible");
		return false;
	}
	
	//----------------------------------------------------------------------------------------------------
	// Fonction de sousmission des formulaires
	//----------------------------------------------------------------------------------------------------
	function send (itemEl){
		var form = document[itemEl];
		if (form)
			form.submit();
	}
	
	//----------------------------------------------------------------------------------------------------
	// Fonctions onClick sur DIV
	//----------------------------------------------------------------------------------------------------
	function getUrl (url){
		document.location.href = url;
	}
	
	//----------------------------------------------------------------------------------------------------
	// Fonctions d'ouverture du Poids au mètre
	//----------------------------------------------------------------------------------------------------
	function openpoids() {
		var wtop = 20;
		var wleft = 20;
		var wwidth= 800;
		var wheight= 400;
		var sc ="scrollbars=no";
		if (screen.availwidth<1024){
			wwidth= 780;
			wleft=(screen.availwidth-wwidth)/2;
			sc="scrollbars=yes";
		}
		if (screen.availwidth>20+wwidth){
			wleft=(screen.availwidth-wwidth)/2;
		}
		wtop=(screen.availheight-wheight)/2;
		bar = sc + ", width=" + wwidth + ",height=" + wheight + ", top=" + wtop + ", left=" + wleft;
	  fml= window.open( '../calcul-du-poids-au-metre/index0.htm' ,'fml','toolbar=no,location=no,menubar=no,status=no,scrollbars=no,resizable=no,' + bar )

	}
	//----------------------------------------------------------------------------------------------------
	// en anglais
	//----------------------------------------------------------------------------------------------------
	
	function enopenpoids() {
		var wtop = 20;
		var wleft = 20;
		var wwidth= 800;
		var wheight= 400;
		var sc ="scrollbars=no";
		if (screen.availwidth<1024){
			wwidth= 780;
			wleft=(screen.availwidth-wwidth)/2;
			sc="scrollbars=yes";
		}
		if (screen.availwidth>20+wwidth){
			wleft=(screen.availwidth-wwidth)/2;
		}
		wtop=(screen.availheight-wheight)/2;
		bar = sc + ", width=" + wwidth + ",height=" + wheight + ", top=" + wtop + ", left=" + wleft;
	  fml= window.open( '../calcul-du-poids-au-metre/en-index0.htm' ,'fml','toolbar=no,location=no,menubar=no,status=no,scrollbars=no,resizable=no,' + bar )

	}
	

	function openpoidshome() {
		var wtop = 10;
		var wleft = 20;
		var wwidth= 800;
		var wheight= 400;
		var sc ="scrollbars=no";
		if (screen.availwidth<1024){
			wwidth= 780;
			wleft=(screen.availwidth-wwidth)/2;
			sc="scrollbars=yes";
		}
		if (screen.availwidth>20+wwidth){
			wleft=(screen.availwidth-wwidth)/2;
		}
		wtop=(screen.availheight-wheight)/2;
		bar = sc + ",width=" + wwidth + ",height=" + wheight + ", top=" + wtop + ", left=" + wleft;
		
    fml= window.open( 'calcul-du-poids-au-metre/index0.htm' ,'fml','toolbar=no,location=no,menubar=no,status=no,scrollbars=no,resizable=no,' + bar )

	}
	
	//----------------------------------------------------------------------------------------------------
	// Exécution automatique des fonctions
	//----------------------------------------------------------------------------------------------------
	YAHOO.util.Event.addListener(window,"load",MenuInter);
	YAHOO.util.Event.addListener(window,"load",MenuBrand);
	YAHOO.util.Event.addListener(window,"load",MenuGamme);
	

