/******************************************************************************
* functionalities.js                                                          *
*                                                                             *
* Last update: August 27, 2002.                                               *
*                                                                             *
* Provides basic functions for PHP / TPL files                                *
******************************************************************************/

var pas_ouverte = true;
var fenetre ;


function fermerResult() {
	if(!pas_ouverte)
	{
		fenetre.close();
		pas_ouverte=! pas_ouverte;
	}

}


	function voirResult() {
		fenetre = "";
		fenetre = window.open('','apercu','target=_blank,width=550,height=300,scrollbars=yes,resizable=yes',false);
 		pas_ouverte = ! pas_ouverte;
 		fenetre.document.writeln("<head><title>Aperçu du message d'aide</title></head>");
		fenetre.document.writeln("<LINK REL='stylesheet' TYPE='text/css' HREF='../include/styles/styles.css'>");
		if(window.parent.formModify)
			fenetre.document.writeln(window.parent.formModify.description.value);
		else
			fenetre.document.writeln(window.parent.formAdd.description.value);
		fenetre.focus();
	}



	function checkLogin() {
		if(event.keyCode == 13)
		{
			window.frames.left.formLogin.submit();
		}
	}




	function checkRowAll(nbdoc,dlang) {
		tab = dlang.split(',');

		for(i=0 ; i<tab.length ; i++) {
			vf = 'doc_'+nbdoc+'_'+tab[i];
			f = document.formLink.elements[vf];
			f.checked = true;
		}
	}



	function checkRowNone(nbdoc,dlang) {
		tab = dlang.split(',');

		for(i=0 ; i<tab.length ; i++) {
			vf = 'doc_'+nbdoc+'_'+tab[i];
			f = document.formLink.elements[vf];
			f.checked = false;
		}
	}



	function checkRowAllVertical(nbdoc,dlang) {
		tab = nbdoc.split(',');

		for(i = tab[0] ; i <= tab[1] ; i++) {
			vf = 'doc_'+i+'_'+dlang;
			f = document.formLink.elements[vf];
			if(f)
				f.checked = true;
		}
	}



	function checkRowNoneVertical(nbdoc,dlang) {
		tab = nbdoc.split(',');

		for(i = tab[0] ; i <= tab[1] ; i++) {
			vf = 'doc_'+i+'_'+dlang;
			f = document.formLink.elements[vf];
			if(f)
				f.checked = false;
		}
	}



	function Links_see(path, name)
	{
		var fenetre = "" ;
		fenetre = window.open(path+'links_see.php?selection='+name,'popdoc','target=_blank,width=537,height=200,scrollbars=no,resizable=no');
		fenetre.focus();
	}


	function Supergestion_modify_validate()
	{
		f = document.formModify;

		if(f.intitule.value.length==0)
		{
			alert("Veuillez entrer un intitulé, merci");
			return ;
		}

		if(f.description.value.length==0)
		{
			alert("Veuillez entrer une description, merci");
			return ;
		}

		if(f.id_group.value.length==0)
		{
			alert("Veuillez sélectionner un groupe, merci");
			return ;
		}

		f.submit()
		return true;
	}

	function Supergestion_add_validate()
	{
		f = document.formAdd;

		if(f.intitule.value.length==0)
		{
			alert("Veuillez entrer un intitulé, merci");
			return ;
		}

		if(f.description.value.length==0)
		{
			alert("Veuillez entrer une description, merci");
			return ;
		}

		if(f.id_group.value.length==0)
		{
			alert("Veuillez sélectionner un groupe, merci");
			return ;
		}

		f.submit()
		return true;
	}



//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// Navigation files
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------

  function Glossary_display(letter)
  {
	window.open('popups/site/glossary.php?alpha='+letter,'_blank','width=650,height=400,scrollbars=yes,resizable=no');
  }


//-----------------------------------------------------------------------------

  function Events_display(name)
  {
	if(name)
		window.open('popups/site/events.php?hist=0&selection='+name,'_blank','width=650,height=350,scrollbars=no,resizable=no');
	else
		window.open('popups/site/events.php?hist=0','_blank','width=650,height=350,scrollbars=no,resizable=no');
  }

//-----------------------------------------------------------------------------

	function viewImage(path,nb,real_x,real_y)
	{
		window.open(path+'photos_view.php?id='+nb,'_blank','width='+real_x+',height='+real_y+',scrollbars=no,resizable=no');
	}

  function viewImageSite(url,real_x,real_y)
  {
	window.open('/blobs/photos_view.php?id='+url,'_blank','width='+real_x+',height='+real_y+',scrollbars=no,resizable=no');
  }


  function Mentions()
  {
	window.open('/popups/site/mentions.php','_blank','width=500,height=400,scrollbars=yes,resizable=yes');
  }




//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// Administration files
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------

  function Help(name)
  {
	window.open('../popups/admin/help.php?name='+name,'_blank','width=565,height=350,scrollbars=yes,resizable=no');
  }



//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// Users administration files
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------

	function Users_add_validate()
	{
		f = document.formAdd;

		if(f.username.value.length<4)
		{
			alert("Veuillez entrer un Username (taille min.=4) pour votre nouvel utilisateur, merci");
			return ;
		}
		if(f.password1.value.length<6)
		{
			alert("Veuillez entrer un Mot de passe (taille min.=6), merci");
			return ;
		}
		if(f.password1.value!=f.password2.value)
		{
			alert("Vous n'avez pas re-saisi le bon Mot de passe");
			return ;
		}
		if(f.civilite.value.length==0)
		{
			alert("Veuillez entrer une Civilité pour votre nouvel utilisateur, merci");
			return ;
		}
		if(f.nom.value.length==0)
		{
			alert("Veuillez entrer un Nom pour votre nouvel utilisateur, merci");
			return ;
		}
		if(f.prenom.value.length==0)
		{
			alert("Veuillez entrer un Prénom pour votre nouvel utilisateur, merci");
			return ;
		}
		if(f.email.value.length==0)
		{
			alert("Veuillez entrer un Email pour votre nouvel utilisateur, merci");
			return ;
		}
		if(f.telephone.value.length==0)
		{
			alert("Veuillez entrer un Téléphone pour votre nouvel utilisateur, merci");
			return ;
		}
		if(f.fonction.value.length==0)
		{
			alert("Veuillez entrer une Fonction pour votre nouvel utilisateur, merci");
			return ;
		}
		if(f.societe.value.length==0)
		{
			alert("Veuillez entrer une Société pour votre nouvel utilisateur, merci");
			return ;
		}
		if(f.erasable.value.length==0)
		{
			alert("Veuillez entrer une valeur Effaçable pour votre nouvel utilisateur, merci");
			return ;
		}

		f.submit()
		return true;
	}

