//D'autres scripts sur http://www.toutjavascript.com
//Si vous utilisez ce script, merci de m'avertir !  < webmaster@toutjavascript.com >
//Auteur original :Olivier Hondermarck  <webmaster@toutjavascript.com>
//Modifs compatibilité Netscape 6/Mozilla : Cédric Lamalle 09/2001 <cedric@cpac.embrapa.br>
//Correction Mac IE5 (Merci Fred)


var timeout; //ne pas toucher, c'est pour declarer la variable
var delai = 3000; // en milliseconde delai avant disparition du sous-menu.*/
var blnOk=true;
var IB=new Object;
var posX=0;posY=0;
var xOffset=0;yOffset=5;

function AffBulle(texte) {
//~ if (!blnOk) {blnOk=true;}
clearTimeout(timeout);
  //~ contenu="<TABLE border=0 cellspacing=0 cellpadding="+IB.NbPixel+"  onMouseOver=\'affiche();\' onmouseout=\'CacherDelai();\' style=\"position:relative; top:3cm;\"><TR bgcolor='"+IB.ColContour+"'><TD><TABLE border=0 cellpadding=2 cellspacing=0 bgcolor='"+IB.ColFond+"'><TR><TD><FONT size='-1' face='arial' color='"+IB.ColTexte+"'>"+texte+"</FONT></TD></TR></TABLE></TD></TR></TABLE>&nbsp;"; 
  var finalPosX=posX-xOffset;
  
    if (finalPosX<0) finalPosX=0;
  if (document.layers) {
  contenu="<TABLE border=0 cellspacing=0 cellpadding="+IB.NbPixel+"  onMouseOver=\'affiche();\' onmouseout=\'CacherDelai();\'  ><TR bgcolor='"+IB.ColContour+"'><TD><TABLE border=0 cellpadding=10 cellspacing=0 bgcolor='"+IB.ColFond+"'><TR><TD><FONT size='-1' face='arial' color='"+IB.ColTexte+"'>"+texte+"</FONT></TD></TR></TABLE></TD></TR></TABLE>&nbsp;"; 
    document.layers["bulle"].document.write(contenu);
    document.layers["bulle"].document.close();
    document.layers["bulle"].top=posY+yOffset;
    document.layers["bulle"].left=finalPosX;
    //~ document.layers["bulle"].z-index=10;
    document.layers["bulle"].visibility="show";}
  if (document.all) {
    //var f=window.event;
    //doc=document.body.scrollTop;
	//~ alert (finalPosX+'a'+posY+yOffset);
	contenu="<TABLE border=0 cellspacing=0 cellpadding="+IB.NbPixel+"  onMouseOver=\'affiche();\' onmouseout=\'CacherDelai();\' ><TR bgcolor='"+IB.ColContour+"'><TD><TABLE border=0 cellpadding=10 cellspacing=0 bgcolor='"+IB.ColFond+"'><TR><TD><FONT size='-1' face='arial' color='"+IB.ColTexte+"'>"+texte+"</FONT></TD></TR></TABLE></TD></TR></TABLE>&nbsp;"; 
    bulle.innerHTML=contenu;
    document.all["bulle"].style.top=posY+yOffset;
    document.all["bulle"].style.left=finalPosX;//f.x-xOffset;
    document.all["bulle"].style.visibility="visible";
  }
  //modif CL 09/2001 - NS6 : celui-ci ne supporte plus document.layers mais document.getElementById
  else if (document.getElementById) {
  contenu="<TABLE border=0 cellspacing=0 cellpadding="+IB.NbPixel+"  onMouseOver=\'affiche();\' onmouseout=\'CacherDelai();\' style=\"position:relative; top:"+(posY+yOffset)+"px;left:"+finalPosX+"px;\"><TR bgcolor='"+IB.ColContour+"'><TD><TABLE border=0 cellpadding=10 cellspacing=0 bgcolor='"+IB.ColFond+"'><TR><TD><FONT size='-1' face='arial' color='"+IB.ColTexte+"'>"+texte+"</FONT></TD></TR></TABLE></TD></TR></TABLE>&nbsp;"; 
  //~ alert (finalPosX+'ba'+posY+yOffset);
	//~ document.getElementById("bulle").style.position =relative ;
	document.getElementById("bulle").innerHTML=contenu;
    //~ document.getElementById("bulle").style.top=3cm;//posY+yOffset;
    //~ document.getElementById("bulle").style.left=finalPosX;
    document.getElementById("bulle").style.visibility="visible";
  }
}
function getMousePos(e) {
  if (document.all) {
  posX=event.x+document.body.scrollLeft; //modifs CL 09/2001 - IE : regrouper l'évènement
  posY=event.y+document.body.scrollTop;
  }
  else {
  posX=e.pageX; //modifs CL 09/2001 - NS6 : celui-ci ne supporte pas e.x et e.y
  posY=e.pageY; 
  }
}
function HideBulle() {
	if (document.layers) {document.layers["bulle"].visibility="hide";}
	if (document.all) {document.all["bulle"].style.visibility="hidden";}
	else if (document.getElementById){document.getElementById("bulle").style.visibility="hidden";}
}



