// V?rification de l'adresse mail
function verifemail(email,limit)
{
 for (var j=1 ; j<limit ; j++)
 {
  if (email.charAt(j)=='@')
  {
   if (j<(limit-4))
   {
    // Ici on regarde si il y a bien 4 caract?re apr?s le @
    for (var k=j ; k<(limit-2) ; k++)
    {
     // On ouvre une seconde boucle pour
     if (email.charAt(k)=='.') return true;
    }
   }
  }
 }
 return false;
}

function verif_newslettersend()
{
 if (!verifemail(document.newsletterform.email.value,document.newsletterform.email.value.length))
 {
 	alert("Format de l'e-mail incorrect!");
 	return false;
 }
 else document.newsletterform.submit();
}

function newsletter()
{
 if (document.formnewsletter.email.value == "")
 {
  alert("Indiquez votre email.\nMerci.")
 }
 else
 {
  if (verifemail(document.formnewsletter.email.value,document.formnewsletter.email.value.length)) document.formnewsletter.submit();
  else alert("Adresse email incorrecte.\nVeuillez corriger.");
 }
}

function newsletterdesins()
{
 if (document.desinsform.email.value == "")
 {
  alert("Indiquez votre email.\nMerci.")
 }
 else
 {
  if (verifemail(document.desinsform.email.value,document.desinsform.email.value.length)) document.desinsform.submit();
  else alert("Adresse email incorrecte.\nVeuillez corriger.");
 }
}

// Formulaire message d'accueil
function verifaccueil()
{
 if (document.formname.texte.value=="") alert("Compl?tez les champs obligatoires en rouge SVP.");
 else document.formname.submit();
}

// Formulaire ACTUALITE
function verifactu()
{
 if ((document.actualiteform.titre.value == "")||(document.actualiteform.actualite.value == ""))
 {
  alert("Complétez les champs obligatoires en rouge SVP.");
 }
 else document.actualiteform.submit();
}

// Visualisation des images en taille maximale compte tenu de la d?finition de l'?cran
function visupics(PIX,WP,HP)
{
 var WS = screen.width-100;
 var HS = screen.height-100;

//window.open("visupics.php?photo="+PIX+"&wp="+WP+"&hp="+HP,"","toolbar=0,location=0,directories=0,menuBar=0,scrollbars=yes,resizable=yes,width="+WP+",height="+HP+",top=50,left=200");
 
 if ((WP<=WS)&&(HP<=HS)) window.open("visupics.php?photo="+PIX+"&wp="+WP+"&hp="+HP,"","toolbar=0,location=0,directories=0,menuBar=0,scrollbars=no,resizable=yes,width="+WP+",height="+HP+",top=50,left=200");
 else if ((WP>WS)&&(HP<=HS)) window.open("visupics.php?photo="+PIX+"&wp="+WS+"&hp="+Math.floor(HP*WS/WP),"","toolbar=0,location=0,directories=0,menuBar=0,scrollbars=no,resisable=yes,width="+WS+",height="+Math.floor(HP*WS/WP)+",top=50,left=200");
 else if ((WP<=WS)&&(HP>HS)) window.open("visupics.php?photo="+PIX+"&wp="+Math.floor(WP*HS/HP)+"&hp="+HS,"","toolbar=0,location=0,directories=0,menuBar=0,scrollbars=no,resisable=yes,width="+Math.floor(WP*HS/HP)+",height="+HS+",top=50,left=200");
 else
 {
  if (Math.floor(HP*WS/WP)<HS) window.open("visupics.php?photo="+PIX+"&wp="+WS+"&hp="+Math.floor(HP*WS/WP),"","toolbar=0,location=0,directories=0,menuBar=0,scrollbars=no,resisable=yes,width="+WS+",height="+Math.floor(HP*WS/WP)+",top=50,left=200");
  else window.open("visupics.php?photo="+PIX+"&wp="+Math.floor(WP*HS/HP)+"&hp="+HS,"","toolbar=0,location=0,directories=0,menuBar=0,scrollbars=no,resisable=yes,width="+Math.floor(WP*HS/HP)+",height="+HS+",top=50,left=200");
 }

}

