<!-- the message below will display only on non-js1.1 browsrs -->

<!-- --> <hr><h1>This page requires JavaScript 1.1</h1>

<!-- --> Please consider using Netscape 3.0/4.0 or Internet Explorer 4.0

<!-- This HTML comment hides the script from non-js1.1 browsers

var menu_height=25;

var menuon=new Array;

var gmenuon=0;

var CatLayer = new Array;

var CatLayerCSS = new Array;

var CatLayerHG = new Array;

var CatLayerHGCSS = new Array;

var csz=new Array;

var cps = new Array;

var htmlcode;

var generating;

var ChosenCatIdArray = new Array;

var CatIdArray = new Array;





function handleMouseOver(e) {

  //alert(e.target.id);

  if (e.target.id=="menuN1") {

    hideLayers(0);

    hideHG(0);

  } else if (e.target.id=="menuN2") {

    hideLayers(1);

    hideHG(1);

    hideHG(0);

  } else if (e.target.id=="menuN3") {

    hideLayers(2);

    hideHG(2);

    hideHG(1);

    hideHG(0);

  } else if (e.target.id=="menuN4") {

    hideLayers(3);

    hideHG(3);

    hideHG(2);

    hideHG(1);

    hideHG(0);

  } else if (e.target.id=="HGN1") {

    gmenuon=1;

  } else if (e.target.id=="HGN2") {

    gmenuon=1;

  } else if (e.target.id=="HGN3") {

    gmenuon=1;

  } else if (e.target.id=="HGN4") {

    gmenuon=1;

  } else {

    routeEvent(e);

  };

}



var highlightit=0;

function hideHG(i) {

  if (highlightit) {

    highlightit=0;

    return;

  };

  CatLayerHGCSS[i].visibility="hidden";

}



function handleMouseOut(e) {

  //alert(e.target.id);

  if (e.target.id=="menuN1") {

    gmenuon=0;setTimeout('hideAllMenu();',3000);

  } else if (e.target.id=="menuN2") {

    gmenuon=0;setTimeout('hideAllMenu();',3000);

  } else if (e.target.id=="menuN3") {

    gmenuon=0;setTimeout('hideAllMenu();',3000);

  } else if (e.target.id=="menuN4") {

    gmenuon=0;setTimeout('hideAllMenu();',3000);

  } else if (e.target.id=="HGN1") {

    //hideHG(0);

  } else if (e.target.id=="HGN2") {

    //hideHG(1);

  } else if (e.target.id=="HGN3") {

    //hideHG(2);

  } else if (e.target.id=="HGN4") {

    //hideHG(3);

  } else {

    routeEvent(e);

  };

}



function initMenu(Id, Ctxt)

{
  Contexte = Ctxt;
    if (!document.getElementById("menuN1")) return;
    CatLayer[0]=document.getElementById("menuN1");
    CatLayerCSS[0]=CatLayer[0].style;
    CatLayer[1]=document.getElementById("menuN2");
    CatLayerCSS[1]=CatLayer[1].style;
    CatLayer[2]=document.getElementById("menuN3");
    CatLayerCSS[2]=CatLayer[2].style;
    CatLayer[3]=document.getElementById("menuN4");
    CatLayerCSS[3]=CatLayer[3].style;
    CatLayerHG[0]=document.getElementById("HGN1");
    CatLayerHGCSS[0]=CatLayerHG[0].style;
    CatLayerHG[1]=document.getElementById("HGN2");
    CatLayerHGCSS[1]=CatLayerHG[1].style;
    CatLayerHG[2]=document.getElementById("HGN3");
    CatLayerHGCSS[2]=CatLayerHG[2].style;
    CatLayerHG[3]=document.getElementById("HGN4");
    CatLayerHGCSS[3]=CatLayerHG[3].style;

  for (i=0; i<c.length; i++) {

    if (!c[i]) continue;

    tsz=0;

    for (j=0; j<c[i].length; j++) {

      writeLayerHG(-1,'<span class="menutext">'+n[c[i][j]]+'</span>');

        cellsize=CatLayerHG[0].offsetWidth+2; //scrollWidth;

        //if isES40

        if (cellsize>300) {

          cellsize=CatLayerHG[0].scrollWidth+2;
        }



      csz[c[i][j]]=cellsize;

      cps[c[i][j]]=tsz;

      tsz+=csz[c[i][j]]+8;

    };

  }

  for (i=0; i<CatLayer.Length; i++)

  {

    //writeLayer(i, "a");

    CatLayerCSS[i].visibility="hidden";

    CatLayerCSS[i].top=i*menu_height;

    menuon[i]=0;

  }

  gmenuon=0;

  menuon[1]=1;



    if (n[Id] == null)

    {

      changeMenu(-1);

      writeLayer(-1, htmlcode);

      return;

    }



    // initilize

    CategoryId = Id;



    // category leaf-level = 0

    level = 0;



    // loop through category list until reaching c[0]

    while (CategoryId != 0 && level < 4)

    {

      ChosenCatIdArray[CategoryId] = 1;



    outerloop:

      for (i = 0; i < c.length; i++)

      {

        if (c[i] == null)

          continue;



        for (j = 0; j < c[i].length; j++)

        {

          if (c[i][j] == CategoryId)

          {

            CategoryId = i;

            CatIdArray[level] = CategoryId;

            break outerloop;

          }

        }



      }



      level++;

    }



    // if can't reach the top-level of categories, return

    if (CategoryId != 0)

    {

      ChosenCatIdArray=new Array;

    }



    changeMenu(-1);

    writeLayer(-1, htmlcode);

}



