 //http://my.oxywork.com
// oxywork : remplacez ces fonctions si nécessaire pour modifier la présentation

function callphone(idcontact,phone) {
//if (confirm("Nouvelle action téléphonique pour le "+phone+" ?")) { compte_edition('','idcontact='+idcontact+'&type=101');};
open_tache('action=ecrire&type_tache=ACTIONS&taskcat=phone&concern='+idcontact);
// placez ici le code nécessaire au CTI ou créez une fonction nommée cti() : appel du numéro 'phone'
if (cti) eval("cti('idcontact','phone');");
};



//////////////////////
// GENERAL
//////////////////////

// info-bulles

function gId(id) {
return document.getElementById(id);
}

var nav='',old='',ow_noselect=0;
var membre_equipe,submenu,submenuout,old;

function infobulle(msg,nostatut){
//alert(msg);alert(msg.length);
if (msg && msg.length>0) {
  var content="",msgc,nbs=0;
  for(i=0;i<msg.length;i++) {msgc=msg.substring(i,i+1);if (msgc!="\n" && msgc!="\r" && msgc!="|") content+=msgc; else content+="<br>";nbs++;}//msg[i]=" ";//else if (i<3) alert(msgc);
  //if (nbs>0) alert(nbs);
  if (!nostatut) {ti=setTimeout("window.status=\""+content+"\"",10);}
  //var content=msg;//"<table width=100 border=0 cellpadding=1 cellspacing=0 bgcolor="+bak+"><td align=center><font color=black size=1 face='Arial'><big>"+msg+"</big></font></td></table>";
  if(old){//alert(msg);
  return;} 
  else{yyy=Yoffset;
  MM_changeProp('dek','','left',mousex+Xoffset);
  MM_changeProp('dek','','top',mousey+yyy);
  //skn.left=mousex+Xoffset;skn.top=mousey+yyy;
  MM_setTextOfLayer('dek','',content);MM_showHideLayers('dek','','show');
  checkdivpos('dek');
  //if(nav){skn.document.write(content);skn.document.close();skn.visibility="visible";}
  //if(iex){document.all("dek").innerHTML=content;skn.visibility="visible";}
  tinfobk=3;
      }
}
}
var infobulle2in='',infobulle2o='';
function infobulle2(thise,oname,width,height) { 
if (infobulle2o==oname) {infobulle2o='';killinfobulle2(1);} else {
	infobulle2o=oname;
	if (oname)  {
		killinfobulle2(1);
		infobulle2in=oname;
		var abspos=getAbsolutePosition(thise);
	  MM_changeProp(infobulle2in,'','left',abspos.x);
	  if (width>0) { MM_changeProp('infobulle2','','width',width);MM_changeProp(infobulle2in,'','width',width);}
	 // if (height>0) { MM_changeProp('infobulle2','','paddingTop',height-20);MM_changeProp(infobulle2in,'','height',height);}
	  MM_changeProp(infobulle2in,'','top',abspos.y+10);
	  MM_changeProp(infobulle2in,'','overflow','visible'); 
	  MM_changeProp(infobulle2in,'','display','block');
	  MM_changeProp(infobulle2in,'','position','absolute');
	  document.getElementById(infobulle2in).className='infobulle2in';
	  
	  MM_changeProp('infobulle2','','left',abspos.x);
	  MM_changeProp('infobulle2','','top',abspos.y+20);
	  //skn.left=mousex+Xoffset;skn.top=mousey+yyy;
	  //if (document.getElementById(infobulle2in).innerHTML.indexOf('okcancel')<0) 
	  document.getElementById('infobulle2').innerHTML="<!okcancel><div align=right><div align=right><a class=button onclick=killinfobulle2(1);>OK</a></div></div></div>";//document.getElementById(infobulle2in).innerHTML+
	  MM_showHideLayers(infobulle2in,'','show');
	  MM_showHideLayers('infobulle2','','show');
	  //if (height) {MM_changeProp('infobulle2','','zIndex',2);MM_changeProp(infobulle2in,'','zIndex',4);}
	}
}
}
function killinfobulle2(dosave) {
	infobulle2o='';
	if (0 && dosave && infobulle2in) {
		t=document.getElementById('infobulle2').innerHTML;if (t.indexOf('<!okcancel>')) t=t.substring(0,t.indexOf('<!okcancel>'));
		document.getElementById(infobulle2in).innerHTML=t;
	}
	MM_showHideLayers(infobulle2in,'','hide');
	MM_showHideLayers('infobulle2','','hide');
	//MM_changeProp(infobulle2in,'','overflow','hidden');
	//MM_changeProp(infobulle2in,'','position','relative');
}

var pom,pox=0,poy=0,pow=200,popupmenue=new Object();


function getAbsolutePosition(element,nogetpos) {
    if (!nogetpos) nogetpos=0;
    var r = { x: element.offsetLeft, y: element.offsetTop,w: element.offsetWidth,h: element.offsetHeight }; 
    if (nogetpos<2 && element.offsetParent && element.scrollTop>12) { r.y -=element.scrollTop;}
    if (element.offsetParent) {
      var tmp = getAbsolutePosition(element.offsetParent,nogetpos+1);
      r.x += tmp.x;
      r.y += tmp.y; //if (tmp.scrollTop)  r.y -=tmp.scrollTop;
    }
    return r;
  };
  

function find_in_submenu(t,o,advsearch) {
//for(var ii=1;i<childNodes[i].childNodes.length;ii++) if (childNodes[i].childNodes[ii] && childNodes[i].childNodes[ii].tagName=='DIV') { if (childNodes[i].childNodes[ii].textContent && childNodes[i].childNodes[ii].textContent.toLowerCase().indexOf(t)>=0) {MM_showHideLayers(childNodes[i].childNodes[ii].id,'','show'); childNodes[i].childNodes[ii].style.height='20px';} else {MM_showHideLayers(childNodes[i].childNodes[ii].id,'','hide');childNodes[i].childNodes[ii].style.height='0px';}  } 	
var foundi,nbfound=0;
if (t) {
with (o) {
	for(var i=1;i<childNodes.length;i++) 
	if (childNodes[i].tagName=='DIV') { 
		if (!t || (childNodes[i].textContent && childNodes[i].textContent.toLowerCase().indexOf(t)>=0)) 
			{
				MM_showHideLayers(childNodes[i].id,'','show');childNodes[i].style.height='20px';
			 	if (childNodes[i].childNodes.length>4) foundi=find_in_submenu(t,childNodes[i]); else {
			 		//alert("final: "+childNodes[i].childNodes.length+" "+childNodes[i].textContent +" "+childNodes[i].childNodes[0].tagName+" "+childNodes[i].childNodes[1].tagName+" "+childNodes[i].childNodes[2].tagName+" "+childNodes[i].childNodes[3].tagName);
					foundi=i;
			 	}
			 	nbfound++;
			 	if (!foundi) foundi=i;
		 } else 	{MM_showHideLayers(childNodes[i].id,'','hide');childNodes[i].style.height='0px';} 
	}
	if (nbfound==1) {
		if (childNodes[foundi]) dosubpopupmenu(childNodes[foundi],childNodes[foundi].innerHTML);
		for(var ifound=1;ifound<childNodes[foundi].childNodes.length;ifound++) if (childNodes[foundi].childNodes[ifound].tagName=="A") {
 			if (childNodes[foundi].childNodes[ifound].attributes.getNamedItem('onclick').value) eval(childNodes[foundi].childNodes[ifound].attributes.getNamedItem('onclick').value.replace("return(false)",""));
 		}
	} else dosubpopupmenu('','',1);
}
if (!nbfound && advsearch) eval(advsearch);
}
return foundi;
}
  
function dopopupmenuto(e) {
pom=setTimeout('dopopupmenu(e,\"'+event.srcElement.attributes.getNamedItem('popupmenu').value+'\",\"'+event.srcElement.attributes.getNamedItem('idreplace').value+'\");',1000);
};
var tte="",advsearch='';


function dopopupmenu(e,msg,idreplace,noclass,idreplace2,idreplace3,contente,idreplace4){
var thise=e,dosearch=0,omsg=msg;
if (nav && (!msg || msg=="popupmenu" || msg=="popupmenuc" || msg=="popupmenudir")) thise=e; else thise=event;
if (!nav && thise) thise=thise.srcElement; else if (nav && thise && thise.currentTarget) thise=thise.currentTarget;
//alert(thise.id);
if (msg=="popupmenu") msg=e.attributes.getNamedItem('popupmenu').value;
else if (msg=="popupmenuc") {dosearch=1; if (e) msg=popupmenuc[e.id]; else if (contente) {msg=popupmenuc[contente]; thise=document.getElementById(contente);}}
else if (msg=="popupmenudir") {dosearch=1; if (thise) {msg=popupmenuc[e.id.replace('gopen','').replace('open','')];} else if (contente) {msg=popupmenuc[contente]; thise=document.getElementById(contente);}}
else if (thise) {
if (!idreplace && thise && thise.attributes.getNamedItem('idreplace')) idreplace=thise.attributes.getNamedItem('idreplace').value;
if (!idreplace2 && thise && thise.attributes.getNamedItem('idreplace2')) idreplace2=thise.attributes.getNamedItem('idreplace2').value;
if (!idreplace3 && thise && thise.attributes.getNamedItem('idreplace3')) idreplace3=thise.attributes.getNamedItem('idreplace3').value;
if (!idreplace4 && thise && thise.attributes.getNamedItem('idreplace4')) idreplace4=thise.attributes.getNamedItem('idreplace4').value;
if (!msg && thise && thise.attributes.getNamedItem('popupmenu')) msg=thise.attributes.getNamedItem('popupmenu').value;
}

if (msg) {
	
	/*
var absleft=thise.offsetLeft,abstop=thise.offsetTop,ip=0;
do { var thisep=thise.parentNode; absleft+=thisep.offsetLeft; abstop+=thisep.offsetTop; ip++;} 
while (thisep && ip<10);
*/
var abspos=getAbsolutePosition(thise),thisew=thise.offsetWidth,thieh=thise.offsetHeight,thisec=thise.innerHTML;//getRelativeCoordinates(thise, window.document);

//alert(thise.style);
//alert(abspos.x+" "+abspos.y+" "+thiew+" "+thisec);
//alert(absleft+" "+mousex+" "+abstop+" "+mousey);
//alert(msg);
var menuarray=new Array();
clearTimeout(tkillpopup);
if (msg) {// msg.length>0) {
  if (msg.substring(0,4)=="menu") msg=menuarray[msg.substring(5)];
  var content="<div>",msgc,msgl,nbs=0;
  var msga=msg.split("\n"); 	if (msga.length<=1) {  msga=msg.split("|-|"); }
  var id=0;
  if (msga[0].substring(0,9)=="advsearch") { id++;dosearch=1;advsearch=msga[0].substring(10);}
  if (dosearch) {
  	content+="<div id=search class=subpopupmenu><input type=text size=10 id=subpopupmenudosearch onchange=\"if (this.parentNode) if (this.parentNode.parentNode) find_in_submenu(this.value.toLowerCase(),this.parentNode.parentNode,advsearch);\" ><input type=button value=&gt;><!input type=button value=X onclick=selupdclearall('"+popupmenu_name[e.id]+"','"+popupmenu_i[e.id]+"','"+popupmenu_ni[e.id]+"');></div>";//   } else {);this.parentNode.childNodes[i].style.height='20px';
  }
  for (i=id;i<msga.length;i++) {
	  content+=dopopupmenu_element(msga[i],idreplace,1,idreplace2,idreplace3,idreplace4);
  };					//for(i=0;i<msg.length;i++) {msgc=msg.substring(i,i+1);if (msgc!="\n" && msgc!="\r" && msgc!=";") content+=msgc; else content+="<tr><td class=subpopupmenu>";}//msg[i]=" ";//else if (i<3) alert(msgc);
  content+="</div>";			//  if (nbs>0) alert(nbs);
  					//var content=msg;//"<table width=100 border=0 cellpadding=1 cellspacing=0 bgcolor="+bak+"><td align=center><font color=black size=1 face='Arial'><big>"+msg+"</big></font></td></table>";
					//  if(old){alert(msg);
					//  return;} 
					//  else{
 
  yyy=Yoffset;
  //alert('mousex='+mousex+' popupmenu.width='+popupmenu.Width+' document.body.Width='+document.body.Width+' document.width='+document.Width+' document.body.scrollLeft='+document.body.scrollLeft);
  pox=abspos.x;poy=abspos.y+thieh;pow=(thisew>200)?thisew:200; //content=thisec+content;
  
  //070316 pox=mousex-20;poy=mousey-10;
   if (!contente) contente='popupmenudiv';
  if (contente=='popupmenudiv') {
  MM_changeProp('popupmenudiv','','left',pox);//if (popupmenu.left+popupmenu.width>document.innerWidth) popupmenu.left=document.innerWidth-popupmenu.width;
  MM_changeProp('popupmenudiv','','top',poy);
  MM_changeProp('popupmenudiv','','width',pow);
   thise.style.borderWidth=1;
  }

  popupmenue=thise;

  if (!noclass) { popupmenue.className=popupmenue.className.replace(' popupmenuover','')+' popupmenuover';}
 
   //MM_changeProp(,'','width',pow);
  
    // alert(content.length+' '+content);
    
   
    //if (!e) alert(contente+' '+msg+" "+content);
  //MM_setTextOfLayer(contente,'',content);//.replace(/</g,"&lt;"));
  //if (!contente) {
  if ( document.getElementById(contente)) {
	  if (omsg=="popupmenudir") {
		  document.getElementById(contente).innerHTML=content.replace(/popupmenu/g,"openmenu");//.replace(/-->/g,">").replace(/<!--div/g,"<div");
		 //alert(contente+" : "+document.getElementById(contente).innerHTML);
	  } else {
		  document.getElementById(contente).innerHTML=content;
	  	document.getElementById(contente).className='popupmenu2';
	  }
  }
  keeppopupmenu();
  if (dosearch) t=setTimeout("if (document.getElementById('subpopupmenudosearch')) document.getElementById('subpopupmenudosearch').focus();",500);
  var to=e,tn=0; if (to && to.parentNode) while(to.parentNode && !tte && tn<30) {tn++; ton=to.id+'';if (ton && ton.indexOf('tab')>=0) tte=to.id; else to=to.parentNode;}// if (tte) alert("e:"+tte);
  //} else if (contente && document.getElementById('openedsubmenu')) document.getElementById('openedsubmenu').innerHTML+=content;
  if (contente=='popupmenudiv') {
  	if (!nav) {// && !contente
		for (i=0;i<document.forms.length;i++) for(var j=0;j<document.forms[i].length;j++) if (document.forms[i][j].type.substring(0,6)=="select") {
			if (tte) { var tt='',to=document.forms[i][j],tn=0; while(to.parentNode && tn<30) {tn++; tt+=","+to.id; to=to.parentNode;}  }//if (tt) alert("j:"+tt);
			if ((!tte || tt.indexOf(tte)>1) && document.forms[i][j] && document.forms[i][j].name) MM_showHideLayers(document.forms[i][j].name,'','hide');
		}
	}
  //alert(content);
  //if(nav){popupmenu.document.write(content);popupmenu.document.close();}
  //if(iex){document.all("popupmenudiv").innerHTML=content;}
  if (nav || iex) pom=setTimeout("MM_showHideLayers('popupmenudiv','','show');",100);
  checkdivpos('popupmenudiv');
  }
  var tinfobk=3;
  					//    }
}
}
}

