var currentVisible = "";
var timer;
var timerRunning = false;

function showDetails(id)
{
	removeTimer();
	if (currentVisible != "") document.getElementById(currentVisible).style.display = "none";
	document.getElementById(id).style.display = "block";
	currentVisible = id;
}

function hideDetails()
{
	document.getElementById(currentVisible).style.display = "none";
	currentVisble = "";
}

function setDetailsTimer(id)
{
	timerRunning = true;
	timer = setTimeout("hideDetails()", 800);
}

function removeTimer()
{
	if (timerRunning) clearTimeout(timer);
	timerRunning = false;
}

if (document.images) {
	
	rssIcon = new Image();
	rssIcon.src = "/img/common/rss_over.png";
	/*
	search_over = new Image();
	search_over.src = "/img/revendeurs/search_over.gif";
	
	bgNavSecond_over = new Image();
	bgNavSecond_over.src = "/img/home/bgNavSecond_over.png";
	*/
}

function noSpam(user,domain) {
	locationstring = "mailto:" + user + "@" + domain;
	window.location = locationstring;
}

// ============== Popup ==============
function openPopup(type,url) {
	if (!window.open) alert('Merci de bien vouloir autoriser les fenêtres popup pour ce site');
	else {
		if (type == 1) { // 1 = Popup
			var largeur = 480;
			var hauteur = 440;
			var top=(screen.height-hauteur)/2;
			var left=(screen.width-largeur)/2;
			window.open(url,'Popup','toolbar=0,location=0,directories=0,status=1,scrollbars=0,resizable=1,copyhistory=0,menuBar=0,width='+largeur+',height='+hauteur+',left='+left+',top='+top+'');
		}
		if (type == 2) { // 1 = fenêtre animation Flash
			var largeur = 750;
			var hauteur = 700;
			var top=(screen.height-hauteur)/2;
			var left=(screen.width-largeur)/2;
			window.open(url,'Flash','toolbar=0,location=0,directories=0,status=1,scrollbars=0,resizable=1,copyhistory=0,menuBar=0,width='+largeur+',height='+hauteur+',left='+left+',top='+top+'');
		}
		if (type == 3) { // 3 = biographies de fondateurs
			var largeur = 750;
			var hauteur = 800;
			var top=(screen.height-hauteur)/2;
			var left=(screen.width-largeur)/2;
			window.open(url,'Flash','toolbar=0,location=0,directories=0,status=1,scrollbars=1,resizable=1,copyhistory=0,menuBar=0,width='+largeur+',height='+hauteur+',left='+left+',top='+top+'');
		}
		else { void(0);	}
	}
}

function openWindow(theURL,winName,features)
{
	window.open(theURL,winName,features);
}

// ============== Pages ==============
function getpage(idm,subm) {
	//alert(idm+","+subm);
	var newurl = arrayPages[idm][subm];
	document.location= newurl+".php";
}