function hideLayers(cm) {

  gmenuon=1;

  menuon[cm]=0;



  //CatLayerHGCSS[cm].visibility="hidden";



  if (menuon[cm+1]) return;

  //hide all layers beneath the cm level

  for (i = cm+1; i < CatLayer.length; i++)

  {

    writeLayer(i-1, "");

    CatLayerCSS[i].visibility="hidden";

    CatLayerCSS[i].top=i*menu_height;

    CatLayerHGCSS[i].visibility="hidden";

    menuon[i]=0;

  }

}



function hideAllMenu() {

  if (gmenuon) return;

  //hide all layers beneath the cm level

  cm=0;

  for (i = cm+1; i < CatLayer.length; i++)

  {

    writeLayer(i-1, "");

    CatLayerHGCSS[i].visibility= "hidden";

    CatLayerCSS[i].visibility= "hidden";

    CatLayerCSS[i].top=i*menu_height;

    menuon[i]=0;

  }

}



function showMenu(cm) {

      gmenuon=1;

      menuon[cm+1]=1;

      var px=cm*menu_height;

      CatLayerCSS[cm+1].top=px;

      CatLayerCSS[cm+1].visibility="visible";

      setTimeout('CatLayerCSS['+(cm+1)+'].top="'+(px+5)+'";',100);

      setTimeout('CatLayerCSS['+(cm+1)+'].top="'+(px+15)+'";',200);

      setTimeout('CatLayerCSS['+(cm+1)+'].top="'+(px+20)+'";',300);

      setTimeout('CatLayerCSS['+(cm+1)+'].top="'+(px+25)+'";',400);

}



function hideMenu(cm) {

	if (cm<menuon.length-1) {

      gmenuon=0;

      menuon[cm+1]=0;

      CatLayerCSS[cm+1].visibility="hidden";

	 }

}



function writeLayer(cm, htmlcode) {
      CatLayer[cm+1].innerHTML=htmlcode;
}



function writeLayerHG(cm, htmlcode) {
      CatLayerHG[cm+1].innerHTML=htmlcode;
}





function highlightCatMenu(cm, p_chosenCategory) {

      gmenuon=1;

      highlightit=1;

      CatId = p_chosenCategory;

      CatName =n[CatId];



      cellsize=csz[CatId];



      CatLayerHGCSS[cm+1].visibility="hidden";

      htmlcode ='';

      htmlcode+='<table width="'+cellsize+'" height="15" border="0" cellspacing="0" cellpadding="0" bgcolor="#F49026">';

      htmlcode+='  <tr >';

      htmlcode+='    <td height="15" align="center" valign="middle">';

      htmlcode+='<a href="';

      htmlcode+=l[CatId]+Contexte;

      htmlcode+='" ';

      htmlcode+='onMouseOver="';

      if (c[CatId]!=null) {

        htmlcode+="changeMenu("+(cm+1)+","+(CatId)+");";

        htmlcode+="writeLayer("+(cm+1)+", htmlcode);";

        htmlcode+="showMenu("+(cm+1)+");";

      }

	  else {

        htmlcode+="hideMenu("+(cm+1)+");";

	  }

      htmlcode+="window.status='"+CatName+".';";

      htmlcode+='return true;" ';

      htmlcode+=' onMouseOut="';

      htmlcode+='return true;" ';

      htmlcode+='>';

      htmlcode+='<span class="menutext" visibility="hidden">';

      htmlcode+=' '+CatName+' ';

      htmlcode+='</span >';

      htmlcode+='</a >';

      htmlcode+='    </td>';

      htmlcode+='  </tr>';

      htmlcode+='</table>';

      htmlcode+='\n';

      writeLayerHG(cm, htmlcode);

      clipTo(CatLayerHGCSS[cm+1],0,cellsize,15,0);

      moveTo(CatLayerHGCSS[cm+1], cps[CatId]+1, CatLayerHGCSS[cm+1].top);

      CatLayerHGCSS[cm+1].visibility="visible";

      //highlightit=0;

}



