// JavaScript Document
function addLoadEvent(func) {
    var oldonload = window.onload;
    if (typeof window.onload != 'function') {
        window.onload = func;
    } else {
        window.onload = function() {
            if (oldonload) {
                oldonload();
            }
            func();
        }
    }
}


function showHideElement(argElementId, argEtat)
{
	if(document.getElementById(argElementId) != null)
	{
		if(argEtat != '')
		{
			document.getElementById(argElementId).style.display = argEtat;
		}
		else
		{		
			if(document.getElementById(argElementId).style.display == 'none')
			{
				document.getElementById(argElementId).style.display = '';
			}
			else
			{
				document.getElementById(argElementId).style.display = 'none';
			}
		}
	}
}


function clearNodeVide(argNode)
{
	var i;

	if(argNode != null)
	{
		for(i = 0; i < argNode.childNodes.length; i++)
		{
			if(argNode.childNodes[i].tagName == undefined)
			{
				argNode.removeChild(argNode.childNodes[i]);
			}
		}
	}
}