// Formulaire RESULTAT
function verifresult()
{
 if ((document.formname.match.value == "")||(document.formname.descriptif.value == "")
      ||(document.formname.suivant.value == ""))
 {
  alert("Compl?tez les champs obligatoires en rouge SVP.");
 }
 else document.formname.submit();
}

function verifdocs()
{
 if (document.formname.type.value == "")
 {
  alert("Veuillez choisir un type valide parmis les sous-catégories.");
 }
 else if ((document.formname.titre.value == "")||(document.formname.document.value == ""))
 {
  alert("Complétez tous les champs obligatoires en rouge SVP.");
 }
 else document.formname.submit();
}

function voiresultat(id)
{
 if (document.getElementById(id).style.display == "none") document.getElementById(id).style.display = "inline";
 else document.getElementById(id).style.display = "none";
}
function veriforum()
{
  erreur = ""
  if (document.poste.pseudo.value == "")
  {
   erreur += "Vous n'avez pas indiqu? de pseudo.\n"
  }
  if (document.poste.sujet.value == "")
  {
    erreur += "Vous n'avez pas indiqu? de sujet.\n"
  }
  if (document.poste.mess.value == "")
  {
    erreur += "Vous n'avez pas indiqu? de message.\n"
  }
  if (erreur == "")
  {
    document.poste.submit()
  }
  else
  {
    alert(erreur + "Corrigez vos saisies, svp!")
  }
}

// Insertion des smileys
function insertSmiley(src)
{
    	var mess = "<img src="+src+">";
    	var messold = document.actualiteform.actualite.value;
    	document.actualiteform.actualite.value = messold+mess;
    	document.actualiteform.actualite.focus();
}

// GALERIES
// Valider la cat?gorie
function galeries_validcat()
{
 if (document.formname.cat.value=="") document.formname.cat.options.selected = "";
 else document.location = "?menu=gal&cat="+document.formname.cat.value;
}

// Affichage des photos
function visupix(filename,w,h,desc)
{
  var image = "<img src='photos/"+filename+"' border=2";
 
  if (h>w) {
  
  	if (h>280) {
  		image += " height=280";
  		wtemp = (280*w)/h;
  		image += " width="+wtemp+">";
  	} else {
  		image += " width="+w+" height="+h+">";
  	}
  	
  } else {
  	
  	if (w>400) {
  		htemp = (400*h)/w;
  		if (htemp >280) {
  			image += " height=280";
  			wtemp = (280*400)/htemp;
  			image += " width="+wtemp+">";
  		} else {
  			image += " width=400 height="+htemp+">";
  		}
  	} else {
  		if (h>280) {
  			image += " height=280";
  			wtemp = (280*w)/h;
  			image += " width="+wtemp+">";
  		} else {
  			image += " width="+w+" height="+h+">";
  		}
  	}
  
  }
  
  //Affichage de la photo avec le lien vers la visualisation en taille réelle
  var idpix = document.getElementById("pix");
  idpix.innerHTML = "<a href=\"javascript:visupics('"+filename+"','"+w+"','"+h+"')\">"+image+"</a>";
  
  //Affichage de la description de la photo
  var idpixdesc = document.getElementById("pixdesc");
  //idpixdesc.innerHTML = "<font family=\"Comic Sans MS\" size=\"1\"><i>Cliquer sur la photo pour l'agrandir...</i></font><br><br><font size=\"2\"><b>"+desc+"</b></font>";
  idpixdesc.innerHTML = "<table border=0 cellpadding=0 cellspacing=0 width=\"100%\"><tr><td height=\"30\" class=\"protokitextepetit\" align=\"center\">Cliquer sur la photo pour l'agrandir...</td></tr><tr><td class=\"protokitexte\" align=\"center\">"+desc+"</td></tr></table>";
}

