// ========================== ACREAT FRAMEWORK - JAVASCRIPT.JS ===================
// ------------------------------------------------------------------
// Ce fichier est le fichier javascript global au kit. Il inclut l'ensemble des fonctions javascript usuelles
// --------------
var userAgent = navigator.userAgent.toLowerCase();
var is_opera  = (userAgent.indexOf('opera') != -1);
var is_saf    = ((userAgent.indexOf('safari') != -1) || (navigator.vendor == "Apple Computer, Inc."));
var is_webtv  = (userAgent.indexOf('webtv') != -1);
var is_ie     = ((userAgent.indexOf('msie') != -1) && (!is_opera) && (!is_saf) && (!is_webtv));
var is_ie4    = ((is_ie) && (userAgent.indexOf("msie 4.") != -1));
var is_moz    = ((navigator.product == 'Gecko') && (!is_saf));
var is_kon    = (userAgent.indexOf('konqueror') != -1);
var is_ns     = ((userAgent.indexOf('compatible') == -1) && (userAgent.indexOf('mozilla') != -1) && (!is_opera) && (!is_webtv) && (!is_saf));
var is_ns4    = ((is_ns) && (parseInt(navigator.appVersion) == 4));
var is_regexp = (window.RegExp) ? true : false;
// --------------
String.prototype.addslashes = function(){return this.replace(/(["\\\.\|\[\]\^\*\+\?\$\(\)])/g, '\\$1');}
String.prototype.trim = function () {return this.replace(/^\s*(\S*(\s+\S+)*)\s*$/, "$1");};
// --------------
if(typeof ROOT == 'undefined') ROOT = "";
var parentTraitementFct;
parentTraitementFct = null;
// --------------
// ArgumentURL()
// public
// Permet de manipuler les arguments
// var object = new ArgumentURL();
// object.getArgument(argName) Returns the value as a string. If no argument exists with that name it returns null.
// object.setArgument(argName, argValue) Sets the argument argName with the value argValue
// object.removeArgument(argName) Removes the argument.
// object.toString() or just object 
function ArgumentURL() 
{
	this.getArgument = _getArg;
	this.setArgument = _setArg;
	this.removeArgument = _removeArg;
	this.toString    = _toString;	//Allows the object to be printed
 									//no need to write toString()
	this.arguments   = new Array();
 
	// Initiation
	var separator = "&";
	var equalsign = "=";
	
	var str = window.location.search.replace(/%20/g, " ");
	var index = str.indexOf("?");
	var sInfo;
	var infoArray = new Array();
 
	var tmp;
 	
	if (index != -1) 
	{
		sInfo = str.substring(index+1,str.length);
		infoArray = sInfo.split(separator);
	}

	for (var i=0; i<infoArray.length; i++) 
	{
		tmp = infoArray[i].split(equalsign);
		if (tmp[0] != "") 
		{
			var t = tmp[0];
			this.arguments[tmp[0]] = new Object();
			this.arguments[tmp[0]].value = tmp[1];
			this.arguments[tmp[0]].name = tmp[0];
		} 
	} 

	function _toString() 
	{
		var s = "";
		var once = true;
		for (i in this.arguments) 
		{
				if (once) 
				{
	 				s += "?";
	 				once = false;
	 			}
	 			s += this.arguments[i].name;
	 			s += equalsign;
	 			s += this.arguments[i].value;
	 			s += separator;
	 	}
		return s.replace(/ /g, "%20");
	 }
 	
	function _getArg(name) 
	{
		if (typeof(this.arguments[name]) != "object" || typeof(this.arguments[name].name) != "string")
			return null;
		else
			return this.arguments[name].value;
	}
	
	function _setArg(name,value) 
	{
		this.arguments[name] = new Object()
		this.arguments[name].name = name;
		this.arguments[name].value = value;
	}

	function _removeArg(name) 
	{
		this.arguments[name] = null;
	}
	return this;
}
// --------------

// ==================================================================
// ======================= OBJET DU FRAMEWORK =======================
// ==================================================================
function ACREAT_FRAMEWORK()
{ 
 	this.root = ""; 
	this.ARGS = new ArgumentURL();
}
var FRAMEWORK = new ACREAT_FRAMEWORK();
// --------------
// AJOUTE UN EVENEMENT AU CHARGEMENT DE LA PAGE
FRAMEWORK.addLoadEvent = function ( oFunction ) 
{
	// DOM2
	if ( typeof window.addEventListener != "undefined" )
		window.addEventListener( "load", oFunction, false );
	// IE 
	else if ( typeof window.attachEvent != "undefined" ) 
		window.attachEvent( "onload", oFunction );
	else 
	{
		if ( window.onload != null ) 
		{
			var oldOnload = window.onload;
			window.onload = function ( e ) 
			{
				oldOnload( e );
				oFunction();
			};
		}
		else 
			window.onload = oFunction;
	}
}
// --------------
// AJOUTE UN EVENEMENT AU CHANGEMENT DE LA PAGE
FRAMEWORK.addUnloadEvent = function ( oFunction ) 
{
	// DOM2
	if ( typeof window.addEventListener != "undefined" )
		window.addEventListener( "unload", oFunction, false );
	// IE 
	else if ( typeof window.attachEvent != "undefined" ) 
		window.attachEvent( "onunload", oFunction );
	else 
	{
		if ( window.onunload != null ) 
		{
			var oldOnunload = window.onunload;
			window.onunload = function ( e ) 
			{
				oldOnunload( e );
				oFunction();
			};
		}
		else 
			window.onunload = oFunction;
	}
}
// --------------
// DHTML Manipulation
// --------------
// CIBLE UN ELEMENT PAR SON ID
FRAMEWORK.fetch_object = function (idname, forcefetch)
{
	if(document.getElementById)
		return document.getElementById(idname);
	else if(document.all)
		return document.all[idname];
	else if(document.layers)
		return document.layers[idname];
}
// --------------
// POSITION X ABSOLUE D'UN ELEMENT 
FRAMEWORK.find_posX = function (obj)
{
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}
// --------------
// POSITION Y ABSOLUE D'UN ELEMENT
FRAMEWORK.find_posY = function (obj)
{
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	return curtop;
}
// --------------
var fetch_object = FRAMEWORK.fetch_object;
// --------------
// COOKIES
// --------------
// RECUPERE LA VALEUR D'UN COOKIE
FRAMEWORK.fetch_cookie = function ( nom ) 
{
	var arg=nom+"=";
	var alen=arg.length;
	var clen=document.cookie.length;
	var i=0;
	while (i<clen)
	{
		var j=i+alen;
		if (document.cookie.substring(i, j)==arg) 
		{
			var endstr=document.cookie.indexOf (";", j);
	 		if (endstr==-1) 
	 			endstr=document.cookie.length;
 			return unescape(document.cookie.substring(j, endstr)); 
		}
		i=document.cookie.indexOf(" ",i)+1;
	 	if (i==0) 
	 		break;
	 }
	return null; 
}
// --------------
// SPECIFIE LA VALEUR D'UN COOKIE
FRAMEWORK.set_cookie = function ( nom, valeur ) 
{
	var argv=set_cookie.arguments;
 	var argc=set_cookie.arguments.length;
 	var expires=(argc > 2) ? argv[2] : null;
 	var path=(argc > 3) ? argv[3] : null;
 	var domain=(argc > 4) ? argv[4] : null;
 	var secure=(argc > 5) ? argv[5] : false;
 	document.cookie=nom+"="+escape(valeur)+
 	((expires==null) ? "" : ("; expires="+expires.toGMTString()))+
	((path==null) ? "" : ("; path="+path))+
 	((domain==null) ? "" : ("; domain="+domain))+
 	((secure==true) ? "; secure" : "");
}
// --------------
// EFFACE UN COOKIE
FRAMEWORK.delete_cookie = function ( nom ) 
{
	var expireNow = new Date();
	document.cookie = nom + "=" + "; expires=Thu, 01-Jan-70 00:00:01 GMT" +  "; path=/";
}
// --------------
var fetch_cookie =  FRAMEWORK.fetch_cookie;
var set_cookie = 	FRAMEWORK.set_cookie;
var delete_cookie = FRAMEWORK.delete_cookie;
// --------------
// FORMULAIRES
// --------------
FRAMEWORK.add_form_element = function ( idFormulaire, typeInput, element_name, element_value, force_create ) 
{
	formulaire = this.fetch_object(idFormulaire);
	if(!formulaire || formulaire.tagName != "FORM") return;
	eval("exists = formulaire." + element_name + ";");
	if(!exists || force_create)
	{
		var input = document.createElement('input');
		input.type = typeInput;
		input.name = element_name;
		if(!this.fetch_object(element_name))
			input.id = element_name;
		input.value = element_value;
   		formulaire.appendChild(input)
	}
}
// -------
FRAMEWORK.init_form = function ( idFormulaire , script_action, action, method ) 
{
	formulaire = this.fetch_object(idFormulaire);
	if(!formulaire || formulaire.tagName != "FORM") return;
	if(formulaire.action == "") 
		formulaire.action = action;
	formulaire.method = method;
	if(script_action != "") this.add_form_element(idFormulaire,"hidden","acreat_script_action",script_action);
	formulaire.onsubmit = new Function("return FRAMEWORK.onsubmit_form(this)");
}
// --------------
FRAMEWORK.init_form_element = function ( idElement , valeurElement, idForm ) 
{
	if(!idForm) 
		var objet = this.fetch_object(idElement);
	else
		eval(" var objet = this.fetch_object(idForm)." + idElement + "; ");
	
	if(!objet) return;	
	switch(objet.type)
	{
		case undefined:
			switch(objet.tagName)
			{
				default: objet.innerHTML =  valeurElement; break;
			}
		break;
		//--
		case "checkbox":
			objet.checked =  (objet.value == valeurElement); 
		break;
		//--
		case "radio":
			var listeRadio = document.getElementsByName(objet.name);
			for(var i=0; i<listeRadio.length; i++)
			{
				if(listeRadio[i].value == valeurElement)
					return listeRadio[i].checked = true;
			}
		break;
		//--
		default: 
			objet.value =  valeurElement; 
		break;
	}
	return;
}
// --------------
FRAMEWORK.onsubmit_form = function ( formulaire ) 
{
	for(var i=0;i<formulaire.elements.length;i++)
	{
		if(formulaire.elements[i].name != "")
		{
			eval("doneexists = (typeof " + formulaire.elements[i].name + "_check == 'undefined') ? false : true;");
			if(doneexists)
			{ 
				eval("var donecheck = " + formulaire.elements[i].name + "_check;");
				if(!donecheck(formulaire.elements[i])) return false;
			}	
		}
	}
	for(var i=0; i<formulaire.elements.length;i++)
	{
		if(formulaire.elements[i].type == "submit")
			formulaire.elements[i].disabled = true;
	}
	return true;
}
// --------------
var verifForm = FRAMEWORK.onsubmit_form;
var initFormElement =  FRAMEWORK.init_form_element;
// --------------
// GENERATION AUTOMATIQUE D'IFRAME
// --------------
FRAMEWORK.load_iframe = function(URL)
{
	if (!document.createElement) {return true};
	var tempIFrame = document.createElement('iframe');
	
	var VISIBLE = (FRAMEWORK.ARGS.getArgument("debug_iframe") == 1);
	
	tempIFrame.style.width = (VISIBLE) ? "100%" : "0px";
	tempIFrame.style.height = (VISIBLE) ? "300px" : "0px";
	tempIFrame.style.border = (VISIBLE) ? "1px" : "0px";
	tempIFrame.style.display = (VISIBLE) ? "" : "none";
	target = (VISIBLE) ? document.body : document.body;
	
	if(!VISIBLE) 
	{
		tempIFrame.onreadystatechange = function() { if(tempIFrame.readyState == "complete") target.removeChild(tempIFrame);  }
		tempIFrame.onload = function() { target.removeChild(tempIFrame);  }
	}

	tempIFrame.id = "AcreatJSRSIframe";
	tempIFrame.src = URL;
	var iframe = target.appendChild(tempIFrame); 

	return iframe;
}
// --------------
// EXECUTION D'ACTION
// --------------
FRAMEWORK.execute_action = function (target, action, params, confirmation, confirmation_bis)
{
	if(confirmation)
	{
		if(!confirm(confirmation)) 
			return;
		if(confirmation_bis)	
		{
			if(!confirm(confirmation_bis)) 
				return;
		}
	}
	
	var paramString = "";
	switch(typeof params)
	{
		case "object":
			for (var i in params)
				paramString += "&" + i + "=" + params[i];
		break;
		// ---
		case "string":
			paramString = "&" + params;
		break;
	}
	 
	if(target == "iframe")
		FRAMEWORK.load_iframe("script.php?action=" + action + paramString);
	else
		document.location.href = "script.php?action=" + action + paramString;
}
// --------------
FRAMEWORK.script_action = function ( action, params, confirmation, confirmation_bis) { return FRAMEWORK.execute_action("doc", action, params, confirmation, confirmation_bis); }
FRAMEWORK.iframe_action = function ( action, params, confirmation, confirmation_bis) { return FRAMEWORK.execute_action("iframe", action, params, confirmation, confirmation_bis); }
// --------------
var executeScriptAction = FRAMEWORK.script_action;
var executeIFrame = function(action,param,actFunct,confirmation,confirmation2) { return FRAMEWORK.iframe_action(action,param,confirmation,confirmation2); }
// --------------
// POPUPS
// --------------
FRAMEWORK._popup = function ( url, w, h, options, target)
{
	if(!target) target = "ACREAT_POPUP";
	if(window.name == target) target += "ACREAT_POPUP_" + Math.round(Math.random()*9999);
	var top=(screen.height-h)/2;
	var left=(screen.width-w)/2;
	var newWin = window.open(url,target,"top=" + top + ",left=" + left + ",width=" + w + ",height=" + h + "," + options);
	newWin.focus();
	return newWin;
}
// --------------
FRAMEWORK.pop = function ( template, params, w, h, options,target)
{
	if(!target) target = null;
	if(!w) w = 640;
	if(!h) h = 480;
	
	var paramString = "";
	switch(typeof params)
	{
		case "object":
			for (var i in params)
				paramString += "&" + i + "=" + params[i];
		break;
		// ---
		case "string":
			paramString = "&" + params;
		break;
	}
		
	return FRAMEWORK._popup("index.php?popup=" + template + paramString,w,h,options, target);
}
// --------------
// POPUP avec liste a choix
FRAMEWORK.pop_ext = function ( template, params, w, h, target, backFunction)
{
	// Définition de la fonction de traitement
	if(!backFunction) 
	{
		backFunction = function(reponse) 
		{ 
			for (var param in reponse)
				try { if(fetch_object(param)) { FRAMEWORK.init_form_element(param, reponse[param]); } } catch(e) {} 
		}
	}
	
	newPopup =  FRAMEWORK.pop( template, params, w, h, target);
	newPopup._back_funct = backFunction;	
	newPopup.update = function(reponse, no_close) { newPopup._back_funct(reponse); if(!no_close) newPopup.self.close(); }
	//window.testFunction = function() { alert('test'); newPopup.onunload = function() { setTimeout("testFunction",100); } }
}
// --------------
// Vérifier la validité d'un information
FRAMEWORK.check_validity = function ( infos, type)
{
	switch(type)
	{
		case "email": return infos.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi); break;
	}
	return true;
}

// ==================================================================
// ------------------------------------------------------------------
/**/ // checkFct(nomFunction) 
/**/ // public
/**/ // Renvoi true si la fonction "nomFunction" est définie
/**/ function checkFct(nomFunction)
/**/ { 
/**/     return eval("(typeof " + nomFunction + " != \"undefined\")");
/**/ }
// ==================================================================
// ------------------------------------------------------------------
/**/ // CheckIsIE() 
/**/ // public
/**/ // Renvoi true si le navigateur en cours est Internet Explorer 
/**/ function CheckIsIE() 
/**/ { 
/**/     if  (navigator.appName.toUpperCase() == 'MICROSOFT INTERNET EXPLORER')  { return true;} 
/**/     else { return false; } 
/**/ }
// ==================================================================
// ------------------------------------------------------------------
/**/ // getCookieVal(offset) 
/**/ // private
/**/ // Recupère la valeur actuelle du cookie offset
/**/ 
/**/ 
// ==================================================================
// ------------------------------------------------------------------
/**/ function getKeyCode(evt) 
/**/ {
/**/ 	var nKey = -1;
/**/     if (evt && evt.which)
/**/       nKey = evt.which;
/**/     else if (window.event && window.event.keyCode)
/**/       nKey = window.event.keyCode; 
/**/ 	return nKey;
/**/ }
/**/ 
// ==================================================================
// ------------------------------------------------------------------
/**/ // acreat_isNull(theVar)
/**/ // public
/**/ // Teste si une variable est nulle
/**/ function acreat_isNull(theVar)
/**/ {
/**/ 	if (typeof (theVar) == 'undefined')
/**/ 		return true;
/**/ 
/**/ 	if (theVar == null)
/**/ 		return true;
/**/ 
/**/ 	return false;
/**/ }
// ==================================================================
// ------------------------------------------------------------------
/**/ // acreat_isEmpty(theVar)
/**/ // public
/**/ // Teste si une variable est vide
/**/ function acreat_isEmpty(theVar)
/**/ {
/**/ 	if (acreat_isNull(theVar))
/**/ 		return true;
/**/ 
/**/ 	if (theVar == '')
/**/ 		return true;
/**/ 
/**/ 	return false;
/**/ }
// ==================================================================
// ------------------------------------------------------------------
/**/ // Position(x, y)
/**/ // public
/**/ // Créé un object position
/**/ function Position(x, y)
/**/ {
/**/ 	this.x = x;
/**/ 	this.y = y;
/**/ }
// ==================================================================
// ------------------------------------------------------------------
/**/ // getAbsolutePos(el, stopIfAbsolute)
/**/ // public
/**/ // Recupère la position absolue d'un element
/**/ function getAbsolutePos(el, stopIfAbsolute)
/**/ {
/**/ 	if (acreat_isNull(el))
/**/ 	{
/**/ 		var res = new Position(0, 0);
/**/ 		return res;
/**/ 	}
/**/ 
/**/ 	var res = new Position(el.offsetLeft, el.offsetTop);
/**/ 
/**/ 	if (el.offsetParent)
/**/ 	{
/**/ 		if ((stopIfAbsolute != true)
/**/ 			|| ((el.offsetParent.currentStyle.position != 'absolute') && (el.offsetParent.currentStyle.position != 'relative')
/**/ 							&& (el.offsetParent.currentStyle.overflow != 'auto') && (el.offsetParent.currentStyle.overflow != 'scroll')))
/**/ 		{
/**/ 			var tmp = getAbsolutePos(el.offsetParent, stopIfAbsolute);
/**/ 
/**/ 			res.x += tmp.x;
/**/ 			res.y += tmp.y;
/**/ 		}
/**/ 	}
/**/ 
/**/ 	return res;
/**/ };
// ==================================================================
// ------------------------------------------------------------------
/**/ // in_array(ineedle, haystack, caseinsensitive)
/**/ // public
/**/ // Rechercher une valeur dans un tableau
/**/ function in_array(ineedle, haystack, caseinsensitive)
/**/ {
/**/ 	needle = new String(ineedle);
/**/ 	if (caseinsensitive)
/**/ 	{
/**/ 		needle = needle.toLowerCase();
/**/ 		for (i in haystack)
/**/ 		{
/**/ 			if (haystack[i].toLowerCase() == needle)
/**/ 			{
/**/ 				return i;
/**/ 			}
/**/ 		}
/**/ 	}
/**/ 	else
/**/ 	{
/**/ 		for (i in haystack)
/**/ 		{
/**/ 			if (haystack[i] == needle)
/**/ 			{
/**/ 				return i;
/**/ 			}
/**/ 		}
/**/ 	}
/**/ 	return -1;
/**/ }
// ==================================================================
// ------------------------------------------------------------------
/**/ // textboxSelect(oTextbox, iStart, iEnd) 
/**/ // private
/**/ function textboxSelect (oTextbox, iStart, iEnd) {
/**/    switch(arguments.length) {
/**/        case 1:
/**/            oTextbox.select();
/**/            break;
/**/        case 2:
/**/            iEnd = oTextbox.value.length;
/**/            /* falls through */
/**/        case 3:          
/**/            if (is_ie) {
/**/                var oRange = oTextbox.createTextRange();
/**/                oRange.moveStart("character", iStart);
/**/                oRange.moveEnd("character", -oTextbox.value.length + iEnd);      
/**/                oRange.select();                                              
/**/            } else {
/**/                oTextbox.setSelectionRange(iStart, iEnd);
/**/            }                    
/**/    }
/**/    oTextbox.focus();
/**/ }
/**/ 
// ==================================================================
// ------------------------------------------------------------------
/**/ // textboxReplaceSelect(oTextbox, sText) 
/**/ // private
/**/ function textboxReplaceSelect (oTextbox, sText) {
/**/ 
/**/    if (is_ie) {
/**/        var oRange = document.selection.createRange();
/**/        oRange.text = sText;
/**/        oRange.collapse(true);
/**/        oRange.select();                            
/**/    } else  {
/**/        var iStart = oTextbox.selectionStart;
/**/        oTextbox.value = oTextbox.value.substring(0, iStart) + sText + oTextbox.value.substring(oTextbox.selectionEnd, oTextbox.value.length);
/**/        oTextbox.setSelectionRange(iStart + sText.length, iStart + sText.length);
/**/    }
/**/ 
/**/    oTextbox.focus();
/**/ }
// ==================================================================
// ------------------------------------------------------------------
/**/ // autocompleteMatch (sText, arrValues) 
/**/ // private
/**/ function autocompleteMatch (sText, arrValues) 
/**/ {	
/**/ 	sTextTemp = sText.toLowerCase();
/**/    for (var i=0; i < arrValues.length; i++) {
/**/ 		arrValuesTemp = arrValues[i].toLowerCase();
/**/        if (arrValuesTemp.indexOf(sTextTemp) == 0) {
/**/            return arrValues[i];
/**/        }
/**/    }
/**/    return null;
/**/ }
/**/ 
// ==================================================================
// ------------------------------------------------------------------
/**/ // autocomplete(nom,valeur) 
/**/ // public
/**/ // Permet l'autocomplete dans un textbox
/**/ // USAGE : arrValues = Array("1","2","3");
/**/ // INPUT onKeyPress="return autocomplete(this, event, arrValues);" ...
/**/ function autocomplete(oTextbox, oEvent, arrValues) 
/**/ {
/**/    switch (oEvent.keyCode) {
/**/        case 38: //up arrow  
/**/        case 40: //down arrow
/**/        case 37: //left arrow
/**/        case 39: //right arrow
/**/        case 33: //page up  
/**/        case 34: //page down  
/**/        case 36: //home  
/**/        case 35: //end                  
/**/        case 13: //enter  
/**/        case 9: //tab  
/**/        case 27: //esc  
/**/        case 16: //shift  
/**/        case 17: //ctrl  
/**/        case 18: //alt  
/**/        case 20: //caps lock
/**/        case 8: //backspace  
/**/        case 46: //delete
/**/            return true;
/**/            break;
/**/        default:
/**/            textboxReplaceSelect(oTextbox, String.fromCharCode(is_ie ? oEvent.keyCode : oEvent.charCode));
/**/            var iLen = oTextbox.value.length;
/**/            var sMatch = autocompleteMatch(oTextbox.value, arrValues);
/**/            if (sMatch != null) {
/**/                oTextbox.value = sMatch;
/**/                textboxSelect(oTextbox, iLen, oTextbox.value.length);
/**/            }  
/**/            return false;
/**/    }
/**/ }
/**/ 
// ==================================================================
// ------------------------------------------------------------------
/**/ // changeDate(variable) 
/**/ // private
/**/ // Mis à jour du champ caché pour le calendrier
/**/ function changeDate(variable)
/**/ {
/**/  	eval("itemA = fetch_object('" + variable + "');");
/**/ 	eval("item_annee = fetch_object('" + variable + "_annee');")
/**/ 	eval("item_mois = fetch_object('" + variable + "_mois');");
/**/ 	eval("item_jour = fetch_object('" + variable + "_jour');");
/**/
/**/ 	while(item_annee.value.length == 2)
/**/ 		item_annee.value = "20" + item_annee.value;
/**/ 
/**/
/**/ 	if( 1000 > eval(item_annee.value) || item_mois.value == "" || eval(item_jour.value) == 0 || item_jour.value =="" )
/**/ 	{
/**/ 		itemA.value = "0000-00-00";
/**/ 		return;
/**/ 	}
										
/**/ 	while(item_jour.value.length < 2)
/**/ 		item_jour.value = "0" + item_jour.value;
										
/**/ 	while(eval(item_jour.value) > 31)
/**/ 		item_jour.value = "31";
																					
/**/ 	itemA.value = item_annee.value + "-" + item_mois.value + "-" + item_jour.value;
/**/ }
// ==================================================================
// ------------------------------------------------------------------
/**/ // changeDate(variable) 
/**/ // private
/**/ // Mis à jour du champ caché pour le calendrier avec heure
/**/ function changeDateTime(variable)
/**/ {
/**/  	eval("itemA = fetch_object('" + variable + "');");
/**/ 	eval("item_annee = fetch_object('" + variable + "_annee');")
/**/ 	eval("item_mois = fetch_object('" + variable + "_mois');");
/**/ 	eval("item_jour = fetch_object('" + variable + "_jour');");
/**/ 	eval("item_heure = fetch_object('" + variable + "_heure');");
/**/ 	eval("item_min = fetch_object('" + variable + "_min');");
/**/ 
/**/ 	if(item_annee.value.length == 2)
/**/ 		item_annee.value = '20' + item_annee.value;
/**/ 
/**/ 	if( 1000 > eval(item_annee.value) || item_mois.value == "" || eval(item_jour.value) == 0 || item_jour.value =="" )
/**/ 	{
/**/ 		itemA.value = '0000-00-00 00:00:00';
/**/ 		return;
/**/ 	}
										
/**/ 	while(item_heure.value > 23)
/**/ 		item_heure.value = item_heure.value - 24;

/**/ 	while(item_min.value > 59)
/**/ 		item_min.value = item_min.value - 59;

/**/ 	while(item_jour.value.length < 2)
/**/ 		item_jour.value = '0' + item_jour.value;	
	
/**/ 	while(item_heure.value.length < 2)
/**/ 		item_heure.value = '0' + item_heure.value;	
	
/**/ 	while(item_min.value.length < 2)
/**/ 		item_min.value = '0' + item_min.value;	

/**/ 	while(eval(item_jour.value) > 31)
/**/ 		item_jour.value = '31';
																					
/**/ 	itemA.value = item_annee.value + '-' + item_mois.value + '-' + item_jour.value + ' ' + item_heure.value + ':' + item_min.value + ':00';
/**/ }
// ==================================================================
// ------------------------------------------------------------------
/**/ // loadIFrame(URL) 
/**/ // private
/**/ // Créé un objet iframe et charge la page URL dedans. C'est l'element de base de JSRS
/**/ var IFrameObj; // our IFrame object
/**/ function loadIFrame(URL)
/**/ {
/**/	  if (!document.createElement) {return true};
/**/ 	  var IFrameDoc;
/**/ 	  if (document.createElement) 
/**/ 	  {
/**/ 		// create the IFrame and assign a reference to the
/**/ 		// object to our global variable IFrameObj.
/**/ 		// this will only happen the first time 
/**/ 		// callToServer() is called
/**/ 		var tempIFrame = document.createElement('iframe');
/**/		var ARGS = new ArgumentURL();
/**/		if(1 == 0 || ARGS.getArgument("debug_iframe") == 1) 
/**/		{ 
/**/ 			tempIFrame.style.width='200px';
/**/ 			tempIFrame.style.height='200px';
/**/ 			tempIFrame.style.border='1px';
/**/ 		} 
/**/		else 
/**/		{ 
/**/ 	  		tempIFrame.onreadystatechange = function() { if(tempIFrame.readyState == "complete") document.body.removeChild(tempIFrame);  }
/**/ 			tempIFrame.style.width='0px';
/**/ 			tempIFrame.style.height='0px';
/**/ 			tempIFrame.style.border='0px';
/**/		} 
/**/ 		tempIFrame.id = "RSIFrame"; 
/**/ 		tempIFrame.src = URL;
/**/ 		IFrameObj = document.body.appendChild(tempIFrame); 
/**/ 		if (document.frames) 
/**/ 		{
/**/ 		  // this is for IE5 Mac, because it will only
/**/ 		  // allow access to the document object
/**/ 		  // of the IFrame if we access it through
/**/ 		  // the document.frames array
/**/ 		  IFrameObj = document.frames['RSIFrame'];
/**/ 		}
/**/ 	  }
/**/ 	  if (navigator.userAgent.indexOf('Gecko') !=-1 && !IFrameObj.contentDocument) 
/**/ 	  {
/**/ 		// we have to give NS6 a fraction of a second
/**/ 		// to recognize the new IFrame
/**/ 		setTimeout('callToServer()',10);
/**/ 		return false;
/**/ 	  }
/**/ 	  
/**/ 	  if (IFrameObj.contentDocument) 
/**/ 	  {
/**/ 		// For NS6
/**/ 		IFrameDoc = IFrameObj.contentDocument; 
/**/ 	  } else if (IFrameObj.contentWindow) 
/**/ 	  {
/**/ 		// For IE5.5 and IE6
/**/ 		IFrameDoc = IFrameObj.contentWindow.document;
/**/ 	  } else if (IFrameObj.document) 
/**/ 	  {
/**/ 		// For IE5
/**/ 		IFrameDoc = IFrameObj.document;
/**/ 	  } else 
/**/ 	  {
/**/ 		return true;
/**/ 	  }
/**/ 	  //IFrameDoc.location.replace(URL);
/**/ 	  return false;
/**/ }
// ==================================================================
// ------------------------------------------------------------------
/**/ // printPage(template,params) 
/**/ // public
/**/ // Lance l'impression d'un template situé dans print_template, chargé via print.php, et y attache les paramètres params
/**/ function printPage(template,params)
/**/ {
/**/ 	test = popupCentre('index.php?print=' + template + '&' + params,800,600);
/**/ }
// ==================================================================
// ------------------------------------------------------------------ 
/**/ // parseQuery() 
/**/ // public
/**/ // Cette fonction récupère l'adresse courante de la page, et renvoi les variables présentent dans l'adresse
/**/ // et les renvoi sous forme de tableau associatif
/**/ function parseQuery() 
/**/ {
/**/ 	var returnVals = new Array();
/**/ 	var qString = new String(window.location);
/**/ 	var queryStart = qString.indexOf('?');
/**/ 	if (queryStart==-1) 
/**/ 		return returnVals;
/**/
/**/ 	var query = qString.substring(queryStart + 1, qString.length);
/**/		parts = query.split("&");
/**/ 	for (i in parts) 
/**/ 	{
/**/ 		bits = parts[i].split("=");
/**/ 		returnVals[bits[0]] = bits[1];
/**/ 	}
/**/ 	return returnVals;
/**/ }
// ==================================================================
// ------------------------------------------------------------------ 
/**/ // goToPage(page,variable) 
/**/ // public
/**/ // Navigue vers la page page en gardant toutes les variables présentent dans l'adresse en cours, sauf
/**/ // les varibales présentent dans variables, séparés par une virgule
/**/ function goToPage(page,variable)
/**/ {
/**/ 	if(!variable)
/**/ 		variable = "PAGE";
/**/ 	vars = parseQuery();
/**/ 	var qString = new String(window.location);
/**/ 	var queryStart = qString.indexOf('?');
/**/	adresse = qString.substring(0 , queryStart);
/**/	vars[variable] = page; i=0;
/**/ 	for (col in vars) 
/**/ 	{
/**/		if(i==0) { sep="?"; i++; } else { sep="&"; }
/**/			adresse = adresse + sep + col + "=" + vars[col]; 
/**/ 	}		
/**/ 	document.location.href = adresse;
/**/ }
// ==================================================================
// ------------------------------------------------------------------ 
/**/ function RandomString()
/**/ {
/**/ var alphaNum = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
/**/ var strLen = 10;
/**/ var randomStr = "";
/**/ for ( count = 0; count < strLen; count++ )
/**/ randomStr += alphaNum.charAt( parseInt( alphaNum.length * Math.random() ) );
/**/ return randomStr;
} 
// ==================================================================
// ------------------------------------------------------------------ 
/**/ // resizeAndCenter(largeur,hauteur,target)
/**/ // public
/**/ // La fenêtre target est redimensionnée et recentrée.
/**/ function resizeAndCenter(largeur,hauteur,target)
/**/ {
/**/	if(!target) var target = window;
/**/ 	var top=(screen.height-hauteur)/2;
/**/ 	var left=(screen.width-largeur)/2;
/**/	target.moveTo(left,top);
/**/	target.resizeTo(largeur,hauteur);
/**/ }
// ==================================================================
// ------------------------------------------------------------------ 	
/**/ // popupCentreOptions(page,largeur,hauteur,options,target)
/**/ // private
/**/ // Ouvre et centre un popup
/**/ function popupCentreOptions(page,largeur,hauteur,options,target)
/**/ {
/**/	if(!target) target = "POPUP";
/**/	if(window.name == target) target = "POPUP_" + RandomString();
/**/ 	var top=(screen.height-hauteur)/2;
/**/ 	var left=(screen.width-largeur)/2;
/**/	var newWin = window.open(page,target,"top="+top+",left="+left+",width="+largeur+",height="+hauteur+"," + options);
/**/	newWin.focus();
/**/	return newWin;
/**/ }
// ==================================================================
// ------------------------------------------------------------------ 	 
/**/ // popupCentreOptions(page,largeur,hauteur,target)
/**/ // private
/**/ // Ouvre et centre un popup
/**/ function popupCentre(page,largeur,hauteur,target)
/**/ {
/**/ 	return popupCentreOptions(page,largeur,hauteur,"fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=no,directories=no,location=no",target);
/**/ }
// ==================================================================
// ------------------------------------------------------------------ 	 
/**/ // popPage(template,variables,largeur,hauteur,fonction,targett)
/**/ // public
/**/ // Ouvre et centre un popup a partir du template, et assigne une fonction a la variable dialogArguments présent dans la page.
/**/ function popPage(template,variables,largeur,hauteur,fonction,target)
/**/ {
/**/	if (typeof fonction != "undefined")
/**/		parentTraitementFct = fonction;
/**/	else
/**/		parentTraitementFct = null;
/**/ 	newWin = popupCentre("index.php?popup=" + template + "&" + variables,largeur,hauteur,target);
/**/	if (!newWin.opener) newWin.opener = self;
/**/ }
// ==================================================================
// ------------------------------------------------------------------ 	 
/**/ // popModeless(template,variables,largeur,hauteur,fonction)
/**/ // private
/**/ // Ouvre et centre un popup modless a partir du template, et assigne une fonction a la variable dialogArguments présent dans la page.
/**/ function popModeless(template,variables,largeur,hauteur,fonction)
/**/ {
/**/ 	 showModelessDialog("popup.php?inc=" + template + "&" + variables, fonction, "status:no;center:yes;dialogHeight:" + hauteur + "px;dialogWidth:" + largeur + "px;") ;
/**/ }
// ==================================================================
// ------------------------------------------------------------------ 	 
/**/ // getParentTraitementFct()
/**/ // public
/**/ // Renvoi la variable dialogArguments
/**/ function getParentTraitementFct()
/**/ {
/**/ 	if (window.opener)
/**/ 		return window.opener.parentTraitementFct;
/**/	else if(window.parent)
/**/		return window.parent.parentTraitementFct;
/**/	else
/**/		return null;
/**/ }
// ==================================================================
// ------------------------------------------------------------------ 	 
/**/
// ==================================================================
// ------------------------------------------------------------------ 	 
/**/ // changeImgSrc(id,src,width,height) 
/**/ // public
/**/ // Change la source d'une image d'id id.
/**/ function changeImgSrc(id,src,width,height)
/**/ {
/**/	var image = fetch_object(id);
/**/	if(image.style.display == "none")
/**/		image.style.display="";		
/**/	if(src == "") {  width = 0; height=0; }	
/**/ 	image.src = src;
/**/	if(typeof width != "undefined")
/**/ 		image.width = width;
/**/	if(typeof height != "undefined")
/**/ 		image.height = height;
/**/
/**/	if( ( typeof width != "undefined" && width == 0 ) || ( typeof height != "undefined" && height==0 ) )
/**/		image.style.display="none";
/**/ }
// ==================================================================
// ------------------------------------------------------------------ 	 
/**/ // changeItemClass(id,newClass) 
/**/ // public
/**/ // Change la class CSS d'un element ayant pour id id
/**/ function changeItemClass(id,newClass)
/**/ {
/**/	fetch_object(id).className=newClass;
/**/ }
// ==================================================================
// ------------------------------------------------------------------ 	 
/**/ // goTo(address)
/**/ // public
/**/ // Navigue vers address
/**/ function goTo(address)
/**/ {	
/**/ 	if (document.location.href)
/**/		document.location.href=address;	
/**/ 	else
/**/ 		document.location=address;	
/**/ }
// ==================================================================
// ------------------------------------------------------------------ 	 
/**/ // disableEnterKey() 
/**/ // public
/**/ // Placé dans un onKeyPress, permet de désactiver la toucher "entré"
/**/ function disableEnterKey(e) 
/**/ { 
/**/ 	if(!e)
/**/ 		e = window.event;
/**/ 	if (e.keyCode == 13) 
/**/ 		e.keyCode = 0; 
/**/ }
// ==================================================================
// ------------------------------------------------------------------
/**/ // URLEncode(plaintext)
/**/ // private / public
/**/ // Encode une chaîne plaintext en encodage URL
/**/ function URLEncode(plaintext)
/**/ {
/**/ 	// The Javascript escape and unescape functions do not correspond
/**/ 	// with what browsers actually do...
/**/ 	var SAFECHARS = "0123456789" +					// Numeric
/**/ 					"ABCDEFGHIJKLMNOPQRSTUVWXYZ" +	// Alphabetic
/**/ 					"abcdefghijklmnopqrstuvwxyz" +
/**/ 					"-_.!~*'()+";					// RFC2396 Mark characters
/**/ 	var HEX = "0123456789ABCDEF";
/**/ 
/**/ 	var encoded = "";
/**/ 	for (var i = 0; i < plaintext.length; i++ ) {
/**/ 		var ch = plaintext.charAt(i);
/**/ 	    if (ch == " ") {
/**/ 		    encoded += "+";				// x-www-urlencoded, rather than %20
/**/ 		} else if (SAFECHARS.indexOf(ch) != -1) {
/**/ 		    encoded += ch;
/**/ 		} else {
/**/ 		    var charCode = ch.charCodeAt(0);
/**/ 			if (charCode > 255) {
/**/ 				encoded += "+";
/**/ 			} else {
/**/ 				encoded += "%";
/**/ 				encoded += HEX.charAt((charCode >> 4) & 0xF);
/**/ 				encoded += HEX.charAt(charCode & 0xF);
/**/ 			}
/**/ 		}
/**/ 	} // for
/**/ 	return encoded;
/**/ };
// ==================================================================
// ------------------------------------------------------------------
/**/ // checkSiVide(element,alerte)
/**/ // public
/**/ // Vérifie si la valeur de element est vide, et si oui, affiche l'alerte alerte
/**/ // S'utilise généralement dans les fonction de check
/**/ function checkSiVide(element,alerte) 
/**/ {  
/**/ 	if(typeof element == "string")
/**/ 		element = fetch_object(element);
/**/ 	element.style.backgroundColor="white"; 
/**/ 	if(element.value == "") 
/**/ 	{   
/**/		if(element.id != "") clignotInput(element.id,null,"#f5cdcd",500,3);
/**/ 		element.focus();  
/**/ 		alert(alerte); 
/**/ 		return false; 
/**/ 	} 
/**/ 	return true; 
/**/ } 
// ==================================================================
// ------------------------------------------------------------------
/**/ // checkNoValue(elementId,valeur,alerte,elementToAlert)
/**/ // public
/**/ // Vérifie si la valeur de element est valeur, et si oui, affiche l'alerte alerte et fait clignoter elementToAlertId
/**/ // S'utilise généralement dans les fonction de check
/**/
/**/ function checkNoValue(element,valeur,alerte,elementToAlert)
/**/ {  
/**/ 	if(typeof element == "string")
/**/ 		element = fetch_object(element);
/**/	if(!elementToAlert)
/**/		elementToAlert = element;
/**/ 	if(typeof elementToAlert == "string")
/**/		elementToAlert = fetch_object(elementToAlert); 
/**/ 	elementToAlert.style.backgroundColor="white"; 
/**/ 	if(element.value == valeur) 
/**/ 	{   
/**/ 		//elementToAlert.style.backgroundColor="#f5cdcd"; 
/**/		clignotInput(elementToAlert.id,null,"#f5cdcd",500,3); 
/**/ 		try { elementToAlert.focus(); } catch(e) {}
/**/ 		alert(alerte); 
/**/ 		return false; 
/**/ 	} 
/**/ 	return true; 
/**/ } 
// ==================================================================
// ------------------------------------------------------------------
/**/ // clavierIsOk()
/**/ // public
/**/ // Vérifie si le clavier n'est pas occupé dans un input
/**/ function clavierIsOk() 
/**/ { 
/**/ 	if(document.activeElement.tagName == "TEXTAREA" || document.activeElement.tagName == "INPUT" || document.activeElement.tagName == "SELECT")
/**/ 		return false;
/**/ 	return true;
/**/ } 
// ==================================================================
// ------------------------------------------------------------------
/**/ // alphaonly(e)
/**/ // public
/**/ // Vérifie au moment de l'insertion d'un element dans un input si l'element est bien alphanumerique
/**/ // USAGE : onKeyPress="return alphaonly(event)"
/**/ function alphaonly(e)
/**/ {
/**/ 	var key;
/**/ 	var keychar;
/**/ 	
/**/ 	if (window.event)
/**/ 	   key = window.event.keyCode;
/**/ 	else if (e)
/**/ 	   key = e.which;
/**/ 	else
/**/ 	   return true;
/**/ 	keychar = String.fromCharCode(key);
/**/ 	keychar = keychar.toLowerCase();
/**/ 	
/**/ 	// control keys
/**/ 	if ((key==null) || (key==0) || (key==8) ||
/**/ 		(key==9) || (key==13) || (key==27) )
/**/ 	   return true;
/**/ 	
/**/ 	// alphas and numbers
/**/ 	else if ((("abcdefghijklmnopqrstuvwxyz0123456789").indexOf(keychar) > -1))
/**/ 	   return true;
/**/ 	else
/**/ 	   return false;
/**/ }
// ==================================================================
// ------------------------------------------------------------------
/**/ // intonly(e)
/**/ // public
/**/ // Vérifie au moment de l'insertion d'un element dans un input si l'element est bien un int
/**/ // USAGE : onKeyPress="return intonly(event)
/**/ function intonly(e)
/**/ {
/**/ 	var key;
/**/ 	var keychar;
/**/ 	
/**/ 	if (window.event)
/**/ 	   key = window.event.keyCode;
/**/ 	else if (e)
/**/ 	   key = e.which;
/**/ 	else
/**/ 	   return true;
/**/ 	keychar = String.fromCharCode(key);
/**/ 	
/**/ 	// control keys
/**/ 	if ((key==null) || (key==0) || (key==8) ||
/**/ 		(key==9) || (key==13) || (key==27) )
/**/ 	   return true;
/**/
/**/ 	// differents keys
/**/ 	if ((key==32) || (key==45))
/**/ 	   return true;		 
/**/ 	// numbers
/**/		 
/**/ 	// numbers
/**/ 	else if ((("0123456789").indexOf(keychar) > -1))
/**/ 	   return true;
/**/ 	
/**/ 	else
/**/ 	   return false;
/**/ }
// ==================================================================
// ------------------------------------------------------------------
/**/ // floatonly(e)
/**/ // public
/**/ // Vérifie au moment de l'insertion d'un element dans un input si l'element est bien un float
/**/ // USAGE : onKeyPress="return floatonly(event)
/**/ function floatonly(e)
/**/ {
/**/ 	var key;
/**/ 	var keychar;
/**/ 	
/**/ 	if (window.event)
/**/ 	   key = window.event.keyCode;
/**/ 	else if (e)
/**/ 	   key = e.charCode;
/**/ 	else
/**/ 	   return true;
/**/ 	keychar = String.fromCharCode(key);
/**/ 	
/**/ 	// control keys
/**/ 	if ((key==null) || (key==0) || (key==8) ||
/**/ 		(key==9) || (key==13) || (key==27) )
/**/ 	   return true;
/**/
/**/ 	// dot keys
/**/ 	if ( (key==46) || (key==44) || (key==32) || (key==45) )/*|| /*space:32*/
/**/ 	   return true;		
/**/	
/**/ 	// numbers
/**/ 	else if ((("0123456789").indexOf(keychar) > -1))
/**/ 	   return true;
/**/ 	
/**/ 	else
/**/ 	   return false;
/**/ }
// ==================================================================
// ------------------------------------------------------------------
/**/ // evt_autoComplete(evt,onChangeFct,listeValeure,control)
/**/ // public
/**/ // Permet de gérer l'autocomplete d'un control, et l'execution de onChangeFct lors de l'appui sur "entrée"
/**/ function evt_autoComplete(evt,onChangeFct,listeValeurs,control)
/**/ {
/**/ 	keyCode=getKeyCode(evt);  
/**/ 	if ( keyCode == 13 ) 
/**/	{ 
/**/		if(onChangeFct != null)
/**/ 			onChangeFct(); 
/**/		return false; 
/**/	} 
/**/	return autocomplete(control, evt, listeValeurs);
/**/ }
/**/ 
// ==================================================================
// ------------------------------------------------------------------
/**/ // isValidEmail(email)
/**/ // public
/**/ // Permet de vérifier la validité d'une adresse mail
/**/ function isValidEmail(email)
/**/ {
/**/ 	return email.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi);
/**/ }
/**/
// ==================================================================
// ------------------------------------------------------------------
/**/ // clignotementInput(idInput)
/**/ // public
/**/ // Permet de faire clignoter un object
/**/ function clignotInput(idInput,couleurOff,couleurOn,delai,nbFois,compteur)
/**/ {  
/**/ 	if(typeof couleurOff == "undefined" || couleurOff == null) 		var couleurOff = "#ffffff"; //white
/**/ 	if(typeof couleurOn == "undefined" || couleurOn == null) 		var couleurOn = "#f5f6be"; //
/**/ 	if(typeof delai == "undefined" || delai == null) 				var delai = 500;
/**/ 	if(typeof nbFois == "undefined" || nbFois == null) 				var nbFois = 0;
/**/ 	if(typeof compteur == "undefined" || compteur == null) 			var compteur = 0;
/**/
/**/	var pause = false;
/**/	if(typeof document.activeElement != "undefined")
/**/	{ try { if(document.activeElement.id == idInput) var pause = true; } catch(e) { } }
/**/	
/**/ 	var couleurActuelle = fetch_object(idInput).style.backgroundColor;
/**/ 	if(couleurActuelle == couleurOn || pause)
/**/	{
/**/ 		fetch_object(idInput).style.backgroundColor=couleurOff;
/**/ 		compteur = compteur+1;
/**/ 		couleurOff = fetch_object(idInput).style.backgroundColor;
/**/	}
/**/ 	else
/**/	{
/**/ 		fetch_object(idInput).style.backgroundColor=couleurOn;
/**/ 		couleurOn = fetch_object(idInput).style.backgroundColor;
/**/	}
/**/
/**/ 	if(nbFois == 0 || compteur < nbFois)
/**/ 		setTimeout("clignotInput('" + idInput + "','" + couleurOff + "','" + couleurOn + "'," + delai + "," + nbFois + "," + compteur + ")",delai);
/**/ }		
// ==================================================================
// ------------------------------------------------------------------
/**/ // addElementToTBody(idTBody,elems,tdInfos) - removeElementFromTBody(cell)
/**/ // public
/**/ // Fonction permettants
/**/ // ----- 
/**/ function removeRow(row)
/**/ {
/**/ 	// Usage : <a href="#" onClick="javascript:removeElementFromTBody(this.parentNode)">Supprimer</a>
/**/ 	if(typeof row == "string")
/**/		row = fetch_object(row);
/**/	if(row.tagName == "TD")
/**/ 		var row = row.parentNode; 
/**/ 	row.parentNode.removeChild(row);
/**/ }
/**/ // ----- 
/**/ function addRow(idTBody,elems,tdInfos)
/**/ {
/**/ 	var trInfos	= new Object();
/**/ 	if(typeof elems == "undefined")
/**/ 		elems = Array();
/**/ 	if(typeof tdInfos == "undefined")
/**/ 		tdInfos = Array();
/**/ 	var tbody = fetch_object(idTBody);
/**/
/**/ 	// --- Recherche d'information concernant les cellules précédentes
/**/ 	if(tbody.rows.length > 0)
/**/ 	{
/**/ 		trInfos["className"] = tbody.rows[0].className;
/**/ 		trInfos["style"] = tbody.rows[0].style;
/**/ 		trInfos["align"] = tbody.rows[0].align;
/**/ 		trInfos["width"] = tbody.rows[0].width;
/**/ 		if(tbody.rows[0].cells.length > 0)
/**/ 		{
/**/ 			for(i=0;i<tbody.rows[0].cells.length;i++)
/**/ 			{
/**/ 				if(typeof tdInfos[i] == "undefined")
/**/ 					tdInfos[i] = new Object();
/**/ 				if(typeof tdInfos[i]["className"] == "undefined")
/**/ 					tdInfos[i]["className"] = tbody.rows[0].cells[i].className;
/**/ 				if(typeof tdInfos[i]["align"] == "undefined")
/**/ 					tdInfos[i]["align"] = tbody.rows[0].cells[i].align;
/**/ 				if(typeof tdInfos[i]["width"] == "undefined")
/**/ 					tdInfos[i]["width"] = tbody.rows[0].cells[i].width;
/**/ 			}
/**/ 		}
/**/ 	}
/**/ 
/**/ 	// --- Création de la ligne
/**/ 	var row = document.createElement("TR");
/**/ 	row.id = idTBody + "_row_" + tbody.rows.length;
/**/ 	
/**/ 	for(i=0;i<elems.length;i++)
/**/ 	{
/**/     	var td = document.createElement("TD");
/**/ 		td.id = row.id + "_cell_" + i;
/**/ 		td.innerHTML = elems[i];
/**/ 		if(typeof tdInfos[i] != "undefined")
/**/ 		{
/**/ 			for(var tag in tdInfos[i])
/**/ 			{ eval("td." + tag + " = tdInfos[i][\"" + tag + "\"];"); }
/**/ 		}
/**/     	row.appendChild(td);
/**/ 	}     
/**/ 	
/**/ 	if(elems.length > 0)
/**/ 		tbody.appendChild(row);
/**/ }
// ==================================================================
// ------------------------------------------------------------------
/**/ // importJSFile(adresseFile)
/**/ // public
/**/ // Permet d'importer un fichier JS
/**/ function importJSFile(adresseFile)
/**/ { 
/**/ 	document.write("<scr" + "ipt src=\"" + adresseFile + "\">" + "<\/script>");
/**/ }
// ------------------------------------------------------------------
/**/ importJSFile(ROOT +"javascript.js");
/**/ if(ROOT != "") importJSFile("javascript.js");
// ------------------------------------------------------------------