<!--
function _DHTML_API()
{
	this.version	= "1.2";
	this.instances	= 0;
	this.objects	= {};
}
DHTML_API = new _DHTML_API();

//--------------------------------------------------------------------------||
// FUNCTION:    DHTMLobj												    ||
// TYPE:		constructor												    ||
// PARAMETERS:  name	  = nom de l'objet DHTML recherché (facultatif)     ||
//				DOMobj	  = objet DOM contenant l'objet DHTML (facultatif)  ||
// RETURNS:     null													    ||
// PURPOSE:     Crée un objet permettant d'accéder à un obj DHTML donné     ||
// CALL:		var obj = new DHTMLobj('obj_id')							||
// VERSION:		v1.2														||
//--------------------------------------------------------------------------||
function DHTMLobj(name, DOMobj)
{
	if (!(document.getElementById || document.all || document.layers)) return false;
	
	DOMobj = (DOMobj?DOMobj.document:document);
	
	this.id		= DHTML_API.instances++;
	this.ref	= "DHTML_API.objects['" + this.id + "']";
	//----- création d'un nouvel objet
	if (name == null)
	{
		this.name	= 'DHTML_object_' + DHTML_API.instances;
		this.obj	= DOMobj.createElement('div');
	}
	//----- récupération d'un nouvel objet
	else
	{	
		this.name	= name;
		this.obj	= (DOMobj.getElementById) ? DOMobj.getElementById(name) : (DOMobj.all) ? DOMobj.all[name] : getNN4obj(DOMobj,name);
	}	
	//----- à ce stade si aucun objet n'est récupérable, fin de la classe
    if (!this.obj) return false;
    //----- définition du style
	this.style	= (DOMobj.getElementById || DOMobj.all) ? this.obj.style : this.obj;    
	//----- calcul de la propriété left si elle n'est pas définie
    if (!this.style.left) { this.setLeft(findPosX(this.obj)); }
    //----- calcul de la propriété top si elle n'est pas définie
    if (!this.style.top) { this.setTop(findPosY(this.obj)); }
    //----- définition du tampon html de contenu de l'objet
	this.htm	= '';
	//----- définition des fonctions d'écriture au sein de l'objet
	if (typeof name != 'string' || !name)
	{
		this.inithtm = (DOMobj.innerHTML)? DOMobj.innerHTML : '';
		this.write = function(htm) { if (htm) {this.htm=htm;} DOMobj.write(this.htm); this.htm=''; };
		this.clear = function() { this.htm = ''; this.obj.innerHTML = this.inithtm; }
	}
	else
	{
		this.inithtm = (this.obj.innerHTML)? this.obj.innerHTML : '';
		this.write = (typeof DOMobj.insertAdjacentHTML != "undefined")? 
						function(htm)
						{
                            if (htm) {this.htm=htm;}
							this.obj.insertAdjacentHTML("BeforeEnd", this.htm);
							this.htm = '';
						} :
						(typeof DOMobj.createRange != "undefined") ? // firefox
							function(htm) 
							{
                                if (htm) { this.htm=htm; }
								var x = document.createRange();                                
								x.setStartBefore(this.obj);
								x = x.createContextualFragment(this.htm);
								this.obj.appendChild(x);
								this.htm = '';
							} :
							function(htm)
							{
                                if (htm) {this.htm=htm;}
								this.obj.innerHTML += this.htm; 
								this.htm = '';
							}
		this.clear = function() { this.htm = ''; this.obj.innerHTML = this.inithtm; }
	}
	
	//----- gestion des plugins
	if (window.DHTMLmvt) { this.Mouvement = new DHTMLmvt(this) }
	
	//----- ajout de l'objet dans la classe père
	DHTML_API.objects[this.id] = this;
}

/*---------------------------------------------------------------------------------------
---------------- METHODES DE GESTION DU STYLE DE L'ELEMENT DHTML
-----------------------------------------------------------------------------------------

-----------------------------------------------------------------------------------------*/

