//	----------------- Gestion de fenêtre modale ----------------
	var popupwindow;
	var intervalId;
	var x,y;
	
	function getViewPortSize() {
		var myWidth = 0, myHeight = 0;
		if( typeof( window.innerWidth ) == 'number' ) {
			//Non-IE
			myWidth = window.innerWidth;
			myHeight = window.innerHeight;
		}else if( document.documentElement &&( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
			//IE 6+ in 'standards compliant mode'
			myWidth = document.documentElement.clientWidth;
			myHeight = document.documentElement.clientHeight;
		} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		 	//IE 4 compatible
		 	myWidth = document.body.clientWidth;
		 	myHeight = document.body.clientHeight;
		}
		var tmp=new Object;
		tmp.width=myWidth;
		tmp.height=myHeight;
		return tmp;
	} 

	function getTaille(){ 		
		var test1 = document.body.scrollHeight;
		var test2 = document.body.offsetHeight;
		if (test1 > test2){ // all but Explorer Mac		
		  var w = document.body.scrollWidth;
		  var h = document.body.scrollHeight;
		}else{ 
			// Explorer Mac;
		   //would also work in Explorer 6 Strict, Mozilla and Safari		
		  var w = document.body.offsetWidth;
		  var h = document.body.offsetHeight;
		}
		var s=getViewPortSize();

		if(s.width>w) w=s.width;
		if(s.height>h) h=s.height;			
		
		if(document.getElementById("divHide")!=undefined){
			document.getElementById("divHide").style.width = w+"px";
			document.getElementById("divHide").style.height = h+"px"; 	
		}
	}
	
	function hideshowSelect(form,view){
		for(var i=0;i<form.elements.length;i++){
			if(form.elements[i].type=="select-one"){
				form.elements[i].disabled = view;
			}		
		}
	}
	
	function hideAllSelect(){ 		
		for(var i=0; i<document.forms.length; i++){
			hideshowSelect(document.forms[i], true);
		}
	}
	
	function showAllSelect(){
		for(var i=0; i<document.forms.length; i++) hideshowSelect(document.forms[i], false);
	}
	
	function Popup(url, titre, size){				
		popupwindow = window.open(url,titre, size);
		
		document.getElementById("divHide").style.display = "block";
		//alert(document.getElementById("divHide").style.display);
		hideAllSelect();
		intervalId = setInterval("checkPopup()", 500);
		return false;
	}
	
	function PopupImage(url, titre, size){
		Popup(url, titre, size);
	}
	
	function checkPopup(){
		if(popupwindow!=undefined){
			if(popupwindow.closed){
				clearInterval(intervalId);
				document.getElementById("divHide").style.display = "none";
				showAllSelect();
			}
		}else{
			alert("Merci de désactiver votre bloqueur de Popup");
			clearInterval(intervalId);
			document.getElementById("divHide").style.display = "none";
			showAllSelect();
		}
	}
	
	function end(){
		if(popupwindow!=undefined) popupwindow.close();
	}
	
	//window.onload = getTaille;
	window.onunload = end;
	window.onresize = getTaille;


//	------------------------- Sommaire -------------------------
function Voir(i){
	window.location.href = "contact.php?id="+i;
}

function ChangeContactFilter(i){
	window.location.href = "sommaire.php?fg="+i;
}

function ChangeV1Filter(i){
	window.location.href = "sommaire.php?fv1="+i+"#Livrets1";
}

function ChangeDECV1Filter(i){
	window.location.href = "dec_sommaire.php?fv1="+i+"#Livrets1";
}

function ChangeV2Filter(i){
	window.location.href = "sommaire.php?fv2="+i+"#Livrets2";
}

function ChangeDECV2Filter(i){
	window.location.href = "dec_sommaire.php?fv2="+i+"#Livrets2";
}

