/********************************************************
 * Script from http://openweb.eu.org.
 * Make accessibles menus.
 * Hacked specialy for this website.
 **
 * La numérotation des sous menus doit commencer à 1 et être incrémentielle.
 */


/****************************
 * Variables initialisation
 */
var $blnOk   = true;
var $itemPrefix= 'subMenu';
var $BrowserID = "IE";


/****************************
 * Functions
 */
// {{{ menuLoad()
function menuLoad()
{
	if (
		(document.body.style.backgroundColor!="") ||
		(document.body.style.color!="") || (document.body.style.marginTop!="")
	)
	{
		$blnOk=false;
	}
  if (document.getElementById)
  {
		if (document.getElementById("texte"))
		{
			with(document.getElementById("texte").style)
			{
				if (
					(visibility!="") || (position!="") || (zIndex!="") || (margin!="") || (padding!="") ||
					(top!="") || (left!="") || (width!="") || (height!="")
				)
				{
					$blnOk=false;
				}
			}
		}
  }
  else
  {
		$blnOk=false;
  }

  if ($blnOk == true)
  {
		/* on ne touche pas au "parent" pour l'instant
    for($i=1; document.getElementById($itemPrefix + $i); $i++) {
      with(document.getElementById("menu"+$i).style) {
        position = "absolute";
        top      = "3em";
        left     = ((($i-1)*11)+1)+"em";
        width    = "10em";
        height   = "1.2em";
        textAlign= "center";
        margin   = "0";
        padding  = "0";
        zIndex   = "2";
      }
    }*/
    for($i=1; document.getElementById($itemPrefix + $i); $i++) {
      with(document.getElementById($itemPrefix + $i).style) {
        position = "absolute";
        top      = "100px";
        display  = "block";
        margin   = "0 0 0 -" + ((($i-1)*100)+($i*1)-1) +"px";// ce reporter à la largeur du parent (85)
        padding  = "0";
        zIndex   = "3";
      }
    }
    menuHide();
	}
}
// }}}

// {{{ menuShow()
function menuShow($id)
{
  if($blnOk == true) {
		if ($BrowserID == "OP")
		{
			document.getElementById('subMenu').innerHTML = '<ul class="subMenu">'+document.getElementById($id).innerHTML+'</ul>';
			//alert(document.getElementById('subMenu').innerHTML);
		}
		else
		{
			menuHide();
			with(document.getElementById($id).style)
			{
				visibility = "visible";
				display    = "block";
				width      = "700px";
			}
		}
  }
}
// }}}

// {{{ menuHide()
function menuHide() {
  if($blnOk == true) {
    for($i=1; document.getElementById($itemPrefix + $i); $i++)
    {
      with(document.getElementById($itemPrefix + $i).style) {
        visibility = "hidden";
        display    = "none";
      }
		}
  }
}
// }}}

// {{{ SetBrowserID()
/**
 * @author unknown <http://www.webconcerns.co.uk/javascript/dhtml/dhtml_page.asp>
 */
function SetBrowserID() {
 if ( (navigator.userAgent.indexOf("Opera")!=-1) && (document.getElementById) )
 {
   $BrowserID="OP"; // Opera
 }
 else if (document.all)
 {
   $BrowserID="IE"; //Internet Explorer e.g. IE4 upwards
 }
 else if (document.layers)
 {
   $BrowserID="NN"; //Netscape 4
 }
 else if ( (!document.all) && (document.getElementById) )
 {
	 $BrowserID="MO"; //Mozila e.g. Netscape 6 upwards
 }
 else
 {
	 $BrowserID = "IE";  //I assume it will not get here
 }
}
// }}}


/****************************
 * Misc functions
 */

/****************************
 * Processing
 */
SetBrowserID();