/* GESTION DE LA PROPRIETE DISPLAY (Except NN4) */
/* -------------------------------------------- */
DHTMLobj.prototype.setDisplay = function (b) { this.style.display = (b) ? 'block' : 'none' ; }
//DHTMLobj.prototype.setDisplay = function (b) { this.style.display = (b) ? '' : 'none' ; }
DHTMLobj.prototype.switchDisplay = function ()
{
    var s = this.style;
	if ( testProperty(s.display) ) { this.setDisplay((s.display == 'block' || s.display == 'inline' || s.display == '') ? 0 : 1) ; }
}

/* GESTION DE LA PROPRIETE VISIBILITY */
/* ---------------------------------- */
DHTMLobj.prototype.setVisibility = function (b)
{
	var show = (!document.layers)?'visible':'show' ;
	var hide = (!document.layers)?'hidden':'hide' ;
	this.style.visibility = (b) ? show : hide ;
}
DHTMLobj.prototype.switchVisibility = function ()
{
	var x=1; // au chargement de la page, this.style.visibility == ""
	if (!document.layers)	{ x = (this.style.visibility == 'visible') ? 1 : 0 ; }
	else					{ x = (this.style.visibility == 'show') ? 1 : 0 ; }
	this.setVisibility(!x);
}

/* GESTION DES DIMENSIONS DE L'ELEMENT DHTML */
/* ---------------------------------------- */
DHTMLobj.prototype.getHeight = function()
{	
	var s = this.style; var o = this.obj; var h = 0;
	if (s.height && !s.height.length)					    { h = parseInt(s.height); }
    /* MSIE 7 */
	else if (o.offsetHeight && !isNaN(o.offsetHeight))	{ h = o.offsetHeight - (s.marginTop?parseInt(s.marginTop):0) + (s.marginBottom?parseInt(s.marginBottom):0); }
	else if (s.pixelHeight && !isNaN(s.pixelHeight))	    { h = s.pixelHeight; }
	else if (s.posHeight && !isNaN(s.posHeight))		    { h = s.posHeight; }
    return h;
}
DHTMLobj.prototype.getWidth = function()
{	
	var s = this.style; var o = this.obj; var w = 0;
	if (s.width && !s.width.length)						{ w = parseInt(s.width); }
	/* MSIE 7 */
    else if (o.offsetWidth && !isNaN(o.offsetWidth))	    { w = o.offsetWidth - (s.marginLeft?parseInt(s.marginLeft):0) - (s.marginRight?parseInt(s.marginRight):0) - (s.borderRightWidth?parseInt(s.borderRightWidth):0) - (s.borderLeftWidth?parseInt(s.borderLeftWidth):0); }
	else if (s.pixelWidth && !isNaN(s.pixelWidth))		{ w = s.pixelWidth; }
	else if (s.posWidth && !isNaN(s.posWidth))			{ w = s.posWidth; }
    return w;
}
DHTMLobj.prototype.setHeight = function(h, isW)
{
	if (isW) { this.setWidth( parseInt( (h*this.getWidth)/this.getHeight), false ); }
	this.style.height = (document.getElementById || document.all) ? (h + 'px') : (h);
}
DHTMLobj.prototype.setWidth	= function(w, isH)
{
	if (isH) { this.setHeight( parseInt( (w*this.getHeight)/this.getWidth), false ); }
	this.style.width = (document.getElementById || document.all) ? (w + 'px') : (w);
}
DHTMLobj.prototype.resizeTo	= function(w, h) { this.setWidth(w); this.setHeight(h); }


