function deplierTOUT(itemname,state)
{

   tmp = document.getElementsByTagName('ul');
    for (i=0;i<tmp.length;i++)
    {
        if (tmp[i].className == itemname) tmp[i].style.display = state;
    }
    
}

function afficherTOUT(itemname,state)
{

    tmp = document.getElementsByTagName('div');
    for (i=0;i<tmp.length;i++)
    {
        if (tmp[i].className == itemname) tmp[i].style.display = state;
    }
    
}

switchAfficherTOUTEtat = new Array();

function switchAfficherTOUT(itemname)
{
	

	if (switchAfficherTOUTEtat[itemname] != 'a')
	{
		if (switchAfficherTOUTEtat[itemname] != 'h')
		{
			switchAfficherTOUTEtat[itemname] = '-';
		}
	}
	
	if (switchAfficherTOUTEtat[itemname] == 'h')
	{
		switchAfficherTOUTEtat[itemname] = 'a';
		afficherTOUT(itemname,'none');
	}else {
		switchAfficherTOUTEtat[itemname] = 'h';
		afficherTOUT(itemname,'block');
	}
}


function toggle(idname)
{
	document.getElementById(idname).style.display = (document.getElementById(idname).style.display == 'none') ? 'block' : 'none';
}


/*******************************************/
/* permet d'avoir une pop-up nickel */
/*******************************************/
function popUpFR(url,hauteur,largeur, haut, gauche)
{
	var w = new Array();
	var i = Math.round(Math.random(0)*300)+1;
	var now = new Date();
	var second = now.getSeconds();
	if(haut==0)
		var haut=(screen.height-hauteur)/2;
	if(gauche==0)
		var gauche=(screen.width-largeur)/2;
	w[i] = window.open(url,'pop'+ i + second,'toolbar=0, location=0, directories=0, status=0, scrollbars=1, resizable=1, copyhistory=0, menuBar=0, width='+ largeur +', height='+ hauteur +', left='+ gauche +', top='+ haut);
	void(0);
}
