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];
        el.removeChild(noeudFils);
      }
    }
  }
}

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;
}


function verifemail(email){
	if(email == null){
		return false;
	}

	var atPos = email.indexOf("@");

	if(
		atPos < 1 ||
		email.indexOf(".", atPos) == -1
	){
		return false
	}

	var login = email.substring(0, atPos);
	var domain = email.substring(atPos + 1, email.length);

	// Regexp declarations
    var atom = "\[^\\s\\(\\)><@,;:\\\\\\\"\\.\\[\\]\]+";
    var word = "(" + atom + "|(\"[^\"]*\"))";
    var loginRE = new RegExp("^" + word + "(\\." + word + ")*$");

    for (i = 0; i < login.length; i++){
        if (login.charCodeAt(i) > 127){
            return false;
        }
    }

    if (!login.match(loginRE)){
        return false;
    }

    return true;
}
