function menu(numeromenu)
{
	if(document.getElementById("des"+numeromenu))
	{
		var element7 = document.getElementById("des"+numeromenu); 	
		if (element7.style.display == "block")
		{
			element7.style.display = "none";
		}else{
			element7.style.display = "block";	
		}
	}
}

function Affiche_Cache(nObjet) {
var ns4=document.layers;
var ie4=document.all;
var ns6=document.getElementById&&!document.all;
 if(ie4) { 
	if (document.getElementById) {nnObjet=document.getElementById(nObjet);}
	else {nnObjet=nObjet;}
   eval(nnObjet).style.visibility = 
    (eval(nnObjet).style.visibility=='visible'?'hidden':'visible');
 }
 else if(ns4) {
   document.eval(nObjet).visibility = 
    (document.eval(nObjet).visibility=='show'?'hidden':'show');
	}
 else if(ns6) {
   var divns6 = document.getElementsByTagName("div")
   divns6[nObjet].style.visibility = 
    (divns6[nObjet].style.visibility=='visible'?'hidden':'visible');
 }
}
function Cache_Cache(nObjet) {
var ns4=document.layers;
var ie4=document.all;
var ns6=document.getElementById&&!document.all;
 if(ie4) { // Internet explorer
 	if (document.getElementById) {nnObjet=document.getElementById(nObjet);}
	else {nnObjet=nObjet;}
   eval(nnObjet).style.visibility = 
    (eval(nnObjet).style.visibility=='visible'?'hidden':'hidden');
 }
 else if(ns4) { // Netscape 4.x
   document.eval(nObjet).visibility = 
    (document.eval(nObjet).visibility=='show'?'hidden':'hidden');
	}
 else if(ns6) { // Netscape 6 (mozilla)
   var divns6 = document.getElementsByTagName("div")
   divns6[nObjet].style.visibility = 
    (divns6[nObjet].style.visibility=='visible'?'hidden':'hidden');
 }
}

/////////// FOCUS ET POINTER /////////////

function dfocus(targ,way,ie_adjustx,ie_adjusty,ff_adjustx,ff_adjusty) {
if (!ie_adjustx) {var ie_adjustx=0;}
if (!ie_adjusty) {var ie_adjusty=0;}
if (!ff_adjustx) {var ff_adjustx=0;}
if (!ff_adjusty) {var ff_adjusty=0;}
ie=(document.all && document.getElementById);
ff=(!document.all && document.getElementById);
if (ie) {adjustx=ie_adjustx;adjusty=ie_adjusty;}
if (ff) {adjustx=ff_adjustx;adjusty=ff_adjusty;}
var dtarg=document.getElementById(targ);
dtarg.focus();
if (!way) {var way="r";}
var posx=(findPosX(dtarg)+adjustx);
var posy=(findPosY(dtarg)+adjusty);
help_pointer(way,posx,posy);
window.scroll(0,(findPosY(dtarg)-300));
}

function jfocus(targ) {
var dtarg=document.getElementById(targ);
dtarg.focus();
}

function findPosX(obj)
{
var curleft=0;
if (obj.offsetParent) {
while (obj.offsetParent) {
curleft+=obj.offsetLeft
obj=obj.offsetParent;
}
}
else if (obj.x)
curleft+=obj.x;
return curleft;
}

function findPosY(obj) {
var curtop=0;
if (obj.offsetParent) {
while (obj.offsetParent) {
curtop+=obj.offsetTop
obj=obj.offsetParent;
}
}
else if (obj.y)
curtop+=obj.y;
return curtop;
}

ie5=(document.all && document.getElementById);
ns6=(!document.all && document.getElementById);

function help_pointer(way,posx,posy) {
var hpointer=document.getElementById("help_pointer");
hpointer.innerHTML='<img width="60" height="84" src="http://www.lexeek.com/files/arrow_'+way+'.gif" />';
if (way=="r") {
posy=posy-60;
posx=posx-60;
}
else if (way=="l") {
posy=posy-60;
posx=posx+60;
}
hpointer.style.top=posy+"px";
hpointer.style.left=posx+"px";
//setVisible(hpointer);
switchBox("help_pointer");
setVisible("help_pointer");
pointerFadeOut();
}
var opac2=40;
function pointerFadeOut() {
var hpointer=document.getElementById("help_pointer");
if(opac2 > 0){
opac2-=1;
hpointer.style.width="65px";
hpointer.style.height="90px";
if(ie5) hpointer.filters.alpha.opacity = opac2;
if(ns6) hpointer.style.MozOpacity = opac2/100;
if (opac2==0) {
//unsetVisible(hpointer);
unsetVisible("help_pointer");
switchBox("help_pointer");
opac2=40;
}else{
setTimeout("pointerFadeOut()", 40);}
}
}