var dopopupmenu_elementi=0,subelementid=0,tcn=new Array(),subreplace=new Array();
function dopopupmenu_element(msgal,idreplace,prof,idreplace2,idreplace3,idreplace4) {
	if (!prof || prof==0) prof=1;
	
	var content='',contenta='',msgsa=new Array();
	
	//alert('prof='+prof+' '+msgal);
	var submenuarray=new Array();
	//contacts


	
	submenuarray["docedit"]="Modifier le texte;javascript:edithtml('','"+idreplace+"','','&idgroupe="+idreplace2+"&saveto="+escape(escape("./?s=1&nomenu=1&id="+idreplace+"&idgroupe="+idreplace2+"&ss=article_enregtext"))+"');;;\nModifier toutes les options;./?ns=1,edit&&idgroupe="+idreplace2+"&id="+idreplace+"\" onclick=\"news_open('&idgroupe="+idreplace2+"',"+idreplace+",'',1)!return(false);;;";
	if (idreplace3==4 || idreplace3==6 || idreplace3==9 || idreplace3==10) submenuarray["docedit"]+="\nModifier les questions;javascript:window.open('index.php?popup=enquete_edition.php&ss=enquete_edition&id="+idreplace+"&mode=table','','width=700,height=520,menubar=no,status=no,scrollbars=yes,resizable=yes');;;";
	else if (idreplace3==5) submenuarray["docedit"]+="\n;javascript:window.open('index.php?popup=inscription_edition.php&id="+idreplace+"&une_inscription=','','width=770,height=500,menubar=no,status=no,scrollbars=yes,resizable=yes');;;\n;javascript:window.open('index.php?popup=inscription_edition.php&onlynew=1&id="+idreplace+"','','width=770,height=500,menubar=no,status=no,scrollbars=yes,resizable=yes');;;";

	submenuarray["doctools"]="Envoyer par email;javascript:email_open('index.php?s=5&ss=ecrire&nomenu=1&idarticle="+idreplace+"&idgroupe="+idreplace2+"','');;;\nImprimer;javascript:printopen('news="+idreplace+"&type="+idreplace3+"',0,1);;;";
	submenuarray["doctarget"]=""//Voir la session;javascript:opsess('&idgens="+idreplace+"');;;bouton_email_ecrire.gif\nDiscussion en direct;javascript:open_postit(0,'"+idreplace+"&rep=1');;;bouton_notes_ecrire.gif";
	submenuarray["groupinfo"]="Modifier ce groupe;#\" onclick=\"groupe_edit('"+idreplace2+"')!return(false);;;Accueil du groupe;./?group="+idreplace2+";;\nListe des membres;./?group="+idreplace2+"&ss=contacts\nNouveau document;./?ns=1,edit&&idgroupe="+idreplace2+"\" onclick=\"news_open('&idgroupe="+idreplace2+"','','',1)!return(false);;;\nNouveau sous-groupe;#\" onclick=\"groupe_edit('&dependde="+idreplace2+"')!return(false);;;";
	submenuarray["catinfo"]="Accueil de la catégorie;./?cat="+idreplace4+";;\nNouveau groupe;#\" onclick=\"groupe_edit('&catg="+idreplace4+"')!return(false);;;";
	submenuarray["online"]="Voir la session;javascript:opsess('&idgens="+idreplace+"');;;bouton_email_ecrire.gif\nDiscussion en direct;javascript:open_postit(0,'"+idreplace+"&rep=1');;;bouton_notes_ecrire.gif";
	submenuarray["communicate"]="Lire les courriers;./?s=5&showfrom="+idreplace+";;;picto_email_titre.gif\nNouveau courrier;javascript:email_ecrire('listeidto="+idreplace+"','');;;bouton_email_ecrire.gif\n (d'après modèle);javascript:email_ecrire('ss=model&listeidto="+idreplace+"','');;;bouton_email_ecrire.gif\nNouvelle note;javascript:open_postit(0,'"+idreplace+"&popup=0');;;bouton_notes_ecrire.gif\nAppel;javascript:void(ajaxopen('','ns=2."+idreplace+"&ss=tel',150,100,'',''));;;bouton_notes_ecrire.gif";
	submenuarray["time"]="Nouveau rendez-vous;javascript:agenda_open('&a="+idreplace+"');;;bouton_contact_rdv.gif";
	submenuarray["compte"]="Voir le compte;./?s=4&idcontact="+idreplace+";;;picto_compte_titre.gif\nNouvel élément;javascript:compte_edition('','idcontact="+idreplace+"');;;bouton_compte_ajouter.gif";//\nNouveau - action;./?s=4&idcontact="+idreplace;
	submenuarray["login"]="Voir le site comme ce contact;./?iam="+idreplace+";;;\nVoir les sessions;javascript:opsess('&idgens="+idreplace+"');;;";
	submenuarray["valid"]="Valider ce document;javascript:news_valid("+idreplace+",1,'');;;\nNe pas valider ce document;javascript:news_valid("+idreplace+",0,'');;;";
	submenuarray["newsedit"]="Modifier le texte;javascript:edithtml('','"+idreplace+"','','&saveto="+escape(escape("./?s=1&nomenu=1&id="+idreplace+"&ss=article_enregtext"))+"','');;;bouton_news_editvisu.gif\nModifier toutes les options;javascript:news_open('',"+idreplace+",'',1,'');;;bouton_news_editer.gif";

//document.write("<a href=# onclick=\"news_open('"+ext+"&creerdepeche=1&iddependde="+id+"&idgroupe="+idgroupe+"','','"+taille+"',1,"+dans_news+");return false;\"><img src="+images_path+"boutons/bouton_news_ssnews.gif width=28 height=17 border=0 alt=\"Créer un sous-document\"></a>");

	var target='',thishassub=0;
	if (nomenu==1)
 	target=" target=_blank"; //050420


  	msgl=msgal.split(";");//  	msgl=msga[i].split(";");
  	contenta='';
  	if (msgl[1] && msgl[1].substring(0,10)=="javascript") msgl[1]="#\" onclick=\""+msgl[1].substring(11)+";return false;";
  	
  	
  	
  	if (msgl[0]=="-") {
  		content+="<div style=\"height:2px;border-top:1px solid #888;\"></div>";
  	}else if (msgl[1] && (msgl[1].substring(0,7)=="submenu")) {// || msgl[0].substring(0,7)=="submenu")) {
  	dopopupmenu_elementi++;subelementid=dopopupmenu_elementi;
  	//alert("0="+msgl[0]+" 1="+msgl[1]+' msgal='+msgal);
  	if (msgl[0] && msgl[0].substring(0,7)!="submenu") contenta="<!div class=popupmenu2><a id=sub"+subelementid+((msgl[3])?"":"")+" "+((msgl[1].indexOf('onclick')>0)?"":target)+" href=\""+((msgl[1] && msgl[1]!="undefined" && msgl[1].substring(0,8)!="submenu_")?msgl[1].replace("submenu:","").replace(/!/g,";"):"#")+"\" title=\""+msgl[0]+"\">"+((msgl[0]!="----")?msgl[0]:"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;")+"</a>";//:msgl[0]);//msgl[3]   //" style=\"height:20px;overflow:hidden;\" class=\"subpopupmenu"+((msgl[1])?"":" popupmenuhassub")+" "+
  		if ((nav && msgl[1][7]=="_") || (!nav && msgl[1].substring(0,8)=="submenu_")) msgs=submenuarray[msgl[1].substring(8)];
  		else if (msgl[1].substring(0,7)=="submenu") {msgs=msgal.substring(msgl[0].length+1);msgl[0]=msgl[0].substring(8);}
	  	
	  	else msgs=msgal.substring(msgl[0].length+1+8);//msgl[1].length+1);
	  	//alert(msgl[1]+" "+msgl[1][7]+" "+ msgl[1].substring(0,8)+" "+msgs);
	  	thishassub=dopopupmenu_elementi
  		content+="<div style=\"height:19px;overflow:hidden;\" id=m"+dopopupmenu_elementi+" class=\""+((msgl[2])?"subpopupmenu "+msgl[2]:"subpopupmenu")+"\" onmouseout=\"if (tcn[this.id]) this.className=tcn[this.id];\" prof="+prof+" onmouseover=\"dosubpopupmenu(this,'',"+prof+");killsubpopupmenu("+prof+");tcn[this.id]=this.className;this.className=this.className.replace('subpopupmenu','');this.className+=' subpopupmenuhover';dosubpopupmenu(this,this.innerHTML,"+prof+","+dopopupmenu_elementi+");\"><div style=\"float:right;height:19px;width:19px;\" id=ms"+dopopupmenu_elementi+" class=\"\"></div><!--c-->"+contenta+"<!--/c-->";//<table width=100% border=0 cellpadding=0 cellspacing=0>"; //sh('m"+i+"',1);// onmouseout=sh('m"+dopopupmenu_elementi+"',0);
  		//subcontent='<table width=100% border=0 cellpadding=0 cellspacing=0>';
  		//alert(msgl[1]);
	  	if (msgs) {
		  	if (msgs.indexOf('|'.repeat(5-prof+1))>1) msgsa=msgs.split('|'.repeat(5-prof+1)); else msgsa=msgs.split("\n");
	  	//alert(msgsa.length+" "+msgs);
	  		//var msgsl=msgsa.length;
	  		for (var is=0;is<msgsa.length;is++) {
  		  	  //alert("is="+is+" prof="+(prof+1)+" msgsa[is]="+msgsa[is]);
		  	  if (msgsa[is]) {
		  	  	
			  	//content+="\n\ndopopupmenu("+prof+"):"+
			  	subreplace[prof]=subelementid;
			  	
			  	
			  	subcontent=dopopupmenu_element(msgsa[is],idreplace,(prof<=5)?prof+1:prof,idreplace2,idreplace3,idreplace4);
			  	if (subcontent.length>20) {//0 && prof<=5 && msgsa[is].indexOf('submenu')>5
			  		//content+='<!sub>'+subreplace[prof]+" -1:"+subreplace[prof-1]+" : "+subcontent.length+" , "+msgsa[is];//alert(msgsa[is]);
			  		//content=content.replace("id=m"+subreplace[prof]+" class=\"","id=m"+subreplace[prof]+" class=\"popupmenuhassub ");
			  		content=content.replace("id=ms"+thishassub+" class=\"","id=ms"+thishassub+" class=\"popupmenuhassub ");
			  	}// else if (msgl[2]) content=content.replace("id=m"+thishassub+" class=\"","id=m"+thishassub+" class=\" "+msgl[2]);
			  	//if (subcontent.indexOf('<!sub>')>0) 
			  	content+=subcontent; //alert("id=sub"+subreplace+" class=\""+content.indexOf("id=sub"+subreplace+" class=\"")+' subelementid='+subelementid+' \ncontent='+content+' \n\nsub='+subcontent);}
			  	//content+=content1;
			  	//if (content1.indexOf('popupmenu2')) is=999;
			  	//msgsl=msgsa[is].split(";"); 
		  		//content+="<tr><td class="+((msgsl[2])?msgsl[2]:"subpopupmenu onmouseover=this.className='subpopupmenuhover'; onmouseout=this.className='subpopupmenu';")+" id=ms"+is+">"+"<a "+((msgl[3])?"class="+msgl[3]:"")+((msgsl[1].indexOf('onclick')>0 ||msgsl[1].indexOf('javascript')>-1)?"":target)+" href="+((msgsl[1] && msgsl[1]!="undefined")?msgsl[1]:"#")+">"+((msgsl[4])?"<img src="+images_path+"boutons/"+msgsl[4]+" border=0 align=absmiddle>":"")+msgsl[0]+"</a>"; 
	  		}}
	  	}
	  	content+="</div>";//</table>
	  	//if (prof==2) alert(content);
	  					//content+="</div><div style=visibility:hidden;overflow:hidden;height:1px id=sm"+i+">"+subcontent+"</div><div class=popupmenu style=height:15px;overflow:hidden; id=m"+i+" onmouseover=dosubpopupmenu('sm"+i+"');>"+msgl[0]+""; 
  	} else if (msgl[0] &&  msgl[0].substring(0,7)!="submenu") {
  			//if (msgl[0])
  		dopopupmenu_elementi++;
  		contenta=((msgl[1])?"<a "+" href=\""+((msgl[1] && msgl[1]!="undefined" && msgl[1].substring(0,7)!="submenu")?msgl[1].replace(/!/g,";"):"#")+"\" "+((msgl[3])?"":"")+((msgl[1].indexOf('onclick')>0)?"":target)+">"+((msgl[0]!="----")?msgl[0]:"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;")+"</a>":msgl[0].replace("£",";"));//+" style=\"height:20px;\" class="+((msgl[1])?"subpopupmenu":"popupmenutitle")+((!msgl[2])?" onmouseout=this.className='subpopupmenu'; onmouseover=this.className='subpopupmenuhover'; ":"")
  		content+="<div class="+((msgl[2])?""+msgl[2]:((msgl[1])?"subpopupmenu style=\"height:19px;\" ":"popupmenutitle"))+((msgl[1] && !msgl[2])?" prof="+prof+"  onmouseover=\"dosubpopupmenu(this,'',"+prof+");killsubpopupmenu("+prof+");tcn[this.id]=this.className;this.className=this.className.replace('subpopupmenu','');this.className+=' subpopupmenuhover';\" onmouseout=\"if (tcn[this.id]) this.className=tcn[this.id];\"":"")+" id=mn"+dopopupmenu_elementi+">"+contenta+"</div>"; 
  	};
  	return content;
}

function dosubpopupmenu(e,content,prof,dopopupmenu_elementi) {
	var profi=prof;
	if (prof=='' && e.attributes.getNamedItem('prof')) prof=e.attributes.getNamedItem('prof').value;
	
//content=MM_findObj(objname).innerHTML;
if (content && content.indexOf('<!--/c-->')) content=content.substring(content.indexOf('<!--/c-->')+9);
//if (prof>=3 && content) alert(content);
if (content && content.length>1) {
	if (!prof || prof==1) {prof=''; profi=1;}
for(var i=prof;i<5;i++) MM_showHideLayers('subpopupmenudiv'+i,'','hide');
  abspos=getAbsolutePosition(e);
  var subx=abspos.x+abspos.w-10;if (subx>windoww-200) subx=abspos.x+30;
  MM_changeProp('subpopupmenudiv'+prof,'','left',subx);//pox+150*profi);
  MM_changeProp('subpopupmenudiv'+prof,'','top',abspos.y);//mousey-10);
  //e.parent.className='subpopupmenuhover';
  //opendepopupmenus+="document.getElementById('"+e.id+"').className='subpopupmenu';";
  MM_setTextOfLayer('subpopupmenudiv'+prof,'',content);//.replace(/<!c/g,"<!--c"));
  checkdivpos('subpopupmenudiv'+prof);
  MM_showHideLayers('subpopupmenudiv'+prof,'','show');
  document.getElementById('subpopupmenudiv'+prof).className='popupmenu2';
  
  //if(nav){subpopupmenu.document.write(content);subpopupmenu.document.close();subpopupmenu.visibility="visible"}
  //if(iex){document.all("subpopupmenudiv").innerHTML=content;subpopupmenu.visibility="visible";}
} else if (prof) {
	//alert(prof);
	for(var i=prof;i<5;i++) {
		MM_showHideLayers('subpopupmenudiv'+((i>1)?i:''),'','hide');
		MM_setTextOfLayer('subpopupmenudiv'+((i>1)?i:''),'','');
	}
}
};

var subopenmenu='';
function dosubopenmenu(e,content,prof,dopopupmenu_elementi) {
	//e.style.overflow='visible';
	//for (var i=e.style.height;i<=documentScrollHeight;i+=1) e.style.height=i;
	e.style.height='';
	//e.className='subopenmenuhover';
	//shh(e.id,1);
	//subopenmenu+='document.getElementById("'+e.id+'").style.overflow="hidden";';
};
function killsubopenmenu(prof) {
	//if (subopenmenu ) eval(subopenmenu);
	subopenmenu='';
};




var opendepopupmenus='',tkillpopup;

function killsubpopupmenu(prof) {
	
	if (opendepopupmenus && prof==1) {
		//alert('prof='+prof+' '+opendepopupmenus);
		//eval(opendepopupmenus);
		opendepopupmenus='';
	}
}
	

function get_mousec(e) {
	get_mouse(e,1);
}
function get_mouse(e,clicki) {
  mousex=(nav)?e.pageX:event.x+document.body.scrollLeft;
  mousey=(nav)?e.pageY:event.y+document.body.scrollTop;
  //window.status="x="+mousex;
  mousebutton=((nav)?e.button:event.button);
  if (clicki) mousebutton+=clicki;
  //if (mousebutton) alert((nav)?e:event); 
  evente=(nav)?e.target:event.srcElement;
  if (evente && evente.parentNode && evente.attributes && evente.parentNode.attributes) {
  	if (!evente.attributes.getNamedItem('href') && !evente.attributes.getNamedItem('onclick') && (evente.parentNode.attributes.getNamedItem('href') || evente.parentNode.attributes.getNamedItem('onclick'))) evente=evente.parentNode;
  }
//if (mousebutton) alert("evente="+evente);//+" "+e.currentTarget+event.srcElement);
}

