
 
function isNumber(el,dec) 
{
  element = document.getElementById(el);

  if (element.value == "") {
      return false;
    }

    if (isNaN(element.value)) {
       return false;
    }
    else {
      if (element.value.indexOf('.') == -1) {
          return true;
      }
      else {
        dectext = element.value.substring(element.value.indexOf('.')+1, element.value.length);
        if (dectext.length > dec)  {
           return false;
        }
        else {
           return true;
        }
      }
    }
}
 
 //recupération des info du navigateur
function getNavigateur()
{
	// Récupération des infos du navigateur
	var N=navigator.appName; var V=navigator.appVersion;
	var version="?"; var nom=N; var os="?"; var langue="?";
	if (N=="Microsoft Internet Explorer") 
	{
		langue=navigator.systemLanguage
		version=V.substring(V.indexOf("MSIE",0)+5,V.indexOf(";",V.indexOf("MSIE",0)));
		if (V.indexOf("Win",0)>0) 
		{
			if ( V.indexOf(";",V.indexOf("Win",0)) > 0 ) 
			{
				os=V.substring(V.indexOf("Win",0),V.indexOf(";",V.indexOf("Win",0)));
			} else 
			{
				os=V.substring(V.indexOf("Win",0),V.indexOf(")",V.indexOf("Win",0)));
			}
		}
		if (V.indexOf("Mac",0)>0) 
		{
			os="Macintosh";
			version=V.substring(V.indexOf("MSIE",0)+6,V.indexOf(" ",V.indexOf("MSIE",0)));
		}
	}
	if (N=="Netscape") 
	{
		langue=navigator.systemLanguage
		version=(V.substring(0,V.indexOf("(",0)));
		if (V.indexOf("Mac",0)>0) 
		{
			os="Macintosh";
		}
		if (V.indexOf("Linux",0)>0) 
		{
			os="Linux";
		}
		if (V.indexOf("Win",0)>0) 
		{
			os=V.substring(V.indexOf("Win",0),V.indexOf(";",V.indexOf("Win",0)));
		}
		if (version==5) 
		{
			version="6.0"
		}
	}
	return (nom+"#"+version.substr(0,3)+"#"+os+"#"+langue)
}


 
 //cette fonction verifie le bon format de la date "XX/XX/XXXX"
 function verifDate(f, champ)
 {
	var s;
	if(f.elements[champ].value == "")
	 {
		alert('La date doit etre renseignée !');
		f.elements[champ].focus();
		return false;
	 }
	//on verifie si la date contient des caracteres different de 0 à 9 et /
	for (i = 0; i <f.elements[champ].value.length; i++ )
	{
		s = f.elements[champ].value.charAt(i);
		if(!((s>=0) && (s<=9)) && (s!='/'))
		{
			alert('Veuillez respecter le format demandé !');
			f.elements[champ].focus();
			return false;
		}
	}
	//on verifie le format
	madate = f.elements[champ].value.split('/');
	if (madate.length != 3)
	{
		alert('Le format de la date est incorect !');
		f.elements[champ].focus();
		return false;
	}
	if (madate[0].length !=2)
	{
		alert('Le format de la date est incorect !');
		f.elements[champ].focus();
		return false;
	}
	if (madate[1].length !=2)
	{
		alert('Le format de la date est incorect !');
		f.elements[champ].focus();
		return false;
	}
	if (madate[2].length !=4)
	{
		alert('Le format de la date est incorect !');
		f.elements[champ].focus();
		return false;
	}
	return true;
 }
 
 // DEpli ou repli un div
 function depliRepli(nameDiv)
 {
 	if (document.getElementById(nameDiv).style.display == 'none')
 	{
 		document.getElementById(nameDiv).style.display='block';
 	}
 	else
 	{
	 	document.getElementById(nameDiv).style.display='none';
	 }
 }


function miseAjourMontant(nameDiv)
 {
 	if (document.getElementById(nameDiv).style.display == 'none')
 	{
 		document.getElementById(nameDiv).style.display='block';
 	}
 	else
 	{
	 	document.getElementById(nameDiv).style.display='none';
		document.fnc.fnc_montant.value="";
	}
 }

//met à jour le champ caché du formulaire 
//pour permettre de reaffiché la page dans les memes conditions 
function depliRepliChamp(nameDiv, nameFormulaire)
{
	if (document.getElementById(nameDiv).style.display == 'none')
 	{
		document.forms[nameFormulaire].elements[nameFormulaire+'Display'].value = 'none';
	}
	else
 	{
	 	document.forms[nameFormulaire].elements[nameFormulaire+'Display'].value = 'block';
	}
}
 
 // Ouverture d'une popup
 function OuvrirPopup(page,nom,option,largeur,hauteur)
 {
	   var top=(screen.height-hauteur)/2;
	   var left=(screen.width-largeur)/2;
       window.open(page,nom,"top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+option);
 }

 // Ouverture d'une popup en taille maxi pour la hauteur
 function OuvrirPopupMaxiHauteur(page,nom,option,largeur)
 {
	   var hauteur_ecran = screen.height;
	   var largeur_ecran = screen.width;
	   var hauteur = hauteur_ecran - 150;
	   
	   var top=50;
	   var left=(largeur_ecran-largeur)/2;
       window.open(page,nom,"top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+option);
 }

  // Ouverture d'une popup en taille maxi pour la largeur
 function OuvrirPopupMaxiLargeur(page,nom,option,hauteur)
 {
	   var hauteur_ecran = screen.height;
	   var largeur_ecran = screen.width;
	   var largeur = largeur_ecran - 100;
	   
	   var left=50;
	   var top=(hauteur_ecran-hauteur)/2;
       window.open(page,nom,"top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+option);
 }

 function changeUrlIframe(nom,page)
 {
	 frames[nom].location.href=page;
 }
 
 // Change la couleur des lignes d'un tableau
 function setPointer(theRow, thePointerColor)
 {
  if (thePointerColor == '' || typeof(theRow.style) == 'undefined') {
   return false;
  }
  if (typeof(document.getElementsByTagName) != 'undefined') {
   var theCells = theRow.getElementsByTagName('td');
  }
  else if (typeof(theRow.cells) != 'undefined') {
   var theCells = theRow.cells;
  }
  else {
   return false;
  }
 
  var rowCellsCnt  = theCells.length;
  for (var c = 0; c < rowCellsCnt; c++) {
   theCells[c].style.backgroundColor = thePointerColor;
  }
 
  return true;
 }


function confirmSupprSujet(suj_id)

// Confirmation de suppression de sujet
{
	if (confirm("Etes-vous sûr de vouloir supprimer ce sujet ?"))
	{
		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprSujet\" action=\"sujet.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"delete\">");
			document.write("<input type=\"hidden\" name=\"suj_id\" value= \"" + suj_id + "\">");
			document.write("</form>");
			document.confirmSupprSujet.submit();
		}
		else
		{
			document.location.href = "sujet.php?action=delete&suj_id="+suj_id;
		}
	}
	else
	{
		alert("Demande de suppression annulée !");
	}
}

function confirmSupprCategorie_sujet(cat_id)

// Confirmation de suppression de categorie_sujet
{
	if (confirm("Etes-vous sûr de vouloir supprimer cette catégorie ?"))
	{
		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprCategorie_sujet\" action=\"categorie_sujet.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"delete\">");
			document.write("<input type=\"hidden\" name=\"cat_id\" value= \"" + cat_id + "\">");
			document.write("</form>");
			document.confirmSupprCategorie_sujet.submit();
		}
		else
		{
			document.location.href = "categorie_sujet.php?action=delete&cat_id="+cat_id;
		}
	}
	else
	{
		alert("Demande de suppression annulée !");
	}
}

 // Confirmation de suppression de utilisateur
 function confirmSupprUtilisateur(id)
 {
 	if (confirm("Etes-vous sûr de vouloir supprimer cet utilisateur ?"))
 	{
 		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprUtilisateur\" action=\"utilisateur.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"delete\">");
			document.write("<input type=\"hidden\" name=\"uti_code\" value=\"" + id + "\">");
			document.write("</form>");
			document.confirmSupprUtilisateur.submit();
		}
		else
		{
			document.location.href = "utilisateur.php?action=delete&uti_code="+id;
		}
 	}
 	else
 	{
 		alert("Demande de suppression annulée !");
 	}
 }