function setVisible(nanobj) {
Affiche_Cache(nanobj);
}
function unsetVisible(nanobj) {
Cache_Cache(nanobj);
}

/////////// FIN FOCUS ET POINTER /////////////

/////////// AJAX FORMS ///////////////////////

////////////////////////////////////////////////////////////////////////////////////////

function getXmlHttp() {
var xmlhttp=false;
if (window.XMLHttpRequest) { // Mozilla, Safari,...
xmlhttp=new XMLHttpRequest();
if (xmlhttp.overrideMimeType) {xmlhttp.overrideMimeType('text/xml');}
} else if (window.ActiveXObject) { // IE
try {xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");}
catch (e) {
try {xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}
catch (e) {}
}
}
if (!xmlhttp) {
alert('Abandon : (Impossible de créer une instance XMLHTTP');
return false;
}
else {return (xmlhttp);}
}

///////////////////////////////////////////////////////////////////////////////////////

function similarity() {
if (document.getElementById("new_doc_search")) {
var a=document.getElementById("new_doc_search");
var b=document.getElementById("demande_similaire");
if (a.value!="") {
var xcall="../../files/ajax_handler.php?action=similarity&str="+escape(a.value);
xmlhttpSimilarity=getXmlHttp();
xmlhttpSimilarity.open("GET",xcall,true);
xmlhttpSimilarity.onreadystatechange=function() {
if (xmlhttpSimilarity.readyState==4) {
if (xmlhttpSimilarity.status==200) {
if (xmlhttpSimilarity.responseText!="") {
//alert(xmlhttpSimilarity.responseText);
b.innerHTML=xmlhttpSimilarity.responseText;
b.style.display="block";
}
else {
b.innerHTML="";
b.style.display="none";
}
}
else {alert("Erreur: La requête n'a pas abouti.");}
}
}
xmlhttpSimilarity.send(null)
}
}
}

function p_notify() {
result0=document.getElementById('notify_result');
mail0=document.getElementById('notify_email');
page0=document.getElementById('page_id');
email=mail0.value;
pageid=page0.value;
var xcall="../../files/ajax_handler.php?action=notify&email="+escape(email)+"&page_id="+escape(pageid)+"";
xmlhttpNotify=getXmlHttp();
xmlhttpNotify.open("GET",xcall,true);
xmlhttpNotify.onreadystatechange=function() {
if (xmlhttpNotify.readyState==4) {
if (xmlhttpNotify.status==200) {
result0.innerHTML=xmlhttpNotify.responseText;
}
else {alert("Erreur: La requête n'a pas abouti.");}
}
}
xmlhttpNotify.send(null)
}

function forum_update(nom_doc,forum,num_doc) {
if (forum=="validef") {
dfocus("forum_posts","r",30,30,200,38);
//timeChat(1);
}
else if (forum=="showf") {chat_ide_window_update();}
forum0=document.getElementById('forum');
num_doc0=document.getElementById('num_doc');
name0=document.getElementById('nom_forum');
text0=document.getElementById('post_content');
forum_posts0=document.getElementById('forum_posts');
name=name0.value;
text=text0.value;
xmlhttpUpdate=getXmlHttp();
var xcall="../../files/ajax_handler.php?action=forum_update&forum="+escape(forum)+"&num_doc="+escape(num_doc)+"&name="+escape(name)+"&text="+escape(text)+"&document="+escape(nom_doc);
xmlhttpUpdate.open("GET",xcall,true);
xmlhttpUpdate.onreadystatechange=function() {
if (xmlhttpUpdate.readyState==4) {
if (xmlhttpUpdate.status==200) {
var tempCompare=forum_posts0.innerHTML;
var bits=xmlhttpUpdate.responseText.substr(0,25);
var str=xmlhttpUpdate.responseText.substr(25);
forum_posts0.innerHTML=str;
/*if (tempCompare!=str && bits=="00000000" && forum!="showf") {
document.getElementById("post_content").value="";
}*/
jfocus("post_content");
}
else {alert("Erreur: La requête n'a pas abouti.");}
}
}
xmlhttpUpdate.send(null);
//timeChat();
}

function forum_show(nom_doc,num_doc) {
forum_posts0=document.getElementById('forum_posts');
xmlhttpShowf=getXmlHttp();
var xcall="../../files/ajax_handler.php?action=forum_show&num_doc="+escape(num_doc)+"&document="+escape(nom_doc);
xmlhttpShowf.open("GET",xcall,true);
xmlhttpShowf.onreadystatechange=function() {
if (xmlhttpShowf.readyState==4) {
if (xmlhttpShowf.status==200) {
//var tempCompare=forum_posts0.innerHTML;
//var bits=xmlhttpShowf.responseText.substr(0,8);
var str=xmlhttpShowf.responseText;//.substr(8);
forum_posts0.innerHTML=str;
//jfocus("post_content");
}
else {alert("Erreur: La requête n'a pas abouti.");}
}
}
xmlhttpShowf.send(null);
}

function sendWiki(num_doc,text,wiki,nom_doc) {
var xcall="../../files/ajax_handler.php?action=wiki_update&wiki="+escape(wiki)+"&num_doc="+escape(num_doc)+"&text="+escape(text)+"&document="+escape(nom_doc);
xmlhttpWiki=getXmlHttp();
xmlhttpWiki.onreadystatechange=function() {removeWikiEditor();};
xmlhttpWiki.open('GET',xcall,true);
xmlhttpWiki.send(null);
}

function sendChatInvit() {
var a=document.getElementById('chat_invit_result');
var b=document.getElementById('chat_invit_exp');
var c=document.getElementById('chat_invit_dest');
var d=document.getElementById('chat_invit_email_fax');
var e=document.getElementById('chat_invit_id');
a.innerHTML="Patientez...";
//email=mail0.value;
//pageid=page0.value;
var xcall="../../files/ajax_chat_handler.php?chat_invit=1&email_fax="+escape(d.value)+"&page_id="+escape(e.value)+"&exp="+escape(b.value)+"&dest="+escape(c.value);
//var xcall="ajax_handler_test.php?action=chat_invit&email_fax="+escape(d.value)+"&page_id="+escape(e.value)+"&exp="+escape(b.value)+"&dest="+escape(c.value);
xmlhttpChatInvit=getXmlHttp();
xmlhttpChatInvit.open("GET",xcall,true);
xmlhttpChatInvit.onreadystatechange=function() {
if (xmlhttpChatInvit.readyState==4) {
if (xmlhttpChatInvit.status==200) {
a.innerHTML=xmlhttpChatInvit.responseText;
}
else {alert("Erreur: La requête n'a pas abouti.");}
}
}
xmlhttpChatInvit.send(null)
}
///////////// FIN AJAX FORMS ///////////

///////////// INFO BULLES //////////////

var offsetfromcursorX=12 //Customize x offset of tooltip
var offsetfromcursorY=10 //Customize y offset of tooltip

var offsetdivfrompointerX=10 //Customize x offset of tooltip DIV relative to pointer image
var offsetdivfrompointerY=14 //Customize y offset of tooltip DIV relative to pointer image. Tip: Set it to (height_of_pointer_image-1).

document.write('<div id="dhtmltooltip"></div>') //write out tooltip DIV
document.write('<img id="dhtmlpointer" src="http://www.lexeek.com/files/arrow2.gif">') //write out pointer image

var ie=document.all;
var ns6=document.getElementById && !document.all;
var enabletip=false;
if (ie||ns6)
var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : ""

var pointerobj=document.all? document.all["dhtmlpointer"] : document.getElementById? document.getElementById("dhtmlpointer") : ""

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function ddrivetip(thetext, thewidth, thecolor){
if (ns6||ie){
if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor
tipobj.innerHTML=thetext
enabletip=true
return false
}
}

function positiontip(e){
if (enabletip){
var nondefaultpos=false
var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
//Find out how close the mouse is to the corner of the window
var winwidth=ie&&!window.opera? ietruebody().clientWidth : window.innerWidth-20
var winheight=ie&&!window.opera? ietruebody().clientHeight : window.innerHeight-20

var rightedge=ie&&!window.opera? winwidth-event.clientX-offsetfromcursorX : winwidth-e.clientX-offsetfromcursorX
var bottomedge=ie&&!window.opera? winheight-event.clientY-offsetfromcursorY : winheight-e.clientY-offsetfromcursorY

var leftedge=(offsetfromcursorX<0)? offsetfromcursorX*(-1) : -1000

//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<tipobj.offsetWidth){
//move the horizontal position of the menu to the left by it's width
tipobj.style.left=curX-tipobj.offsetWidth+"px"
nondefaultpos=true
}
else if (curX<leftedge)
tipobj.style.left="5px"
else{
//position the horizontal position of the menu where the mouse is positioned
tipobj.style.left=curX+offsetfromcursorX-offsetdivfrompointerX+"px"
pointerobj.style.left=curX+offsetfromcursorX+"px"
}

//same concept with the vertical position
if (bottomedge<tipobj.offsetHeight){
tipobj.style.top=curY-tipobj.offsetHeight-offsetfromcursorY+"px"
nondefaultpos=true
}
else{
tipobj.style.top=curY+offsetfromcursorY+offsetdivfrompointerY+"px"
pointerobj.style.top=curY+offsetfromcursorY+"px"
}
tipobj.style.visibility="visible"
if (!nondefaultpos)
pointerobj.style.visibility="visible"
else
pointerobj.style.visibility="hidden"
}
}

