function SwitchOnHome(id)	{
	d = document.getElementById('sous_menu_'+id);
	d.style.display = 'block';
}

function SwitchOffHome(id)	{
	d = document.getElementById('sous_menu_'+id);
	d.style.display = 'none';
}

function SwitchOn(id)	{
	d = document.getElementById('sous_menu_'+id);
	d.style.display = 'block';
}

function SwitchOff(id)	{
	d = document.getElementById('sous_menu_'+id);
	d.style.display = 'none';
}

// Si on est deja sur la page

function SemiSwitch(id)	{
	d = document.getElementById('sous_menu_'+id);
	d.style.display = 'none';
}

function SwitchLang(url,lang)	{
	if (lang=="fr"){
		document.location=url+"&lang=en";
	} else {
		document.location=url+"&lang=fr";
	}
}
	
function highlight(objet, myClass){ 
	d = document.getElementById(objet);
	if (d) {
  		d.className = myClass;
  	}
}

function depliance(objet){
	d = document.getElementById(objet);
	var etat = d.style.display;
	
	if (etat!='none') {
		d.style.display = 'none';
	} else {
		d.style.display = 'block';
	}
}

function switchMsgAuteur() {
	d = document.getElementById("preview");
	var orig = document.getElementById("message");
		if (d) {
			d.style.opacity = 0.5;
			orig.style.opacity = 1;
		}
	}
	
function Popup(url,largeur,hauteur) {
	var where = new String(document.location);
	var recherche = where.indexOf('recherche');
	if (recherche=='-1') {
		var page = url + "?mode=popup";
	} else {
		var page = url + "&mode=popup";
	}
	var dimensions = "width="+largeur+", height="+hauteur+", scrollbars=yes, resizable=yes";
	popup = window.open(page,'ETAI',dimensions);
	popup.opener.name = "opener";
}

function getBack(destination){
	opener.location=destination;
	opener.focus();
	window.close();
}