// ***********************************************************************************************************

	function Users_modify_validate()
	{
		f = document.formModify;

		if(f.password1.value.length<6)
		{
			alert("Veuillez entrer un Mot de passe (taille min.=6), merci");
			return ;
		}
		if(f.password1.value!=f.password2.value)
		{
			alert("Vous n'avez pas re-saisi le bon Mot de passe");
			return ;
		}
		if(f.civilite.value.length==0)
		{
			alert("Veuillez entrer une Civilité pour votre nouvel utilisateur, merci");
			return ;
		}
		if(f.nom.value.length==0)
		{
			alert("Veuillez entrer un Nom pour votre nouvel utilisateur, merci");
			return ;
		}
		if(f.prenom.value.length==0)
		{
			alert("Veuillez entrer un Prénom pour votre nouvel utilisateur, merci");
			return ;
		}
		if(f.email.value.length==0)
		{
			alert("Veuillez entrer un Email pour votre nouvel utilisateur, merci");
			return ;
		}
		if(f.telephone.value.length==0)
		{
			alert("Veuillez entrer un Téléphone pour votre nouvel utilisateur, merci");
			return ;
		}
		if(f.fonction.value.length==0)
		{
			alert("Veuillez entrer une Fonction pour votre nouvel utilisateur, merci");
			return ;
		}
		if(f.societe.value.length==0)
		{
			alert("Veuillez entrer une Société pour votre nouvel utilisateur, merci");
			return ;
		}
		if(f.erasable.value.length==0)
		{
			alert("Veuillez entrer une valeur Effaçable pour votre nouvel utilisateur, merci");
			return ;
		}

		f.submit()
		return true;
	}



//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// Groups administration files
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------

	function Groups_add_validate()
	{
		f = document.formAdd;

		if(f.groupname.value.length==0)
		{
			alert("Veuillez entrer un Nom de groupe, merci");
			return ;
		}

		if(f.id_user.value.length==0)
		{
			alert("Veuillez sélectionner un Utilisateur propriétaire, merci");
			return ;
		}

		if(f.description.value.length==0)
		{
			alert("Veuillez entrer une description, merci");
			return ;
		}

		if(f.erasable.value.length==0)
		{
			alert("Veuillez préciser si ce groupe est effaçable ou non, merci");
			return ;
		}

		f.submit()
		return true;
	}

//-----------------------------------------------------------------------------

	function Groups_modify_validate()
	{
		f = document.formModify;

		if(f.groupname.value.length==0)
		{
			alert("Veuillez entrer un nom de groupe, merci");
			return ;
		}

		f.submit()
		return true;
	}



//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// Glossary administration files
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------

	function Glossary_add_validate()
	{
		f = document.formAdd;

		if(f.abbreviation.value.length==0)
		{
			alert("Veuillez entrer une Abbréviation pour votre nouvelle entrée dans le glossaire, merci");
			return ;
		}

		if(f.definition.value.length==0)
		{
			alert("Veuillez entrer une Définition pour votre nouvelle entrée dans le glossaire, merci");
			return ;
		}

		f.submit()
		return true;
	}


	function Glossary_modify_validate()
	{
		f = document.formModify;

		if(f.abbreviation.value.length==0)
		{
			alert("Veuillez entrer une Abbréviation pour cette entrée du glossaire, merci");
			return ;
		}

		if(f.definition.value.length==0)
		{
			alert("Veuillez entrer une Définition pour cette entrée du glossaire, merci");
			return ;
		}

		f.submit()
		return true;
	}



//-----------------------------------------------------------------------------
// Fiches pratiques administration files
//-----------------------------------------------------------------------------

	function Fiches(numero_fiche)
	{
		window.open('popups/site/fiches.php?numero='+numero_fiche,'_blank','width=600,height=450,scrollbars=yes,resizable=yes');
	}

	function Fiches_add_validate()
	{
		f = document.formAdd;

		if(f.numero.value.length==0)
		{
			alert("Veuillez entrer un Numero pour votre nouvelle fiche pratique, merci");
			return ;
		}

		if(f.titre.value.length==0)
		{
			alert("Veuillez entrer un Titre pour votre nouvelle fiche pratique, merci");
			return ;
		}

		if(f.content.value.length==0)
		{
			alert("Veuillez entrer un Contenu pour votre nouvelle fiche pratique, merci");
			return ;
		}

		f.submit()
		return true;
	}


	function Fiches_modify_validate()
	{
		f = document.formModify;

		if(f.numero.value.length==0)
		{
			alert("Veuillez entrer un Numero pour cette fiche pratique, merci");
			return ;
		}

		if(f.titre.value.length==0)
		{
			alert("Veuillez entrer un Titre pour cette fiche pratique, merci");
			return ;
		}

		if(f.content.value.length==0)
		{
			alert("Veuillez entrer un Contenu pour cette fiche pratique, merci");
			return ;
		}

		f.submit()
		return true;
	}



//-----------------------------------------------------------------------------
// Lettre de l'Observatoire
//-----------------------------------------------------------------------------

	function Watchdog_abo_send()
	{
		f = document.formAbo;

		if(f.civilite.value.length==0)
		{
			alert("Veuillez saisir une civilité pour votre abonnement, merci");
			return ;
		}

		if(f.nom.value.length==0)
		{
			alert("Veuillez saisir un nom pour votre abonnement, merci");
			return ;
		}

		if(f.prenom.value.length==0)
		{
			alert("Veuillez saisir un prénom pour votre abonnement, merci");
			return ;
		}

//		if(f.organisme.value.length==0)
//		{
//			alert("Veuillez saisir un organisme d'appartenance pour votre abonnement, merci");
//			return ;
//		}

//		if(f.fonction.value.length==0)
//		{
//			alert("Veuillez saisir une fonction pour votre abonnement, merci");
//			return ;
//		}

		if(f.adresse1.value.length==0)
		{
			alert("Veuillez saisir une adresse pour votre abonnement, merci");
			return ;
		}

		if(f.codepostal.value.length==0)
		{
			alert("Veuillez saisir un code postal pour l'adresse de votre abonnement, merci");
			return ;
		}

		if(f.ville.value.length==0)
		{
			alert("Veuillez saisir une ville pour l'adresse de votre abonnement, merci");
			return ;
		}

		if(f.pays.value.length==0)
		{
			alert("Veuillez saisir un pays pour l'adresse de votre abonnement, merci");
			return ;
		}

		if(f.email.value.length==0)
		{
			alert("Veuillez saisir une adresse email pour votre abonnement, merci");
			return ;
		}

		f.submit()
		return true;
	}