function hideddrivetip(){
if (ns6||ie){
enabletip=false
tipobj.style.visibility="hidden"
pointerobj.style.visibility="hidden"
tipobj.style.left="-1000px"
tipobj.style.backgroundColor=''
tipobj.style.width=''
}
}

document.onmousemove=positiontip

/////////// FIN INFOBULLES ///////////////

/////////// CHAT WINDOW //////////////////
function chat_ide_window_update() {
}
////////// END CHAT /////////////////////

////////// LGDJ /////////////////////////
function lgdj_disp(n) {
if (document.getElementById("lgdj_div0")) {
document.getElementById("lgdj_div0").style.display=(document.getElementById("lgdj_div0").style.display!="block")?"block":"block";
document.getElementById("lgdj_div0").innerHTML="<img class=\"portal-button\" src=\"http://www.lexeek.com/files/button-delete.gif\" style=\"float:right\" onclick=\"switchBox('lgdj_div0','off')\" /><iframe frameborder=\"0\" src=\"http://www.lgdj.fr/ouvrage"+n+"/?&_ID=ID00019&_URLAff=http%3A//www.lexeek.com\" name=\"lgdj_if0_name\" id=\"lgdj_if0\"></iframe><div style=\"height:1px;line-height:1px;clear:both\"></div>";
}
else {lgdj_fiche_ouvrage(n);}
}