function VoirV1(i, typeRessource){	
	switch(typeRessource){
		case "conseillers":
			window.location.href="volet1.php?id="+i;
			break;
		case "DEC":
			window.location.href="dec_volet1.php?id="+i;
			break;
		case "responsable":
		case "CFC":
			window.location.href="resp_volet1.php?id="+i;
			break;
		case "candidat":
			window.location.href="volet1.php?id="+i;
			break;			
	}	
}

function VoirV2(i){	
	window.location.href="volet2.php?id="+i;
}

function AllowDownloadV2(i){
	document.form1.idvolet2.value=i;
	document.form1.submit();
}

function AddEmail(idvolet){
	Popup('addEmail.php?idv1='+idvolet,'Justitficatifs','height=300,width=400,scrollbars=yes');
}

function ViewAdresse(idCandidat){
	Popup('viewadress.php?idc='+idCandidat,'Coordonnées','height=300,width=400,scrollbars=yes');
}

function ViewAgenda(idc){
	window.location.href="agenda.php?idcandidat="+idc;
}

//	------------------------- PDC --------------------------
function Valide(){
	/*var msg = "";
	if(document.form1.TypeVAE.options[document.form1.TypeVAE.selectedIndex].value=="") msg += " - Type de VAE\n";
	if(document.form1.personnelEducNat.options[document.form1.personnelEducNat.selectedIndex].value=="") msg += " - Personnel de l'éducation nationale\n";
	if(document.form1.personnelGreta.options[document.form1.personnelGreta.selectedIndex].value=="") msg += " - Personnel d'un GRETA\n";
	
	if(msg != "") alert("Merci de compléter les champs suivants :\n\n"+msg);
	else{*/
		if(confirm("Voulez-vous valider cette demande de contact ?\nAttention, assurez vous du bon choix de diplôme. Une fois validé, vous ne pourrez plus le modifier")){
			document.form1.traitement.value="Validation";
			document.form1.submit();
		}
	/*}*/
}

function Transfere(){						
	document.getElementById("transfere").style.display="inline";
	document.getElementById("divBoutons").style.display="none";		
}

function AnnuleTransfere(){
	document.getElementById("transfere").style.display="none";
	document.getElementById("divBoutons").style.display="inline";	
}

function ValideTransfere(){
	var msg ="";
	if(document.form1.motif.options[document.form1.motif.selectedIndex].value=="") msg += "- Motif de réorientation\n";
	//if(document.form1.conseiller.value=="") msg += "- Conseiller\n";
	if(msg == ""){
		document.form1.traitement.value="Transfere";
		document.form1.submit();		
	}else{
		alert("Merci de remplir les champs suivans: \n\n"+msg);	
	}				
}

function Refuse(){					
	document.getElementById("refus").style.display="inline";
	document.getElementById("divBoutons").style.display="none";	
}

function AnnuleRefus(){
	document.getElementById("refus").style.display="none";
	document.getElementById("divBoutons").style.display="inline";	
}

function ValideRefus(){
	var msg ="";
	if(document.form1.motifRefus.options[document.form1.motifRefus.selectedIndex].value=="") msg += "Veuillez remplir le motif de refus\n";				
	//if(document.form1.commentRefus.value=="") msg = "Veuillez remplir le champ commentaire\n";
	if(msg == ""){
		document.form1.traitement.value="Refus";
		document.form1.submit();		
	}else{
		alert(msg);	
	}
}

function Retour(){
	window.location.href="sommaire.php";
}

function ModifCtct(idctct){
	window.location.href = "mod_contact.php?id="+idctct;
}

function ValidModifCtct(){
	document.form1.submit();
}

function Abandon(){
	if(confirm("Voulez-vous passer cette demande de contact en \"Abandon / Sans suite\" ?")){
		document.form1.traitement.value="Abandon";
		document.form1.submit();
	}
}

/*function changeSpecialite(obj){
	if(obj.options[obj.selectedIndex].value!="") document.getElementById("choixDiplome").style.display = "inline";
}*/

