/////////////////////////////////////////////////
////                   MENU                  ////
/////////////////////////////////////////////////

if (iStart) {
 if (oCB.isMACIE4 || oCB.isMACIE5) {
  oLoadTimer = setInterval("fCheckLoad()", 100);
 } else {
  if (oMain.onload) {
   fReturn = oMain.onload;
  }
  oMain.onload = fRun;
 }
}

function fCheckLoad() {
 var iLoad = 0;
 if (oParametrage.Menu_Utilise_Frames) {
  if (oParent.document.readyState=="complete" && oParent.frames[oParametrage.Frames_Racine].document.readyState == "complete" && oParent.frames[oParametrage.Frames_Autres].document.readyState == "complete") {
   iLoad = 1;
  }
 } else {
  if (oParent.document.readyState == "complete") {
   iLoad = 1;
  }
 }
 if (iLoad) {
  clearInterval(oLoadTimer);
  fRun();
 }
}

function fNavUnload() {
 iLoaded = 0;
 iCreated = 0;
 /*if (top.portail.main) {
  if (typeof(top.portail.main.killWin) != 'undefined') {
   top.portail.main.killWin();
  }
 }*/
}

function fUnloadAll() {
 fNull(oFirstContainer);
 oFirstContainer = oFirst = oSecond = oTarget = oUnload = oCursorOver = oCloseTimer = oDocument = oBody = oMain = null;
 /*if (top.portail.main) {
  if (typeof(top.portail.main.killWin) != 'undefined') {
   top.portail.main.killWin();
  }
 }*/
}

function fCheckLoaded() {
 if (!oCB.isIE) {
  if (oSecond.document.body) {
   clearInterval(oLoadTimer);
   fRun();
  }
 } else {

  try {
   var sTry = oSecond.document.readyState;
  } catch (e) {
   var sTry = "";
  }

  if (sTry != "") {
   if (oSecond.document.readyState == "complete") {
    if (oLoadTimer) {
     clearInterval(oLoadTimer);
    }
    fRun();
   }
  }

 }
}

function fNavLoaded(e) {
 if (e.target != self) {
  routeEvent(e);
 }
 if (e.target == oSecond) {
  fRun();
 }
}

function fRedo() {
 if (oCB.appVersion.indexOf("4.0") == -1) {
  oDocument.location.reload();
 } else if (iSecondWidth != oSecond.innerWidth || iSecondHeight != oSecond.innerHeight || iFirstWidth != oFirst.innerWidth || iFirstHeight != oFirst.innerHeight) {
  oDocument.location.reload();
 }
}

function fRelative() {
 oParametrage.Menu_Decale_Top = (iStartTop < 1 && iStartTop > 0) ? iStartTop * iFirstHeight : iStartTop;
 oParametrage.Menu_Decale_Left = (iStartLeft < 1 && iStartLeft > 0) ? iStartLeft * iFirstWidth : iStartLeft;
}

function fReturn() {
 return;
}

function fFalse() {
 return false;
}

function fRun() {
	
 if (!iLoaded && iStart) {
  iCreated = 0;
  iLoaded = 1;
  if (oParametrage.Menu_Utilise_Frames) {
   oFirst = parent.frames[oParametrage.Frames_Racine];
   oSecond = parent.frames[oParametrage.Frames_Autres];
   oTarget = parent.frames[oParametrage.Frames_Target];
  } else {
   oFirst = oSecond = oTarget = window;
  }
  if (oParametrage.Menu_Utilise_Frames) {
   if (!oFirst) {
    oFirst = oSecond;
    if (!oFirst) {
     oFirst = oSecond = oTarget;
     if (!oFirst) {
      oFirst = oSecond = oTarget = window;
     }
    }
   }
   if (!oSecond) {
    oSecond = oTarget;
    if (!oSecond) {
     oSecond = oTarget = oFirst;
    }
   }
   if (!oTarget) {
    oTarget = oSecond;
   }
  }
  if (oFirst == oSecond) {
   iWithFrames = 0;
  }
  if (iWithFrames) {
   oParametrage.Premiere_Ligne_Horizontale = oParametrage.Frames_Orientation ? 0 : 1;
  }
  if (oCB.isIE6 || oCB.isOPERA7) {
   oFirstHTML = oFirst.document.getElementsByTagName("HTML")[0];
   oSecondHTML = oSecond.document.getElementsByTagName("HTML")[0];
   iFirstCSS = (oFirst.document.compatMode.indexOf("CSS") == -1) ? 0 : 1;
   iSecondCSS = (oSecond.document.compatMode.indexOf("CSS") == -1) ? 0 : 1;
  }
  iFirstWidth = oCB.isIE ? iFirstCSS ? oFirstHTML.clientWidth : oFirst.document.body.clientWidth : oFirst.innerWidth;
  iFirstHeight = oCB.isIE ? iFirstCSS ? oFirstHTML.clientHeight : oFirst.document.body.clientHeight : oFirst.innerHeight;
  iSecondWidth = oCB.isIE ? iSecondCSS ? oSecondHTML.clientWidth : oSecond.document.body.clientWidth : oSecond.innerWidth;
  iSecondHeight = oCB.isIE ? iSecondCSS ? oSecondHTML.clientHeight : oSecond.document.body.clientHeight : oSecond.innerHeight;
  if (oParametrage.Menu_Position_Horizontale.indexOf("justify") != -1 && oParametrage.Premiere_Ligne_Horizontale) {
   fJustify();
  }
  if (iFirstCreate || oFirst == oSecond) {
   oFirstContainer = fCreate(oParametrage.Menu_Name, oParametrage.Premiere_Ligne, null);
  } else {
   fReCreate(oParametrage.Menu_Name, oParametrage.Premiere_Ligne);
  }
  fRelative();
  if (oParametrage.Menu_Div_Span) {
   fTarget();
  }
  fLeft();
  fTop();
  fPosition(oFirstContainer, oParametrage.Menu_Decale_Top, oParametrage.Menu_Decale_Left);
  iInit = 1;
  fInitiate();
  iCreated = 1;
  oUnload = oCB.isIE ? oSecond.document.body : oSecond;
  oUnload.onunload = oCB.isNAV4 ? fNavUnload : fUnload;
  if (oCB.isIE) {
   oMain.onunload = fUnloadAll;
  }
  oMain.onresize = oCB.isNAV4 ? fRedo : fRePosition;
  if (oCB.isNAV4 && iFirstCreate) {
   oMain.captureEvents(Event.LOAD);
   oMain.onload = fNavLoaded;
  }
  if (iFirstCreate) {
   fReturn();
  }
  iFirstCreate = 0;
  if (oParametrage.Menu_Position_Verticale == "static" && !iWithFrames) {
   //setInterval("fKeepPosition()", 250);
  }
 }
}

