/***********************************************************************
						DEBUT INFOBULLE
***********************************************************************/
function infobullePositionne(e)
{
	var posx = 0;
	var posy = 0;
	if (!e) var e = window.event;
	if (e.pageX || e.pageY)
	{
		posx = e.pageX;
		posy = e.pageY;
	}
	else if (e.clientX || e.clientY)
	{
		posx = e.clientX + document.body.scrollLeft	+ document.documentElement.scrollLeft;
		posy = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;
	}
	// posx and posy contain the mouse position relative to the document
	// Do something with this information
	var targ;
	if (!e) var e = window.event;
	if (e.target) targ = e.target;
	else if (e.srcElement) targ = e.srcElement;
	if (targ.nodeType == 3) // defeat Safari bug
		targ = targ.parentNode;
		
//	alert (targ);
	
	
}
function infobulleSwitch (lien)
{
	var className = new String (lien.className);
	if (className.indexOf ("hovered") == -1)
	{
		className = className.concat (" hovered");
		lien.onmousemove = infobullePositionne;
	}
	else
	{
		className = className.replace (" hovered", "");
	}
	lien.className = className;
}
function infobulleSwitchPrepare ()
{
	var tab_liens = document.getElementsByTagName ("a");
	for (var i = 0; i < tab_liens.length; i++)
	{
		var lien = tab_liens [i];
		var className = lien.className;
		if (className.indexOf ("with_infobulle") != -1)
		{
			lien.onmouseover = function ()
			{
				infobulleSwitch (this);
			}
			lien.onmouseout = function ()
			{
				infobulleSwitch (this);
			}
		}
	}
}
window.onload = infobulleSwitchPrepare;
/***********************************************************************
						FIN INFOBULLE
***********************************************************************/

/***********************************************************************
						DEBUT FONCTION SHOW/HIDE LAYER
***********************************************************************/
var currentLayer = null;
function getProdDetail(id)
{
	currentLayer = id;
	self.document.body.onmousemove = getMouse;
	document.getElementById(id).style.display = "block"; 
}

function hideProdDetail(id)
{
	currentLayer = null;
	document.getElementById(id).style.display = "none";
	self.document.body.onmousemove = null;
}
var posX=0;
var posY=0;
function getMouse(evt)
{	
	if(currentLayer == null){
		
		self.document.body.onmousemove = null;
	}
	
	if(document.all)
	{
		var scrollObj = (document.documentElement) ? document.documentElement : document.body;
		posX = self.event.x+scrollObj.scrollLeft;
		posY = self.event.y+scrollObj.scrollTop;
	}
	else
	{
		posX = evt.pageX ;
		posY = evt.pageY ;
	}
	if(document.getElementById(currentLayer))
	{
		document.getElementById(currentLayer).style.left = 10+posX+"px";
		document.getElementById(currentLayer).style.top = 10+posY+"px";
	}
	return evt;
}

/***********************************************************************
						FIN FONCTION SHOW/HIDE LAYER
***********************************************************************/