// Confirmation de suppression de fonction
function confirmSupprFonction(fon_id)
{
	if (confirm("Etes-vous sûr de vouloir supprimer ce fonction ?"))
	{
		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprFonction\" action=\"gestionfonction.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"delete\">");
			document.write("<input type=\"hidden\" name=\"fon_id\" value= \"" + fon_id + "\">");
			document.write("</form>");
			document.confirmSupprFonction.submit();
		}
		else
		{
			document.location.href = "gestionfonction.php?action=delete&fon_id="+fon_id;
		}
	}
	else
	{
		alert("Demande de suppression annulée !");
	}
}

 // Confirmation de suppression des informations
 function confirmSupprInformation(id)
 {
 	if (confirm("Etes-vous sûr de vouloir supprimer cette information ?"))
 	{
 		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprInformation\" action=\"information.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"delete\">");
			document.write("<input type=\"hidden\" name=\"inf_id\" value=\"" + id + "\">");
			document.write("</form>");
			document.confirmSupprInformation.submit();
		}
		else
		{
			document.location.href = "information.php?action=delete&inf_id="+id;
		}
 	}
 	else
 	{
 		alert("Demande de suppression annulée !");
 	}
 }

 
 // Confirmation de suppression des compte rendus
 function confirmSupprCompterendu(id)
 {
 	if (confirm("Etes-vous sûr de vouloir supprimer ce compte rendu ?"))
 	{
 		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprCompterendu\" action=\"compterendu.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"delete\">");
			document.write("<input type=\"hidden\" name=\"cpt_id\" value=\"" + id + "\">");
			document.write("</form>");
			document.confirmSupprCompterendu.submit();
		}
		else
		{
			document.location.href = "compterendu.php?action=delete&cpt_id="+id;
		}
 	}
 	else
 	{
 		alert("Demande de suppression annulée !");
 	}
 }

// Confirmation de suppression d'une réservation de salle de réunion
 function confirSupprResaSalle(id)
 {
 	if (confirm("Etes-vous sûr de vouloir supprimer cette réunion ?"))
 	{
 		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirSupprResaSalle\" action=\"reservation_salle_gestion.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"delete\">");
			document.write("<input type=\"hidden\" name=\"res_id\" value=\"" + id + "\">");
			document.write("</form>");
			document.confirSupprResaSalle.submit();
		}
		else
		{
			document.location.href = "reservation_salle_gestion.php?action=delete&res_id="+id;
		}
 	}
 	else
 	{
 		alert("Demande de suppression annulée !");
 	}
 }


 // Confirmation de suppression des salles
 function confirmSupprSalle(id)
 {
 	if (confirm("Etes-vous sûr de vouloir supprimer cette salle ?"))
 	{
 		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprSalle\" action=\"salle.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"delete\">");
			document.write("<input type=\"hidden\" name=\"sal_id\" value=\"" + id + "\">");
			document.write("</form>");
			document.confirmSupprSalle.submit();
		}
		else
		{
			document.location.href = "salle.php?action=delete&sal_id="+id;
		}
 	}
 	else
 	{
 		alert("Demande de suppression annulée !");
 	}
 }

  // Confirmation de suppression des voitures
 function confirmSupprVoiture(id)
 {
 	if (confirm("Etes-vous sûr de vouloir supprimer cette voiture ?"))
 	{
 		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprVoiture\" action=\"voiture.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"delete\">");
			document.write("<input type=\"hidden\" name=\"voi_immat\" value=\"" + id + "\">");
			document.write("</form>");
			document.confirmSupprSalle.submit();
		}
		else
		{
			document.location.href = "voiture.php?action=delete&voi_immat="+id;
		}
 	}
 	else
 	{
 		alert("Demande de suppression annulée !");
 	}
 }

 // Confirmation de suppression de service
 function confirmSupprService(id)
 {
 	if (confirm("Etes-vous sûr de vouloir supprimer ce service ?"))
 	{
 		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprService\" action=\"service.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"delete\">");
			document.write("<input type=\"hidden\" name=\"ser_id\" value=\"" + id + "\">");
			document.write("</form>");
			document.confirmSupprService.submit();
		}
		else
		{
			document.location.href = "service.php?action=delete&ser_id="+id;
		}
 	}
 	else
 	{
 		alert("Demande de suppression annulée !");
 	}
 }

 // Confirmation de suppression de action
 function confirmSupprAction(id,mod_id)
 {
 	if (confirm("Etes-vous sûr de vouloir supprimer cette action ?"))
 	{
 		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprAction\" action=\"action.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"delete\">");
			document.write("<input type=\"hidden\" name=\"act_id\" value=\"" + id + "\">");
			document.write("<input type=\"hidden\" name=\"mod_id\" value=\"" + mod_id + "\">");
			document.write("</form>");
			document.confirmSupprAction.submit();
		}
		else
		{
			document.location.href = "action.php?action=delete&act_id="+id+"&mod_id="+mod_id;
		}
 	}
 	else
 	{
 		alert("Demande de suppression annulée !");
 	}
 }

  // Confirmation de suppression de dossier
 function confirmSupprDossier(dos_id,soc_id)
 {
 	if (confirm("Etes-vous sûr de vouloir supprimer ce dossier ?"))
 	{
 		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprDossier\" action=\"dossier.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"delete\">");
			document.write("<input type=\"hidden\" name=\"dos_id\" value=\"" + dos_id + "\">");
			document.write("<input type=\"hidden\" name=\"soc_id\" value=\"" + soc_id + "\">");
			document.write("</form>");
			document.confirmSupprDossier.submit();
		}
		else
		{
			document.location.href = "dossier.php?action=delete&dos_id="+dos_id+"&soc_id="+soc_id;
		}
 	}
 	else
 	{
 		alert("Demande de suppression annulée !");
 	}
 }