function kill(){ window.status=' '; if(!old){yyy=-1000;MM_showHideLayers('dek','','hide');}}
function keeppopupmenu(e){ 
	if(!old){yyy=-1000;clearTimeout(tkillpopup);}
}
var popupmenue;
function killpopupmenu(e){ 
	if (pom) clearTimeout(pom);
	var thise=e;
	if (nav) thise=e; else thise=event;
	if (!nav && thise) thise=thise.srcElement; else if (nav && thise && thise.currentTarget) thise=thise.currentTarget;
	popupmenue=thise;if (popupmenue) popupmenue.className=popupmenue.className.replace('popupmenuover','');
	if(!old){yyy=-1000;tkillpopup=setTimeout("dokillpopupmenu();",200);}//popupmenue=document.getElementById('"+thise.id+"');popupmenue.className=popupmenue.className.replace('popupmenuover','');//MM_showHideLayers('ajax','','hide');
}
function dokillpopupmenu() {
	MM_showHideLayers('popupmenudiv','','hide','subpopupmenudiv','','hide','subpopupmenudiv2','','hide','subpopupmenudiv3','','hide');
	MM_setTextOfLayer('popupmenudiv','','');MM_setTextOfLayer('subpopupmenudiv','','');MM_setTextOfLayer('subpopupmenudiv2','','');MM_setTextOfLayer('subpopupmenudiv3','','');
	//alert("tte="+tte);
	if (!nav) {
		//for (i=0;i<document.forms.length;i++) for(var j=0;j<document.forms[i].length;j++) if (document.forms[i][j].type.substring(0,6)=="select") MM_showHideLayers(document.forms[i][j].name,'','show');
		for (i=0;i<document.forms.length;i++) for(var j=0;j<document.forms[i].length;j++) if (document.forms[i][j].type.substring(0,6)=="select") {
			if (tte) {var tt='',to=document.forms[i][j],tn=0; while(to.parentNode && tn<30) {tn++; tt+=","+to.id; to=to.parentNode;}  }
			if ((!tte || tt.indexOf(tte)>0) && document.forms[i][j] && document.forms[i][j].name) {MM_showHideLayers(document.forms[i][j].name,'','inherit');}
		}
		if (tte && current_tab>0) {t=current_tab;tab_open(current_tab+1);tab_open(t);}
	}
}
//t=setTimeout('dokillpopupmenu();',100);
function altimage(e) {if (!e) {infobulle(event.srcElement.alt);} else {infobulle(e.target.alt);}}

function altlink(e)  {if (!e) {infobulle(event.srcElement.title);} else {infobulle(e.target.title);}};
function althtmllink(e)  {//if (!event.srcElement.htmltitle || event.srcElement.htmltitle!="1") infobulle(event.srcElement.title,1); else infobulle(event.srcElement.htmltitle,1); 
//alert('event.srcElement.htmltitle='+event.srcElement.htmltitle);
if (!e) {infobulle(event.srcElement.htmltitle,1);} else {infobulle(e.target.htmltitle?e.target.htmltitle:e.htmltitle,1);}};

var popupmenuc=new Array(),popupmenu_name=new Array(),popupmenu_i=new Array(),popupmenu_ni=new Array(),hiddenchilds=new Array();

var noaltimage=0;
function doaltimage(pass) {
	//if (membre_equipe) alert(pass+" "+window.load);
	//var thisNode = new Array();
if (!noaltimage) {
if (!pass) pass=0;
	if(!old){
		skn=(nav)?document.getElementById('dek'):document.getElementById('dek').style;
		popupmenu=(nav)?document.getElementById('popupmenudiv'):document.getElementById('popupmenudiv').style;
		subpopupmenu=(nav)?document.getElementById('subpopupmenudiv'):document.getElementById('subpopupmenudiv').style;
		if(nav)document.captureEvents(Event.MOUSEMOVE);
		//document.onmousemove=get_mouse;
	}
	with (document) {
	//alert('pass='+pass+' links.length='+links.length);
		if (pass==0 && images.length<200) for (i=0;i<images.length;i++) if (images[i].alt) {images[i].onmouseover=altimage;images[i].onmouseout=kill;}
		if (pass==1) for (i=0;i<links.length;i++) if (links[i]) {
			//for (j=0;j<links[i].attributes.length;j++) thisNode[links[i].attributes[j].name]=links[i].attributes[j].value;
			if (links.length<100 && links[i].attributes.getNamedItem('title') && !links[i].attributes.getNamedItem('htmltitle')) {links[i].onmouseover=altlink;links[i].onmouseout=kill;}
			if (links[i].attributes.getNamedItem('htmltitle')) {links[i].onmouseover=althtmllink;links[i].onmouseout=kill;}
			if (links[i].attributes.getNamedItem('popupmenu')) {links[i].onmouseover=dopopupmenu;links[i].onmouseout=killpopupmenu;}
			//if (thisNode['popupmenu']) {links[i].onmouseover=dopopupmenu;links[i].onmouseout=killpopupmenu;}
		}
		var selarr,submenu=0;
		if (pass==3 && !popupmenuc.length && !ow_noselect) {
			for (i=0;i<document.forms.length;i++) if (document.forms[i] && document.forms[i].length>0) for(var j=0;j<document.forms[i].length;j++) 
			 if (  (
			 	document.forms[i][j].type.substring(0,6)=="select" && document.forms[i][j].options.length>1 && ((nav && document.forms[i][j].options.length<650) || document.forms[i][j].options.length<400) && (document.forms[i][j].name.substring(1,8)=="idgroupe" || document.forms[i][j].attributes.getNamedItem('owoptions'))
			     //  ) || (
			 //	document.forms[i][j].type.substring(0,6)!="select" && document.forms[i][j].attributes.getNamedItem('owoptions')
			       )
			 ) {//selarr[i][]=document.forms[i][j].name; // id && 
			
			//for (i=0;$<selarr.length;i++
			//alert(document.forms[i][j].attributes.getNamedItem('owoptions').value);
			
			if (document.forms[i] && document.forms[i][j]) with (document.forms[i][j]) {
				var submenutype=attributes.getNamedItem('owoptions').value;
				//if (!options) options=unescape(attributes.getNamedItem('options')).split("|-|");
				var res='',reso='',ress='',resh=new Array(),outa='',nonch='',noncl='',noncl2="";
				res=type+"\n";ress='';resh='',reshi=0;
				//if (size>1) m=1;
				//insertAdjacentHTML('beforeBegin','test');
				//res='';
				var menuitem="",permitopen=0,ni=(id)?id:name,noi=(id)?id:name,n=name,no=name,menutext='',menutext2=';',nonch='',noncl;
				if (!n) n=id;
				if (attributes.getNamedItem('onchange')) nonch=attributes.getNamedItem('onchange').value; 
				if (attributes.getNamedItem('owonclick')) noncl=attributes.getNamedItem('owonclick').value; 
				if (attributes.getNamedItem('owonclick2')) noncl2=attributes.getNamedItem('owonclick2').value; 
				if (attributes.getNamedItem('owadvsearch') && !menuitem) menuitem="advsearch:"+attributes.getNamedItem('owadvsearch').value+"\n"; 
				if (attributes.getNamedItem('owpermitopen')) permitopen=1;
				if (ni.indexOf("[")>0) {ni=ni.substring(0,ni.indexOf('[')); }
				if (attributes.getNamedItem('owgenerate')) {
						var dmc = document.createElement("option");
						dmc.text = "2008" ;
						dmc.value = "2008-01-01";
						appendChild(dmc);
				}				
				//alert(noncl.replace('#VALUE','999'));
				//alert('i='+i+' j='+j+' n='+n+n.indexOf("["));
				
				for(k=0;k<options.length;k++) {
				if (0 && options[k].attributes) {
					if (options[k].attributes.getNamedItem('owencode')) {
						
						options[k].text=unescape(options[k].attributes.getNamedItem('owencode').value);;
					}
				}
				options[k].text=options[k].text.replace(/"/g,"'").replace(/'/g," ").replace(/\n/g," ");//"
				if (options[k].selected) {
					ress+='&nbsp; '+options[k].text.replace(/_/g," ")+'&nbsp;<wbr> ';//(options[k].htmltext)?options[k].htmltext:options[k].text)
					//resh+='<input type=hidden name="'+n+'[]" value="'+options[k].value+'">';
					resh[reshi]=options[k].value;reshi++;
					//if (size>1) {
						if (!document.getElementById(n) || document.getElementById(n).type!='hidden') {
						addhidden(i,n+((size>1)?"":""),options[k].value);j++;
						//alert(document.getElementById(n).type);
						}// else alert("n="+n+" "+document.getElementById(n).id+" "+document.getElementById(n).type);
					//}
				}
				if ((!options[k].attributes.getNamedItem('owoptions') || options[k].attributes.getNamedItem('owoptions').value!="hide")) {
				//alert("'"+options[k+1].text+"'");
				
					menutext=options[k].text.replace(/;/g,",");menutext2=';';
					if ((options[k].text && options[k+1] && (options[k+1].text.substring(0,3)=="   " || options[k+1].text.substring(0,3)=="___" || options[k+1].text.substring(0,4)=="  \_" || options[k+1].text.substring(0,4)=="..\_"))) {
						//menuitem+="||submenu:"+options[k].text+";";
						menutext2=";submenu:";
						if (submenu>=2) submenu=3; else submenu++;
					}
					else if ((options[k].text && options[k+1] && (options[k+1].text.substring(0,2)=="  " || options[k+1].text.substring(0,2)=="__" || options[k+1].text.substring(0,3)==" \_" || options[k+1].text.substring(0,3)==".\_"))) {
						//menuitem+="||submenu:"+options[k].text+";";
						menutext2=";submenu:";
						if (submenu>=1) submenu=2; else submenu++;
					}
					else if ((options[k].text && options[k+1] && (options[k+1].text.substring(0,1)==" " || options[k+1].text.substring(0,1)=="_" || options[k+1].text.substring(0,2)=="\_"))) {
						//menuitem+="||submenu:"+options[k].text+";";
						menutext2=";submenu:";
						submenu=1;
					}
					if ((options[k].text && (options[k].text.substring(0,3)=="   " || options[k].text.substring(0,3)=="___"))) {
						if (submenu>=2) submenu=3; else submenu++;
					}
					else if ((options[k].text && (options[k].text.substring(0,2)=="  " || options[k].text.substring(0,2)=="__"))) {
						if (submenu>=1) submenu=2; else submenu++;
					}
					else if ((options[k].text && (options[k].text.substring(0,1)==" " || options[k].text.substring(0,1)=="_"))) {
						submenu=1;
					}
					
					if (menutext.substring(0,3)=="   " ||menutext.substring(0,3)=="___") menutext=menutext.substring(3);
					else if (menutext.substring(0,2)=="  " ||menutext.substring(0,2)=="__") menutext=menutext.substring(2);
					else if (menutext.substring(0,1)==" " ||menutext.substring(0,1)=="_") menutext=menutext.substring(1);
					

					if (menutext && menuitem=="" && (!options[k].value))// || options[k].value==0)) 
						menuitem=menutext;
					else {//if (options[k].text) {
					if (!menutext) menutext="----";
						if (!(options[k].text.substring(0,1)==" " || options[k].text.substring(0,1)=="_")) submenu=0;
						menuitem+=((submenu)?";"+"|".repeat(5-submenu+1):"\n")+menutext+menutext2;
						menuitem1="#\" onclick=\""+((options[k].attributes.getNamedItem('js'))?options[k].attributes.getNamedItem('js').value:((noncl)?noncl.replace('#VALUE',options[k].value):"selupd('"+i+"','"+n+"','"+ni+"','"+options[k].text.replace(/'/g," ").replace(/_/g," ")+"','"+options[k].value+"','"+size+"')"+((noncl2)?"!"+noncl2.replace('#VALUE',options[k].value):"")))+((!noncl && !noncl2 && nonch!='' && nonch!=null && nonch!='null' && nonch!='undefined')?"!"+nonch:"")+"!return(false)";//"
						menuitem+=menuitem1.replace(/;/g,"!");
						if (options[k].className) menuitem+=";"+options[k].className+";"+options[k].className;
					}
					/* ex:   
titre;lien;classbg;class
menutitre;submenu_menuid
menutitre;submenu:titre;lien;clbg;cl;img||titre;lien;clbg;cl;img";
*/
				}
				}
			
			var reshtml='',resclass='';//input type=text';
			if (menuitem.substring(0,1)=="\n") menuitem=menuitem.substring(1);
			 //if (style) reshtml+=' style="'+style;
			 //if (class) resclass=class;
			//outerHTML='<input type=text onmouseover=dopopupmenu onmouseout=killpopupmenu value="'+res+'">"';
			/*
			if (document.forms[i][j].size>1) {
				//outa='<div id=hidden'+n+'></div>';
				//alert(no);
				for(k=0;k<resh.length;k++) {
					var kv=resh[k];alert(kv);
					addhidden(i,n+'[]',kv);j++;
				}
			} else 
			
			if (document.forms[i][j].size<=1) {
				//outa='<input type=hidden name="'+n+'" id="'+n+'">';
				addhidden(i,n,resh[0]);j++;
				//ress=options[selectedIndex].text;
			 }
			 */
			 
			
			//alert(n);
			
			
			popupmenuc['select'+i+ni]=menuitem;
			popupmenu_name['select'+i+ni]=n;
			popupmenu_i['select'+i+ni]=i;
			popupmenu_ni['select'+i+ni]=ni;
			jm=document.forms[i].length;
			//if (n=="idgroupel") alert(outa+" "+menuitem);
			if (!ress) ress="...";
			
			if (submenutype=="submenuopen") {
			//reso="<div class=popupmenu  id=select"+i+ni+"></div>";
			t=setTimeout("dopopupmenu('','popupmenuc','','','','','select"+i+ni+"');",100);//(e,msg,idreplace,noclass,idreplace2,idreplace3,contente
			}
			/*else
			*/
			reso=outa
			+'<div class=owselect id=divselect'+i+ni+'><a class="owselect '+resclass+'" '+reshtml+' id=select'+i+ni+' onclick=dopopupmenu(this,"popupmenuc"); onmouseover=dopopupmenu(this,"popupmenuc"); onmouseout=killpopupmenu(); href=#>'+ress+'</a>';
			if (permitopen) reso+='<a '+reshtml+' id=selectopen'+i+ni+' style=overflow:visible; onclick=document.getElementById("divselect'+i+ni+'").className="owselectopen";document.getElementById("select'+i+ni+'").className="owselectopen";document.getElementById("select'+i+ni+'").onmouseover=ow_void;dopopupmenu(this,"popupmenudir","","","","","selectopenc'+i+ni+'"); href=#><img border=0 src='+images_path+'3/cat.png></a><div class=owselectopenc id=selectopenc'+i+ni+'></div>';
			reso+='</div>';
			
			
			//<div style=display:none;>'+menuitem+'</div>//onclick=alert(popupmenuc["select'+i+ni+'"]); 
			//alert(no);
			//if (no && reso) document.forms[i][no].
			outerHTML=reso; //else alert(n);
		}}
			//t=setTimeout("document.getElementById('displaydgroupdiv').innerHTML=document.getElementById('gotodgroupdiv').innerHTML",1500);
			//t=setTimeout("document.getElementById('displaywgroupdiv').innerHTML=document.getElementById('gotowgroupdiv').innerHTML",1500);
		//if (document.getElementById('displaycontactdiv') && document.getElementById('gotocontactdiv')) document.getElementById('displaycontactdiv').innerHTML=document.getElementById('gotocontactdiv').innerHTML;//document.getElementById('gotocontactdiv').innerHTML=' ';}

		}
		//if (menuitem) alert(menuitem);
	};
var p=pass;p++;
if (p<=3) t=setTimeout('doaltimage('+p+');',20);
}
};

function ow_void() {}

function addhidden(f,n,v) {
	var he = document.createElement("input");
	he.setAttribute("type",'hidden');
	he.setAttribute("name",n);
	he.setAttribute("id",n);//'hidd'+f+
	he.setAttribute("value",v);
	document.forms[f].appendChild(he);
	hiddenchilds[n+v]=he;//alert(n+v);
	//alert(""+n+"="+v);
	
}
function selupd(formi,n,ni,t,v,m) {

if (!m || m<=1) {
if (document.getElementById('select'+formi+ni)) document.getElementById('select'+formi+ni).innerHTML=t;
//alert('formi='+formi+' n:'+n+" = "+" = ");//+document.forms[formi][n].value);
if (document.forms[formi] && document.forms[formi][n]) document.forms[formi][n].value=v;
/*else if (document.forms[formi] && document.getElementById('hidd'+formi+n) ) document.getElementById('hidd'+formi+n).value=v;
else if (document.forms[formi] && document.getElementById(n) ) document.getElementById(n).value=v;
*/
else addhidden(formi,n,v);
//alert(formi + '.'+ n+" = "+document.forms[formi][n].value);
killpopupmenu();
} else {
	//alert(document.getElementById('select'+formi+n).innerHTML+" '"+t+"' "+h.indexOf(t));
	//o=document.forms[formi].n;
	//alert('n='+n+' ni='+ni+' o='+document.getElementById('select'+formi+ni));
	if (document.getElementById('select'+formi+ni).innerHTML.indexOf(t)<0) {
		document.getElementById('select'+formi+ni).innerHTML+='&nbsp; '+t+'&nbsp;<wbr> ';
		//document.getElementById('hidden'+n).innerHTML+='<input type=hidden name="'+n+'[]" value="'+v+'">';
		
		//alert(n);
		addhidden(formi,n,v);
		//alert(document.getElementById('hidden'+n).innerHTML);
		}
	else {
		document.getElementById('select'+formi+ni).innerHTML=document.getElementById('select'+formi+ni).innerHTML.replace('&nbsp; '+t+'&nbsp;<wbr> ','');
		document.getElementById('select'+formi+ni).innerHTML=document.getElementById('select'+formi+ni).innerHTML.replace(t,'');
		//alert(n+v+" "+hiddenchilds[n+"[]"+v]);
		document.forms[formi].removeChild(hiddenchilds[n+v]);//document.getElementById(n));//document.getElementById('hidden'+n).innerHTML=document.getElementById('hidden'+n).innerHTML.replace('<input type=hidden name="'+n+'[]" value="'+v+'">','');
	}
}
}

function selupdclearall(formname,formi,ni) {
for(var hc in hiddenchilds) { 
//alert("formname="+formname+" formi="+formi+" hc="+hiddenchilds[hc].name);
if (hiddenchilds[hc].name==formname) { try { document.forms[formi].removeChild(hiddenchilds[hc]); } catch(err) { } }

}  
document.getElementById('select'+formi+ni).innerHTML=" ... ";
killpopupmenu();
}

//if (window.onload) 
//window.onload=doaltimage; 
var Xoffset=20,Yoffset=5,pom;
var tkillpopup,mousex,mousey,mousebutton,evente,tinfobk,skn,nav,old,iex=(document.all),yyy=-1000;
document.write('<div id="addelements" style=visibility:hidden;></div>');
document.write('<div id="dek" class=infobulle style="position:absolute;visibility:hidden;z-index:200;"></div>');
document.write("<div id='loading' class=noprint style='position:"+((navigator.appName.indexOf("Microsoft")!=-1)?"absolute":"fixed")+"; z-index:9999; width: 90%; height: 22px; left: 5%;bottom: 0px; background-color: #f0f0f0; border:1px solid #ccc;filter:Alpha(Opacity=30%);' align=center valign=middle><img src="+images_path+"3/loading.gif height=18 width=18><div style=display:inline; id='loading_info'>...</div></div>");
document.write('<div id="popupmenudiv" onmouseover=keeppopupmenu(); onmouseout=killpopupmenu(); class=popupmenu style="position:absolute;visibility:hidden;z-index:201;"></div>');
document.write('<div id="subpopupmenudiv" onmouseover=keeppopupmenu(); onmouseout=killpopupmenu(); class=popupmenu style="position:absolute;visibility:hidden;z-index:202;"></div>');
document.write('<div id="subpopupmenudiv2" onmouseover=keeppopupmenu(); onmouseout=killpopupmenu(); class=popupmenu style="position:absolute;visibility:hidden;z-index:203;"></div>');
document.write('<div id="subpopupmenudiv3" onmouseover=keeppopupmenu(); onmouseout=killpopupmenu(); class=popupmenu style="position:absolute;visibility:hidden;z-index:204;"></div>');
document.write('<div id="subpopupmenudiv4" onmouseover=keeppopupmenu(); onmouseout=killpopupmenu(); class=popupmenu style="position:absolute;visibility:hidden;z-index:205;"></div>');
document.write('<div name=ajax id="ajax" onmouseover=keeppopupmenu(); onmouseout=killpopupmenu(); style="position:absolute;visibility:hidden;z-index:99999;"></div>');
document.write('<div name=infobulle2 id="infobulle2" class=infobulle2 style="position:absolute;visibility:hidden;"></div>');
if(navigator.appName=="Netscape"){(document.layers || parseInt(navigator.appVersion)>=5)?nav=true:old=true;}
if (nav && !old) 
HTMLElement.prototype.__defineSetter__("outerHTML", function (sHTML) {
   var r = this.ownerDocument.createRange();
   r.setStartBefore(this);
   var df = r.createContextualFragment(sHTML);
   this.parentNode.replaceChild(df, this);
});
String.prototype.repeat = function(l){
	return new Array(l+1).join(this);
};

var windoww=0,windowh=0;//=(nav)?window.innerWidth:document.body.offsetWidth,windowh=(nav)?window.innerHeight:document.body.offsetHeight;

if (parseInt(navigator.appVersion)>3) {
 if (navigator.appName=="Netscape") {
  windoww = window.innerWidth-16;
  windowh = window.innerHeight-16;
 }
 if (navigator.appName.indexOf("Microsoft")!=-1) {
 	function getiew() {
		  windoww = document.body.offsetWidth-20;
		  windowh = document.body.offsetHeight-20;
 	}
 	t=setTimeout('getiew();',10);
 }
}


function checkdivpos(en) {
	var pos=getAbsolutePosition(document.getElementById(en));
	//alert(pos.x+" "+pos.y+" "+pos.w+" "+pos.h+" "+windoww+" "+windowh);
	//if (pos.x+pos.w>windoww-40) MM_changeProp(en,'','left',windoww-pos.w-40);
	//if (pos.y+pos.h>windowh-10) MM_changeProp(en,'','top',windowh-pos.h-10);
}

var nocontent,forcehelp,cti,dsm_ot,dsm_inmenu,dsm_t,fullload=0;

function closeload(isonload) {
if (!fullload) { 
//obj=MM_findObj('loading');
//obj.visibility="hidden";
//alert("wol="+windowonload+" fullload="+fullload);
if (document.getElementById('zone5') && document.getElementById('zone5').innerHTML=='') document.getElementById('zone5').style.width=0;
//MM_showHideLayers('loading','','hide');
infoload("......");
window.onload=hideload();
if (!fullload) {
document.onmousemove=get_mouse;
document.onmousedown=get_mousec;
document.ondrag=get_mousec;

//if (!window.onload || isonload) 
t=setTimeout('doaltimage(0)',10);
if (windowonload) 
	eval(windowonload);
}
}
fullload=1;

};


function affload() {
MM_showHideLayers('loading','','show');
};
function hideload() {
MM_showHideLayers('loading','','hide');
};
function infoload(t) {
affload();
MM_setTextOfLayer('loading_info','',t);
};


function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; if (d.forms) for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  if (d.layers) for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_setTextOfLayer(objName,x,newText,preserve) { //v4.01
if (!preserve) newText=unescape(newText); //else alert(newText);
  if ((obj=MM_findObj(objName))!=null) with (obj)
    if (document.layers) {document.write(newText); document.close();}
    else innerHTML = newText;
}

function MM_changeProp(objName,x,theProp,theValue) { //v6.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)) {
    if (obj.style) obj=obj.style;
    if (theValue == true || theValue == false) {
      eval("obj."+theProp+"="+theValue);
    }
    else if (theProp) {
    //if (theValue.indexOf("'")>0 || theValue.indexOf("\"")>0) {
        //var theIter=0;
        //do {var theValueO=theValue; theIter++;  theValue=theValue.replace("'","\\\'").replace("\"","\\\"");} while (theValue!=theValueO && theIter<40);
       // }
    eval("obj."+theProp+"=unescape('"+escape(theValue)+"');");
    }
  }
}


function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}