// V?rification de la categorie GALERIE
function verifcat(cat)
{
 for (i=0;i<cat.length;i++)
 {
  switch(cat.charAt(i))
  {
   case "a" : break;
   case "b" : break;
   case "c" : break;
   case "d" : break;
   case "e" : break;
   case "f" : break;
   case "g" : break;
   case "h" : break;
   case "i" : break;
   case "j" : break;
   case "k" : break;
   case "l" : break;
   case "m" : break;
   case "n" : break;
   case "o" : break;
   case "p" : break;
   case "q" : break;
   case "r" : break;
   case "s" : break;
   case "t" : break;
   case "u" : break;
   case "v" : break;
   case "w" : break;
   case "x" : break;
   case "y" : break;
   case "z" : break;
   case "A" : break;
   case "B" : break;
   case "C" : break;
   case "D" : break;
   case "E" : break;
   case "F" : break;
   case "G" : break;
   case "H" : break;
   case "I" : break;
   case "J" : break;
   case "K" : break;
   case "L" : break;
   case "M" : break;
   case "N" : break;
   case "O" : break;
   case "P" : break;
   case "Q" : break;
   case "R" : break;
   case "S" : break;
   case "T" : break;
   case "U" : break;
   case "V" : break;
   case "W" : break;
   case "X" : break;
   case "Y" : break;
   case "Z" : break;
   case "0" : break;
   case "1" : break;
   case "2" : break;
   case "3" : break;
   case "4" : break;
   case "5" : break;
   case "6" : break;
   case "7" : break;
   case "8" : break;
   case "9" : break;
   case "_" : break;
   default : return false;
  }
 }
 return true;
}

function verifso6son()
{
 if (document.so6sonform.login.value == "")
 {
  alert('Indiquer votre login.');
 }
 else if (document.so6sonform.pwd.value == "")
 {
  alert('Indiquer votre mot de passe.');
 }
 else if (((document.so6sonform.pwdnew.value != "")||(document.so6sonform.pwdnewconfirm.value != ""))&&(!(verifcat(document.so6sonform.pwdnew.value)&&verifcat(document.so6sonform.pwdnewconfirm.value))||(document.so6sonform.pwdnew.value!=document.so6sonform.pwdnewconfirm.value)))
 {
    alert("Nouveau mot de passe incorrect. Corrigez, svp!")
 }
 else if ((document.so6sonform.email.value != "")&&(!verifemail(document.so6sonform.email.value,document.so6sonform.email.value.length)))
 {
  alert('Corrigez le format de votre E-mail.');
 }
 else document.so6sonform.submit();
}

function verifmail()
{
   document.membresmail.submit()
}

// identification administrateur
function verifadmin()
{
  erreur = ""
  if (document.adminform.login.value == "")
  {
   erreur += "Vous n'avez pas indiqu? le login.\n"
  }
    if (document.adminform.pwd.value == "")
  {
   erreur += "Vous n'avez pas indiqu? le mot de passe.\n"
  }
  if (erreur == "")
  {
    document.adminform.submit()
  }
  else
  {
    alert(erreur + "Corrigez vos saisies, svp!")
  }
}

function verifmembremodif()
{
  if (document.formname.oldpwd.value=="") alert("Completez les champs obligatoires en rouge SVP.");
  else if ((document.formname.nom.value=="")&&(document.formname.prenom.value=="")&&(document.formname.email.value=="")&&(document.formname.pwd.value=="")&&(document.formname.pwdbis.value=="")&&(document.formname.pix.value=="")) alert("Indiquez au moins une coordonnee a modifier!");
  else if (document.formname.pwd.value!=document.formname.pwdbis.value) alert("Saisissez correctement les 2 champs correspondant au mot de passe SVP.");
  else if (document.formname.oldpwd.value == document.formname.pwd.value) alert("Inutile de saisir un nouveau mot de passe si vous ne le modifiez pas.");
  else if (!(verifcat(document.formname.pwd.value))) alert("ATTENTION : N'utilisez que les chiffres, lettres et le caractere underscore _ pour le mot de passe!");
  else document.formname.submit()
}

// Admin Creer membre
function creermembre()
{
 if ((document.formname.nom.value=="")||(document.formname.prenom.value==""))
 {
   alert("Complétez les champs obligatoires en rouge SVP.")
 }
 else document.formname.submit()
}