// Confirmation de suppression de chemin de fer
function confirmSupprFer(fer_id,soc_id)
{
	if (confirm("Etes-vous sûr de vouloir supprimer ce chemin de fer ?"))
	{
		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprDossier\" action=\"fer.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"delete\">");
			document.write("<input type=\"hidden\" name=\"fer_id\" value=\"" + fer_id + "\">");
			document.write("<input type=\"hidden\" name=\"soc_id\" value=\"" + soc_id + "\">");
			document.write("</form>");
			document.confirmSupprDossier.submit();
		}
		else
		{
			document.location.href = "fer.php?action=delete&fer_id="+fer_id+"&soc_id="+soc_id;
		}
	}
	else
	{
		alert("Demande de suppression annulée !");
	}
}

 // Confirmation de suppression de groupe
 function confirmSupprGroupe(id)
 {
 	if (confirm("Etes-vous sûr de vouloir supprimer ce groupe ?"))
 	{
 		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprGroupe\" action=\"groupe.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"delete\">");
			document.write("<input type=\"hidden\" name=\"grp_id\" value=\"" + id + "\">");
			document.write("</form>");
			document.confirmSupprGroupe.submit();
		}
		else
		{
			document.location.href = "groupe.php?action=delete&grp_id="+id;
		}
 	}
 	else
 	{
 		alert("Demande de suppression annulée !");
 	}
 }

 // Confirmation de suppression d'un journal
 function confirmSupprJournal(id)
 {
 	if (confirm("Etes-vous sûr de vouloir supprimer ce journal ?"))
 	{
 		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprJournal\" action=\"journal.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"delete\">");
			document.write("<input type=\"hidden\" name=\"jou_id\" value=\"" + id + "\">");
			document.write("</form>");
			document.confirmSupprJournal.submit();
		}
		else
		{
			document.location.href = "journal.php?action=delete&jou_id="+id;
		}
 	}
 	else
 	{
 		alert("Demande de suppression annulée !");
 	}
 }
 
 // Confirmation de suppression de module
 function confirmSupprModule(id)
 {
 	if (confirm("Etes-vous sûr de vouloir supprimer ce module et toutes les actions associées ?\n"))
 	{
  		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprModule\" action=\"module.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"delete\">");
			document.write("<input type=\"hidden\" name=\"mod_id\" value=\"" + id + "\">");
			document.write("</form>");
			document.confirmSupprModule.submit();
		}
		else
		{
			document.location.href = "module.php?action=delete&mod_id="+id;
		}
  	}
  	else
  	{
  		alert("Demande de suppression annulée !");
  	}
 }
 
  // Confirmation de suppression de machine
  function confirmSupprMachine(id)
  {
  	if (confirm("Etes-vous sûr de vouloir supprimer cette machine ?"))
  	{
   		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprMachine\" action=\"machine.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"delete\">");
			document.write("<input type=\"hidden\" name=\"mac_id\" value=\"" + id + "\">");
			document.write("</form>");
			document.confirmSupprMachine.submit();
		}
		else
		{
			document.location.href = "machine.php?action=delete&mac_id="+id;
		}
   	}
   	else
   	{
   		alert("Demande de suppression annulée !");
   	}
 }
 
  // Confirmation de suppression d'une catégorie de probleme
  function confirmSupprCatprob(id)
  {
  	if (confirm("Etes-vous sûr de vouloir supprimer cette catégorie de problème ?"))
  	{
   		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprCatprob\" action=\"catprob.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"delete\">");
			document.write("<input type=\"hidden\" name=\"catprob_id\" value=\"" + id + "\">");
			document.write("</form>");
			document.confirmSupprCatprob.submit();
		}
		else
		{
			document.location.href = "catprob.php?action=delete&catprob_id="+id;
		}
   	}
   	else
   	{
   		alert("Demande de suppression annulée !");
   	}
 }

  
  function confirmSupprDocument(doc_id, pro_id, chr_id)
// Confirmation de suppression de document
{
	if (confirm("Etes-vous sûr de vouloir supprimer ce document ?"))
	{
		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprDocument\" action=\"projet.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"deleteDoc\">");
			document.write("<input type=\"hidden\" name=\"doc_id\" value= \"" + doc_id + "\">");
			document.write("<input type=\"hidden\" name=\"chr_id\" value= \"" + chr_id + "\">");
			document.write("<input type=\"hidden\" name=\"pro_id\" value= \"" + pro_id + "\">");
			document.write("</form>");
			document.confirmSupprDocument.submit();
		}
		else
		{
			document.location.href = "projet.php?action=deleteDoc&doc_id="+doc_id+"&pro_id="+pro_id+"&chr_id="+chr_id;
		}
	}
	else
	{
		alert("Demande de suppression annulée !");
	}
}

// Confirmation de publication de news
  function confirmPubNews(id)
  {
  	if (confirm("Etes-vous sûr de vouloir publier cette news ?"))
  	{
  		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmPubNews\" action=\"index.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"publi\">");
			document.write("<input type=\"hidden\" name=\"new_id\" value=\"" + id + "\">");
			document.write("<input type=\"hidden\" name=\"page\" value=\"news\">");
			document.write("</form>");
			document.confirmPubNews.submit();
		}
		else
		{
			document.location.href = "index.php?page=news&action=publi&new_id="+id;
		}
  	}
  	else
  	{
  		alert("Demande de publication annulée !");
  	}
 }
 
 // Confirmation de suppression de logiciel
  function confirmSupprLogiciel(id)
  {
  	if (confirm("Etes-vous sûr de vouloir supprimer cet logiciel ?"))
  	{
   		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprLogiciel\" action=\"logiciel.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"delete\">");
			document.write("<input type=\"hidden\" name=\"log_id\" value=\"" + id + "\">");
			document.write("</form>");
			document.confirmSupprLogiciel.submit();
		}
		else
		{
			document.location.href = "logiciel.php?action=delete&log_id="+id;
		}
   	}
   	else
   	{
   		alert("Demande de suppression annulée !");
   	}
 }

// Confirmation de suppression de note
  function confirmSupprNote(id)
  {
  	if (confirm("Etes-vous sûr de vouloir supprimer cette note ?"))
  	{
   		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprNote\" action=\"note.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"delete\">");
			document.write("<input type=\"hidden\" name=\"note_id\" value=\"" + id + "\">");
			document.write("</form>");
			document.confirmSupprNote.submit();
		}
		else
		{
			document.location.href = "note.php?action=delete&note_id="+id;
		}
   	}
   	else
   	{
   		alert("Demande de suppression annulée !");
   	}
 }

// Confirmation de suppression d'offre d'emploi
function confirmSupprEmploi(id)
{
	if (confirm("Etes-vous sûr de vouloir supprimer cette offre ?"))
	{
		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprEmploi\" action=\"index.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"delete\">");
			document.write("<input type=\"hidden\" name=\"page\" value=\"emploi\">");
			document.write("<input type=\"hidden\" name=\"emp_id\" value=\"" + id + "\">");
			document.write("</form>");
			document.confirmSupprEmploi.submit();
		}
		else
		{
			document.location.href = "index.php?page=emploi&action=delete&emp_id="+id;
		}
	}
	else
	{
		alert("Demande de suppression annulée !");
	}
}

// Confirmation de publication de offre
function confirmPubEmploi(id)
{
	if (confirm("Etes-vous sûr de vouloir publier cette offre ?"))
	{
		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmPubEmploi\" action=\"index.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"publi\">");
			document.write("<input type=\"hidden\" name=\"page\" value=\"emploi\">");
			document.write("<input type=\"hidden\" name=\"emp_id\" value=\"" + id + "\">");
			document.write("</form>");
			document.confirmPubEmploi.submit();
		}
		else
		{
			document.location.href = "index.php?page=emploi&action=publi&emp_id="+id;
		}
	}
	else
	{
		alert("Demande de publication annulée !");
	}
}

// Confirmation de suppression de mail
function confirmSupprMail(id)
{
	if (confirm("Etes-vous sûr de vouloir supprimer ce mail ?"))
	{
		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprMail\" action=\"index.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"delete\">");
			document.write("<input type=\"hidden\" name=\"page\" value=\"mail\">");
			document.write("<input type=\"hidden\" name=\"mail_id\" value=\"" + id + "\">");
			document.write("</form>");
			document.confirmSupprMail.submit();
		}
		else
		{
			document.location.href = "index.php?page=mail&action=delete&mail_id="+id;
		}
	}
	else
	{
		alert("Demande de suppression annulée !");
	}
}

// Confirmation de publication de mail
function confirmPubMail(id)
{
	if (confirm("Etes-vous sûr de vouloir publier ce mail ?"))
	{
		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmPubMail\" action=\"index.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"publi\">");
			document.write("<input type=\"hidden\" name=\"page\" value=\"mail\">");
			document.write("<input type=\"hidden\" name=\"mail_id\" value=\"" + id + "\">");
			document.write("</form>");
			document.confirmPubMail.submit();
		}
		else
		{
			document.location.href = "index.php?page=mail&action=publi&mail_id="+id;
		}
	}
	else
	{
		alert("Demande de publication annulée !");
	}
}

