function remplacerHtml(el, texte) {
	//alert('el : '+el);
  if (el != null) {
	//alert('remplacerHtml ('+el+')');
    effacerTexte(el);
   var nouveauNoeud = document.createTextNode(texte);
    el.appendChild(nouveauNoeud);
		el.innerHTML = texte;
  }
}

function remplacerTexte(el, texte) {
  if (el != null) {
    effacerTexte(el);
    var nouveauNoeud = document.createTextNode(texte);
    el.appendChild(nouveauNoeud);
  }
}

function effacerTexte(el) {
  if (el != null) {
    if (el.childNodes) {
      for (var i = 0; i < el.childNodes.length; i++) {
        var noeudFils = el.childNodes[i];
				//alert('el : '+el+' ; noeudFils : '+noeudFils);

        el.removeChild(noeudFils);
      }
    }
		//else alert(el+" n'a pas de noeud enfant");
  }
	//else alert(el+" est nul");
}

function getTexte(el) {
  var texte = "";
  if (el != null) {
    if (el.childNodes) {
      for (var i = 0; i < el.childNodes.length; i++) {
        var noeudFils = el.childNodes[i];
        if (noeudFils.nodeValue != null) {
          texte = texte + noeudFils.nodeValue;
        }
      }
    }
  }
  return texte;
}

String.prototype.trim = function(){
	return (this.replace(/^[\s\xA0]+/, "").replace(/[\sxA0]+$/, ""));
}

////////////// changer l'opacité d'un TAG
function setupOpacity(tagName, tagNameId){
	var theobjs=new Array();
	theelements=document.getElementsByTagName(tagName);
	for(var i=0; i<theelements.length; i++) {
		var obj=theelements[i];
		if(obj.id){
			theobjs[obj.id]=new DivObj(obj);
		}
	}
	if(tagNameId) {
		theobjs[tagNameId].objSetOpacity(1);
	}
	return theobjs;
}
function DivObj(obj){
	this.obj=obj;
	this.objGetOpacity=getOpacity;
	if(obj.style.filter) {
		this.objSetOpacity = alphaOpacity;
	}
	else {
		this.objSetOpacity=cssOpacity;
	}
}
function getOpacity(){
	if(this.obj.style.filter) {
		var filterString = this.obj.style.filter;
		var derivedVal = filterString.substring(filterString.indexOf(':')+1, filterString.indexOff(')'));
		return derivedVal/100;
	}
	else {
	 return this.obj.style.opacity;
	}
}

function changeOpacity(tagName, tagNameId, incremente){
	var theobjs= setupOpacity(tagName, tagNameId);
	var currentOpacity=parseFloat(theobjs[tagNameId].objGetOpacity());
	currentOpacity+=incremente;
	theobjs[tagNameId].objSetOpacity(currentOpacity);
}
/********************/