function MM_showHideObject(obj,v) { //v6.0
obj.disabled=(v=='show')?'false':'true';
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; 
  
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}


function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function titre(colbord,colfond,titre,espace,picto,apres,classe,helpid) {
if (!espace) {espace=0;};
if (apres || picto || helpid>0) document.write("<table border=0 cellspacing=0 cellpadding=0><tr valign=bottom><td align=left>");
document.write("<img src="+images_path+"pix.gif height=2 width=2>");
if (colbord) document.write("<table border=0 cellspacing="+espace+" cellpadding=1><tr><td bgcolor="+colbord+">");
document.write("<table border=0 cellspacing=0 cellpadding=2");
//if (classe) document.write(" class="+classe);
document.write("><tr><td");
if (colfond) document.write(" bgcolor="+colfond);
if (classe) document.write(" class="+classe);
document.write(">");
document.write(titre);
if (colbord) document.write("</td></table>");
document.write("</td></table>\n");
if (picto) document.write("</td><td align=left><img src="+images_path+"pix.gif height=2 width=2><br><img border=0 src="+images_path+"boutons/"+picto+">");
if (helpid>0) {document.write("</td><td>");help(helpid);};
if (apres) document.write("</td><td align=right class=small>"+apres);//+"<font size=-2>&nbsp;&nbsp;</font>");
if (apres || picto || helpid>0) document.write("</td></table>");
};

function barreboutons(fond,boutons) {
document.write("<table width=100% border=0 cellspacing=0 cellpadding=0 height=17 background=");
document.write(fond);
document.write("><tr><td>"+boutons+"</td></tr></table>");
};

function ToggleAll(form,nam,like,foo) {
	//w=window.open();
	var i=0,e;
	if (form!='' && document.getElementById(form)) form=document.getElementById(form);
 if (form && form!='undefined' && form.elements)
 {
  if (like=="false") var state=false; else if (like=="true") var state=true; else if (like) var state=like.checked; else var state=true;
  for (i=0;i<form.elements.length;i++) {
    e = form.elements[i];
    //w.document.write('<br>e.name='+e.name+' name='+name+' state='+state);
    //if (i<2) alert(name+" == "+e.id.substring(0,name.length));
    if (e.name != 'allbox' && e.type=='checkbox' && (!nam || e.name.substring(0,nam.length)==nam || e.id.substring(0,nam.length)==nam)) {
    			//e.checked=state;    	//if (e.onClick) e.click();    	//if (e.onclick) e.click(); else 
    	if (e.click && e.checked==false && state==true) e.click(); else e.checked=state;
    			/*if (e.onchange) e.onchange();    	if (e.onChange) e.onChange();    	*/
    }
      //if (state=="x") {if (e.checked) state="false"; else state="true";} else {e.checked=state;};
  }
 }
}

function submitonce(theform){
  if (document.all||document.getElementById){
    for (i=0;i<theform.length;i++){
      var tempobj=theform.elements[i]
        if(tempobj.type.toLowerCase()=="submit")
        tempobj.disabled=true
    }
  }
}

function printit(nsmess,iemess,othermess){
closeload();
    if (0 && iex && membre_equipe) {// && queryCommandEnabled(7)
	 var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>'; 
	 document.body.insertAdjacentHTML('beforeEnd', WebBrowser); 
	 res=WebBrowser1.ExecWB(7,2);
	 if (!res) window.print(); 
	 WebBrowser1.outerHTML = "";
    }
    else window.print();
/*
var NS = (navigator.appName == "Netscape");
  var VERSION = parseInt(navigator.appVersion);
  if (!othermess) othermess="Imprimez avec Ctrl-P";
if (VERSION > 3) {
  if (NS) {
    if (nsmess) alert(nsmess);
    window.print();
  } else {
    if (iemess) alert(iemess);
    var WebBrowser = '<object id="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
    document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
    res=WebBrowser1.ExecWB(6 ,2);//Use a 1 vs. a 2 for a prompting dialog box
    WebBrowser1.outerHTML = "";
  }
  t=setTimeout('window.close();',2000);
} else alert(othermess);
*/
}

function edithtml(what,id,ext,ext2,target,height) {
if (!ext) ext='';
if (!ext2) ext2='';
if (!height) height=500;
if (!target) target="edithtml"+id;
window.open("?lib=edithtml.php&w=670&h=350&jpath="+what+"&id="+id+escape(ext)+ext2,target,"width=670,height="+height+",menubar=no,status=yes,scrollbars=yes,resizable=yes");
};

function choix_pseudo(champobj,champ,opt,nosearch) {
var val='',w;
if (champ!="") {	obj=MM_findObj(champ); val=obj.value;	};
	if (!nosearch) w=window.open("",'choixpseudo'+champ.substring(0,3),'width=520,height=450,scrollbars=no,menubar=no,status=no,resizable=yes');
	if (w) {
		w.document.write('<link rel="stylesheet" type="text/css" href="index.php/shared/shared.css"><body><form method=post action=index.php name=foauto><input type=hidden name=parse value="nomenu=1&s=2&ss=choix_pseudo&seltout='+val+'&champ='+champ+opt+'">');//&effacrit=1
		if (val) {w.document.write('<input type=submit value=Go><script>document.foauto.submit();</script>');}
		else w.document.write('Recherche rapide : <input type=text name=cherche size=30><br><input type=submit value="Valider directement cette recherche" onclick=foauto.miseajour_selectall.value=1;><input type=hidden name=miseajour_selectall value=0><br><input type=submit value="Vérifier la recherche ou Recherche avancée"><br><br>');
		//if (createlink && createlink!='undefined') w.document.write(createlink);
	} else window.open('./?nomenu=1&s=2&ss=choix_pseudo&seltout='+val+'&formname='+champobj+'&champ='+champ+opt,'choixpseudo'+champ.substring(0,3),'width=520,height=450,scrollbars=no,menubar=no,status=no,resizable=yes');

//window.open('?nomenu=1&s=2&ss=choix_pseudo&effacrit=1&seltout='+val+'&champ='+champ+opt,'choixpseudo'+champ.substring(0,3),'width=520,height=350,scrollbars=yes,menubar=no,status=no,resizable=yes');
};

function choix_pseudo_exchange(from,to) {
of=MM_findObj(from);ot=MM_findObj(to);	//eval("t="+form+"."+from+".value");
t=of.value;			//eval("formtaches."+from+".value=formtaches."+to+".value");
of.value=ot.value;		//eval("formtaches."+to+".value=t");
ot.value=t;
eval("t=choix_"+from+".innerHTML");
eval("choix_"+from+".innerHTML=choix_"+to+".innerHTML");
eval("choix_"+to+".innerHTML=t");
};

function pseudo_tools(name) {
//document.write("<div id="+name+" onmouseover=sh('"+name"',1); onmouseout=sh('"+name+"',0); style=overflow:hidden; width=20 height=15>t<br>t</div>");
};

function choix_critcontact(champ,opt) {
var val='';
if (champ!="") {
	obj=MM_findObj(champ); val=obj.value;
	};
winopen('nomenu=1&s=2&ss=choix_pseudo&champext='+champ+opt+'&ext2='+val,'width=520,height=450','choixcrit'+champ.substring(0,3),'POST');
};


function winopen(args,taille,name,method)
{ if (!name) name='';
if (!taille) taille='width=870,height=500';
  if (method=="POST") {
  	w=window.open("",name,"resizable=yes,scrollbars=yes,status=no,menubar=no,"+taille);
	if (args) {
		w.document.write('<form method=post action=index.php name=foauto><input type=hidden name=parse value=\"'+args+'\"><input type=submit value=Go></form>');
		w.document.foauto.submit();
	}
  } else {
  	window.open(((args)?"index.php?"+args:''),name,"resizable=yes,scrollbars=yes,status=no,menubar=no,"+taille);
  };
  return false;
};


function alert_init() {
	var nms;
if (!nms) nms=0; //else alert(nms);
/* 100111 suppression cron, trop de problèmes de lenteur
if (MM_findObj("ifral") && !nms && fullload) { tal=setTimeout("ifral.location.replace('./?lib=cron.php');",1200000); }
else if (!nms) {tal=setTimeout("alert_init();",100000);};
*/
//tal=setTimeout("ifral.location='./?shared=cron.php';alert_init();",120000);popup=1&nojs=1

};

function printopen(ext,modele,printdialog) {
if (modele>0) ext+="&print="+modele; else ext+="&print=-1";
if (printdialog) url="s=1&ss=printdialog&nomenu=1&ext="+escape(ext); else url=""+ext;//080627: change en post, enleve index.php?
  	w=window.open("",'','width=670,height=570,resizable=yes,scrollbars=yes,status=no,location=no,menubar=yes');
	w.document.write('<form method=post action=index.php name=foauto><input type=hidden name=parse value=\"'+url+'\"><input type=submit value=Go></form>');
	w.document.foauto.submit();
//window.open(url,'','width=670,height=570,resizable=yes,scrollbars=yes,status=no,location=no,menubar=yes');
return false;
};