// Confirmation de suppression de dossier de presse
function confirmSupprDpresse(id)
{
	if (confirm("Etes-vous sûr de vouloir supprimer ce dossier de presse ?"))
	{
		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprDpresse\" action=\"index.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"delete\">");
			document.write("<input type=\"hidden\" name=\"page\" value=\"dpresse\">");
			document.write("<input type=\"hidden\" name=\"dpr_id\" value=\"" + id + "\">");
			document.write("</form>");
			document.confirmSupprDpresse.submit();
		}
		else
		{
			document.location.href = "index.php?page=dpresse&action=delete&dpr_id="+id;
		}
	}
	else
	{
		alert("Demande de suppression annulée !");
	}
}

// Confirmation de publication de dossier de presse
function confirmPubDpresse(id)
{
	if (confirm("Etes-vous sûr de vouloir publier ce dossier de presse ?"))
	{
		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmPubDpresse\" action=\"index.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"publi\">");
			document.write("<input type=\"hidden\" name=\"page\" value=\"dpresse\">");
			document.write("<input type=\"hidden\" name=\"dpr_id\" value=\"" + id + "\">");
			document.write("</form>");
			document.confirmPubDpresse.submit();
		}
		else
		{
			document.location.href = "index.php?page=dpresse&action=publi&dpr_id="+id;
		}
	}
	else
	{
		alert("Demande de publication annulée !");
	}
}

// Confirmation de suppression de revue de presse
function confirmSupprRpresse(id)
{
	if (confirm("Etes-vous sûr de vouloir supprimer cette revue de presse ?"))
	{
		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprRpresse\" action=\"index.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"delete\">");
			document.write("<input type=\"hidden\" name=\"page\" value=\"rpresse\">");
			document.write("<input type=\"hidden\" name=\"rpr_id\" value=\"" + id + "\">");
			document.write("</form>");
			document.confirmSupprRpresse.submit();
		}
		else
		{
			document.location.href = "index.php?page=rpresse&action=delete&rpr_id="+id;
		}
	}
	else
	{
		alert("Demande de suppression annulée !");
	}
}

// Confirmation de publication de revue de presse
function confirmPubRpresse(id)
{
	if (confirm("Etes-vous sûr de vouloir publier cette revue de presse ?"))
	{
		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmPubRpresse\" action=\"index.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"publi\">");
			document.write("<input type=\"hidden\" name=\"page\" value=\"rpresse\">");
			document.write("<input type=\"hidden\" name=\"rpr_id\" value=\"" + id + "\">");
			document.write("</form>");
			document.confirmPubRpresse.submit();
		}
		else
		{
			document.location.href = "index.php?page=rpresse&action=publi&rpr_id="+id;
		}
	}
	else
	{
		alert("Demande de publication annulée !");
	}
}

// Confirmation de suppression de communique de presse
function confirmSupprCpresse(id)
{
	if (confirm("Etes-vous sûr de vouloir supprimer ce communiqué de presse ?"))
	{
		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprCpresse\" action=\"index.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"delete\">");
			document.write("<input type=\"hidden\" name=\"page\" value=\"cpresse\">");
			document.write("<input type=\"hidden\" name=\"cpr_id\" value=\"" + id + "\">");
			document.write("</form>");
			document.confirmSupprCpresse.submit();
		}
		else
		{
			document.location.href = "index.php?page=cpresse&action=delete&cpr_id="+id;
		}
	}
	else
	{
		alert("Demande de suppression annulée !");
	}
}

// Confirmation de publication de communique de presse
function confirmPubCpresse(id)
{
	if (confirm("Etes-vous sûr de vouloir publier ce communiqué de presse ?"))
	{
		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmPubCpresse\" action=\"index.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"publi\">");
			document.write("<input type=\"hidden\" name=\"page\" value=\"cpresse\">");
			document.write("<input type=\"hidden\" name=\"cpr_id\" value=\"" + id + "\">");
			document.write("</form>");
			document.confirmPubCpresse.submit();
		}
		else
		{
			document.location.href = "index.php?page=cpresse&action=publi&cpr_id="+id;
		}
	}
	else
	{
		alert("Demande de publication annulée !");
	}
}

// Confirmation de retirage de la publication
function confirmRetPub(id,categorie)
{
	if (confirm("Etes-vous sûr de vouloir retirer de la publication cette information ?"))
	{
		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmRetPub\" action=\"index.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"retirer\">");
			document.write("<input type=\"hidden\" name=\"page\" value=\"publication\">");
			document.write("<input type=\"hidden\" name=\"categorie\" value=\"" + categorie + "\">");
			document.write("<input type=\"hidden\" name=\"id\" value=\"" + id + "\">");
			document.write("</form>");
			document.confirmRetPub.submit();
		}
		else
		{
			document.location ='index.php?page=publication&action=retirer&categorie='+categorie+'&id='+id;
		}
	}
	else
	{
		alert("Demande annulée !");
	}
}

// Confirmation de suppression de la candidature
function confirmSuppCan(id, cv, mot)
{
	if (confirm("Etes-vous sûr de vouloir supprimer cette candidature ?"))
	{
		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSuppCan\" action=\"index.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"delete\">");
			document.write("<input type=\"hidden\" name=\"page\" value=\"candidature\">");
			document.write("<input type=\"hidden\" name=\"can_id\" value=\"" + id + "\">");
			document.write("<input type=\"hidden\" name=\"can_cv\" value=\"" + cv + "\">");
			document.write("<input type=\"hidden\" name=\"can_mot\" value=\"" + mot + "\">");
			document.write("</form>");
			document.confirmSuppCan.submit();
		}
		else
		{
			document.location ='index.php?page=candidature&action=delete&can_id='+id+'&can_cv='+cv+'&can_mot='+mot;
		}
	}
	else
	{
		alert("Demande de suppression annulée !");
	}
}

// Confirmation de suppression d'un acces FTP
function confirmSuppFtp(id)
{
	if (confirm("Etes-vous sûr de vouloir supprimer cet acces FTP ?"))
	{
		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSuppFtp\" action=\"index.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"delete\">");
			document.write("<input type=\"hidden\" name=\"page\" value=\"espaceftp\">");
			document.write("<input type=\"hidden\" name=\"cftp_id\" value=\"" + id + "\">");
			document.write("</form>");
			document.confirmSuppFtp.submit();
		}
		else
		{
			document.location ='index.php?page=espaceftp&action=delete&cftp_id='+id;
		}
	}
	else
	{
		alert("Demande de suppression annulée !");
	}
}



// Confirmation de suppression des questions CE
function confirmSupprQce(id)
{
	if (confirm("Etes-vous sûr de vouloir supprimer cette question ?"))
	{
		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprQce\" action=\"gestionqce.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"delete\">");
			document.write("<input type=\"hidden\" name=\"page\" value=\"gestionqce\">");
			document.write("<input type=\"hidden\" name=\"qce_id\" value=\"" + id + "\">");
			document.write("</form>");
			document.confirmSupprQce.submit();
		}
		else
		{
			document.location ='gestionqce.php?page=gestionqce&action=delete&qce_id='+id;
		}
	}
	else
	{
		alert("Demande de suppression annulée !");
	}
}