function fJustify() {
 var aParams = (typeof(oParametrage.Array_Levels[0]) != 'undefined') ? oParametrage.Array_Levels[0] : oParametrage.Array_Defaut;
 var iNb = (aParams[1][0] != 0) ? oParametrage.Premiere_Ligne + 1 : 2;
 var iWidth = Math.round((oParametrage.Menu_Justify_Portion * iFirstWidth - iNb * aParams[1][0]) / oParametrage.Premiere_Ligne);
 var i = 0;
 var oObj = null;
 for (i = 1; i < oParametrage.Premiere_Ligne + 1; i++) {
  oObj = eval(oParametrage.Menu_Name + i);
  oObj[2] = iWidth;
 }
 oParametrage.Menu_Decale_Left = 0;
}

function fCreate(sMenuName, iNumber, oParentOne) {
 oParametrage.iIndex++;
 var oPrevious = null;
 var i = 0;
 var iWidth = 0;
 var iHeight = 0;
 var iNbChilds = 0;
 var oChildDiv = null;
 var sMenu = sMenuName + "1";
 var aParams = (typeof(oParametrage.Array_Levels[eval(sMenu + "[0]")]) != 'undefined') ? oParametrage.Array_Levels[eval(sMenu + "[0]")] : oParametrage.Array_Defaut;
 var iFirstWidth = eval(sMenu + "[2]");
 var iFirstHeight = aParams[0];
 var oWindow = (oParametrage.iIndex == 1) ? oFirst : oSecond;
 var iBorder = (aParams[1][0] == 0) ? 0 : 1;
 var iBorderWidth = aParams[1][0];
 if (oParametrage.iIndex == 1 && oParametrage.Premiere_Ligne_Horizontale) {
  for (i = 1; i < iNumber + 1; i++) {
   sMenu = sMenuName + eval(i);
   iWidth = eval(sMenu + "[2]") ? iWidth + eval(sMenu + "[2]") : iWidth + iFirstWidth;
  }
  iWidth = iBorder ? iWidth + (iNumber + 1) * iBorderWidth : iWidth + 2 * iBorderWidth;
  iHeight = iFirstHeight + 2 * iBorderWidth;
 } else {
  for (i = 1; i < iNumber + 1; i++) {
   sMenu = sMenuName + eval(i);
   iHeight = iHeight + iFirstHeight;
  }
  iHeight = iBorder ? iHeight + (iNumber + 1) * iBorderWidth : iHeight + 2 * iBorderWidth;
  iWidth = iFirstWidth + 2 * iBorderWidth;
 }
 if (oCB.isDOM) {
  var oChild = oWindow.document.createElement("div");
  oChild.style.position="absolute";
  oChild.style.visibility="hidden";
  oWindow.document.body.appendChild(oChild);
 } else {
  if (oCB.isNAV4) {
   var oChild = new Layer(iWidth, oWindow);
  } else {
   sMenu += "c";
   oWindow.document.body.insertAdjacentHTML("AfterBegin", "<div id=\"" + sMenu + "\" style=\"visibility:hidden; position:absolute;\"><\/div>");
   var oChild = oWindow.document.all[sMenu];
  }
 }
 oChild.SetUp = fDivSetup;
 oChild.SetUp(iWidth, iHeight, iNumber, sMenuName + "1", oParentOne, aParams);
 if (oCB.isIE4) {
  oChild.InnerString = "";
  for (i = 1; i < iNumber + 1; i++) {
   sMenu = sMenuName + eval(i);
   oChild.InnerString += "<div id=\"" + sMenu + "\" style=\"position:absolute;\"><\/div>";
  }
  oChild.innerHTML = oChild.InnerString;
 }
 for (i = 1; i < iNumber + 1; i++) {
  sMenu = sMenuName + eval(i);
  aParams = (typeof(oParametrage.Array_Levels[eval(sMenu + "[0]")]) != 'undefined') ? oParametrage.Array_Levels[eval(sMenu + "[0]")] : oParametrage.Array_Defaut;
  iNbChilds = eval(sMenu + "[3]");
  iWidth = (oParametrage.iIndex == 1 && oParametrage.Premiere_Ligne_Horizontale) ? eval(sMenu + "[2]") ? eval(sMenu + "[2]") : iFirstWidth : iFirstWidth;
  iHeight = aParams[0];
  if (oCB.isDOM) {
   oChildDiv = oWindow.document.createElement("div");
   oChildDiv.style.position = "absolute";
   oChildDiv.style.visibility = "inherit";
   oChild.appendChild(oChildDiv);
  } else {
   oChildDiv = oCB.isNAV4 ? new Layer(iWidth, oChild) : oWindow.document.all[sMenu];
  }
  oChildDiv.aOptions = eval(sMenu);
  // BgLowColor
  oChildDiv.aOptions[5] = aParams[2][0];
  // BgHighColor
  oChildDiv.aOptions[6] = aParams[2][1];
  // FontLowColor
  oChildDiv.aOptions[7] = aParams[3][0];
  // FontHighColor
  oChildDiv.aOptions[8] = aParams[3][1];
  // FontFamily
  oChildDiv.aOptions[9] = aParams[4][0];
  // FontSize
  oChildDiv.aOptions[10] = aParams[4][1];
  // FontBold
  oChildDiv.aOptions[11] = aParams[4][2];
  // FontItalic
  oChildDiv.aOptions[12] = aParams[4][3];
  // TextCentered
  oChildDiv.aOptions[13] = aParams[4][4];
  // Top Padding
  oChildDiv.aOptions[14] = aParams[5][0];
  // Left Padding
  oChildDiv.aOptions[15] = aParams[5][1];
  // BgLowImage
  oChildDiv.aOptions[16] = aParams[6][0];
  // BgHighImage
  oChildDiv.aOptions[17] = aParams[6][1];
  // BorderWidth
  oChildDiv.aOptions[18] = aParams[1][0];
  oChildDiv.SetUp = oCB.isNAV4 ? fNavChildSetup : fChildSetup;
  oChildDiv.SetUp(oChild, oPrevious, sMenu, iWidth, iHeight, iNbChilds);
  if (iNbChilds) {
   oChildDiv.oChildContainer = fCreate(sMenu + "_", iNbChilds, oChildDiv);
  }
  oPrevious = oChildDiv;
 }
 oChild.oFirstOne = oChildDiv;
 oParametrage.iIndex--;
 return oChild;
}

