var oO =
{

	// Test de passage d'un argument
	_Test: 
		function()
		{
			//var iI = arguments.length - 1;
			//for(iI; iI >= 0; iI--) if(!arguments[iI]) return false;
			//return true;
		},

	_Deroule:
		function(id, initHeight, finalHeight, interval)
		{
//alert("id:" + id + "\ninitHeight:" + initHeight + "\nfinalHeight:" + finalHeight + "\ninterval:" + interval);
			// Identification de l'objet
			var oElem = document.getElementById(id);
			if(!oElem) return;
			
			// Contrôle des valeurs de variables
			if(typeof(initHeight || finalHeight || interval) != 'number') return false;

			// Contrôle d'éxécution de la méthode
			if(oElem.movement) clearTimeout(oElem.movement);
			
			// Initialisation des paramètres
			if( !oElem.style.height ) oElem.style.height = parseInt(initHeight) + 'px';
			var iDimY = parseInt(oElem.style.height);
			
			// Condition de fin de la méthode
			if(iDimY == finalHeight){
			clearTimeout(oElem.movement);
			return true;
			}
			// Conditions d'incrémentation et décrémentation
			if(iDimY < finalHeight)
			{
				var dist = Math.ceil((finalHeight - iDimY)/10);
				iDimY = iDimY + dist;
			}
			if(iDimY > finalHeight)
			{
				var dist = Math.ceil((iDimY - finalHeight)/10);
				iDimY = iDimY - dist;
			}
			oElem.style.height = iDimY + 'px';
			
			// Répétition de la méthode
			var repeat = "oO._Deroule('" + id + "'," + 1 + "," + finalHeight + "," + interval + ")";
			oElem.movement = setTimeout(repeat, interval);
			return true;
		},


	_Reduit:
				function(id, initHeight, finalHeight, interval)
		{
//alert("id:" + id + "\ninitHeight:" + initHeight + "\nfinalHeight:" + finalHeight + "\ninterval:" + interval);
			// Identification de l'objet
			var oElem = document.getElementById(id);
			if(!oElem){
			return;
			}
			
			// Contrôle des valeurs de variables


			// Contrôle d'éxécution de la méthode
			if(oElem.movement) clearTimeout(oElem.movement);
			
			// Initialisation des paramètres
			if( !oElem.style.height ) oElem.style.height = parseInt(initHeight) + 'px';
			var iDimY = parseInt(oElem.style.height);
			
			// Condition de fin de la méthode
			if(iDimY <= 1){
			clearTimeout(oElem.movement);
			return;
			}
			
			// Conditions d'incrémentation et décrémentation
			if(iDimY < 0)
			{
				//var dist = Math.ceil((iDimY)/10);
				//iDimY = iDimY - dist;
			}
			if(iDimY > 0)
			{
				var dist = Math.ceil((iDimY)/10);
				iDimY = iDimY - dist;
			}
			oElem.style.height = iDimY + 'px';
			
			// Répétition de la méthode
			var repeat = "oO._Reduit('" + id + "'," + initHeight + "," + 1 + "," + interval + ")";
			oElem.movement = setTimeout(repeat, interval);
			//alert ('stop');
			return true;
		}


};
// Lancement du script



function visible(variable){

var oDiv = document.getElementById(variable);

if (oDiv.offsetHeight > 1){
iDivHeight = oDiv.offsetHeight;
//alert(iDivHeight);
//var oDiv = document.getElementById('exemple');
//var iDivHeight = oDiv.offsetHeight;
f_valeur=document.getElementById("box_" + variable).value;
	if (f_valeur!=""){
	iDivHeight=document.getElementById("box_" + variable).value
	}else{
	document.getElementById("box_" + variable).value=iDivHeight;
	}
oO._Reduit(variable, iDivHeight,1, 30);

}else{
//var iDivHeight = oDiv.offsetHeight;

iDivHeight=document.getElementById("box_" + variable).value;
//alert(iDivHeight);
oO._Deroule(variable, 1,iDivHeight, 30);
// oDiv.style.height='22px';
}

}




function visiblediv(variable){
var oDiv = document.getElementById(variable);
iDivHeight=document.getElementById("box_" + variable).value;
//alert(iDivHeight);
oO._Deroule(variable, 1,iDivHeight, 30);
// oDiv.style.height='22px';
}

function invisiblediv(variable){
var oDiv = document.getElementById(variable);
iDivHeight = document.getElementById("box_" + variable).value;
oO._Reduit(variable, iDivHeight,1, 30);
}

