  // Popup Articles Associés
  function PopArticleAssoc(id_article)
  {
    var haut=(screen.height-400)/2;
    var gauche=(screen.width-770)/2;
    poparticleassoc=window.open('pop_articleassoc.php?Id='+id_article,'poparticleassoc','top='+haut+',left='+gauche+',toolbar=0, location=0, directories=0, status=0, scrollbars=1, resizable=0, copyhistory=0, menuBar=0, width=810, height=350');
    if (poparticleassoc.blur) poparticleassoc.focus();
  }
  
  // Popup Documents Associés
  function PopDocumentAssoc(id_article)
  {
    var haut=(screen.height-400)/2;
    var gauche=(screen.width-770)/2;
    popdocumentassoc=window.open('pop_documentassoc.php?Id='+id_article,'popdocumentassoc','top='+haut+',left='+gauche+',toolbar=0, location=0, directories=0, status=0, scrollbars=1, resizable=0, copyhistory=0, menuBar=0, width=810, height=350');
    if (popdocumentassoc.blur) popdocumentassoc.focus();
  }
    
  // Popup PopAmi
  function PopAmi(Dossier, url)
  {
    var haut=(screen.height-420)/2;
    var gauche=(screen.width-555)/2;
    popami=window.open(Dossier+'ami.php?Url='+url+'','popami','top='+haut+',left='+gauche+',toolbar=0, location=0, directories=0, status=0, scrollbars=1, resizable=0, copyhistory=0, menuBar=0, width=555, height=420');
    if (popami.blur) popami.focus();
  }
  
  // Fonction d'affichage/masquage des mois de l'AGENDA
  function ShowHideAgenda(DivId)
  {
	targetElement1 = document.getElementById('agenda-enroule-'+DivId);
	targetElement2 = document.getElementById('agenda-deroule-'+DivId);
	targetImg = document.getElementById('img-agenda-'+DivId);
	
	imgPlus = new Image;
	imgPlus.src = 'img/agenda/agenda_03.gif';
	
	imgMoins = new Image;
	imgMoins.src = 'img/agenda/agenda_02.gif';
	
	if(targetElement1.style.display == ""){
		targetElement1.style.display = "none";
		targetElement2.style.display = "";
		targetImg.src = imgMoins.src;
	}
	else{
		targetElement1.style.display = "";
		targetElement2.style.display = "none";
		targetImg.src = imgPlus.src;
	}
  }
  

  // Gestion de l'affichage des menus dynamiques
  function montre(id)  {
	if (document.getElementById) document.getElementById(id).style.display="block";
	else if (document.all) document.all[id].style.display="block";
	else if (document.layers) document.layers[id].display="block";
  }
		
  function cache(id) {
	if (document.getElementById) document.getElementById(id).style.display="none";
	else if (document.all) document.all[id].style.display="none";
	else if (document.layers) document.layers[id].display="none";
  }
  
  
/****************************************************************/
/*     findInPage(): recherche et met en surbrillance le mot    */
/*     passe en parametre                                       */
/****************************************************************/

function findInPage(str)
{
  var txt, i, found;
  var n=0;
  txt = window.document.body.createTextRange();
  
  for (i = 0; i <= n && (found = txt.findText(str)) != false; i++) 
  {
    txt.moveStart("character", 1);
    txt.moveEnd("textedit");
  }
  
  if (found) 
  {
    txt.moveStart("character", -1);
    txt.findText(str);
    txt.select();
    txt.scrollIntoView();
    n++;
  }
  else 
  {
    if (n > 0) 
    {
      n = 0;
    }
    else
    {
      alert("Aucun mot ne correspond a la recherche");
    }
  }
} 