function fReCreate(sMenuName, iNumber) {
 var i = 0;
 var sMenu = '';
 var iNbChilds = 0;
 var oChildDiv = oFirstContainer.oFirstOne;
 oParametrage.iIndex++;
 for (i = iNumber; i > 0; i--) {
  sMenu = sMenuName + eval(i);
  iNbChilds = eval(sMenu + "[3]");
  if (iNbChilds) {
   oChildDiv.oChildContainer = fCreate(sMenu + "_", iNbChilds, oChildDiv);
  }
  oChildDiv = oChildDiv.oPreviousOne;
 }
 oParametrage.iIndex--;
}

function fDivSetup(iWidth, iHeight, iNb, sMenuName, oParentOne, aParams) {
 var sColor = (aParams[1][0]) ? (aParams[1][0] != 0) ? aParams[1][1] : "" : "";
 this.oFirstOne = null;
 this.oCaller = oParentOne;
 this.iShow = 0;
 this.iOrigineLeft = this.iOrigineTop = 0;
 if (oCB.isNAV4) {
  if (sColor != '') {
   this.bgColor = sColor;
  }
  this.visibility = "hide";
  this.resizeTo(iWidth, iHeight);
 } else {
  if (sColor != '') {
   this.style.backgroundColor = sColor;
  }
  this.style.width = iWidth + sPX;
  this.style.height = iHeight + sPX;
  if (!oCB.isNAV) {
   this.style.zIndex = oParametrage.iIndex + oParametrage.Premier_zIndex;
  }
  if (oCB.isIE6) {
   sFilter="";
   if (oParametrage.Filtre_Slide && oParametrage.iIndex != 1) {
    sFilter = oParametrage.Filtre_Slide;
   }
   if (oParametrage.Filtre_Shadow) {
    sFilter += oParametrage.Filtre_Shadow;
   }
   if (oParametrage.Filtre_Opacity) {
    sFilter += oParametrage.Filtre_Opacity;
   }
   if (sFilter != "") {
    this.style.filter = sFilter;
   }
  }
 }
}

function fChildSetup(oParentOne, oPreviousOne, sMenuName, iWidth, iHeight, iNb) {
 this.oChildContainer = null;
 var oText;
 var sText = this.aOptions[1];
 var iPad = (oParametrage.iIndex == 1) ? iFirstCSS : iSecondCSS;
 var iPadLeft = ((oCB.isDOMNAV && !oCB.isOPERA7) || oCB.isMACIE5 || iPad) ? this.aOptions[15] : 0;
 var iPadTop = ((oCB.isDOMNAV && !oCB.isOPERA7) || oCB.isMACIE5 || iPad) ? this.aOptions[14] : 0;
 var oWindow = (oParametrage.iIndex == 1) ? oFirst : oSecond;
 this.iHilite = 0;
 this.iRemember = 0;
 this.iClicked = 0;
 this.oContainer = oParentOne;
 this.oPreviousOne = oPreviousOne;
 this.iLevel = oParametrage.iIndex;
 this.fOpenMenu = fOpen;
 this.style.overflow = "hidden";
 this.iNbChilds = iNb;
 this.MenuName = sMenuName;
 this.style.cursor = (this.aOptions[1] || (oParametrage.iIndex == 1 && oParametrage.Menu_Ouvre_Sur_Click)) ? oCB.isIE ? "hand" : "pointer" : "default";
 this.value = sText;
 this.style.color = this.aOptions[7];
 this.style.fontFamily = this.aOptions[9];
 this.style.fontSize = !oCB.isMAC4 ? this.aOptions[10] + "pt" : Math.round(4 * this.aOptions[10] / 3) + "pt";
 this.style.fontWeight = this.aOptions[11] ? "bold" : "normal";
 this.style.fontStyle = this.aOptions[12] ? "italic" : "normal";
 this.style.textAlign = this.aOptions[13];
 if (this.aOptions[5]) {
  if (this.aOptions[5] != "") {
   this.style.backgroundColor = this.aOptions[5];
  }
 }
 if (this.aOptions[16]) {
  this.style.backgroundImage = "url(\"" + oParametrage.Portal_Path + this.aOptions[16] + "\")";
 }
 if (sText.indexOf("<") == -1) {
  this.style.width = iWidth - iPadLeft + sPX;
  this.style.height = iHeight - iPadTop + sPX;
  this.style.paddingLeft = this.aOptions[15] + sPX;
  this.style.paddingTop = this.aOptions[14] + sPX;
 } else {
  this.style.width = iWidth + sPX;
  this.style.height = iHeight + sPX;
 }
 if (sText.indexOf("<") == -1 && oCB.isDOM) {
  oText = oWindow.document.createTextNode(sText);
  this.appendChild(oText);
 } else {
  this.innerHTML = sText;
 }
 if (oCB.isIE) {
  this.onselectstart = fFalse;
  this.onmouseover = oParametrage.Menu_Ouvre_Sur_Click ? fClick : fOpen;
  this.onmouseout = fClose;
  this.onclick = (oParametrage.Menu_Ouvre_Sur_Click && this.aOptions[4]) ? fOpen : fGoTo;
 } else {
  oParametrage.Menu_Ouvre_Sur_Click ? this.addEventListener("mouseover", fClick, false) : this.addEventListener("mouseover", fOpen, false);
  this.addEventListener("mouseout", fClose, false);
  (oParametrage.Menu_Ouvre_Sur_Click && this.aOptions[4]) ? this.addEventListener("click", fOpen, false) : this.addEventListener("click", fGoTo, false);
 }
}