function getsize() {

return CatLayerHG[0].scrollWidth;

}



function changeMenu(cm, p_chosenCategory)

{

  var chosenCategory;

  var numChildren;

  var CatId;

  var CatName;

  var i;



  // get the chosen category from this CatMenu

  if (cm == -1)

    chosenCategory = 0;

  else

  {

    chosenCategory=p_chosenCategory;

  }



  // if no children, then user is done;

  if (c[chosenCategory]==null)

  {

    //document.ListItemForSale.Category1.value = chosenCategory;

    numChildren = 0;

  }

  else

  {

    numChildren = c[chosenCategory].length;

  }



  htmlcode ='';

  //htmlcode+='<html><body>';

  htmlcode+='<table width="750" height="25" cellpadding="0" cellspacing="0" border="0" bgcolor="#6F71A4" ><tr><td >';

  htmlcode+='<table height="25" cellpadding="0" cellspacing="0" border="0"><tr>';

  // fill up the next based on the chosenCategory

  if ((cm+1) < CatLayer.length)

  {



    for (i = 0; i < numChildren; i++)

    {

      CatId = c[chosenCategory][i];

      //CatName = (c[CatId]==null) ? n[CatId] : n[CatId]+ " ->";

      //CatMenu[cm+1].options[i] = new Option(CatName, CatId);

      CatName =n[CatId];



      cellsize=csz[CatId];

      htmlcode+='<td valign="bottom">';

      htmlcode+='<table width="'+(cellsize+8)+'" height="20" border="0" cellspacing="0" cellpadding="0" bgcolor="#6F71A4">';

      htmlcode+='  <tr >';

      if (ChosenCatIdArray[CatId]) { ;//couleur

        htmlcode+='    <td width="'+(cellsize)+'" height="15" align="center" valign="middle" bgcolor="#F49026">';

      } else {

        htmlcode+='    <td width="'+(cellsize)+'" height="15" align="center" valign="middle">';

      }

      htmlcode+='<a href="';

      htmlcode+='#';

      htmlcode+='" ';

      htmlcode+='onMouseOver="';

      if (c[CatId]!=null) {

        htmlcode+="changeMenu("+(cm+1)+","+(CatId)+");";

        htmlcode+="writeLayer("+(cm+1)+", htmlcode);";

        htmlcode+="showMenu("+(cm+1)+");";

        htmlcode+="highlightCatMenu("+(cm)+", "+CatId+");";

      }

	  else {

        htmlcode+="highlightCatMenu("+(cm)+", "+CatId+");";

      }

      htmlcode+="window.status='"+CatName+".';";

      htmlcode+='return true;" >';

      htmlcode+='<span class="menutext" >';

      htmlcode+=' '+CatName+' ';

      htmlcode+='</span >';

      htmlcode+='</a >';

      htmlcode+='</td>';

      htmlcode+='<td rowspan="2" width="8" align="center">';

/*

        htmlcode+='<table width="8" cellpadding="0" cellspacing="0" border="0" bgcolor="#6F71A4">';

        htmlcode+='   <tr height="1" >';

        htmlcode+='     <td height="1" ></td>';

        htmlcode+='   </tr>';

        htmlcode+='</table>';

*/

      htmlcode+='<span class="menutext" >';

      htmlcode+='|';

      htmlcode+='</span >';

      htmlcode+='</td>';

      htmlcode+='  </tr>';

      htmlcode+='  <tr >';

      htmlcode+='    <td height="5" align="center" valign="bottom">';

      if (c[CatId]!=null) {

        htmlcode+='<img src="../../images/fdown.gif" width="5" height="5"/>';

      } else {

        htmlcode+='<table height="5" width="1" cellpadding="0" cellspacing="0" border="0" bgcolor="#6F71A4">';

        htmlcode+='   <tr height="1" >';

        htmlcode+='     <td height="1" ></td>';

        htmlcode+='   </tr>';

        htmlcode+='</table>';

      };

      htmlcode+='</td>';

      htmlcode+='  </tr>';

      htmlcode+='</table>';

      htmlcode+="</td>";

    }

    //CatMenu[cm+1].length = numChildren;

  }

  htmlcode+="</tr></table>";

  htmlcode+='</tr><tr><td bgcolor="#FFFFFF">';

  htmlcode+=' <table height="1" width="1" cellpadding="0" cellspacing="0" border="0" bgcolor="#FFFFFF">';

  htmlcode+='   <tr height="1" >';

  htmlcode+='     <td height="1" ></td>';

  htmlcode+='   </tr>';

  htmlcode+=' </table>';

  htmlcode+="</td></tr></table>";

  htmlcode+="\n";

}

// This JS comment is also at the end of the HTML comment above -->