//-----------------------------------------------------------------------------
// Lettres de la Fondation: administration files
//-----------------------------------------------------------------------------

	function Lettres_abo_send()
	{
		f = document.formAbo;

		if(f.civilite.value.length==0)
		{
			alert("Veuillez saisir une civilité pour votre abonnement, merci");
			return ;
		}

		if(f.nom.value.length==0)
		{
			alert("Veuillez saisir un nom pour votre abonnement, merci");
			return ;
		}

		if(f.prenom.value.length==0)
		{
			alert("Veuillez saisir un prénom pour votre abonnement, merci");
			return ;
		}

//		if(f.organisme.value.length==0)
//		{
//			alert("Veuillez saisir un organisme d'appartenance pour votre abonnement, merci");
//			return ;
//		}

//		if(f.fonction.value.length==0)
//		{
//			alert("Veuillez saisir une fonction pour votre abonnement, merci");
//			return ;
//		}

		if(f.adresse1.value.length==0)
		{
			alert("Veuillez saisir une adresse pour votre abonnement, merci");
			return ;
		}

		if(f.codepostal.value.length==0)
		{
			alert("Veuillez saisir un code postal pour l'adresse de votre abonnement, merci");
			return ;
		}

		if(f.ville.value.length==0)
		{
			alert("Veuillez saisir une ville pour l'adresse de votre abonnement, merci");
			return ;
		}

		if(f.pays.value.length==0)
		{
			alert("Veuillez saisir un pays pour l'adresse de votre abonnement, merci");
			return ;
		}

		if(f.email.value.length==0)
		{
			alert("Veuillez saisir une adresse email pour votre abonnement, merci");
			return ;
		}

		f.submit()
		return true;
	}


	function Lettres_add_validate()
	{
		f = document.formAdd;

		if(f.country.value.length==0)
		{
			alert("Veuillez entrer un Pays pour votre nouvelle Lettre de la Fondation, merci");
			return ;
		}

		if(f.period.value.length==0)
		{
			alert("Veuillez entrer une Périodicité pour votre nouvelle Lettre de la Fondation, merci");
			return ;
		}

		if(f.title.value.length==0)
		{
			alert("Veuillez entrer un Titre pour votre nouvelle Lettre de la Fondation, merci");
			return ;
		}

		if(f.content.value.length==0)
		{
			alert("Veuillez entrer un Contenu pour votre nouvelle Lettre de la Fondation, merci");
			return ;
		}

		if(f.signature.value.length==0)
		{
			alert("Veuillez entrer un Auteur pour votre nouvelle Lettre de la Fondation, merci");
			return ;
		}

		if(f.archives.value.length==0)
		{
			alert("Veuillez entrer oui ou non pour les Archives, dans votre nouvelle Lettre de la Fondation, merci");
			return ;
		}

		f.submit()
		return true;
	}


	function Lettres_modify_validate()
	{
		f = document.formModify;

		if(f.country.value.length==0)
		{
			alert("Veuillez entrer un Pays pour cette Lettre de la Fondation, merci");
			return ;
		}

		if(f.period.value.length==0)
		{
			alert("Veuillez entrer une Périodicité pour cette Lettre de la Fondation, merci");
			return ;
		}

		if(f.title.value.length==0)
		{
			alert("Veuillez entrer un Titre pour cette Lettre de la Fondation, merci");
			return ;
		}

		if(f.content.value.length==0)
		{
			alert("Veuillez entrer un Contenu pour cette Lettre de la Fondation, merci");
			return ;
		}

		if(f.signature.value.length==0)
		{
			alert("Veuillez entrer un Auteur pour cette Lettre de la Fondation, merci");
			return ;
		}

		f.submit()
		return true;
	}



//-----------------------------------------------------------------------------
// Revues de presse: administration files
//-----------------------------------------------------------------------------

	function Revues_abo_send()
	{
		f = document.formAbo;

		if(f.civilite.value.length==0)
		{
			alert("Veuillez saisir une civilité pour votre abonnement, merci");
			return ;
		}

		if(f.nom.value.length==0)
		{
			alert("Veuillez saisir un nom pour votre abonnement, merci");
			return ;
		}

		if(f.prenom.value.length==0)
		{
			alert("Veuillez saisir un prénom pour votre abonnement, merci");
			return ;
		}

//		if(f.organisme.value.length==0)
//		{
//			alert("Veuillez saisir un organisme d'appartenance pour votre abonnement, merci");
//			return ;
//		}

//		if(f.fonction.value.length==0)
//		{
//			alert("Veuillez saisir une fonction pour votre abonnement, merci");
//			return ;
//		}

		if(f.adresse1.value.length==0)
		{
			alert("Veuillez saisir une adresse pour votre abonnement, merci");
			return ;
		}

		if(f.codepostal.value.length==0)
		{
			alert("Veuillez saisir un code postal pour l'adresse de votre abonnement, merci");
			return ;
		}

		if(f.ville.value.length==0)
		{
			alert("Veuillez saisir une ville pour l'adresse de votre abonnement, merci");
			return ;
		}

		if(f.pays.value.length==0)
		{
			alert("Veuillez saisir un pays pour l'adresse de votre abonnement, merci");
			return ;
		}

		if(f.email.value.length==0)
		{
			alert("Veuillez saisir une adresse email pour votre abonnement, merci");
			return ;
		}

		f.submit()
		return true;
	}


	function Revues_add_validate()
	{
		f = document.formAdd;

		if(f.country.value.length==0)
		{
			alert("Veuillez entrer un Pays pour votre nouvelle Revue de Presse, merci");
			return ;
		}

		if(f.period.value.length==0)
		{
			alert("Veuillez entrer une Périodicité pour votre nouvelle Revue de Presse, merci");
			return ;
		}

		f.submit()
		return true;
	}


	function Revues_modify_validate()
	{
		f = document.formModify;

		if(f.country.value.length==0)
		{
			alert("Veuillez entrer un Pays pour cette Revue de Presse, merci");
			return ;
		}

		if(f.period.value.length==0)
		{
			alert("Veuillez entrer une Périodicité pour cette Revue de Presse, merci");
			return ;
		}

		f.submit()
		return true;
	}



//-----------------------------------------------------------------------------
// Pages de Revues de presse: administration files
//-----------------------------------------------------------------------------

	function Revuespages_add_validate()
	{
		f = document.formAdd;

		if(f.id_revue.value.length==0)
		{
			alert("Veuillez sélectionner une Revue de presse pour votre nouvelle Page de revue de presse, merci");
			return ;
		}

		if(f.id_page.value.length==0)
		{
			alert("Veuillez entrer un Numéro de page pour votre nouvelle Page de revue de Presse, merci");
			return ;
		}

		if(f.title.value.length==0)
		{
			alert("Veuillez entrer un Titre pour votre nouvelle Page de revue de Presse, merci");
			return ;
		}

		if(f.content.value.length==0)
		{
			alert("Veuillez entrer un Contenu pour votre nouvelle Page de revue de Presse, merci");
			return ;
		}

		f.submit()
		return true;
	}


	function Revuespages_modify_validate()
	{
		f = document.formModify;

		if(f.id_revue.value.length==0)
		{
			alert("Veuillez sélectionner une Revue de presse pour cette Page de revue de presse, merci");
			return ;
		}

		if(f.id_page.value.length==0)
		{
			alert("Veuillez entrer un Numéro de page pour cette Page de revue de Presse, merci");
			return ;
		}

		if(f.title.value.length==0)
		{
			alert("Veuillez entrer un Titre pour cette Page de revue de Presse, merci");
			return ;
		}

		if(f.content.value.length==0)
		{
			alert("Veuillez entrer un Contenu de page pour cette Page de revue de Presse, merci");
			return ;
		}

		f.submit()
		return true;
	}



