function com(id) {mag=open('gestion/com.php?id='+id,'mag','width=350,height=450,status=no,scrollbars=YES,menubar=no,toolbar=no,location=no');}

function recomand(id) {mag=open('gestion/recomand.php?id='+id,'mag','width=350,height=450,status=no,scrollbars=YES,menubar=no,toolbar=no,location=no');}

function suppc(n) {mag=open('gestion/supp.php?cat='+n+'&t=c','mag','width=500,height=300,status=no,scrollbars=YES,menubar=no,toolbar=no,location=no');}

function validc(n) {mag=open('gestion/valid.php?cat='+n+'&t=c','mag','width=500,height=300,status=no,scrollbars=no,menubar=no,toolbar=no,location=no');} 

function supps(id) {mag=open('gestion/supp.php?id='+id+'&t=s','mag','width=500,height=300,status=no,scrollbars=YES,menubar=no,toolbar=no,location=no');}

function valids(id,prov) {mag=open('gestion/valid.php?id='+id+'&t=s&prov='+prov,'mag','width=500,height=300,status=no,scrollbars=no,menubar=no,toolbar=no,location=no');} 

function suppcom(id,id_site,SESSID) {mag=open('../gestion/supp.php?id='+id+'&id_site='+id_site+'&t=com','mag','width=500,height=300,status=no,scrollbars=YES,menubar=no,toolbar=no,location=no');}

function goto(formulaire,cat) { 
location.href = formulaire.page.options[formulaire.page.selectedIndex].value+"?cat="+cat; }

function aff(champ) {document.getElementById(champ).innerHTML="- Vu";}

function SelAll (form){
for (var i=0;i<form.elements.length;i++){
	var e = form.elements[i];
 	e.checked = 1;
 	}
}

function UnSelAll (form){
for (var i=0;i<form.elements.length;i++){
 	var e = form.elements[i];
	e.checked = 0;
 	}
}

function CheckSel(msg){
for (var i=0;i<document.formu.elements.length;i++)
 	if (document.formu.elements[i].checked==1) return true;			
if (msg!="") alert (msg);
return false;
}

function form_del(err_mess){
if (CheckSel("")){
	centrePop("poplist",400,450);
	document.formu.target="poplist";
	document.formu.action = "gestion/supp.php";
	}
}

function form_move(err_mess){
if (CheckSel("")){
	centrePop("poplist",400,450);
	document.formu.target="poplist";
	document.formu.action = "gestion/move.php";
	}
}

function form_valid(err_mess){
if (CheckSel("")){
	centrePop("poplist",400,450);
	document.formu.target="poplist";
	document.formu.action = "gestion/valid.php";
	}
}

function centrePop(name,largeur,hauteur) {
      var gauche = (screen.width - largeur)/2
      var haut =  (screen.height - hauteur)/2
      window.open("",name,"width="+largeur
         +",height="+hauteur+",left="+gauche
         +",top="+haut)
}