// Confirmation de suppression d'une activité
function confirmSupprActivite(id)
{
	if (confirm("Etes-vous sûr de vouloir supprimer cette activité ?"))
	{
   		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprActivite\" action=\"annuaire_activite.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"delete\">");
			document.write("<input type=\"hidden\" name=\"acti_id\" value=\"" + id + "\">");
			document.write("</form>");
			document.confirmSupprActivite.submit();
		}
		else
		{
			document.location.href = "annuaire_activite.php?action=delete&acti_id="+id;
		}
	}
	else
	{
		alert("Demande de suppression annulée !");
	}
}

// Confirmation de suppression d'un type
function confirmSupprType(id)
{
	if (confirm("Etes-vous sûr de vouloir supprimer ce type ?"))
	{
   		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprType\" action=\"annuaire_type.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"delete\">");
			document.write("<input type=\"hidden\" name=\"typ_id\" value=\"" + id + "\">");
			document.write("</form>");
			document.confirmSupprType.submit();
		}
		else
		{
			document.location.href = "annuaire_type.php?action=delete&typ_id="+id;
		}
	}
	else
	{
		alert("Demande de suppression annulée !");
	}
}

// Confirmation de suppression d'un type d'adresse
function confirmSupprTypeAdresse(id)
{
	if (confirm("Etes-vous sûr de vouloir supprimer ce type d'adresse ?"))
	{
   		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprTypeAdresse\" action=\"annuaire_type_adresse.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"delete\">");
			document.write("<input type=\"hidden\" name=\"typ_adr_id\" value=\"" + id + "\">");
			document.write("</form>");
			document.confirmSupprTypeAdresse.submit();
		}
		else
		{
			document.location.href = "annuaire_type_adresse.php?action=delete&typ_adr_id="+id;
		}
	}
	else
	{
		alert("Demande de suppression annulée !");
	}
}

// Confirmation de suppression d'un contact
function confirmSupprContact(id,id2)
{
	if (confirm("Etes-vous sûr de vouloir supprimer ce contact ?"))
	{
		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprContact\" action=\"annuaire.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"deletecontact\">");
			document.write("<input type=\"hidden\" name=\"con_id\" value=\"" + id + "\">");
			document.write("<input type=\"hidden\" name=\"soc_id\" value=\"" + id2 + "\">");
			document.write("</form>");
			document.confirmSupprContact.submit();
		}
		else
		{
			document.location.href= "annuaire.php?action=deletecontact&con_id="+id+"&soc_id="+id2;
		}
	}
	else
	{
		alert("Demande de suppression annulée !");
	}
}

// Confirmation de suppression d'une adresse
function confirmSupprAdresse(id,id2,id3)
{
	if (confirm("Etes-vous sûr de vouloir supprimer cette adresse ?"))
	{
   		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprAdresse\" action=\"annuaire.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"deleteadresse\">");
			document.write("<input type=\"hidden\" name=\"adr_id\" value=\"" + id + "\">");
			document.write("<input type=\"hidden\" name=\"soc_id\" value=\"" + id2 + "\">");
			document.write("<input type=\"hidden\" name=\"typ_adr_id\" value=\"" + id3 + "\">");
			document.write("</form>");
			document.confirmSupprAdresse.submit();
		}
		else
		{
			document.location.href = "annuaire.php?action=deleteadresse&adr_id="+id+"&soc_id="+id2+"&typ_adr_id="+id3;
		}
	}
	else
	{
		alert("Demande de suppression annulée !");
	}
}

function confirmSupprProjet_tache(tac_id, pro_id)
// Confirmation de suppression de projet_tache
{
	if (confirm("Etes-vous sûr de vouloir supprimer cette tâche ?"))
	{
		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprProjet_tache\" action=\"projet.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"deleteTache\">");
			document.write("<input type=\"hidden\" name=\"tac_id\" value= \"" + tac_id + "\">");
			document.write("<input type=\"hidden\" name=\"tac_id\" value= \"" + pro_id + "\">");
			document.write("</form>");
			document.confirmSupprProjet_tache.submit();
		}
		else
		{
			document.location.href = "projet.php?action=deleteTache&tac_id="+tac_id+"&pro_id="+pro_id;
		}
	}
	else
	{
		alert("Demande de suppression annulée !");
	}
}

// Confirmation de suppression d'une adresse de contact
function confirmSupprAdresseContact(id,id2,id3)
{
	if (confirm("Etes-vous sûr de vouloir supprimer cette adresse de contact ?"))
	{
   		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprAdresseContact\" action=\"annuaire.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"deleteadressecontact\">");
			document.write("<input type=\"hidden\" name=\"adr_id\" value=\"" + id + "\">");
			document.write("<input type=\"hidden\" name=\"soc_id\" value=\"" + id2 + "\">");
			document.write("<input type=\"hidden\" name=\"con_id\" value=\"" + id3 + "\">");
			document.write("</form>");
			document.confirmSupprAdresseContact.submit();
		}
		else
		{
			document.location.href = "annuaire.php?action=deleteadressecontact&adr_id="+id+"&soc_id="+id2+"&con_id="+id3;
		}
	}
	else
	{
		alert("Demande de suppression annulée !");
	}
}
// Confirmation de suppression d'une société
function confirmSupprSociete(id)
{
	if (confirm("Etes-vous sûr de vouloir supprimer cette société et tous les éléments rattachés ?"))
	{
   		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprSociete\" action=\"annuaire.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"delete\">");
			document.write("<input type=\"hidden\" name=\"soc_id\" value=\"" + id + "\">");
			document.write("</form>");
			document.confirmSupprSociete.submit();
		}
		else
		{
			document.location.href = "annuaire.php?action=delete&soc_id="+id;
		}
	}
	else
	{
		alert("Demande de suppression annulée !");
	}
}

// Confirmation de suppression d'un rendez-vous
function confirmSupprRdv(rdv_id, dateJour, periodique)
{
	if (periodique == 0)
	{
		if (confirm("Etes-vous sûr de vouloir supprimer ce rendez-vous ?"))
		{
			var test = getNavigateur();
			if (test.indexOf("Mac",0)>0)
			{
				document.write("<form name=\"confirmSupprRdv\" action=\"planning.php\" method=\"POST\" target=\"jour\"");
				document.write("<input type=\"hidden\" name=\"action\" value=\"deleterdv\">");
				document.write("<input type=\"hidden\" name=\"rdv_id\" value=\"" + rdv_id + "\">");
				document.write("<input type=\"hidden\" name=\"date\" value=\"" + dateJour + "\">");
				document.write("<input type=\"hidden\" name=\"rdv_periodique\" value=\"" + periodique + "\">");
				document.write("</form>");
				document.confirmSupprRdv.submit();
			}
			else
			{
				window.open("planning.php?action=deleterdv&rdv_id="+rdv_id+"&date="+dateJour+"&rdv_periodique="+periodique,'jour');
			}
		}
		else
		{
			alert("Demande de suppression annulée !");
		}
	}
	else
	{
		if (confirm("Etes-vous sûr de vouloir supprimer ce rendez-vous ainsi que tous les rendez vous périodique ?"))
		{
			var test = getNavigateur();
			if (test.indexOf("Mac",0)>0)
			{
				document.write("<form name=\"confirmSupprRdv\" action=\"planning.php\" method=\"POST\" target=\"jour\"");
				document.write("<input type=\"hidden\" name=\"action\" value=\"deleterdv\">");
				document.write("<input type=\"hidden\" name=\"rdv_id\" value=\"" + rdv_id + "\">");
				document.write("<input type=\"hidden\" name=\"date\" value=\"" + dateJour + "\">");
				document.write("<input type=\"hidden\" name=\"rdv_periodique\" value=\"" + periodique + "\">");
				document.write("</form>");
				document.confirmSupprRdv.submit();
			}
			else
			{
				window.open("planning.php?action=deleterdv&rdv_id="+rdv_id+"&date="+dateJour+"&rdv_periodique="+periodique,'jour');
			}
		}
		else
		{
			alert("Demande de suppression annulée !");
		}
	}
}