// Admin Creer membre
function creerpersonne()
{
 if ((document.formname.nom.value=="")||(document.formname.prenom.value=="")||(document.formname.fonction.value==""))
 {
   alert("Compl?tez les champs obligatoires en rouge SVP.")
 }
 else document.formname.submit()
}

function verifdroits()
{
  if (document.formname.login.value=="") alert("S?lectionnez un membre");
  else document.formname.submit();
}

// Formulaire PALMARES
function verifpalm()
{
 if (document.formname.contenu.value == "")
 {
  alert("Compl?tez les champs obligatoires en rouge SVP.");
 }
 else document.formname.submit();
}

// Formulaire CLUBS
function verifclubs()
{
 if ((document.formname.nom.value == "")||(document.formname.adresse.value == ""))
 {
  alert("Complétez les champs obligatoires en rouge SVP.");
 }
 else document.formname.submit();
}

function modifhist()
{
  if ((document.formname.presentation.value == "")||(document.formname.nom1.value == "")
      ||(document.formname.prenom1.value == "")||(document.formname.fonction1.value == "")
      ||(document.formname.nom2.value == "")||(document.formname.prenom2.value == "")
      ||(document.formname.fonction2.value == "")||(document.formname.structure.value == ""))
  {
    alert("Compl?tez les champs obligatoires en rouge SVP.")
  }
  else document.formname.submit()
}

function verifmatchs()
{
  if ((document.formname.competition.value == "")||(document.formname.journee.value == "")
      ||(document.formname.equipe_domicile.value == "")||(document.formname.equipe_exterieur.value == ""))
  {
    alert("Complétez les champs obligatoires en rouge SVP.")
  }
  else document.formname.submit()
}

function verifequipe()
{
  if ((document.formname.categorie.value == "")||(document.formname.numequipe.value == "")
      ||(document.formname.niveau.value == "")||(document.formname.responsable.value == "")
      ||(document.formname.effectif.value == ""))
  {
    alert("Compl?tez les champs obligatoires en rouge SVP.")
  }
  else document.formname.submit()
}

function verifevent()
{
  if ((document.formname.titre.value == "")||(document.formname.description.value == ""))
  {
    alert("Complétez les champs obligatoires en rouge SVP.")
  }
  else document.formname.submit()
}

function admincreercomitedir()
{
 if ((document.creercomitedir.nom.value=="")||(document.creercomitedir.prenom.value=="")
      ||(document.creercomitedir.fonction.value==""))
 {
    alert("Compl?tez les champs obligatoires en rouge SVP.")
 }
 else document.creercomitedir.submit()
}

function admincreerdir()
{
 if ((document.creerdir.nom.value=="")||(document.creerdir.prenom.value=="")
      ||(document.creerdir.fonction.value==""))
 {
    alert("Compl?tez les champs obligatoires en rouge SVP.")
 }
 else document.creerdir.submit()
}

function admincreercommtournois()
{
 if ((document.creercommtournois.nom.value=="")||(document.creercommtournois.prenom.value=="")
      ||(document.creercommtournois.fonction.value==""))
 {
    alert("Compl?tez les champs obligatoires en rouge SVP.")
 }
 else document.creercommtournois.submit()
}

function admincreercommjeunes()
{
 if ((document.creercommjeunes.nom.value=="")||(document.creercommjeunes.prenom.value=="")
      ||(document.creercommjeunes.fonction.value==""))
 {
    alert("Compl?tez les champs obligatoires en rouge SVP.")
 }
 else document.creercommjeunes.submit()
}

function admincreercommpartenaires()
{
 if ((document.creercommpartenaires.nom.value=="")||(document.creercommpartenaires.prenom.value=="")
      ||(document.creercommpartenaires.fonction.value==""))
 {
    alert("Compl?tez les champs obligatoires en rouge SVP.")
 }
 else document.creercommpartenaires.submit()
}

function admincreerresponsables()
{
 if ((document.creerresponsables.nom.value=="")||(document.creerresponsables.prenom.value=="")
      ||(document.creerresponsables.fonction.value==""))
 {
    alert("Compl?tez les champs obligatoires en rouge SVP.")
 }
 else document.creerresponsables.submit()
}

