var hideOneClicTimeOut;		// Delai apres lequel la zone OneClic se referme

// Ouvre la zone OneClic
function showOneClic()
{
	var obj = document.getElementById('OneClic');
	
	var fullHeight = 90;	// Taille de la zone une fois depliee
	var currentHeight = 0;
	if(obj.style.height.indexOf('px') != -1)	// Si une taille initiale a ete definie dans le style, on recupere la valeur de celle-ci
		currentHeight = parseInt(obj.style.height.substr(0, obj.style.height.indexOf('px')));
	
	// Si la zone a deja la taille maximum, il n'est pas necessaire d'executer la suite
	if(currentHeight < fullHeight)
	{
		obj.style.display = "block";	// Rend la zone visible

		var timer;
		var fct =        function ()
		{
				currentHeight  +=       10;     // Augmente la taille de 20 pixel 			
				obj.style.height     =	 currentHeight      +     'px';				
				if( currentHeight >= fullHeight)
					clearInterval(timer);   // La zone est a sa taille maximum, on stoppe le timer
		};
		fct();        
		timer = setInterval(fct,10);    //Toute les 40 ms
	}
	// Destruction du timeout de reduction de la zone
	clearTimeout(hideOneClicTimeOut);
}

function hideOneClic()
{
		
	var obj = document.getElementById('OneClic');

	var reducedHeight = 0;	// Taille de la zone une fois repliee
	var currentHeight = 90;	//Taille par defaut de la zone depliee
	if(obj.style.height.indexOf('px') != -1)	// Si une taille initiale a ete definie dans le style, on recupere la valeur de celle-ci
		currentHeight = parseInt(obj.style.height.substr(0, obj.style.height.indexOf('px')));
    
	if(currentHeight > reducedHeight)
	{   
        var timer;
        var fct =        function ()
        {
        	currentHeight  -=   10;     // Reduit la taille de la zone
			obj.style.height     =	 currentHeight + 'px';
				
          	if( currentHeight <= reducedHeight)
            {
            	clearInterval(timer);   // Arrete le timer
                //obj.style.overflow    =   'inherit';
				obj.style.display     =   "none";		
            }
        };
        fct();        
		timer = setInterval(fct,2);    //Toute les 40 ms
	}
}

function delayHideOneClic()
{
	hideOneClicTimeOut = setTimeout('hideOneClic()', 500);
}
