/* ================================================================================================
 * Fonctions de base utilisees dans l'ensmeble des scripts
 * ================================================================================================
 */
 
/*
 * Constantes predefinies 
 * ================================================================================================
 */
var Mozilla = (navigator.appName == "Netscape");
var IE 		= (navigator.appName == "Microsoft Internet Explorer");
var cValSS	= Math.pow(-2,31);
var cValSO	= null;

/*** Format d'export */
//var cFormatJPG=1;
//var cFormatPNG=2;
//var cFormatTIF=3;
//var cFormatPDF=4;
//var cFormatSLK=5;

var cFormatPDF = 1;
var cFormatExcel = 2;
var cFormatOpenOffice = 3;
var cFormatCSV = 4;
var cFormatJPG = 5;
var cFormatPNG = 6;
var cFormatTIF = 7;
var cFormatImprimante = 8;
var cFormatWord = 9;

/*
 * Surcharge des types predefinis
 * ================================================================================================
 */
/*** Implementation pour firefox de la fonction swapNode :echange de 2 noeuds dans un arbre. */
if (Mozilla)
{
	Node.prototype.swapNode = function (node) {
		var nextSibling = this.nextSibling;
		var parentNode = this.parentNode;
		node.parentNode.replaceChild(this, node);
		parentNode.insertBefore(node, nextSibling);
	}
};

/*** Implementation de la méthode getType pour l'object window (pour Reperes) */
window.getType = function(){
	return getObjectType.call(this);	
};


/*** Implementation de la méthode getUrlReperes pour l'objet window (pour Reperes) */
window.getUrlReperes	= function(){ 
	var strAdresse = document.location.href;
	strAdresse = strAdresse.replace("/MultiCollectivites", "");
	strAdresse = strAdresse.replace("/MonoCollectivite", "");
	strAdresse = strAdresse.slice(0, strAdresse.lastIndexOf("/")+1);
	return strAdresse;
};

/*** Implementation de la méthode getType pour le type Array */
Array.prototype.getType = function(){	
	return getObjectType.call(this);	
};


/*** Implementation de la méthode toInteger pour le type Boolean : conversion d'un booleen en entier */
Boolean.prototype.toInteger = function (){
	if (this == true){
		return 1;
	}
	else{
		return 0;
	}
};

/*** Implementation de la méthode Arrondir pour le type Number : correction du bug de la fonction round pour certaines valeurs */
Number.prototype.Arrondir = function(intNbDecimales){
	if (isNaN(intNbDecimales)){return NaN;}

	if (intNbDecimales>0){
		return Math.round(Math.pow(10,intNbDecimales)*parseFloat(this))/Math.pow(10,intNbDecimales);
	}
	else{
		return Math.round(parseFloat(this));
	}
};

/*** Implementation de la méthode Arrondir pour le type String : correction du bug de la fonction round pour certaines valeurs */
String.prototype.Arrondir = function(intNbDecimales){
	if (isNaN(this)){return NaN;}
	if (isNaN(intNbDecimales)){return NaN;}

	if (intNbDecimales>0){
		return Math.round(Math.pow(10,intNbDecimales)*parseFloat(this))/Math.pow(10,intNbDecimales);
	}
	else{
		return Math.round(parseFloat(this));
	}
};

/*
 * Fonctions communes
 * ================================================================================================
 */

/*** Classe de gestion des erreurs : Affichage d'une alerte avec le descriptif de l'erreur  */
function Erreur(strNomFonction, err, strInformation){
	var strMessage  = "----------------------------------------------------------------------------------------\n"
					+ "Fonction			: "	+	strNomFonction	+ "\n"
					+ "----------------------------------------------------------------------------------------\n"
					+ "Exception		: " + err.name + "\n"
					+ "Description		: " + err.message + "\n";
	if (typeof strInformation != "undefined"){
		strMessage += "----------------------------------------------------------------------------------------\n"
					+ "Informations		:\n" + strInformation;
	}
	
	/* Utilisation de l'objet de debuggage console de firebug si possible */
	try{
		console.error(strMessage);
	}catch(c){
		alert(strMessage);
	}

	if (this.Chargement){
		this.Chargement(false);
	}else if (parent.Chargement){
		parent.Chargement(false);
	}else if (window.WebReperesMulti){
		window.WebReperesMulti.Chargement(false);
	}else if (window.WebReperesMono){
		window.WebReperesMono.Chargement(false);
	}else if (parent.WebReperesMulti){
		parent.WebReperesMulti.Chargement(false);
	}else if (parent.WebReperesMono){
		parent.WebReperesMono.Chargement(false);
	}
};

/*** Fonction permettant d'obtenir le nom de la classe constructeur d'un objet de type Object */
function getObjectType(obj)
{
	if (!obj){
		obj= this;
	}
	var strTmp = "undefined";
	try{
		if (typeof obj == "object"){
			if (obj.constructor){
				strTmp = obj.constructor.toString().replace(/function/i, "").replace(/ /i, "").replace("\n","");
				strTmp = strTmp.substring(0, strTmp.indexOf("("));
			}
		}
		else{
			strTmp = typeof obj;
		}
	}
	catch(error){
		Erreur("Object.getObjectType" , error);
	}
	finally{
		return strTmp;
	}
};

/*** Fonction de gestion de la memoire qui brise toutes les references internes d'un objet (sauf l'objet parent caller) */
function DisposeObject(){
	 for (var prop in this){
		try{
			if (typeof this[prop] == "object"){
				if (prop != "caller"
				 && prop != "objAfterRequest"
				 && prop != "fnAfterRequest"
				 && this[prop] != null
				 && this[prop].dispose){
					this[prop].dispose();
				}
			}
			this[prop] = null;
			delete this[prop];
		}
		catch(ex){}
	}
};