function dateday(name,journame,ji) {
y=MM_findObj(name+'[2]').value;
if (!ji) ji=0;	
if (y>0 && (y<70 || y>=1970)) {           //
	d=new Date(y,MM_findObj(name+'[1]').selectedIndex-1,MM_findObj(name+'[0]').selectedIndex+ji);
	//alert(d.getDate()+" "+d.getMonth()+" "+d.getYear());
	MM_setTextOfLayer(journame,'',formdatejour[d.getDay()]);//MM_findObj(journame).selectedIndex=1+d.getDay();
	MM_findObj(name+'[0]').selectedIndex=d.getDate();
	MM_findObj(name+'[1]').selectedIndex=d.getMonth()+1;
y=d.getYear();
if (y>40 && y<999) y+=1900; else if (y>0 && y<40) y+=2000;
	MM_findObj(name+'[2]').value=y;
};
if (MM_findObj(name)) MM_findObj(name).value=y+"/"+(d.getMonth()+1)+"/"+d.getDate();
};

var domot,domota,domotw=new Array(),domoth=new Array();
function sh(o,v,noinline,oheight) {
if (document.getElementById(o)) {
	if (!v && v!='0') {noinline=1;v=(document.getElementById(o).style.overflow=='hidden')?1:0;}
	if (v=='auto') {if (document.getElementById(o).oheight) v=0; else v=1;
	//document.getElementById(o).style.height;
	}
	//if (oheight) document.getElementById(o).oheight=oheight;
	if (v) {
	
		if (oheight) document.getElementById(o).oheight=oheight;
		if (!document.getElementById(o).oheight) document.getElementById(o).oheight=document.getElementById(o).style.height;
		if (!document.getElementById(o).oheight) document.getElementById(o).oheight=document.getElementById(o).height;
		if (domota) eval(domota);clearTimeout(domot);document.getElementById(o).style.overflow='visible';
		if (!noinline) { document.getElementById(o).style.display='inline';document.getElementById(o).style.zIndex=999;} else document.getElementById(o).style.height='';}
	else {	
	
		//domota="document.getElementById('"+o+"').style.overflow='hidden';document.getElementById('"+o+"').style.zIndex=1;";
		document.getElementById(o).style.overflow='hidden';document.getElementById(o).style.zIndex=1;
		if (document.getElementById(o).oheight) {
		//domota+="document.getElementById('"+o+"').style.height='"+document.getElementById(o).oheight+"';";
		document.getElementById(o).style.height=document.getElementById(o).oheight;
		}
		 else {
		 //domota+="document.getElementById('"+o+"').style.height=0;";
		 document.getElementById(o).style.height=1;
		 }
		//alert(domota);
		//eval(domota);//domot=setTimeout(domota,100); 
	};
}
};
function sho(divn,show) {//montre simple
	if (!show && show!='0') show=(document.getElementById(divn).style.visibility=='hidden')?1:0;
	if (show) { MM_showHideLayers(divn,'','show'); } else { MM_showHideLayers(divn,'','hide'); };
};
//var shhh;
function shh(divn,show) {//montre overflow
 	//var shhh; shhh[divn]=document.getElementById(divn).style.height; //if (shhh && shhh[divn]) MM_changeProp(divn,'','height',shhh[divn]);
	if (!show && show!='0') show=(document.getElementById(divn).style.overflow=='hidden')?1:0;
	if (show) { MM_showHideLayers(divn,'','show');MM_changeProp(divn,'','overflow','visible');MM_changeProp(divn,'','height','0'); } else { MM_showHideLayers(divn,'','hide');MM_changeProp(divn,'','overflow','hidden'); };
};
function sha(divn,show) {//pass devant

	if (show) { MM_showHideLayers(divn,'','show');MM_changeProp(divn,'','overflow','visible');MM_changeProp(divn,'','position','absolute');MM_changeProp(divn,'','zIndex','9999'); } else { MM_showHideLayers(divn,'','hide');MM_changeProp(divn,'','overflow','hidden');MM_changeProp(divn,'','position','relative'); };
};
function shs(divn,show,mode) {//montre auto devant
	if (!mode) mode='auto';
	if (!show && show!='0') show=(document.getElementById(divn).style.overflow=='hidden')?1:0;
	alert(show);
	if (show) { MM_changeProp(divn,'','overflow',mode); } else { MM_changeProp(divn,'','overflow','hidden');};
};
function shb(o,v,top) {
	if (v) {
		//if (domota) eval(domota);  
		clearTimeout(domot);
		if (!domoth[o] && document.getElementById(o).style.height) domoth[o]=document.getElementById(o).style.height;
		document.getElementById(o).style.height='';
		document.getElementById(o).style.overflow='visible';
		document.getElementById(o).style.position='absolute';
		if (top) document.getElementById(o).style.top=top;
		document.getElementById(o).style.zIndex=999;
	} else {	
		domota="document.getElementById('"+o+"').style.overflow='hidden';document.getElementById('"+o+"').style.position='';document.getElementById('"+o+"').style.zIndex=1;";
		if (domoth[o]) domota+="document.getElementById('"+o+"').style.height='"+domoth[o]+"'";
		eval(domota);
		//domot=setTimeout(domota,1); 
	};
};

function changeframeset(frameset,cols,rows,frame,content) {

if (top.document.getElementById(frameset)) {
top.document.getElementById(frameset).cols=cols;
content='<link rel="stylesheet" type="text/css" href="./index.php/templates/shared.css"><link rel="stylesheet" type="text/css" href="./index.php/templates/3.css">'+content;
if (top.document.getElementById(frame).contentWindow.document) {top.document.getElementById(frame).contentWindow.document.open();top.document.getElementById(frame).contentWindow.document.write(content);top.document.getElementById(frame).contentWindow.document.close();}
if (top.document.getElementById(frame).contentDocument) {top.document.getElementById(frame).contentDocument.open();top.document.getElementById(frame).contentDocument.write(content);top.document.getElementById(frame).contentDocument.close();}
//else if (top.document.getElementById(frame).document) top.document.getElementById(frame).document.write(content);
else top.document.getElementById(frame).innerHTML=content;
}
}

//////////////////////
// SUBMENU
//////////////////////
if (!membre_equipe) {
	function show_submenu() {};
	function submenuout() {};
} else if (membre_equipe==1) { 

	function show_submenu(section,e) {
	//alert(section);
	var dsm=MM_findObj('divsubmenu2');
	if (dsm && membre_equipe) {
	  var t='';
	       //if (section==0) t="<a class=submenuonglets href=?s=8&ss=taches_liste>Mes tâches</a><a class=submenuonglets href=?s=0&ss=notes&action=liste>Notes et dialogues écrits</a>";
	  //else 
	  if (section==1 || section==12) {
	  if (dansgroupe>0) t+="Groupe en cours: <a class=\"grouptitlebg submenuonglets\" href=./?s=8&idgroupe="+dansgroupe+"&ss=taches_liste>Tâches</a><a class=\"grouptitlebg submenuonglets\" href=./?s=1&idgroupe="+dansgroupe+">Documents</a><a class=\"grouptitlebg submenuonglets\" href=./?s=1&idgroupe="+dansgroupe+"&ss=contacts>Contacts</a><a class=\"grouptitlebg submenuonglets\" href=./?s=1&idgroupe="+dansgroupe+"&ss=emails>Courriers</a><hr>";// - <a class=\"grouptitlebg submenuonglets\" href=javascript:groupe_edit('&dependde="+dansgroupe+"');>Nouveau sous-groupe</a><a class=\"grouptitlebg submenuonglets\" href=javascript:news_open('&idgroupe="+dansgroupe+"','','',1);>Nouveau document</a><br> ";
	  t+="<a class=\"grouptitlebg submenuonglets\" href=javascript:groupe_edit('&dependde="+dansgroupe+"&npd="+section+"');>Nouveau groupe</a><a class=\"grouptitlebg submenuonglets\" href=javascript:news_open('&idgroupe="+dansgroupe+"&npd="+section+"','','',1);>Nouveau document</a><a class=\"grouptitlebg submenuonglets\" href=./?s="+section+"&ss=search&idgroupe="+dansgroupe+">Recherche avancée</a><input class=\"submenuonglets\" style=width:85%;height:20px;display:inline;  id=searchtext"+section+" value='Recherche' onclick=this.value='';this.style.borderWidth=2; onkeypress=\"if (this.value&&event.keyCode==13) window.location.replace('./?s="+section+"&cherche='+this.value);\"><input type=button value=OK style=width:10%; onclick=window.location.replace('./?s="+section+"&cherche='+document.getElementById('searchtext"+section+"').value);>";
	  if (document.getElementById('goto'+((section==1)?"d":"w")+'groupdiv')) t+="<div class=\"grouptitlebg submenuonglets\">"+document.getElementById('goto'+((section==1)?"d":"w")+'groupdiv').innerHTML+"</div>";
	  }
	  else if (section==2) {
	  	t="<a class=\"contacttitlebg submenuonglets\" href=javascript:contact_open('','creer_type=0');>Nouveau contact</a><a class=\"contacttitlebg submenuonglets\" href=javascript:contact_open('','creer_type=1');>Nouvelle société</a><input class=submenuonglets style=width:85%;height:20px;display:inline;  value='Recherche' onclick=this.value='';this.style.borderWidth=2; id=searchtext"+section+" onkeypress=\"if (this.value&&event.keyCode==13) window.location.replace('./?s=2&cherche='+this.value);\"><input type=button value=OK style=width:10%; onclick=window.location.replace('./?s="+section+"&cherche='+document.getElementById('searchtext"+section+"').value);>";//<div class=\"submenuonglets\" style=height:24px;>"+document.getElementById('gotocontactdiv').innerHTML.replace(/gotocontact/g,'goto1contact').replace(/sell/g,'listeidto')+"</div>";
	  }
	  else if (section==3) t="<div align=center><a class=\"agendatitlebg submenuonglets\" href=javascript:agenda_open('');>Nouveau rendez-vous</a><a class=\"agendatitlebg submenuonglets\" href=./?s=3>consulter l'agenda</a><input class=submenuonglets style=width:85%;height:20px;display:inline;  value='Recherche' onclick=this.value='';this.style.borderWidth=2;  id=searchtext"+section+" onkeypress=\"if (this.value&&event.keyCode==13) window.location.replace('./?s=3&cherche='+this.value);\"><input type=button value=OK style=width:10%; onclick=window.location.replace('./?s="+section+"&cherche='+document.getElementById('searchtext"+section+"').value);></div>";
	  else if (section==4) t="<div align=center><a class=\"accounttitlebg submenuonglets\" href=javascript:compte_edition('','');>Nouvel élément du compte</a><a class=\"accounttitlebg submenuonglets\" href=./?s=4,showaccounts>Etat des comptes</a><input class=submenuonglets style=width:85%;height:20px;display:inline;  value='Recherche' onclick=this.value='';this.style.borderWidth=2;  id=searchtext"+section+" onkeypress=\"if (this.value&&event.keyCode==13) window.location.replace('./?s=4&cherche='+this.value);\"><input type=button value=OK style=width:10%; onclick=window.location.replace('./?s="+section+"&cherche='+document.getElementById('searchtext"+section+"').value);></div>";
	  else if (section==5) t="<div align=center><a class=\"emailtitrebg submenuonglets\" href=javascript:email_open('index.php?nomenu=1&s=5&ss=ecrire','');>nouveau message</a><a class=\"emailtitrebg submenuonglets\" href=javascript:email_open('index.php?nomenu=1&s=5&ss=model','');>d'après modèle</a><a class=\"emailtitrebg submenuonglets\" href=javascript:news_open('dapres_type=12&idgroupe="+dansgroupe+"&ciblestrategie=4','','',1);>Créer un modèle</a><a class=\"emailtitrebg submenuonglets\" href=?s=5&ss=search>Recherche avancée</a><input class=submenuonglets style=width:85%;height:20px;display:inline;  value='Recherche' onclick=this.value='';this.style.borderWidth=2;  id=searchtext"+section+" onkeypress=\"if (this.value&&event.keyCode==13) window.location.replace('./?s=5&cherche='+this.value);\"><input type=button value=OK style=width:10%; onclick=window.location.replace('./?s="+section+"&cherche='+document.getElementById('searchtext"+section+"').value);></div>";
	  else if (section==6) 
	  	t="<a style=\"margin-top:10px;border-top:1px solid #333;\" class=\"submenuonglets\" href=./?logout=1>Se déconnecter</a>";
	  else if (section==8) t="<a class=\"tasktitlebg submenuonglets\" href=./?s=8&ss=taches_liste>Mes Tâches</a><a class=\"tasktitlebg submenuonglets\" href=# onclick=\"planning('me');return false;\">Planning graphique</a><a class=\"tasktitlebg submenuonglets\" href=# onclick=\"open_tache('action=ecrire');return false;\">Nouvelle tâche</a>";
	  if (t) {
	  	//alert(t);
	    if (!dsm_ot) dsm_ot=dsm.innerHTML;
	    MM_setTextOfLayer('divsubmenu2','','<table cellpadding=0 cellspacing=0 width=100%><tr><td>'+t+'</td></table>');
	    if (e) var absposx=getAbsolutePosition(e).x;//getRelativeCoordinates(thise, window.document);
	    //if (setclass) MM_changeProp('divsubmenu2','','className',setclass);
	    MM_showHideLayers('divsubmenu2','','show');
	    MM_changeProp('divsubmenu2','','left',(absposx>0)?absposx:mousex-20);
		//MM_changeProp('divsubmenu2','','top',mousey+10);

	    dsm_inmenu=1;
	  } else {
	  	submenuout(1);
	  }
	};
	};
	
	//tm=setTimeout('submenu(s);',2000);
	
	function submenuout(force) {
	if (force) {MM_showHideLayers('divsubmenu2','','hide');MM_findObj('divsubmenu2').innerHTML='';}
	if (dsm_t) clearTimeout(dsm_t);
	if ( !force ) {
		
	if (dsm_ot && !dsm_inmenu) dsm_t=setTimeout("dosubmenuout();",500);//dsm_ot
	else { if (dsm_inmenu<=1) dsm_inmenu=0;
		dsm_t=setTimeout('submenuout();',500);};
	};
	}
	function dosubmenuout() {
		if (!dsm_inmenu) {
			MM_showHideLayers('divsubmenu2','','hide');MM_findObj('divsubmenu2').innerHTML='';
		}
	}
}
//////////////////////
// EMAIL
//////////////////////

var outils_div=0; 



function email_setmailstate(id,state,noajax,email_db) {
	var ces=(s==15 || email_db=='forum')?15:5;
	//if (state!='') {
	t="<div style=\"width:12px;height:12px;text-align:left;vertical-align:top;font-weight:bold;background-color:#"+email_statesbgcol[state]+";color:#"+email_statescol[state]+"\">"+email_states[state].substring(0,2)+"</div>";
	t+="<div style=\"width:150px;height:12px;text-align:left;vertical-align:top;font-weight:bold;background-color:#"+email_statesbgcol[state]+";color:#"+email_statescol[state]+"\">"+email_states[state]+" ("+state+")"+"</div>";
	var nextstate=0;for(var i=state+1;(i<=99 && !nextstate);i++) if (email_states[i]) nextstate=i;
	t+="<div style=\"width:150px;height:12px;margin-left:20px;margin-bottom:4px;text-align:left;vertical-align:top;background-color:#"+email_statesbgcol[nextstate]+";color:#"+email_statescol[nextstate]+"\" onclick=email_setmailstate('"+id+"',"+nextstate+");> --&gt; "+email_states[nextstate]+"</div>";
	//if (!ret) 
	MM_setTextOfLayer('outils_readstate'+id+'s','',t);
	//else return t;
	if (!noajax) {
		//TODO: changer état
		//alert('./?ns=5,setmailstate&id='+id+'&state='+state+((email_db)?'&email_db='+email_db:''));
		//if (ifral) ifral.location.replace('./?ns='+ces+',setmailstate&id='+id+'&state='+state+((email_db)?'&email_db='+email_db:'')); //else window.open('./?ns='+ces+',setmailstate&id='+id+'&state='+state+((email_db)?'&email_db='+email_db:''),'','width=1;height);
		if (document.getElementById('ifral')) ifral.location.replace('./?ns='+ces+',setmailstate&id='+id+'&state='+state+((email_db)?'&email_db='+email_db:''));
		else window.location.replace('./?ns='+ces+',setmailstate&id='+id+'&state='+state+((email_db)?'&email_db='+email_db:'')+"&doafter=close");
		sh('outils_readstate'+id,0);
	}
	//}
}

