function $(e){	return document.getElementById(e);	}

buttonDechetsOn = new Image();
buttonDechetsOnEn = new Image();
buttonDechetsOnNl = new Image();
buttonDechetsOnDe = new Image();

buttonDechetsOn.src = "./images/buttonDechetsOn.jpg";
buttonDechetsOnEn.src = "./images/buttonDechetsOnEn.jpg";
buttonDechetsOnNl.src = "./images/buttonDechetsOnNl.jpg";
buttonDechetsOnDe.src = "./images/buttonDechetsOnDe.jpg";

buttonDechetsOn.name = "buttonDechets";
buttonDechetsOnEn.name = "buttonDechetsEn";
buttonDechetsOnNl.name = "buttonDechetsNl";
buttonDechetsOnDe.name = "buttonDechetsDe";



function showItem(item){
	document.getElementById(item).style.display = "block";
}

function hideItem(item){
	document.getElementById(item).style.display = "none";
}

sfHover = function() {
var sfEls = document.getElementById("mainMenu").getElementsByTagName("li");
for (var i=0; i<sfEls.length; i++) {
	sfEls[i].onmouseover=function() {
		this.className+="sfhover";
		myUl = this.getElementsByTagName("ul");
		if(myUl.length > 0) myUl[0].style.marginLeft = "-"+this.offsetWidth;
	}
	sfEls[i].onmouseout=function() {
		this.className=this.className.replace(new RegExp("sfhover\\b"), "");
	}
}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

function DisplayPngByBrowser ( browser, img_path, width, height) {
var png_path;
if (browser == 'Microsoft Internet Explorer') {
	document.write('<a href="./index.php?page=societe"><img id="logoSeos" src="http://www.seosgroup.com/images/integration/blank.gif" style="border: none; width:'+width+'px; height:'+height+'px; position:absolute; left: 19.8%; z-index:500;" ></a>');
}
else if (browser == 'Netscape')
	document.write('<a href="./index.php?page=societe"><img id="logoSeos" src="'+img_path+'" style="position:absolute; z-index:200;" /></a>');
else
	document.write('<a href="./index.php?page=societe"><img id="logoSeos" src="'+img_path+'" style="z-index:200;" /></a>');
}

function is_mail(ao_champ){
	lb_return = false;
	if(ao_champ.indexOf("@") != -1){
		ln_index = ao_champ.indexOf("@");
		if(ao_champ.indexOf(".", ln_index) != -1){
			lb_return = true;
		}
	}
	return lb_return;
}

function verifForm(aoForm){
	if(!is_mail(aoForm.email.value)){
		alert('Email incorrect');
	}else{
		aoForm.submit();
	}
}