function choixDiplome(){
	if(document.form1.comboDomaine.options[document.form1.comboDomaine.selectedIndex].value=="") alert("Merci de choisir un domaine");
	else{
		//alert(document.form1.comboDomaine.options[document.form1.comboDomaine.selectedIndex].value);
		Popup('choixDiplome.php?idd='+document.form1.comboDomaine.options[document.form1.comboDomaine.selectedIndex].value+((document.form1.comboMention.options[document.form1.comboMention.selectedIndex].value!="")? '&idm='+document.form1.comboMention.options[document.form1.comboMention.selectedIndex].value:''),'Diplomes','height=200,width=600,scrollbars=yes')
	}
}

function SendDiplome(obj){
	window.opener.document.form1.iddiplome.value = obj.options[obj.selectedIndex].value;
	window.opener.document.form1.nomDiplome.value = obj.options[obj.selectedIndex].text;
}

function AnnulSendDiplome(){
	window.opener.document.form1.iddiplome.value = window.opener.document.form1.oldiddiplome.value;
	window.opener.document.form1.nomDiplome.value = window.opener.document.form1.oldDiplomeName.value;
}

function setEtat(id, valeur){
	document.form1.traitement.value="setEtat";
	document.form1.valeur.value=valeur;
	document.form1.action="contact.php?id="+id;
	document.form1.submit();
}

//	------------------------- Volet 1 - Conseiller -------------------------
function setEtapeV1(idV1){
	Popup('setEtape.php?idv1='+idV1,'Livret1','height=300,width=400,scrollbars=yes');
}

function Justificatifs(idvolet, idcandidat, iddiplome){
	//document.frmJustificatif.submit();
	//window.open('justifV1.php?idv1='+idvolet+'&idc='+idcandidat+'&idd='+iddiplome,'Justitficatifs','height=500,width=400,scrollbars=yes')	
	Popup('justifV1.php?idv1='+idvolet+'&idc='+idcandidat+'&idd='+iddiplome,'Justitficatifs','height=300,width=400,scrollbars=yes');
}

function popTypeVAE(idV1, idCandidat){	
	Popup('typeVAE.php?idc='+idCandidat+'&idv1='+idV1,'VAE','height=200,width=400,scrollbars=yes');
}

function PopExpert(idvolet, idcandidat, iddiplome){
	//window.open('v1tov2.php?idv1='+idvolet+'&idc='+idcandidat+'&idd='+iddiplome,'Justitficatifs','height=500,width=400,scrollbars=yes')	
	Popup('v1tov2.php?idv1='+idvolet+'&idc='+idcandidat+'&idd='+iddiplome,'Recevabilité','height=500,width=400,scrollbars=yes');
}

function PopCFC(idvolet, idcandidat, iddiplome){
	//window.open('v1tov2.php?idv1='+idvolet+'&idc='+idcandidat+'&idd='+iddiplome,'Justitficatifs','height=500,width=400,scrollbars=yes')	
	Popup('v1tov2cfc.php?idv1='+idvolet+'&idc='+idcandidat+'&idd='+iddiplome,'Recevabilité','height=500,width=400,scrollbars=yes');
}

function Recharge(id){
	window.location.href = "volet1.php?id="+id;
}

function PopupV1(rectorat){
	//if(confirm(((rectorat=="1")? "Ce dossier va être transféré à la DEC.\n":"")+"Voulez-vous valider ce volet 1 ?")){
		//window.open('validV1.php?idv1='+document.frmValid.idvolet1.value+'&rectorat='+rectorat,'Validation','height=500,width=400,scrollbars=yes');		
		Popup('validV1.php?idv1='+document.frmValid.idvolet1.value+'&rectorat='+rectorat,'Validation','height=500,width=400,scrollbars=yes');
	//}
}