//-----------------------------------------------------------------------------
// Publications: administration files
//-----------------------------------------------------------------------------

	function Publications_add_validate()
	{
		f = document.formAdd;

		if(f.numero.value.length==0)
		{
			alert("Veuillez entrer un Numero pour votre nouvelle Publication, merci");
			return ;
		}

		if(f.title1.value.length==0)
		{
			alert("Veuillez entrer un Titre 1 pour votre nouvelle Publication, merci");
			return ;
		}

		if(f.resume.value.length==0)
		{
			alert("Veuillez entrer un Résumé pour votre nouvelle Publication, merci");
			return ;
		}

		if(f.auteur.value.length==0)
		{
			alert("Veuillez entrer un Auteur(s) pour votre nouvelle Publication, merci");
			return ;
		}

		f.submit()
		return true;
	}


	function Publications_modify_validate()
	{
		f = document.formModify;

		if(f.numero.value.length==0)
		{
			alert("Veuillez entrer un Numero pour cette Publication, merci");
			return ;
		}

		if(f.title1.value.length==0)
		{
			alert("Veuillez entrer un Titre 1 pour cette Publication, merci");
			return ;
		}

		if(f.resume.value.length==0)
		{
			alert("Veuillez entrer un Résumé pour cette Publication, merci");
			return ;
		}

		if(f.auteur.value.length==0)
		{
			alert("Veuillez entrer un Auteur(s) pour cette Publication, merci");
			return ;
		}

		f.submit()
		return true;
	}



//-----------------------------------------------------------------------------
// Publications types: administration files
//-----------------------------------------------------------------------------

	function Publicationstypes_add_validate()
	{
		f = document.formAdd;

		if(f.category.value.length==0)
		{
			alert("Veuillez entrer une Catégorie pour votre nouveau Type de Publication, merci");
			return ;
		}

		if(f.description.value.length==0)
		{
			alert("Veuillez entrer une Description pour votre nouveau Type de Publication, merci");
			return ;
		}

		f.submit()
		return true;
	}


	function Publicationstypes_modify_validate()
	{
		f = document.formModify;

		if(f.category.value.length==0)
		{
			alert("Veuillez entrer une Catégorie pour ce Type de Publication, merci");
			return ;
		}

		if(f.description.value.length==0)
		{
			alert("Veuillez entrer une Description pour ce Type de Publication, merci");
			return ;
		}

		f.submit()
		return true;
	}



//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// Events administration files
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------

	function Events_add_validate()
	{
		f = document.formAdd;

		if(f.titre.value.length==0)
		{
			alert("Veuillez entrer le titre de votre nouvel événement, merci");
			return ;
		}
		if((f.dayBegin.value.length==0) || (f.monthBegin.value.length==0) || (f.yearBegin.value.length==0))
		{
			alert("Veuillez compléter la Date de Début de votre nouvel événement, merci");
			return ;
		}
		if((f.dayEnd.value.length!=0) || (f.monthEnd.value.length!=0) || (f.yearEnd.value.length!=0))
		{
			if((f.dayEnd.value.length==0) || (f.monthEnd.value.length==0) || (f.yearEnd.value.length==0))
			{
				alert("Veuillez compléter la Date de Fin de votre nouvel événement, merci");
				return ;
			}
		}
		if((f.dayEnd.value.length!=0) && (f.monthEnd.value.length!=0) && (f.yearEnd.value.length!=0))
		{
			if(f.yearEnd.value<f.yearBegin.value)
			{
				alert("La Date de Fin doit être postérieure à la Date de Début, merci");
				return ;
			}
			else
			{
				if(f.yearEnd.value==f.yearBegin.value)
				{
					if(f.monthEnd.value<f.monthBegin.value)
					{
						alert("La Date de Fin doit être postérieure à la Date de Début, merci");
						return ;
					}
					else
					{
						if(f.monthEnd.value==f.monthBegin.value)
						{
							if(f.dayEnd.value<=f.dayBegin.value)
							{
								alert("La Date de Fin doit être postérieure à la Date de Début, merci");
								return ;
							}
						}
					}
				}
			}
		}
		if(f.description.value.length==0)
		{
			alert("Veuillez entrer la Description de votre nouvel événement, merci");
			return ;
		}

		f.submit()
		return true;
	}

//-----------------------------------------------------------------------------

	function Events_modify_validate()
	{
		f = document.formModify;

		if(f.titre.value.length==0)
		{
			alert("Veuillez entrer le titre de votre nouvel événement, merci");
			return ;
		}
		if((f.dayBegin.value.length==0) || (f.monthBegin.value.length==0) || (f.yearBegin.value.length==0))
		{
			alert("Veuillez compléter la Date de Début de votre nouvel événement, merci");
			return ;
		}
		if((f.dayEnd.value.length!=0) || (f.monthEnd.value.length!=0) || (f.yearEnd.value.length!=0))
		{
			if((f.dayEnd.value.length==0) || (f.monthEnd.value.length==0) || (f.yearEnd.value.length==0))
			{
				alert("Veuillez compléter la Date de Fin de votre nouvel événement, merci");
				return ;
			}
		}
		if((f.dayEnd.value.length!=0) && (f.monthEnd.value.length!=0) && (f.yearEnd.value.length!=0))
		{
			if(f.yearEnd.value<f.yearBegin.value)
			{
				alert("La Date de Fin doit être postérieure à la Date de Début, merci");
				return ;
			}
			else
			{
				if(f.yearEnd.value==f.yearBegin.value)
				{
					if(f.monthEnd.value<f.monthBegin.value)
					{
						alert("La Date de Fin doit être postérieure à la Date de Début, merci");
						return ;
					}
					else
					{
						if(f.monthEnd.value==f.monthBegin.value)
						{
							if(f.dayEnd.value<=f.dayBegin.value)
							{
								alert("La Date de Fin doit être postérieure à la Date de Début, merci");
								return ;
							}
						}
					}
				}
			}
		}
		if(f.description.value.length==0)
		{
			alert("Veuillez entrer la Description de votre nouvel événement, merci");
			return ;
		}

		f.submit()
		return true;
	}



	//-----------------------------------------------------------------------------
	// Urls administration files
	//-----------------------------------------------------------------------------

	function Urls_add_validate()
	{
		f = document.formAdd;

		if(f.titre.value.length==0)
		{
			alert("Veuillez entrer le Titre de votre lien sur le web, merci");
			return ;
		}

		if(f.url.value.length==0)
		{
			alert("Veuillez entrer l'URL de votre lien sur le web, merci");
			return ;
		}

		f.submit()
		return true;
	}

	function Urls_link(categorie, level0, level1, level2, level3, level4)
	{
		switch(categorie)
		{
			case "level0" :
				if(level0=="")
				{
					alert("Vous devez d'abord selectionner un Niveau 0");
					return;
				}
				break;

			case "level1" :
				if(level1=="")
				{
					alert("Vous devez d'abord selectionner un Niveau 1");
					return;
				}
				break;

			case "level2" :
				if(level2=="")
				{
					alert("Vous devez d'abord selectionner un Niveau 2");
					return;
				}
				break;

			case "level3" :
				if(level3=="")
				{
					alert("Vous devez d'abord selectionner un Niveau 3");
					return;
				}
				break;

			case "level4" :
				if(level4=="")
				{
					alert("Vous devez d'abord selectionner un Niveau 4");
					return;
				}
				break;
		}

		window.open('urls_link.php?categorie='+categorie+'&level0='+level0+'&level1='+level1+'&level2='+level2+'&level3='+level3+'&level4='+level4,'_top','width=520,height=500,scrollbars=yes,resizable=no');
	}

	function Urls_link_validate()
	{
		f = document.formLink;
		f.submit()
		return true;
	}

	function Urls_modify_validate()
	{
		f = document.formModify;

		if(f.titre.value.length==0)
		{
			alert("Veuillez saisir un Titre pour votre lien sur le web, merci");
			return ;
		}
/*
		if (f.titre.value.indexOf("£")>=0 || f.titre.value.indexOf("/")>=0 || f.titre.value.indexOf("\\")>=0 )
		{
			alert("Les caractères '£' et '/' et '\\' ne sont pas autorisés");
			return ;
		}
*/
		if(f.url.value.length==0)
		{
			alert("Veuillez saisir une URL pour votre lien sur le web, merci");
			return ;
		}

		f.submit()
		return true;
	}



