function rowOverEffect(object,row,rowover) {
  if (object.className == row) object.className = rowover;
}

function rowOutEffect(object,row,rowover) {
  if (object.className == rowover) object.className = row;
}
var oldElementToggle;
function toggle(element) {
	e=document.getElementById(element);
	e.style.height = e.offsetHeight;
	h = parseInt(e.style.height);
	if (h<e.getAttribute("origHeight")) {
		window.clearInterval(e.getAttribute("timer"));
		e.style.height="2";
		e.setAttribute("timer",window.setInterval("expand('" + element + "')",10));
	} else {
		window.clearInterval(e.getAttribute("timer"));
		e.setAttribute("origHeight",h);
		e.setAttribute("timer",window.setInterval("shrink('" + element + "')",10));
	}
	
	if ( oldElementToggle && oldElementToggle!=element && parseInt(document.getElementById(oldElementToggle).style.height)==document.getElementById(oldElementToggle).getAttribute("origHeight")) {
		toggle(oldElementToggle);
		oldElementToggle=element;
	}
	else if (!oldElementToggle) {
		oldElementToggle=element;				 
	}
	else if (oldElementToggle=element){
		oldElementToggle='';
	}
	//else alert(oldElementToggle+"-"+parseInt(document.getElementById(oldElementToggle).style.height)+":"+document.getElementById(oldElementToggle).getAttribute("origHeight"));
}

function snaptoggle(element) {		
	e=document.getElementById(element);
	e.style.height = e.offsetHeight;
	h = parseInt(e.style.height);
	if (h<e.getAttribute("origHeight")) {
		e.style.display = "block"
		e.style.height = e.getAttribute("origHeight");
		//g = e.filters.item(0);
		//g.opacity = 100;
	} else {
		e.setAttribute("origHeight",h);
		e.style.height = "0px";
		e.style.display = "none";
	}
}

function shrink(element) {
	e=document.getElementById(element);
	h = parseFloat(e.style.height);
	oh = e.getAttribute("origHeight");
	//f = e.filters.item(0);
	if (h<=2) {
		window.clearInterval(e.getAttribute("timer"));
		e.style.height="0px";
		e.style.display = "none";
		//f.opacity = 0;
	}
	e.style.height = Math.round(h/1.25);
	pc = Math.round(h/oh*100);
	//f.opacity = pc;
}

function expand(element) {		
	e=document.getElementById(element);
	e.style.display = "block";
	h = parseFloat(e.style.height);
	oh = e.getAttribute("origHeight");
	//f = e.filters.item(0);
	if (h>=oh) {
		window.clearInterval(e.getAttribute("timer"));
		e.style.height=e.getAttribute("origHeight");
		//f.opacity = 100;
	} else {
		nh = Math.round(h*1.25);
		if (nh>oh) {
			nh=oh;
		}
		pc = Math.round(h/oh*100);
		e.style.height = nh;
		//f.opacity = pc;
	}
}

function Compteur_Texte(nTexte, nCompteur, nLimite) {
  // Ajouter ce code dans la saisie du champ "textarea"
  // onKeyDown="Compteur_Texte(this,this.form.compteur,2000);"
  // onKeyUp="Compteur_Texte(this,this.form.compteur,2000);"
  // 2000 représente le nombre maximum de caractères accepté
  // Vous devez aussi ajouter une boîte de saisie qui
  // indique le nombre de caractères restant.
  // <input readonly="readonly" type="text" name="compteur" value="2000">
  if (nTexte.value.length > nLimite)
    nTexte.value = nTexte.value.substring(0, nLimite);
  else 
  	nCompteur.value = nLimite - nTexte.value.length;
}