function ValiderV1(rectorat){
	//if(confirm(((rectorat=="1")? "Ce dossier va être transféré à la DEC.\n":"")+"Voulez-vous valider ce volet 1 ?")){
		//window.open('validV1.php?idv1='+document.frmValid.idvolet1,'Validation','height=500,width=400,scrollbars=yes');		
		Popup('validV1.php?idv1='+document.frmValid.idvolet1,'Validation','height=500,width=400,scrollbars=yes');
	//}
}

function Relance(idvolet, idcandidat, iddiplome){
	//window.open('relance.php?idv1='+idvolet+'&idc='+idcandidat+'&idd='+iddiplome,'Relance','height=500,width=400,scrollbars=yes')	
	Popup('relance.php?idv1='+idvolet+'&idc='+idcandidat+'&idd='+iddiplome,'Relance','height=500,width=400,scrollbars=yes')	
}

function Archiver(idvolet, idcandidat, iddiplome, etat, action){
	var msg;
	if((etat != "Archivage" && etat != "Validation" && etat != "ValideCandidat") && action!="Reactiver") msg = "Voulez-vous archiver ce dossier ?";
	else msg = "Voulez-vous réactiver ce Livret 1 pour le candidat";
	if(confirm(msg)){
		//window.open('archive.php?idv1='+idvolet+'&idc='+idcandidat+'&idd='+iddiplome+"&etat="+etat,'Archivage','height=150,width=300,scrollbars=yes')	
		Popup('archive.php?idv1='+idvolet+'&idc='+idcandidat+'&idd='+iddiplome+"&etat="+etat+"&action="+action,'Archivage','height=150,width=300,scrollbars=yes');
	}
}

function setReceived(id){
	//Popup('archive.php?setReceived='+id,'Archivage','height=150,width=450,scrollbars=yes');
	document.formprint.submit();	
}

function ArchiverV2(idvolet, idcandidat, iddiplome, etat){
	var msg;
	if(etat != "Archivage") msg = "Voulez-vous archiver ce dossier ?";
	else msg = "Voulez-vous réactiver ce dossier ?";
	if(confirm(msg)){
		//window.open('archive.php?idv1='+idvolet+'&idc='+idcandidat+'&idd='+iddiplome+"&etat="+etat,'Archivage','height=150,width=300,scrollbars=yes')	
		Popup('archive.php?idv2='+idvolet+'&idc='+idcandidat+'&idd='+iddiplome+"&etat="+etat,'Archivage','height=150,width=300,scrollbars=yes');
	}
}

function ArchiverDEC(idvolet, idcandidat, iddiplome, etat){	
	if(confirm("Voulez-vous réactiver ce livret 1 pour le candidat")){
		//window.open('archive.php?idv1='+idvolet+'&idc='+idcandidat+'&idd='+iddiplome+"&etat="+etat+"&dec=1",'Archivage','height=150,width=300,scrollbars=yes')	
		Popup('archive.php?idv1='+idvolet+'&idc='+idcandidat+'&idd='+iddiplome+"&etat="+etat+"&dec=1",'Archivage','height=150,width=300,scrollbars=yes')	
	}
}

function Etapes(idvolet, idcandidat, iddiplome, etat, type){
	//window.open('etapes.php?idv1='+idvolet+'&idc='+idcandidat+'&idd='+iddiplome+"&etat="+etat,'Archivage','height=300,width=400,scrollbars=yes')	
	Popup('etapes.php?idv'+type+'='+idvolet+'&idc='+idcandidat+'&idd='+iddiplome+"&etat="+etat,'Archivage','height=300,width=400,scrollbars=yes');
}

function VerifValidV1(){	
	//var msgradio = "Merci de préciser l'avis de recevabilité";
	var msg ="";
	var tmp ="";
	/*var Champs=new Array("commentaire", "typedemande");
	var Message=new Array("Avis à propos du diplôme visé", "Avis à propos de la demande de VAE");*/
	var Champs=new Array("commentaire");
	var Message=new Array("Avis à propos du diplôme visé");
	
	for (i=0;i<Champs.length;i++){		
		if (eval("document.frmValidation."+Champs[i])!="undefined" && eval("document.frmValidation."+Champs[i]+".value")==""){
			msg+="- "+Message[i]+"\n";
		}
	}
	
	if(msg!=""){
		tmp="Merci de remplir les champs suivants:\n\n"+msg;
		alert(tmp);
	}else{
		document.frmValidation.submit();
	}
}

