
function show(elId){
	var el = WG_getE(elId);
	if(el.style.display != "block"){
		el.style.display = "block";
	}
}

function hide(elId){
	var el = WG_getE(elId);
	if(el.style.display != "none"){
		el.style.display = "none";
	}
}

// Controle du format des adresses e-mail
function controlMail(email){
	var debut = email.indexOf("@");
	var taille = email.length;
	var fin = email.substr(debut,taille);
	if (debut != -1) {
		if (fin.indexOf(".") != -1) {
			return true;
		}else{
			return false;
		}
	}else{
		return false;
	}
}

/*add some events on menu for IE compatibility only*/
function startMenu() {
	if (isIE ) {
		var liMenu = document.getElementById("menu-haut").getElementsByTagName("LI");
		for (var i=0; i<liMenu.length; i++) {
		  	li = liMenu[i];
		  	if (li.nodeName=="LI") {
		  		li.onmouseenter=function() {
		  			//this.className += " over";
					if(this.className=='maillots' || this.className=='qui' || this.className=='espace-client'|| this.className=='cat'){
						if(this.childNodes[2]){
							this.childNodes[2].style.display = "block";
						}
					}
					if(this.className=='CMS_lvl2'){
						if(this.childNodes[2]){
							this.childNodes[2].style.display = "block";	
							for(var j=0; j<this.parentNode.childNodes.length; j++){
								//check this num id
								if(this.parentNode.childNodes[j] == this){
									var c = j;
									break;
								}
							}	
							for(var j=c; j<this.parentNode.childNodes.length; j++){
								//check this num id
								if(this.parentNode.childNodes[j].nodeName== "LI" && this.parentNode.childNodes[j] != this){
									this.parentNode.childNodes[j].style.top = "-3px";
								}
							}	
						}	
						this.childNodes[0].style.backgroundColor = "#404040";
					}
					if(this.className=='CMS_lvl3'){
						this.childNodes[0].style.backgroundColor = "#707070";
					}
		    	}
		  		li.onmouseleave=function() {
		  			//this.className = this.className.replace(" over", "");
					if(this.className=='maillots' || this.className=='qui' || this.className=='espace-client'|| this.className=='cat'){
						if(this.childNodes[2]){
							this.childNodes[2].style.display = "none";
						}
					}
					if(this.className=='CMS_lvl2'){
						if(this.childNodes[2]){
							this.childNodes[2].style.display = "none";
							if(get_nextsibling(this)){
								get_nextsibling(this).style.top = "0px";
							}
						}
						this.childNodes[0].style.backgroundColor = "#000000";
					}
					if(this.className=='CMS_lvl3'){	
						this.childNodes[0].style.backgroundColor = "#404040";
					}
				}
			}
		}
	}
}

// Corrige les différences de retour de nextSibling entre les navigateurs
function get_nextsibling(n)
  {
  	var x=n.nextSibling;
	if(x){
		while (x.nodeType!=1)
		{
		x=x.nextSibling;
		}
		return x;
	} else{
		return false;
	}
}