function fNavChildSetup(oParentOne, oPreviousOne, sMenuName, iWidth, iHeight, iNb) {
 this.value = this.aOptions[1];
 sCenterText = (this.aOptions[13] != "left") ? "<div align=\"" + this.aOptions[13] + "\">" : "";
 sTextClose = "</font>" + ((this.aOptions[13] != "left") ? "</div>" :"");
 if (this.aOptions[15] && this.value.indexOf("<") == -1 && this.aOptions[13] == "left") {
  this.value = "&nbsp\;" + this.value;
 }
 if (this.aOptions[11]) {
  this.value = this.value.bold();
 }
 if (this.aOptions[12]) {
  this.value = this.value.italics();
 }
 this.Ovalue = this.value;
 this.value = this.value.fontcolor(this.aOptions[7]);
 this.Ovalue = this.Ovalue.fontcolor(this.aOptions[8]);
 this.value = sCenterText + "<font face=\"" + this.aOptions[9] + "\" point-size=\"" + (!oCB.isMAC4 ? this.aOptions[10] : Math.round(4 * this.aOptions[10] / 3)) + "\">" + this.value + sTextClose;
 this.Ovalue = sCenterText + "<font face=\"" + this.aOptions[9] + "\" point-size=\"" + (!oCB.isMAC4 ? this.aOptions[10] : Math.round(4 * this.aOptions[10] / 3)) + "\">" + this.Ovalue + sTextClose;
 this.oChildContainer = null;
 this.oPreviousOne = oPreviousOne;
 this.iHilite = 0;
 this.iRemember = 0;
 this.iClicked = 0;
 this.visibility = "inherit";
 this.MenuName = sMenuName;
 this.iNbChilds = iNb;
 if (this.aOptions[5]) {
  if (this.aOptions[5] != "") {
   this.bgColor = this.aOptions[5];
  }
 }
 if (this.aOptions[16]) {
  this.background.src = this.aOptions[16];
 }
 this.resizeTo(iWidth, iHeight);
 this.document.write(this.value);
 this.document.close();
 this.oLayer = new Layer(iWidth, oParentOne);
 this.oLayer.iLevel = oParametrage.iIndex;
 this.oLayer.visibility = "inherit";
 this.oLayer.onmouseover = oParametrage.Menu_Ouvre_Sur_Click ? fClick : fOpen;
 this.oLayer.onmouseout = fClose;
 this.oLayer.captureEvents(Event.MOUSEDOWN);
 this.oLayer.onmousedown = (oParametrage.Menu_Ouvre_Sur_Click && this.aOptions[4]) ? fOpen : fGoTo;
 this.oLayer.fOpenMenu = fOpen;
 this.oLayer.layer = this;
 this.oLayer.resizeTo(iWidth, iHeight);
 this.oLayer.oContainer = oParentOne;
}

function fOver(oObj) {
 if (oCB.isNAV4) {
  if (oObj.aOptions[6]) {
   if (oObj.aOptions[6] != "") {
    oObj.bgColor = oObj.aOptions[6];
   }
  }
  if (oObj.aOptions[17]) {
   oObj.background.src = oObj.aOptions[17];
  }
  if (oObj.value.indexOf("<img") == -1) {
   oObj.document.write(oObj.Ovalue);
   oObj.document.close();
  }
 } else {
  if (oObj.aOptions[6]) {
   if (oObj.aOptions[6] != "") {
    oObj.style.backgroundColor = oObj.aOptions[6];
   }
  }
  if (oObj.aOptions[8]) {
   oObj.style.color = oObj.aOptions[8];
  }
  if (oObj.aOptions[17]) {
   oObj.style.backgroundImage = "url(\"" + oParametrage.Portal_Path + oObj.aOptions[17] + "\")";
  }
 }
 oObj.iHilite = 1;
}

function fOut(oObj) {
 oObj.iHilite = 0;
 if (oCB.isNAV4) {
  if (oObj.aOptions[5]) {
   if (oObj.aOptions[5] != "") {
    oObj.bgColor = oObj.aOptions[5];
   }
  }
  if (oObj.aOptions[16]) {
   oObj.background.src = oObj.aOptions[16];
  }
  if (oObj.value.indexOf("<img") == -1) {
   oObj.document.write(oObj.value);
   oObj.document.close();
  }
 } else {
  if (oObj.aOptions[5]) {
   if (oObj.aOptions[5] != "") {
    oObj.style.backgroundColor = oObj.aOptions[5];
   }
  }
  if (oObj.aOptions[7]) {
   oObj.style.color = oObj.aOptions[7];
  }
  if (oObj.aOptions[16]) {
   oObj.style.backgroundImage = "url(\"" + oParametrage.Portal_Path + oObj.aOptions[16] + "\")";
  }
 }
}

