function lien(url) {
  var maitre; 
  if (opener.closed) {
    // si la fenêtre principale est fermée
    maitre=window.open('','nomprincipal','toolbar=yes, location=yes,status=yes,menubar=yes, scrollbars=yes,resizable=yes,copyhistory=no');
    maitre.location.href = url;
  } else {
    // Si la fenêtre principale est ouverte
    opener.location.href = url;
  }
  // Ferme le pop-up automatiquement
  window.close()
}
function favoris() {
	if (this.navigator.userAgent.indexOf('Opera')>-1) { alert ('Pour mettre La vague Ã  l\'Ã¢me dans vos bookmarks, appuyez sur CTRL + T');	}	
	if (this.navigator.appName.indexOf('Netscape')>-1) { window.sidebar.addPanel("La vague Ã  l'Ã¢me",document.location.href,""); }
	if (this.navigator.userAgent.indexOf('MSIE')>-1) { window.external.AddFavorite(document.location.href,"La vague Ã  l'Ã¢me"); }
}

function verifForm() {
	var msg="";
	if (document.FormMessage.nom.value=="") {msg='votre nom';}
	if (document.FormMessage.prenom.value=="") {
		if (msg!="") {msg=msg+', votre prenom';} else {msg='votre prenom';}
	}
	if ((document.FormMessage.email.value.indexOf("@",1)<0)||(document.FormMessage.email.value.indexOf(".",4)<0)) {
		if (msg!="") {msg=msg+', votre adresse e-mail au format correct';} else {msg='votre adresse e-mail au format correct';}
	}
	if (document.FormMessage.message.value=="") {
		if (msg!="") {msg=msg+', votre message';} else {msg='votre message';}
	}
	if (msg!="") {alert('Veuillez prÃ©ciser '+msg);return false;} else {return true;}
}

function style_vague (data) {
	var	obj = "l'ecrit de la vague";
	doc = data.replace("E", "E");
	doc = doc.replace("e", "e");
	doc = doc.toLowerCase();
	if (doc.indexOf(obj) >-1 ) {
		var nb = doc.indexOf(obj);
		var nb2 = nb + 19;
			var chaine = data.substring(0, nb) + '<span class=\"titre\">L\'&Eacute;CRIT DE LA VAGUE</span>' + data.substring(nb2);
	} else {
		var chaine = data;	
	}
   
   document.write(chaine);
}

function verifSuppr (type, id) {
	if (confirm("Voulez vous vraiment supprimer cet enregistrement ?")) {
		window.location='fct_suppression.php?id_'+type+'='+id;
	}	
}
