function verif () {
  var ok = 1;
  
  p=new RegExp("^.+@.+\\..+$");
  if ((document.form_news.adresse.value == "") || (document.form_news.adresse.value.search(p) == -1)) {
    alert("Vous devez saisir une adresse e-mail valide");
    ok = 0;
  }

  if (ok == 1) {
    adresse = document.form_news.adresse.value; 
	suppr = "";
	if (document.form_news.suppr.checked) suppr = "yes";
    param="height=200, width=400, location=no, menubar=yes, resizable=no, scrollbars=no, status=yes, toolbar=no";
    var newWindow=window.open("http://www.ctms.fr/inscrire.php?adresse="+adresse+"&suppr="+suppr, '_blank', param);
  }
}

function modif(type, id, langue) {
  if (type == "rubrique") {
    fichier = "modif_rubrique";
    id_rubrique = id;
    param="height=600, width=800, location=no, menubar=no, resizable=no, scrollbars=yes, status=yes, toolbar=no";
    var newWindow=window.open("http://www.ctms.fr/root/index.php?fichier="+fichier+"&id_rubrique="+id_rubrique+"&langue="+langue, '_blank', param);
  }
  if (type == "paragraphe"){
    fichier = "modif_paragraphe";
	id_paragraphe = id;
    param="height=600, width=800, location=no, menubar=no, resizable=no, scrollbars=yes, status=yes, toolbar=no";
    var newWindow=window.open("http://www.ctms.fr/root/index.php?fichier="+fichier+"&id_paragraphe="+id_paragraphe+"&langue="+langue, '_blank', param);
  }
}

function suppr(type, id, zone, langue) {
  if (type == "rubrique") {
    fichier = "suppr_rubrique";
    id_rubrique = id;
    param="height=350, width=600, location=no, menubar=no, resizable=no, scrollbars=yes, status=yes, toolbar=no";
    var newWindow=window.open("http://www.ctms.fr/root/index.php?fichier="+fichier+"&id_rubrique="+id_rubrique+"&langue="+langue, '_blank', param);
  }
  if (type == "paragraphe"){
    fichier = "suppr_paragraphe";
	id_paragraphe = id;
	id_zone = zone;
    param="height=350, width=600, location=no, menubar=no, resizable=no, scrollbars=yes, status=yes, toolbar=no";
    var newWindow=window.open("http://www.ctms.fr/root/index.php?fichier="+fichier+"&id_zone="+id_zone+"&id_paragraphe="+id_paragraphe+"&langue="+langue, '_blank', param);
  }
}

function suppr2(type, id, zone, langue, id2) {
  if (type == "rubrique") {
    fichier = "suppr_rubrique";
    id_rubrique = id;
    param="height=350, width=600, location=no, menubar=no, resizable=no, scrollbars=yes, status=yes, toolbar=no";
    var newWindow=window.open("http://www.ctms.fr/root/index.php?fichier="+fichier+"&id_rubrique="+id_rubrique+"&langue="+langue, '_blank', param);
  }
  if (type == "paragraphe"){
    fichier = "suppr_paragraphe";
	id_paragraphe = id;
	id_zone = zone;
    param="height=350, width=600, location=no, menubar=no, resizable=no, scrollbars=yes, status=yes, toolbar=no";
    var newWindow=window.open("http://www.ctms.fr/root/index.php?fichier="+fichier+"&id_zone="+id_zone+"&id_paragraphe="+id_paragraphe+"&id_rubrique="+id2+"&langue="+langue, '_blank', param);
  }
}

function ajout_para(type, id, zone, langue) {
  if (type == "rubrique") {
    fichier = "ajout_paragraphe";
    id_rubrique = id;
	id_zone = zone;
    param="height=600, width=800, location=no, menubar=no, resizable=no, scrollbars=yes, status=yes, toolbar=no";
    var newWindow=window.open("http://www.ctms.fr/root/index.php?fichier="+fichier+"&id_rubrique="+id_rubrique+"&id_zone="+id_zone+"&langue="+langue, '_blank', param);
  }
  if (type == "paragraphe"){
    fichier = "ajout_paragraphe";
	id_paragraphe = id;
	id_zone = zone;
    param="height=600, width=800, location=no, menubar=no, resizable=no, scrollbars=yes, status=yes, toolbar=no";
    var newWindow=window.open("http://www.ctms.fr/root/index.php?fichier="+fichier+"&id_paragraphe="+id_paragraphe+"&id_zone="+id_zone+"&langue="+langue, '_blank', param);
  }
}

function ajout_rub(type, id, langue) {
  if (type == "rubrique") {
    fichier = "ajout_rubrique";
    id_rubrique = id;
    param="height=600, width=800, location=no, menubar=no, resizable=no, scrollbars=yes, status=yes, toolbar=no";
    var newWindow=window.open("http://www.ctms.fr/root/index.php?fichier="+fichier+"&id_rubrique="+id_rubrique+"&langue="+langue, '_blank', param);
  }
}

function bouge(type, id, zone, direction, langue) {
  if (type == "rubrique") {
    fichier = "bouge_rubrique";
    id_rubrique = id;
    param="height=350, width=600, location=no, menubar=no, resizable=no, scrollbars=yes, status=yes, toolbar=no";
    var newWindow=window.open("http://www.ctms.fr/root/index.php?fichier="+fichier+"&direction="+direction+"&id_rubrique="+id_rubrique+"&langue="+langue, '_blank', param);
  }
  if (type == "paragraphe"){
    fichier = "bouge_paragraphe";
	id_paragraphe = id;
	id_zone = zone;
    param="height=350, width=600, location=no, menubar=no, resizable=no, scrollbars=yes, status=yes, toolbar=no";
    var newWindow=window.open("http://www.ctms.fr/root/index.php?fichier="+fichier+"&id_zone="+id_zone+"&direction="+direction+"&id_paragraphe="+id_paragraphe+"&langue="+langue, '_blank', param);
  }
}

function verif_ml() {
  p=new RegExp("^.+@.+\\..+$");
  if ((document.form_newsletter.email.value == "") || (document.form_newsletter.email.value.search(p) == -1)) {
    alert("Vous devez saisir une adresse e-mail valide");
  }
  else document.form_newsletter.submit();
}

function admin_ml() {
  param="height=600, width=800, location=no, menubar=no, resizable=no, scrollbars=yes, status=yes, toolbar=no";
  var newWindow=window.open("http://www.ctms.fr/root/index.php?fichier=admin_ml", '_blank', param);
}


function urldecode( str ) {
 
    var ret = str;
       
    ret = ret.replace(/\+/g, '%20');
    ret = decodeURIComponent(ret);
    ret = ret.toString();
 
    return ret;
}