/* 2007 DW || FROMAGERIE DE L'ETOILE



*/

function ow (url)
{
	window.open(url);
}

function initHide(id)
{
	document.getElementById(id).style.display = "none";
}

hideId = "";

function hideShow(id)
{
	document.getElementById(id).style.display = "block";
	if(hideId)
	{
		document.getElementById(hideId).style.display = "none";
	}
	if(hideId != id)
	{
		hideId = id;
	} else {
		hideId = "";
	}
}


// menu deroulant

var tmpMasque = 200;
var secMasque = 1;
var counter = 0;
var intHide = false;
var departX = 3;

function showSubMenu(id)
{
	if(intHide) clearInitHide();
	document.getElementById("subMenu").style.display = "block";
	document.getElementById("subMenu").style.left = Number((departX+id)*98)-1+"px";
	writeContent(id);
}

function hideSubMenu()
{
	counter = 0;
	intHide = setInterval(countTime,tmpMasque);
}

function countTime()
{
	if(counter>=secMasque)
	{
		document.getElementById("subMenu").style.display = "none";
		clearInitHide();
	} else {
		counter++;
	}
}

function clearInitHide()
{
	clearInterval(intHide);
}

function writeContent(id)
{
	var nbBt = tablib[id].length;
	var listMenu = "";
	for(i=0;i<nbBt;i++)
	{
		listMenu = listMenu+"<li><a href='"+traceur+tablien[id][i]+"' onmouseover='clearInitHide();' onmouseout='hideSubMenu(0);'>"+tablib[id][i]+"</a></li>";
	}
	document.getElementById("subMenu").innerHTML = listMenu;	
}