function email_readstate(id,state,email_db) {
outils_div++;
document.write("<div style=\"width:15px;height:12px;line-height:12px;padding:1px;font-size:10px;text-align:left;vertical-align:top;float:left;\"><div id=outils_readstate"+id+" style=width:12px;height:12px;position:absolute;overflow:hidden;z-index:"+(9999-outils_div)+"; onmouseover=sh('outils_readstate"+id+"',1); onmouseout=sh('outils_readstate"+id+"',0);>");
document.write("<div id=outils_readstate"+id+"s></div>");
for (var i=0;i<=99;i++) if (email_states[i]) {
document.write("<div style=\"width:150px;height:12px;margin-left:20px;text-align:left;vertical-align:top;background-color:#"+email_statesbgcol[i]+";color:#"+email_statescol[i]+"\" onclick=email_setmailstate('"+id+"',"+i+",'','"+email_db+"');>"+email_states[i]+"</div>");
}
t=setTimeout('email_setmailstate('+id+','+state+',1,"'+email_db+'");',500);
document.write("</div>&nbsp;</div>");
}

function email_statesonglets(state,url,compact,limit_to) {
if (limit_to) limit_to=' '+limit_to; else limit_to='';
document.write("<div class=divonglets>");
for (var i=0;i<=99;i++) if (email_states[i] && (!limit_to || limit_to.indexOf(' '+i+' ')>0)) {
document.write("<div class=menuonglets style=\"display:inline;background-color:#"+email_statesbgcol[i]+";color:#"+email_statescol[i]+";"+((state==i)?"font-weight:bold;":"")+"\" onclick=window.location='"+url+i+"';"+((compact)?" title=\""+email_states[i]+"\">"+email_states[i].substring(0,2):">"+email_states[i])+"</div>");
}
document.write("</div>");

}

function email_outils (id,c,lu,pj,pub,ext,idgroupe,contactde,envoi,compact,newsecrire,ces) {
if (!ces) ces=(s==15)?15:5;
document.write("<div align=right style=text-align:right; nowrap>");
if (compact<=2)
{
 if (envoi==0 || compact==2) {// oui si forum
 outils_div++;
 document.write("<div style=\"width:28px;height:17px;text-align:left;vertical-align:top;float:left;\"><div id=outils_div"+outils_div+" style=width:28px;height:17px;position:absolute;overflow:hidden;z-index:"+(9999-outils_div)+"; onmouseover=sh('outils_div"+outils_div+"',1); onmouseout=sh('outils_div"+outils_div+"',0);>");
	 if (newsecrire>0)
	 		document.write("<a target=_blank href=# onclick=\"news_open('&action=re&re_pasbody=1&idre="+id+"',"+newsecrire+");return false;\"><img src="+images_path+"3/emailre.png width=28 height=17 border=0 alt=Répondre></a>");
	   else	document.write("<a target=_blank href=index.php?s="+ces+"&"+ext+"&id="+id+"&ss=ecrire&action=re&c="+c+" onclick=\"email_open('index.php?nomenu=1&s="+ces+"&"+ext+"&id="+id+"&ss=ecrire&action=re&c="+c+"','mailre"+id+"'); return false;\"><img src="+images_path+"3/emailre.png width=28 height=17 border=0 alt=Répondre></a>");
	 if (membre_equipe && compact==0) document.write("<br><a target=_blank href=index.php?s="+ces+"&"+ext+"&id="+id+"&ss=model&action=re&c="+c+" onclick=\"email_open('index.php?nomenu=1&s="+ces+"&"+ext+"&id="+id+"&ss=model&action=re&c="+c+"','mailre"+id+"'); return false;\"><img src="+images_path+"3/emailremodel.png width=28 height=17 border=0 alt=\"Répondre avec un modèle de courrier\"></a>");
 if (compact<=1) document.write("<br><a href=index.php?s="+ces+"&"+ext+"&sel[]="+id+"&c="+c+"&email_marquer_lu=99&email_menu_act=1 onclick=\"open_tache('action=ecrire&"+ext+"&st="+s+"&stc="+c+"&taskcat=mail&idgroupe="+idgroupe+"&selv="+id+"');\"><img src="+images_path+"3/emailtask.png width=27 height=15 border=0 alt=\"Créer une tâche à partir de ce courrier et le marquer comme lu\"></a>");
 if (compact==0)
 	document.write("<br><a href=# onclick=\"return email_sel('selv="+id+",');\"><img name=agirsel src="+images_path+"3/mailact.png width=28 height=17 border=0 alt=\"Classer ce courrier\"></a>");
document.write("</div>&nbsp;</div>");
 };


};

 if (compact==0)
 {
outils_div++;
 document.write("<div style=\"width:28px;height:17px;text-align:left;vertical-align:top;float:left;\"><div id=outils_div"+outils_div+" style=width:28px;height:17px;position:absolute;overflow:hidden;z-index:"+(9999-outils_div)+"; onmouseover=sh('outils_div"+outils_div+"',1); onmouseout=sh('outils_div"+outils_div+"',0);>");
	if (lu>0) {document.write("<a href=index.php?s="+ces+"&"+ext+"&sel[]="+id+"&c="+c+"&email_marquer_nonlu=1&email_menu_act=1><img src="+images_path+"3/mailclose.png width=28 height=17 border=0 alt=\"Passer: A lire\"></a>");}
      else {document.write("<a href=index.php?s="+ces+"&"+ext+"&sel[]="+id+"&c="+c+"&email_marquer_lu=99&email_menu_act=1><img src="+images_path+"3/mailopen.png width=28 height=17 border=0 alt=\"Passer: Archiver\"></a>");};
document.write("<br><a href=index.php?s="+ces+"&"+ext+"&sel[]="+id+"&c="+c+"&email_marquer_lu=11&email_menu_act=1><img src="+images_path+"3/mailopen.png width=28 height=17 border=0 alt=\"Passer: A traiter\"></a>");
document.write("<br><a href=index.php?s="+ces+"&"+ext+"&sel[]="+id+"&c="+c+"&email_marquer_lu=21&email_menu_act=1><img src="+images_path+"3/mailopen.png width=28 height=17 border=0 alt=\"Passer: A facturer\"></a>");
 document.write("</div></div>");
  };



 
  outils_div++;
 document.write("<div style=\"width:28px;height:17px;text-align:left;vertical-align:top;float:left;\"><div id=outils_div"+outils_div+" style=width:28px;height:17px;position:absolute;overflow:hidden;z-index:"+(9999-outils_div)+"; onmouseover=sh('outils_div"+outils_div+"',1); onmouseout=sh('outils_div"+outils_div+"',0);>");

 if (pub==1) {document.write("<a href=# onclick=\"e='';if (confirm('marquer comme non lu en rendant privé?')) e='&email_marquer_nonlu=1'; window.location='index.php?s="+ces+"&"+ext+"&sel[]="+id+"&c="+c+"&email_rendre_prive=1&email_menu_act=1'+e;\"><img src="+images_path+"boutons/bouton_email_public.gif width=28 height=17 border=0 alt=\"Public. Me privatiser ce message.\"></a><br>");}
else if (idgroupe>0 && compact!=2) {document.write("<a href=# onclick=\"e='';if (confirm('marquer comme non lu en rendant public?')) e='&email_marquer_nonlu=1'; window.location='index.php?s="+ces+"&"+ext+"&sel[]="+id+"&c="+c+"&email_rendre_public=1&email_menu_act=1'+e;\"><img src="+images_path+"boutons/bouton_email_prive.gif width=28 height=17 border=0 alt=\"Privé. Rendre public sur le groupe.\"></a><br>");}


 document.write("<a target=_blank href=index.php?s="+ces+"&"+ext+"&id="+id+"&ss=ecrire&action=fw&c="+c);

  if (envoi>0)
 	document.write(" onclick=\"email_open('index.php?nomenu=1&s="+ces+"&"+ext+"&dapresid="+id+"&ss=ecrire&action=again&c="+c+"','mailfw"+id+"'); return false;\"><img src="+images_path+"boutons/bouton_email_fw.gif width=28 height=17 border=0 alt=\"Transférer ce message à un autre destinataire\"></a>");
 else if (compact<=2 && idgroupe>0 && membre_equipe && !newsecrire)
 	document.write(" onclick=\"if (confirm('Transférer en interne ? (sinon, faire suivre une copie)')) {choix_pseudo('','','&deja="+contactde+"&unseul=1&lien="+escape("opener.location='?s="+ces+"&nomenu=1&id="+id+"&set_id_to=#SELTOUT';")+"');} else { email_open('index.php?nomenu=1&s="+ces+"&"+ext+"&id="+id+"&ss=ecrire&action=fw&c="+c+"','mailfw"+id+"');}; return false;\"><img src="+images_path+"boutons/bouton_email_fw.gif width=28 height=17 border=0 alt=\"Transférer ce message à un autre destinataire\"></a>");
 else if (compact<=2)
 	document.write(" onclick=\"email_open('index.php?nomenu=1&s="+ces+"&"+ext+"&id="+id+"&ss=ecrire&action=fw&c="+c+"','mailfw"+id+"'); return false;\"><img src="+images_path+"boutons/bouton_email_fw.gif width=28 height=17 border=0 alt=\"Transférer ce message à un autre destinataire\"></a>");
    //  else {document.write("<img src="+images_path+"boutons/bouton_email_pjvide.gif width=28 height=17 border=0>");}

//};
//if (compact!=2)
//{
//};
if (compact==0) document.write("<br><a href=index.php?s="+ces+"&"+ext+"&sel[]="+id+"&c="+c+"&email_effacer=1&email_menu_act=1><img src="+images_path+"boutons/bouton_email_effacer.gif width=28 height=17 border=0 alt=\"Effacer\"></a>");
document.write("</div></div>");


if (compact<=2)
{
	if (pj.length>2) document.write("<div style=\"width:16px;height:17px;float:left;\"><a target=_blank href="+pj+"><img src="+images_path+"3/attach.png width=18 height=17 border=0 alt=\"Pièce jointe\"></a></div>");
	else if (pj=="1") document.write("<div style=\"width:16px;height:17px;float:left;\"><img src="+images_path+"3/attach.png width=18 height=17 border=0 alt=\"Pièce jointe\"></div>");
	else if (compact<=1) document.write("<div style=\"width:16px;height:17px;float:left;\"><img src="+images_path+"boutons/bouton_email_pjvide.gif width=16 height=17 border=0 alt=\"Pas de pièce jointe\"></div>");
};
document.write("</div>");
};


function email_open(url,name,args) {
if (args)
 {
	w=window.open("index.php?popup=1&nojs=1",name,'width=700,height=560,menubar=no,scrollbars=yes,status=yes,resizable=yes');
	w.document.write("<form method=post action=index.php name=foauto><input type=hidden name=parse value=\""+args+"\">");
	w.document.write('<input type=submit value=Go></form>');w.document.foauto.submit();
 }
else
 { window.open(url,name,'width=700,height=560,menubar=no,scrollbars=yes,status=yes,resizable=yes'); };
};

function email_ecrire(url,name,args,ces) {
	if (!ces) ces=(s==15)?15:5;
if (!url) url="";
if (!args) args="";
if (!name) name="emailecr";
if (url.indexOf('model')>0 || args.indexOf('model')>0) {
	window.open("./?s="+ces+"&nomenu=1&"+url+"&"+args,name,'width=700,height=560,menubar=no,scrollbars=yes,status=yes,resizable=yes'); 
} else {
	window.open("./?s="+ces+",ecrire&nomenu=1&"+url+"&"+args,name,'width=700,height=560,menubar=no,scrollbars=yes,status=yes,resizable=yes'); 
	/*
	w=window.open('',name,'width=700,height=560,menubar=no,scrollbars=yes,status=yes,resizable=yes');
	w.document.write("<html><head><title>Oxywork - Nouveau courrier</title></head>");
	w.document.write("<frameset rows=240,* marginwidth=10 marginheight=10 border=0 topmargin=10 leftmargin=10>");
	w.document.write("<frame name=menu scrolling=no marginwidth=10 marginheight=10 border=0 topmargin=10 leftmargin=10 src=./?s=5&ss=ecrire&inframe=top&nomenu=1&"+url+"&"+args+">");
	w.document.write("<frame name=idC id=idC marginwidth=10 marginheight=10 border=0 topmargin=10 leftmargin=10 rightmargin=10 bottommargin=10>");
	w.document.write("</frameset></html>");
	*/
}
};

function email_sel(ext2,ces) {
	if (!ces) ces=(s==15)?15:5;
	window.open("index.php?s="+ces+"&ss=selection&nomenu=1&"+ext2,"email_sel","width=600,height=300,status=no,menubar=no,scrollbars=yes");
	return false;
};

function email_op(id,ces) {
	if (!ces) ces=(s==15)?15:5;
	email_open("index.php?s="+ces+"&nomenu=1&id="+id,'email'+id);
	return false;
};

function email_agirsel(ext,bouton) {
var selliste="&selv=",femail=document.getElementById('email_menu');
if (email_menu.toutsel) selliste+=email_menu.toutsel.value;
for (var i=0;i<femail.elements.length;i++)
  {if (femail.elements[i].checked)
    { selliste+=femail.elements[i].value+","; };
  };
if (selliste=="") {alert("Aucune sélection. Sélectionnez les messages en cochant la case à gauche de la ligne."); }
else { if (bouton=='creertache')
			open_tache("action=ecrire&taskcat=mail&"+ext+selliste);
	   else email_sel(ext+selliste);
	 };
};

function email_okpouragirsel() {
var selliste=0,femail=document.getElementById('email_menu');
for (var i=0;i<femail.elements.length;i++)
  {if (femail.elements[i].checked)
    { selliste=selliste+1; };
  };
if (selliste>0)
{
  document.agirsel.src=""+images_path+"3/actonsel.png";
  //document.creertache.src=""+images_path+"3/emailtask.png";
  document.effacer.src=""+images_path+"3/delete.png";
  document.marquer_lu.src=""+images_path+"3/mailopen.png";
  //document.move.src=""+images_path+"pix.gif";//boutons/bouton_email_mv.gif";
} else {
  document.agirsel.src=""+images_path+"pix.gif";
  //document.creertache.src=""+images_path+"pix.gif";
  document.effacer.src=""+images_path+"pix.gif";
  document.marquer_lu.src=""+images_path+"pix.gif";
  //document.move.src=""+images_path+"pix.gif";
};
};


function contact_from_email(fromemail) {
// if (confirm('Créer un nouveau contact ? (si non, cet email sera attribué à un contact à choisir)'))
//	 contact_open('','&email_new='+escape(fromemail));
// else
	 choix_pseudo('','',"&unseul=1&createlink=1&lien=contact_open(\'#SELTOUT\',\'email_new="+escape(fromemail)+"\');");
 return false;
};



// MENUS