function admincreerarb()
{
 if ((document.creerarb.nom.value=="")||(document.creerarb.prenom.value=="")
       ||(document.creerarb.fonction.value==""))
 {
    alert("Compl?tez les champs obligatoires en rouge SVP.")
 }
 else document.creerarb.submit()
}

function creerpart()
{
 if ((document.formname.nom.value=="")||(document.formname.logo.value==""))
 {
    alert("Compl?tez les champs obligatoires en rouge SVP.")
 }
 else document.formname.submit()
}

function creerpart2()
{
 if (document.formname.nom.value=="")
 {
    alert("Compl?tez les champs obligatoires en rouge SVP.")
 }
 else document.formname.submit()
}

function creereduc()
{
   if ((document.formname.nom.value=="")||(document.formname.prenom.value=="")
        ||(document.formname.categorie.value=="")||(document.formname.numequipe.value==""))
 {
    alert("Compl?tez les champs obligatoires en rouge SVP.")
 }
 else document.formname.submit()
}

function creerclubs()
{
   if ((document.formname.nom.value=="")||(document.formname.adresse.value==""))
 {
    alert("Complétez les champs obligatoires en rouge SVP.")
 }
 else document.formname.submit()
}

function verifmodifpart(liste,maximum)
{
  $compt = 0;
  $sel = 0;
  for (i = 0; i < liste.length; i++)
  {
    if(liste[i].checked == true)
    {
      $compt = $compt+1;
      $sel = i;
    }
  }
  if ($compt == 0)
  {
    alert("Vous devez rentrer un sponsor.\n")
  }
  else if ($compt != 1)
  {
    alert("Il ne peut y avoir qu'un sponsor de la semaine.\n")
  }
  else
  {
    return $sel;
    document.modifpart.submit();
  }
}

function verifmodif()
{
  document.location=document.modifpart.nompart.options[document.modifpart.nompart.selectedIndex].value;
}

function getAdresse()
{
var liste=document.modifpart.nompart.options[document.modifpart.nompart.selectedIndex].value;
var adresse=("adminmodifpartdb.php?idpart="+liste);
alert("bonjour");
//return adresse;
document.location=adresse;

}

function getRandomNum(lbound,ubound)
{
  return (Math.floor(Math.random()*(ubound - lbound)) + lbound);
}

function getRandomChar()
{
  var numberChars = "0123456789";
  var lowerChars = "abcdefghijklmnopqrstuvwxyz";
  var charSet = numberChars + lowerChars;
  return charSet.charAt(getRandomNum(0,charSet.length));
}

function getPassword(longueur)
{
  var pwd = "";
  for (var ind = 0; ind < longueur; ++ind)
  {
    pwd = pwd + getRandomChar();
  }
  return pwd;
}

function verifprofil()
{
 if ((document.formname.nbinit.value=="")||(document.formname.nb5ans.value=="")||(document.formname.nbdeb.value=="")
        ||(document.formname.nbpous.value=="")||(document.formname.nbbenj.value=="")||(document.formname.nb13ans.value=="")
        ||(document.formname.nb15ans.value=="")||(document.formname.nb18ans.value=="")||(document.formname.nbsen.value=="")
        ||(document.formname.nbvet.value==""))
 {
    alert("Compl?ter le nombre d'?quipes de toutes les cat?gories.\n")
 }
 else
 {
   document.formname.submit();
 }
}

// Validit? du formulaire
function verifgalerie()
{
 erreur = "";
 // On v?rifie la validit? de la cat?gorie
 if ((document.formname.cat.value != "")&&(!verifcat(document.formname.cat.value)))
 {
  erreur += "Format de la cat?gorie invalide.\n";
 }
 if (
 ((document.formname.cat.value == "")&&(document.formname.catselect.value == ""))
 ||
 ((document.formname.photo1.value == "")&&(document.formname.photo2.value == "")&&(document.formname.photo3.value == "")&&(document.formname.photo4.value == "")&&(document.formname.photo5.value == ""))
 )
 {
  erreur += "Compl?tez les champs obligatoires en rouge SVP.";
 }
 if (erreur != "") alert(erreur);
 else document.formname.submit();
}

