// VARIABLE ET CONSTANTES
var calendarField="";
var o;

// FONCTIONS
function chgAct(menu,act,actid,sactid,ssactid,sssactid,ssssactid,sssssactid,langue){
	o = document.fglobal;
	o.MENU.value=menu;
	o.ACT.value=act;
	o.ACTID.value=actid;
	o.SACTID.value=sactid;	
	o.SSACTID.value=ssactid;
	o.SSSACTID.value=sssactid;
	o.SSSSACTID.value=ssssactid;
	o.SSSSSACTID.value=sssssactid;
	if(langue){
	o.LANGUE.value=langue;
	}
	if(act!=""){
		if(o.lst){o.lst.value="";}
		if(o.page){o.page.value="";}
		if(o.orderby){o.orderby.value="";}
	}
	o.submit();
} // function chgAct

function chgPage(pge){
	o = document.fglobal;
	o.page.value=pge;
	o.submit();
} // function chgPage

function calendrier(mode){
	o = document.fglobal;
	calendarField=mode;
	var obj = o.elements[mode];
	vtmp=obj.value.split("/");
	window.open("calendrier/calendrier.php?y="+vtmp[2]+"&m="+vtmp[1]+"&d="+vtmp[0],"calendrier","width=230,height=240,scrollbars=no,left=200,top=150");
} // function calendrier

function retourDate(dat){
	o = document.fglobal;
	el=o.elements[calendarField];
	el.disabled=false;
	el.value=dat;
	el.disabled=true;
	calendarField="";
} // function retourDate

function restrictions(type,actid){
	window.open("restrictions.php?type="+type+"&id="+actid,"restrictions","width=400,height=250,left=100,top=100,scrollbars=no");
} // function restrictions

function rafraichir(){
	o = document.fglobal;
	o.submit();
} // function rafraichir

function raz(){
	o = document.fglobal;
	o.ACTID.value="";
	o.lst.value="";
	o.page.value=1;
	o.strsearch.value="";
	o.submit();
} // function raz

function editor(field){
	o = document.fglobal;
	if(field)letexte=o.elements[field].value;
	editorField=field;
	window.open('editor/index.php?obj='+editorField+'&path='+editor_path,'Editor','toolbar=0,menubar=0,scrollbars=0,resizable=0,location=0,directories=0,left=50,top=20,width=808,height=570');
} // function editor

function retoureditor(texte){
	texte=texte.replace(/\n|\r/g,"");
	o = document.fglobal;
	el=o.elements[editorField];
	el.value=texte;
} // function retoureditor

function infini(obj){
	obj.disabled=false;
	obj.value='31/12/2300';
	obj.disabled=true;
} // function infini

function orderBy(order){
	o = document.fglobal;
	if(o.orderby)o.orderby.value=" " + order;
	o.submit();
} // function orderby