function CacherDelai() {
	if (blnOk) {
		timeout = setTimeout('HideBulle()',delai);
	}
}
function InitBulle(ColTexte,ColFond,ColContour,NbPixel) {
	IB.ColTexte=ColTexte;IB.ColFond=ColFond;IB.ColContour=ColContour;IB.NbPixel=NbPixel;
	if (document.layers) {
		window.captureEvents(Event.MOUSEMOVE);window.onMouseMove=getMousePos;
		document.write("<LAYER name='bulle' top=0 left=0 visibility='hide'></LAYER>");
	}
	if (document.all) {
		document.write("<DIV id='bulle' style='position:absolute;top:0;left:0;visibility:hidden'></DIV>");
		document.onmousemove=getMousePos;
	}
	//modif CL 09/2001 - NS6 : celui-ci ne supporte plus document.layers mais document.getElementById
	else if (document.getElementById) {
	        document.onmousemove=getMousePos;
	        document.write("<DIV id='bulle' style='position:absolute;top:0;left:0;visibility:hidden'></DIV>");
	}

}

function AnnulerCacher() {
	if (blnOk && timeout) {
		clearTimeout(timeout);
		timeout = setTimeout('HideBulle()',delai);
	}
}

function affiche(){
clearTimeout(timeout);
}

function contact()  {   
window.open("formulaire.php", "contact", "toolbar=no, location=no, directories=no, status=yes, scrollbars=no, resizable=no, copyhistory=no, width=520, height=400, left=300, top=50"); 
}

function newsletter(lemail)  {   
window.open("newsletter.php?lemail="+lemail, "newsletter", "toolbar=no, location=no, directories=no, status=no, scrollbars=no, resizable=yes, copyhistory=no, width=100, height=80, left=300, top=50"); 
}

function partage()  {   
window.open("partage.php", "partage", "toolbar=no, location=no, directories=no, status=yes, scrollbars=no, resizable=no, copyhistory=no, width=400, height=350, left=300, top=50"); 
}
 function favoris() {
 if ( navigator.appName != 'Microsoft Internet Explorer' ){
 window.sidebar.addPanel("spring","http://spring-spring/","");
 }
 else {
 window.external.AddFavorite("http://spring-spring","spring spring");
 }
 } 


function file(fichier)
     {
     if(window.XMLHttpRequest) // FIREFOX
          xhr_object = new XMLHttpRequest();
     else if(window.ActiveXObject) // IE
          xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
     else
          return(false);
     xhr_object.open("GET", fichier, false);
     xhr_object.send(null);
     if(xhr_object.readyState == 4) return(xhr_object.responseText);
     else return(false);
     }

function validateMail(email) {
   var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
   //~ var address = document.forms[form_id].elements[email].value;
   if(reg.test(email) == false) {
      return false;
   }
}

function show(id,tot) {
	 var ids;
	 //~ alert(id);
      for (ids=1; ids<=tot; ids++){
		 if (ids==id){ 
		 nomaide="aide"+id;
		  document.getElementById(nomaide).style.visibility = "visible";
		  }
		  if(ids != id)
		  {
		  nomaide="aide"+ids;
		  document.getElementById(nomaide).style.visibility = "hidden";
		  }
	  }

}


function TabClick( nTab ){
	Col = document.getElementsByName("Content");
	for (i = 0; i < document.getElementsByName("Content").length; i++)
    	{
		document.getElementsByName("tabs")[i].className = "TabBorderBottom TabCommon TabOff";
    	document.getElementsByName("Content")[i].style.display = "none";
		}
	document.getElementsByName("Content")[nTab].style.display = "block";	
	document.getElementsByName("tabs")[nTab].className = "TabCommon TabOn TabActiveBackground TabActiveBorderLeftRight";
}


function montre(id) {
var d = document.getElementById(id);
	for (var i = 1; i<=10; i++) {
		if (document.getElementById('smenu'+i)) {document.getElementById('smenu'+i).style.display='none';}
	}
if (d) {d.style.display='block';}
}