/*---------------------------------------------------------------------------------------
---------------- GESTION DU POSITIONNEMENT DE L'ELEMENT DHTML
-----------------------------------------------------------------------------------------
    For DOCTYPE in 'strict mode' (document.getElementById || document.all),
    you must add 'px' to the value (Mozilla, Explorer on Mac and Safari)
-----------------------------------------------------------------------------------------    
    POSITION
    -- Static (positonnement habituel de l'élément, cad en fonction de son ordre d'arrivée. valeur par défaut)
	-- Absolute	(élément est positionné par rapport aux bords de la page. Il défile avec la page)
	-- Fixed (élément est positionné par rapport aux bords de la page mais ne défile pas avec la page)
	-- Relative	(élément est positionné par rapport à l'élément précédent)
	-- Inherit (Même valeur que celle de l'élément parent)
	FLOAT
	-- None	(élément est inséré dans le flot du texte. Il n'y pas d'habillage)
	-- Right (élément est placé à droite. L'habillage se fait par la gauche)
	-- Left	(élément est placé à gauche. L'habillage se fait par la droite)
	-- Inherit (même valeur que celle de l'élément parent)
	CLEAR
	-- None	(les éléments flotants se positionnent normalement et éventuellement se mettent côte à côte)
	-- Left	(l'élément est repoussé après les éléments flotants déjà placés sur sa gauche)
	-- Right (l'élément est repoussé après les éléments flotants déjà placés sur sa droite)
	-- Both	(l'élément est repoussé après les éléments flotants déjà placés sur sa gauche et sur sa droite)
	-- Inherit (Même valeur que celle de l'élément parent)
-----------------------------------------------------------------------------------------*/
DHTMLobj.prototype.appendTo = function(o)   { o.appendChild(this.body); }
DHTMLobj.prototype.setPosition = function(str) { this.style.position = str; }
DHTMLobj.prototype.setFloat = function(str) { this.style.float = str; }
DHTMLobj.prototype.setClear = function(str) { this.style.clear = str; }
DHTMLobj.prototype.getLeft = function()     { return parseInt(this.style.left); }
DHTMLobj.prototype.getRight = function()    { return parseInt(this.getLeft() + this.getWidth()); }
DHTMLobj.prototype.getTop = function()      { return parseInt(this.style.top); }
DHTMLobj.prototype.getBottom = function()   { return parseInt(this.getTop() + this.getHeight()); }
DHTMLobj.prototype.setLeft = function(x)    { this.style.left = (document.getElementById || document.all) ? (x + 'px') : (x); }
DHTMLobj.prototype.setTop = function(y)     { this.style.top = (document.getElementById || document.all) ? (y + 'px') : (y); }
DHTMLobj.prototype.setZIndex = function(i)  { this.style.zIndex = i; }
DHTMLobj.prototype.hMoveBy = function(x)    { this.setLeft(this.getLeft() + x*1); }
DHTMLobj.prototype.vMoveBy = function(y)    { this.setTop(this.getTop() + y*1); }
DHTMLobj.prototype.moveTo = function(x,y)	{ this.setLeft(x); this.setTop(y);  }
DHTMLobj.prototype.moveBy = function(x,y)	{ this.hMoveBy(x); this.vMoveBy(y);  }
DHTMLobj.prototype.attach = function(o)	    { this.moveTo(findPosX(o), findPosY(o)); }
DHTMLobj.prototype.center = function()	    
{ 
    //----- gestion du positionnement
    var w = this.getWidth();
    var h = this.getHeight();
    var posX = (Math.max(screen.width, w)-w)/2;
    var posY = (Math.max(screen.height, h)-h)/2;
    //----- définition de sa position sur l'écran
    this.moveTo(posX, posY);
}

/*---------------------------------------------------------------------------------------
---------------- GESTION DU STYLE DE L'OBJET
-----------------------------------------------------------------------------------------
	BACKGROUND-ATTACHMENT
	-- scroll, fixed
	BACKGROUND-COLOR
	-- color-rgb (rgb(255,0,0)), color-hex (#ff0000), color-name (red), transparent
	BACKGROUND-IMAGE
	-- url, none
	BACKGROUND-POSITION
	-- x (left/center/right, %, pos) y (top/center/bottom, %, pos)
	BACKGROUND-REPEAT
	-- repeat, repeat-x, repeat-y, no-repeat
-----------------------------------------------------------------------------------------*/
DHTMLobj.prototype.setBgAttachment	= function(val)	{ this.style.backgroundAttachment  = val; }
DHTMLobj.prototype.setBgColor		= function(val)	{ this.style.backgroundColor	   = val; }
DHTMLobj.prototype.setBgImage		= function(url)	{ this.style.backgroundImage	   = 'url('+url+')'; }
DHTMLobj.prototype.setBgPosition	= function(val)	{ this.style.backgroundPosition    = val; }
DHTMLobj.prototype.setBgRepeat		= function(val)	{ this.style.backgroundRepeat	   = val; }
DHTMLobj.prototype.setBackground	= function(color, image, position, repeat, attach)
{	
	if (color)		{ this.setBgColor(color); }	
	if (image)		{ this.setBgImage(image); }
	if (position)	{ this.setBgPosition(position); }
	if (repeat)		{ this.setBgRepeat(repeat); }
	if (attach)		{ this.setBgAttach(weight); }
}