//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// Backgrounds administration files
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------

	function Backgrounds_add_validate()
	{
		f = document.formAdd;

		if(f.titre.value.length==0)
		{
			alert("Veuillez entrer un Titre pour votre nouveau fond d'écran, merci");
			return ;
		}
		if(f.bgimage.value.length==0)
		{
			alert("Veuillez entrer le nom de l'Image pour votre nouveau fond d'écran, merci");
			return ;
		}
		if(f.bgcolor.value.length==0)
		{
			alert("Veuillez entrer le nom de la Couleur pour votre nouveau fond d'écran, merci");
			return ;
		}

		f.submit()
		return true;
	}

	function Backgrounds_upload_validate()
	{
		f = document.formAdd;

		if(f.fichier.value.length==0)
		{
			alert("Veuillez spécifier un fichier, merci");
			return ;
		}

		f.submit()
		return true;
	}

	function Icons_upload_validate()
	{
		f = document.formAdd;

		if(f.fichier.value.length==0)
		{
			alert("Veuillez spécifier un fichier, merci");
			return ;
		}

		f.submit()
		return true;
	}

	function Backgrounds_files_delete()
	{
		f = document.formDelete;

		if(f.filename.value.length==0)
		{
			alert("Veuillez sélectionner un fichier, merci");
			return ;
		}

		f.submit()
		return true;
	}

	function Icons_files_delete()
	{
		f = document.formDelete;

		if(f.filename.value.length==0)
		{
			alert("Veuillez sélectionner un fichier, merci");
			return ;
		}

		f.submit()
		return true;
	}

//-----------------------------------------------------------------------------

	function Backgrounds_modify_validate()
	{
		f = document.formModify;

		if(f.titre.value.length==0)
		{
			alert("Veuillez entrer un Titre pour votre fond d'écran, merci");
			return ;
		}

		f.submit()
		return true;
	}