function verifcalendrier(jour)
{
 if (document.formname.titre.value=="") alert("Compl?tez les champs obligatoires en ROUGE.\nMerci.");
 else if ((document.formname.jour.value == "")||(document.formname.mois.value=="")||(document.formname.annee.value=="")) alert("Indiquez le jour concerné.\nMerci.");
 //else if (jour > document.formname.annee.value+document.formname.mois.value+document.formname.jour.value) alert("Indiquez un jour de l'année ? venir\nMerci");
 else if (document.formname.doc.value != "")
      {
       if ((document.formname.doc.value.substr((document.formname.doc.value.length - 3),3) == 'doc')||
            (document.formname.doc.value.substr((document.formname.doc.value.length - 3),3) == 'xls')||
            (document.formname.doc.value.substr((document.formname.doc.value.length - 3),3) == 'pdf')||
            (document.formname.doc.value.substr((document.formname.doc.value.length - 3),3) == 'gif')||
            (document.formname.doc.value.substr((document.formname.doc.value.length - 3),3) == 'jpg')||
            (document.formname.doc.value.substr((document.formname.doc.value.length - 4),4) == 'jpeg')||
            (document.formname.doc.value.substr((document.formname.doc.value.length - 3),3) == 'ppt')||
            (document.formname.doc.value.substr((document.formname.doc.value.length - 3),3) == 'pps'))
         document.formname.submit();
       else alert("le format du document n'est pas conforme.\n");
      }
 else document.formname.submit();
}

function verifcalendrier_rdvhebdo(jour)
{
 if (document.formname.titre.value=="") alert("Complétez les champs obligatoires en ROUGE.\nMerci.");
 else if ((document.formname.jour0.value == "")||(document.formname.mois0.value=="")||(document.formname.annee0.value=="")) alert("Indiquez le premier jour concerné.\nMerci.");
 else if ((document.formname.jour1.value == "")||(document.formname.mois1.value=="")||(document.formname.annee1.value=="")) alert("Indiquez la date limite.\nMerci.");
 //else if (jour > document.formname.annee0.value+document.formname.mois0.value+document.formname.jour0.value) alert("Indiquez un jour de l'année ? venir\nMerci");
 else if (document.formname.doc.value != "")
      {
       if ((document.formname.doc.value.substr((document.formname.doc.value.length - 3),3) == 'doc')||
            (document.formname.doc.value.substr((document.formname.doc.value.length - 3),3) == 'xls')||
            (document.formname.doc.value.substr((document.formname.doc.value.length - 3),3) == 'pdf')||
            (document.formname.doc.value.substr((document.formname.doc.value.length - 3),3) == 'gif')||
            (document.formname.doc.value.substr((document.formname.doc.value.length - 3),3) == 'jpg')||
            (document.formname.doc.value.substr((document.formname.doc.value.length - 4),4) == 'jpeg')||
            (document.formname.doc.value.substr((document.formname.doc.value.length - 3),3) == 'ppt')||
            (document.formname.doc.value.substr((document.formname.doc.value.length - 3),3) == 'pps'))
         document.formname.submit();
       else alert("le format du document n'est pas conforme.\n");
      }
 else document.formname.submit();
}

function verifcalendrier2(jour)
{
 if (document.formname.titre.value=="") alert("Compl?tez les champs obligatoires en ROUGE.\nMerci.");
 else if ((document.formname.jour.value == "")||(document.formname.mois.value=="")||(document.formname.annee.value=="")) alert("Indiquez le jour concern?.\nMerci.");
 //else if (jour > document.formname.annee.value+document.formname.mois.value+document.formname.jour.value) alert("Indiquez un jour de l'ann?e ? venir\nMerci");
 else document.formname.submit();
}

function adminvalidcat(id)
{
 document.location = "adminphotodel.php?id="+id+"&cat="+document.effacerphoto.cat.value;
}

function adminvalidactu(id)
{
 document.location = "adminactumodif.php?id="+id+"&idactu="+document.actualiteform.actu.value;
}

function adminvalidmemb(id)
{
 document.location = "adminmembmodif.php?id="+id+"&login="+document.creermemb.memb.value;
}