/*---------------------------------------------------------------------------------------
---------------- GESTION DU STYLE DU TEXT DE L'OBJET
-----------------------------------------------------------------------------------------
	COLOR
	-- color-rgb (rgb(255,0,0)), color-hex (#ff0000), color-name (red), transparent
	FONT-FAMILY
	-- family-name	 ("times", "courier", "arial", etc.)
	-- generic-family ("serif", "sans-serif", "cursive", "fantasy", "monospace")
	FONT-SIZE
	-- xx-small, x-small, small, medium, large, x-large, xx-large
	-- smaller, larger (smaller/larger than parent element)
	-- length (px, em, cm, %, etc.)
	FONT-STYLE
	-- normal, italic, oblique, [bold]
	FONT-WEIGHT
	-- normal, bold, bolder, lighter
	-- 100, 200, 300, 400, 500, 600, 700, 800, 900
	FONT-VARIANT
	-- normal, small-caps
	LINE-HEIGHT
	-- number, font-size, %
-----------------------------------------------------------------------------------------*/
DHTMLobj.prototype.setClass			= function(cls)			{ this.obj.className = cls; }
DHTMLobj.prototype.setColor			= function(color)		{ this.style.color = color; }
DHTMLobj.prototype.setFontFamily	= function(family)	    { this.style.fontFamily = family; }
DHTMLobj.prototype.setFontSize		= function(size)	    { this.style.fontSize = size; }
DHTMLobj.prototype.setFontStyle		= function(style)	    { this.style.fontStyle = style; }
DHTMLobj.prototype.setFontWeight	= function(weight)	    { this.style.fontWeight = weight; }
DHTMLobj.prototype.setFontVariant	= function(variant)		{ this.style.fontVariant = variant; }
DHTMLobj.prototype.setLineHeight	= function(line)	    { this.style.lineHeight = line; }
DHTMLobj.prototype.setFont			= function(family, size, style, weight, variant, line)
{	
	if (family)						{ this.setFontFamily(family); }	
	if (size)						{ this.setFontSize(size); }
	if (style && style != 'bold')	{ this.setFontStyle(style); }
	if (style && style == 'bold')	{ this.setFontWeight(style); }
	if (weight && style != 'bold')	{ this.setFontWeight(weight); }
	if (variant)					{ this.setFontVariant(variant); }
	if (line)						{ this.setLineHeight(line); }
}


/*---------------------------------------------------------------------------------------
---------------- FONCTIONS UTILES A LA CLASSE
-----------------------------------------------------------------------------------------
	getNN4obj
    testProperty
    getInnerDimension
    getScrollingOffset
    getPageDimension
-----------------------------------------------------------------------------------------*/

//----------------------------------------------------------------||
// FUNCTION:	getNN4obj                                         ||
// PARAMETERS:  obj  = DOMobj ou est l'objet cherche (object)     ||
//              name = name of the searched object (string)       ||
// RETURNS:     NNS4 layer			                              ||
// PURPOSE:     récupère l'objet DHTML pour netscape navigator 4x ||
// VERSION:     v1.0 (version très aboutie)		                  ||
//----------------------------------------------------------------||
function getNN4obj(obj,name)
{
	var x = obj.layers;
	var foundLayer;
	for (var i=0;i<x.length;i++)
	{
		if (x[i].id == name)		  { foundLayer = x[i]; }
		else if (x[i].layers.length) { var tmp = getNN4obj(x[i],name); }
		if (tmp) foundLayer = tmp;
	}
	return foundLayer;
}

//----------------------------------------------------------------||
// FUNCTION:	testProperty	                                  ||
// PARAMETERS:  property  = propriété de la classe			      ||
// RETURNS:     true or false									  ||
// PURPOSE:     teste la prise en charge d'une propriété		  ||
// VERSION:     v1.0							                  ||
//----------------------------------------------------------------||
function testProperty(property) { if (typeof property == "undefined") { return false; } return true; }