function fKeepPosition() {
 var iScrollTop = oCB.isIE ? iSecondCSS ? oSecondHTML.scrollTop : oSecond.document.body.scrollTop : oSecond.pageYOffset;
 if (iScrollTop != iStatic) {
  var oContainerStyle = oCB.isNAV4 ? oFirstContainer : oFirstContainer.style;
  oFirstContainer.iOrigineTop = oParametrage.Menu_Decale_Top + iScrollTop;
  oContainerStyle.top = oFirstContainer.iOrigineTop + sPX;
  iStatic = iScrollTop;
 }
}

function fTarget() {
 var oDivSpan = oCB.isNAV4 ? oFirst.document.layers[oParametrage.Menu_Div_Span] : oCB.isDOM ? oFirst.document.getElementById(oParametrage.Menu_Div_Span) : oFirst.document.all[oParametrage.Menu_Div_Span];
 if (oCB.isDOM) {
  while (oDivSpan) {
   oParametrage.Menu_Decale_Top += oDivSpan.offsetTop;
   oParametrage.Menu_Decale_Left += oDivSpan.offsetLeft;
   oDivSpan = oDivSpan.offsetParent;
  }
 } else {
  oParametrage.Menu_Decale_Top += oCB.isNAV4 ? oDivSpan.pageY : oDivSpan.offsetTop;
  oParametrage.Menu_Decale_Left += oCB.isNAV4 ? oDivSpan.pageX : oDivSpan.offsetLeft;
 }
}

function fLeft() {
 if (oParametrage.Menu_Position_Horizontale.indexOf("left") == -1) {
  var iLeft = iFirstWidth - (!oCB.isNAV4 ? parseInt(oFirstContainer.style.width) : oFirstContainer.clip.width);
  oParametrage.Menu_Decale_Left += (oParametrage.Menu_Position_Horizontale.indexOf("right") != -1) ? iLeft : iLeft / 2;
  if (oParametrage.Menu_Decale_Left < 0) {
   oParametrage.Menu_Decale_Left = 0;
  }
 }
}

function fTop() {
 if (oParametrage.Menu_Position_Verticale != "top" && oParametrage.Menu_Position_Verticale != "static") {
  var iTop = iFirstHeight - (!oCB.isNAV4 ? parseInt(oFirstContainer.style.height) : oFirstContainer.clip.height);
  oParametrage.Menu_Decale_Top += (oParametrage.Menu_Position_Verticale == "bottom") ? iTop : iTop / 2;
  if (oParametrage.Menu_Decale_Top < 0) {
   oParametrage.Menu_Decale_Top = 0;
  }
 }
}

function fInitiate() {
 if (iInit && iLoaded) {
  fInit(oFirstContainer);
  iInit = 0;
  iShowFlag = 0;
 }
}

function fGoTo() {
 var oObj = oCB.isNAV4 ? this.layer : this;
 if (oObj.aOptions[4]) {
  fOut(oObj);
  iInit = 1;
  fInitiate();
  (oObj.aOptions[4].indexOf("javascript:") != -1) ? eval(oObj.aOptions[4]) : oTarget.location.href = oParametrage.Portal_Path + oObj.aOptions[4];
 }
}

function fClick() {
 if (!iLoaded || !iCreated) {
  return;
 }
 var oObj = oCB.isNAV4 ? this.layer : this;
 oCursorOver = this;
 iInit = 0;
 fClearAll(this.oContainer.oFirstOne);
 fOver(oObj);
}

function fClose() {
 if (!iLoaded || !iCreated) {
  return;
 }
 if (this == oCursorOver) {
  if (oOpenTimer) {
   clearTimeout(oOpenTimer);
  }
  if (oCloseTimer) {
   clearTimeout(oCloseTimer);
  }
  iInit = 1;
  oCloseTimer = setTimeout("fInitiate(oCursorOver)", oParametrage.Menu_Delai_Fermeture);
 }
}

function fInit(oObj) {
 var oFirstObj = oObj.oFirstOne;
 var oFirstStyle = oCB.isNAV4 ? oObj : oObj.style;
 oParametrage.iIndex++;
 oFirstStyle.visibility = (oParametrage.iIndex == 1) ? sShow : sHide;
 oObj.iShow = (oParametrage.iIndex == 1) ? 1 : 0;
 while (oFirstObj != null) {
  if (oFirstObj.iHilite) {
   fOut(oFirstObj);
  }
  if (oFirstObj.oChildContainer) {
   fInit(oFirstObj.oChildContainer);
  }
  oFirstObj = oFirstObj.oPreviousOne;
 }
 oParametrage.iIndex--;
}

function fUnload() {
 fNavUnload();
 if (oCB.isIE) {
  var oObj = oFirstContainer ? oFirstContainer.oFirstOne : null;
  while (oObj != null) { 
   if (oObj.oChildContainer) {
    fNull(oObj.oChildContainer);
    oObj.oChildContainer = null;
   }
   oObj = oObj.oPreviousOne;
  }
 }
 if (!oCB.isNAV4) {
  oLoadTimer = setInterval("fCheckLoaded()", 100);
 }
}

function fNull(oObj) {
 var oFirstObj = oObj.oFirstOne;
 var oSecondObj = null;
 while (oFirstObj != null) {
  oSecondObj = oFirstObj;
  if (oFirstObj.oChildContainer) {
   fNull(oFirstObj.oChildContainer);
   oFirstObj.oChildContainer = null;
  }
  oFirstObj.oContainer = null;
  oFirstObj = oFirstObj.oPreviousOne;
  oSecondObj.oPreviousOne = null;
  oSecondObj = null;
 }
 oObj.oFirstOne = null;
}

function fClearAll(oObj) {
 var oSecondStyle;
 var oSecondObj;
 while (oObj) {
  if (oObj.iHilite) {
   oSecondObj = oCB.isNAV4 ? oObj.oLayer : oObj;
   if (oSecondObj != oCursorOver) {
    fOut(oObj);
   }
   if (oObj.oChildContainer) {
    oSecondStyle = oCB.isNAV4 ? oObj.oChildContainer : oObj.oChildContainer.style;
    if (oSecondObj != oCursorOver) {
     oSecondStyle.visibility = sHide;
     oObj.oChildContainer.iShow = 0;
    }
    fClearAll(oObj.oChildContainer.oFirstOne);
   }
   break;
  }
  oObj = oObj.oPreviousOne;
 }
}