////////// END LGDJ /////////////////////

//////// REGLAGE TEMPLATE //////

function editos(){
if(document.getElementById("welcome_msg_box")){
var W=new Object;W.wcm=new Array;var wcm=document.getElementsByTagName("div");var wcmy;
for(i=0;i<wcm.length;i++){
if(wcm[i].getAttribute("className")){wcmy=wcm[i].getAttribute("className");}else{wcmy=wcm[i].getAttribute("class");}
if(wcmy=="wcm_box"){
W.wcm[i]=wcm[i].offsetHeight;
if(W.wcmax){if(W.wcmax<wcm[i].offsetHeight){W.wcmax=wcm[i].offsetHeight;}}else{W.wcmax=wcm[i].offsetHeight;}
}
}
for(i=0;i<wcm.length;i++){
if(wcm[i].getAttribute("className")){wcmy=wcm[i].getAttribute("className");}else{wcmy=wcm[i].getAttribute("class");}
if(wcmy=="wcm_box"){
if(wcm[i].offsetHeight<W.wcmax){
wcm[i].style.marginBottom=10+(W.wcmax-wcm[i].offsetHeight)+"px";
}
}
}
var wmb=document.getElementById("welcome_msg_box").getElementsByTagName("hr");for(i=0;i<(wmb.length-1);i++){
wmb[i].style.clear="none";
}
}
}

///////////////////////////////////

//////////// dimensions

function BS(w){if(parseInt(navigator.appVersion)>3){if(navigator.appName.indexOf("Microsoft")!=-1){W=document.body.offsetWidth;H=document.body.offsetHeight;}else{W=window.innerWidth;H=window.innerHeight;}}if(!H && !W){return false;}if(w){return(w=="w")?W:H;}return [W,H];}
if(BS("w")<1120){var ggx=468;var ggy=60;}else{var ggx=728;var ggy=90;}

///////////////////////