  //Popup Diaporama Presentation
  function PopDiaporamaPresentation()
  {
    var haut=(screen.height-400)/2;
    var gauche=(screen.width-600)/2;
    popdiapo=window.open('presentation-atelier.php','popdiapo','top='+haut+',left='+gauche+',toolbar=0, location=0, directories=0, status=0, scrollbars=0, resizable=0, copyhistory=0, menuBar=0, width=600, height=400');
    if (popdiapo.blur) popdiapo.focus();
  }
  
  //Popup Galerie
  function PopPhotoAssoc(id_article)
  {
    var haut=(screen.height-570)/2;
    var gauche=(screen.width-570)/2;
    popphotos=window.open('pop_photos.php?Id='+id_article,'popphotos','top='+haut+',left='+gauche+',toolbar=0, location=0, directories=0, status=0, scrollbars=1, resizable=0, copyhistory=0, menuBar=0, width=570, height=570');
    if (popphotos.blur) popphotos.focus();
  }
  
  //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 Options Associés
  function PopOptionAssoc(id_article)
  {
    var haut=(screen.height-400)/2;
    var gauche=(screen.width-770)/2;
    popoptionassoc=window.open('pop_optionassoc.php?Id='+id_article,'popoptionassoc','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 (popoptionassoc.blur) popoptionassoc.focus();
  }
  
  //Popup Options par Defaut
  function PopOptionDefaut(id_article)
  {
    var haut=(screen.height-400)/2;
    var gauche=(screen.width-770)/2;
    popoptiondefaut=window.open('pop_optiondefaut.php?Id='+id_article,'popoptiondefaut','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 (popoptiondefaut.blur) popoptiondefaut.focus();
  }
  
  //Popup PopAmi
  function PopAmi(Dossier, url)
  {
    var haut=(screen.height-420)/2;
    var gauche=(screen.width-515)/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=515, height=420');
    if (popami.blur) popami.focus();
  }
  
  //Popup PopLegende
  function PopLegende(Dossier)
  {
    var haut=(screen.height-600)/2;
    var gauche=(screen.width-600)/2;
    poplegende=window.open(Dossier+'fiche-article-legende.php','poplegende','top='+haut+',left='+gauche+',toolbar=0, location=0, directories=0, status=0, scrollbars=0, resizable=0, copyhistory=0, menuBar=0, width=600, height=600');
    if (poplegende.blur) poplegende.focus();
  }
  
  //Popup PopFaq1
  function PopFaq1(Dossier)
  {
    var haut=(screen.height-523)/2;
    var gauche=(screen.width-563)/2;
    popfaq1=window.open(Dossier+'questions-aide-1.php','popfaq1','top='+haut+',left='+gauche+',toolbar=0, location=0, directories=0, status=0, scrollbars=0, resizable=0, copyhistory=0, menuBar=0, width=563, height=523');
    if (popfaq1.blur) popfaq1.focus();
  }
  
  //Popup PopFaq2
  function PopFaq2(Dossier)
  {
    var haut=(screen.height-531)/2;
    var gauche=(screen.width-653)/2;
    popfaq2=window.open(Dossier+'questions-aide-2.php','popfaq2','top='+haut+',left='+gauche+',toolbar=0, location=0, directories=0, status=0, scrollbars=0, resizable=0, copyhistory=0, menuBar=0, width=653, height=531');
    if (popfaq2.blur) popfaq2.focus();
  }
  
  //Popup Tarifs Associés
  function PopTarifsDimension(id_article)
  {
    var haut=(screen.height-400)/2;
    var gauche=(screen.width-770)/2;
    poptarifsdimension=window.open('pop_tarifs.php?IdArticle='+id_article,'poptarifsdimension','top='+haut+',left='+gauche+',toolbar=0, location=0, directories=0, status=0, scrollbars=1, resizable=0, copyhistory=0, menuBar=0, width=810, height=400');
    if (poptarifsdimension.blur) poptarifsdimension.focus();
  }
  
  
  // Gestion des dimensions / tarifs Flash  
  function SetIdTarif(IdTarif)
  { 
    	document.getElementById('IdTarif').value = IdTarif;
  }
  
  // Gestion des dimensions / tarifs Flash  
  function VerifIdTarif()
  { 
	if(document.getElementById('IdTarif'))
	{
		if(document.getElementById('IdTarif').value == '' || document.getElementById('IdTarif').value == '0')
		{
			alert('Vous devez séléctionner une largeur et une hauteur');	
			return false;
		}
		else if(!IsInteger(document.getElementById('Quantite').value))
		{
			alert('La quantité doit être un chiffre entre 1 et 999');
			return false;
		}
		else return true;
	}
	else
	{
		if(!IsInteger(document.getElementById('Quantite').value))
		{
			alert('La quantité doit être un chiffre entre 1 et 999');
			return false;
		}
		else return  true;
	}
  }	
  
  // Verifie que la chaine est bien un entier
  function IsInteger(s) 
  {
	for (var i = 0; i < s.length; i++) 
	{
		var c = s.charAt(i);
		if (!((c >= "0") && (c <= "9")) || s==0) 
		{
			return false;
		}
	}
	return true;
  }
	
  // Compte les caractères du champs passé en paramètre
  function Compter(Target, max, nomchamp)
  {
  	StrLen = Target.value.length
  	if (StrLen > max )
  	{
    	Target.value = Target.value.substring(0,max);
    	CharsLeft = max;								
  	}
  	else
  	{
    	CharsLeft = StrLen;
  	}	
 	 nomchamp.value = CharsLeft;
  }
  
  
  /***************************************************************************/
  // Affichage/Disparition d'un DIV
  /***************************************************************************/

  function ShowHide(DivId)
  {
	var targetElement;
	targetElement = document.getElementById(DivId) ;
	if (targetElement.style.display == "none") targetElement.style.display = "" ;
	else targetElement.style.display = "none" ;
  }
  
  function ShowHideGammeOptions(DivId)
  {
	targetElement1 = document.getElementById('EnteteDev-'+DivId);
	targetElement2 = document.getElementById('EnteteShrink-'+DivId);
	//targetElement3 = document.getElementById('EnteteDefaut-'+DivId) ;
	targetElement4 = document.getElementById('Options-'+DivId);
	
	if(targetElement1.style.display == ""){
		targetElement1.style.display = "none";
		targetElement2.style.display = "";
		//targetElement3.style.display = "none";
		targetElement4.style.display = "";
	}
	else{
		targetElement1.style.display = "";
		targetElement2.style.display = "none";
		//targetElement3.style.display = "";
		targetElement4.style.display = "none";
	}
  }
  
  function ShowHideDevis(DivId)
  {
	targetElement1 = document.getElementById('DevDevis_'+DivId);
	targetElement2 = document.getElementById('RedDevis_'+DivId);
	targetElement3 = document.getElementById('Devis_'+DivId);
	
	if(targetElement1.style.display == ""){
		targetElement1.style.display = "none";
		targetElement2.style.display = "";
		targetElement3.style.display = "";
	}
	else{
		targetElement1.style.display = "";
		targetElement2.style.display = "none";
		targetElement3.style.display = "none";
	}
  }
  
  
  /***************************************************************************/
  // 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";
  }
