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 note(id) {mag=open('gestion/note.php?id='+id,'mag','width=350,height=450,status=no,scrollbars=no,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=YES,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=YES,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 compt_out(id) { parent.document.getElementById("COMPT_OUT").src='gestion/out.php?go=no&url_id='+id; }

function aller(formulaire) { location.href = formulaire.page.options[formulaire.page.selectedIndex].value; }

function dead(id) {mag=open('gestion/dead.php?id='+id,'_blank','width=500,height=300,status=no,scrollbars=YES,menubar=no,toolbar=no,location=no');}

function SelAll (){ 
for (var i=0;i<document.formu.elements.length;i++){ 
   var e = document.formu.elements[i]; 
    e.checked = 1; 
    } 
} 

function UnSelAll (){ 
for (var i=0;i<document.formu.elements.length;i++){ 
    var e = document.formu.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 InvSelect() { 
for (var i = 0; i < document.formu.elements.length; i++) { 
   if(document.formu.elements[i].type == 'checkbox'){ 
     document.formu.elements[i].checked =!(document.formu.elements[i].checked); 
   } 
 } 
} 

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+",status=no,scrollbars=YES")
}

var url='http://';
function ChangeInputURL() {
if (document.formu.url.disabled==true){
		document.formu.url.disabled=false;
		document.formu.url.value=url;
	}
	else {
		url=document.formu.url.value;
		document.formu.url.disabled=true;
		document.formu.url.value="Note Mode - Pas d'Url";
		}
}

function clic(id){
	document.getElementById('s_'+id).innerHTML="";
   	if(document.images)
  		(new Image()).src="gestion/out.php?go=no&url_id=" + id;
   return true;
}

function open_chat(){ var dial_width = window.screen.availWidth; if(dial_width>1024){dial_width=1024;}
var dial_height = window.screen.availHeight-40; if(dial_height>728){dial_height=728;}
var dial_left = (screen.width-dial_width)/2; var dial_top = (screen.height-dial_height)/2;
var params = 'top='+dial_top+',left='+dial_left+',width='+dial_width+',height='+dial_height+',resizable=1';
window.open('http://www.mes-dialogues.net/zonedial/?player=1&ids=1057684639_02','ZoneDial', params);}