function PopupV1DEC(){
	//window.open('dec_validV1.php?idv1='+document.frmValid.idvolet1.value,'Validation','height=500,width=400,scrollbars=yes');			
	Popup('dec_validV1.php?idv1='+document.frmValid.idvolet1.value,'Validation','height=500,width=400,scrollbars=yes');			
}

function PopupV1Resp(){
	//window.open('resp_validV1.php?idv1='+document.frmValid.idvolet1.value,'Validation','height=550,width=400,scrollbars=yes');			
	Popup('resp_validV1.php?idv1='+document.frmValid.idvolet1.value,'Validation','height=550,width=400,scrollbars=yes');			
}

function Navig(idvolet, rubrique, idpage){
	window.location.href = "volet1.php?id="+idvolet+"&rub="+rubrique+"&page="+idpage;
}

function PopupV1toV2(idvolet1){		
	Popup('validV1toV2.php?idv1='+idvolet1,'Validation','height=500,width=400,scrollbars=yes');		
}

function AlertValidV1toV2(etat, emailpresent){
	window.opener.location.reload(true);
	switch(etat){
		case "recevable":
			chaine = "Ce livret a bien été validé.";
			break;
		case "nonrecevable":
			chaine = "Ce livret a bien été marqué comme non recevable.";
			break;
		case "incomplet":
			chaine = "Ce livret a bien été marqué comme incomplet.";
			break;
	}
	if(emailpresent == "email") chaine += "Un mail a été envoyé au candidat.";
	else chaine += "Le candidat n'a pas précisé d'adresse email. Aucun message n'a donc été envoyé.";		
	alert(chaine);
}

function loadrubrique(id, rub){
	//alert(rub);
	Popup('volet1_pop.php?id='+id+"&rub="+rub,'Validation','height=300,width=800,scrollbars=yes');		
}


//	------------------------- Volet 1 - Candidat -------------------------

function ValideL1(etablissement){
	if(confirm("Attention, une fois votre Livret 1 validé, il sera directement transmis "+((etablissement=="rectorat")? "aux services académiques":"au service VAE de l'université")+" pour étude de recevabilité. Merci de bien vérifier votre saisie. Voulez-vous envoyer ce Livret 1 ?")){
		document.frmValid.submit();
	}
}


//	------------------------- Justificatifs -------------------------
function Reset(page, idvolet, idcandidat, iddiplome){
	window.location.href = page+"?idv1="+idvolet+"&idc="+idcandidat+"&idd="+iddiplome;
}

function Reset2(page, idvolet, idcandidat, iddiplome){
	window.location.href = page+"?idv2="+idvolet+"&idc="+idcandidat+"&idd="+iddiplome;
}

function ValiderJs(){
	document.frmJustificatif.submit();
}

function verifChbx(obj){
	if(obj.checked==false) document.frmJustificatif.delJs.value += ((document.frmJustificatif.delJs.value!="")? "|":"")+obj.value;							
}

function AlertValid(mastring){
	var msg="";
	tabexp = mastring.split("|");
	for(i=0; i<tabexp.length; i++){
		msg+="- "+tabexp[i]+"\n";
	}
	if(msg!="") alert("Ce livret ne peut être validé car les justificatis suivant n'ont pas été fournis :\n\n"+msg);
}

function AlertValidok(rectorat, avis){
	if(avis!="non recevable"){
		alert("Ce livret a bien été transféré au responsable du diplôme");
	}else{
		alert("Ce livret a bien été marqué comme non recevable");
	}
	window.opener.location.reload();
	window.close();
}

function SentOk(){
	alert("Votre relance a bien été envoyée au candidat");
	window.close();
}