function fUnfold() {
 var oObj = oCursorOver;
 var iScrollTop = oCB.isIE ? iSecondCSS ? oSecondHTML.scrollTop : oSecond.document.body.scrollTop : oSecond.pageYOffset;
 var iScrollLeft = oCB.isIE ? iSecondCSS ? oSecondHTML.scrollLeft : oSecond.document.body.scrollLeft : oSecond.pageXOffset;
 var iHeight = oCB.isNAV4 ? oObj.clip.height : parseInt(oObj.style.height);
 var iWidth = oCB.isNAV4 ? oObj.clip.width : parseInt(oObj.style.width);
 var iLeft = (iWithFrames && oObj.iLevel == 1 && !oParametrage.Premiere_Ligne_Horizontale) ? 0 : oCB.isNAV4 ? oObj.oContainer.left : parseInt(oObj.oContainer.style.left);
 var iTop = (iWithFrames && oObj.iLevel == 1 && oParametrage.Premiere_Ligne_Horizontale) ? 0 : oCB.isNAV4 ? oObj.oContainer.top : parseInt(oObj.oContainer.style.top);
 var iContainerWidth = oCB.isNAV4 ? oObj.layer.oChildContainer.clip.width : parseInt(oObj.oChildContainer.style.width);
 var iContainerHeight = oCB.isNAV4 ? oObj.layer.oChildContainer.clip.height : parseInt(oObj.oChildContainer.style.height);
 var oContainerStyle = oCB.isNAV4 ? oObj.layer.oChildContainer : oObj.oChildContainer.style;
 var oContainerChild = oCB.isNAV4 ? oObj.layer.oChildContainer : oObj.oChildContainer;
 var iTotalLeft = (iWithFrames && oObj.iLevel == 1) ? oContainerChild.iOrigineLeft + iLeft + iScrollLeft : oContainerChild.iOrigineLeft + iLeft;
 var iTotalTop = (iWithFrames && oObj.iLevel == 1) ? oContainerChild.iOrigineTop + iTop + iScrollTop : oContainerChild.iOrigineTop + iTop;
 if (!iShowFlag) {
  iShowFlag = 1;
 }
 if (oParametrage.Menu_Ouvre_Droite_Gauche) {
  if (iTotalLeft < iScrollLeft) {
   iTotalLeft = (oObj.iLevel == 1) ? iScrollLeft : iTotalLeft + (iContainerWidth + (1 - 2 * oParametrage.Menu_Chevauchement_Horizontal) * iWidth);
  }
  if (iTotalLeft + iContainerWidth > iSecondWidth + iScrollLeft) {
   iTotalLeft = iSecondWidth + iScrollLeft - iContainerWidth;
  }
 } else {
  if (iTotalLeft + iContainerWidth > iSecondWidth + iScrollLeft) {
   iTotalLeft = (oObj.iLevel == 1) ? iSecondWidth + iScrollLeft - iContainerWidth : iTotalLeft - (iContainerWidth + (1 - 2 * oParametrage.Menu_Chevauchement_Horizontal) * iWidth);
  }
  if (iTotalLeft < iScrollLeft) {
   iTotalLeft = iScrollLeft;
  }
 }
 if (oParametrage.Menu_Ouvre_Bas_Haut) {
  if (iTotalTop < iScrollTop) {
   iTotalTop = (oObj.iLevel == 1) ? iScrollTop : iTotalTop + (iContainerHeight - (1 - 2 * oParametrage.Menu_Chevauchement_Vertical) * iHeight);
  }
  if (iTotalTop + iContainerHeight > iSecondHeight + iScrollTop) {
   iTotalTop = iSecondHeight + iScrollTop - iContainerHeight + (oCB.isNAV4 ? 4 : 0);
  }
 } else {
  if (iTotalTop + iContainerHeight > iScrollTop + iSecondHeight) {
   iTotalTop = (oObj.iLevel == 1) ? iScrollTop + iSecondHeight - iContainerHeight : iTotalTop - iContainerHeight + (1 - 2 * oParametrage.Menu_Chevauchement_Vertical) * iHeight;
  }
  if (iTotalTop < iScrollTop) {
   iTotalTop = iScrollTop;
  }
 }
 oContainerStyle.top = iTotalTop + sPX;
 oContainerStyle.left = iTotalLeft + sPX;
 if (oCB.isIE6 && oParametrage.Filtre_Slide) {
  oObj.oChildContainer.filters[0].Apply();
  oObj.oChildContainer.filters[0].play();
 }
 oContainerStyle.visibility = sShow;
}

