// Procédures globales du projet
function _SAE(c,o){var d=0;c += "";var f=c.length-1;if(o&1)while(c.charAt(d)==" ")d++;if(o&2)while(c.charAt(f)==" ")f--;if (f < d) f= d;return c.substring(d,f+1)}
function _VAL(v){var r=parseFloat(v);return isNaN(r)?0:r}var _FT_=null;var _NT_=""
function _TRD(){var b=false;if(_FT_)if(_FT_.closed)_NT_="";if(_NT_==""){b=true;_NT_="_TW_";if(window.name==_NT_)_NT_+="_";_FT_=window.open("",_NT_,"alwaysRaised=1,dependent=1,scrollbars=1,resizable=1,screenX=0,screenY=0,width=388,height=1")
_FT_.document.writeln("<HTML><HEAD><TITLE>"+STD_TITRE_TRACE+"</TITLE></HEAD><BODY bgcolor='#FFFF00'>");if(b)_FT_.document.writeln(""+STD_INFO_TRACE+"<BR><HR>");_FT_.document.writeln("<font face='Courier New,Courier,mono' size='-1'>")}}
function _TRC(p){_TRD();_FT_.document.write(p);_FT_.document.writeln("<BR>");_FT_.scroll(_FT_.innerWidth, _FT_.innerHeight)}
function _TRF(){if(_FT_){_FT_.close();_FT_=null;_NT_=""}}
function GLOBALPROCEDURESOFCOULEURVITRAILBROWSER_CALCULATEAGE(VPAR_DDOB, VPAR_DDATE){{var VIYEAR=0;var VDDOB=VPAR_DDOB;var VDDATE=VPAR_DDATE;if(((_SAE(VDDOB,3)=="")||(_SAE(VDDATE,3)==""))){return(0)}if((VDDATE<VDDOB)){VV0AC4D148=VDDATE;VDDATE=VDDOB
VDDOB=VV0AC4D148}VIYEAR=(_VAL((VDDATE + "").substring(1-1, 4))-_VAL((VDDOB + "").substring(1-1, 4)));if(((VDDATE + "").substr(5-1)<(VDDOB + "").substr(5-1))){VIYEAR=VIYEAR-1}return(VIYEAR)}}
function GLOBALPROCEDURESOFCOULEURVITRAILBROWSER_NOTYETBROWSER(){{alert("Feature not implemented yet!")}}
function GLOBALPROCEDURESOFCOULEURVITRAILBROWSER_JSTRACE(VSPAR_LINETOTRACE){{_TRC(VSPAR_LINETOTRACE)}}
// Summary: Set a specific cell at a specific z-index value
// Syntax:
// New_Procedure ()
//
// Parameters:
//	None
// Return Value:
// 	None
//
// For instance:
// Indicate an example.
//
//Procedure JSSetzIndex(Cell_GFI..alias, 99)
//
//
function JSSetzIndex(spar_Alias, ipar_Level)
{
eval("dww" + spar_Alias).style.zIndex = ipar_Level;
}

//Returns the height of the client area in the browser
function JSGetBrowserHeight(i_nMode)
{
	return document.body.clientHeight;
}

//Returns the value of the current left scroll
function JSGetBrowserLeftScrollValue()
{
	return document.body.scrollLeft;
}

//Returns the value of the current top scroll
function JSGetBrowserTopScrollValue()
{
	return document.body.scrollTop;
}

//Returns the current width of the client area in the browser
function JSGetBrowserWidth()
{
	return document.body.clientWidth;
}

//Set the GFIChangeSize procedure to be called each time the user scrolls or resizes the browser window
function JSPrepareResize()
{
	window.onresize = GFIChangeSize;
	window.onscroll = GFIChangeSize;
}

// Summary: Set the background color of a cell
// Syntax:
// New_Procedure ()
//
// Parameters:
//	None
// Return Value:
// 	None
//
// For instance:
// JSSetBackgroundColor(iGFI, sColor)
//
function JSSetBackgroundColor(spar_GFI, spar_Color)
{
	eval("dww" + spar_GFI).style.backgroundColor = eval(spar_Color); 
}

//It seems that thios function should be called at the END of the onload code to work properly
function JSHideScrollbars()
{
	document.body.style.overflow="hidden";
}

function JSGrayField(spar_FieldAlias)
{
//eval("dww" + spar_Alias)
	//spar_FieldAlias.disabled = true;
//	PAGE_ADMINISTRATION.getElementById(spar_FieldAlias).disabled = true;
	//document.PAGE_ADMINISTRATION.getElementById(spar_FieldAlias).disabled = true;
	document.getElementById(spar_FieldAlias).disabled = true;
	//eval("_PAGE_."+spar_FieldAlias).disabled="true";
//	spar_FieldAlias.disabled="true";
}
// Summary: <specify the procedure action>
// Syntax:
//JSGrayField ()
//
// Parameters:
//	None
// Return Value:
// 	None
//
// For instance:
// Indicate an example.
//
//Procedure JSGrayField(spar_Field)
//
//
function JSGrayCHX(spar_FieldAlias)
{
	document.PAGE_ADMINISTRATION.A7[1].disabled = true;
	document.PAGE_ADMINISTRATION.getElementById(A7[2]).disabled = true;
	
//	document.PAGE_ADMINISTRATION.spar_FieldAlias[1].disabled = true;
}

function JSLoadInnerHTML(spar_FieldAlias, spar_URL)
{
	document.getElementById("dww"+spar_FieldAlias).innerHTML = spar_URL;
}
// Résumé : Load an image via its URL in an image field via its alias
// Syntaxe :
//JSLoadImage ()
//
// Paramètres :
//	Aucun
// Valeur de retour :
// 	Aucune
//
// Exemple :
// Indiquez ici un exemple d'utilisation.
//
//PROCEDURE JSLoadImage()
//
//
function JSReplaceHTML(el, html) {
	if( el ) {
		var oldEl = (typeof el === "string" ? document.getElementById(el) : el);
		var newEl = document.createElement(oldEl.nodeName);
		
		// Preserve any properties we care about (id and class in this example)
		newEl.id = oldEl.id;
		newEl.className = oldEl.className;
		
		//set the new HTML and insert back into the DOM
		newEl.innerHTML = html;
		if(oldEl.parentNode)
		oldEl.parentNode.replaceChild(newEl, oldEl);
		else
		oldEl.innerHTML = html;
		
		//return a reference to the new element in case we need it
		return newEl;
		}
};

// Summary: <specify the procedure action>
// Syntax:
//JSReplaceHTML ()
//
// Parameters:
//	None
// Return Value:
// 	None
//
// For instance:
// Indicate an example.
//
//PROCEDURE JSReplaceHTML()
//
//
function JSReplaceInnerText(el, InnerText) {
	if( el ) {
		var oldEl = (typeof el === "string" ? document.getElementById(el) : el);
		var newEl = document.createElement(oldEl.nodeName);
		
		// Preserve any properties we care about (id and class in this example)
		newEl.id = oldEl.id;
		newEl.className = oldEl.className;
		
		//set the new HTML and insert back into the DOM
		newEl.innerText = InnerText;
		if(oldEl.parentNode)
		oldEl.parentNode.replaceChild(newEl, oldEl);
		else
		oldEl.innerText = InnexText;
		
		//return a reference to the new element in case we need it
		return newEl;
		}
};

// Summary: <specify the procedure action>
// Syntax:
//JSReplaceHTML ()
//
// Parameters:
//	None
// Return Value:
// 	None
//
// For instance:
// Indicate an example.
//
//PROCEDURE JSReplaceHTML()
//
//