// Confirmation de suppression d'un FTP Externe
function confirmSupprFtpFromAnnuaire(id, soc_id)
{
	if (confirm("Etes-vous sûr de vouloir supprimer cet acces FTP ?"))
	{
   		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprFtp\" action=\"annuaire_ftp.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"delete\">");
			document.write("<input type=\"hidden\" name=\"ftp_id\" value=\"" + id + "\">");
			document.write("<input type=\"hidden\" name=\"soc_id\" value=\"" + soc_id + "\">");
			document.write("</form>");
			document.confirmSupprFtp.submit();
		}
		else
		{
			document.location.href = "annuaire_ftp.php?action=delete&ftp_id="+id+"&soc_id="+soc_id;
		}
	}
	else
	{
		alert("Demande de suppression annulée !");
	}
}

function confirmSupprChrono(chr_id, pro_id)
// Confirmation de suppression de chrono
{
	if (confirm("Etes-vous sûr de vouloir supprimer ce chrono ?"))
	{
		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprChrono\" action=\"projet.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"deleteChrono\">");
			document.write("<input type=\"hidden\" name=\"chr_id\" value= \"" + chr_id + "\">");
			document.write("<input type=\"hidden\" name=\"pro_id\" value= \"" + pro_id + "\">");
			document.write("</form>");
			document.confirmSupprChrono.submit();
		}
		else
		{
			document.location.href = "projet.php?action=deleteChrono&chr_id="+chr_id+"&pro_id="+pro_id;
		}
	}
	else
	{
		alert("Demande de suppression annulée !");
	}
}

// Confirmation de suppression d'un FTP Externe
function confirmSupprFtpFromFTP(id)
{
	if (confirm("Etes-vous sûr de vouloir supprimer cet acces FTP ?"))
	{
   		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprFtp\" action=\"ftp.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"delete\">");
			document.write("<input type=\"hidden\" name=\"ftp_id\" value=\"" + id + "\">");
			document.write("</form>");
			document.confirmSupprFtp.submit();
		}
		else
		{
			document.location.href = "ftp.php?action=delete&ftp_id="+id;
		}
	}
	else
	{
		alert("Demande de suppression annulée !");
	}
}

//cette fonction permet d'afficher la liste déroulante logiciel ou materiel
//dans l'ecran base de connaissance
function afficheDiv(f)
{
	tab_catprob_id = f.value.split(',');
	catprob_id = tab_catprob_id[1];

	$objLogiciel = document.getElementById("divLogiciel");
	$objMachine = document.getElementById("divMachine");

	if (catprob_id == 'Logiciel')
	{
		$objLogiciel.style.display = 'block';
		$objMachine.style.display = 'none';
	}
	if (catprob_id == 'Matériel')
	{
		$objLogiciel.style.display = 'none';
		$objMachine.style.display = 'block';
	}
	if (catprob_id != 'Logiciel' && catprob_id != 'Matériel')
	{
		$objLogiciel.style.display = 'none';
		$objMachine.style.display = 'none';
	}
}

//cette fonction submit un formulaire
function envoiForm(nomForm)
{
	document.forms[nomForm].submit();
}

//cette fonction ajoute une variable dans le formulaire formu
// au champ champ
function ajoutTable(formu, champ, valeur)
{
	if (document.forms[formu].elements[champ].value == '')
	{
		virgule = "";
	}
	else
	{
		virgule = ",";
	}
	document.forms[formu].elements[champ].value = document.forms[formu].elements[champ].value + virgule + valeur;
}

//cette fonction selectionne toutes les tables
// du formulaire formu
function selectionTable(formu, champ, nbTable, lstTable)
{
	for (i=0; i<nbTable; i++)
	{
		document.forms[formu].elements[champ + i].checked = true;
		document.forms[formu].lstTable.value = lstTable;
	}
}

// Quittage brutal de session de chemin de fer
function fermetureBrutale()
{
	if (confirm("Vous venez de quitter l'application.\n\nVous pouvez encore sauvegarder vos modifications si vous ne l'avez pas déjà fait.\n\nCliquer sur OK pour sauvegarder vos modifications.\nCliquer sur annuler pour ne pas sauvegarder."))
	{
		window.open('fer.php?action=testsession&quit=true','_blank');
	}
	else
	{
		window.open('fer.php?action=quit','_blank');
	}
}

function alerteSaisie(message,sujet,test)
{
	if (test.value == "NO")
	{
		if (confirm("Etes vous sur de vouloir quitter ?\n\nTexte en cours de rédaction"))
		{
			alert("Texte Perdu !");
		}
		else
		{
		window.open("mailer.php?action=reload&message="+message.value+"&sujet="+sujet.value,"AlerteSaisie", "width=100,height=100");
		}
	}
}
//gestion de l'ecrasement d'un fichier uploader
function confirmationEcrase(listefichier, formu, champPhoto)
{
	var champ = champPhoto.name;
	var lstFichier = listefichier.split("#");
	var champPhoto = champPhoto.value;
	var lspPhoto = champPhoto.split("\\");
	var taille = lspPhoto.length;
	
	photo = lspPhoto[taille -1];
	for (i=0; i<lstFichier.length; i++)
	{
		if (lstFichier[i] == photo)
		{
			rep = confirm('Voulez vous remplacer la photo : ' + photo + ' ?');
			if (rep == true)
			{
				document.forms[formu].elements['ecraseFichier'+champ].value="true";
			}
			else
			{
				document.forms[formu].elements['ecraseFichier'+champ].value="false";
			}
		}
	}
	return true;
}

//verification du formulaire de tache pour le projet
function verifProjetTache(f)
{
	if (f.uti_code.value =="")
	{
		alert("Veuillez sélectionner une personne !");
		return false;
	}
	if (f.tac_intitule.value =="")
	{
		alert("Veuillez remplir l'intitulé !");
		f.tac_intitule.focus();
		return false;
	}
	return true;
}


function projetDelete(pro_id)
{
	rep = confirm("Attention voulez vous réellement supprimer le projet\nainsi que toutes ses pièces jointes ?");
	if (rep == true)
	{
		document.location= "projet.php?action=deleteProjet&pro_id="+pro_id;
	}
}

function confirmSupprEmbauche(emb_id)
// Confirmation de suppression de embauche
{
	if (confirm("Etes-vous sûr de vouloir supprimer ce embauche ?"))
	{
		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprEmbauche\" action=\"embauche.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"delete\">");
			document.write("<input type=\"hidden\" name=\"emb_id\" value= \"" + emb_id + "\">");
			document.write("</form>");
			document.confirmSupprEmbauche.submit();
		}
		else
		{
			document.location.href = "embauche.php?action=delete&emb_id="+emb_id;
		}
	}
	else
	{
		alert("Demande de suppression annulée !");
	}
}

function confirmSupprHeuresup(hsup_id)
// Confirmation de suppression de heuresup
{
	if (confirm("Etes-vous sûr de vouloir supprimer ce heuresup ?"))
	{
		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprHeuresup\" action=\"heuresup.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"delete\">");
			document.write("<input type=\"hidden\" name=\"hsup_id\" value= \"" + hsup_id + "\">");
			document.write("</form>");
			document.confirmSupprHeuresup.submit();
		}
		else
		{
			document.location.href = "heuresup.php?action=delete&hsup_id="+hsup_id;
		}
	}
	else
	{
		alert("Demande de suppression annulée !");
	}
}