//----------------------------------------------------------------||
// FUNCTION:	getInnerDimension                                 ||
// PARAMETERS:  none											  ||
// RETURNS:     x or y	= dimensions 			                  ||
// PURPOSE:     Retrieve inner dimensions of a window or a frame  ||
// VERSION:     v1.1 (version très aboutie)		                  ||
//----------------------------------------------------------------||
function getInnerDimension()
{
	var x,y;
	
	// All except Explorer
	// -------------------
	if (self.innerHeight) // ou window.innerHeight
	{
		// Sys.Browser.Firefox, etc.
		if (document.documentElement && document.documentElement.clientHeight)	
		{
			x = Math.min(self.innerWidth, document.documentElement.clientWidth);
            y = Math.min(self.innerHeight, document.documentElement.clientHeight);
		}
		// opera etc.
		else if (document.body.clientWidth)	
		{
			x = Math.min(self.innerWidth, document.body.clientWidth);
            y = Math.min(self.innerHeight, document.body.clientHeight);
		}
		else
		{
			x = self.innerWidth;
			y = self.innerHeight;
		}		
	}
	// Explorer 6 Strict Mode
	// ----------------------
	else if (document.documentElement && document.documentElement.clientHeight)				
	{
		x = document.documentElement.clientWidth;
		y = document.documentElement.clientHeight;
	}
	// Other Explorers
	// ----------------
	else if (document.body)
	{
		x = document.body.clientWidth;
		y = document.body.clientHeight;				
	}
	
	//----- renvoi la bonne dimension
	return { width : x, height : y };
}

//----------------------------------------------------------------||
// FUNCTION:	getScrollingOffset                                ||
// PARAMETERS:  strDim  = string ('x':width ou 'y':height)        ||
// RETURNS:     x or y	= dimensions 			                  ||
// PURPOSE:     Retrieve the scrolling offset of document or page ||
// VERSION:     v1.0 (version très aboutie)		                  ||
//----------------------------------------------------------------||
function getScrollingOffset(strDim)
{    
	var x,y;
	
	// All except Explorer
	// --------------------
	if (self.pageYOffset)
	{
		x = self.pageXOffset;
		y = self.pageYOffset;
	}
	
	// Explorer 6 Strict
	// -----------------
	else if (document.documentElement && document.documentElement.scrollTop)
	{
		x = document.documentElement.scrollLeft;
		y = document.documentElement.scrollTop;
	}
	// All other Explorers
	// -------------------
	else if (document.body)
	{
		x = document.body.scrollLeft;
		y = document.body.scrollTop;
	}
	
	//----- renvoi la bonne dimension
	return eval(strDim=='x'?x:y);
}

//----------------------------------------------------------------||
// FUNCTION:	getPageDimension                                  ||
// PARAMETERS:  strDim  = string ('x':width ou 'y':height)        ||
// RETURNS:     x or y	= dimensions 			                  ||
// PURPOSE:     Retrieve width or height of the total page        ||
// VERSION:     v1.0 (version très aboutie)		                  ||
//----------------------------------------------------------------||
function getPageDimension(strDim)
{
	var x,y;
	var test1 = document.body.scrollHeight;
	var test2 = document.body.offsetHeight; 
	
	// All but Explorer Mac
	// ---------------------
	if (test1 > test2)
	{
		x = document.body.scrollWidth;
		y = document.body.scrollHeight;
	}
	// Explorer Mac;
	// Would also work in Explorer 6 Strict, Mozilla and Safari
	// ---------------------------------------------------------
	else
	{
		x = document.body.offsetWidth;
		y = document.body.offsetHeight;
	}
	
	//----- renvoi la classe des dimensions
	return eval(strDim=='x'?x:y);
}

function findPosX(o)
{
	var x = 0;
	if (o.offsetParent)
	{
		while (o.offsetParent)
		{
			x += o.offsetLeft;
			o = o.offsetParent;
		}
	}
	else if (o.x) { x += o.x; }
	return x; // ne prend pas en compte le margin : posX = posX + margin
}

function findPosY(o)
{
	var y = 0;	
	if (o.offsetParent)
	{
		while (o.offsetParent)
		{
			y += o.offsetTop;
			o = o.offsetParent;
		}
	}
	else if (o.y) { y += o.y; }
	return y; //ne prend pas en compte le margin : posY = posY + margin
}
//-->