//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// Filetypes administration files
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------

	function Fileextensions_add_validate()
	{
		f = document.formAdd;

		if(f.extension.value.length==0)
		{
			alert("Veuillez entrer le nom d'une Extension pour votre nouveau type de fichiers, merci");
			return ;
		}

		if(f.application.value.length==0)
		{
			alert("Veuillez entrer le nom d'une Application pour votre nouveau type de fichiers, merci");
			return ;
		}
		f.submit()
		return true;
	}

	function Fileextensions_modify_validate()
	{
		f = document.formModify;

		if(f.application.value.length==0)
		{
			alert("Veuillez entrer le nom d'une Application pour votre nouveau type de fichiers, merci");
			return ;
		}
		f.submit()
		return true;
	}









	function Language_add_validate()
	{
		f = document.formAdd;

		if(f.abbreviation.value.length==0)
		{
			alert("Veuillez entrer une abréviation pour cette langue, merci");
			return ;
		}

		if(f.nom.value.length==0)
		{
			alert("Veuillez entrer le nom pour cette nouvelle langue, merci");
			return ;
		}

		if(f.version.value.length==0)
		{
			alert("Veuillez entrer un titre de version pour cette nouvelle langue, merci");
			return ;
		}

		f.submit()
		return true;
	}

	function Language_modify_validate()
	{
		f = document.formModify;

		if(f.nom.value.length==0)
		{
			alert("Veuillez entrer le nom pour cette langue, merci");
			return ;
		}

		if(f.version.value.length==0)
		{
			alert("Veuillez entrer le titre de la version pour cette langue, merci");
			return ;
		}

		f.submit()
		return true;
	}










	function Contenttypes_add_validate()
	{
		f = document.formAdd;

		if(f.intitule.value.length==0)
		{
			alert("Veuillez entrer le nom d'une Extension pour votre nouveau type de fichiers, merci");
			return ;
		}

		if(f.description.value.length==0)
		{
			alert("Veuillez entrer le nom d'une Application pour votre nouveau type de fichiers, merci");
			return ;
		}
		f.submit()
		return true;
	}

	function Contenttypes_modify_validate()
	{
		f = document.formModify;

		if(f.description.value.length==0)
		{
			alert("Veuillez entrer le nom d'une Application pour votre type de fichiers, merci");
			return ;
		}

		f.submit()
		return true;
	}

	function Css_modify_validate()
	{
		f = document.formModify;

		if(f.contents.value.length==0)
		{
			alert("Le fichier ne peut pas être vide, merci");
			return ;
		}

		f.submit()
		return true;
	}

	function Fichiers_modify_validate()
	{
		f = document.formModify;

		if(f.contents.value.length==0)
		{
			alert("Le fichier ne peut pas être vide, merci");
			return ;
		}

		f.submit()
		return true;
	}

	function Fichiers_explorer_validate()
	{
		f = document.formExplorer;

		if(f.filenum.value == "")
		{
			alert("Veuillez sélectionner un fichier, merci");
			return ;
		}

		f.submit()
		return true;
	}

	function Index_modify_validate()
	{
		f = document.formModify;

		if(f.contents.value.length==0)
		{
			alert("Le fichier ne peut pas être vide, merci");
			return ;
		}

		f.submit()
		return true;
	}


	//-----------------------------------------------------------------------------
	// Helpforms administration files
	//-----------------------------------------------------------------------------

	function Helpforms_add_validate()
	{
		f = document.formAdd;

		if(f.name2.value.length==0)
		{
			alert("Veuillez entrer un Nom pour votre nouveau message d'aide, merci");
			return ;
		}

		if(f.context.value.length==0)
		{
			alert("Veuillez entrer un Contexte pour votre nouveau message d'aide, merci");
			return ;
		}

		if(f.description.value.length>8000)
		{
			alert("La Description de votre nouveau message d'aide ne peut contenir plus de 8000 caractères pour le moment, merci");
			return ;
		}

		f.submit()
		return true;
	}

	function Helpforms_modify_validate()
	{
		f = document.formModify;

		if(f.context.value.length==0)
		{
			alert("Veuillez entrer un Contexte pour votre nouveau message d'aide, merci");
			return ;
		}

		if(f.description.value.length>8000)
		{
			alert("La Description de votre nouveau message d'aide ne peut contenir plus de 8000 caractères pour le moment, merci");
			return ;
		}

		f.submit()
		return true;
	}


	//-----------------------------------------------------------------------------
	// Photos administration files
	//-----------------------------------------------------------------------------

	function Photos_add_validate()
	{
		f = document.formAdd;

		if(f.description.value.length==0)
		{
			alert("Veuillez entrer une brève Description de votre photo / image, merci");
			return ;
		}

		if(f.fichier.value.length==0)
		{
			alert("Veuillez sélectionner une image parmi vos répertoires personnels, merci");
			return ;
		}

		f.submit()
		return true;
	}

	function Photos_modify_validate()
	{
		f = document.formModify;

		if(f.description.value.length==0)
		{
			alert("Veuillez entrer une Description pour votre image/photo, merci");
			return ;
		}

		f.submit()
		return true;
	}

	function Photos_see(path,name)
	{
		window.open(path+'photos_see.php?selection='+name,'_blank','width=550,height=300,scrollbars=no,resizable=no');
	}


	//-----------------------------------------------------------------------------
	// Documents administration files
	//-----------------------------------------------------------------------------

	function Documents_add_validate(tYear,tMonth,tDay)
	{
		f = document.formAdd;

		if(f.titre.value.length==0)
		{
			alert("Veuillez saisir un Titre pour votre document, merci");
			return ;
		}
/*

		if(f.metadata.value.length==0)
		{
			alert("Veuillez saisir une description 'metadata' pour votre document, merci");
			return ;
		}

		if (f.titre.value.indexOf("£")>=0 || f.titre.value.indexOf("/")>=0 || f.titre.value.indexOf("\\")>=0 )
		{
			alert("Les caractères '£' et '/' et '\\' ne sont pas autorisés");
			return ;
		}

		if(f.fichier.value.length==0)
		{
			alert("Veuillez sélectionner un Fichier à joindre à l'aide du bouton 'Browse', merci");
			return ;
		}
		if((f.dayBegin.value.length==0) || (f.monthBegin.value.length==0) || (f.yearBegin.value.length==0))
		{
			alert("Veuillez compléter la Date d'apparition de votre document, merci");
			return ;
		}
		else
		{
			if(f.yearBegin.value<tYear)
			{
				alert("La Date d'apparition de votre document doit être postérieure à hier, merci");
				return ;
			}
			else
			{
				if(f.yearBegin.value==tYear)
				{
					if(f.monthBegin.value<tMonth)
					{
						alert("La Date d'apparition de votre document doit être postérieure à hier, merci");
						return ;
					}
					else
					{
						if(f.monthBegin.value==tMonth)
						{
							if(f.dayBegin.value<tDay)
							{
								alert("La Date d'apparition de votre document doit être postérieure à hier, merci");
								return ;
							}
						}
					}
				}
			}
		}

		if((f.dayEnd.value.length==0) || (f.monthEnd.value.length==0) || (f.yearEnd.value.length==0))
		{
			alert("Veuillez compléter la Date d'expiration de votre document, merci");
			return ;
		}

		if((f.dayEnd.value.length!=0) && (f.monthEnd.value.length!=0) && (f.yearEnd.value.length!=0))
		{
			if(f.yearEnd.value<f.yearBegin.value)
			{
				alert("La Date d'expiration de votre document doit être postérieure à la Date d'apparition, merci");
				return ;
			}
			else
			{
				if(f.yearEnd.value==f.yearBegin.value)
				{
					if(f.monthEnd.value<f.monthBegin.value)
					{
						alert("La Date d'expiration de votre document doit être postérieure à la Date d'apparition, merci");
						return ;
					}
					else
					{
						if(f.monthEnd.value==f.monthBegin.value)
						{
							if(f.dayEnd.value<=f.dayBegin.value)
							{
								alert("La Date d'expiration de votre document doit être postérieure à la Date d'apparition, merci");
								return ;
							}
						}
					}
				}
			}
		}
*/
		f.submit()
		return true;
	}

	function Documents_link(categorie, level0, level1, level2, level3, level4)
	{
		switch(categorie)
		{
			case "level0" :
				if(level0=="")
				{
					alert("Vous devez d'abord selectionner un Niveau 0");
					return;
				}
				break;

			case "level1" :
				if(level1=="")
				{
					alert("Vous devez d'abord selectionner un Niveau 1");
					return;
				}
				break;

			case "level2" :
				if(level2=="")
				{
					alert("Vous devez d'abord selectionner un Niveau 2");
					return;
				}
				break;

			case "level3" :
				if(level3=="")
				{
					alert("Vous devez d'abord selectionner un Niveau 3");
					return;
				}
				break;

			case "level4" :
				if(level4=="")
				{
					alert("Vous devez d'abord selectionner un Niveau 4");
					return;
				}
				break;
		}

		window.open('documents_link.php?categorie='+categorie+'&level0='+level0+'&level1='+level1+'&level2='+level2+'&level3='+level3+'&level4='+level4,'_top','width=520,height=500,scrollbars=yes,resizable=no');
	}

	function Documents_link_validate()
	{
		f = document.formLink;
		f.submit()
		return true;
	}

	function Documents_modify_validate_ident()
	{
		f = document.formModify;

		if(f.titre.value.length==0)
		{
			alert("Veuillez saisir un Titre pour votre document, merci");
			return ;
		}
/*
		if (f.titre.value.indexOf("£")>=0 || f.titre.value.indexOf("/")>=0 || f.titre.value.indexOf("\\")>=0 )
		{
			alert("Les caractères '£' et '/' et '\\' ne sont pas autorisés");
			return ;
		}

		if(f.yearEnd.value<f.yearBegin.value)
		{
			alert("La Date d'expiration de votre document doit être postérieure à la Date d'apparition, merci");
			return ;
		}
		else
		{
			if(f.yearEnd.value==f.yearBegin.value)
			{
				if(f.monthEnd.value<f.monthBegin.value)
				{
					alert("La Date d'expiration de votre document doit être postérieure à la Date d'apparition, merci");
					return ;
				}
				else
				{
					if(f.monthEnd.value==f.monthBegin.value)
					{
						if(f.dayEnd.value<=f.dayBegin.value)
						{
							alert("La Date d'expiration de votre document doit être postérieure à la Date d'apparition, merci");
							return ;
						}
					}
				}
			}
		}
*/
		f.submit()
		return true;
	}

	function Documents_modify_validate_file()
	{
		f = document.formModify;

		if(f.fichier.value.length==0)
		{
			alert("Veuillez sélectionner un Fichier à joindre à l'aide du bouton 'Browse', merci");
			return ;
		}

		f.submit()
		return true;
	}

	function Documents_see(path,name)
	{
		var fenetre = "" ;
		fenetre = window.open(path+'documents_see.php?selection='+name,'popdoc','target=_blank,width=550,height=300,scrollbars=no,resizable=no');
		fenetre.focus();
	}


	//-----------------------------------------------------------------------------
	// CSV Files administration files
	//-----------------------------------------------------------------------------

	function CSV_add_validate()
	{
		f = document.formAdd;

		if(f.csv_filename.value.length == 0)
		{
			alert("Veuillez sélectionner un Fichier CSV à joindre à l'aide du bouton 'Browse', merci");
			return ;
		}

		f.submit()
		return true;
	}

	function CSV_modify_validate()
	{
		f = document.formModify;

		f.submit()
		return true;
	}


	//-----------------------------------------------------------------------------
	// Structure administration files
	//-----------------------------------------------------------------------------

	function Structure(level0, level1, level2, level3, level4, lastlevel)
	{
		window.open('structure.php?level0='+level0+'&level1='+level1+'&level2='+level2+'&level3='+level3+'&level4='+level4+'&lastlevel='+lastlevel,'_top','width=750,height=300,scrollbars=no,resizable=no');
	}

	function Structure_add(categorie, level0, level1, level2, level3, level4)
	{
		window.open('structure_add.php?categorie='+categorie+'&level0='+level0+'&level1='+level1+'&level2='+level2+'&level3='+level3+'&level4='+level4,'_top','width=700,height=420,scrollbars=no,resizable=no');
	}

	function StructureLang_add_validate(cat)
	{
		f2 = document.formAdd;

		if(cat == 'level0')
			f = document.formAdd.new_level0;
		else if(cat == 'level1')
			f = document.formAdd.new_level1;
		else if(cat == 'level2')
			f = document.formAdd.new_level2;
		else if(cat == 'level3')
			f = document.formAdd.new_level3;
		else if(cat == 'level4')
			f = document.formAdd.new_level4;

		if (f.value.length==0)
		{
			alert("Veuillez entrer un Sujet pour le niveau, merci");
			return ;
		}

		if(f2.id_language.value.length==0)
		{
			alert("Veuillez sélectionner une langue, merci");
			return ;
		}
		f2.submit()
		return true;
	}

	function Structure_add_validate(cat)
	{
		f = document.formAdd;

		switch(cat)
		{
			case 'level0':

				if (f.new_level0.value.length==0)
				{
					alert("Veuillez entrer un Sujet de Niveau 0, merci");
					return ;
				}

				if (f.new_level0.value.indexOf("£")>=0 || f.new_level0.value.indexOf("/")>=0 || f.new_level0.value.indexOf("\\")>=0 )
				{
					alert("Les caractères '£' et '/' et '\\' ne sont pas autorisés");
					return ;
				}

				if (f.classe.value.length==0)
				{
					alert("Veuillez entrer un nom de Classe associée à ce Niveau 0, merci");
					return ;
				}

				if (f.ecart.value.length==0)
				{
					alert("Veuillez entrer une valeur (en pixels) pour l'écart avant ce Niveau 0, merci");
					return ;
				}

				if (f.padding_left.value.length==0)
				{
					alert("Veuillez entrer une valeur (en pixels) pour le parametre 'padding_left' de ce Niveau 0, merci");
					return ;
				}

				if (f.padding_right.value.length==0)
				{
					alert("Veuillez entrer une valeur (en pixels) pour le parametre 'padding_right' de ce Niveau 0, merci");
					return ;
				}

				if (f.padding_top.value.length==0)
				{
					alert("Veuillez entrer une valeur (en pixels) pour le parametre 'padding_top' de ce Niveau 0, merci");
					return ;
				}

				if (f.padding_bottom.value.length==0)
				{
					alert("Veuillez entrer une valeur (en pixels) pour le parametre 'padding_bottom' de ce Niveau 0, merci");
					return ;
				}

				if (f.text_align.value.length==0)
				{
					alert("Veuillez entrer une valeur pour le parametre 'text_align' de ce Niveau 0, merci");
					return ;
				}

				break;


			case 'level1':

				if (f.new_level1.value.length==0)
				{
					alert("Veuillez entrer un Sujet de Niveau 1, merci");
					return ;
				}

				if (f.new_level1.value.indexOf("£")>=0 || f.new_level1.value.indexOf("/")>=0 || f.new_level1.value.indexOf("\\")>=0 )
				{
					alert("Les caractères '£' et '/' et '\\' ne sont pas autorisés");
					return ;
				}

				break;


			case 'level2' :

				if (f.new_level2.value.length==0)
				{
					alert("Veuillez entrer un Sujet de Niveau 2, merci");
					return ;
				}

				if (f.new_level2.value.indexOf("£")>=0 || f.new_level2.value.indexOf("/")>=0 || f.new_level2.value.indexOf("\\")>=0 )
				{
					alert("Les caractères '£' et '/' et '\\' ne sont pas autorisés");
					return ;
				}

				break;


			case 'level3' :

				if (f.new_level3.value.length==0)
				{
					alert("Veuillez entrer un Sujet de Niveau 3, merci");
					return ;
				}

				if (f.new_level3.value.indexOf("£")>=0 || f.new_level3.value.indexOf("/")>=0 || f.new_level3.value.indexOf("\\")>=0 )
				{
					alert("Les caractères '£' et '/' et '\\' ne sont pas autorisés");
					return ;
				}

				break;


			case 'level4' :

				if (f.new_level4.value.length==0)
				{
					alert("Veuillez entrer un Sujet de Niveau 4, merci");
					return ;
				}

				if (f.new_level3.value.indexOf("£")>=0 || f.new_level3.value.indexOf("/")>=0 || f.new_level3.value.indexOf("\\")>=0 )
				{
					alert("Les caractères '£' et '/' et '\\' ne sont pas autorisés");
					return ;
				}

				break;
		}

		if(f.contenttype.value.length==0)
		{
			alert("Veuillez sélectionner un Type de contenu, merci");
			return ;
		}

		if(f.new_background.value.length==0)
		{
			alert("Veuillez sélectionner un Fond d'écran, merci");
			return ;
		}

		if(f.new_order.value.length==0)
		{
			alert("Veuillez sélectionner un Ordre d'apparition, merci");
			return ;
		}

		if(f.id_user.value.length==0)
		{
			alert("Veuillez sélectionner un Administrateur pour votre nouvelle structure, merci");
			return ;
		}

		f.submit()
		return true;
	}

	function Structure_delete(categorie, level0, level1, level2, level3, level4)
	{
		switch(categorie)
		{
			case "level0" :
				if(level0=="")
				{
					alert("Vous devez d'abord selectionner un Niveau 0, merci.");
					return;
				}
				break;

			case "level1" :
				if(level1=="")
				{
					alert("Vous devez d'abord selectionner un Niveau 1, merci.");
					return;
				}
				break;

			case "level2" :
				if(level2=="")
				{
					alert("Vous devez d'abord selectionner un Niveau 2, merci.");
					return;
				}
				break;

			case "level3" :
				if(level3=="")
				{
					alert("Vous devez d'abord selectionner un Niveau 3, merci.");
					return;
				}
				break;

			case "level4" :
				if(level4=="")
				{
					alert("Vous devez d'abord selectionner un Niveau 4, merci.");
					return;
				}
				break;
		}

		window.open('structure_delete.php?categorie='+categorie+'&level0='+level0+'&level1='+level1+'&level2='+level2+'&level3='+level3+'&level4='+level4,'_top','width=700,height=270,scrollbars=no,resizable=no');
	}

	function Structure_delete_validate()
	{
		f = document.formDelete;
		f.submit()
		return true;
	}

	function Structure_modify(categorie, level0, level1, level2, level3, level4)
	{
		switch(categorie)
		{
			case "level0" :
				if(level0=="")
				{
					alert("Vous devez d'abord selectionner un Niveau 0");
					return;
				}
				break;

			case "level1" :
				if(level1=="")
				{
					alert("Vous devez d'abord selectionner un Niveau 1");
					return;
				}
				break;

			case "level2" :
				if(level2=="")
				{
					alert("Vous devez d'abord selectionner un Niveau 2");
					return;
				}
				break;

			case "level3" :
				if(level3=="")
				{
					alert("Vous devez d'abord selectionner un Niveau 3");
					return;
				}
				break;

			case "level4" :
				if(level4=="")
				{
					alert("Vous devez d'abord selectionner un Niveau 4");
					return;
				}
				break;
		}

		window.open('structure_modify.php?categorie='+categorie+'&level0='+level0+'&level1='+level1+'&level2='+level2+'&level3='+level3+'&level4='+level4,'_top','width=700,height=390,scrollbars=no,resizable=no');
	}

	function Structure_modify_validate(cat)
	{
		f = document.formModify;

		switch(cat)
		{
			case '0':
				if (f.new_level0.value.length==0)
				{
					alert("Veuillez entrer un Sujet de Niveau 0, merci");
					return ;
				}

				if (f.new_level0.value.indexOf("£")>=0 || f.new_level0.value.indexOf("/")>=0 || f.new_level0.value.indexOf("\\")>=0 )
				{
					alert("Les caractères '£' et '/' et '\\' ne sont pas autorisés");
					return ;
				}

				if (f.classe.value.length == 0)
				{
					alert("Veuillez entrer un nom de Classe associé à ce Niveau 0, merci");
					return ;
				}

				if (f.ecart.value.length == 0)
				{
					alert("Veuillez entrer une valeur (en pixels) pour l'écart avant ce Niveau 0, merci");
					return ;
				}

				break;

			case '1':
				if (f.new_level1.value.length==0)
				{
					alert("Veuillez entrer un Sujet de Niveau 1, merci");
					return ;
				}

				if (f.new_level1.value.indexOf("£")>=0 || f.new_level1.value.indexOf("/")>=0 || f.new_level1.value.indexOf("\\")>=0 )
				{
					alert("Les caractères '£' et '/' et '\\' ne sont pas autorisés");
					return ;
				}

				break;

			case '2' :
				if (f.new_level2.value.length==0)
				{
					alert("Veuillez entrer un Sujet de Niveau 2, merci");
					return ;
				}

				if (f.new_level2.value.indexOf("£")>=0 || f.new_level2.value.indexOf("/")>=0 || f.new_level2.value.indexOf("\\")>=0 )
				{
					alert("Les caractères '£' et '/' et '\\' ne sont pas autorisés");
					return ;
				}

				break;

			case '3':
				if (f.new_level3.value.length==0)
				{
					alert("Veuillez entrer un Sujet de Niveau 3, merci");
					return ;
				}

				if (f.new_level3.value.indexOf("£")>=0 || f.new_level3.value.indexOf("/")>=0 || f.new_level3.value.indexOf("\\")>=0 )
				{
					alert("Les caractères '£' et '/' et '\\' ne sont pas autorisés");
					return ;
				}

				break;

			case '4' :
				if (f.new_level4.value.length==0)
				{
					alert("Veuillez entrer un Sujet de Niveau 4, merci");
					return ;
				}

				if (f.new_level4.value.indexOf("£")>=0 || f.new_level4.value.indexOf("/")>=0 || f.new_level4.value.indexOf("\\")>=0 )
				{
					alert("Les caractères '£' et '/' et '\\' ne sont pas autorisés");
					return ;
				}

				break;
		}

		f.submit()
		return true;
	}


	//-----------------------------------------------------------------------------
	// Content administration files
	//-----------------------------------------------------------------------------

	function Content_link(categorie, level0, level1, level2, level3, level4)
	{
		switch(categorie)
		{
			case "level0" :
				if(level0=="")
				{
					alert("Vous devez d'abord selectionner un Niveau 0");
					return;
				}
				break;

			case "level1" :
				if(level1=="")
				{
					alert("Vous devez d'abord selectionner un Niveau 1");
					return;
				}
				break;

			case "level2" :
				if(level2=="")
				{
					alert("Vous devez d'abord selectionner un Niveau 2");
					return;
				}
				break;

			case "level3" :
				if(level3=="")
				{
					alert("Vous devez d'abord selectionner un Niveau 3");
					return;
				}
				break;

			case "level4" :
				if(level4=="")
				{
					alert("Vous devez d'abord selectionner un Niveau 4");
					return;
				}
				break;
		}

		window.open('content_link.php?categorie='+categorie+'&level0='+level0+'&level1='+level1+'&level2='+level2+'&level3='+level3+'&level4='+level4,'_top','width=520,height=600,scrollbars=yes,resizable=no');
	}

	function Content_link_Validate()
	{
		f = document.formLink;

		f.submit()
		return true;
	}

	function ContentTypes_see(path, name)
	{
		window.open(path+'content_types.php?selection='+name,'_blank','width=750,height=465,scrollbars=no,resizable=no');
	}
