//-------------------------- fonction de menu -------------------------------------------------------

function montre(id) {
var d = document.getElementById(id);
	for (var i = 1; i<=10; i++) {
		if (document.getElementById('smenu'+i)) {document.getElementById('smenu'+i).style.display='none';}
	}
if (d) {d.style.display='block';}
}
function cache(id) {
var d = document.getElementById(id);
	for (var i = 1; i<=10; i++) {
		if (document.getElementById('smenu'+i)) {document.getElementById('smenu'+i).style.display='none';}
	}
if (d) {d.style.display='none';}
}


function confirm_droit(mess,url)
{
	if(confirm(mess))
	{
		document.location=url;
	}
}


function show_o1()
	{
		document.all.onglet1.style.display='block';
		document.all.onglet2.style.display='none';
	}
function show_o2()
{
		document.all.onglet2.style.display='block';
		document.all.onglet1.style.display='none';
}
function affiche(id)
{
	var d = document.getElementById(id);
	d.style.display = "block";
}
function cache(id)
{
	var d = document.getElementById(id);
	d.style.display = "none";
}
//----
function confirm_suppr(lien,mess) //confirmation de suppression
{
	
	if(confirm("Etes-vous sur de vouloir supprimer "+mess+"?"))
	{
		document.location = (lien);
	}
	
}

//----------------------------------- fonction ouverture de popup ---------------------------------------------------------------------
function popup(mapage,width,height,params) 
{
    x = (640 - width)/2, y = (480 - height)/2;
    if (screen)
    {
       y = (screen.availHeight - height)/2;
       x = (screen.availWidth - width)/2;
    }
    if (screen.availWidth > 1800)
    {
      x = ((screen.availWidth/2) - width)/2;
    }
    window.open(mapage,'','width='+width+',height='+height+',screenX='+x+',screenY='+y+',top='+y+',left='+x+','+params);
}

//----------------------------------- ouvre une image dans un popup -----------------------------------
function ouvrir(chemin,titre,largeur,hauteur) 
{
	test = window.open("about:blank","","width="+largeur+",height="+hauteur+"");
	texte = "<title>"+titre+"</title><a href='#' onClick='window.close()'><img src="+chemin+" alt='Cliquez pour fermer' border='0'></a>";
	test.document.write(texte);
}
