// JavaScript Document
function hideOrShowPart( id_elt, id_elt_img, cookie_name)
{
	var elt 		= document.getElementById(id_elt);
	var elt_img 	= document.getElementById(id_elt_img);
	
	if ( elt.style.display == "none" ) // was hidden, show..
	{
		elt.style.height = "";
		elt.style.display = "";
		if (elt_img != null )
			elt_img.src = "images/uparrows_white.gif";
		EcrireCookie(cookie_name, 1);
	}
	else // was shonw, hide..
	{
		elt.style.height = "00";
		elt.style.display = "none";
		if (elt_img != null )
			elt_img.src = "images/downarrows_white.gif";
		EcrireCookie(cookie_name, 0);
	}
}

function hideOrShowVerticalPart( id_elt)
{
	var elt = document.getElementById(id_elt);
	if ( elt.style.display == "none" ) // was hidden, show..
	{
		elt.style.width = "";
		elt.style.display = "";
	}
	else // was shonw, hide..
	{
		elt.style.width = "00";
		elt.style.display = "none";
	}
}

function GetInnerText( sId) 
{
	// IE and Firefox do not support the same property!!
	if(document.all)
     return document.getElementById(sId).innerText;
	return document.getElementById(sId).textContent ;
}

function SetInnerText( sId, sText) 
{
	// IE and Firefox do not support the same property!!
	if(document.all)
     document.getElementById(sId).innerText = sText;
	document.getElementById(sId).textContent  = sText;
}

function GetEltText( elt) 
{
	if(document.all)
     return elt.innerText;
	return elt.textContent ;
}

function GetEltChildTextOrValue( elt, index) 
{
	if (document.all)
     	return elt.children[index].value;
	return elt.childNodes[index].value; 
}


function SetEltText( elt, sText) 
{
	if (document.all)
		 elt.innerText = sText;
	else 
		elt.textContent = sText;
}

function SetEltValue( elt, sText) 
{
	if (document.all)
		 elt.value = sText;
	else 
		elt.textContent = sText;
}

function MyRound( dNumber, iDecimal)
{
	var tmp = Math.pow(10, iDecimal);
	var result = Math.round(dNumber * tmp) / tmp;
	return result;
}