function email_menu (ext,c,affichage,deuxlignes,idgroupe,pastitre,ces,nosend,nocontent) {
var ext2="";if (!ces) ces=(s==15)?15:5;
if (idgroupe) ext+="&idgroupe="+idgroupe;
if (idgroupe) ext2+="&ss=emails";
if (!pastitre) titre("#666699","#ffffff","<a href=index.php?"+ext+ext2+"&s="+ces+" class=emailtitre>COURRIER</a>",0,'picto_email_titre.gif','','',40);
//document.write("<div class=toolbar id=toolbar5 onmouseover=sh(this.id,1); onmouseout=sh(this.id,0); >");
//document.write("<table width=100% border=0 cellspacing=0 cellpadding=0 background="+images_path+"boutons/bouton_email_fond.gif><tr><td valign=top>");

if (affichage!="forum") {
	if (nosend!=1) {
 document.write("<a class=tool href=index.php?s="+ces+"&"+ext+ext2+"&ss=ecrire onclick=\"email_open('index.php?nomenu=1&s="+ces+"&"+ext+ext2+"&ss=ecrire','');return false;\"><img src="+images_path+"3/edit.png width=20 height=15 border=0 alt=\"Nouveau message\" align=absmiddle>Nouveau message</a> ");
 document.write("<a class=tool href=index.php?s="+ces+"&"+ext+"&ss=model onclick=\"email_open('index.php?nomenu=1&s="+ces+"&"+ext+"&ss=model','');return false;\"><img src="+images_path+"3/open.png width=15 height=15 border=0 alt=\"Ouvrir un modèle de courrier\" align=absmiddle></a> ");
 if (!nocontent) document.write("<a href=# onclick=\"window.open('index.php?popup=pop3_get.php&action=liste&goap="+escape("index.php?s="+ces+"&"+ext+ext2)+"','pop3get','width=450,height=250,menubar=no,status=yes,resizable=yes,scrollbars=yes');return false;\"><img src="+images_path+"3/checkmailbox.png width=15 height=15 border=0 alt=\"Vérifier le nouveau courrier.\" align=absmiddle></a>");
	}
	 if (affichage!="compact" && affichage!="ultracompact") {
 document.write("<a href=index.php?s="+ces+"&"+ext+ext2+"&c="+c+"&affichage=compact><img src="+images_path+"3/compact.png width=16 height=15 border=0 alt=\"Affichage compact\" align=absmiddle></a>");
	 };
	 if (affichage!="frombody") {
	 document.write("<a href=index.php?s="+ces+"&"+ext+ext2+"&c="+c+"&affichage=frombody><img src="+images_path+"3/fulldetails.png width=16 height=15 border=0 alt=\"Affichage avec détails\" align=absmiddle></a>");
	  };
	 if (affichage!="fil" && affichage!="suivi" && affichage!="ultracompact") {
	 document.write("<a href=index.php?s="+ces+"&"+ext+ext2+"&c="+c+"&affichage=fil><img src="+images_path+"3/compact.png width=16 height=15 border=0 alt=\"Affichage par fil de discussion\" align=absmiddle></a>");
	  };
};
document.write("<a href=# onclick=\"var search=prompt('search?','');if (search) window.location.replace('index.php?s="+ces+"&"+ext+ext2+"&c="+c+"&search='+search);return false;\"><img src="+images_path+"3/search.png width=20 height=15 border=0 alt=\"Search\" align=absmiddle></a>");
if (!nocontent)
{
 if (deuxlignes) document.write("<br>");//<table border=0 cellspacing=0 cellpadding=0 background="+images_path+"boutons/bouton_email_fond.gif><tr><td>"); else document.write("</td><td align=left>");
 document.write(" <input class=tool type=checkbox name=allbox onclick=ToggleAll('email_menu','',this);email_okpouragirsel();>");
  document.write("<a href=# onclick=\"email_agirsel('&"+ext+"&st="+s+"&stc="+c+"&idgroupe="+idgroupe+"','creertache');return false;\"><img name=creertache src="+images_path+"3/emailtask.png width=27 height=15 border=0 alt=\"Créer une tâche\" align=absmiddle></a>");
 document.write("<a href=# onclick=\"email_agirsel('c="+c+"&affichage="+affichage+"');return false;\"><img name=agirsel src="+images_path+"pix.gif width=24 height=15 border=0 alt=\"Agir sur la sélection\" align=absmiddle></a>");
 if (affichage!="forum") {
  document.write("<a href=# onclick=\"email_menu.email_marquer_lu.value=99;email_menu.email_menu_act.value=1;email_menu.submit();return false;\"><img name=marquer_lu src="+images_path+"pix.gif width=27 height=15 border=0 alt=\"Marquer comme lu\" align=absmiddle></a>");
 };
 document.write("<a href=# onclick=\"email_menu.email_effacer.value=1;email_menu.email_menu_act.value=1;email_menu.submit();return false;\"><img name=effacer src="+images_path+"pix.gif width=18 height=15 border=0 alt=\"Effacer\" align=absmiddle></a>");
 //document.write("<a href=# onclick=\"alert(classeurs.email_moveto.value);email_menu.email_moveto.value=classeurs.email_moveto.value;email_menu.email_menu_act.value=1;email_menu.submit();return false;\"><img name=move src="+images_path+"pix.gif width=28 height=17 border=0 alt=\"Effacer\" align=absmiddle></a>");
 //if (deuxlignes) document.write("</td></tr></table>");
};
//document.write("</div>");//</td><td>&nbsp;</td></tr></table>");
};






//////////////////////
// AGENDA
//////////////////////

function agenda_menu(ext,pastitre) {
//if (!pastitre) titre('#ffffff','#B0BCD7','<a href=index.php?'+ext+'&s=3 class=agendatitre>AGENDA</a>',0,'picto_agenda_titre.gif','','',72);
//document.write("<table width=100% border=0 cellspacing=0 cellpadding=0 height=17 background="+images_path+"boutons/bouton_agenda_fond.gif><tr><td class=tool>");
document.write("<a href=# class=tool onclick=\"agenda_open('"+ext+"');return false;\"><img src="+images_path+"boutons/bouton_agenda_ecrire.gif width=27 height=17 border=0 alt=\"Nouveau rendez-vous\"></a>");
document.write("<a href=# onclick=\"window.open('index.php?s=3&ss=imprimer&nomenu=1&"+ext+"','agendaimprim','width=640,height=400,scrollbars=yes,status=no,menubar=no');return false;\"><img src="+images_path+"3/print.png width=27 height=17 border=0 alt=\"Imprimer l'agenda et les contacts associés\"></a>");
//document.write("<a href=# onclick=\"open_tache('action=ecrire"+ext+"');return false;\"><img src="+images_path+"boutons/bouton_planning_tco.gif width=28 height=17 border=0 alt=\"Rajouter une nouvelle tâche ou une tâche en cours\"></a>");
//document.write("</td></tr></table>");
};

function agenda_outils (ext,id,editer,valider,annuler,extc) {
if (valider) {document.write("<a href=./?s=3&ss=valid&id="+id+" onclick=return(void(window.open(this.href,'','width=100,height=50')));><img src="+images_path+"boutons/bouton_agenda_valider.gif width=28 height=17 border=0></a>");};
document.write("<a href=index.php?s=5&ss=ecrire&idrdv="+id+" onclick=\"email_open('index.php?s=5&nomenu=1&ss=ecrire&idrdv="+id+"','rv"+id+"');return false;\"><img src="+images_path+"3/emailsend.png width=28 height=17 border=0 alt=\"Envoyer par email\"></a>");
if (editer)  {document.write("<a href=# onclick=\"agenda_open('"+ext+"&idagenda="+id+"');return false;\"><img src="+images_path+"3/modify.png width=28 height=17 border=0 alt=\"Editer\"></a>");};
//document.write("<a href=# onclick=\"window.open('index.php?s=3&ss=imprimer&nomenu=1&"+ext+'&'+extc+"','agendaimprim','width=640,height=400,scrollbars=yes,status=no,menubar=no');return false;\"><img src="+images_path+"3/print.png width=27 height=17 border=0 alt=\"Imprimer l'agenda et les contacts associés\"></a>");
//if (annuler) {document.write("<a href=\"index.php?s=3&"+ext+"&idagenda="+id+"&agendaeffacer=1&confirmeeff=1\" onclick=\"return confirm('Merci de confirmer cet effacement');\"><img src="+images_path+"boutons/bouton_agenda_effacer.gif width=28 height=17 border=0 alt=\"Effacer\"></a>");};
//if (valider || editer || annuler) {document.write("<img src="+images_path+"boutons/bouton_agenda_finfond.gif width=3 height=17>");};
};

function agenda_open(ext) {
window.open('index.php?nomenu=1&'+ext+'&s=3&ss=ecrire','','width=700,height=350,scrollbars=yes,menubar=no,status=no,resizable=yes');
};




//////////////////////
// GROUPES
//////////////////////

function groupe_edit(idgroupe) {
window.open('index.php?nomenu=1&s=1&ss=edition&idgroupe='+idgroupe,'','width=600,height=500,menubar=no,scrollbars=yes,status=no,resizable=yes');
};





//////////////////////
// NEWS
//////////////////////



function news_docdetails(o,menu,idreplace) {
	if (menu) { dopopupmenu(o,menu,idreplace); }
	else {
	var t=o.innerHTML,abspos=getAbsolutePosition(o),oa=document.getElementById('ajax'),divname='ajax';//.substring(o.innerHTML.indexOf('<!tooltip>'))
	//alert(t+' '+abspos.y+' ');
	     	MM_changeProp(divname,'','width',140);
     		MM_changeProp(divname,'','height',100);
     		MM_changeProp(divname,'','overflow','auto');
     		MM_changeProp(divname,'','left',abspos.x);
		MM_changeProp(divname,'','top',abspos.y);
		oa.innerHTML=t;
	     	MM_showHideLayers(divname,'','show');
	}
	     	
	
}

function news_outils(id,idgroupe,lu,pj,ext,type,editer,taille,cible,sousnews,editfile,dans_news,envoi,valide) {

// if (!dans_news) document.write("<input type=checkbox name=chnews[] value="+id+">");
if (editer<10) {
if (valide==101)
{ // avalider
	document.write("<a href=# onclick=\"news_valid("+id+",1,"+dans_news+");return false;\"><img src="+images_path+"boutons/bouton_news_valider.gif  border=0 alt=\"Valider ce document\"></a>");
	document.write("<a href=# onclick=\"news_valid("+id+",0,"+dans_news+");return false;\"><img src="+images_path+"boutons/bouton_news_nepasval.gif  border=0 alt=\"Ne pas valider ce document\"></a>");
};


if (envoi!=0) document.write("<a href=# onclick=\"email_open('index.php?s=5&ss=ecrire&nomenu=1&idarticle="+id+ext+"&idgroupe="+idgroupe+"','');return false;\"><img src="+images_path+"3/emailsend.png  border=0 alt=\"Envoyer ce document\"></a>");
if (membre_equipe && dans_news) document.write("<a href=# onclick=\"printopen('news="+id+"&type="+type+"',0,1);return false;\"><img src="+images_path+"3/print.png  border=0 alt=\"Imprimer ou publiposter ce document\"></a>");
}

if (editer>=1)
 {
 	
  var target="";if (dans_news==1) target="_top";
  document.write("<a href=# onclick=\"edithtml('','"+id+"','','&idgroupe="+idgroupe+"&saveto=");
  document.write(escape("./?s=1&nomenu=1&id="+id+"&idgroupe="+idgroupe+"&ss=article_enregtext"));
  document.write("','"+target+"');return false;\"><img src="+images_path+"boutons/bouton_news_editvisu.gif  border=0"+((editer>=10)?" align=right>":" alt=\"")+"Modifier ce texte"+((editer>=10)?"<br style=clear:both;>":"\">")+"</a>");
  if (editer<10) document.write("<a href=# onclick=\"news_open('"+ext+"&idgroupe="+idgroupe+"',"+id+",'"+taille+"',1,"+dans_news+");return false;\"><img src="+images_path+"3/modify.png  border=0 alt=\"Editer ce document (#"+id+")\"></a>");
  if (sousnews==1)
    {document.write("<a href=# onclick=\"news_open('"+ext+"&creerdepeche=1&dapres_type=1&dapres_modele="+id+"&dupliq_opts[notext]=1&iddependde="+id+"&idgroupe="+idgroupe+"','','"+taille+"',1,"+dans_news+");return false;\"><img src="+images_path+"boutons/bouton_news_ssnews.gif  border=0"+((editer>=10)?" align=right>":" alt=\"")+"Créer un sous-document"+((editer>=10)?"<br>":"\">")+"</a>");
    };
  if (0 && editfile && editfile!="" && editfile!='undefined')
    {document.write("<a href="+editfile+"# onclick=\"news_edit("+id+",'"+editfile+"');return false;\"><img src="+images_path+"boutons/bouton_news_editpj.gif  border=0></a>");
    };
  };
if (editer<10) {
//document.write("<img src="+images_path+"boutons/bouton_news_valider.gif width=28 height=17 border=0>");
if (pj==1) { document.write("<img src="+images_path+"3/attach.png width=12 height=17 alt=\"Fichier joint\">"); };
if (editer>=1) document.write("<a href=?news="+id+"&nomenu="+nomenu+"&targetinfos=1>");
if (cible==0) { document.write("<img border=0 src="+images_path+"3/office.png  alt=\"Equipe\">"); };
if (cible==1) { document.write("<img border=0 src="+images_path+"3/group.png  alt=\"Membres du groupe de l'équipe\">"); };
if (cible==2) { document.write("<img border=0 src="+images_path+"3/public.png  alt=\"Identifiés hors équipe\">"); };
if (cible==3) { document.write("<img border=0 src="+images_path+"3/group.png  alt=\"Membres du groupe hors équipe\">"); };
if (cible==4) { document.write("<img border=0 src="+images_path+"3/public.png  alt=\"Public non identifié\">"); };
if (editer>=1) document.write("</a>");
}

// if (pour==4) { document.write("<img src="+images_path+"boutons/picto_news_selection.gif width=25 height=17 alt=\"Sélection\">"); };
};

function news_open(ext,id,taille,editer,dans_news,target) {
if (!target ) target=parseInt(id);
if (!ext || ext=="undefined") ext='';
if (editer==1) {ext="&ss=article_edition&"+ext;target+="edit";} else {ext="&ss=article_affichage&"+ext;target+="aff";};
if (editer && dans_news==1) target="_top";
var url='index.php?s=1&nomenu=1&'; if (id) url+='&id='+id;
if (!taille || taille=="width=,height=") taille="width=600,height=500";  //value = showModalDialog(url, null, taille+',status:no,help:no');
var w=window.open('',target,taille+',resizable=yes,menubar=no,status=no,scrollbars=yes');
w.document.write('<title>Oxywork Document Popup</title><frameset name=mainpopupframeset id=mainpopupframeset marginwidth=2 marginheight=0 border=2 resizable cols=0,*><frame name=frame_left id=frame_left marginwidth=0 marginleft=0 src=><frame name=frame_main id=frame_main marginwidth=0 marginleft=0  src='+url+ext+'></frameset>');
w.document.close();

};

function news_op(id,dans_news) {
	if (!dans_news) dans_news=0;
	news_open('',id,'',0,dans_news);
	return false;
};

function news_edit(id,f) {
window.open('index.php?popup=edit_fichier.php&id='+id+'&f='+f,'edcomm','width=500,height=140,status=no,menubar=no,location=no,scrollbars=yes');
};

function news_pj(f,id,taille) {
window.open(f,id,taille+',top=0,left=0,status=no,menubar=yes,location=no,scrollbars=yes,resizable=yes');
};

function news_valid(id,valid,dans_news) {
	ext="";if (dans_news) ext="&nomenu=1";
	if (valid==1) str="Validation de ce document"; else str="Refus de ce document";
	rep=prompt(str+"\nVotre commentaire: ","");
	if (rep!=null) window.location="index.php?s=1&ss=articles&classeur=101&action=valider&idvalide="+id+"&valide="+valid+"&rep="+escape(rep)+ext;

};





//////////////////////
// HELP
//////////////////////

var helps="";
function help(id,idgroupe) {
if (!idgroupe) idgroupe=38;
if (membre_equipe || forcehelp) document.write("<a title=aide href=# onclick=\"return help_open("+id+","+idgroupe+");\"><img src="+images_path+"3/info.png vspace=2 hspace=2 width=6 height=10 border=0 alt=\"Aide\"></a>");
helps+="+"+id+"+";
};
function help_open(id,idgroupe) {
if (!id && helps) id=helps;
if (!idgroupe) idgroupe=38;
if (id) {
	left=0;if (screen.width) left=screen.width-700-10;
	wh=window.open('','owhelp','left='+left+',top=0,width=700,height=300,resizable=yes,menubar=no,status=no,scrollbars=yes');
	wh.document.write('<title>Help.oxywork.com</title><frameset cols=300,*><frame name=g src=http://help.oxywork.com/?nomenu=1&s=1&cat=1&idgroupe='+idgroupe+'&linktarget=d><frame name=d src=http://help.oxywork.com/?nomenu=1&news='+id+'></frameset>');
	wh.focus();
};
return false;
};

function hidehelp() {
left=0;if (screen.width) left=screen.width-400-10;
window.open('?lib=hidehelp_popup.php','owhelp','left='+left+',top=0,width=400,height=300,resizable=yes,menubar=no,status=no,scrollbars=no');
return false;
};







//////////////////////
// CONTACTS
//////////////////////