function fPosition(oObj, iTop, iLeft) {
 var aParams = (typeof(oParametrage.Array_Levels[oParametrage.iIndex]) != 'undefined') ? oParametrage.Array_Levels[oParametrage.iIndex] : oParametrage.Array_Defaut;
 oParametrage.iIndex++;
 var iPad = (oParametrage.iIndex == 1) ? iFirstCSS : iSecondCSS;
 var iPadLeft = ((oCB.isDOMNAV && !oCB.isOPERA7) || oCB.isMACIE5 || iPad) ? aParams[5][1] : 0;
 var iPadTop = ((oCB.isDOMNAV && !oCB.isOPERA7) || oCB.isMACIE5 || iPad) ? aParams[5][0] : 0;
 var iBorder = (aParams[1][0] == 0) ? 0 : 1;
 var iBorderWidth = aParams[1][0];
 var oSecondObj = oObj.oFirstOne;
 var oObjStyle = !oCB.isNAV4 ? oObj.style : oObj;
 var oSecondStyle = !oCB.isNAV4 ? oSecondObj.style : oSecondObj;
 var iiPadLeft = (oSecondObj.value.indexOf("<") == -1) ? iPadLeft : 0;
 var iiPadTop = (oSecondObj.value.indexOf("<") == -1) ? iPadTop : 0;
 var oSecondWidth = !oCB.isNAV4 ? parseInt(oSecondStyle.width) + iiPadLeft : oSecondStyle.clip.width;
 var oSecondHeight = !oCB.isNAV4 ? parseInt(oSecondStyle.height) + iiPadTop : oSecondStyle.clip.height;
 var oObjWidth = !oCB.isNAV4 ? parseInt(oObjStyle.width) : oObjStyle.clip.width;
 var oObjHeight = !oCB.isNAV4 ? parseInt(oObjStyle.height) : oObjStyle.clip.height;
 var Ti, Li, Hi, CCw, CCh, STp, SLt;
 if (oParametrage.iIndex == 1 && iWithFrames) {
  !oParametrage.Frames_Orientation ? iTop = oParametrage.Menu_Ouvre_Bas_Haut ? 0 : iFirstHeight - oObjHeight + (oCB.isNAV4 ? oCB.isMAC ? -2 : 4 : 0) : iLeft = oParametrage.Menu_Ouvre_Droite_Gauche ? 0 : iFirstWidth - oObjWidth + (oCB.isNAV4 ? oCB.isMAC ? -2 : 4 :0);
 }
 if (oParametrage.iIndex == 2 && iWithFrames) {
  !oParametrage.Frames_Orientation ? iTop = oParametrage.Menu_Ouvre_Bas_Haut ? iSecondHeight - oObjHeight + (oCB.isNAV4 ? oCB.isMAC ? -2 : 4 : 0) : 0 : iLeft = oParametrage.Menu_Ouvre_Droite_Gauche ? iSecondWidth - oObjWidth : 0;
 }
 if (oParametrage.iIndex == 2) {
  iTop += oParametrage.Frames_Correction_Verticale;
  iLeft += oParametrage.Frames_Correction_Horizontale;
 }
 oObjStyle.top = (oParametrage.iIndex == 1) ? iTop + sPX : 0;
 oObj.iOrigineTop = iTop;
 oObjStyle.left = (oParametrage.iIndex == 1) ? iLeft + sPX : 0;
 oObj.iOrigineLeft = iLeft;
 if (oParametrage.iIndex == 1 && oParametrage.Premiere_Ligne_Horizontale) {
  Hi = 1;
  Li = oObjWidth - oSecondWidth - 2 * iBorderWidth;
  Ti = 0;
 } else {
  Hi = Li = 0;
  Ti = oObjHeight - oSecondHeight - 2 *iBorderWidth;
 }
 while (oSecondObj != null) {
  oSecondStyle.left = Li + iBorderWidth + sPX;
  oSecondStyle.top = Ti + iBorderWidth + sPX;
  if (oCB.isNAV4) {
   oSecondObj.oLayer.moveTo(Li + iBorderWidth, Ti + iBorderWidth);
  }
  if (oSecondObj.oChildContainer) {
   if (oParametrage.Menu_Ouvre_Droite_Gauche) {
    CCw = oCB.isNAV4 ? oSecondObj.oChildContainer.clip.width : parseInt(oSecondObj.oChildContainer.style.width);
   }
   if (oParametrage.Menu_Ouvre_Bas_Haut) {
    CCh = oCB.isNAV4 ? oSecondObj.oChildContainer.clip.height : parseInt(oSecondObj.oChildContainer.style.height);
   }
   if (Hi) {
    STp = oParametrage.Menu_Ouvre_Bas_Haut ? Ti - CCh : Ti + oSecondHeight + 2 * iBorderWidth;
    SLt = oParametrage.Menu_Ouvre_Droite_Gauche ? Li + oSecondWidth - CCw : Li;
   } else {
    SLt = oParametrage.Menu_Ouvre_Droite_Gauche ? Li - CCw + oParametrage.Menu_Chevauchement_Horizontal * oSecondWidth + iBorderWidth : Li + (1 - oParametrage.Menu_Chevauchement_Horizontal) * oSecondWidth + iBorderWidth;
    STp = (oParametrage.iIndex == 1 && iWithFrames) ? oParametrage.Menu_Ouvre_Bas_Haut ? Ti - CCh + oSecondHeight : Ti : oParametrage.Menu_Ouvre_Bas_Haut ? Ti - CCh + (1 - oParametrage.Menu_Chevauchement_Vertical) * oSecondHeight + 2 * iBorderWidth : Ti + oParametrage.Menu_Chevauchement_Vertical * oSecondHeight;
   }
   fPosition(oSecondObj.oChildContainer, STp, SLt);
  }
  oSecondObj = oSecondObj.oPreviousOne;
  if(oSecondObj) {
   oSecondStyle = !oCB.isNAV4 ? oSecondObj.style : oSecondObj;
   iiPadLeft = (oSecondObj.value.indexOf("<") == -1) ? iPadLeft : 0;
   iiPadTop = (oSecondObj.value.indexOf("<") == -1) ? iPadTop : 0;
   oSecondWidth = !oCB.isNAV4 ? parseInt(oSecondStyle.width) + iiPadLeft : oSecondStyle.clip.width;
   oSecondHeight = !oCB.isNAV4 ? parseInt(oSecondStyle.height) + iiPadTop : oSecondStyle.clip.height;
   Hi ? Li-=iBorder ? (oSecondWidth + iBorderWidth) : (oSecondWidth) : Ti-=iBorder ? (oSecondHeight + iBorderWidth) : oSecondHeight;
  }
 }
 oParametrage.iIndex--;
}

