

// showOne
function showOne(index)
{
	
	// le clic vient d'ailleur
	if(!window.location.pathname.match(/clients.php/))
	{
		window.location.href = "clients.php?" + index;
		return;
	}
	
	var query = window.location.search;
	if(query && !index)
		index = query.substring(1, query.length);		
	
	if(!index)
		return;
	
	var root = document.getElementById('client')
	var dd = root.getElementsByTagName('dd');
	for(var i=0; i<dd.length; i++)
	{
		dd[i].style.display = (dd[i].id == index)? "block" : "none";
		dd[i].previousSibling.firstChild.className = (dd[i].id == index)? "on" : "off";
	}
}

// showHide
function showHide(index, item)
{
	var elt = document.getElementById(index);
	if (!elt.style.display || elt.style.display == 'block') 
	{
		elt.style.display = 'none';
		item.className = "off";
	}
	else
	{	
		elt.style.display = 'block';
		item.className = "on";
	}
	return false;
}

// preload
function preload()
{
	imgload = new Array();
	for(var j=0;j<preload.arguments.length;j++)
	{
		imgload[j] = new Image();
		imgload[j].src = preload.arguments[j];
	}
}

// showMenu
function showMenu(id)
{
	if (currentMenu)
		currentMenu.style.display = "none";
	currentMenu = document.getElementById(id);
	if (currentMenu)
		currentMenu.style.display = "block";
}


// initMenu
function initMenu()
{
	if(actif > 2)
  		clearTimeout(actif);
		 
	actif = setTimeout("showMenu(Menu)",10000);
}
// loadMenu
function loadMenu()
{
	showMenu(Menu);
}

// window open
function wOpen(img)
{
	w = open("",'target','width=150,height=150,toolbar=no,scrollbars=no,resizable=no'); 
	w.document.write("<html><head><title>OptinProcess</title></head>"); 
	w.document.write('<script type="text/javascript">'); 
	w.document.write("function checksize(){if (document.images[0].complete ){window.resizeTo(document.images[0].width + 10, document.images[0].height + 50);}else{setTimeout('checksize()',250)}}"); 
	w.document.write('</script>'); 
	w.document.write('<body onload="checksize()" onblur="window.close()" onclick="window.close()" leftMargin="0" topMargin="0" marginwidth="0" marginheight="0">');
	w.document.write("<div style='width:100%;'> ");
	w.document.write("<img src='" + img + "' border=0 alt=''>"); 
	w.document.write("</div>");
	w.document.write("</body></html>"); 
	w.document.close(); 
	return false;	
}