/* auteur: Nadim Saikali */
/* Date de création: 10/05/2003 */
/* Modifs : 12/09/2003 */
// capture mouse pos event
if (document.layers) // Netscape 4
{
	document.captureEvents(Event.MOUSEMOVE);
	document.onmousemove = captureMousePosition;
}
else
{
	document.onmousemove = captureMousePosition;
}

var cOffsetX=-1, cOffsetY=-205;
var winX = 0;
var winY = 0;

function captureMousePosition(e)
{
	if (document.all)
	{
		winX=(Math.ceil((event.screenX)/20)*20);
		winY=(Math.ceil((event.screenY)/20)*20);
	}
	else
	{
		winX=(Math.ceil((e.screenX)/20)*20);
		winY=(Math.ceil((e.screenY)/20)*20);
	}
}

var calendrier=null;
// calendrier popup
function winit(presdate,nomfrom,nomchamp)
{
	if (navigator.platform.indexOf("Mac") == 0)
	{
		calendrier = window.open("calendrier.php?presdate="+presdate+"&formu="+nomfrom+"&champ="+nomchamp+"&posL="+winX+"&posT="+winY+"","cal","toolbar=0,width=200,height=150,left="+(winX+cOffsetX)+",top="+(winY+cOffsetY));
		calendrier.focus();
	}
	else
	{
		if (calendrier!=null) { calendrier.close(); calendrier=null; }
		calendrier = window.open("calendrier.php?presdate="+presdate+"&formu="+nomfrom+"&champ="+nomchamp+"","cal","toolbar=0,width=200,height=150,left="+(winX+cOffsetX)+",top="+(winY+cOffsetY));
		calendrier.focus();
		
		if ( (navigator.appName.indexOf("Netscape") == 0) && (navigator.appVersion.indexOf("4") == 0) )// Netscape 4 :(
		{ calendrier=null; }
	}
}