function noFrames(){
	if(top!=self)
	 top.location=self.location;
}
//------------------------------------------//
// DEPENDENCIES: string.js
// Tests if an email address is valid
function isValidEmailAddress(emailAddress){
    // If a simple regular expression doesn't work
    if(!new RegExp(/^test$/).test("test")){
        return true;
    }
    // If the email address is empty
    if(emailAddress.trim() == ""){
        return false;
    }
    return new RegExp(/^[^@]+@[^@]+\.[^@]{2,}$/).test(emailAddress.trim());
}
//------------------------------------------//
function rempliOptions(listeOptionsPossibles,elementCible,choix){
  razOptions(elementCible);
  try{
   for (i=0; i<listeOptionsPossibles[choix].length; i++) { 
         		var new_option = new Option(listeOptionsPossibles[choix][i][1],
         								listeOptionsPossibles[choix][i][0],
         								listeOptionsPossibles[choix][i][2],
         								listeOptionsPossibles[choix][i][2]); 
         		elementCible.options[elementCible.length]=new_option;
         }
     }
   catch(e){}
}
function razOptions(elementCible){
	var l=elementCible.length; 
	for (i=l; i>=0;i-=1) {
	   elementCible.options[i]=null;
	}//document.forms[0].elements["ornement"]
}
//----------------------------------------------//
var expressionDate = /^[0-9]{4}-[0-9]{2}-[0-9]{2}$/;
function testeDate(cible){
	return expressionDate.test(cible);
	}
//------------------------------------------------
var debut= "Remplir le champ ";
var fin = " du formulaire";
var finOpt = " ou deselectionner l'option."
	
function verifChampVide(nomChamp,texteErreur){
	if(document.forms[0].elements[nomChamp].value==""){
		document.forms[0].elements[nomChamp].focus();
		document.forms[0].elements[nomChamp].select();
		alert(texteErreur);
		return false;
	}
	return true;
}
function verifChampOptionnelVide(nomChamp,nomOption,texteErreur){
	if(document.forms[0].elements[nomOption].checked && 
			document.forms[0].elements[nomChamp].value==""){
		document.forms[0].elements[nomChamp].focus();
		document.forms[0].elements[nomChamp].select();
		alert(texteErreur);
		return false;
	}
	return true;
}
//-------------------------------------------------------
function confirmeSuppression(){
	return confirm("Voulez vous supprimer cet élément?");
	}