function AlreadySent(){
	alert("Une relance à déjà été envoyée à ce candidat aujourd'hui");
	window.close();
}

function RespV1Sent(){
	alert("Votre avis a bien été transféré au service V.A.E.");
	window.opener.location.href = "resp_sommaire.php";
	window.close();
}

//	------------------------- Utilisateurs -------------------------
function Annuler(){
	window.location.href = "admin_users.php";
}

function verifiermail(mail) {
   if ((mail.indexOf("@")>=0)&&(mail.indexOf(".")>=0)) {
      return true 
   } else {
      return false
   }
}

//	------------------------- Actualité -------------------------
function DelDocActu(type){	
	document.form1.deldoc.value=type;
	document.form1.submit();
}


//	------------------------- Volet 2 - Conseiller -------------------------

function setEtapeV2(idV2){
	Popup('setEtape.php?idv2='+idV2,'Livret2','height=300,width=400,scrollbars=yes');
}

function JustificatifsV2(iddiplome){	
	Popup('justifV1.php?idv2=0&idDiplome='+iddiplome,'Justitficatifs','height=300,width=400,scrollbars=yes');
}

function setRapporteurs(idvolet2){
	Popup('setRapporteur.php?idv2='+idvolet2,'Rapporteurs','height=250,width=400,scrollbars=yes');
}

//	------------------------- Volet 2 - Conseiller -------------------------


//	------------------------- Volet 2 - Candidat -------------------------

	function ValidV2Candidat(idv2){
		if(confirm("Attention, la validation du Livret 2 signifie que vous nous l'avez fait parvenir. Voulez-vous valider ce Livret ?")){
			document.frmV2.idVolet2.value = idv2;
			document.frmV2.toDo.value = "validate";
			document.frmV2.submit();
		}
	}
	
	function ReactivV2Candidat(idv2){
		document.frmV2.idVolet2.value = idv2;
		document.frmV2.toDo.value = "reActiv";
		document.frmV2.submit();
	}

	function chgCurrentV2(idv2){
		document.frmV2.idVolet2.value = idv2;
		document.frmV2.toDo.value = "setInSession";
		document.frmV2.submit();
	}

//	------------------------- Volet 2 - Candidat -------------------------

//	------------------------- Accompagnateur Expert -------------------------

function EnvoyerAcc(){	
	var Champs=new Array("Nom", "Prenom", "Telephone");
	var Message=new Array("Nom", "Prénom", "Telephone");	
	var msg="";
	
	for(i=0;i<Champs.length;i++){		
		if (eval("document.form1."+Champs[i]+".value")==""){
			msg+="- "+Message[i]+"\n";
		}
	}
	
	if(document.form1.Diplome.options[document.form1.Diplome.selectedIndex].value == "") msg+="- Diplôme lié à cette personne\n";
	
	if(msg!=""){
		tmp="Merci de remplir les champs suivants:\n\n"+msg;
		alert(tmp);
	}else{
		document.form1.submit();
	}	
}

function MakeJury(i){
	window.location.href='makeJury.php?id='+i;
}

function checkJury(i){
	//window.location.href='checkJury.php?id='+i;
	window.location.href='makeJury.php?id='+i;
}

//	------------------------- Rapporteur -------------------------

function EnvoyerRapp(){	
	var Champs=new Array("Nom", "Prenom", "Email", "Telephone", "Fax", "Login", "Mdp");
	var Message=new Array("Nom", "Prénom", "Email", "Telephone", "Fax", "Logn", "Mot de passe");	
	var msg="";
	
	for(i=0;i<Champs.length;i++){		
		if (eval("document.form1."+Champs[i]+".value")==""){
			msg+="- "+Message[i]+"\n";
		}
	}
	
	if(document.form1.Diplome.options[document.form1.Diplome.selectedIndex].value == "") msg+="- Diplôme lié à cette personne\n";
	
	if(msg!=""){
		tmp="Merci de remplir les champs suivants:\n\n"+msg;
		alert(tmp);
	}else{
		document.form1.submit();
	}	
}