function confirmSupprDeplacement(dep_id)
// Confirmation de suppression de deplacement
{
	if (confirm("Etes-vous sûr de vouloir supprimer ce deplacement ?"))
	{
		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprDeplacement\" action=\"deplacement.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"delete\">");
			document.write("<input type=\"hidden\" name=\"dep_id\" value= \"" + dep_id + "\">");
			document.write("</form>");
			document.confirmSupprDeplacement.submit();
		}
		else
		{
			document.location.href = "deplacement.php?action=delete&dep_id="+dep_id;
		}
	}
	else
	{
		alert("Demande de suppression annulée !");
	}
}

function confirmSupprProcessus(proc_id)
// Confirmation de suppression de processus
{
	if (confirm("Etes-vous sûr de vouloir supprimer ce processus ?"))
	{
		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprProcessus\" action=\"processus.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"delete\">");
			document.write("<input type=\"hidden\" name=\"proc_id\" value= \"" + proc_id + "\">");
			document.write("</form>");
			document.confirmSupprProcessus.submit();
		}
		else
		{
			document.location.href = "processus.php?action=delete&proc_id="+proc_id;
		}
	}
	else
	{
		alert("Demande de suppression annulée !");
	}
}

function confirmSupprTypem(typem_id)
// Confirmation de suppression de type d'emetteur
{
	if (confirm("Etes-vous sûr de vouloir supprimer ce type d'emetteur ?"))
	{
		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprTypem\" action=\"type_emetteur.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"delete\">");
			document.write("<input type=\"hidden\" name=\"typem_id\" value= \"" + typem_id + "\">");
			document.write("</form>");
			document.confirmSupprTypem.submit();
		}
		else
		{
			document.location.href = "type_emetteur.php?action=delete&typem_id="+typem_id;
		}
	}
	else
	{
		alert("Demande de suppression annulée !");
	}
}

function confirmSupprModplact(modplact_id)
// Confirmation de suppression d'un module du plan action
{
	if (confirm("Etes-vous sûr de vouloir supprimer ce module du plan action ?"))
	{
		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprModplact\" action=\"module_plan_action.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"delete\">");
			document.write("<input type=\"hidden\" name=\"modplact_id\" value= \"" + modplact_id + "\">");
			document.write("</form>");
			document.confirmSupprModplact.submit();
		}
		else
		{
			document.location.href = "module_plan_action.php?action=delete&modplact_id="+modplact_id;
		}
	}
	else
	{
		alert("Demande de suppression annulée !");
	}
}

function confirmSupprTypact(typact_id)
// Confirmation de suppression de type d'action
{
	if (confirm("Etes-vous sûr de vouloir supprimer ce type d'action ?"))
	{
		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprTypact\" action=\"type_action.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"delete\">");
			document.write("<input type=\"hidden\" name=\"typact_id\" value= \"" + typact_id + "\">");
			document.write("</form>");
			document.confirmSupprTypact.submit();
		}
		else
		{
			document.location.href = "type_action.php?action=delete&typact_id="+typact_id;
		}
	}
	else
	{
		alert("Demande de suppression annulée !");
	}
}

function confirmSupprFnc(fnc_id, page, retour_page)
// Confirmation de suppression de fnc
{
	if (confirm("Etes-vous sûr de vouloir supprimer cette fiche de non conformité ?"))
	{
		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprFnc\" action=\"" + page + "\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"delete\">");
			document.write("<input type=\"hidden\" name=\"fnc_id\" value= \"" + fnc_id + "\">");
			document.write("<input type=\"hidden\" name=\"retour_page\" value= \"" + retour_page + "\">");
			document.write("</form>");
			document.confirmSupprFnc.submit();
		}
		else
		{
			document.location.href = page + "?action=delete&fnc_id="+fnc_id+"&retour_page="+retour_page;
		}
	}
	else
	{
		alert("Demande de suppression annulée !");
	}
}

function confirmSupprPlaction(plact_id)
// Confirmation de suppression de plaction
{
	if (confirm("Etes-vous sûr de vouloir supprimer cette action ?"))
	{
		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprPlaction\" action=\"plaction.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"delete\">");
			document.write("<input type=\"hidden\" name=\"plact_id\" value= \"" + plact_id + "\">");
			document.write("</form>");
			document.confirmSupprPlaction.submit();
		}
		else
		{
			document.location.href = "plaction.php?action=delete&plact_id="+plact_id;
		}
	}
	else
	{
		alert("Demande de suppression annulée !");
	}
}

function confirmSupprPlan(pla_id)
// Confirmation de suppression de plan
{
	if (confirm("Toutes les actions liées à ce plan seront supprimées.\n\nEtes-vous sûr de vouloir supprimer ce plan d'action ?"))
	{
		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprPlan\" action=\"plan.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"delete\">");
			document.write("<input type=\"hidden\" name=\"pla_id\" value= \"" + pla_id + "\">");
			document.write("</form>");
			document.confirmSupprPlan.submit();
		}
		else
		{
			document.location.href = "plan.php?action=delete&pla_id="+pla_id;
		}
	}
	else
	{
		alert("Demande de suppression annulée !");
	}
}

function confirmSupprTyp_abs(typ_abs_id)

// Confirmation de suppression de typ_abs
{
	if (confirm("Etes-vous sûr de vouloir supprimer ce typ_abs ?"))
	{
		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprTyp_abs\" action=\"absence_type.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"delete\">");
			document.write("<input type=\"hidden\" name=\"typ_abs_id\" value= \"" + typ_abs_id + "\">");
			document.write("</form>");
			document.confirmSupprTyp_abs.submit();
		}
		else
		{
			document.location.href = "absence_type.php?action=delete&typ_abs_id="+typ_abs_id;
		}
	}
	else
	{
		alert("Demande de suppression annulée !");
	}
}

function confirmSupprTyp_projet(typ_pro_id)

// Confirmation de suppression de typ_projet
{
	if (confirm("Etes-vous sûr de vouloir supprimer ce typ_projet ?"))
	{
		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprTyp_projet\" action=\"projet_type.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"delete\">");
			document.write("<input type=\"hidden\" name=\"typ_pro_id\" value= \"" + typ_pro_id + "\">");
			document.write("</form>");
			document.confirmSupprTyp_projet.submit();
		}
		else
		{
			document.location.href = "projet_type.php?action=delete&typ_pro_id="+typ_pro_id;
		}
	}
	else
	{
		alert("Demande de suppression annulée !");
	}
}

function confirmSupprBase_documentaire(bdoc_id)

// Confirmation de suppression de base_documentaire
{
	if (confirm("Etes-vous sûr de vouloir supprimer ce base_documentaire ?"))
	{
		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprBase_documentaire\" action=\"base_documentaire.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"delete\">");
			document.write("<input type=\"hidden\" name=\"bdoc_id\" value= \"" + bdoc_id + "\">");
			document.write("</form>");
			document.confirmSupprBase_documentaire.submit();
		}
		else
		{
			document.location.href = "base_documentaire.php?action=delete&bdoc_id="+bdoc_id;
		}
	}
	else
	{
		alert("Demande de suppression annulée !");
	}
}

function confirmSupprBdoc_categorie(bdoccat_id)

// Confirmation de suppression de bdoc_categorie
{
	if (confirm("Etes-vous sûr de vouloir supprimer ce bdoc_categorie ?"))
	{
		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprBdoc_categorie\" action=\"base_documentaire_categorie.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"delete\">");
			document.write("<input type=\"hidden\" name=\"bdoccat_id\" value= \"" + bdoccat_id + "\">");
			document.write("</form>");
			document.confirmSupprBdoc_categorie.submit();
		}
		else
		{
			document.location.href = "base_documentaire_categorie.php?action=delete&bdoccat_id="+bdoccat_id;
		}
	}
	else
	{
		alert("Demande de suppression annulée !");
	}
}