function fRePosition() {
 iFirstWidth = oCB.isIE ? iFirstCSS ? oFirstHTML.clientWidth : oFirst.document.body.clientWidth : oFirst.innerWidth;
 iFirstHeight = oCB.isIE ? iFirstCSS ? oFirstHTML.clientHeight : oFirst.document.body.clientHeight : oFirst.innerHeight;
 iSecondWidth = oCB.isIE ? iSecondCSS ? oSecondHTML.clientWidth : oSecond.document.body.clientWidth : oSecond.innerWidth;
 iSecondHeight = oCB.isIE ? iSecondCSS ? oSecondHTML.clientHeight : oSecond.document.body.clientHeight : oSecond.innerHeight;
 if (oParametrage.Menu_Position_Horizontale.indexOf("justify") != -1 && oParametrage.Premiere_Ligne_Horizontale) {
  fJustify();
  var oObj = oFirstContainer.oFirstOne;
  var iWidth = eval(oParametrage.Menu_Name + '1[2]');
  var aParams = (typeof(oParametrage.Array_Levels[0]) != 'undefined') ? oParametrage.Array_Levels[0] : oParametrage.Array_Defaut;
  var iNb = (aParams[1][0] != 0) ? oParametrage.Premiere_Ligne + 1 : 2;
  var i = 0;
  oFirstContainer.style.width = oParametrage.Premiere_Ligne * iWidth + iNb * BorderWidthMain + sPX;
  var iPadLeft = ((oCB.isDOMNAV && !oCB.isOPERA7) || oCB.isMACIE5 || iFirstCSS) ? oObj.aOptions[15] : 0;
  for (i = 0; i < oParametrage.Premiere_Ligne; i++) {
   oObj.style.width = iWidth - (oObj.value.indexOf("<") == -1 ? iPadLeft : 0) + sPX;
   oObj = oObj.oPreviousOne;
  }
  iStatic = -1;
  fRelative();
  if (oParametrage.Menu_Div_Span) {
   fTarget();
  }
  fLeft();
  fTop();
  fPosition(oFirstContainer,oParametrage.Menu_Decale_Top,oParametrage.Menu_Decale_Left);
 }
}

function fOpen() {
 if (!iLoaded || !iCreated) {
  return;
 }
 if (oOpenTimer) {
  clearTimeout(oOpenTimer);
 }
 var oObj = oCB.isNAV4 ? this.layer : this;
 if (oObj.iNbChilds && !oObj.oChildContainer) {
  var iPad = (oParametrage.iIndex == 1) ? iFirstCSS : iSecondCSS;
  var iPadLeft = ((oCB.isDOMNAV && !oCB.isOPERA7) || oCB.isMACIE5 || iPad) ? oObj.aOptions[15] : 0;
  var iPadTop = ((oCB.isDOMNAV && !oCB.isOPERA7) || oCB.isMACIE5 || iPad) ? oObj.aOptions[14] : 0;
  oParametrage.iIndex = this.iLevel;
  oObj.oChildContainer = fCreate(oObj.MenuName + "_", oObj.iNbChilds, oObj);
  var iBorderWidth = oObj.aOptions[18];
  var oObjStyle = !oCB.isNAV4 ? oObj.style : oObj;
  var iiPadLeft = (oObj.value.indexOf("<") == -1) ? iPadLeft : 0;
  var iiPadTop = (oObj.value.indexOf("<") == -1) ? iPadTop : 0;
  var oObjWidth = !oCB.isNAV4 ? parseInt(oObjStyle.width) + iiPadLeft : oObjStyle.clip.width;
  var oObjHeight = !oCB.isNAV4 ? parseInt(oObjStyle.height) + iiPadTop : oObjStyle.clip.height;
  var Ti, Li, Hi, CCw, CCh, STp, SLt;
  if (oParametrage.Menu_Ouvre_Droite_Gauche) {
   CCw = oCB.isNAV4 ? oObj.oChildContainer.clip.width : parseInt(oObj.oChildContainer.style.width);
  }
  if (oParametrage.Menu_Ouvre_Bas_Haut) {
   CCh = oCB.isNAV4 ? oObj.oChildContainer.clip.height : parseInt(oObj.oChildContainer.style.height);
  }
  if (oParametrage.iIndex == 1 && oParametrage.Premiere_Ligne_Horizontale) {
   Hi = 1;
   Li = (oCB.isNAV4 ? oObj.left : parseInt(oObj.style.left)) - iBorderWidth;
   Ti = 0;
  } else {
   Hi = Li = 0;
   Ti = (oCB.isNAV4 ? oObj.top : parseInt(oObj.style.top)) - iBorderWidth;
  }
  if (Hi) {
   STp = oParametrage.Menu_Ouvre_Bas_Haut ? Ti - CCh : Ti + oObjHeight + 2 * iBorderWidth;
   SLt = oParametrage.Menu_Ouvre_Droite_Gauche ? Li + oObjWidth - CCw : Li;
  } else {
   SLt = oParametrage.Menu_Ouvre_Droite_Gauche ? Li - CCw + oParametrage.Menu_Chevauchement_Horizontal * oObjWidth + iBorderWidth : Li + (1 - oParametrage.Menu_Chevauchement_Horizontal) * oObjWidth;
   STp = (oParametrage.iIndex == 1 && iWithFrames) ? oParametrage.Menu_Ouvre_Bas_Haut ? Ti - CCh + oObjHeight : Ti : oParametrage.Menu_Ouvre_Bas_Haut ? Ti - CCh + (1 - oParametrage.Menu_Chevauchement_Vertical) * oObjHeight + 2 * iBorderWidth : Ti + oParametrage.Menu_Chevauchement_Vertical * oObjHeight + iBorderWidth;
  }
  fPosition(oObj.oChildContainer, STp, SLt);
  oParametrage.iIndex = 0;
 }
 var oContainerChild = oCB.isNAV4 ? this.layer.oChildContainer : this.oChildContainer;
 oObj = oCB.isNAV4 ? this.layer : this;
 oCursorOver = this;
 iInit = 0;
 fClearAll(this.oContainer.oFirstOne);
 if (!oObj.iHilite) {
  fOver(oObj);
 }
 if (oContainerChild != null && !oContainerChild.iShow) {
  oOpenTimer = setTimeout("fUnfold()", oParametrage.Menu_Delai_Ouverture);
 }
}