/*** Fonction de serialisation XML d'un objet */
function SerialiserObjet()
{
	var strChaineXmlTmp;
	var strNomBalise;
	var objTmp;

	try{
		if (getObjectType(this) == "Collection")
		{
			strNomBalise = this.classe + "s";
			objTmp = this.item;
		}
		else
		{
			strNomBalise = getObjectType(this);
			objTmp = this;
		}

		strChaineXmlTmp = "<" + strNomBalise;

		for (var prop in objTmp)
		{
			if ((typeof objTmp[prop] != "object" || getObjectType(objTmp[prop]) == "Array"  )
			&& typeof objTmp[prop] != "function")
			{
				if (prop.toString().charAt(0) == "m")
					var nomProp = prop.toString().slice(1, prop.toString().length);
				else
					var nomProp = prop.toString();

				try{
					if (objTmp[prop].constructor != Boolean)
					{
						var valProp = objTmp[prop].toString();

						valProp = valProp.replace(/>/g, "&gt;");
						valProp = valProp.replace(/</g, "&lt;");
						valProp = valProp.replace(/\"/g, "&quot;");
						valProp = valProp.replace(/\n/g, "");
						strChaineXmlTmp += " " + nomProp + "=\"" + valProp + "\"";
					}
					else
					{
						strChaineXmlTmp += " " + nomProp + "=\"" + objTmp[prop].toInteger().toString() + "\"";
					}
				}
				catch(e){alert(prop + " : " + objTmp[prop]);}
			}
			if (typeof objTmp[prop] == "function" && prop.toString() == "Cle")
			{   strChaineXmlTmp += " " + prop.toString() + "=\"" + eval("objTmp." + prop.toString() + "()") + "\"";
			}
		}
		strChaineXmlTmp += ">";

		for (var prop in objTmp)
		{
			if (typeof objTmp[prop] == "object" && getObjectType(objTmp[prop]) != "Array")
			{	try{
					strChaineXmlTmp += objTmp[prop].serialize();
				}
				catch(e){alert(prop.toString() + ": pas de fonction serialize"); }
			}
		}
		strChaineXmlTmp += "</" + strNomBalise + ">";
	}
	catch(error){
		Erreur("SerialiserObjet.call" , error);
		strChaineXmlTmp = undefined;
	}
	finally{
		objTmp = null;
		prop = null;
		return strChaineXmlTmp;
	}
};


/*** Fonction qui force la saisie d'un entier (caractere numerique uniquement) */
function ForceInteger(oEvent)
{
	var myEvent		= (document.all ? window.event : oEvent);
	var KeyAscii	= (document.all ? window.event.keyCode : oEvent.which);

	var strListeCaracteresAutorises = "0123456789";

	/* on controle qu'on a bien saisi un caractere autorise*/
	if ( KeyAscii!= 0 && (strListeCaracteresAutorises.indexOf(String.fromCharCode(KeyAscii)) == -1 || KeyAscii == 13) )
	{	blnReturnValue = false;	}
	else
	{	blnReturnValue = true;	}

	/* test navigateur*/
	if (document.all)
		myEvent.returnValue = blnReturnValue;
	else
	{	if (!blnReturnValue)
			myEvent.preventDefault();
	}

};

/*** Fonction qui force la saisie d'un numerique (caractere numerique + ponctuation) */
function ForceNumber(oEvent)
{
	var myEvent		= (document.all ? window.event : oEvent);
	var KeyAscii	= (document.all ? window.event.keyCode : oEvent.which);

	var strListeCaracteresAutorises = "0123456789.,";

	/* on controle qu'on a bien saisi un caractere autorise*/
	if ( KeyAscii!= 0 && (strListeCaracteresAutorises.indexOf(String.fromCharCode(KeyAscii)) == -1 || KeyAscii == 13) )
	{	blnReturnValue = false;	}
	else
	{	blnReturnValue = true;	}

	/* test navigateur*/
	if (document.all)
		myEvent.returnValue = blnReturnValue;
	else
	{	if (!blnReturnValue)
			myEvent.preventDefault();
	}

};

/* -------------------------------------------------------------------------------------------------------------------------
 *  Fonction qui empeche force la saisie d'un caratère unicode interdit par la liste suivante
 * -------------------------------------------------------------------------------------------------------------------------
 * |	!	|	\u0021	|	"	|	\u0022	|	#	|	\u0023	|	$	|	\u0024	|	%	|	\u0025	|	&	|	\u0026	|
 * |	'	|	\u0027	|	(	|	\u0028	|	)	|	\u0029	|	*	|	\u002a	|	+	|	\u002b	|	,	|	\u002c	|
 * |	-	|	\u002d	|	.	|	\u002e	|	/	|	\u002f	|	:	|	\u003a	|	;	|	\u003b	|	<	|	\u003c	|
 * |	=	|	\u003d	|	>	|	\u003e	|	?	|	\u003f	|	@	|	\u0040	|	[	|	\u005b	|	\	|	\u005c	|
 * |	]	|	\u005d	|	^	|	\u005e	|	`	|	\u0060	|	{	|	\u007b	|	|	|	\u007c	|	}	|	\u007d	|
 * |	~	|	\u007e	|	¡	|	\u00a1	|	¢	|	\u00a2	|	£	|	\u00a3	|	¤	|	\u00a4	|	¥	|	\u00a5	|
 * |	¦	|	\u00a6	|	§	|	\u00a7	|	¨	|	\u00a8	|	©	|	\u00a9	|	ª	|	\u00aa	|	«	|	\u00ab	|
 * |	¬	|	\u00ac	|	­	|	\u00ad	|	®	|	\u00ae	|	¯	|	\u00af	|	°	|	\u00b0	|	±	|	\u00b1	|
 * |	²	|	\u00b2	|	³	|	\u00b3	|	´	|	\u00b4	|	µ	|	\u00b5	|	¶	|	\u00b6	|	·	|	\u00b7	|
 * |	¸	|	\u00b8	|	¹	|	\u00b9	|	º	|	\u00ba	|	»	|	\u00bb	|	¼	|	\u00bc	|	½	|	\u00bd	|
 * |	¾	|	\u00be	|	¿	|	\u00bf	|	À	|	\u00c0	|	Á	|	\u00c1	|	Â	|	\u00c2	|	Ã	|	\u00c3	|
 * |	Ä	|	\u00c4	|	Å	|	\u00c5	|	Æ	|	\u00c6	|	Ç	|	\u00c7	|	È	|	\u00c8	|	É	|	\u00c9	|
 * |	Ê	|	\u00ca	|	Ë	|	\u00cb	|	Ì	|	\u00cc	|	Í	|	\u00cd	|	Î	|	\u00ce	|	Ï	|	\u00cf	|
 * |	Ð	|	\u00d0	|	Ñ	|	\u00d1	|	Ò	|	\u00d2	|	Ó	|	\u00d3	|	Ô	|	\u00d4	|	Õ	|	\u00d5	|
 * |	Ö	|	\u00d6	|	×	|	\u00d7	|	Ø	|	\u00d8	|	Ù	|	\u00d9	|	Ú	|	\u00da	|	Û	|	\u00db	|
 * |	Ü	|	\u00dc	|	Ý	|	\u00dd	|	Þ	|	\u00de	|	ß	|	\u00df	|	à	|	\u00e0	|	á	|	\u00e1	|
 * |	â	|	\u00e2	|	ã	|	\u00e3	|	ä	|	\u00e4	|	å	|	\u00e5	|	æ	|	\u00e6	|	ç	|	\u00e7	|
 * |	è	|	\u00e8	|	é	|	\u00e9	|	ê	|	\u00ea	|	ë	|	\u00eb	|	ì	|	\u00ec	|	í	|	\u00ed	|
 * |	î	|	\u00ee	|	ï	|	\u00ef	|	ð	|	\u00f0	|	ñ	|	\u00f1	|	ò	|	\u00f2	|	ó	|	\u00f3	|
 * |	ô	|	\u00f4	|	õ	|	\u00f5	|	ö	|	\u00f6	|	÷	|	\u00f7	|	ø	|	\u00f8	|	ù	|	\u00f9	|
 * |	ú	|	\u00fa	|	û	|	\u00fb	|	ü	|	\u00fc	|	ý	|	\u00fd	|	þ	|	\u00fe	|	ÿ	|	\u00ff	|
 * -------------------------------------------------------------------------------------------------------------------------
 */
function PreventUnicodeChar(oEvent)
{
	var myEvent		= (document.all ? window.event : oEvent);
	var KeyAscii	= (document.all ? window.event.keyCode : oEvent.which);

	var strListeCaracteresInterdits = " "
+ "\u0021" + "\u0022" + "\u0023" +"\u0024" + "\u0025" + "\u0026"
+ "\u0027" + "\u0028" + "\u0029" +"\u002a" + "\u002b" + "\u002c"
+ "\u002d" + "\u002e" + "\u002f" +"\u003a" + "\u003b" + "\u003c"
+ "\u003d" + "\u003e" + "\u003f" +"\u0040" + "\u005b" + "\u005c"
+ "\u005d" + "\u005e" + "\u0060" +"\u007b" + "\u007c" + "\u007d"
+ "\u007e" + "\u00a1" + "\u00a2" +"\u00a3" + "\u00a4" + "\u00a5"
+ "\u00a6" + "\u00a7" + "\u00a8" +"\u00a9" + "\u00aa" + "\u00ab"
+ "\u00ac" + "\u00ad" + "\u00ae" +"\u00af" + "\u00b0" + "\u00b1"
+ "\u00b2" + "\u00b3" + "\u00b4" +"\u00b5" + "\u00b6" + "\u00b7"
+ "\u00b8" + "\u00b9" + "\u00ba" +"\u00bb" + "\u00bc" + "\u00bd"
+ "\u00be" + "\u00bf" + "\u00c0" +"\u00c1" + "\u00c2" + "\u00c3"
+ "\u00c4" + "\u00c5" + "\u00c6" +"\u00c7" + "\u00c8" + "\u00c9"
+ "\u00ca" + "\u00cb" + "\u00cc" +"\u00cd" + "\u00ce" + "\u00cf"
+ "\u00d0" + "\u00d1" + "\u00d2" +"\u00d3" + "\u00d4" + "\u00d5"
+ "\u00d6" + "\u00d7" + "\u00d8" +"\u00d9" + "\u00da" + "\u00db"
+ "\u00dc" + "\u00dd" + "\u00de" +"\u00df" + "\u00e0" + "\u00e1"
+ "\u00e2" + "\u00e3" + "\u00e4" +"\u00e5" + "\u00e6" + "\u00e7"
+ "\u00e8" + "\u00e9" + "\u00ea" +"\u00eb" + "\u00ec" + "\u00ed"
+ "\u00ee" + "\u00ef" + "\u00f0" +"\u00f1" + "\u00f2" + "\u00f3"
+ "\u00f4" + "\u00f5" + "\u00f6" +"\u00f7" + "\u00f8" + "\u00f9"
+ "\u00fa" + "\u00fb" + "\u00fc" +"\u00fd" + "\u00fe" + "\u00ff";

	/* on controle qu'on a bien saisi un caractere autorise*/
	if ( KeyAscii!= 0 && (strListeCaracteresInterdits.indexOf(String.fromCharCode(KeyAscii)) >= 0 || KeyAscii==13) )
	{	blnReturnValue = false;	}
	else
	{	blnReturnValue = true;	}

	/* test navigateur*/
	if (document.all){
		myEvent.returnValue = blnReturnValue;
	}else{
		if (!blnReturnValue){
			myEvent.preventDefault();
		}
	}
};

/*
 * Fonction qui recopie les regles d'une classe CSS dans le style d'un element HTML
 */
function TransfertCSStoStyle(objHTMLElement, strClassName)
{
	var objRule;
	var objStyle;

	try
	{
		/* Recherche du style*/
		for (var i=0; i<document.styleSheets[0].rules.length; i++)
		{
			objRule = document.styleSheets[0].rules[i];
			if (objRule.selectorText == "." + strClassName)
			{
				objStyle = document.styleSheets[0].rules[i].style;
				break;
			}
		}

		/* Copie du style*/
		if (objStyle)
		{
			for (var propStyle in objStyle)
			{
				if (objStyle[propStyle]!="")
				{
					objHTMLElement.style[propStyle] = objStyle[propStyle];
				}
			}
		}
	}
	catch(Error)
	{

		alert("Erreur : TransfertCSSStyle");
	}
};

/*
 * Fonction qui convertit une chaine representant une taille en pixels en entier
 */
function pxToInt(strValeur)
{
	if (strValeur == "")
		return 0;
	else
		return parseInt(strValeur.toString().replace(/px/i,""));
};

/*
 * Fonction qui coche une case a cocher dans une liste a partir d'une valeur
 */
function CheckElement(arrElements, value){
	for (var i=0; i<arrElements.length; i++){
		arrElements[i].checked = (arrElements[i].value == value);
	}
};

/*
 * Implementation de la methode contains sur le type HTMLElement
 */
if(typeof HTMLElement!="undefined" && !HTMLElement.prototype.contains){

	HTMLElement.prototype.contains = function(objHTMLElement){
		for (var i=0; i<this.getElementsByTagName(objHTMLElement.tagName).length; i++){
			if ( this.getElementsByTagName(objHTMLElement.tagName)[i] == objHTMLElement){
				return true;
			}
		}
		return false;
	};
};
/*
 * outerHTML()
 * for Netscape 6/Mozilla by Thor Larholm me@jscript.dk
 * Usage: include this code segment at the beginning of your document
 * before any other Javascript contents.
 */
 
if(typeof HTMLElement!="undefined" && !HTMLElement.prototype.outerHTML){

	HTMLElement.prototype.outerHTML = function () {

	var emptyElements		= {HR: true, BR: true, IMG: true, INPUT: true	};
	var specialElements	= {TEXTAREA: true};

	var html = '';
	switch (this.nodeType) {
		case this.ELEMENT_NODE:
		html += '<';
		html += this.nodeName;
		if (!specialElements[this.nodeName]) {
			for (var a = 0; a < this.attributes.length; a++)
			html += ' ' + this.attributes[a].nodeName.toUpperCase() +
					'="' + this.attributes[a].nodeValue + '"';
			html += '>';
			if (!emptyElements[this.nodeName]) {
			html += this.innerHTML;
			html += '<\/' + this.nodeName + '>';
			}
		}
		else switch (this.nodeName) {
			case 'TEXTAREA':
			for (var a = 0; a < this.attributes.length; a++)
				if (this.attributes[a].nodeName.toLowerCase() != 'value')
				html += ' ' + this.attributes[a].nodeName.toUpperCase() +
						'="' + this.attributes[a].nodeValue + '"';
				else
				var content = this.attributes[a].nodeValue;
			html += '>';
			html += content;
			html += '<\/' + this.nodeName + '>';
			break;
		}
		break;
		case this.TEXT_NODE:
		html += this.nodeValue;
		break;
		case this.COMMENT_NODE:
		html += '<!' + '--' + this.nodeValue + '--' + '>';
		break;
	}
	return html;
	};
};

/*
 * insertAdjacentHTML(), insertAdjacentText() and insertAdjacentElement()
 * for Netscape 6/Mozilla by Thor Larholm me@jscript.dk
 * Usage: include this code segment at the beginning of your document
 * before any other Javascript contents.
 */
if(typeof HTMLElement!="undefined" && !
HTMLElement.prototype.insertAdjacentElement){

	HTMLElement.prototype.insertAdjacentElement = function(where,parsedNode)
	{
		switch (where){
		case "beforeBegin":
			this.parentNode.insertBefore(parsedNode,this);
			break;
		case "afterBegin":
			this.insertBefore(parsedNode,this.firstChild);
			break;
		case "beforeEnd":
			this.appendChild(parsedNode);
			break;
		case "afterEnd":
			if (this.nextSibling)
			this.parentNode.insertBefore(parsedNode,this.nextSibling);
			else this.parentNode.appendChild(parsedNode);
			break;
		}
	};

	HTMLElement.prototype.insertAdjacentHTML = function(where,htmlStr)
	{
		var r = this.ownerDocument.createRange();
		r.setStartBefore(this);
		var parsedHTML = r.createContextualFragment(htmlStr);
		this.insertAdjacentElement(where,parsedHTML)
	};


	HTMLElement.prototype.insertAdjacentText = function(where,txtStr)
	{
		var parsedText = document.createTextNode(txtStr);
		this.insertAdjacentElement(where,parsedText);
	};
};

/*
 * Fonction qui ajoute un filtre opaque sur un object HTML
 */
function lightup(obj, opacity){
	try{
		if (navigator.appName.indexOf("Netscape")!=-1&&parseInt(navigator.appVersion)>=5){
			obj.style.MozOpacity=opacity/100;
		}else if (navigator.appName.indexOf("Microsoft")!=-1&&parseInt(navigator.appVersion)>=4){
			if (opacity == 100){
				obj.style.filter = "";
			}else{
				obj.style.filter = "alpha(opacity=" + opacity + ")";
			}
		}
	}
	catch(e){}
};

/*
 * Fonction permettant de faire un include "dynamique"
 */
function include(fichier){
	var HEAD = document.getElementsByTagName("head");
	var SCRIPT = document.createElement("script");
	SCRIPT.type = "text/javascript";
	SCRIPT.src  = fichier;
	HEAD[0].appendChild(SCRIPT);

	SCRIPT = null;
	HEAD = null;
};

/*
 * PortableDrag.js:
 * beginDrag() is designed to be called from an onmousedown event handler.
 * elementToDrag may be the element that received the mousedown event, or it
 * may be some containing element.  event must be the Event object for the
 * mousedown event.  This implementation works with both the DOM Level 2
 * event model and the IE Event model.
 */
function beginDrag(elementToDrag, oEvent, blnLockDragX, blnLockDragY) {

	var myevent		= (document.all ? window.event : oEvent);
	/*
	 * Compute the distance between the upper-left corner of the element
	 * and the mouse click. The moveHandler function below needs these values.
	 */

    var deltaX = myevent.clientX - parseInt(elementToDrag.style.left);
    var deltaY = myevent.clientY - parseInt(elementToDrag.style.top);

    /* Register the event handlers that will respond to the mousemove events
     * and the mouseup event that follow this mousedown event.
     */
    if (document.addEventListener) {  /* DOM Level 2 Event Model*/
		/* Register capturing event handlers */
	    document.addEventListener("mousemove", moveHandler, true);
		document.addEventListener("mouseup", upHandler, true);
    }
    else if (document.attachEvent) {  /* IE 5+ Event Model*/
		/* In the IE Event model, we can't capture events, so these handlers
		 * are triggered when only if the event bubbles up to them.
		 * This assumes that there aren't any intervening elements that
		 * handle the events and stop them from bubbling.
		 */
		document.attachEvent("onmousemove", moveHandler);
		document.attachEvent("onmouseup", upHandler);
    }
    else {                            /* IE 4 Event Model*/
		/* In IE 4 we can't use attachEvent(), so assign the event handlers
		 * directly after storing any previously assigned handlers so they
		 * can be restored.  Note that this also relies on event bubbling.
		 */
		var oldmovehandler = document.onmousemove;
		var olduphandler = document.onmouseup;
		document.onmousemove = moveHandler;
		document.onmouseup = upHandler;
    }

    /* We've handled this event.  Don't let anybody else see it.*/
    if (myevent.stopPropagation) myevent.stopPropagation();   /* DOM Level 2*/
    else myevent.cancelBubble = true;                       /* IE */

    /*  Now prevent any default action. */
    if (myevent.preventDefault) myevent.preventDefault();     /* DOM Level 2*/
    else myevent.returnValue = false;                       /* IE*/

    /**
     * This is the handler that captures mousemove events when an element
     * is being dragged.  It is responsible for moving the element.
     **/
    function moveHandler(e) {
		if (!e) e = window.event;  /* IE event model*/

    /* 
     * Move the element to the current mouse position, adjusted as
     * necessary by the offset of the initial mouse click.
     */
		if (!blnLockDragX){
			elementToDrag.style.left = (e.clientX - deltaX) + "px";
		}
		if (!blnLockDragY){
			elementToDrag.style.top = (e.clientY - deltaY) + "px";
		}
		/* And don't let anyone else see this event.*/
		if (e.stopPropagation) e.stopPropagation();       /* DOM Level 2*/
		else e.cancelBubble = true;                       /* IE*/
    };

    /**
     * This is the handler that captures the final mouseup event that
     * occurs at the end of a drag.
     **/
    function upHandler(e) {
		if (!e) e = window.event;  /* IE event model*/
	
		/* Unregister the capturing event handlers.*/
		if (document.removeEventListener) {    /* DOM Event Model*/
		    document.removeEventListener("mouseup", upHandler, true);
		    document.removeEventListener("mousemove", moveHandler, true);
		}
		else if (document.detachEvent) {       /* IE 5+ Event Model*/
		    document.detachEvent("onmouseup", upHandler);
		    document.detachEvent("onmousemove", moveHandler);
		}
		else {                                 /* IE 4 Event Model*/
		    document.onmouseup = olduphandler;
		    document.onmousemove = oldmovehandler;
		}
	
		/* And don't let the event propagate any further.*/
		if (e.stopPropagation) e.stopPropagation();       /* DOM Level 2*/
		else e.cancelBubble = true;                       /* IE*/
    };
};
var  EventManager = {

    listeners: [],
/*
    initialise: function() {
        if (this.listeners == null) {
            this.listeners = [];
        }
    },
*/
	registerEvent: function(elt, evtType, obj, fn, captures) {


		var blnTrouve = false;
		var i=0;
		var listenerRegistred;
		var elementRegistred;
		var eventRegistred;

		/* enregistrement dans le registre du listener*/
		while (i<this.listeners.length && !blnTrouve){
			if (this.listeners[i][0] == obj){
				blnTrouve = true;
			}else{
				i++;
			}
		}
		if (blnTrouve){
			listenerRegistred = this.listeners[i];
		}else{
			this.listeners.push([obj, new Array()]);
			listenerRegistred = this.listeners[this.listeners.length-1];
		}

		/* enregistrement dans le registre de l'element cible */
		blnTrouve = false;
		i=0;
		while (i<listenerRegistred[1].length && !blnTrouve){
			if (listenerRegistred[1][i][0] == elt){
				blnTrouve = true;
			}else{
				i++;
			}
		}

		if (blnTrouve){
			elementRegistred =  listenerRegistred[1][i];
		}else{
			listenerRegistred[1].push([elt, new Array()]);
			elementRegistred = listenerRegistred[1][listenerRegistred[1].length-1];
		}

		/* enregistrement dans le registre du type de l'evenement et de la fonction lancee*/
		blnTrouve = false;
		i=0;
		while (i<elementRegistred[1].length && !blnTrouve){
			if (elementRegistred[1][i][0] == evtType){
				blnTrouve = true;
			}else{
				i++;
			}
		}

		if (blnTrouve){
			eventRegistred = elementRegistred[1][i];
		}else{
			elementRegistred[1].push([evtType, fn, captures]);
			eventRegistred = elementRegistred[1][elementRegistred[1].length-1];
		}

		/* enregistrement dans le gestionnaire d'evenement*/
		if (elementRegistred[0].addEventListener){
			elementRegistred[0].addEventListener(eventRegistred[0],
												 eventRegistred[1],
												 eventRegistred[2]);
		}
		else{
			elementRegistred[0].attachEvent	("on" + eventRegistred[0],
											 eventRegistred[1]);
	   }

		listenerRegistred = null;
		elementRegistred  = null;
		eventRegistred	  = null;
	},

	unregisterEvent: function(elt, evtType, obj) {

		var listenerRegistred;
		var elementRegistred;
		var eventRegistred;

		/* recherche dans le registre du listener*/
		var i=0;
		while (i<this.listeners.length && !listenerRegistred){
			if (this.listeners[i][0] == obj){
				listenerRegistred = this.listeners[i];

				/* recherche dans le registre de l'element cible*/
				var j=0;
				while (j<listenerRegistred[1].length && !elementRegistred){
					if (listenerRegistred[1][j][0] == elt){
						elementRegistred =  listenerRegistred[1][j];

						/* recherche dans le registre  de l'evenement*/
						var k=0;
						while (k<elementRegistred[1].length && !eventRegistred){

							if (elementRegistred[1][k][0] == evtType){
								eventRegistred = elementRegistred[1][k];

								/* suppression dans le registre de l'evenemt*/
								if (elementRegistred[0].removeEventListener){
									elementRegistred[0].removeEventListener(eventRegistred[0],
																			eventRegistred[1],
																			eventRegistred[2]);
								}
								else{
									elementRegistred[0].detachEvent	("on" + eventRegistred[0],
																	 		eventRegistred[1]);
							  	}

							  	elementRegistred[1].splice(k,1)

							}else{
								k++;
							}
						}
						if (elementRegistred[1].length == 0){
							listenerRegistred[1].splice(j,1);
						}

					}else{
						j++;
					}
				}
				if (listenerRegistred[1].length == 0){
					this.listeners.splice(i,1);
				}

			}else{
				i++;
			}
		}

		listenerRegistred = null;
		elementRegistred  = null;
		eventRegistred	  = null;

	},

	unregisterElement: function(elt, obj) {

		var listenerRegistred;
		var elementRegistred;
		var eventRegistred;

		/* recherche dans le registre du listener*/
		var i=0;
		while (i<this.listeners.length && !listenerRegistred){
			if (this.listeners[i][0] == obj){
				listenerRegistred = this.listeners[i];

				/* recherche dans le registre de l'element cible*/
				var j=0;
				while (j<listenerRegistred[1].length && !elementRegistred){

					if (listenerRegistred[1][j][0] == elt){
						elementRegistred =  listenerRegistred[1][j];

						/* recherche dans le registre  de l'evenement*/
						while (elementRegistred[1].length>0){

							eventRegistred = elementRegistred[1][0];

							/* suppression dans le registre de l'evenemt*/
								if (elementRegistred[0].removeEventListener){
									elementRegistred[0].removeEventListener(eventRegistred[0],
																			eventRegistred[1],
																			eventRegistred[2]);
								}
								else{
									elementRegistred[0].detachEvent	("on" + eventRegistred[0],
																	 		eventRegistred[1]);
							  	}

						  	elementRegistred[1].splice(0,1);
						}

						listenerRegistred[1].splice(j,1);

					}else{
						j++;
					}
				}
				if (listenerRegistred[1].length == 0){
					this.listeners.splice(i,1);
				}

			}else{
				i++;
			}
		}

		listenerRegistred = null;
		elementRegistred  = null;
		eventRegistred	  = null;
	},

	unregisterListener: function(obj) {

		var listenerRegistred;
		var elementRegistred;
		var eventRegistred;

		/* recherche dans le registre du listener*/
		var i=0;
		while (i<this.listeners.length && !listenerRegistred){

			if (this.listeners[i][0] == obj){

				listenerRegistred = this.listeners[i];

				/* recherche dans le registre de l'element cible*/
				while (listenerRegistred[1].length>0){

					elementRegistred =  listenerRegistred[1][0];

					/* recherche dans le registre  de l'evenement*/
					while (elementRegistred[1].length>0){

						eventRegistred = elementRegistred[1][0];

						/* suppression dans le registre de l'evenemt*/
							if (elementRegistred[0].removeEventListener){
								elementRegistred[0].removeEventListener(eventRegistred[0],
																		eventRegistred[1],
																		eventRegistred[2]);
							}
							else{
								elementRegistred[0].detachEvent	("on" + eventRegistred[0],
																 		eventRegistred[1]);
						  	}

					  	elementRegistred[1].splice(0,1);
					}
					listenerRegistred[1].splice(0,1);
				}
				this.listeners.splice(i,1);

			}else{
				i++;
			}
		}

		listenerRegistred = null;
		elementRegistred  = null;
		eventRegistred	  = null;
	},

	unregisterAll: function(obj, elt) {

		var listenerRegistred;
		var elementRegistred;
		var eventRegistred;

		/* recherche dans le registre du listener*/
		while (EventManager.listeners.length>0){

			listenerRegistred = EventManager.listeners[0];

			/* recherche dans le registre de l'element cible*/
			while (listenerRegistred[1].length>0){

				elementRegistred =  listenerRegistred[1][0];

				/* recherche dans le registre  de l'evenement*/
				while (elementRegistred[1].length>0){

					eventRegistred = elementRegistred[1][0];

					/* suppression dans le registre de l'evenement*/
					if (elementRegistred[0].removeEventListener){
						elementRegistred[0].removeEventListener(eventRegistred[0],
																eventRegistred[1],
																eventRegistred[2]);
					}
					else{
						elementRegistred[0].detachEvent	("on" + eventRegistred[0],
														 		eventRegistred[1]);
				  	}

				  	elementRegistred[1].splice(0,1);
				}
				listenerRegistred[1].splice(0,1);
			}
			this.listeners.splice(0,1);
		}

		listenerRegistred = null;
		elementRegistred  = null;
		eventRegistred	  = null;
	},

	add: function(element, eventtype, listener, captures) {

/*		this.initialise();*/

		var fnEvent = function(event) { listener.handleEvent(event); };
		this.registerEvent(	element, eventtype, listener, fnEvent, captures);
		fnEvent = null;

	},

	remove: function(element, eventtype, listener) {
		this.unregisterEvent(element, eventtype, listener);
	}
}
// mozXPath [http://km0ti0n.blunted.co.uk/mozxpath/] km0ti0n@gmail.com
// Code licensed under Creative Commons Attribution-ShareAlike License
// http://creativecommons.org/licenses/by-sa/2.5/
if( document.implementation.hasFeature("XPath", "3.0") )
{
	XMLDocument.prototype.selectNodes = function(cXPathString, xNode)
	{
		if( !xNode ) { xNode = this; }

		var oNSResolver = this.createNSResolver(this.documentElement);
		var aItems = this.evaluate(cXPathString, xNode, oNSResolver, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
		var aResult = [];
		for( var i = 0; i < aItems.snapshotLength; i++)
		{
			aResult[i] =  aItems.snapshotItem(i);
		}

		return aResult;
	}
	XMLDocument.prototype.selectSingleNode = function(cXPathString, xNode)
	{
		if( !xNode ) { xNode = this; }

		var xItems = this.selectNodes(cXPathString, xNode);
		if( xItems.length > 0 )
		{
			return xItems[0];
		}
		else
		{
			return null;
		}
	}

	Element.prototype.selectNodes = function(cXPathString)
	{
		if(this.ownerDocument.selectNodes)
		{
			return this.ownerDocument.selectNodes(cXPathString, this);
		}
		else{throw "For XML Elements Only";}
	}

	Element.prototype.selectSingleNode = function(cXPathString)
	{
		if(this.ownerDocument.selectSingleNode)
		{
			return this.ownerDocument.selectSingleNode(cXPathString, this);
		}
		else{throw "For XML Elements Only";}
	}
}
// Create the loadXML method and xml getter for Mozilla
if (window.DOMParser &&
	window.XMLSerializer &&
	window.Node && Node.prototype && Node.prototype.__defineGetter__) {

	// XMLDocument did not extend the Document interface in some versions
	// of Mozilla. Extend both!
	//XMLDocument.prototype.loadXML =
	Document.prototype.loadXML = function (s) {

		// parse the string to a new doc
		var doc2 = (new DOMParser()).parseFromString(s, "text/xml");

		// remove all initial children
		while (this.hasChildNodes())
			this.removeChild(this.lastChild);

		// insert and import nodes
		for (var i = 0; i < doc2.childNodes.length; i++) {
			this.appendChild(this.importNode(doc2.childNodes[i], true));
		}
	};


	/*
	 * xml getter
	 *
	 * This serializes the DOM tree to an XML String
	 *
	 * Usage: var sXml = oNode.xml
	 *
	 */
	// XMLDocument did not extend the Document interface in some versions
	// of Mozilla. Extend both!
	/*
	XMLDocument.prototype.__defineGetter__("xml", function () {
		return (new XMLSerializer()).serializeToString(this);
	});
	*/
	Document.prototype.__defineGetter__("xml", function () {
		return (new XMLSerializer()).serializeToString(this);
	});
}


function MozTransformXML(xmlDoc, strFeuilleXSL, tabParamXSL)
{
	var xsltProcessor = new XSLTProcessor();

	// Load the xsl file using synchronous (third param is set to false) XMLHttpRequest
	var myXMLHTTPRequest = new XMLHttpRequest();
	myXMLHTTPRequest.open("GET", strFeuilleXSL, false);
	myXMLHTTPRequest.send(null);

	//var xslRef = new getXMLDomObject();
	//xslRef.loadXML(myXMLHTTPRequest.responseText)
	var xslRef = myXMLHTTPRequest.responseXML;

	if (xslRef){
		// Finally import the .xsl
		xsltProcessor.importStylesheet(xslRef);

		try{
			for (var i=0; i<tabParamXSL.length; i++)
			{
				xsltProcessor.setParameter(null, tabParamXSL[i][0], tabParamXSL[i][1]);
			}
		}catch(errorNoParam){alert("error")}
		var ownerDocument = xsltProcessor.transformToDocument(xmlDoc);

		// resultat HTML
		if (ownerDocument.toString() == "[object HTMLDocument]"){
			return ownerDocument.childNodes[0].innerHTML;
		}else{
			// resultat texte => renvoie la chaine
			if (ownerDocument.childNodes[0].nodeName == "transformiix:result"){
				return ownerDocument.childNodes[0].textContent;
			}
			// resultat XML => renvoie la chaine xml
			else{
				return (new XMLSerializer()).serializeToString(ownerDocument.childNodes[0])
			}
		}
	}
	else{
		alert("La feuille de style '" + strFeuilleXSL + "' est introuvable.");
		return "La feuille de style '" + strFeuilleXSL + "' est introuvable.";
	}
}

function MSTransformXML(xmlDoc, strFeuilleXSL, tabParamXSL)
{
	var xslDoc				= new ActiveXObject("Msxml2.FreeThreadedDOMDocument.3.0");
	var xmlResultat			= new ActiveXObject("Msxml2.DOMDocument.3.0");
	var xslt				= new ActiveXObject("Msxml2.XSLTemplate.3.0");
	var xslProc;
	xslDoc.async = false;
	xslDoc.resolveExternals = false;
	xslDoc.load(strFeuilleXSL);

	if (xslDoc.parseError.errorCode != 0) {
		var myErr = xslDoc.parseError;
		alert("You have error " + myErr.reason);
	}
	else{
		xslt.stylesheet = xslDoc;
		xmlDoc.async = false;
		xmlDoc.resolveExternals = false;
	}

	if (xmlDoc.parseError.errorCode != 0) {
		var myErr = xmlDoc.parseError;
		alert("You have error " + myErr.reason);
	}
	else {
		xslProc = xslt.createProcessor();
		xslProc.input = xmlDoc;
		try{
			for (var i=0; i<tabParamXSL.length; i++)
			{
				xslProc.addParameter(tabParamXSL[i][0], tabParamXSL[i][1])
			}
		}catch(errorNoParam){}
		xslProc.transform();

		return xslProc.output.replace("UTF-16", "UTF-8");
	}
}

function getHTTPObject()
{
	var xmlhttp = false;

	if (typeof XMLHttpRequest != "undefined"){
	    xmlhttp =  new XMLHttpRequest();
	}
	else if (navigator.appName == "Microsoft Internet Explorer"){
	    xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	}
	else{
	    xmlhttp = false;
	}

	return xmlhttp;
}


function getXMLDomObject()
{
	var XmlDom = false;

	if (navigator.appName == "Microsoft Internet Explorer"){
	    XmlDom = new ActiveXObject("Msxml2.DOMDocument.3.0");
		XmlDom.async = false;
		XmlDom.resolveExternals = false;
	}
	else if (navigator.appName == "Netscape"){
		XmlDom = 	document.implementation.createDocument
					(
						"http://www.w3.org/1999/XML/",
						"xml",
						null
					);
	}
	else{
	    XmlDom = false;
	}


	return XmlDom;
}

function getXSLDomObject()
{
	var XslDom = false;

	if (navigator.appName == "Microsoft Internet Explorer"){
	    XslDom = new ActiveXObject("Msxml2.FreeThreadedDOMDocument.3.0");
		XslDom.async = false;
		XslDom.resolveExternals = false;
	}
	else if (navigator.appName == "Netscape"){
		XslDom = 	document.implementation.createDocument
					(
						"http://www.w3.org/1999/XSL/Transform",
						"stylesheet",
						null
					);
	}
	else{
	    XslDom = false;
	}


	return XslDom
}

function TransformXML(xmlDoc, strFeuilleXSL, tabParamXSL)
{
	var strResultat = false;

	if (navigator.appName == "Microsoft Internet Explorer"){
		strResultat = MSTransformXML(xmlDoc, strFeuilleXSL, tabParamXSL);
	}

	else if (navigator.appName == "Netscape"){
		strResultat = MozTransformXML(xmlDoc, strFeuilleXSL, tabParamXSL)
	}
	else{
		strResultat = false;
	}

	return strResultat

}

function CreateXMLHTTPRequestObject() {
	// Proprietes

	this.xhr_object    = new getHTTPObject();
	this.response      = null;
	this.ready         = true;
	this.asynchronous  = true;
	this.afterRequest	  = null;
	this.objAfterRequest  = null;
	this.fnAfterRequest	  = null;
	

	// Methodes

	// Appelle la fonction censee indiquer qu une communication est en cours
	// La fonction doit etre fournie par l utilisateur de la classe et doit prendre un booleen en parametre :
	//  - true  : la communication commence
	//  - false : la communication est terminee
	this.indicatorFunction = null;

	// Permet de definir la fonction qui servira d indicateur de communication
	this.setIndicatorFunction = function(func) {
		if(typeof(func) == "function") this.indicatorFunction = func;
	};

	// Passe en mode synchrone
	this.setSynchronous = function() {
		this.asynchronous = false;
	};

	// Passe en mode asynchrone
	this.setAsynchronous = function() {
		this.asynchronous = true;
	};

	// Lance une requete sur un fichier du serveur en passant eventuellement des parametres, avec la methode GET
	this.getFileGet = function(url, data) {
		return this.doRequest(url, "GET", data);
	};

	// Alias de this.getFileGet
	this.getFile = this.getFileGet;

	// Lance une requete sur un fichier du serveur en passant eventuellement des parametres, avec la methode POST
	this.getFilePost = function(url, data) {
		return this.doRequest(url, "POST", data);
	};

	// Recupere tous les header associes a l URL passee en parametre, ou juste le header passe en parametre s il est precise
	this.getFileHeader = function(url, header) {
		return this.doRequest(url, "HEAD", header);
	};

	// Effectue la requete proprement dite
	//  - method : GET, POST ou HEAD
	//  - url    : chemin vers un fichier
	//  - data   : donnees a transmettre (ex : a=5&foo=bar)
	this.doRequest = function(url, method, data) {
		if(!this.ready || !this.xhr_object) return false;

		// Recherche header_name dans tous les headers et retourne la valeur correspondante
		// ou "Header inconnu..." si header_name n a pas ete trouve
		function _getResponseHeader(headers, header_name) {
			if (headers)
			{
				var tmp = headers.split("\n");
				for(var i=0, n=tmp.length, t=[]; i<n-1; ++i) {
					t = tmp[i].split(": ");
					if(t[0].toLowerCase() == header_name.toLowerCase()) return t[1];
				}
			}
			return "Header inconnu...";
		};

		if(this.indicatorFunction) this.indicatorFunction(true);
		this.ready = false;

		// On copie la reference a l objet courant car il ne sera plus "dans le contexte"
		// au moment ou la fonction onreadystatechange sera executee
		var obj = this;
		function onreadystatechangeFunction() {
			if(obj.xhr_object.readyState != 4) return;
			if(obj.indicatorFunction) obj.indicatorFunction(false);

			if (obj.xhr_object.status == 200){
				
				var all_headers = obj.xhr_object.getAllResponseHeaders();
				if(method == "HEAD") {
					obj.response = data ? _getResponseHeader(all_headers, data) : all_headers;
				}
				else {
					var content_type = _getResponseHeader(all_headers, "Content-Type");
					if (content_type != "Header inconnu..." && (new RegExp("^text/xml.*$", "gi")).test(content_type))
						obj.response = obj.xhr_object.responseXML;
					else
						obj.response = obj.xhr_object.responseText;
				}
				if(obj.hasResponse()){
					var strResponse = obj.xhr_object.responseText;
					obj.validateRequest();
	
					if (typeof obj.fnAfterRequest != "undefined"){
						obj.fnAfterRequest.call(obj.objAfterRequest, strResponse);
					}
				}else{
					var strMessage  = "pas de reponse ";
					try{
						console.error(strMessage);
					}catch(c){
						alert(strMessage);
					}
					obj.cancelRequest();
				}
			}else{
				var strMessage  = "Requete status: " + obj.xhr_object.status;
				try{
					console.error(strMessage);
				}catch(c){
					alert(strMessage);
				}
				obj.cancelRequest();
			}
		}

		if(method == "GET" && typeof(data) != "undefined" && data != "") url += "?"+data;
		try{
			this.xhr_object.open(method, url, this.asynchronous);
		}
		catch(err){
			var strMessage  = "----------------------------------------------------------------------------------------\n"
							+ "Fonction			: CreateXMLHTTPRequestObject.doRequest\n"
							+ "----------------------------------------------------------------------------------------\n"
							+ "Exception		: " + err.name + "\n"
							+ "Description		: " + err.message + "\n"
							+ "method:			: " + method + "\n"
							+ "url:				: " + url + "\n";
			try{
				console.error(strMessage);
			}catch(c){
				alert(strMessage);
			}
		}

		if(this.asynchronous)
			this.xhr_object.onreadystatechange = onreadystatechangeFunction;

		if(data) {
			this.xhr_object.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		}else{
			data = null;
		}
		this.xhr_object.send(data);

		if(!this.asynchronous)
			onreadystatechangeFunction();

		return true;
	}

	// Retourne true si la reponse est arrivee, false sinon
	this.hasResponse = function() {
		return this.response != null;
	};

	// Retourne la reponse a la derniere requete
	this.getResponse = function() {
		//return this.response;
		return this.xhr_object;
	};

	// Valide la requete, une nouvelle requete peut etre faite avec ce meme objet
	this.validateRequest = function() {
		this.ready    = true;
		this.response = null;
	};

	// Annule la requete en cours
	this.cancelRequest = function() {
		this.xhr_object.abort();
		if(this.indicatorFunction) this.indicatorFunction(false);
		this.validateRequest();
	};

	// liberation memoire
	this.dispose = function(){
		DisposeObject.call(this);
	};
}



var objRequeteHTTP;

function callServer(url, strfnName, strObjName, blnAsynchronous)
{
	//alert("url: " + url + "\n" + "fn: "  + strfnName + "\n" + "Obj: " + strObjName + "\n");
	objRequeteHTTP = new CreateXMLHTTPRequestObject();
	try{
		objRequeteHTTP.objAfterRequest = eval(strObjName);
		if (typeof objRequeteHTTP.objAfterRequest != "undefined"){
			objRequeteHTTP.fnAfterRequest  = eval(strObjName + "." + strfnName);
		}else{
			objRequeteHTTP.fnAfterRequest  = eval(strfnName);
		}
		if (typeof blnAsynchronous == "boolean"){
			objRequeteHTTP.asynchronous	   = blnAsynchronous;
		}
		if (!objRequeteHTTP.getFile(url)) {
			Erreur("callServer", new Error(), "Le lancement de la requete a echoue.");
		}
	}catch(err){
		var strMessage  = "----------------------------------------------------------------------------------------\n"
						+ "Fonction			: callServer\n"
						+ "----------------------------------------------------------------------------------------\n"
						+ "Exception		: " + err.name + "\n"
						+ "Description		: " + err.message + "\n"
						+ "----------------------------------------------------------------------------------------\n"
						+ "method:			: " + method + "\n"
						+ "==================\n"
						+ "Parametres:		:\n"
						+ "==================\n"
						+ "url: " + url + "\n"					
						+ "strfnName: " + strfnName + "\n"
						+ "strObjName: " + strObjName + "\n"
						+ "blnAsynchronous: " + blnAsynchronous + "\n";
		try{
			console.error(strMessage);
			alert(strMessage);			
		}catch(c){
			alert(strMessage);
		}
	}
	finally{
		objRequeteHTTP = null;
	}
}
/* 
 * Client-side access to querystring name=value pairs
 * Version 1.2.3
 * 22 Jun 2005
 * Adam Vandenberg
 */
/* optionally pass a querystring to parse */
function Querystring(qs) {
	this.params = new Object();

	if (qs == null)		qs=location.search.substring(1,location.search.length);
	if (qs.length == 0) return;

/* 	Turn <plus> back to <space>
	See: http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.13.4.1 */
	qs = qs.replace(/\+/g, ' ');
	/* parse out name/value pairs separated via & */
	var args = qs.split('&');

/* split out each name=value pair */
	for (var i=0;i<args.length;i++) {
		var value;
		var pair = args[i].split('=');
		var name = unescape(pair[0]);

		if (pair.length == 2){
			value = unescape(pair[1]);
		}else{
			value = name;
		}
		this.params[name] = value;
	}
};

Querystring.prototype.get = function(key, default_) {
	/* This silly looking line changes UNDEFINED to NULL */
	if (default_ == null) default_ = null;

	var value=this.params[key];
	if (value==null) value=default_;

	return value;
};/*
 * Classe Cookie
 * Gestion des cookies en javascript
 * (fortement inspire par http://www.codehouse.com/javascript/scripts/cjl/cookie)
 */
function Cookie(strname, duration, path, domain, secure){
	this.affix = "";
	this.name = strname;
	if( duration ){
		var date = new Date();
			  var curTime = new Date().getTime();

			  date.setTime(curTime + (1000 * 60 * duration));
			  this.affix = "; expires=" + date.toGMTString();
	}

	if( path ){
		this.affix += "; path=" + path;
	}

	if( domain ){
		this.affix += "; domain=" + domain;
	}

	if( secure ){
		this.affix += "; secure=" + secure;
	}
};

Cookie.prototype.getValue = function(){
	var m = document.cookie.match(new RegExp("(" + this.name + "=[^;]*)(;|$)"));
	return m ? m[1] : null;
};

Cookie.prototype.cookieExists = function(){
	return this.getValue() ? true : false;
};

Cookie.prototype.expire = function(){
	var date = new Date();
	date.setFullYear(date.getYear() - 1);
	document.cookie=this.name + "=noop; expires=" + date.toGMTString();
};

Cookie.prototype.setSubValue = function(key, value)
{
	var ck = this.getValue();

	if( /[;, ]/.test(value) ){
		/*Mac IE doesn't support encodeURI*/
		value = window.encodeURI ? encodeURI(value) : escape(value);
	}


	if( value ){
		var attrPair = "@" + key + value;

		if( ck ){
			if( new RegExp("@" + key).test(ck) ){
				document.cookie = ck.replace(new RegExp("@" + key + "[^@;]*"), attrPair) + this.affix;
			}else{
				document.cookie =ck.replace(new RegExp("(" + this.name + "=[^;]*)(;|$)"), "$1" + attrPair) + this.affix;
			}
		}else{
			document.cookie = this.name + "=" + attrPair + this.affix;
		}
	}else{
		if( new RegExp("@" + key).test(ck) ){
			document.cookie = ck.replace(new RegExp("@" + key + "[^@;]*"), "") + this.affix;
		}
	}
};


Cookie.prototype.getSubValue = function(key){
	var ck = this.getValue();

	if( ck ){
		var m = ck.match(new RegExp("@" + key + "([^@;]*)"));

		if( m ){
			var value = m[1];

			if( value ){
				 /*Mac IE doesn't support decodeURI*/
				return window.decodeURI ? decodeURI(value) : unescape(value);
			}
		}
	}
};

function InterfaceSVG(){
};

/* objet Javascript SVG */
InterfaceSVG.prototype.setsvgObject = function(objSVG){
	this.svgObject		=  objSVG;
};
InterfaceSVG.prototype.getsvgObject = function(){
	return this.svgObject;
};
/* Export du SVG */
InterfaceSVG.prototype.getExportSvg = function(blnPortrait){
	if (typeof this.svgObject != "undefined"){
		return this.svgObject.getExportSvg(blnPortrait);
	}
};
InterfaceSVG.prototype.getTitre = function(){
	return this.svgObject.getTitre();
}

/* Description XML des couches SVG */
InterfaceSVG.prototype.setDescriptionSVG = function(strXmlDescription){
	this.DescriptionSVG	=  strXmlDescription;
};
InterfaceSVG.prototype.getDescriptionSVG = function(){
	return this.DescriptionSVG;
};

/* Donnees Javascript SVG */
InterfaceSVG.prototype.setJsDonnees = function(strJs){
	this.DonneesJS		=  strJs;
};
InterfaceSVG.prototype.getJsDonnees = function(){
	return this.DonneesJS;
};

/* Contexte SVG (etiquette, ...)*/
InterfaceSVG.prototype.setContexteSVG = function(strContexteSVG){
	var ModeleSerial  = new RegExp("<serial>","i");
	if (ModeleSerial.test(strContexteSVG)){
		this.ContexteSVG =  strContexteSVG;
	}else{
		this.ContexteSVG =  "<serial>" + strContexteSVG + "</serial>";	
	}
};

InterfaceSVG.prototype.getContexteSVG = function(){
	if (!this.ContexteSVG){	
		this.ContexteSVG = "<serial/>"
	}
	return this.ContexteSVG;
};
/* Hauteur */
InterfaceSVG.prototype.setHauteur 			=  function (intHeight) {
	this.Hauteur = intHeight;
}
InterfaceSVG.prototype.getHauteur 			=  function () {
	return this.Hauteur;
};
/* Largeur */
InterfaceSVG.prototype.setLargeur 			=  function (intWidth) {
	this.Largeur = intWidth;
};
InterfaceSVG.prototype.getLargeur 			=  function () {
	return this.Largeur;
};

/* CheminReperes */
InterfaceSVG.prototype.setCheminReperes 			=  function (strCheminReperes) {
	this.CheminReperes = strCheminReperes;
};
InterfaceSVG.prototype.getCheminReperes 			=  function () {
	return this.CheminReperes;
};

/* CheminCoucheSVG */
InterfaceSVG.prototype.setCheminCoucheSVG 			=  function (strCheminCoucheSVG) {
	this.CheminCoucheSVG = strCheminCoucheSVG;
};
InterfaceSVG.prototype.getCheminCoucheSVG 			=  function () {
	return this.CheminCoucheSVG;
};

/* CleVariableEnCours */
InterfaceSVG.prototype.setCleVariableEnCours 			=  function (strCleVariableEnCours) {
	this.CleVariableEnCours = strCleVariableEnCours;
};
InterfaceSVG.prototype.getCleVariableEnCours 			=  function () {
	return this.CleVariableEnCours;
};

/* CleVariableOrdonneeNuage */
InterfaceSVG.prototype.setCleVariableOrdonneeNuage 	=  function (strCleVariableOrdonneeNuage) {
	this.CleVariableOrdonneeNuage = strCleVariableOrdonneeNuage;
};

InterfaceSVG.prototype.getCleVariableOrdonneeNuage 	=  function () {
	return this.CleVariableOrdonneeNuage;
};

/* NomClasseVariable */
InterfaceSVG.prototype.setNomClasseVariable 	=  function (strNomClasseVariable) {
	this.NomClasseVariable = strNomClasseVariable;
};

InterfaceSVG.prototype.getNomClasseVariable 	=  function () {
	return this.NomClasseVariable;
};

/* Chargement termine */
InterfaceSVG.prototype.setChargementTermine			=  function () {
};

/* Type de l'object */
InterfaceSVG.prototype.getType	= function(){	return getObjectType.call(this);	
};

/* Liberation memoire */
InterfaceSVG.prototype.dispose = function(){
	EventManager.unregisterListener(this);
	DisposeObject.call(this);
	window.i_SVG = null;
	if (!IE)
		delete window.i_SVG;
};

/*
InterfaceSVG.prototype.RaffraichirToolBar			=  function () {
	
	window.uc.RecupereSelectionCarte()
	window.uc.Chargement(false);
};
*/

InterfaceSVG.prototype.ModifierPerimetre		=  function (TypeTerritoire,tSelect) {
	window.uc.ModifierPerimetre(TypeTerritoire,tSelect);	
};
/*
********************************************************************************************************
	Classe  Collection
********************************************************************************************************
*/
/*** Constructeur */
function Collection(nomclasse,itemArray)
{
	this.classe			=	nomclasse;
	this.item			=	new Object();

	if (itemArray)
	{
		for (var i=0; i<itemArray.length; i++)
		{
			var obj = itemArray[i];
			this.item[itemArray[i][0]] = itemArray[i][1];
		}
	}
};

/*** Methode exist(cle) : renvoie true si l element dont la cle est cle existe */
Collection.prototype.contains = function (cle)
{
	var blnExiste = false;
	try{
		blnExiste = this.item.hasOwnProperty(cle);
	}
	catch(error){
		Erreur("Collection.prototype.contains" , error, "Cle = " + cle);
	}
	finally{
		return blnExiste;
	}
};

/*** Methode add(cle, obj) : ajoute un element la Collection */
Collection.prototype.add = function (cle, obj)
{
	try{
		/*if (obj.getType() == this.classe || this.classe == "Object" )*/
		if (getObjectType.call(obj) == this.classe || this.classe == "Object" )
		{
			/*eval("this.item." + cle + " = obj;");*/
			this.item[cle] = obj;
			return this.item[cle]
		}
		else
			return undefined;
	}
	catch(error){
		Erreur("Collection.prototype.add" , error, "Classe = " + this.classe);
		return undefined;
	}
	finally{
	}
};

/*** Methode remove(cle) : supprime un element la Collection */
Collection.prototype.remove = function (cle)
{
	try{
		if (this.item.hasOwnProperty(cle)){
			this.item[cle] = null;
			delete this.item[cle];
		}
	}
	catch(error){
		Erreur("Collection.prototype.remove" , error, "Cle = " + cle);
	}
};

/*** Methode count() : Compte le nombre d element de la Collection */
Collection.prototype.count = function ()
{
	try{
		var intNb = 0;
		for (var obj in this.item ){
			intNb++;
		}
		return intNb;
	}
	catch(error){
		Erreur("Collection.prototype.count" , error);
		return undefined;
	}
};

/*** Methode getItemByIndex(index) : retourne un element a partir de sa position */
Collection.prototype.getItemByIndex = function (index)
{
	try{
		var intNb = 0;
		for (var obj in this.item ){
			if (intNb == index)
				return this.item[obj.toString()];
			intNb++;
		}
		return undefined;
	}
	catch(error){
		Erreur("Collection.prototype.getItemByIndex" , error, "Index = " + index);
		return undefined;
	}
};


/*** Methode getIndex(cle) : retourne la position d un element a partir de sa cle */
Collection.prototype.getIndex = function (cle)
{
	try{
		var intIndex = 0;
		for (var obj in this.item ){
			if (cle == obj.toString())
				return intIndex;

			intIndex++;
		}
		return undefined;
	}
	catch(error){
		Erreur("Collection.prototype.getIndex" , error, "Cle = " + cle);
		return undefined;
	}
};

/*** Methode item(cle) : retourne un element a partir de sa cle */
Collection.prototype.value = function (cle)
{
	var obj;
	try{
		obj = this.item[cle];
	}
	catch(error){
		Erreur("Collection.prototype.value" , error, "Cle = " + cle);
	}
	finally{
		return obj;
	}
};

/*** Methode item(cle) : retourne un element a partir de sa cle */
Collection.prototype.setValue = function (cle, value)
{
	try{
		if (this.item[cle]){
			this.item[cle] = value;
		}
	}
	catch(error){
		Erreur("Collection.prototype.setValue" , error, "Cle = " + cle + ", value=" + value);
	}
};

/*** Methode getItemByIndex(index) : retourne la cle d un element a partir de sa position */
Collection.prototype.getKey = function (index)
{
	try{
		var intIndex = 0;
		for (var obj in this.item ){
			if (intIndex == index)
				return obj.toString();
			intIndex++;
		}
		return undefined;
	}
	catch(error){
		Erreur("Collection.prototype.getKey" , error);
		return undefined;
	}
};

/*** Methode swapItem(index) : retourne la cle d un element a partir de sa position */
Collection.prototype.swapItem = function (oldIndex,newIndex)
{
	var newItem = new Object();
	var strCleTmp, objTmp;
	var intIndex;

	try{
		intIndex = 0;
		for (var obj in this.item){
			switch (intIndex){
				case oldIndex:
					newItem[this.getKey(newIndex)] = this.getItemByIndex(newIndex);
					break;
				case newIndex:
					newItem[this.getKey(oldIndex)] = this.getItemByIndex(oldIndex);
					break;
				default:
					newItem[obj.toString()] = this.item[obj.toString()];
					break;
			}
			intIndex++;
		}

		this.item = newItem
	}
	catch(error){
		Erreur("Collection.prototype.swapItem" , error, "oldIndex = " + oldIndex + " , newIndex = " + newIndex );
	}
};

/*** Type de l'object */
Collection.prototype.getType	= function(){	return getObjectType.call(this);	};

/*** Serialisation */
Collection.prototype.serialize = function ()	{	return SerialiserObjet.call(this);	};

/*** Liberation memoire  */
Collection.prototype.dispose = function (){
	for (var prop in this.item){
		if (typeof this.item[prop] == "object" && prop != "caller"){
			if (this.item[prop] != null && this.item[prop].dispose){
				this.item[prop].dispose();
			}
		}
		this.item[prop] = null;
		delete this.item[prop];
	}
	this.item = undefined;
	delete this.item;
};


function DHTMLDropDownMenu(objCaller){
	this.caller			= objCaller;
	this.EstDeploye		= false;
	this.CleMenuDeploye	= undefined;
	this.ListeMenus	    = new Collection("DHTMLMenu");

	this.divGrpMenu		= document.createElement("DIV");
//	this.divGrpMenu.style.height = "100%";
//	this.divGrpMenu.style.width  = '100%'
	this.divGrpMenu.style.position	 = "absolute";
	this.divGrpMenu.style.left 	 = 0;
	this.divGrpMenu.style.top  	 = 0;

	if (IE){
		this.divGrpMenu.onselectstart= new Function ("return false");
		this.divGrpMenu.ondragstart	 = new Function ("return false");
	}
}

DHTMLDropDownMenu.prototype.dataBind = function (arrdataSource){
	if (typeof arrdataSource != "undefined"){
		this.dataSource = arrdataSource;
	}

	this.ListeMenus	   = new Collection("DHTMLMenu");
	for (var i=0; i<arrdataSource.length; i++){
		var objItemTmp = new DHTMLMenu(this, arrdataSource[i][0], arrdataSource[i][1], arrdataSource[i][2])
		objItemTmp.dataBind(arrdataSource[i][3]);
		this.ListeMenus.add(objItemTmp.value,  objItemTmp)
	}

}
DHTMLDropDownMenu.prototype.handleEvent = function(oEvent){

	var myEvent		= (IE ? window.event : oEvent);
	var objOrigine	= (IE ? window.event.srcElement : oEvent.target);

	for (var cleMenu in this.ListeMenus.item){

		var objMenu = this.ListeMenus.value(cleMenu);

		if (objMenu.getNode().contains(objOrigine) || this.tableEnteteMenu == objOrigine){

			switch (myEvent.type){
				case "click":
					clearTimeout(this.tmContract);
					if (objMenu.EstDeploye){
						objMenu.contract();
						this.CleMenuDeploye = undefined;
					}
					else{
						if (this.CleMenuDeploye){
							this.ListeMenus.value(this.CleMenuDeploye).contract();
						}
						objMenu.deploy();
						this.CleMenuDeploye = objMenu.value;
					}
					break;

				case "mouseover":
					clearTimeout(this.tmContract);
					if (!objMenu.EstDeploye){
						if (this.CleMenuDeploye){
							this.ListeMenus.value(this.CleMenuDeploye).contract();
							this.CleMenuDeploye = undefined;
						}
						objMenu.deploy();
						this.CleMenuDeploye = objMenu.value;
					}
					break;


				case "mouseout":
					clearTimeout(this.tmContract);
					objM=objMenu;
					this.tmContract = window.setTimeout("objM.contract()", 100);
					break;
			}
			if (this.caller){
				this.caller.handleEvent(oEvent);
			}
			return;
		}
	}

	objOrigine 	= null;
	myEvent 	= null;

}
DHTMLDropDownMenu.prototype.length = function(){
	return this.ListeMenus.count();
}
DHTMLDropDownMenu.prototype.getNode = function(){
	return this.divGrpMenu;
}
DHTMLDropDownMenu.prototype.load = function(){

	//this.divGrpMenu		= document.createElement("DIV");
	for (var cleTmpMenu in this.ListeMenus.item){
		var	objTmpMenu = this.ListeMenus.value(cleTmpMenu)
		this.divGrpMenu.appendChild(objTmpMenu.getNode());
		objTmpMenu.load();
		//objTmpMenu.divMenu.style.width  	 = objTmpMenu.tableEnteteMenu.clientWidth;
		//objTmpMenu.divMenu.style.height  	 = objTmpMenu.tableEnteteMenu.clientHeight;

	}
}
DHTMLDropDownMenu.prototype.getWidth = function(){

	var intWidth = 0;
	for (var cleTmpMenu in this.ListeMenus.item){
		var	objTmpMenu = this.ListeMenus.value(cleTmpMenu)
		intWidth += pxToInt(objTmpMenu.getNode().clientWidth);
	}
	return intWidth;
}
DHTMLDropDownMenu.prototype.getHeight = function(){
	return this.divGrpMenu.clientHeight;
}


// Type de l'object
DHTMLDropDownMenu.prototype.getType	= function(){	return getObjectType.call(this);	}
// Liberation memoire
DHTMLDropDownMenu.prototype.dispose = function(){
	EventManager.unregisterListener(this);
	DisposeObject.call(this);
}

function DHTMLMenu(objCaller, strValue, strText, strUrlImg){

	this.caller			= objCaller;
	this.value			= strValue;
	this.text			= strText;
	this.urlImg			= strUrlImg;

	this.ListeItems	    = new Collection("DHTMLItemMenu");
	this.EstDeploye		= false;
//	this.zIndex			= 1;

	this.divMenu				 = document.createElement("DIV");
	this.divMenu.style.position  = "relative";
	if (IE)
		this.divMenu.style.styleFloat = "left";
	else
		this.divMenu.style.cssFloat	  = "left";

	if (IE){
		this.divMenu.onselectstart= new Function ("return false");
		this.divMenu.ondragstart	 = new Function ("return false");
	}

}

DHTMLMenu.prototype.dataBind = function (arrdataSource){
	if (typeof arrdataSource != "undefined"){
		this.dataSource = arrdataSource;
	}

	this.ListeItems	   = new Collection("DHTMLItemMenu");

	for (var i=0; i<arrdataSource.length; i++){
		var objItemTmp = new DHTMLItemMenu(this, arrdataSource[i][0], arrdataSource[i][1], arrdataSource[i][2], arrdataSource[i][3], arrdataSource[i][4])
		if (arrdataSource[i].length>5){
			objItemTmp.dataBind(arrdataSource[i][5])
		}
		this.ListeItems.add(objItemTmp.value,  objItemTmp)
	}

}
DHTMLMenu.prototype.length = function(){
	return this.ListeItems.count()
}
DHTMLMenu.prototype.handleEvent = function(oEvent){

	var myEvent		= (IE ? window.event : oEvent);
	var objOrigine	= (IE ? window.event.srcElement : oEvent.target);

			/*
	if (this.tableEnteteMenu.contains(objOrigine) || this.tableEnteteMenu == objOrigine){
		switch (myEvent.type){
			case "click":
				this.tableEnteteMenu.className = "tdEnteteMenuSurvol"
				break;

			case "mouseover":
				this.tableEnteteMenu.className = "tdEnteteMenuSurvol"
				break;


			case "mouseout":
				if (!this.EstDeploye){
					this.tableEnteteMenu.className = "tdEnteteMenu";
				}
				else{
 					this.tableEnteteMenu.className = "tdEnteteMenuSurvol"
				}
				break;
		}
	}
				*/

	if (this.caller){
		this.caller.handleEvent(oEvent);
	}

	objOrigine 	= null;
	myEvent 	= null;
}
DHTMLMenu.prototype.contract = function(){

	this.tableEnteteMenu.className = "tdEnteteMenu";
	if (typeof this.tableSousMenus != "undefined"){
		this.divMenu.removeChild(this.tableSousMenus)
		this.tableSousMenus = undefined;
	}

	this.EstDeploye = false;

}
DHTMLMenu.prototype.deploy = function(){

	// Liste deroulante deployee
	this.tableEnteteMenu.className = "tdEnteteMenuSurvol";
	this.tableSousMenus = document.createElement("TABLE");
	this.tableSousMenus.style.position  = "absolute";
	this.tableSousMenus.style.left 	 = 0;
	this.tableSousMenus.style.top  	 = pxToInt(this.tableEnteteMenu.offsetHeight);
	this.tableSousMenus.cellpadding = 0;
	this.tableSousMenus.cellSpacing = 0;
	this.tableSousMenus.className = "tableItemMenu";

	EventManager.add(this.tableSousMenus, "mouseover", this, false);
	EventManager.add(this.tableSousMenus, "mouseout", this, false);
	this.divMenu.appendChild(this.tableSousMenus)

	for (var strCleItem in this.ListeItems.item){

		var tmpLigne = this.tableSousMenus.insertRow(this.tableSousMenus.rows.length);
		var objItemTmp = this.ListeItems.value(strCleItem)
		objItemTmp.load();
		tmpLigne.appendChild(objItemTmp.getNode());
	}
	this.EstDeploye = true;

}
DHTMLMenu.prototype.getNode = function(){
	return this.divMenu;
}
DHTMLMenu.prototype.load = function(){


	// Liste deroulante contractee
	this.tableEnteteMenu = document.createElement("TABLE");
//	this.tableEnteteMenu.style.position  = "absolute";
	this.tableEnteteMenu.className = "tdEnteteMenu";
	this.tableEnteteMenu.style.left 	 = 0;
	this.tableEnteteMenu.style.top  	 = 0;
	this.tableEnteteMenu.style.width = "auto";
	this.tableEnteteMenu.cellpadding = 0;
	this.tableEnteteMenu.cellSpacing = 2;
	this.tableEnteteMenu.insertRow(0);

	var tdTmp		= this.tableEnteteMenu.rows[0].insertCell(0)
	tdTmp.noWrap	= true;
	tdTmp.innerHTML =  "&nbsp;&nbsp;" + this.text + "&nbsp;&nbsp;&nbsp;";
	tdTmp.style.background = " Transparent url(" + this.urlImg + ") no-repeat right"

	this.divMenu.appendChild(this.tableEnteteMenu)
	this.divMenu.style.width  	 = this.tableEnteteMenu.clientWidth;
	this.divMenu.style.height  	 = this.tableEnteteMenu.clientHeight;

	EventManager.add(this.tableEnteteMenu, "click", this, false);
	EventManager.add(this.tableEnteteMenu, "mouseover", this, false);
	EventManager.add(this.tableEnteteMenu, "mouseout", this, false);


	if (this.EstDeploye){
		this.deploy();
	}
}

// Type de l'object
DHTMLMenu.prototype.getType	= function(){	return getObjectType.call(this);	}
// Liberation memoire
DHTMLMenu.prototype.dispose = function(){
	EventManager.unregisterListener(this);
	DisposeObject.call(this);
}

function DHTMLItemMenu(objCaller, strValue, strText, strAlt, strUrlImg, fnAction){


	this.caller		= objCaller;
	this.value		= strValue;
	this.text		= strText;
	this.alt		= strAlt;
	this.urlImg		= strUrlImg;
	this.disabled   = true;
	this.action		= fnAction;

//	if (fnAction)
//		this.action	= fnAction;
//	else
//		this.action	= function(){}


	this.tdItemMenu		  = document.createElement("TD");
	this.tdItemMenu.title = this.alt;
	if (IE){
		this.tdItemMenu.onselectstart= new Function ("return false");
		this.tdItemMenu.ondragstart	 = new Function ("return false");
	}
	EventManager.add(this.tdItemMenu, "click", this, false);
	EventManager.add(this.tdItemMenu, "mouseover", this, false);
	EventManager.add(this.tdItemMenu, "mouseout", this, false);
}

DHTMLItemMenu.prototype.load = function (){

	if (this.tdItemMenu.hasChildNodes())
		this.tdItemMenu.removeChild(this.tdItemMenu.firstChild)

	var tableTmp = document.createElement("TABLE");
	//tableTmp.style.width = "100%";
	tableTmp.cellPadding=0;
	tableTmp.cellSpacing=0;

	if (typeof this.text != "undefined"){

		if (this.disabled)
			this.tdItemMenu.className = "tdItemMenuDisabled";
		else
			this.tdItemMenu.className = "tdItemMenu";

		var trTmp	 = tableTmp.insertRow(0)
		var tdTmp	 = trTmp.insertCell(0)
		tdTmp.noWrap = true
		tdTmp.className="tdIconeItemMenu"
		tdTmp.style.backgroundImage = "url(" + this.urlImg + ")"

		var tdTmp = trTmp.insertCell(1)
		tdTmp.noWrap = true
		tdTmp.innerHTML =  "&nbsp;&nbsp;" + this.text + "&nbsp;&nbsp;";

	}
	else{
		this.tdItemMenu.className = "SousMenuSep";
		tableTmp.insertRow(0).appendChild(document.createElement("TH"));
		tableTmp.insertRow(1).appendChild(document.createElement("TD"));
	}
	this.tdItemMenu.appendChild(tableTmp)

}
DHTMLItemMenu.prototype.getNode = function(){
	return this.tdItemMenu;
}
DHTMLItemMenu.prototype.disable = function(){
	this.tdItemMenu.className = "tdItemMenuDisabled";
	lightup(this.tdItemMenu, 30);
	this.disabled   = true;
}
DHTMLItemMenu.prototype.enable = function(){
	this.tdItemMenu.className = "tdItemMenu";
	lightup(this.tdItemMenu, 100);
	this.disabled   = false;
}
DHTMLItemMenu.prototype.handleEvent = function(oEvent){
	var myEvent		= (IE ? window.event : oEvent);
	var objOrigine	= (IE ? window.event.srcElement : oEvent.target);

	if (!this.disabled){
		switch (myEvent.type){
			case "click":
				eval(this.action);
				//this.action();
				break;
			case "mouseover":
				this.tdItemMenu.className = "tdItemMenuSurvol";
				break;
			case "mouseout":
				this.tdItemMenu.className = "tdItemMenu";
					break;
		}
	}

	if (this.caller){
		this.caller.handleEvent(oEvent);
	}

	objOrigine 	= null;
	myEvent 	= null;
}

// Type de l'object
DHTMLItemMenu.prototype.getType	= function(){	return getObjectType.call(this);	}
// Liberation memoire
DHTMLItemMenu.prototype.dispose = function(){
	EventManager.unregisterListener(this);
	DisposeObject.call(this);
}


/*--------------------------------------------------------------------------------------------------
									Classe tabStrip : Menu Onglet + Corps
--------------------------------------------------------------------------------------------------*/
function DHTMLtabStrip(objCaller, intNbOngletMaxParLigne, intEspaceEntreOnglet, blnLargeurMax)
{
	// Parametres d'affichage
	this.caller					  = objCaller;
	this.cssStyleBtnOngletActif	  = "btnOngletActif";
	this.urlBgImgBtnOngletActif   = "url(" + getUrlReperes() + "Commun/IMG/Boutons/Fond_tab_A.gif)";

	this.cssStyleBtnOngletInactif = "btnOngletInactif";
	this.urlBgImgBtnOngletInactif = "url(" + getUrlReperes() + "Commun/IMG/Boutons/Fond_tab_N.gif)";

	this.cssStyleBtnOngletSurvol  = "btnOngletSurvol";
	this.urlBgImgBtnOngletSurvol  = "url(" + getUrlReperes() + "Commun/IMG/Boutons/Fond_tab_S.gif)";

	this.cssStyleSepOnglet		  = "btnOngletSep";
	this.cssStyleCorpsOngletActif = "CorpsVide";
	
	this.selectedValue			  = "";

	if (typeof intNbOngletMaxParLigne != "undefined"){
		this.NbOngletMaxParLigne = intNbOngletMaxParLigne;
	}
	else{
		this.NbOngletMaxParLigne = 3;
	}

	if (typeof intEspaceEntreOnglet != "undefined"){
		this.EspaceEntreOnglet	= intEspaceEntreOnglet;
	}
	else{
		this.EspaceEntreOnglet = "0%";
	}

	/*
	// recuperation de la liste des onglets
	if (typeof objListeOnglets != "undefined"){
		this.ListeOnglets		= objListeOnglets;
	}
	else{
		this.ListeOnglets		= new Collection("Array")
	}

	// selection du premier onglet par defaut
	if (this.ListeOnglets.count()>0){
		this.selectedValue		= this.ListeOnglets.getKey(0);
	}
	else{
	this.selectedValue		= "";
	}
	*/

	if (typeof blnLargeurMax != "undefined"){
		this.OccupeLargeurMax = blnLargeurMax;
	}
	else{
		this.OccupeLargeurMax = true;
	}


	// index du premier onglet visible
	this.IndexOngletDeb			= 0;

	//*** Construction de la structure du tabStrip
	this.divtabStrip	= document.createElement("DIV")

	this.tabStrip		= this.divtabStrip.appendChild(document.createElement("TABLE"));
	this.tabStrip.border	= 0;
	this.tabStrip.cellPadding	= 0;
	this.tabStrip.cellSpacing	= 0;
	//*** espace avant
//	this.tabStrip.insertRow(this.tabStrip.rows.length).insertCell(0).style.height=0;


	//*** Titres des onglets
	this.MenuTabStrip			 = this.tabStrip.insertRow(this.tabStrip.rows.length);
	if (IE){
		this.MenuTabStrip.onselectstart= new Function ("return false");
		this.MenuTabStrip.ondragstart	 = new Function ("return false");
	}

	//*** Contenu d'un onglet
	this.CorpsTabStrip			 = this.tabStrip.insertRow(this.tabStrip.rows.length).insertCell(0);
	this.CorpsTabStrip.valign	 = "top";
	this.CorpsTabStrip.align	 = "center";

	//this.divCorpsTabStrip	= this.CorpsTabStrip.appendChild(document.createElement("DIV"))
	//this.divCorpsTabStrip.style.display="block"

	//*** espace apres
//	this.tabStrip.insertRow(this.tabStrip.rows.length).insertCell(0).style.height=0;
}

DHTMLtabStrip.prototype.dataBind = function (arrDataSource){

	this.ListeOnglets		= new Collection("Array")

	for (var i=0; i<arrDataSource.length; i++){
		this.ListeOnglets.add(arrDataSource[i][0],  arrDataSource[i]);
	}

	if (this.ListeOnglets.count()>0){
		this.selectedValue		= this.ListeOnglets.getKey(0);
	}
	else{
		this.selectedValue		= "";
	}
}

// *** 	Methode de selection d'un onglet
DHTMLtabStrip.prototype.selectIndex = function(intIndex){
	var strCle = this.ListeOnglets.getKey(intIndex);
	this.selectValue(strCle);
}
// *** 	Methode de selection d'un onglet
DHTMLtabStrip.prototype.selectValue = function(cle){
	var objStrip;
	for (var i=0; i<this.MenuTabStrip.cells.length; i++)
	{
		if(this.MenuTabStrip.cells[i].id != ""){
			this.MenuTabStrip.cells[i].className = this.MenuTabStrip.cells[i].className.replace(this.cssStyleBtnOngletActif,this.cssStyleBtnOngletInactif);
			this.MenuTabStrip.cells[i].style.backgroundImage = this.urlBgImgBtnOngletInactif;
		}else{
			this.MenuTabStrip.cells[i].className = this.MenuTabStrip.cells[i].className = this.cssStyleSepOnglet;
		}		
		if(this.MenuTabStrip.cells[i].id == cle){
			objStrip = this.MenuTabStrip.cells[i];
		}
	}
	if (objStrip){
		objStrip.className = this.cssStyleBtnOngletActif
		objStrip.style.backgroundImage = this.urlBgImgBtnOngletActif;
	}
	this.selectedValue = cle;
}
// *** 	Methode de chargement du tabStrip
DHTMLtabStrip.prototype.load = function(){
	var intCptOnglet;
	var intNbOngletParLigne;
	var intNbCarLignesOnglet;
	var celluleSep;

	this.CorpsTabStrip.className = this.cssStyleCorpsOngletActif;

	// on supprime les anciens onglets
	while (this.MenuTabStrip.cells.length>0){
		this.MenuTabStrip.deleteCell(0)
	}

	intCptOnglet = 0
	intNbCarLignesOnglet = 0
	if (pxToInt(this.EspaceEntreOnglet)>0){
		celluleSep			 = document.createElement("TD");
		celluleSep.innerHTML = "&nbsp;"
		celluleSep.style.width	 = this.EspaceEntreOnglet;
		this.MenuTabStrip.appendChild(celluleSep.cloneNode(true));
	}

	// ajout des onglets
	var intCptOnglet = 0;
	for (var strIdOngletTmp in this.ListeOnglets.item)
	{
		var objTmpOnglet = this.ListeOnglets.value(strIdOngletTmp);

		if (intCptOnglet>=this.IndexOngletDeb && (intCptOnglet-this.IndexOngletDeb)<this.NbOngletMaxParLigne )
		{
/*			if (pxToInt(this.EspaceEntreOnglet)>0){
				this.MenuTabStrip.appendChild(celluleSep.cloneNode(true)) ;
			}
*/
			var cellule = this.MenuTabStrip.insertCell(this.MenuTabStrip.cells.length) ;
			cellule.height= 25;
			cellule.id= objTmpOnglet[0];

			if (cellule.id == this.selectedValue){
				cellule.className 			  = this.cssStyleBtnOngletActif;
				cellule.style.backgroundImage = this.urlBgImgBtnOngletActif;
			}
			else{
				cellule.className 			  = this.cssStyleBtnOngletInactif;
				cellule.style.backgroundImage = this.urlBgImgBtnOngletInactif;
			}
			/*if (objTmpOnglet[2]!="" && typeof objTmpOnglet[2] != "undefined"){
				var spIcone = document.createElement("SPAN");
				cellule.appendChild(spIcone);
				spIcone.style.position = "absolute";
				spIcone.style.width= "100%"
				spIcone.innerHTML ="<img src =\"" + objTmpOnglet[2] + "\">";
			}
			cellule.insertAdjacentHTML("beforeEnd",objTmpOnglet[1]);
			*/
			cellule.innerHTML = "&nbsp;" + objTmpOnglet[1].replace(/\s/g,"&nbsp;").replace(/-/g,"&#8209;") + "&nbsp;";
			cellule.noWrap = true;
			cellule.style.width  = "0%";

//				cellule.style.textIndent		 = "30px";
//				cellule.style.backgroundPosition = "10px";
//				cellule.style.backgroundRepeat	 = "no-repeat";
//				cellule.style.backgroundImage	 = "url(" + objTmpOnglet[2] + ")";

			intNbCarLignesOnglet +=  cellule.innerHTML.length;

			if (pxToInt(this.EspaceEntreOnglet)>0){
				this.MenuTabStrip.appendChild(celluleSep.cloneNode(true)) ;
			}
		}
		intCptOnglet++;
	}
	if (pxToInt(this.EspaceEntreOnglet)>0){
		this.MenuTabStrip.appendChild(celluleSep.cloneNode(true)) ;
	}
	if (this.OccupeLargeurMax){
		for (var i=0; i<this.MenuTabStrip.cells.length; i++)
		{
			if (this.MenuTabStrip.cells[i].id.search(/Aff/i)==-1 && this.MenuTabStrip.cells[i].id!=""){
				var ratio = parseInt((this.MenuTabStrip.cells[i].innerHTML.length / intNbCarLignesOnglet)*100) - 2*pxToInt(this.EspaceEntreOnglet)
				this.MenuTabStrip.cells[i].style.width = ratio.toString() + "%"
			}
		}
	}
	else{
		for (var i=0; i<this.MenuTabStrip.cells.length; i++)
		{
			if (this.MenuTabStrip.cells[i].id.search(/Aff/i)==-1 && this.MenuTabStrip.cells[i].id!=""){
				this.MenuTabStrip.cells[i].innerHTML = "&nbsp;&nbsp;" + this.MenuTabStrip.cells[i].innerHTML  +  "&nbsp;&nbsp;"
			}
		}
	}
	
	if (this.IndexOngletDeb>0)
	{
		var cellule = this.MenuTabStrip.insertCell(0) ;
		cellule.height= 25;
		cellule.id="AffPrec"

		cellule.className = this.cssStyleBtnOngletInactif;
		cellule.style.backgroundImage = this.urlBgImgBtnOngletInactif;
		cellule.innerHTML = "&nbsp;<<&nbsp"
 	}

	if ((this.IndexOngletDeb+this.NbOngletMaxParLigne)<this.ListeOnglets.count())
	{
		var cellule = this.MenuTabStrip.insertCell(this.MenuTabStrip.cells.length) ;
		cellule.height= 25
		cellule.id="AffSuiv"

		cellule.className = this.cssStyleBtnOngletInactif
		cellule.style.backgroundImage = this.urlBgImgBtnOngletInactif;
		cellule.innerHTML = "&nbsp;>>&nbsp"
	}

	if (this.OccupeLargeurMax){
		this.divtabStrip.style.width		= "100%"
		this.tabStrip.style.width			= "100%"
		this.CorpsTabStrip.style.width		= "100%"
	}else{
		this.divtabStrip.style.width		= "100%";
		this.tabStrip.style.width			= "100%";
		this.MenuTabStrip.insertCell(this.MenuTabStrip.cells.length);
		this.MenuTabStrip.cells[this.MenuTabStrip.cells.length-1].innerHTML = "&nbsp;";
		this.MenuTabStrip.cells[this.MenuTabStrip.cells.length-1].className = this.cssStyleSepOnglet;
		this.MenuTabStrip.cells[this.MenuTabStrip.cells.length-1].style.width = "100%";
	}

	this.CorpsTabStrip.colSpan		 = this.MenuTabStrip.cells.length;

	EventManager.add(this.MenuTabStrip, "click", this, false)
	EventManager.add(this.MenuTabStrip, "mouseover", this, false)
	EventManager.add(this.MenuTabStrip, "mouseout", this, false)
	

}

	//*** 	Gestionnaire d'evenement du tabStrip
DHTMLtabStrip.prototype.handleEvent = function (oEvent){
	var myEvent		= (IE ? window.event : oEvent);
	var objOrigine	= (IE ? window.event.srcElement : oEvent.target);

	if (this.MenuTabStrip.contains(objOrigine) && objOrigine.id != ""){

		switch (myEvent.type){
			case "click":
				switch (objOrigine.id){
					case "AffPrec":
						this.previousStrip();
						break;
					case "AffSuiv":
						this.nextStrip();
						break;
					default:
						if (objOrigine.id != this.selectedValue){
							this.selectValue(objOrigine.id);
							this.caller.handleEvent(oEvent);
						}
						break;
				}
				break;

			case "mouseover":
				objOrigine.className = objOrigine.className.replace(this.cssStyleBtnOngletInactif,this.cssStyleBtnOngletSurvol);
				objOrigine.style.backgroundImage = objOrigine.style.backgroundImage.replace(this.urlBgImgBtnOngletInactif,this.urlBgImgBtnOngletSurvol);
				break;

			case "mouseout":
				objOrigine.className = objOrigine.className.replace(this.cssStyleBtnOngletSurvol,this.cssStyleBtnOngletInactif);
				objOrigine.style.backgroundImage = objOrigine.style.backgroundImage.replace(this.urlBgImgBtnOngletSurvol, this.urlBgImgBtnOngletInactif);
				break;

		}
	}
	this.CorpsTabStrip.className = this.cssStyleCorpsOngletActif;

	objOrigine 	= null;
	myEvent 	= null;
}

// *** 	Methode de redimensionnement du tabStrip
DHTMLtabStrip.prototype.resize = function(){
	if (this.OccupeLargeurMax){
		this.divtabStrip.style.width		= "100%"
		this.tabStrip.style.width			= "100%"
		this.CorpsTabStrip.style.width		= "100%"
	}
	//this.divtabStrip.style.height			= "98%";
	//this.CorpsTabStrip.style.height		= "100%";
	//this.tabStrip.style.height			= "100%";
	//this.divCorpsTabStrip.style.width		= "98%";
	//this.divCorpsTabStrip.style.height  	= "100%";
}


// *** 	Methode de navigation vers l'onglet suivant
DHTMLtabStrip.prototype.nextStrip = function(){
//		alert(this.IndexOngletDeb)
	this.IndexOngletDeb++;
	this.load();
}

// *** 	Methode de navigation vers l'onglet precedent
DHTMLtabStrip.prototype.previousStrip = function(){
//		alert(this.IndexOngletDeb)
	this.IndexOngletDeb--;
	this.load();
}

DHTMLtabStrip.prototype.setCorpsTabStrip = function(strHTMLContenu){
	//this.divCorpsTabStrip.style.overflow = "hidden";
	//this.divCorpsTabStrip.innerHTML = strHTMLContenu;
	this.CorpsTabStrip.innerHTML = strHTMLContenu;
}

DHTMLtabStrip.prototype.appendCorpsTabStrip = function(Node){
	//this.divCorpsTabStrip.style.overflow = "hidden";
	//this.divCorpsTabStrip.innerHTML = strHTMLContenu;
	this.CorpsTabStrip.appendChild(Node);
}

DHTMLtabStrip.prototype.removeCorpsTabStrip = function(Node){
	//this.divCorpsTabStrip.style.overflow = "hidden";
	//this.divCorpsTabStrip.innerHTML = strHTMLContenu;
	this.CorpsTabStrip.removeChild(Node);
}

DHTMLtabStrip.prototype.getNode = function(){
	return this.divtabStrip;
}

// Type de l'object
DHTMLtabStrip.prototype.getType	= function(){	return getObjectType.call(this);	}

// Liberation memoire
DHTMLtabStrip.prototype.dispose 	= function(){
	EventManager.unregisterListener(this);
	DisposeObject.call(this);
}
/*****************************************************************************

Name : getImgDirectory

Parameters : Image source path

Return : Image source Directory

*****************************************************************************/



function getImgDirectory(source) {

    return source.substring(0, source.lastIndexOf('/') + 1);

}

/*****************************************************************************

Name : toggle

Parameters :  node , DOM element (<a> tag)

Description :     Description, collapse or unfold a branch

*****************************************************************************/



function toggle(node) {

    // Get the next tag (read the HTML source)

	var nextDIV = node.nextSibling;



	// find the next DIV

	while(nextDIV.nodeName != "DIV") {

		nextDIV = nextDIV.nextSibling;

	}



	// Unfold the branch if it isn't visible

	if (nextDIV.style.display == 'none') {



		// Change the image (if there is an image)

		if (node.childNodes.length > 0) {



			if (node.childNodes.item(0).nodeName == "IMG") {

				node.childNodes.item(0).src = getImgDirectory(node.childNodes.item(0).src) + "minus.gif";

			}

		}



		nextDIV.style.display = 'block';

	}

	// Collapse the branch if it IS visible

	else {



		// Change the image (if there is an image)

		if (node.childNodes.length > 0) {

			if (node.childNodes.item(0).nodeName == "IMG") {

  				node.childNodes.item(0).src = getImgDirectory(node.childNodes.item(0).src) + "plus.gif";

			}

		}

		nextDIV.style.display = 'none';

	}

}



/*****************************************************************************

Name : toggle2

Parameters :  node DOM element (<a> tag), folderCode String

Description :    if you use the "code" attribute in a folder element, toggle2 is called

instead of toggle. The consequence is that you MUST implement a selectFolder function in your page.

*****************************************************************************/

function toggle2(node, folderCode) {

    toggle(node);

    alert(folderCode);

}
var idSelected = null
function SelectionnerTreeView(idLign){
	
	if (idSelected != null){
		var oOldSelect = this.document.getElementById(idSelected)
		if (oOldSelect != null){
			oOldSelect.style.color="black"
			oOldSelect.style.fontWeight="normal"
		}
	}
	if (idLign != null){
		var oNewSelect = this.document.getElementById(idLign)
		if (oNewSelect!= null){
			idSelected = idLign
			oNewSelect.style.color="rgb(73,153,226)"
			oNewSelect.style.fontWeight="bold"
		}	
	}
}

function DHTMLListBox(objCaller, intWidth, intHeight){

	this.caller			= objCaller;
	this.selectedValue  = "";
	this.selectedText   = "-";
	this.selectedIndex  = -1;
	this.multiple	    = false;
	this.isSelecting = false;
	this.NbSelections   = 0;
	this.ListeItems	    = new Collection("DHTMLItemList");


	this.divListBox	= document.createElement("DIV");
	this.divListBox.style.position	= "relative";
	this.divListBox.className 		= "listbox";
	this.divListBox.style.width  	= intWidth;
	this.divListBox.style.height 	= intHeight;

	if (IE){
		this.divListBox.onselectstart= new Function ("return false");
		this.divListBox.ondragstart	 = new Function ("return false");
	}
}



DHTMLListBox.prototype.dataBind = function (arrdataSource){

	this.ListeItems.dispose();
	this.ListeItems	   = new Collection("DHTMLItemList");

	for (var i=0; i<arrdataSource.length; i++){
		var objItemTmp = new DHTMLItemList(this, i, arrdataSource[i][0], arrdataSource[i][1], false);
		this.ListeItems.add(objItemTmp.value,  objItemTmp);
	}

}

DHTMLListBox.prototype.resize = function(intWidth, intHeight){
	this.divListBox.style.width  = intWidth;
	this.divListBox.style.height = intHeight;
}

DHTMLListBox.prototype.selectIndex = function(intIndex){
	if (intIndex>=0){

		var objItemSelect  = this.ListeItems.getItemByIndex(intIndex);

		if (this.multiple){
			if (objItemSelect.selected){
				objItemSelect.unselect();
				this.NbSelections--;
				if (this.NbSelections>0){
					for (var cleItem in this.ListeItems.item){
						objItemSelect = this.ListeItems.value(cleItem);
						if (objItemSelect.selected){
							this.selectedIndex = objItemSelect.index;
							this.selectedValue = objItemSelect.value;
							this.selectedText  = objItemSelect.text;
						}
					}
				}
				else{
					this.selectedIndex = -1;
					this.selectedValue = "";
					this.selectedText  = "-";
				}
			}
			else{
				objItemSelect.select();
				this.selectedIndex = objItemSelect.index;
				this.selectedValue = objItemSelect.value;
				this.selectedText  = objItemSelect.text;
				this.NbSelections++;
			}
		}
		else{
			if (!objItemSelect.selected){

				if (this.ListeItems.contains(this.selectedValue))
					this.ListeItems.value(this.selectedValue).unselect();

				objItemSelect.select();
				this.selectedIndex = objItemSelect.index;
				this.selectedValue = objItemSelect.value;
				this.selectedText  = objItemSelect.text;
				this.NbSelections=1;
			}
		}
	}
	else{
		this.selectedIndex = -1;
		this.selectedValue = "";
		this.selectedText  = "-";
	}
}

DHTMLListBox.prototype.selectValue = function(cle){
	if (this.ListeItems.contains(cle)){
		var objItemSelect  = this.ListeItems.value(cle);

		if (this.multiple){
			if (objItemSelect.selected){
				objItemSelect.unselect();
				this.NbSelections--;
				if (this.NbSelections>0){
					for (var cleItem in this.ListeItems.item){
						objItemSelect = this.ListeItems.value(cleItem);
						if (objItemSelect.selected){
							this.selectedIndex = objItemSelect.index;
							this.selectedValue = objItemSelect.value;
							this.selectedText  = objItemSelect.text;
						}
					}
				}
				else{
					this.selectedIndex = -1;
					this.selectedValue = "";
					this.selectedText  = "-";
				}
			}
			else{
				objItemSelect.select();
				this.selectedIndex = objItemSelect.index;
				this.selectedValue = objItemSelect.value;
				this.selectedText  = objItemSelect.text;
				this.NbSelections++;
			}
		}
		else{
			if (!objItemSelect.selected){

				if (this.ListeItems.contains(this.selectedValue))
					this.ListeItems.value(this.selectedValue).unselect();

				objItemSelect.select();
				this.selectedIndex = objItemSelect.index;
				this.selectedValue = objItemSelect.value;
				this.selectedText  = objItemSelect.text;
				this.NbSelections=1;
			}
		}
	}
	else{
		this.selectedIndex = -1;
		this.selectedValue = "";
		this.selectedText  = "-";
	}
}

DHTMLListBox.prototype.length = function(){
	return this.ListeItems.count()
}

DHTMLListBox.prototype.getValue = function(index){
	return this.ListeItems.getKey(index);
}

DHTMLListBox.prototype.getIndex = function(cle){
	return this.ListeItems.getIndex(cle);
}

DHTMLListBox.prototype.handleEvent = function(oEvent){

	var myEvent		= (IE ? window.event : oEvent);
	var objOrigine	= (IE ? window.event.srcElement : oEvent.target);

	switch (objOrigine.tagName){

		case "TD":
			switch (myEvent.type){
				case "mousedown":
					if (this.multiple){
						this.selectIndex(objOrigine.parentNode.rowIndex);
						this.isSelecting = true;
					}
					break;

				case "mouseup":
					if (this.multiple && this.isSelecting){
						this.isSelecting = false;
					}
					this.caller.handleEvent(oEvent);
					break;

				case "mouseover":
					if (this.multiple && this.isSelecting){
						this.selectIndex(objOrigine.parentNode.rowIndex);
					}
					break;

				case "dblclick":
					this.caller.handleEvent(oEvent);
					break;

				case "click":
					if (objOrigine.parentNode.rowIndex != this.selectedIndex){
						this.selectIndex(objOrigine.parentNode.rowIndex);
						this.caller.handleEvent(oEvent);
					}
					break;
			}
			break;
	}
	objOrigine 	= null;
	myEvent 	= null;
}

DHTMLListBox.prototype.getNode = function(){
	return this.divListBox;
}

DHTMLListBox.prototype.load = function(){

	if (typeof this.tableItemList != "undefined"){
		this.divListBox.removeChild(this.tableItemList)
		this.tableItemList = undefined;
	}

	this.tableItemList = document.createElement("TABLE");
	this.tableItemList.cellpadding = 0;
	this.tableItemList.cellSpacing = 0;
	this.tableItemList.className = "tableItemList";
	this.divListBox.appendChild(this.tableItemList);
	this.divListBox.scrollTop = 0;
	
	if (this.ListeItems.count()>0){
		for (var strCleItem in this.ListeItems.item){

			var tmpLigne = this.tableItemList.insertRow(this.tableItemList.rows.length);
			var objItemTmp = this.ListeItems.value(strCleItem)
			objItemTmp.load();
			tmpLigne.appendChild(objItemTmp.getNode());

		}
	}
	else{
		this.selectedValue  = "";
		this.selectedText   = "-";
		this.selectedIndex  = -1;
	}

}

// Type de l'object
DHTMLListBox.prototype.getType	= function(){	return getObjectType.call(this);	}

// Liberation memoire
DHTMLListBox.prototype.dispose 	= function(){
	EventManager.unregisterListener(this);
	DisposeObject.call(this);
}
function DHTMLComboBox(objCaller, intWidth, intHeight){

	this.caller			= objCaller;
	this.selectedValue  = "";
	this.selectedText   = "-";
	this.selectedIndex  = -1;
	this.ListeItems	    = new Collection("DHTMLItemList");
	this.EstDeploye		= false;
	this.Width 			= intWidth;
	if (intHeight <= 0)intHeight = 16;
	this.Height 		= intHeight;
//	this.zIndex			= 1;

	this.divComboBox				 = document.createElement("DIV");
	this.divComboBox.style.position	 = "relative";
	this.divComboBox.style.width  	 = this.Width;
//	this.divComboBox.style.height 	 = "100%";

	EventManager.add(this.divComboBox, "mouseover", this, false);
	EventManager.add(this.divComboBox, "mouseout", this, false);

	if (IE){
		this.divComboBox.onselectstart= new Function ("return false");
		this.divComboBox.ondragstart	 = new Function ("return false");
	}


	// Liste deroulante contractee
	this.divItemList			     = document.createElement("DIV");
//	this.divItemList.style.position  = "absolute";
	this.divItemList.style.left 	 = "0px";
//	this.divItemList.style.right 	 = "0px";
	this.divItemList.style.top  	 = "0px";
	this.divItemList.style.width  	 = this.Width;
	this.divItemList.style.height 	 = "auto";
	this.divComboBox.appendChild(this.divItemList)

	this.tableSelectItem = document.createElement("TABLE");
	this.tableSelectItem.className 	 = "tableComboBox";
	this.tableSelectItem.style.width  = this.Width;
	this.tableSelectItem.style.height = this.Height;
	this.tableSelectItem.border=0;
	this.tableSelectItem.cellpadding = 0;
	this.tableSelectItem.cellSpacing = 0;
	this.tableSelectItem.insertRow(0);
	this.divItemList.appendChild(this.tableSelectItem);
	this.disabled = true;
	this.enable();
	//EventManager.add(this.tableSelectItem, "click", this, false);

	this.tdSelectedItem = this.tableSelectItem.rows[0].insertCell(0)
	this.tdSelectedItem.className = "tdselectedItemCombo";
	this.tdSelectedItem.noWrap = true;

	this.divSelectedItem = document.createElement("DIV");
	this.divSelectedItem.style.overflow = "hidden";
	if (!isNaN(pxToInt(this.Width))){
		this.divSelectedItem.style.width = pxToInt(this.Width)-25;
	}else{
		this.divSelectedItem.style.width = this.Width;
	}
	this.divSelectedItem.style.height = this.Height;
	this.tdSelectedItem.appendChild(this.divSelectedItem);

	this.tdToggleList = this.tableSelectItem.rows[0].insertCell(1)
	this.tdToggleList.className = "tdtoggleCombo";
	this.tdToggleList.innerHTML = "&nbsp;";
}

DHTMLComboBox.prototype.dataBind = function (arrdataSource){

	this.ListeItems.dispose();
	this.ListeItems	   = new Collection("DHTMLItemList");

	for (var i=0; i<arrdataSource.length; i++){
		var objItemTmp = new DHTMLItemList(this, i, arrdataSource[i][0], arrdataSource[i][1], false)
		this.ListeItems.add(objItemTmp.value,  objItemTmp)
	}

}

DHTMLComboBox.prototype.selectIndex = function(intIndex){
	if (this.ListeItems.contains(this.selectedValue)){
		this.ListeItems.value(this.selectedValue).unselect();
	}

	if (intIndex>=0){
		var objItemSelect  = this.ListeItems.getItemByIndex(intIndex).select();
		this.selectedIndex = intIndex;
		this.selectedValue = objItemSelect.value;
		this.selectedText  = objItemSelect.text
	}
	else{
		this.selectedIndex = -1;
		this.selectedValue = "";
		this.selectedText  = "-";
	}
//		this.tdSelectedItem.className = "tdselectedItemCombo";
//		this.tdSelectedItem.innerHTML = this.selectedText;
	this.divSelectedItem.innerHTML = this.selectedText;

}

DHTMLComboBox.prototype.selectValue = function(cle){
	if (this.ListeItems.contains(this.selectedValue)){
		this.ListeItems.value(this.selectedValue).unselect();
	}
	if (this.ListeItems.contains(cle)){
		var objItemSelect  = this.ListeItems.value(cle).select();
		this.selectedIndex = objItemSelect.index;
		this.selectedValue = objItemSelect.value;
		this.selectedText  = objItemSelect.text
	}
	else{
		this.selectedIndex = -1;
		this.selectedValue = "";
		this.selectedText  = "-";
	}
//		this.tdSelectedItem.className = "tdselectedItemCombo";
//		this.tdSelectedItem.innerHTML = this.selectedText;
	this.divSelectedItem.innerHTML = this.selectedText;
}

DHTMLComboBox.prototype.length = function(){
	return this.ListeItems.count()
}

DHTMLComboBox.prototype.getValue = function(index){
	return this.ListeItems.getKey(index);
}

DHTMLComboBox.prototype.getIndex = function(cle){
	var intIndex = this.ListeItems.getIndex(cle);
	if (typeof intIndex != "undefined"){
		return intIndex;
	}else{
		return -1;
	}
}

DHTMLComboBox.prototype.disable = function(cle){
	EventManager.remove(this.tableSelectItem, "click", this);
	lightup(this.tableSelectItem, 30);
	this.disabled = true;
}

DHTMLComboBox.prototype.enable = function(cle){
	if (this.disabled){
		EventManager.add(this.tableSelectItem, "click", this, false);
		lightup(this.tableSelectItem, 100);
		this.disabled = false;
	}
}

DHTMLComboBox.prototype.handleEvent = function(oEvent){

	var myEvent		= (IE ? window.event : oEvent);
	var objOrigine	= (IE ? window.event.srcElement : oEvent.target);

	clearTimeout(this.tmContract);

	if (this.tableSelectItem.contains(objOrigine)){
		switch (myEvent.type){
			case "click":
				clearTimeout(this.tmContract);
				if (this.EstDeploye){
					this.contract();
				}
				else{
					this.deploy();
				}
				break;

			case "mouseover":
				clearTimeout(this.tmContract);
				this.tableSelectItem.className = "tableComboBoxOver";
				break;


			case "mouseout":
				clearTimeout(this.tmContract);
				if (!this.EstDeploye){
					this.tableSelectItem.className = "tableComboBox";
				}
				objC=this;
				this.tmContract = window.setTimeout("objC.contract();", 100);
				break;
		}
		return;
	}

	if (this.EstDeploye){
		if (this.divItemSousList.contains(objOrigine)){


			switch (myEvent.type){
				case "click":
					if (objOrigine.parentNode.rowIndex != this.selectedIndex){
						this.selectIndex(objOrigine.parentNode.rowIndex);
						this.caller.handleEvent(oEvent);
					}
					//objc=this;
					//this.tmContract = window.setTimeout("objc.contract();", 150);
					this.contract();
					break;

				case "mouseover":
//					clearTimeout(this.tmContract);
					break;

				case "mouseout":
					objm=this;
					this.tmContract = window.setTimeout("objm.contract();", 150);
					break;
			}
			return;
		}
	}

	objOrigine 	= null;
	myEvent 	= null;
}


DHTMLComboBox.prototype.contract = function(){

	if (typeof this.divItemSousList != "undefined"){
		this.divItemList.removeChild(this.divItemSousList)
		this.divItemSousList = undefined;
	}

	this.EstDeploye = false;
	this.tableSelectItem.className = "tableComboBox";
}

DHTMLComboBox.prototype.deploy = function(){

	if (typeof this.divItemSousList != "undefined"){
		this.divItemList.removeChild(this.divItemSousList)
		this.divItemSousList = undefined;
	}

	// Liste deroulante deployee
	this.divItemSousList = document.createElement("DIV");
	this.divItemList.appendChild(this.divItemSousList)
	this.divItemSousList.style.position  = "absolute";
	this.divItemSousList.style.right 	 = "0px";
	this.divItemSousList.style.top  	 = pxToInt(this.tableSelectItem.clientHeight) + "px";
	this.divItemSousList.className = "tableItemCombo";
	this.divItemSousList.style.overflowY = "auto";
	this.divItemSousList.style.overflowX = "hidden";
	
	var tableItemList = document.createElement("TABLE");
	tableItemList.cellpadding = 0;
	tableItemList.cellSpacing = 0;
	tableItemList.style.width = "100%";

	this.divItemSousList.appendChild(tableItemList)

	for (var strCleItem in this.ListeItems.item){

		var tmpLigne = tableItemList.insertRow(tableItemList.rows.length);
		var objItemTmp = this.ListeItems.value(strCleItem)
		objItemTmp.load();
		tmpLigne.appendChild(objItemTmp.getNode());
	}

	if (pxToInt(tableItemList.clientWidth)>pxToInt(this.divItemList.clientWidth)){
		this.divItemSousList.style.width 	 = pxToInt(tableItemList.clientWidth) + "px";
	}
	if (pxToInt(tableItemList.clientHeight)>150){
		this.divItemSousList.style.height 	 = "150";
		this.divItemSousList.style.overflowY = "auto";
		this.divItemSousList.style.width = parseInt(pxToInt(this.divItemSousList.clientWidth)+50) + "px";
	}
	
	this.EstDeploye = true;
}

DHTMLComboBox.prototype.getNode = function(){
	return this.divComboBox;
}
DHTMLComboBox.prototype.load = function(){

	this.divSelectedItem.innerHTML = this.selectedText;
	if (this.EstDeploye){
		this.deploy();
	}
}

// Type de l'object
DHTMLComboBox.prototype.getType	= function(){	return getObjectType.call(this);	}

// Liberation memoire
DHTMLComboBox.prototype.dispose 	= function(){
	EventManager.unregisterListener(this);
	DisposeObject.call(this);
}


function DHTMLItemList(objCaller, intIndex, strValue, strText, blnSelected){

	this.caller			= objCaller;
	this.index			= intIndex;
	this.value			= strValue;
	this.text			= strText;
	this.selected		= false;
	this.tdItemList		= document.createElement("TD");
	this.tdItemList.noWrap = true;
	EventManager.add(this.tdItemList, "mouseover", this, false);
	EventManager.add(this.tdItemList, "mouseout", this, false);

	if (IE){
		this.tdItemList.onselectstart= new Function ("return false");
		this.tdItemList.ondragstart	 = new Function ("return false");
	}

	if (this.caller.getType() == "DHTMLListBox"){
		if (this.caller.multiple){
			EventManager.add(this.tdItemList, "mousedown", this, false);
			EventManager.add(this.tdItemList, "mouseup", this, false);
		}
		else{
			EventManager.add(this.tdItemList, "click", this, false);
			EventManager.add(this.tdItemList, "dblclick", this, false);
		}
	}else{
		EventManager.add(this.tdItemList, "click", this, false);
	}

}

DHTMLItemList.prototype.load = function (){
	if (this.selected){
		this.tdItemList.className = "tdItemComboSelect";
	}
	else{
		this.tdItemList.className = "tdItemCombo";
	}

	this.tdItemList.innerHTML = (this.text!= "" ? this.text : "&nbsp;");

}

DHTMLItemList.prototype.getNode = function(){
	return this.tdItemList;
}

DHTMLItemList.prototype.unselect = function(){
	this.selected		= false;
	this.tdItemList.className = "tdItemCombo";
	return this;
}

DHTMLItemList.prototype.select = function(){
	this.selected		= true;
	this.tdItemList.className = "tdItemComboSelect";
	return this;
}

DHTMLItemList.prototype.handleEvent = function(oEvent){

	var myEvent		= (IE ? window.event : oEvent);
	var objOrigine	= (IE ? window.event.srcElement : oEvent.target);

	switch (myEvent.type){

		case "mouseover":
			if (this.selected){
				this.tdItemList.className = "tdItemComboSelectSurvol";
			}else{
				this.tdItemList.className = "tdItemComboSurvol";
			}
			break;
		case "mouseout":
			if (this.selected){
				this.tdItemList.className = "tdItemComboSelect";
			}else{
				this.tdItemList.className = "tdItemCombo";
			}
			break;

	}
	this.caller.handleEvent(oEvent);

	objOrigine 	= null;
	myEvent 	= null;
}

// Type de l'object
DHTMLItemList.prototype.getType	= function(){	return getObjectType.call(this);	}

// Liberation memoire
DHTMLItemList.prototype.dispose 	= function(){
	EventManager.unregisterListener(this);
	DisposeObject.call(this);
}
function DHTMLSpinBox(objCaller, intminValue, intmaxValue){

	this.minValue				=   intminValue;
	this.maxValue				=   intmaxValue;

	this.caller					=	objCaller;
	this.divSpinbox				=	document.createElement("DIV");
	this.btUp					=   document.createElement("TD");;
	this.btUp.type				=	"button";
	this.btDown					=   document.createElement("TD");;
//	this.btDown.type			=	"button";
	this.txtValue				=   document.createElement("TD");;
//	this.txtValue.type			=	"text";

}

DHTMLSpinBox.prototype.load = function(){

	var objTable = document.createElement("TABLE");
	this.divSpinbox.appendChild(objTable);
	objTable.cellPadding =0;
	objTable.cellSpacing =0;
	objTable.insertRow(0);
	objTable.insertRow(1);

	this.txtValue = objTable.rows[0].insertCell(0);
	this.txtValue.rowSpan = 2;
	this.txtValue.innerHTML = this.minValue;

	this.btUp = objTable.rows[0].insertCell(1);
	this.btUp.vAlign ="bottom";
	this.btDown = objTable.rows[1].insertCell(0);
	this.btDown.vAlign ="top";

	this.divSpinbox.style.border = "solid 1px black";
	this.txtValue.className		=	"SpinBox";
	this.btUp.className			=	"SpinUp";
	this.btDown.className		=	"SpinDown";

	EventManager.add(this.btDown, "click", this, false);
	EventManager.add(this.btUp  , "click", this, false);
}

DHTMLSpinBox.prototype.setValue = function(v){
	if (v<this.minValue){
		this.txtValue.innerHTML = this.minValue;
	}else if (v>this.maxValue){
		this.txtValue.innerHTML = this.maxValue;
	}else{
		this.txtValue.innerHTML = v;
	}
}

DHTMLSpinBox.prototype.getValue = function(v){
	return this.txtValue.innerHTML;
}

DHTMLSpinBox.prototype.handleEvent = function(oEvent){

	var myEvent		= (IE ? window.event : oEvent);
	var objOrigine	= (IE ? window.event.srcElement : oEvent.target);

	switch (myEvent.type){
		case "click":
			switch (objOrigine) {
				case this.btUp:
					if (parseInt(this.txtValue.innerHTML)<this.maxValue){
						this.txtValue.innerHTML = parseInt(this.txtValue.innerHTML)+1;
					}
					break;
				case this.btDown:
					if (parseInt(this.txtValue.innerHTML)>this.minValue){
						this.txtValue.innerHTML = parseInt(this.txtValue.innerHTML)-1;
					}

					break;
			}
			break;
	}
	this.caller.handleEvent(oEvent);

	myEvent 	= null;

}
DHTMLSpinBox.prototype.disable = function(){
	this.btUp.disabled = true;
	this.btDown.disabled = true;
}

DHTMLSpinBox.prototype.enable = function(){
	this.btUp.disabled = false;
	this.btDown.disabled = false;
}

DHTMLSpinBox.prototype.getNode = function(){
	return this.divSpinbox;
}

// Type de l'object
DHTMLSpinBox.prototype.getType	= function(){	return getObjectType.call(this);	}

// Liberation memoire
DHTMLSpinBox.prototype.dispose 	= function(){
	EventManager.unregisterListener(this);
	DisposeObject.call(this);
}



function DHTMLImgButton(objCaller, urlImg, strAlt){

	this.caller					=	objCaller;
	this.inputButton			=	document.createElement("INPUT");
	this.inputButton.type		=	"button";
	this.inputButton.className	=	"ImgButtonOut";
	lightup(this.inputButton, 30);
	this.inputButton.disabled	=	true;
	this.inputButton.alt		=	strAlt;
	this.inputButton.title		=	strAlt;
	this.inputButton.style.backgroundImage =  "url(" + urlImg + ")";

	EventManager.add(this.inputButton, "click", this, false);
	EventManager.add(this.inputButton, "mouseover", this, false);
	EventManager.add(this.inputButton, "mouseout", this, false);

};

DHTMLImgButton.prototype.handleEvent = function(oEvent){

	var myEvent		= (IE ? window.event : oEvent);

	switch (myEvent.type){
		case "mouseover":
			this.inputButton.className = "ImgButtonOver";
			break;
		case "mouseout":
			this.inputButton.className = "ImgButtonOut";
			break;
	}
	this.caller.handleEvent(oEvent);

	myEvent 	= null;

};
DHTMLImgButton.prototype.disable = function(){
	lightup(this.inputButton, 30);
	this.inputButton.className = "ImgButtonOut";
	this.inputButton.disabled = true;
};

DHTMLImgButton.prototype.enable = function(){
	this.inputButton.disabled = false;
	lightup(this.inputButton, 100);
};

DHTMLImgButton.prototype.getNode = function(){
	return this.inputButton;
};

DHTMLImgButton.prototype.getType	= function(){
	return getObjectType.call(this);	
};

DHTMLImgButton.prototype.dispose 	= function(){
	EventManager.unregisterListener(this);
	DisposeObject.call(this);
};



function DHTMLLinkButton(objCaller, strText, strAlt){

	this.caller					=	objCaller;
	this.inputButton			=	document.createElement("INPUT")
	this.inputButton.type		=	"button"
	this.inputButton.className	=	"LinkButtonOut"
	lightup(this.inputButton, 30);
	this.inputButton.disabled	=	true;
	this.inputButton.alt		=	strAlt;
	this.inputButton.value		=	strText;

	EventManager.add(this.inputButton, "click", this, false)
	EventManager.add(this.inputButton, "mouseover", this, false)
	EventManager.add(this.inputButton, "mouseout", this, false)
};

DHTMLLinkButton.prototype.handleEvent = function(oEvent){

	var myEvent		= (IE ? window.event : oEvent);

	switch (myEvent.type){
		case "mouseover":
			this.inputButton.className = "LinkButtonOver";
			break;
		case "mouseout":
			this.inputButton.className = "LinkButtonOut";
			break;
	}
	this.caller.handleEvent(oEvent);

	myEvent 	= null;
};

DHTMLLinkButton.prototype.disable = function(){
	lightup(this.inputButton, 30);
	this.inputButton.className = "LinkButtonOut";
	this.inputButton.disabled = true;
};

DHTMLLinkButton.prototype.enable = function(){
	this.inputButton.disabled = false;
	lightup(this.inputButton, 100);
};

DHTMLLinkButton.prototype.getNode = function(){
	return this.inputButton;
};

DHTMLLinkButton.prototype.getType	= function(){
	return getObjectType.call(this);	
};

DHTMLLinkButton.prototype.dispose 	= function(){
	EventManager.unregisterListener(this);
	DisposeObject.call(this);
};


function DHTMLMixedButton(objCaller, urlImg, strText, strAlt){

	this.caller					=	objCaller;
	this.inputButton			=	document.createElement("INPUT")
	this.inputButton.type		=	"button"
	this.inputButton.className	=	"MixedButtonOut"
	lightup(this.inputButton, 30);
	this.inputButton.disabled	=	true;
	this.inputButton.alt		=	strAlt;
	this.inputButton.value		=	strText;
	this.inputButton.style.backgroundImage =  "url(" + urlImg + ")"

	EventManager.add(this.inputButton, "click", this, false)
	EventManager.add(this.inputButton, "mouseover", this, false)
	EventManager.add(this.inputButton, "mouseout", this, false)
};


DHTMLMixedButton.prototype.handleEvent = function(oEvent){

	var myEvent		= (IE ? window.event : oEvent);

	switch (myEvent.type){
		case "mouseover":
			this.inputButton.className = "MixedButtonOver";
			break;
		case "mouseout":
			this.inputButton.className = "MixedButtonOut";
			break;
	}
	this.caller.handleEvent(oEvent);

	myEvent 	= null;
};

DHTMLMixedButton.prototype.disable = function(){
	lightup(this.inputButton, 30);
	this.inputButton.className = "MixedButtonOut";
	this.inputButton.disabled = true;
}

DHTMLMixedButton.prototype.enable = function(){
	this.inputButton.disabled = false;
	lightup(this.inputButton, 100);
};

DHTMLMixedButton.prototype.getNode = function(){
	return this.inputButton;
};

DHTMLMixedButton.prototype.getType	= function(){
	return getObjectType.call(this);	
};

DHTMLMixedButton.prototype.dispose 	= function(){
	EventManager.unregisterListener(this);
	DisposeObject.call(this);
};

function HeaderCell(objCaller, strCleCellule, strClassName, strContenu, strTitle, blnEstAffichee){

 	this.caller 			= objCaller;
	this.cle				= strCleCellule;
	this.textContent		= strContenu;
	this.title				= strTitle;
	this.className			= strClassName;
	this.EstAffichee		= blnEstAffichee;

	this.rgxpEventTri		= new RegExp("btnTri_", "i");
	this.rgxpEventVariable	= new RegExp("btnVariable_", "i");

 	this.divUc 				= document.createElement("DIV");
//	this.divUc.style.height="100%";
//	this.divUc.noWrap 		= "true";
	this.divUc.align 		= "center";
	this.divUc.vAlign    	= "middle";

	this.btnTriCroissant	= new DHTMLImgButton(this, strCheminImgBtn + "bt_SortUp_N.gif", "Tri croissant");
	this.btnTriCroissant.enable();

	this.btnTriDecroissant	= new DHTMLImgButton(this, strCheminImgBtn + "bt_SortDown_N.gif", "Tri d\u00e9croissant");
	this.btnTriDecroissant.enable();
}

HeaderCell.prototype.getNode = function(){
	return this.divUc;
}
HeaderCell.prototype.Show = function(){
	this.divUc.style.visibility = "visible";
}
HeaderCell.prototype.Hide = function(){
	this.divUc.style.visibility = "hidden";
}

HeaderCell.prototype.load = function(){

/*	var objTable 	= document.createElement("TABLE");
	objTable.cellPadding=0;
	objTable.cellSpacing=0;
	objTable.style.width = "100%";
	objTable.style.height= "100%";
	var objLigne 	= objTable.insertRow(0);
	var objCellule 	= objLigne.insertCell(0);
*/
//	this.divUc.appendChild(objTable);
//	objLigne.style.height="100%";
	
	this.divUc.title	   	= this.title;
	this.divUc.className 	= this.className;
	this.divUc.innerHTML 	= "";
	// Libelle
	if (this.cle == "DIM" || this.cle == "NUMDIM"){
		this.divUc.innerHTML = this.textContent;
		//objCellule.innerHTML = this.textContent;
	}
	else{
		this.btnModifVariable				=	document.createElement("A")
		this.btnModifVariable.id			=	this.rgxpEventVariable.source + this.cle
		this.btnModifVariable.title			=	this.divUc.title;
		this.btnModifVariable.className		=	"LinkOut"
		this.btnModifVariable.innerHTML		=	this.textContent;
		EventManager.add(this.btnModifVariable, "click"		, this, false)
		EventManager.add(this.btnModifVariable, "mouseover"	, this, false)
		EventManager.add(this.btnModifVariable, "mouseout"	, this, false)

		this.divUc.appendChild(this.btnModifVariable);
		//objCellule.appendChild(this.btnModifVariable);
	}

	// Boutons de tri
/*
	objLigne 	= objTable.insertRow(1);
	objCellule 	= objLigne.insertCell(0);
	objLigne.style.height="0%";
 */
	if (this.cle != "NUMDIM"){
		var tableBoutons;
		var LigneBoutons;
		var CelluleBoutons;

		tableBoutons		= document.createElement("TABLE");
		tableBoutons.cellPadding=0;
		tableBoutons.cellSpacing=0;
		tableBoutons.align	= "center";
		LigneBoutons		= tableBoutons.insertRow(0);

		CelluleBoutons	= LigneBoutons.insertCell(LigneBoutons.cells.length);
		CelluleBoutons.appendChild(this.btnTriCroissant.getNode());
		this.btnTriCroissant.getNode().id = this.rgxpEventTri.source + "ASC_" + this.cle;

		CelluleBoutons	= LigneBoutons.insertCell(LigneBoutons.cells.length);
		CelluleBoutons.appendChild(this.btnTriDecroissant.getNode());
		this.btnTriDecroissant.getNode().id = this.rgxpEventTri.source + "DESC_" + this.cle;

		this.divUc.appendChild(tableBoutons);
		//objCellule.appendChild(tableBoutons);


		tableBoutons			=	null;
		LigneBoutons			=	null;
		CelluleBoutons			=	null;
//	}else{
//		objCellule.innerHTML = "&nbsp;";
	}
/*	objTable 	= null;
	objLigne 	= null;
	objCellule 	= null;*/
}
HeaderCell.prototype.handleEvent = function(oEvent){

	var myEvent		= (IE ? window.event : oEvent);
	var objOrigine	= (IE ? window.event.srcElement : oEvent.target);

	// Modifier une variable du tableau
	switch (objOrigine){
		case this.btnModifVariable:
			switch (myEvent.type){
				case "click":
					if (this.caller){
						this.caller.handleEvent(oEvent);
					}
					break;
				case "mouseover":
					objOrigine.className = "LinkOver";
					break;
				case "mouseout":
					objOrigine.className = "LinkOut";
					break;
			}
			break;

		default:
			if (this.caller){
				this.caller.handleEvent(oEvent);
			}
	}
}

// Type de l'object
HeaderCell.prototype.getType	= function(){	return getObjectType.call(this);	}

// Liberation memoire
HeaderCell.prototype.dispose = function(){
	EventManager.unregisterListener(this);
	DisposeObject.call(this);
}

HeaderCell.prototype.getPrintNode = function(){

	var divExport = document.createElement("DIV");
	divExport.className 	= this.className;
	divExport.innerHTML = this.textContent;

	return divExport;
};
function HeaderRow(objCaller, objContexte){

 	this.caller 		= objCaller;
	if (typeof objContexte != "undefined"){
		this.ContexteEnCours			= objContexte;
	}
	else{
		this.ContexteEnCours			= new ContexteMulti();
	}

 	this.divUc = document.createElement("DIV");
 	this.divUc.style.overflowY = "hidden";

	//Tri en cours
	this.rgxpEventTri 		   = new RegExp("btnTri_", "i")
	this.idbtnTriEnCours	   = undefined;

	// Redimensionnement en cours
	this.rgxpEventResize	   = new RegExp("resize_", "i");
	this.ixColResize		   = undefined;

	// Tableau
	this.tableEntete	    = document.createElement("TABLE");
	this.tableEntete.className = "TableauEtude"

	this.tableEntete.cellSpacing = 0;
	this.tableEntete.cellPadding = 0;
	this.divUc.appendChild(this.tableEntete)

	if (IE){
		this.tableEntete.onselectstart= new Function ("return false");
		this.tableEntete.ondragstart	 = new Function ("return false");
	}
}

HeaderRow.prototype.load = function(intColDeb, intNbVariablesParPage){


	//N° d'Ordre
	this.CelNum =  new HeaderCell(	this,
										"NUMDIM",
										"CelluleTableau",
										" N\u00b0 ",
										"Num\u00e9ro d\u0027ordre",
										this.ContexteEnCours.TableauCtxt.AffNumOrdre
									  );
	//Dimension
	var strTitreDimension;
	if (this.ContexteEnCours.DimSousTotal == null){
		strTitreDimension = this.ContexteEnCours.Dimension.Nom;
	}else{
		this.ContexteEnCours.DimSousTotal.Nom = this.ContexteEnCours.DimSousTotal.Nom.replace (/\s/g,"");
		if (this.ContexteEnCours.DimSousTotal.Nom == ""){
			strTitreDimension = this.ContexteEnCours.Dimension.Nom;
		}else{
			strTitreDimension =	this.ContexteEnCours.Dimension.Nom + "<br>/ " + this.ContexteEnCours.DimSousTotal.Nom;
		}	
	}	
	this.CelDim =  	new HeaderCell(this,
										"DIM",
										"CelluleTableau",
										strTitreDimension,
										"Dimension " + this.ContexteEnCours.Dimension.Nom,
										true
										);
	//Variables
	this.Cellules = new Collection("HeaderCell");
	for (var strCleVariableTmp in this.ContexteEnCours.Variables.item)
	{

		var objVariableTmp = this.ContexteEnCours.Variables.value(strCleVariableTmp);
		this.Cellules.add(objVariableTmp.Cle(), new HeaderCell(this,
														objVariableTmp.Cle(),
														"CelluleTableau",
														objVariableTmp.LibelleLong().replace(/ - /g,"<BR>"),
														objVariableTmp.Definition(),
														objVariableTmp.EstAffichee()
														));
		objVariableTmp = null;
	}

	var SectionEnteteTableau;
	var trLigneEntete;
	var tdCellule;
	var tableCellDonnee;
	var trCellDonnee;
	var tdCellDonnee;
	var objCellule;
	var tdResize;

	// Reinitialisation du tableau
	while (this.tableEntete.hasChildNodes()){
		this.tableEntete.removeChild(this.tableEntete.firstChild);
	}

	SectionEnteteTableau = this.tableEntete.createTHead();
	trLigneEntete		 = SectionEnteteTableau.insertRow(0);

	// Largeur des colonnes
	this.colgrpEntete = this.tableEntete.appendChild(document.createElement("COLGROUP"));
	var colprop;

	// Chargement des cellules
	// Numero de ligne
	if (this.CelNum.EstAffichee){
		tdCellule = trLigneEntete.insertCell(trLigneEntete.cells.length);
		tdCellule.className = "thDimension_Normal";
		tdCellule.appendChild(this.CelNum.getNode());
		this.CelNum.load();

		colprop = this.colgrpEntete.appendChild(document.createElement("COL"));
		colprop.id    = "col_" + this.CelNum.cle;
		colprop.width = this.caller.Parametres.getLargeurColonne(this.CelNum.cle);

		tdResize = trLigneEntete.insertCell(trLigneEntete.cells.length);
		tdResize.className = "tdResize";
		tdResize.id = "resize_" + this.CelNum.cle;
		EventManager.add(tdResize, "mousedown"		, this, false)
		EventManager.add(tdResize, "mouseup"		, this, false);

		colprop = this.colgrpEntete.appendChild(document.createElement("COL"));
		colprop.width = "1";

	}

	// Dimension
	tdCellule = trLigneEntete.insertCell(trLigneEntete.cells.length);
	tdCellule.className = "thDimension_Normal";
	tdCellule.appendChild(this.CelDim.getNode());
	this.CelDim.load();

	colprop = this.colgrpEntete.appendChild(document.createElement("COL"));
	colprop.id    = "col_" + this.CelDim.cle;
	colprop.width = this.caller.Parametres.getLargeurColonne(this.CelDim.cle);

	tdResize = trLigneEntete.insertCell(trLigneEntete.cells.length);
	tdResize.className = "tdResize";
	tdResize.id = "resize_" + this.CelDim.cle;
	EventManager.add(tdResize, "mousedown"		, this, false)
	EventManager.add(tdResize, "mouseup"		, this, false);

	colprop = this.colgrpEntete.appendChild(document.createElement("COL"));
	colprop.width = "1";

	//Variables
	//var intIndexColVariable = 2;
	var intColAffEnCours = -1;
	var intColFin = intColDeb + intNbVariablesParPage -1 ;

	for (var CleCellule in this.Cellules.item){

		objCellule = this.Cellules.value(CleCellule);
		if (objCellule.EstAffichee){
			intColAffEnCours++;

			if (intColAffEnCours >= intColDeb && intColAffEnCours<=intColFin){

				tdCellule = trLigneEntete.insertCell(trLigneEntete.cells.length);
				tdCellule.className = "thDonnee_Normal";
				tdCellule.valign="middle"

				tableCellDonnee = document.createElement("TABLE")
				tdCellule.appendChild(tableCellDonnee)
				tableCellDonnee.cellPadding=0
				tableCellDonnee.cellSpacing=0
//				tableCellDonnee.style.width = "100%";
				tableCellDonnee.valign="middle"
				tableCellDonnee.align="center"

				// Accès au variables suivantes/precedentes
				trCellDonnee    = tableCellDonnee.insertRow(tableCellDonnee.rows.length)
				tdCellDonnee	= trCellDonnee.insertCell(trCellDonnee.cells.length)
				tdCellDonnee.innerHTML = "&nbsp;"

				// bouton d'acces a la variable precedente
				if (intColAffEnCours == (intColDeb) && intColAffEnCours > 0 ){
					this.btnVariablePrecedente	= new DHTMLImgButton(this, strCheminImgBtn + "bt_MoveLeft_N.gif", "Variable pr\u00e9c\u00e9dente");
					this.btnVariablePrecedente.enable();
					tdCellDonnee.appendChild(this.btnVariablePrecedente.getNode())
					tdCellDonnee.align="left"
				}

				// bouton d'acces a la variable suivante
				if (intColAffEnCours == intColFin && intColAffEnCours < this.ContexteEnCours.Variables.count()-1 )
				{
					this.btnVariableSuivante	= new DHTMLImgButton(this, strCheminImgBtn + "bt_MoveRight_N.gif", "Variable suivante");
					this.btnVariableSuivante.enable();
					tdCellDonnee.appendChild(this.btnVariableSuivante.getNode())
					tdCellDonnee.align="right"
				}

				// Variable ( lien vers ecran modification + boutons tri)
				trCellDonnee    = tableCellDonnee.insertRow(tableCellDonnee.rows.length)
				tdCellDonnee.noWrap = true;
				tdCellDonnee	= trCellDonnee.insertCell(trCellDonnee.cells.length)
				tdCellDonnee.appendChild(objCellule.getNode());
				objCellule.load();
				//tdCellDonnee.style.width = "100%";

				colprop = this.colgrpEntete.appendChild(document.createElement("COL"));
				colprop.id    = "col_" + CleCellule;
				colprop.width = this.caller.Parametres.getLargeurColonne(CleCellule);


				tdResize = trLigneEntete.insertCell(trLigneEntete.cells.length);
				tdResize.className = "tdResize";
				tdResize.id = "resize_" + CleCellule;
				EventManager.add(tdResize, "mousedown"		, this, false)
				EventManager.add(tdResize, "mouseup"		, this, false);

				colprop = this.colgrpEntete.appendChild(document.createElement("COL"));
				colprop.width = "1";
			}
		}
		//intIndexColVariable++;
	}

	this.divUc.style.height = pxToInt(this.tableEntete.clientHeight)+1+(Mozilla?1:0);


	// liberation de la memoire
	SectionEnteteTableau	=	null;
	trLigneEntete			=	null;
	tdCellule				=	null;
	tableCellDonnee			= 	null;
	trCellDonnee			= 	null;
	tdCellDonnee			= 	null;
	objCellule				= 	null;
}

HeaderRow.prototype.getNode = function(){
	return this.divUc;
}

HeaderRow.prototype.handleEvent = function(oEvent){

	var myEvent		= (IE ? window.event : oEvent);
	var objOrigine	= (IE ? window.event.srcElement : oEvent.target);

	if (myEvent.type == "mouseup"){
		if (this.CleColResize){
			document.body.removeChild(this.axe);
			EventManager.remove(this.axe, "mousedown"		, this)
			EventManager.remove(this.axe, "mouseup"		, this)
			if ((this.caller.Parametres.getLargeurColonne(this.CleColResize)+ (myEvent.clientX - this.axeY))>2){
				this.caller.Parametres.setLargeurColonne(this.CleColResize, parseInt(this.caller.Parametres.getLargeurColonne(this.CleColResize))
																			+ parseInt(myEvent.clientX - this.axeY));
			}else{
				this.caller.Parametres.setLargeurColonne(this.CleColResize, 2);
			}
			this.caller.RedimensionneTableau();
			this.divUc.style.height = pxToInt(this.tableEntete.clientHeight)+1+(Mozilla?1:0);
			delete this.axe;
			delete this.axeY;
		}
	}

	if (this.rgxpEventResize.test(objOrigine.id)){
		switch (myEvent.type){
			case "mousedown":
				if (!this.axe){
					this.axe = document.createElement("DIV");
					this.axe.style.height = "100%";
					this.axe.style.width  = "1px";
					this.axe.style.backgroundColor = "red";
					this.axe.style.position = "absolute";
					this.axe.style.cursor = "w-resize"
					this.axe.style.top = 0;
					this.CleColResize = objOrigine.id.replace("resize_", "");
					this.axeY = myEvent.clientX;
					this.axe.style.left = this.axeY;
					this.axe.style.zIndex = 5000;
					document.body.appendChild(this.axe);
					EventManager.add(this.axe, "mousedown"		, this, false);
					EventManager.add(this.axe, "mouseup"		, this, false);
				}
				beginDrag(this.axe, myEvent, false, true)
				break;
		}
	}

	if (this.rgxpEventTri.test(objOrigine.id)){
		switch (myEvent.type){
			case "click":
				if (this.idbtnTriEnCours){
					document.getElementById(this.idbtnTriEnCours).style.backgroundColor = "";
				}
				this.idbtnTriEnCours = objOrigine.id;
				objOrigine.style.backgroundColor = "red";
				break;
		}
	}

	if (this.caller){
		this.caller.handleEvent(oEvent);
	}
	objOrigine 	= null;
	myEvent 	= null;
}

// Type de l'object
HeaderRow.prototype.getType	= function(){	return getObjectType.call(this);	}

// Liberation memoire
HeaderRow.prototype.dispose = function(){
	EventManager.unregisterListener(this);
	DisposeObject.call(this);
}

HeaderRow.prototype.getPrintNode = function(intColDeb, intNbVariablesParPage){

	var tableExport;
	var trLigneEntete;
	var tdCellule;
	var tableCellDonnee;
	var trCellDonnee;
	var tdCellDonnee;
	var objCellule;

	// Tableau
	tableExport	    = document.createElement("TABLE");
	tableExport.className = "TableauEtude"
	tableExport.cellSpacing = 0;
	tableExport.cellPadding = 0;

	// Largeur des colonnes
//	tableExport.appendChild(this.colgrpEntete.cloneNode(true));

	// Chargement des cellules
	trLigneEntete		 = tableExport.insertRow(0);
	// Numero de ligne
	if (this.CelNum.EstAffichee){
		tdCellule = trLigneEntete.insertCell(trLigneEntete.cells.length);
		tdCellule.className = "thDimension_Normal";
		tdCellule.appendChild(this.CelNum.getPrintNode());
	}

	// Dimension
	tdCellule = trLigneEntete.insertCell(trLigneEntete.cells.length);
	tdCellule.className = "thDimension_Normal";
	tdCellule.appendChild(this.CelDim.getPrintNode());


	//Variables
	//var intIndexColVariable = 2;
	var intColAffEnCours = -1
	var intColFin = intColDeb + intNbVariablesParPage -1 ;

	for (var CleCellule in this.Cellules.item){

		objCellule = this.Cellules.value(CleCellule);
		if (objCellule.EstAffichee){
			intColAffEnCours++;

			if (intColAffEnCours >= intColDeb && intColAffEnCours<=intColFin){

				tdCellule = trLigneEntete.insertCell(trLigneEntete.cells.length);
				tdCellule.className = "thDonnee_Normal";
				tdCellule.appendChild(objCellule.getPrintNode());
			}
		}
		//intIndexColVariable++;
	}

	// liberation de la memoire
	trLigneEntete	=	null;
	tdCellule		=	null;
	objCellule		= 	null;

	return tableExport;
}
	function Pagination(objCaller){

 	this.caller 		= objCaller;

 	this.divUc = document.createElement("DIV");
 	this.divUc.style.visibility = "hidden";

	this.tableNavigation	    = document.createElement("TABLE");
	this.tableNavigation.cellPadding = 0;
	this.tableNavigation.cellSpacing = 0;
	this.tableNavigation.insertRow(this.tableNavigation.rows.length);

	this.divUc.appendChild(this.tableNavigation)

	/*=============================================================================
			Gestion de la pagination
	=============================================================================*/
	var tdTmp;

	// premiere page
	tdTmp = this.tableNavigation.rows[0].insertCell(this.tableNavigation.rows[0].cells.length)
	this.btnPageDebut	= new DHTMLImgButton(this, strCheminImgBtn + "bt_Movefirst_N.gif", "Premi\u00e8re page");
	tdTmp.appendChild(this.btnPageDebut.getNode());

	// page precedente
	tdTmp = this.tableNavigation.rows[0].insertCell(this.tableNavigation.rows[0].cells.length)
	this.btnPagePrecedente	= new DHTMLImgButton(this, strCheminImgBtn + "bt_Moveleft_N.gif", "Page pr\u00e9c\u00e9dente");
	tdTmp.appendChild(this.btnPagePrecedente.getNode());

	// aller a la page ...
	tdTmp = this.tableNavigation.rows[0].insertCell(this.tableNavigation.rows[0].cells.length)
	tdTmp.width  = "100";

	this.divPagination = document.createElement("DIV");
	tdTmp.appendChild(this.divPagination);
	this.divPagination.style.position = "relative";
	this.divPagination.style.width = "100%";
	this.divPagination.style.height = "60%";
	this.divPagination.style.zIndex = 15;

	// page suivante
	tdTmp = this.tableNavigation.rows[0].insertCell(this.tableNavigation.rows[0].cells.length)
	this.btnPageSuivante	= new DHTMLImgButton(this, strCheminImgBtn + "bt_Moveright_N.gif", "Page suivante");
	tdTmp.appendChild(this.btnPageSuivante.getNode());


	// derniere page
	tdTmp = this.tableNavigation.rows[0].insertCell(this.tableNavigation.rows[0].cells.length)
	this.btnPageFin	= new DHTMLImgButton(this, strCheminImgBtn + "bt_Movelast_N.gif", "Derni\u00e8re page");
	tdTmp.appendChild(this.btnPageFin.getNode());

	tdTmp = null;
}

Pagination.prototype.getNode = function(){
	return this.divUc;
}
Pagination.prototype.Show = function(){
	this.divUc.style.visibility = "visible";
}
Pagination.prototype.Hide = function(){
	this.divUc.style.visibility = "hidden";
}
Pagination.prototype.load = function(intNbPages){

	this.NbPages = intNbPages;

	if (typeof this.cboPageTableau == "undefined"){
		this.cboPageTableau		= new DHTMLComboBox(this, this.divPagination.offsetWidth, this.divPagination.offsetHeight);
		this.divPagination.appendChild(this.cboPageTableau.getNode());
	}

	var arrPages = new Array();
	for (var i=1; i<=this.NbPages; i++)
	{
		arrPages.push([i.toString(), i.toString() + "/" + this.NbPages.toString()]);
	}
	this.cboPageTableau.dataBind(arrPages);
	this.cboPageTableau.load();
	arrPages = null;

	this.divUc.style.height = pxToInt(this.tableNavigation.clientHeight);

	if (this.NbPages > 1){
		this.Show();
	}else{
		this.Hide();
	}
}
Pagination.prototype.select = function(intNumPage){

	if (typeof intNumPage != "undefined"){
		if (intNumPage<1){
			intNumPage = 1;
		}else{
			if (intNumPage>this.NbPages){
				intNumPage = this.NbPages;
			}else{
				intNumPage = intNumPage;
			}
		}
	}

	if (intNumPage > 1){
		this.btnPageDebut.enable();
	}else{
		this.btnPageDebut.disable();
	}

	if (intNumPage > 1){
		this.btnPagePrecedente.enable();
	}else{
		this.btnPagePrecedente.disable();
	}

	this.cboPageTableau.selectValue(intNumPage);

	if (intNumPage < this.NbPages){
		this.btnPageSuivante.enable();
	}else{
		this.btnPageSuivante.disable();
	}

	if (intNumPage < this.NbPages){
		this.btnPageFin.enable();
	}else{
		this.btnPageFin.disable();
	}
}
Pagination.prototype.handleEvent = function(oEvent){

	var myEvent		= (IE ? window.event : oEvent);
	var objOrigine	= (IE ? window.event.srcElement : oEvent.target);

	switch (myEvent.type){
		case "click":
			switch (objOrigine){

				case this.btnPageDebut.getNode():
					this.select(1);
					break;

				case this.btnPagePrecedente.getNode():
					this.select(parseInt(this.cboPageTableau.selectedValue)-1);
					break;

				case this.btnPageSuivante.getNode():
					this.select(parseInt(this.cboPageTableau.selectedValue)+1);
					break;

				case this.btnPageFin.getNode():
					this.select(this.NbPages);
					break;

				default:
					if (this.cboPageTableau.getNode().contains(objOrigine)){
						this.select(this.cboPageTableau.selectedValue);
					}
			}
			this.caller.handleEvent(oEvent);
			break;
	}
}
Pagination.prototype.getNumPageEnCours = function(){
	return this.cboPageTableau.selectedValue;
}

// Type de l'object
Pagination.prototype.getType	= function(){	return getObjectType.call(this);	}

// Liberation memoire
Pagination.prototype.dispose = function(){
	EventManager.unregisterListener(this);
	DisposeObject.call(this);
}

/*
 *
 * Fenetre Type Reperes
 *
 */
function FormReperes(){
}

FormReperes.prototype.init = function(strTitle, intWidth, intHeight, blnScrollable, blnClosable, blnMovable){

	this.divForm = document.createElement("DIV");
	this.divForm.style.width  = intWidth;
	this.divForm.style.height = intHeight;
	//this.divForm.align="center"
	this.divForm.style.position	  = "absolute";
	this.divForm.style.left  = 0;
	this.divForm.style.top	 = 0;
	this.divForm.style.visibility = "hidden";
	this.divForm.style.overflow   = "hidden";

	this.styleBarreTitreForm  =  "styleBarreTitreForm"
	this.styleCorpsForm  	  = "styleCorpsForm"

	this.divBarreTitreForm 		  = document.createElement("DIV");
	this.divBarreTitreForm.className = this.styleBarreTitreForm;
	this.divBarreTitreForm.style.backgroundImage= "url(" + getUrlReperes() + "Commun/IMG/Boutons//Fond_bt_N.gif)";

	//this.divForm.appendChild(this.divBarreTitreForm);
	this.btnMove  = new DHTMLImgButton(this, getUrlReperes() + "Commun/IMG/pReperes.ico", "D\u00e9placer la fen\u00eatre")
	this.btnClose = new DHTMLImgButton(this, getUrlReperes() + "Commun/IMG/boutons/bt_Close_N.gif", "Fermer la fen\u00eatre")
	this.btnMove.enable();
	this.btnClose.enable();
	var objTable = document.createElement("TABLE");
	this.divBarreTitreForm.appendChild(objTable);
	objTable.insertRow(0);
	objTable.cellpadding=5;
	objTable.cellSpacing=0;
	var tdMove  = objTable.rows[0].insertCell(0);
	tdMove.align="left";
	tdMove.width="30";
	tdMove.innerHTML ="<img src =\"" + getUrlReperes() + "Commun/IMG/pReperes.ico\">";
	var tdTitle = objTable.rows[0].insertCell(1);
	tdTitle.align="center";
	tdTitle.innerHTML = strTitle;
	var tdClose = objTable.rows[0].insertCell(2);
	tdClose.width="30";
	tdClose.align="right";
	tdClose.appendChild(this.btnClose.getNode());
	this.btnClose.getNode().align="right";

	if (!blnClosable){
		this.btnClose.getNode().style.visibility = "hidden";
	}

	if (blnMovable){
		this.divBarreTitreForm.style.cursor = "move";
		this.divBarreTitreForm.onmousedown = function(event){
			beginDrag(this.parentNode, event);
		}
	}

	this.divCorpsForm = document.createElement("DIV");
	this.divCorpsForm.className		 = this.styleCorpsForm;
	if (blnScrollable){
		this.divCorpsForm.style.overflow= "auto";
	}else{
		this.divCorpsForm.style.overflow= "hidden";
	}
	this.divForm.appendChild(this.divCorpsForm);

	if (isNaN(intHeight)){
		this.divBarreTitreForm.style.width = intHeight;
		this.divCorpsForm.style.width = intHeight;
	}
	else{
		this.divBarreTitreForm.style.width = intWidth;
		this.divCorpsForm.style.width = intWidth;
	}

	if (isNaN(intHeight)){
		this.divCorpsForm.style.height = intHeight;
	}
	else{
		if (IE){
			this.divCorpsForm.style.height = pxToInt(intHeight)-30;
		}
		else{
			this.divCorpsForm.style.height = pxToInt(intHeight)-33;
		}
	}
}

FormReperes.prototype.setCorpsForm = function(strHTMLContenu){
	this.divBarreTitreForm.style.width  = pxToInt(this.divForm.clientWidth);
	this.divCorpsForm.style.width		= pxToInt(this.divForm.clientWidth);
	this.divCorpsForm.style.height		= pxToInt(this.divForm.clientHeight) - pxToInt(this.divBarreTitreForm.clientHeight) - 8;
	this.divForm.style.width = pxToInt(this.divCorpsForm.clientWidth) + 4
	this.divCorpsForm.innerHTML = strHTMLContenu;
}

FormReperes.prototype.appendCorpsForm = function(Node){
	this.divCorpsForm.appendChild(Node);
}

FormReperes.prototype.removeCorpsForm = function(Node){
	this.divCorpsForm.removeChild(Node);
}


FormReperes.prototype.Place = function(intTop, intLeft, zIndex){

	this.divForm.style.top		  = intTop;
	this.divForm.style.left		  = intLeft;
	this.divForm.style.zIndex	  = zIndex;

   /*
		this.divForm.style.marginTop  = pxToInt(this.divForm.clientHeight)/-2;
		this.divForm.style.marginLef  = pxToInt(this.divForm.clientWidth)/-2;
		this.divForm.style.top		  = "50%";
		this.divForm.style.left		  = "50%";
 */
}

/*FormReperes.prototype.moveForm = function(oEvent){
	var myEvent		= (IE ? window.event : oEvent);
	var objOrigine	= (IE ? window.event.srcElement : oEvent.target);
	beginDrag(objOrigine.parentNode, myEvent);
}*/

FormReperes.prototype.Show = function(){
	/*if (this.divForm.addEventListener){
		this.divForm.addEventListener("mousedown",this.moveForm,false);
	}
	else{
		this.divForm.attachEvent("onmousedown",this.moveForm);
   }*/
   this.divForm.style.visibility = "visible";
}
FormReperes.prototype.Hide = function(){
	this.divForm.style.visibility = "hidden";
}
FormReperes.prototype.getNode = function(){
	return this.divForm;
}
FormReperes.prototype.getBarreTitreForm = function(){
	return this.divBarreTitreForm;
}
FormReperes.prototype.getCorpsForm = function(){
	return this.divCorpsForm;
}



// Type de l'object
FormReperes.prototype.getType	= function(){	return getObjectType.call(this);	}

// Liberation memoire
FormReperes.prototype.dispose 	= function(){
	/*if (this.divBarreTitreForm.removeEventListener){
		this.divBarreTitreForm.removeEventListener("mousedown",this.moveForm,false);
	}
	else{
		this.divBarreTitreForm.detachEvent("onmousedown",this.moveForm);
   }*/
	EventManager.unregisterListener(this);
	DisposeObject.call(this);
}
/*
 *
 * Volet Gauche Type Reperes
 *
 */
function VoletReperes(){
}

VoletReperes.prototype = new FormReperes();

VoletReperes.prototype.styleCorpsVoletGauche 		= "styleCorpsVoletGauche";
VoletReperes.prototype.styleBarreVoletGaucheOver	= "styleBarreVoletGaucheOver";
VoletReperes.prototype.styleBarreVoletGaucheOut 	= "styleBarreVoletGaucheOut";

VoletReperes.prototype.divBarreVolet   				= document.createElement("DIV");
VoletReperes.prototype.divContenuVolet 				= document.createElement("DIV");

VoletReperes.prototype.BorderTitle	 = undefined;
VoletReperes.prototype.SrcImg		 = undefined;
VoletReperes.prototype.EstAffiche	 = true;

VoletReperes.prototype.init2 = function(strTitle, strBorderTitle, intWidth, intHeight, strSrcImg){

	this.init(strTitle, intWidth, intHeight);
	this.BorderTitle = strBorderTitle;
	this.SrcImg = strSrcImg;

	this.getNode().style.position = "absolute";
	this.getNode().style.top 	 	= "1px";

//	this.divBarreVolet   	= document.createElement("DIV");
	this.divBarreVolet.className = this.styleBarreVoletGaucheOut;
	this.divBarreVolet.id   = "divBarreVolet";
	this.divCorpsForm.appendChild(this.divBarreVolet);

	EventManager.add(this.divBarreVolet, "click", this, false);
	EventManager.add(this.divBarreVolet, "mouseover", this, false);
	EventManager.add(this.divBarreVolet, "mouseout", this, false);

//	this.divContenuVolet = document.createElement("DIV");
	this.divContenuVolet.className			 = this.styleCorpsVoletGauche;
	this.divContenuVolet.id   = "divContenuVolet";
	this.divCorpsForm.appendChild(this.divContenuVolet);


// initialisation : le volet est masque
	this.getNode().style.left = "0px" ;
	this.divBarreVolet.innerHTML = "";

	var strHtmlBarreVolet = "<table height='100%'>"
							+ "<tr height='0px'><td><img src='" + getUrlReperes() + "Commun/IMG/boutons/bt_MoveAllRight_N.gif'></td></tr>"
							+ "<tr height='100%' valign='middle'><td class='styleTexteBarreVoletGauche' >";

//  Icone eventuelle dans la barre de titre
	if (typeof this.SrcImg != "undefined"){
		strHtmlBarreVolet += "<img src='" + this.SrcImg + "'><BR><BR>";
	}

	for (var i=0; i<this.BorderTitle.length; i++){
		strHtmlBarreVolet += this.BorderTitle.charAt(i) + "<br>";
	}
	strHtmlBarreVolet += "</td></tr>"
					  +  "<tr height='0px'><td><img src='" + getUrlReperes() + "Commun/IMG/boutons/bt_MoveAllRight_N.gif'></td></tr>"
					  +  "</table>";
	this.divBarreVolet.innerHTML = strHtmlBarreVolet;
}

VoletReperes.prototype.handleEvent = function(oEvent){
	var myEvent		= (IE ? window.event : oEvent);
	var objOrigine	= (IE ? window.event.srcElement : oEvent.target);

	// Afficher/Masquer le volet des parametres
	if (this.divBarreVolet == objOrigine || this.divBarreVolet.contains(objOrigine)){
		switch (myEvent.type){
			case "click":
				if (this.EstAffiche){
					this.Minimize();
				}else{
					this.Restore();
				}
				break;
			case "mouseover":
				this.divBarreVolet.className = this.styleBarreVoletGaucheOver;
				break
			case "mouseout":
				this.divBarreVolet.className = this.styleBarreVoletGaucheOut;
				break;
		}
	}

	objOrigine 	= null;
	myEvent 	= null;

}

VoletReperes.prototype.getCorpsForm = function(){
	return this.divContenuVolet;
}
VoletReperes.prototype.getBarreVoletForm = function(){
	return this.divBarreVolet;
}

VoletReperes.prototype.setCorpsForm = function(strHTMLContenu){

	this.divContenuVolet.style.width		= "90%";//100%
	this.divContenuVolet.style.height		= pxToInt(this.getNode().clientHeight) - pxToInt(this.getBarreTitreForm().clientHeight) - 8;
	this.divBarreVolet.style.height			= pxToInt(this.getNode().clientHeight) - pxToInt(this.getBarreTitreForm().clientHeight) - 8;
	this.divCorpsForm.style.height  		= pxToInt(this.getNode().clientHeight) - pxToInt(this.getBarreTitreForm().clientHeight) - 8;
	this.divContenuVolet.style.overflow = "hidden";
	this.getNode().style.width = pxToInt(this.divCorpsForm.clientWidth) + 4;
	this.divContenuVolet.innerHTML = strHTMLContenu;
}

VoletReperes.prototype.appendCorpsForm = function(Node){
	this.divContenuVolet.appendChild(Node);
}

VoletReperes.prototype.removeCorpsForm = function(Node){
	this.divContenuVolet.removeChild(Node);
}

VoletReperes.prototype.Restore = function(){
	this.getNode().style.top  = "1px";
	this.getNode().style.left = "0px";
	//this.divContenuVolet.style.width = pxToInt(this.getNode().clientWidth) - pxToInt(this.divBarreVolet.clientWidth);
	this.divBarreVolet.innerHTML = this.divBarreVolet.innerHTML.replace(/MoveAllRight/g, "MoveAllLeft");
	this.divBarreVolet.className = this.styleBarreVoletGaucheOut;
	this.EstAffiche	 = true;
}

VoletReperes.prototype.Minimize = function(){
	this.getNode().style.top  = "1px";
	this.getNode().style.left = this.divBarreVolet.clientWidth
							  - this.getNode().offsetWidth ;
	this.divBarreVolet.innerHTML = this.divBarreVolet.innerHTML.replace(/MoveAllLeft/g, "MoveAllRight");
	this.divBarreVolet.className = this.styleBarreVoletGaucheOut;
	this.EstAffiche	 = false;
}
/*
 *
 * Fenetre Modale Reperes
 *
 */
function FormModal(){
}

FormModal.prototype.init = function(strTitle, blnScrollable, blnClosable, blnMovable){

	this.title   = strTitle
	this.divFond = document.createElement("DIV");
	this.divFond.className = "Fond";
//	lightup(this.divFond, 30);

	this.divFondTransparent = document.createElement("DIV");
	this.divFond.appendChild(this.divFondTransparent);
	this.divFondTransparent.className = "FondTransparent";
	this.divFondTransparent.style.backgroundImage= "url(" + getUrlReperes() + "Commun/IMG/FondTransparent.gif)";

	this.divFondOpaque = document.createElement("DIV");
	this.divFond.appendChild(this.divFondOpaque);
	this.divFondOpaque.className = "FondOpaque";


	this.divForm = document.createElement("DIV");
	this.divFondTransparent.appendChild(this.divForm);

	this.divForm.style.position	  = "absolute";
	this.divForm.align			  = "center";
	this.divForm.style.visibility = "hidden";

	this.styleBarreTitreForm  = "styleBarreTitreForm"
	this.styleCorpsForm  	  = "styleCorpsForm"


	this.divBarreTitreForm 		  = document.createElement("DIV");
	this.divForm.appendChild(this.divBarreTitreForm);
	this.divBarreTitreForm.className = this.styleBarreTitreForm;
	this.divBarreTitreForm.style.backgroundImage= "url(" + getUrlReperes() + "Commun/IMG/Boutons/Fond_bt_N.gif)";

	this.btnMove  = new DHTMLImgButton(this, getUrlReperes() + "Commun/IMG/pReperes.ico", "D\u00e9placer la fen\u00eatre")
	this.btnClose = new DHTMLImgButton(this, getUrlReperes() + "Commun/IMG/boutons/bt_Close_N.gif", "Fermer la fen\u00eatre")
	this.btnMove.enable();
	this.btnClose.enable();
	var objTable = document.createElement("TABLE");
	this.divBarreTitreForm.appendChild(objTable);
	objTable.insertRow(0);
	objTable.cellpadding=5;
	objTable.cellSpacing=0;
	var tdMove  = objTable.rows[0].insertCell(0);
	tdMove.align="left";
	tdMove.width="30";
	tdMove.innerHTML ="<img src =\"" + getUrlReperes() + "Commun/IMG/pReperes.ico\">";
	var tdTitle = objTable.rows[0].insertCell(1);
	tdTitle.align="center";
	tdTitle.innerHTML = strTitle;
	var tdClose = objTable.rows[0].insertCell(2);
	tdClose.width="30";
	tdClose.align="right";
	tdClose.appendChild(this.btnClose.getNode());
	this.btnClose.getNode().align="right";

	if (!blnClosable){
		this.btnClose.getNode().style.visibility = "hidden";
	}

	if (blnMovable){
		this.divBarreTitreForm.style.cursor = "move";
		this.divBarreTitreForm.onmousedown = function(event){
			beginDrag(this.parentNode, event);
		}
	}


	this.divCorpsForm = document.createElement("DIV");
	this.divCorpsForm.className		 = this.styleCorpsForm;
	this.divForm.appendChild(this.divCorpsForm);
	if (blnScrollable){
		this.divCorpsForm.style.overflow= "auto";
	}else{
		this.divCorpsForm.style.overflow= "hidden";
	}


}

FormModal.prototype.appendCorpsForm = function(Node){
	this.divCorpsForm.appendChild(Node);
}

FormModal.prototype.removeCorpsForm = function(Node){
	this.divCorpsForm.removeChild(Node);
}

FormModal.prototype.setCorpsForm = function(strHTMLContenu){
	this.divBarreTitreForm.style.width  = pxToInt(this.divForm.clientWidth);
	this.divCorpsForm.style.width		= pxToInt(this.divForm.clientWidth);
	this.divCorpsForm.style.height		= pxToInt(this.divForm.clientHeight) - pxToInt(this.divBarreTitreForm.clientHeight) - 8;
//	this.divCorpsForm.style.overflow = "hidden";
	this.divForm.style.width = pxToInt(this.divCorpsForm.clientWidth) + 4
	this.divCorpsForm.innerHTML = strHTMLContenu;
}


FormModal.prototype.Show = function(){
	this.divBarreTitreForm.style.width  = pxToInt(this.divForm.clientWidth) + "px";
	this.divCorpsForm.style.width		= pxToInt(this.divForm.clientWidth) + "px";

	this.divForm.style.top		  = parseInt((pxToInt(document.body.clientHeight)
								  - pxToInt(this.divForm.clientHeight))/2) + "px";
	this.divForm.style.left		  = parseInt((pxToInt(document.body.clientWidth)
								  - pxToInt(this.divForm.clientWidth))/2) + "px";
	this.divForm.style.visibility = "visible";
}
FormModal.prototype.Hide = function(){
	this.divForm.style.visibility = "hidden";
}
FormModal.prototype.getNode = function(){
	return this.divFond;
}
FormModal.prototype.getForm = function(){
	return this.divForm;
}

FormModal.prototype.getBarreTitreForm = function(){
	return this.divBarreTitreForm;
}
FormModal.prototype.getCorpsForm = function(){
	return this.divCorpsForm;
}


// Type de l'object
FormModal.prototype.getType	= function(){	return getObjectType.call(this);	}

// Liberation memoire
FormModal.prototype.dispose 	= function(){
	EventManager.unregisterListener(this);
	DisposeObject.call(this);
}


var strCheminImg = getUrlReperes() + "Commun/IMG/";
//alert(strCheminImg)
/*
 *
 * Fenetre d'information de chargement en cours
 *
 */

function FormChargement(){
	this.init("Rep&egrave;res<!--&trade;-->", false, false, false)
}

FormChargement.prototype = new FormModal();

FormChargement.prototype.load = function(strMessage){
	var objRow;
	var objCell;
	var objImg;

/*	this.divImg = document.createElement("DIV")
	objDiv.appendChild(this.divImg);

	this.divImg.style.position= "absolute";
	this.divImg.style.width= "300px";
	this.divImg.appendChild(objImg);
	objImg.style.position= "absolute";
	objImg.src = getUrlReperes() + "Commun/IMG/progressCircle.gif";
	objImg.border = 0;
	objImg.width  = "32";
	objImg.height = "32";
*/
	this.divMessage = document.createElement("DIV")
	this.appendCorpsForm(this.divMessage);
	this.divMessage.style.width  = "300px";
	this.divMessage.style.height = "auto";
	this.divMessage.style.backgroundImage = "url(" + getUrlReperes() + "Commun/IMG/progressCircle.gif)";
	this.divMessage.style.backgroundPosition = "center center";
	this.divMessage.style.backgroundRepeat = "no-repeat";
	this.divMessage.style.top= 0;
	
/*	this.objTable = document.createElement("TABLE")
	this.appendCorpsForm(this.objTable);
	this.objTable.cellpadding  = 0;
	this.objTable.cellspacing  = 0;
	this.objTable.style.width  = "300px";
	this.objTable.style.height = "auto";
	this.objTable.valign	="middle"

	objRow = this.objTable.insertRow(0);
	objCell 	= objRow.insertCell(0);
	objCell.nowrap	="true";
	objCell.align	="center";
	objCell.valign	="middle";
*/
	this.setMessage(strMessage);
	this.divForm.style.width  = pxToInt(this.divMessage.clientWidth) + "px";
	this.divForm.style.height = pxToInt(this.divMessage.clientHeight) + "px";

	objRow   = undefined;
	objCell  = undefined;
	objImg   = undefined;
}

FormChargement.prototype.setMessage = function(strMessage){
	if (typeof strMessage == "undefined"){
		strMessage = "Veuillez patienter s'il vous plait...";
	}
//	this.objTable.rows[0].cells[0].innerHTML = "<br><br><b>Chargement&nbsp;en&nbsp;cours...</b><br>" + strMessage + "<br><br><br>";
	this.divMessage.innerHTML = "<br><b>" + strMessage + "</b><br><br>";
	this.divForm.style.width  = pxToInt(this.divMessage.clientWidth) + "px";
	this.Show();
}

//var strCheminImg = getUrlReperes() + "Commun/IMG/";
//alert(strCheminImg)
/*
 *
 * Fenetre d'information de chargement en cours
 *
 */

function FormDownload(){
	this.init("Rep&egrave;res<!--&trade;-->", false, true, false)
}

FormDownload.prototype = new FormModal();

FormDownload.prototype.load = function(strUrlDownload, eFormatExport){

	var strFormatExport;
	var spText;
	switch (parseInt(eFormatExport)){
		case cFormatJPG:
			strFormatExport = "icon-jpg.png";
			break;
		case cFormatPNG:
			strFormatExport = "icon-png.png";
			break;
		case cFormatTIF:
			strFormatExport = "icon-tif.gif";
			break;
		case cFormatPDF:
			strFormatExport = "icon-pdf.gif";
			break;
		case cFormatCSV:
			strFormatExport = "icon-csv.gif";
			break;
		case cFormatExcel:
			strFormatExport = "icon-xls.gif";
			break;
		case cFormatWord:
			strFormatExport = "icon-doc.gif";
			break;
		case cFormatOpenOffice:
			strFormatExport = "icon-ods.gif";
			break;
	}

	var divLien = document.createElement("DIV");
	this.appendCorpsForm(divLien);
	divLien.style.width  = "300px";
	divLien.style.height = "auto";
	divLien.style.top= 0;
	this.divForm.style.width  = pxToInt(divLien.clientWidth) + "px";
	this.divForm.style.height = pxToInt(divLien.clientHeight) + "px";

	this.objLien = document.createElement("a");
	divLien.appendChild(document.createElement("BR"));
	divLien.appendChild(this.objLien);
	divLien.appendChild(document.createElement("BR"));
	spText = document.createElement("SPAN");
	spText.style.fontSize = "smaller";
	divLien.appendChild(spText);
	spText.innerHTML = "Cliquez sur le lien pour ouvrir le fichier dans une nouvelle fen\u00eatre ou faites un clic droit puis 'Enregistrer sous...'";
	divLien.appendChild(document.createElement("BR"));
	divLien.appendChild(document.createElement("BR"));
	
	this.objLien.href 	= strUrlDownload;
	this.objLien.target  = "_blank";
	this.objLien.style.textDecoration = "none";
	this.objLien.style.textIndent = "20px";
	this.objLien.style.height = "20px";
	this.objLien.style.fontWeight = "bold";
	this.objLien.style.backgroundImage = "url(" + getUrlReperes() + "Commun/IMG/" + strFormatExport + ")";
	this.objLien.style.backgroundPosition = "left center";
	this.objLien.style.backgroundRepeat = "no-repeat";
	if (IE){
		this.objLien.innerHTML = "&nbsp;T&eacute;l&eacute;charger"
	}else{
		this.objLien.innerHTML = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;T&eacute;l&eacute;charger"
	}
	EventManager.add(this.objLien, "click", this, false);
	
	this.Show();
}

FormDownload.prototype.handleEvent = function(oEvent){

	var myEvent		= (IE ? window.event : oEvent);
	var objOrigine	= (IE ? window.event.srcElement : oEvent.target);

	switch (myEvent.type){
		case "click":
			switch (objOrigine){
				case this.btnClose.getNode():
				case this.objLien:
					this.Hide();
					this.getNode().parentNode.removeChild(this.getNode());
					this.dispose();
					break;
			}
	}

	objOrigine 	= null;
	myEvent 	= null;
}


/*
 *
 * Fenetre de choix pour l'enregistrement
 *
 */
function FormEnregistrement(objCaller, fn_Enregistrer, fn_NePasEnregistrer, fn_Annuler){

	this.caller 		 = objCaller;
	this.init("Rep&egrave;res<!--&trade;-->", false, true, true)

	//*** Recuperation des evenements
	if (typeof fn_Enregistrer != "undefined"){
		this.Enregistrer = fn_Enregistrer;
	}
	else{
		this.Enregistrer = function(){};
	}

	if (typeof fn_NePasEnregistrer != "undefined"){
		this.NePasEnregistrer = fn_NePasEnregistrer;
	}
	else{
		this.NePasEnregistrer = function(){};
	}

	if (typeof fn_Annuler != "undefined"){
		this.Annuler = fn_Annuler;
	}
	else{
		this.Annuler = function(){};
	}

}
FormEnregistrement.prototype = new FormModal();

FormEnregistrement.prototype.Chargement = function(blnEnCours, strMessage){
	this.caller.Chargement(blnEnCours, strMessage);
}

FormEnregistrement.prototype.load = function(){

	var objRow;
	var objCell;
	var objBtn;

	this.objTable = document.createElement("TABLE")
	this.objTable.cellpadding = 0;
	this.objTable.cellspacing = 0;
	this.objTable.style.width  = "400px";
	this.objTable.style.height = "auto";

	objRow = this.objTable.insertRow(this.objTable.rows.length)

	objCell 	= objRow.insertCell(objRow.cells.length)
	objCell.valign	= "middle"
	objCell.colSpan	= 3
	objCell.innerHTML = "<div style='margin: 5px'>"
					  +	"	&nbsp;La session en cours a &eacute;t&eacute; modifi&eacute;e.&nbsp;"
					  +	"	<br>"
					  +	"	&nbsp;Souhaitez-vous enregistrer les modifications apport&eacute;es&nbsp;?"
					  +	"</div>"

	objRow = this.objTable.insertRow(this.objTable.rows.length)

	objCell = objRow.insertCell(objRow.cells.length)
	objCell.align	="center"
	objCell.valign	="middle"
	objCell.width="33%"
	this.btnOui = new DHTMLLinkButton(this		, "    Oui     ", "");
	this.btnOui.enable();
	objCell.appendChild(this.btnOui.getNode());

	objCell = objRow.insertCell(objRow.cells.length)
	objCell.align	="center"
	objCell.valign	="middle"
	objCell.width="33%"
	this.btnNon = new DHTMLLinkButton(this		, "    Non     ", "");
	this.btnNon.enable();
	objCell.appendChild(this.btnNon.getNode());

	objCell = objRow.insertCell(objRow.cells.length)
	objCell.align	="center"
	objCell.valign	="middle"
	objCell.width="33%"
	this.btnAnnuler = new DHTMLLinkButton(this	, "   Annuler  ", "");
	this.btnAnnuler.enable();
	objCell.appendChild(this.btnAnnuler.getNode());


	this.getCorpsForm().appendChild(this.objTable);
	this.divForm.style.width  		  = this.objTable.clientWidth;
	this.divForm.style.height 		  = this.objTable.clientHeight;

	this.Show();
	this.Chargement(false);

	objRow   = undefined;
	objCell  = undefined;
	objBtn   = undefined;
}

FormEnregistrement.prototype.handleEvent = function(oEvent){

	var myEvent		= (IE ? window.event : oEvent);
	var objOrigine	= (IE ? window.event.srcElement : oEvent.target);

	switch (myEvent.type){
		case "click":
			switch (objOrigine){
				case this.btnOui.getNode():
					this.Enregistrer();
					break;
				case this.btnNon.getNode():
					this.NePasEnregistrer();
					break;
				case this.btnClose.getNode():
				case this.btnAnnuler.getNode():
					this.Annuler();
					break;
			}
	}

	objOrigine 	= null;
	myEvent 	= null;
}
var strCheminImgLogos = getUrlReperes() + "Commun/IMG/";
/*
 *
 * Fenetre d'information sur la version de Reperes
 *
 */

function FormAPropos(objCaller, strVersion, fn_Ok){

	this.caller 		 = objCaller;
	this.init("Rep&egrave;res<!--&trade;-->", false, true, true)

	this.Version = strVersion;
	//*** Recuperation des evenements
	if (typeof fn_Ok != "undefined"){
		this.Ok = fn_Ok;
	}
	else{
		this.Ok = function(){};
	}
}

FormAPropos.prototype = new FormModal();

FormAPropos.prototype.Chargement = function(blnEnCours, strMessage){
	this.caller.Chargement(blnEnCours, strMessage);
}

FormAPropos.prototype.load = function(){

	var objRow;
	var objCell;
	var objBtn;

	this.objTable = document.createElement("TABLE")
	this.objTable.cellpadding = 0;
	this.objTable.cellspacing = 0;
	this.objTable.style.width  = "500px";
	this.objTable.style.height = "auto";
//	this.objTable.style.margin = "20";
	this.objTable.valign="top";
	objRow = this.objTable.insertRow(this.objTable.rows.length)

	objCell 	= objRow.insertCell(objRow.cells.length)
	objCell.valign	= "top"
	var strHTML =
	"<table cellSpacing='5' cellPadding='0' align='center'>"
+	"	<tr>"
+	"		<td valign='middle' align='center' colspan='2'>"
+	"			Version&nbsp;<b><span id='spNomVersion' >" + this.Version + "</span></b><br>"
+	"		</td>"
+	"	</tr>"
+	"	<tr>"
+	"		<td colspan='2' class='SousMenuSep'>"
+	"			<table cellpadding='0' cellspacing='0'>"
+	"				<tr>"
+	"					<th>"
+	"					</th>"
+	"				</tr>"
+	"				<tr>"
+	"					<td></td>"
+	"				</tr>"
+	"			</table>"
+	"		</td>"
+	"	</tr>"
+	"	<tr>"
+	"		<td id='tdLogoRCF' align='center' colspan='2'>"
+	"			<a target='winRcf' href='http://www.ressources-consultants.fr'><img border='0' name='ImgLogoRCF' src='" + strCheminImgLogos + "Logo_RCF.gif'>"
+	"			</a>"
+	"		</td>"
+	"	</tr>"
+	"	<tr>"
+	"		<td colspan='2' class='SousMenuSep'>"
+	"			<table cellpadding='0' cellspacing='0'>"
+	"				<tr>"
+	"					<th>"
+	"					</th>"
+	"				</tr>"
+	"				<tr>"
+	"					<td></td>"
+	"				</tr>"
+	"			</table>"
+	"		</td>"
+	"	</tr>"
+	"	<tr>"
+	"		<td id='tdRCFDTN' width='50%' valign='top' align='left' nowrap>"
+	"			<u>Direction Territoriale Nord</u><br>"
+	"			16, rue de Penhoet<br>"
+	"			35000 RENNES<br>"
+	"			<br>"
+	"			T&eacute;l : 02.99.78.09.78"
+	"		</td>"
+	"		<td id='tdRCFDTS' width='50%' valign='top' align='left' nowrap>"
+	"			<u>Direction Territoriale Sud</u><br>"
+	"			5, avenue Marcel Dassault - Tersud A<br>"
+	"			BP 25083<br>"
+	"			31504 TOULOUSE CEDEX 5<br>"
+	"			T&eacute;l : 05.62.47.47.20"
+	"		</td>"
+	"	</tr>"
+	"	<tr>"
+	"		<td colspan='2' class='SousMenuSep'>"
+	"			<table cellpadding='0' cellspacing='0'>"
+	"				<tr>"
+	"					<th>"
+	"					</th>"
+	"				</tr>"
+	"				<tr>"
+	"					<td></td>"
+	"				</tr>"
+	"			</table>"
+	"		</td>"
+	"	</tr>"
+	"	<tr>"
+	"		<td valign='middle' align='center' colspan='2' height='30'>"

	if (this.caller.UtilisateurEnCours.CodeClient() == "FMVM"){
		strHTML = strHTML
+	"			&nbsp;Hotline&nbsp;: 05.62.47.47.20"
+	"			<br>&nbsp;<img border='0' name='ImgLogoMail' src='" + strCheminImgLogos + "Logo_Mail.gif'>"
+	"			<a href='mailto:reperesfmvm@ressources-consultants.fr'>reperesfmvm@ressources-consultants.fr</a>"
+	"			<br>&nbsp;Contact : Delphine Rosada"
	}else{
		strHTML = strHTML
+	"			<img border='0' name='ImgLogoMail' src='" + strCheminImgLogos + "Logo_Mail.gif'>"
+	"			&nbsp;Hotline&nbsp;: <a href='mailto:reperes@ressources-consultants.fr'>reperes@ressources-consultants.fr</a>"
	}

	strHTML = strHTML
+	"		</td>"
+	"	</tr>"
+	"</table>"

	objCell.innerHTML = strHTML;
	objRow = this.objTable.insertRow(this.objTable.rows.length)

	objCell = objRow.insertCell(objRow.cells.length)
	objCell.align	="center"
	objCell.valign	="middle"
	this.btnFermer = new DHTMLLinkButton(this	, " Fermer ", "");
	this.btnFermer.enable();
	objCell.appendChild(this.btnFermer.getNode());

	this.getCorpsForm().appendChild(this.objTable);
	this.divForm.style.width  		  = this.objTable.clientWidth;
	this.divForm.style.height 		  = this.objTable.clientHeight;
	this.Show();
	this.Chargement(false);
	objRow   = undefined;
	objCell  = undefined;
	objBtn   = undefined;
}

FormAPropos.prototype.handleEvent = function(oEvent){

	var myEvent		= (IE ? window.event : oEvent);
	var objOrigine	= (IE ? window.event.srcElement : oEvent.target);

	switch (myEvent.type){
		case "click":
			switch (objOrigine){
				case this.btnClose.getNode():
				case this.btnFermer.getNode():
					this.Ok();
					break;
			}
	}

	objOrigine 	= null;
	myEvent 	= null;
}