function RappValidV2(idvolet){
	if(confirm("Voulez-vous valider ce dossier ?")){
		document.form1.idVolet2.value = idvolet;
		document.form1.submit();
	}
}

// ------------------------ Recherche par candidat ----------------------
function RechercheCandidat(recherche){	
	Popup('recherche.php?r='+recherche,'Recherche','height=250,width=400,scrollbars=yes');
}

// ------------------------ Recherche diplome ----------------------
function RechercheDiplome(recherche){
	Popup('recherche.php?d='+recherche,'Recherche','height=250,width=500,scrollbars=yes');
}

// ------------------------ Recherche de jury et d'accompagnateur expert ----------------------
function RecherchePersonne(recherche){	
	Popup('recherchePersonne.php?r='+recherche,'Recherche','height=250,width=500,scrollbars=yes');
}

//	------------------------- Jury -------------------------

function EnvoyerJury(){	
	var Champs=new Array("Ets", "Nom", "Prenom", "Email");
	var Message=new Array("Entreprise", "Nom", "Prénom", "Email");	
	var msg="";
	
	for(i=0;i<Champs.length;i++){		
		if (eval("document.form1."+Champs[i]+".value")==""){
			msg+="- "+Message[i]+"\n";
		}
	}
	
	if(document.form1.Diplome.options[document.form1.Diplome.selectedIndex].value == "" && document.form1.Type.options[document.form1.Type.selectedIndex].value!="membrePermanent") msg+="- Diplôme lié à cette personne\n";
	
	if(msg!=""){
		tmp="Merci de remplir les champs suivants:\n\n"+msg;
		alert(tmp);
	}else{
		document.form1.submit();
	}	
}

function addSelectedJury(){
	document.form1.submit();
}

function checkFormJury(){
	var Champs=new Array("dateJury", "heureJury", "lieuJury", "salleJury");
	var Message=new Array("Date", "Heure", "Lieu", "Salle");
	var msg="";
	
	for(i=0;i<Champs.length;i++){		
		if (eval("document.form2."+Champs[i]+".value")==""){
			msg+="- "+Message[i]+"\n";
		}
	}
	if(msg!=""){
		alert("Merci de remplir les champs suivants:\n\n"+msg);
		return false;
	}else return true;
}

function VerifConvoc(idv2, type, idp){
	if(checkFormJury()){
		document.form2.idv2.value = idv2;
		if(type=='jury') document.form2.idj.value = idp;
		else if(type=='candidat')  document.form2.idc.value = idp;
		else alert("Type inconnu");
		document.form2.todo.value = "view";
		document.form2.submit();
	}
}

function deleteFromConvoc(idv2, type, idp){
	document.form2.idv2.value = idv2;
	if(type=='jury') document.form2.idj.value = idp;
	document.form2.todo.value = "delete";
	document.form2.submit();
}

function SendConvoc(idv2, type, idp){
	if(confirm("Voulez-vous envoyer cette convocation ?")){
		document.form2.idv2.value = idv2;
		if(type=='jury') document.form2.idj.value = idp;
		else if(type=='candidat')  document.form2.idc.value = idp;
		else alert("Destinataire inconnu");
		document.form2.todo.value = "send";
		document.form2.submit();
	}
}

function DeleteEtape(typevolet, values){
	if(confirm("Attention, il est préférable de ne pas supprimer d'étape en cas de traîtement électronique du dossier. Voulez-vous continuer ?")){
		document.formdel.delEtape.value = values	
		document.formdel.submit();
	}
}

//	Réactivation d'un contact
function Reactivate(i){
	if(confirm("Voulez-vous réactiver ce contact ?")){
		document.formPdC.idcontact.value=i;
		document.formPdC.traitement.value="reactivate";
		document.formPdC.submit();
	}
}