function contacts_menu (creation,groupe,ext2,nocontent) {

ext='';
if (groupe) ext="creer_dans_groupe="+groupe;

if (creation) {
//document.write("<table width=100% border=0 cellspacing=0 cellpadding=0 background="+images_path+"boutons/bouton_contact_fond.gif><tr><td>");
document.write("<a href=# onclick=\"contact_open('','"+ext+"');return false;\"><img name=nouveau src="+images_path+"3/edit.png width=20 height=15 border=0 alt=\"Créer un contact\"></a>");
if (nocontent!=1)
{ document.write("<input type=checkbox name=allbox onclick=ToggleAll('contacts','',this);contacts_okpouragirsel();>");
  document.write("<a href=# onclick=\"s=contacts_agirsel();if (s) winopen('nomenu=1&s=2&ss=agirsel&'+s,'width=400,height=230');return false;\"><img name=agirsel src="+images_path+"pix.gif width=28 height=17 border=0 alt=\"Agir sur la sélection\"></a>");
  document.write("<a href=# onclick=\"s=contacts_agirsel();if (s) email_open('','contactemail','s=5&nomenu=1&ss=ecrire'+s+'&contacts_ext2="+ext2+"');return false;\"><img name=ecrire src="+images_path+"pix.gif width=28 height=17 border=0 alt=\"Courrier aux contacts cochés\"></a>");
  document.write("<a href=# onclick=\"s=contacts_agirsel();if (s) email_open('','contactemail','s=5&nomenu=1&ss=model'+s+'&contacts_ext2="+ext2+"');return false;\"><img name=ecriremod src="+images_path+"pix.gif width=28 height=17 border=0 alt=\"Courrier d'après modèle aux contacts cochés\"></a>");
};
//document.write("</td></tr></table>");
};
};

function contacts_agirsel(ext) {
var selliste="&listeidto=";
var o=document.getElementById('contacts'); if (o) {
for (var i=0;i<o.elements.length;i++)
  {if (o.elements[i].name.substring(0,2)=="cs" && o.elements[i].checked)//o.elements[i].type=="checkbox" && 
    { selliste+=o.elements[i].value+","; };
  };
if (selliste=="&listeidto=") {alert("Aucune sélection. Sélectionnez les contacts en cochant la case à gauche du nom."); };
return selliste;
}
};

function contacts_okpouragirsel() {
var selliste=0;
for (var i=0;i<document.contacts.elements.length;i++)
  {if (document.contacts.elements[i].checked)
    { selliste=selliste+1; };
  };
if (selliste>0) {
	document.agirsel.src=images_path+"boutons/bouton_email_regletri.gif";
	document.ecrire.src=images_path+"boutons/bouton_contact_ecrirea.gif";
	document.ecriremod.src=images_path+"boutons/bouton_contact_ecriremodele.gif";
	}
else {
	document.agirsel.src=""+images_path+"pix.gif";
	document.ecrire.src=""+images_path+"pix.gif";
	document.ecriremod.src=""+images_path+"pix.gif";
	};
};

function contacts_outils (ext,idcontact,droitedit) {
if (droitedit) document.write("<a href=# onclick=\"contact_open("+idcontact+");return false;\"><img src="+images_path+"boutons/bouton_contact_editer.gif width=28 height=17 border=0 alt=\"Editer\"></a>");
document.write("<a href=# onclick=\"open_postit(0,"+idcontact+");return false;\"><img src="+images_path+"boutons/bouton_contact_adliste.gif width=28 height=17 border=0 alt=\"Ecrire une note ou initier un dialogue écrit\"></a>");
document.write("<a href=# onclick=\"agenda_open('"+ext+"&a="+idcontact+"');return false;\"><img src="+images_path+"boutons/bouton_contact_rdv.gif width=28 height=17 border=0 alt=\"Prendre un rendez-vous\"></a>");
document.write("<a href=# onclick=\"email_open('index.php?nomenu=1&s=5&"+ext+"&ss=ecrire&listeidto="+idcontact+"','emailto"+idcontact+"');return false;\"><img src="+images_path+"boutons/bouton_contact_ecrirea.gif width=28 height=17 border=0 alt=\"Ecrire un courrier\"></a>");
//document.write("<br><img src="+images_path+"boutons/bouton_contact_adliste.gif width=28 height=17>");
//document.write("<img src="+images_path+"boutons/bouton_contact_effacer.gif width=28 height=17>");
//document.write("<img src="+images_path+"boutons/bouton_contact_imprimer.gif width=28 height=17>");
};

function contact_open(idcontact,ext) {
if (!ext) ext='';
window.open('index.php?nomenu=1&s=2&ss=edition&idgens='+escape(idcontact)+'&'+ext,'contactedit'+idcontact,'width=770,height=550,status=no,menubar=no,location=no,resizable=yes,scrollbars=yes');
};

function contactsliste(ext) {
window.open("?s=2&nomenu=1&ss=resultats&affichage=compact&"+ext,"contactsliste","width=600,height=400,scrollbars=yes,status=no,menubar=no,resizable=yes");
};

function rappel_login(iddest,cachepasse,ext)
{
if (!iddest) iddest="";
if (!document.wremlogin) w=window.open("",'wremlogin','width=300,height=200,scrollbars=auto,menubar=no,status=no');
w.document.write('<link rel="stylesheet" type="text/css" href="index.php/shared/shared.css"><body><form method=post action=index.php name=foauto><input type=hidden name=parse value="s=2&ss=rappel_login&nomenu=1&idcontact='+iddest+'&cachepasse='+cachepasse+'&'+ext+'"><input type=submit value=Go></form>');
w.document.write("Identification en cours, un instant...");
w.document.foauto.submit();
};


//////////////////////
// COMPTE
//////////////////////

function compte_edition(id,ext,fen) {
if (!fen) fen='';
window.open('index.php?s=4&ss=compte_edition&nomenu=1&id='+id+'&'+ext,fen,'width=770,height=450,scrollbars=yes,menubar=no,status=no,resizable=yes');
};

function listesel(fn,name) {
var selliste='';
if (fn) {
	if (!name) name='sel[]';
	for (var i=0;i<fn.length;i++)
	  if (fn[i].name=name && fn[i].checked)//.elements
	    selliste+="&"+name+"="+fn.elements[i].value;
};
return selliste;
};


//////////////////////
// GROUPES
//////////////////////
function planning(idgens) {
	var attributs = "width=770,height=300,resizable=yes,status=no,menu=yes,location=no,toolbar=no,scrollbars=yes";

	if (idgens=="complet") {
		window.open('index.php?s=8&nomenu=1&ss=planning&complet=1', '', attributs);
	}
	else {
		if (idgens<0) {
			window.open('index.php?s=8&nomenu=1&ss=planning&idgroupe='+(-1*idgens), '', attributs);
		}
		else {
			window.open('index.php?s=8&nomenu=1&ss=planning&idgens='+idgens, '', attributs);
		}
	}
};

function open_tache(ext,nomenu) {
if (nomenu) wn='_self'; else wn='';
window.open('index.php?s=8&ss=taches&nomenu=1&'+ext,wn,'width=700,height=500,status=no,menubar=no,location=no,resizable=yes,scrollbars=yes');
};

function open_tache_descr(ext,nomenu) {
if (nomenu) wn='_self'; else wn='';
window.open('index.php?s=8&ss=tache_affichage&nomenu=1&'+ext,wn,'width=700,height=500,status=no,menubar=no,location=no,resizable=yes,scrollbars=yes');
};

//////////////////////
// NOTES
//////////////////////

function open_postit(editer,a,a_sens,action,titre) {
if (!a_sens) a_sens=1;
if (!action) action="ecrire";
if (!titre) titre="note"+editer;
if (action=='ecrire' || document.cookie.indexOf('postitopen['+editer+']=1')==-1) {
w=window.open('index.php?s=13&action='+action+'&nomenu=1&id='+editer+'&postita='+a+'&a_sens='+a_sens+'&playsound=1',titre,'width=500,height=300,menubar=no,scrollbars=yes,status=no,resizable=yes');
//w.document.write('Dialogue écrit : nouveau message...');
};// else w=eval('note'+editer);
//if (w && w!="undefined") w.focus();
};

function opsess(idsess) {
	var idfen='';
	if (idsess==parseInt(idsess)) idfen='sess'+idsess; 
	window.open('./?s=9&ss=stats&viewsession='+idsess+'&nomenu=1',idfen,'width=600,height=300,resizable=yes,scrollbars=yes,status=yes');return(false);
}

function allownumbersonly(v) {
var r='';
for(var i=0;i<v.length;i++) {if (v.charAt(i)==",") r+="."; else if (v.charAt(i)=="." || v.charAt(i)=="-" || (v.charCodeAt(i)>="0".charCodeAt(0) && v.charCodeAt(i)<="9".charCodeAt(0) ) ) r+=v.charAt(i);}
return r;
}

function doautoajax() {
	var l=(document.layers)?document.layers:document.all; 
	if (l) for (i=0;i<l.length;i++) if (l[i].owajaxtimer) {t=setTimeout("ajaxopen('"+l[i].id+"')",l[i].owajaxtimer*1000);}
}
t=setTimeout('doautoajax();',1000);


var ajax_oldhtml=new Array();

function ajaxopen(divname,url,width,height,submit_reload_divname,alturl,add_backbutton) {
//alert(divname+","+url);
var res='',noajax=0;
var basehref="."; 
if (!divname) divname='ajax';
if (add_backbutton==1) ajax_oldhtml[divname]=document.getElementById(divname).innerHTML;
if (o=document.getElementById(divname)) {
	MM_setTextOfLayer(divname,'','<img src='+images_path+'boutons/loader.gif style=position:absolute;z-index:99; width=16 height=16 alt="'+divname+','+url+'" />'+document.getElementById(divname).innerHTML);
     if (!url && o.attributes.getNamedItem('owajax')) url=o.attributes.getNamedItem('owajax').value;//'./?'+
     if (o.owajaxtimer) t=setTimeout("ajaxopen('"+divname+"')",o.owajaxtimer*1000);
     if(window.XMLHttpRequest) // FIREFOX
          xhr_object = new XMLHttpRequest(); 
     else if(window.ActiveXObject) // IE
          xhr_object = new ActiveXObject("Microsoft.XMLHTTP"); 
     else noajax=1;//          return(false); 
     if (!noajax) {
     	if (width && height) {
     		MM_changeProp(divname,'','width',width);
     		MM_changeProp(divname,'','height',height);
     		MM_changeProp(divname,'','left',mousex);
			MM_changeProp(divname,'','top',mousey+10);
	     	MM_showHideLayers(divname,'','show');
	     	checkdivpos(divname);
	     	MM_setTextOfLayer(divname,'',"<div href=# style=background-color:#ccc;text-align:right;width:100%; onclick=MM_showHideLayers('ajax','','hide');MM_setTextOfLayers('ajax','','');>X</div>"+'<p><img src='+images_path+'boutons/loader.gif style=position:absolute;z-index:99; width=16 height=16 alt=... />');
     	}
     if (url.indexOf('?')<=0 && url.indexOf('/')<=5)      url=basehref+"/?"+url;
     xhr_object.open("GET", url+"&mode=ajax&reals="+s, false); 
     xhr_object.send(null);      
     if(xhr_object.readyState == 4) res=(xhr_object.responseText);
     }
     if (res) {
     	if (res.indexOf('noop')>0) {} else {//res.indexOf('error') || 
	     	var submitaction='';
		     if (width && height) {
		     	if (submit_reload_divname) submitaction="parent.ajaxopen('"+submit_reload_divname+"');";//\\\",1000);";
		     	res=res.replace("popup=","lib=").replace("</form","<input type=hidden name=aftersubmit value=\""+submitaction+"\"><input type=button value=Cancel onclick=MM_showHideLayers('ajax','','hide');MM_setTextOfLayers('ajax','','');></form").replace('method='," target=ifral onsubmit=\"MM_showHideLayers('"+divname+"','','hide');\" method=");//window.open('','recordthis','width=10,height=10');
		     	res="<div href=# style=background-color:#ccc;text-align:right;width:100%; onclick=MM_showHideLayers('ajax','','hide');MM_setTextOfLayers('ajax','','');><img src="+images_path+"arrows/x.gif width=7 height=7 alt=X /></div>"+res;
		     }
		     else if (add_backbutton==1) {
		     	res="<div href=# style=background-color:#ccc;height:12px;text-align:left;width:100%; onclick=MM_setTextOfLayer('"+divname+"','',ajax_oldhtml['"+divname+"']);><img align=right src="+images_path+"arrows/x.gif hspace=3 vspace=3 width=7 height=7 alt=X /><img src="+images_path+"arrows/l.gif hspace=3 vspace=3 width=7 height=7 alt=Close /></div>"+res;
		     }
	     	o.innerHTML=res;
	     	
     	}
     } else {
     	if (!alturl) alturl=url;
     	if (alturl!="none" && width && height) {
     		height+=30;width+=20;
     		winopen(alturl,'width='+width+',height='+height);
     	}
     }
}
     return false;
}

var progressbardone='';
function progressbar(percent,stylec,style,text) {
if (progressbardone=='') {
	document.write('<div id=progressbarc style="'+stylec+'"><div id=progressbart class=small style=position:absolute;>'+text+'</div><div id=progressbar style="'+style+'"></div></div>');
} else if (text) MM_setTextOfLayer('progressbart','',text);
progressbardone=percent;
MM_changeProp('progressbar','','width',percent+'%');
MM_changeProp('progressbar','','height','100%');
}

function choix_pseudo_onchange(o,opt,nom,formnom,ext) {
//alert(o+' '+o.type+" "+o.options+' opt='+opt+' nom='+nom+' v='+document.getElementById(nom).value);
if (opt==-2) {ov=(o.options)?o.options[o.selectedIndex]:MM_findObj(nom);var lo=prompt('id#/ref# ?',ov.value); ov.value=' '+lo+' ';if (o.options) o.options[o.selectedIndex].text+=' : '+lo;} 
else if (opt==-1) {choix_pseudo(formnom,nom,ext,0);if (o.options) o.selectedIndex=0;} 
else if (opt==-3) {choix_pseudo(formnom,nom,'&chtype=0&openenq=0&'+ext,1);if (o.options) o.selectedIndex=0;} 
else if (opt==-4) {choix_pseudo(formnom,nom,'&chtype=1&openenq=1&'+ext,1);if (o.options) o.selectedIndex=0;} 
else if (opt==-5) {choix_pseudo(formnom,nom,ext,1);if (o.options) o.selectedIndex=0;} // avec cherche dans ext
else if (opt>=0) {o=MM_findObj(nom);o.value=opt;} 
else if (o.options) o.selectedIndex=0; 


}

function findChild(o,ctype) {
var found=0;
if (o.childNodes) for(var i=0;i<o.childNodes.length && !found;i++) if (o.childNodes[i].type==ctype) found=o.childNodes[i]; else found=findChild(o.childNodes[i],ctype);
return found;
}

function selthis(o,s,a,e,bgcolorchecked) {
if (s==1) { // mouseover
 //if (e) get_mouse(e);
 o.style.backgroundColor='#ccc'; 
 if (mousebutton) {s=2;ow_cancelstate=1;}
} else if (s==0) {
 var ocheck=findChild(o,"checkbox");if (ocheck && ocheck.checked) o.style.backgroundColor=(bgcolorchecked)?"#"+bgcolorchecked:'#bbb'; else o.style.backgroundColor='';
}
if (s==2) { // click
var eventtype=evente.tagName.toLowerCase();
if (eventtype.length==1 && eventtype!="a") {eventtype=evente.parentNode.tagName.toLowerCase();}
//alert(o+" "+o.name+" "+o.id+" "+o.tagName+" | "+eventtype+" "+evente.tagName);
//alert(o+" "+o.type+" "+o.href+" "+o.onclick);
//alert(evente+" "+evente.type+" "+evente.href+" "+evente.onclick);
//if (!evente || !evente.type || (!(evente.attributes.getNamedItem('href') && evente.attributes.getNamedItem('href').value) && !(evente.attributes.getNamedItem('onclick') && evente.attributes.getNamedItem('onclick').value) && evente.type!="input" && evente.type!="select" && evente.type!="checkbox")) {
if (!evente || (!(evente.type || evente.href || evente.onclick) && eventtype!="input" && eventtype!="a" && eventtype!="input" && eventtype!="select" && eventtype!="checkbox")) {
if (a) eval(a); else {var ocheck=findChild(o,"checkbox");if (ocheck && ocheck.click) ocheck.click();}
return false;
} //else alert(evente+" "+evente.attributes.getNamedItem('href')+" "+evente.attributes.getNamedItem('onclick').value+' '+evente.type);
}
}
var ow_cancelstate=0;
/*
function ow_cancel() {
if (ow_cancelstate) {ow_cancelstate=0;return false;} else return true;
}
document.body.onselectstart = ow_cancel;
*/