function adminvalideduc(id)
{
 document.location = "admineducmodif.php?id="+id+"&iddir="+document.creereduc.educ.value;
}

function adminvalidequipe(id)
{
 document.location = "adminequipemodif.php?id="+id+"&idequipe="+document.creerequipe.equipe.value;
}

function adminvalideven(id)
{
 document.location = "adminevenmodif.php?id="+id+"&idev="+document.creerev.even.value;
}

function adminvalidresult(id)
{
 document.location = "adminresultmodif.php?id="+id+"&idresult="+document.resultatform.result.value;
}

function adminvalidpart(id)
{
 document.location = "adminpartmodif.php?id="+id+"&idpart="+document.creerpart.part.value;
}

function adminvalidpalm(id)
{
 document.location = "adminpalmmodif.php?id="+id+"&idpalm="+document.palmform.palm.value;
}

function getCalendrier()
{
 window.open('calendrier/calendrierview.php','_blank','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=0,width=900,height=550');
}

function getCalendrier(annee)
{
 window.open('calendrier/calendrierview.php?annee='+annee,'_blank','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=0,width=900,height=570,top=50,left=70');
}

function validmodif(id)
{
 document.location = "adminmenu.php?menu=actu&part=Modifier2&idactu="+document.formname.idactu.value+"&id="+id;
}

function validmodifmemb(id)
{
 document.location = "membmenu.php?menu=actu&part=Modifier2&idactu="+document.formname.idactu.value+"&id="+id;
}

function validmodifpers(pers,ident,id)
{
 document.location = "adminmenu.php?menu="+pers+"&part=Modifier2&"+ident+"="+document.formname.identif.value+"&id="+id;
}

function validmodifpersmemb(pers,ident,id)
{
 document.location = "membmenu.php?menu="+pers+"&part=Modifier2&"+ident+"="+document.formname.identif.value+"&id="+id;
}

function validmodifclubs(clubs,idclubs,id)
{
 document.location = "adminmenu.php?menu="+clubs+"&part=Modifier2&"+idclubs+"="+document.formname.idclubs.value+"&id="+id;
}

function validmodifclubsmemb(clubs,idclubs,id)
{
 document.location = "membmenu.php?menu="+clubs+"&part=Modifier2&"+idclubs+"="+document.formname.idclubs.value+"&id="+id;
}

function validmodifmembpers(pers,ident,id)
{
 document.location = "membmenu.php?menu="+pers+"&part=Modifier2&"+ident+"="+document.formname.identif.value+"&id="+id;
}

function validdroit(pers,ident,id)
{
 document.location = "adminmenu.php?menu="+pers+"&part=Droits2&"+ident+"="+document.formname.login.value+"&id="+id;
}

function verifmodifpartsem()
{
  document.location=document.formname.nompart.options[document.formname.nompart.selectedIndex].value;
}

function validcatphoto(menu,part,id)
{
 document.location = "adminmenu.php?menu="+menu+"&part="+part+"&cat="+document.formname.cat.value+"&id="+id;
}

function validsujetforum(menu,part,id)
{
 document.location = "adminmenu.php?menu="+menu+"&part="+part+"&sujet="+document.formname.sujet.value+"&id="+id;
}

function validcatphotomemb(menu,part,id)
{
 document.location = "membmenu.php?menu="+menu+"&part="+part+"&cat="+document.formname.cat.value+"&id="+id;
}
function verif_adminforumdelmess()
{
  if (document.formname.sujet.value=="") alert("Sélectionnez un sujet");
  else document.formname.submit();
}
function doc_validcat2(id)
{
 if (document.formname.cat.value=="") alert("Sélectionnez une catégorie");
 else document.location = "membmenu.php?menu=doc&part=Comptes-Rendus&type="+document.formname.cat.value+"&id="+id;
}
function doc_validcat3(id)
{
 if (document.formname.cat.value=="") alert("Sélectionnez une catégorie");
 else document.location = "adminmenu.php?menu=doc&part=Comptes-Rendus&type="+document.formname.cat.value+"&id="+id;
}