function confirmSupprProduit(pro_id)
// Confirmation de suppression de produit
{
	if (confirm("Etes-vous sûr de vouloir supprimer ce produit ?"))
	{
		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprProduit\" action=\"gestionproduit.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"delete\">");
			document.write("<input type=\"hidden\" name=\"pro_id\" value= \"" + pro_id + "\">");
			document.write("</form>");
			document.confirmSupprProduit.submit();
		}
		else
		{
			document.location.href = "gestionproduit.php?action=delete&pro_id="+pro_id;
		}
	}
	else
	{
		alert("Demande de suppression annulée !");
	}
}

function confirmSupprBl(bl_id, soc_id)
// Confirmation de suppression de bl
{
	if (confirm("Etes-vous sûr de vouloir supprimer ce bl ?"))
	{
		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprBl\" action=\"bon_livraison.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"delete\">");
			document.write("<input type=\"hidden\" name=\"bl_id\" value= \"" + bl_id + "\">");
			document.write("<input type=\"hidden\" name=\"soc_id\" value= \"" + soc_id + "\">");
			document.write("</form>");
			document.confirmSupprBl.submit();
		}
		else
		{
			document.location.href = "bon_livraison.php?action=delete&bl_id="+bl_id+"&soc_id="+soc_id;
		}
	}
	else
	{
		alert("Demande de suppression annulée !");
	}
}

function confirmSupprBl_produit(bl_id,pro_id,soc_id)
// Confirmation de suppression de bl_produit
{
	if (confirm("Etes-vous sûr de vouloir supprimer ce produit au bon de livraison ?"))
	{
		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprBl_produit\" action=\"bon_livraison.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"delete_bl_produit\">");
			document.write("<input type=\"hidden\" name=\"bl_id\" value= \"" + bl_id + "\">");
			document.write("<input type=\"hidden\" name=\"pro_id\" value= \"" + pro_id + "\">");
			document.write("<input type=\"hidden\" name=\"soc_id\" value= \"" + soc_id + "\">");
			document.write("</form>");
			document.confirmSupprBl_produit.submit();
		}
		else
		{
			document.location.href = "bon_livraison.php?action=delete_bl_produit&bl_id="+bl_id+"&pro_id="+pro_id+"&soc_id="+soc_id;
		}
	}
	else
	{
		alert("Demande de suppression annulée !");
	}
}


function confirmSupprArcade(arc_id)

// Confirmation de suppression de arcade
{
	if (confirm("Etes-vous sûr de vouloir supprimer ce arcade ?"))
	{
		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprArcade\" action=\"gestionarcade.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"delete\">");
			document.write("<input type=\"hidden\" name=\"arc_id\" value= \"" + arc_id + "\">");
			document.write("</form>");
			document.confirmSupprArcade.submit();
		}
		else
		{
			document.location.href = "arcade.php?action=delete&arc_id="+arc_id;
		}
	}
	else
	{
		alert("Demande de suppression annulée !");
	}
}

function confirmSupprType_transport(typ_transport_id)
// Confirmation de suppression de type_transport
{
	if (confirm("Etes-vous sûr de vouloir supprimer ce type_transport ?"))
	{
		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprType_transport\" action=\"gestiontype_transport.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"delete\">");
			document.write("<input type=\"hidden\" name=\"typ_transport_id\" value= \"" + typ_transport_id + "\">");
			document.write("</form>");
			document.confirmSupprType_transport.submit();
		}
		else
		{
			document.location.href = "gestiontype_transport.php?action=delete&typ_transport_id="+typ_transport_id;
		}
	}
	else
	{
		alert("Demande de suppression annulée !");
	}
}

function confirmSupprBE(be_id, soc_id)
// Confirmation de suppression de be
{
	if (confirm("Etes-vous sûr de vouloir supprimer ce be ?"))
	{
		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprBe\" action=\"bon_expedition.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"delete\">");
			document.write("<input type=\"hidden\" name=\"be_id\" value= \"" + be_id + "\">");
			document.write("<input type=\"hidden\" name=\"soc_id\" value= \"" + soc_id + "\">");
			document.write("</form>");
			document.confirmSupprBe.submit();
		}
		else
		{
			document.location.href = "bon_expedition.php?action=delete&be_id="+be_id+"&soc_id="+soc_id;
		}
	}
	else
	{
		alert("Demande de suppression annulée !");
	}
}


function verifChampType()
{
	if (document.news.type.value == 'autre')
	{
		alert('Attention êtes vous certain de vouloir choisir le type "Autre" \n le commentaire sera alors obligatoire !');
	}
}


function confirmSupprDevisVersion(devis_id)

// Confirmation de suppression d'une version d'un devis
{
	if (confirm("Etes-vous sûr de vouloir supprimer ce devis ?"))
	{
		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprDevisVersion\" action=\"devis.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"delete_version\">");
			document.write("<input type=\"hidden\" name=\"devis_id\" value= \"" + devis_id + "\">");
			document.write("</form>");
			document.confirmSupprDevisVersion.submit();
		}
		else
		{
			document.location.href = "devis.php?action=delete_version&devis_id="+devis_id;
		}
	}
	else
	{
		alert("Demande de suppression annulée !");
	}
}



function confirmSupprDevis(devis_numero)

// Confirmation de suppression d'un devis et toutes ses versions
{
	if (confirm("Etes-vous sûr de vouloir supprimer ce devis ainsi que toutes les versions qu'il contient ?"))
	{
		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprDevis\" action=\"devis.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"delete_devis\">");
			document.write("<input type=\"hidden\" name=\"devis_numero\" value= \"" + devis_numero + "\">");
			document.write("</form>");
			document.confirmSupprDevis.submit();
		}
		else
		{
			document.location.href = "devis.php?action=delete_devis&devis_numero="+devis_numero;
		}
	}
	else
	{
		alert("Demande de suppression annulée !");
	}
}




function confirmSupprDirection(direction_id)

// Confirmation de suppression de direction
{
	if (confirm("Etes-vous sûr de vouloir supprimer ce direction ?"))
	{
		var test = getNavigateur();
		if (test.indexOf("Mac",0)>0)
		{
			document.write("<form name=\"confirmSupprDirection\" action=\"direction.php\" method=\"POST\"");
			document.write("<input type=\"hidden\" name=\"action\" value=\"delete\">");
			document.write("<input type=\"hidden\" name=\"direction_id\" value= \"" + direction_id + "\">");
			document.write("</form>");
			document.confirmSupprDirection.submit();
		}
		else
		{
			document.location.href = "direction.php?action=delete&direction_id="+direction_id;
		}
	}
	else
	{
		alert("Demande de suppression annulée !");
	}
}


function addLigne(num_grp)
{
	document.devis.status.value='add';
	document.devis.groupe.value=num_grp;
	document.devis.submit();
	return true;
}


function addGroupe()
{
	document.devis.status.value='groupe_add';
	document.devis.submit();
	return true;
}



function removeGroupe(devis_groupe_index)
{
	document.devis.status.value='groupe_remove';
	document.devis.groupe.value=devis_groupe_index;
	document.devis.submit();
	return true;
}



function delLigne(devis_groupe_index,devis_ligne_index)
{
	document.devis.status.value='delete';
	document.devis.del_index.value=devis_ligne_index;
	document.devis.groupe.value=devis_groupe_index;
	document.devis.focus.value="lkjlkjlk";
	document.devis.submit();
	return true;
}


function updatePDF()
{
	document.devis.focus.value='change';
	document.devis.status.value='kjhsdqfkjhsdf';
	document.devis.submit();
	return false;
}

