
/******************************************************************************
* dhtmllib.js                                                                 *
*                                                                             *
* Copyright 1999 by Mike Hall.                                                *
* Web address: http://www.brainjar.com                                        *
* Last update: February 26, 2000.                                             *
*                                                                             *
* Provides basic functions for DHTML positioned elements which will work on   *
* both Netscape Communicator and Internet Explorer browsers (version 4.0 and  *
* up).                                                                        *
******************************************************************************/

// Determine browser.

var isMinNS4 = (navigator.appName.indexOf("Netscape") >= 0 && parseFloat(navigator.appVersion) >= 4) ? 1 : 0;
var isMinIE4 = (document.all) ? 1 : 0;
var isMinIE5 = (isMinIE4 && navigator.appVersion.indexOf("5.") >= 0) ? 1 : 0;

//-----------------------------------------------------------------------------
// Layer visibility.
//-----------------------------------------------------------------------------

document.write("<DIV id=PopLayer style='position:absolute; z-index:200; visibility:hidden'></DIV>");
document.write("<DIV id=PopLayer2 style='position:absolute; z-index:200; visibility:hidden'></DIV>");

function pop(largeur_info,msg,entete)
{
	var content ="<table width="+largeur_info+" cellspacing=0 cellpadding=1 border=0 bgcolor="+BordMenuPop+"><tr><td><table width=100% bgcolor="+FondMenuPop+"><tr><td class=mt><font color=#FFFFFF><center><b>"+entete+"</b></center></font></td></tr></table><table width=100% cellspacing=0 cellpadding=4 border=0 bgcolor=#FFFFFF><tr><td class=pt>"+msg+"</td></tr></table></td></tr></table>";
	if(isMinNS4!=1)
	{
		changeLayerContent(PopLayer, content)
		showLayer(PopLayer);
	}
}

function pop2(largeur_info,msg,entete)
{
	var content ="<table width="+largeur_info+" cellspacing=0 cellpadding=1 border=0 bgcolor="+BordMenuPop+"><tr><td><table width=100% bgcolor="+FondMenuPop+"><tr><td class=mt><font color=#FFFFFF><center><b>"+entete+"</b></center></font></td></tr></table><table width=100% cellspacing=0 cellpadding=4 border=0 bgcolor=#FFFFFF><tr><td class=pt>"+msg+"</td></tr></table></td></tr></table>";
	if(isMinNS4!=1)
	{
		changeLayerContent(PopLayer2, content)
		showLayer(PopLayer2);
	}
}

function kill()
{
	if(isMinNS4!=1)hideLayer(PopLayer);
	if(isMinNS4!=1)hideLayer(PopLayer2);
}

if (isMinNS4) document.captureEvents(Event.MOUSEMOVE);
document.onmousemove = get_mouse;

function get_mouse(e)
{
	mouseX = (isMinNS4) ? e.pageX : event.x+document.body.scrollLeft;
	mouseY = (isMinNS4) ? e.pageY : event.y+document.body.scrollTop;
	
	if(isMinNS4!=1)moveLayerTo(PopLayer,mouseX-decaleX,mouseY+decaleY)
	if(isMinNS4!=1)moveLayerTo(PopLayer2,mouseX-100,mouseY+15)
}

function hideLayer(layer) {

  if (isMinNS4)
    layer.visibility = "hide";
  if (isMinIE4)
    layer.style.visibility = "hidden";
}

function showLayer(layer) {

  if (isMinNS4)
    layer.visibility = "show";
  if (isMinIE4)
    layer.style.visibility = "visible";
}


//-----------------------------------------------------------------------------
// Layer positioning.
//-----------------------------------------------------------------------------

function moveLayerTo(layer, x, y) {

  if (isMinNS4)
    layer.moveTo(x, y);
  if (isMinIE4) {
    layer.style.left = x;
    layer.style.top  = y;
  }
}
 
function changeLayerContent(layer, content)
{
	if (isMinNS4)
	{
		layer.document.open();
		layer.document.write(content);
		layer.document.close();
	}
	if (isMinIE4)
	{
		layer.innerHTML = content;
	}
	return -1;
}