function popupPdt(nom,w,h){
	sw=Math.round((screen.availWidth-w)/2);
	sh=Math.round((screen.availHeight-h)/2);
	window.open ('popup-pdt.php?nom='+nom, nom, config='width='+w+', height='+h+', top='+sh+', left='+sw+', toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no')
}
function popup_autre(url){
	sw=Math.round((screen.availWidth-500)/2);
	sh=Math.round((screen.availHeight-500)/2);
	window.open (url,"fiche","width=500,height=500,"+ sw +","+ sh +"")
}
function chang_rubrique(rub,nb){
	if (rub!=document.formulaire.rubrique.value)
	{
		if (document.formulaire.rubrique.value!="rien"){
			 if (document.formulaire.rubrique_nb.value!="100"){
				for (nboucle=0;nboucle<document.formulaire.rubrique_nb.value;nboucle++)
				{			
					nvaleur_parente	=	document.formulaire.rubrique.value + "_"	+	nboucle;		
					document.getElementById(document.formulaire.rubrique.value + "_td").className="rubrique_inactive";	
					document.getElementById(document.formulaire.rubrique.value + "_fleche_haut").style.display="none";		
					document.getElementById(document.formulaire.rubrique.value + "_fleche").style.display="none";		
					document.getElementById(nvaleur_parente).className="fermer";			
				}
			 }
			 else
			 {
				 document.getElementById(document.formulaire.rubrique.value + "_td").className="rubrique_inactive";	
			}
			document.formulaire.rubrique.value="rien";
			document.formulaire.rubrique_nb.value="rien";
			
		}
		if (nb!=100)
		{
			for (boucle=0;boucle<nb;boucle++)
			{			
				valeur_parente	=	rub + "_"	+	boucle;		
				document.getElementById(rub + "_fleche_haut").style.display="block";	
				document.getElementById(rub + "_fleche").style.display="none";									
				document.getElementById(rub + "_td").className="rubrique_active";
				document.getElementById(valeur_parente).className="ouvrir";	
			}
		}
		else
		{
		document.getElementById(rub+"_td").className="rubrique_active";
		}
	document.formulaire.rubrique.value=rub;
	document.formulaire.rubrique_nb.value=nb;
	}				
}
function style_over(valeur){
	if(document.formulaire.rubrique.value!=valeur){document.getElementById(valeur+'_fleche').style.display='block'}	
	}
function style_out(valeur){
	if(document.formulaire.rubrique.value!=valeur){document.getElementById(valeur+'_fleche').style.display='none'}	
	}
function choix_rubrique(rubrique){
	var a, tmp; 
	tmp = ""; 
	a = rubrique; 
	  
	for(var i = 0; i < a.length; i++) 
	{ 
	tmp = tmp + a.charAt(i); 
	  
		if (a.charAt(i) == "_") 
		{ 
		tmp = tmp.replace("_","-"); 
		} 
	} 
	document.location.href= tmp + ".php";	
}
function choix_information(rubrique){
	var a, tmp; 
	tmp = ""; 
	a = rubrique; 
	  
	for(var i = 0; i < a.length; i++) 
	{ 
	tmp = tmp + a.charAt(i); 
	  
		if (a.charAt(i) == "_") 
		{ 
		tmp = tmp.replace("_","-"); 
		} 
	} 
	document.location.href= tmp+".php";	
}
function popupPourvoir(name){
	sw=Math.round((screen.availWidth-262)/2);
	sh=Math.round((screen.availHeight-309)/2);
	window.open ("fiche-pourvoir.php","fiche","width=262,height=309,left="+ sw +",top="+ sh +"")
}
function popupCommerciaux(name){
	sw=Math.round((screen.availWidth-790)/2);
	sh=Math.round((screen.availHeight-450)/2);
	window.open ("fiche-commerciaux.php?commercial="+name,"fiche","width=800,height=450,left="+ sw +",top="+ sh +"")
}
function popupImg(img){	
	titre="Agrandissement";
	w=open("popup-img.php?img="+img,"image","width=400,height=400,toolbar=no,scrollbars=no,resizable=no,top=0,left=0");
	w.document.close();
}
function arobaceok(email)
{
	if(document.formContact.email.value == ""){
		alert("Il manque votre adresse e-mail!");
		return false;
	}
	var a=document.forms[0].email.value;
	var test="" + a;
	for(var k = 0; k < test.length;k++)
		{
		var c = test.substring(k,k+1);
		if(c == "@")
		{
		return true;
		}
	}
	alert("La syntaxe de votre e-mail est incorrect !");
	return false;
}