// JScript source code
var userAgent =navigator.userAgent;
var msie =userAgent.indexOf("MSIE");
var ie4 =((msie > 0) && (document.all)) ? true : false;                                         // IE 4+
var ie5 =((ie4) && (document.getElementById)) ? true : false;                                   // IE 5+
var ie6 =(ie5) && (parseInt(userAgent.substring(msie + 5, userAgent.indexOf(".", msie))) >=6); // IE 6+
var ns4 =(!document.all) && (!document.getElementById) ? true : false;                          // NS 4
var ns6 =((!ie4) && (document.getElementById)) ? true : false;                                  // NS 6.2+, Mozilla 1+
/*switch(true){
  case ie4 && !ie5:
    alert("IE 4");
    break;
  case ie5 && !ie6:
    alert("IE 5");
    break;
  case ie6:
    alert("IE 6");
    break;
};*/
if(ie6){ 
  document.write('<?IMPORT namespace="t" implementation="#default#time2">');
  //document.expando =false;
};
// Common
function GetAbsoluteTop(element){
  var result =0;
  for(var currentElement =element; currentElement.tagName !="BODY"; currentElement =currentElement.offsetParent){
    result +=currentElement.offsetTop;
  };
  return result;
};
function debug(message){
  status +=message + ' ';
};
function inspect(obj){
  var msg ="";
  for(prop in obj){
    msg +=prop + " =" + obj[prop] + "\n";
  };
  alert(msg);
};
// CMenuTemplate
function CMenuTemplate_Add(item){
  item.Index =this.Items.length;
  item.Parent =this;
  this.Items[item.Index] =item;
  var p;
  for(p =item.Parent; p.ClassName !="CMenu"; p =p.Parent){
    item.Level++;
  };
  item.Menu =p;
  for(var i =0; i < item.Items.length; i++){
    item.Items[i].Level +=item.Level;
    item.Items[i].Menu =item.Menu;
  };
};
function CMenuTemplate_HasArticle(articleId){
  for(var i =0; i < this.Items.length; i++){
    if((this.Items[i].ArticleId ==articleId) || this.Items[i].HasArticle(articleId)){
      return true;
    };
  };
  return false;
};
function CMenuTemplate_GenerateMenu(activeArticleId){
  if(this.Level ==-1){
    this.ActiveArticleId =activeArticleId;
  };
  var level =this.Level + 1; // creating items for that level
  // container
  var menuContainer =document.createElement("div");
  menuContainer.id =this.GenerateName("MenuContainer");
  menuContainer.style.marginTop =-1;
  switch(level){
    case 1:
      if(ie6){
        menuContainer.style.overflow ="hidden";
        if(!this.Expanded){
          menuContainer.style.height ="1px";
        };
      }else{
        if(!this.Expanded){
          menuContainer.style.display ="none";
        };
      };
      break;
    case 2:
      menuContainer.style.display ="none";
      menuContainer.style.position ="absolute";
      menuContainer.style.zIndex =1;
      menuContainer.style.overflow ="hidden";
      menuContainer.onmouseover =new Function(this.GetGlobalReference() + ".KeepSubmenu()");
      menuContainer.onmouseout =new Function(this.GetGlobalReference() + ".CloseSubmenu()");
      break;
  };
  // table
  var table =document.createElement("table");
  table.cellPadding =0;
  if(this.Menu.TableCellSpacings !=null){
    table.cellSpacing =this.Menu.TableCellSpacings[level];
  };
  if(this.Menu.TableClasses !=null){
    table.className =this.Menu.TableClasses[level];
  };
  if(level ==1){
    table.style.position ="relative";
    table.style.marginTop ="1px";
  };
  for(var i =0; i < this.Items.length; i++){
    // separator (level >=1)
    if((level >=1) && (this.Menu.Separators !=null)){
      var tableRow =table.insertRow(table.rows.length);
      var tableCell =tableRow.insertCell(tableRow.cells.length);
      var image =document.createElement("img");
      image.src =this.Menu.Separators[level];
      tableCell.appendChild(image);
    };
    // menu item
    var item =this.Items[i];
    item.Expanded =item.Active();
    var tableRow =table.insertRow(table.rows.length);
    // cell
    var tableCell =tableRow.insertCell(tableRow.cells.length);
    tableCell.id =item.GenerateName("MenuitemCell");
    tableCell.vAlign ="middle";
    tableCell.noWrap =true;
    tableCell.onmouseover =new Function(item.GetGlobalReference() + ".HighlightCell()");
    tableCell.onmouseout =new Function(item.GetGlobalReference() + ".RestoreCell()");
    tableCell.onclick =new Function(item.GetGlobalReference() + ".NavigateCell()");
    if(item.Items.length > 0){
      if(item.Active()){
        if(item.Menu.ActiveSubmenuCellCssClasses !=null){
          tableCell.className =item.Menu.ActiveSubmenuCellCssClasses[level];
        };
      }else{
        if(item.Menu.SubmenuCellCssClasses !=null){
          tableCell.className =item.Menu.SubmenuCellCssClasses[level];
        };
      };
    }else{
      if(item.Active()){
        if(item.Menu.ActiveCellCssClasses !=null){
          tableCell.className =item.Menu.ActiveCellCssClasses[level];
        };
      }else{
        if(item.Menu.CellCssClasses !=null){
          tableCell.className =item.Menu.CellCssClasses[level];
        };
      };
    };
    // image
    var image =item.Menu.GenerateImage(item.Active() ? item.Menu.ActiveImages : item.Menu.Images, level);
    if(image !=null){
      tableCell.appendChild(image);
    };
    // link
    var link =document.createElement("a");
    if(item.Active()){
      if(item.Menu.ActiveLinkCssClasses !=null){
        link.className =item.Menu.ActiveLinkCssClasses[level]
      };
    }else{
      if(item.Menu.LinkCssClasses !=null){
        link.className =item.Menu.LinkCssClasses[level];
      };
    };
    if(item.Reference !=""){
      link.href =item.Reference;
    };
    if(ie5){
      link.innerText =item.Caption;
    };
    if(ns6){
      link.innerHTML =item.Caption;
    };
    tableCell.appendChild(link);
    // subitems
    var submenuContainer =null;
    if(item.Items.length > 0){
      switch(level){
        case 0:
          var tableRow =table.insertRow(table.rows.length);
          var tableCell =tableRow.insertCell(tableRow.cells.length);
          submenuContainer =item.GenerateMenu(activeArticleId);
          tableCell.appendChild(submenuContainer);
          break;
        case 1:
          submenuContainer =item.GenerateMenu(activeArticleId);
          document.body.appendChild(submenuContainer);
          break;
      };
    };
    // animation (level ==0)
    if(ie6 && (level ==0) && (submenuContainer !=null)){
      var animateElement =document.createElement("t:Animate");
      animateElement.id =item.GenerateName("SubmenuAnimate");
      animateElement.targetElement =submenuContainer.id;
      animateElement.attributeName ="height";
      animateElement.dur ="400ms";
      animateElement.fill ="hold";
      tableCell.appendChild(animateElement);
      var transitionFilter =document.createElement("t:TransitionFilter");
      transitionFilter.id =item.GenerateName("SubmenuTransitionFilter");
      transitionFilter.targetElement =submenuContainer.id;
      transitionFilter.type ="fade";
      transitionFilter.dur ="400ms";
      tableCell.appendChild(transitionFilter);
    };
    // separator (level ==0)
    if((level ==0) && (this.Menu.Separators !=null)){
      var tableRow =table.insertRow(table.rows.length);
      var tableCell =tableRow.insertCell(tableRow.cells.length);
      var image =document.createElement("img");
      image.src =this.Menu.Separators[level];
      tableCell.appendChild(image);
    };   
  };
  menuContainer.appendChild(table);
  // shadow (level => 2)
  if(ie6 && (level >=2)){
    var shadowElement =document.createElement("div");
    shadowElement.style.position ="relative";
    shadowElement.style.zIndex =-1;
    shadowElement.style.backgroundColor ="black";
    shadowElement.style.border ="solid 1px black";
    shadowElement.style.filter ="progid:DXImageTransform.Microsoft.Blur(PixelRadius='2',MakeShadow='true',ShadowOpacity='0.3')";
    menuContainer.appendChild(shadowElement);
  };
  return menuContainer;
};
function CMenuTemplate_GenerateName(nameType){
  if(this.Level ==-1){
    return nameType + "_" + this.Menu.Name;
  }else{
    return this.Parent.GenerateName(nameType) + "_" + this.Index;
  };
};
// CMenu
function CMenu(menuName, menuArray){
  // common (inherited) properties
  this.ClassName ="CMenu";    // string
  this.Items =new Array();    // CMenuItem[]
  this.Name =menuName;        // string
  this.ActiveArticleId =0;    // int
  this.Menu =this;            // CMenu
  this.Level =-1;             // int
  // methods
  this.Add =CMenuTemplate_Add;
  this.HasArticle =CMenuTemplate_HasArticle;
  this.GenerateMenu =CMenuTemplate_GenerateMenu;
  this.GenerateName =CMenuTemplate_GenerateName;
  this.GetHTML =CMenu_GetHTML;
  this.AssignParameters =CMenu_AssignParameters;
  this.GenerateImage =CMenu_GenerateImage;
  var i =0;
  while(i < menuArray.length){
    if(menuArray[i] ==null){
      break;
    };
    var item =new CMenuItem(menuArray[i], menuArray[i + 1], menuArray[i + 2], menuArray[i + 3]);
    this.Add(item);
    if(menuArray[i + 4] !=null){
      var menu =new CMenu("", menuArray[i + 4]);
      for(var j =0; j < menu.Items.length; j++){
        item.Add(menu.Items[j]);
      };
    };
    i +=5;
  };
};
function CMenu_GenerateImage(imageArray, level){
  /*var html ="";
  if(imageArray !=null){
    html ='<img src="' + imageArray[level] + '"';
    if(this.ImageWidths !=null){
      html +=' width="' + this.ImageWidths[level] + '"';
    };
    if(this.ImageHeights !=null){
      html +=' height="' + this.ImageHeights[level] + '"';
    };
    html +=' align="absmiddle">';
  };
  return html;*/
  var image =null;
  if(imageArray !=null){
    image =document.createElement("img");
    image.src =imageArray[level];
    if(this.ImageWidths !=null){
      image.width =this.ImageWidths[level];
    };
    if(this.ImageHeights !=null){
      image.height =this.ImageHeights[level];
    };
    image.align ="absmiddle";
  };
  return image;
};
function CMenu_GetHTML(activeArticleId){ // depricated
  this.ActiveArticleId =activeArticleId;
  var html ="", htmlPopup ="";
  html +='<div id="MenuContainer' + this.Name + '">';
  // table
  html +='<table cellpadding="0px"';
  if(this.TableCellSpacings !=null){
    html +=' cellspacing="' + this.TableCellSpacings[0] + '"';
  };
  if(this.TableClasses !=null){
    html +=' class="' + this.TableClasses[0] + '"';
  };
  html +='>';
  for(var i =0; i < this.Items.length; i++){
    // menu item
    this.Items[i].Expanded =this.Items[i].Active();
    html +='<tr>';
    // cell
    html +='<td id="MenuitemCell_' + this.Name + '_' + i + '" valign="middle" nowrap="true" onmouseover="' + this.Items[i].GetGlobalReference() + '.HighlightCell()" onmouseout="' + this.Items[i].GetGlobalReference() + '.RestoreCell()" onclick="' + this.Items[i].GetGlobalReference() + '.NavigateCell()"';
    if(this.Items[i].Items.length > 0){
      if(this.Items[i].Active()){
        if(this.ActiveSubmenuCellCssClasses !=null){
          html +=' class="' + this.ActiveSubmenuCellCssClasses[0] + '"';
        };
      }else{
        if(this.SubmenuCellCssClasses !=null){
          html +=' class="' + this.SubmenuCellCssClasses[0] + '"';
        };
      };
    }else{
      if(this.Items[i].Active()){
        if(this.ActiveCellCssClasses !=null){
          html +=' class="' + this.ActiveCellCssClasses[0] + '"';
        };
      }else{
        if(this.CellCssClasses !=null){
          html +=' class="' + this.CellCssClasses[0] + '"';
        };
      };
    };
    html +='>';
    // image
    html +=this.GenerateImage(this.Items[i].Active() ? this.ActiveImages : this.Images, 0);
    // link
    html +='<a';
    if(this.Items[i].Active()){
      if(this.ActiveLinkCssClasses !=null){
        html +=' class="' + this.ActiveLinkCssClasses[0] + '"';
      };
    }else{
      if(this.LinkCssClasses !=null){
        html +=' class="' + this.LinkCssClasses[0] + '"';
      }
    };
    if(ie4 || ns6){
      if(this.Items[i].Reference !=""){
        html +=' href="' + this.Items[i].Reference +  '"';
      };
    };
    if(ns4){
      var item =this.Items[i];
      if((item.Reference =="") && (item.Items.length > 0)){
        item =item.Items[0];
      };
      html +=' href="' + item.Reference +  '"';
      if(item.InExternalWindow()){
        html +=' target="_blank"';
      };
    }
    html +='>' + this.Items[i].Caption + '</a>';
    html +='</td>';
    html +='</tr>';
    // subitems (Level 1)
    if(this.Items[i].Items.length > 0){
      html +='<tr>';
      html +='<td>';
      html +='<div id="SubmenuContainer' + i + '"';
      if(ie4 && !ie6 || ns4 || ns6){
        html +=(this.Items[i].Expanded) ? '' : ' style="display:none"';
      };
      if(ie6){
        html +=' style="overflow: hidden;' + ((this.Items[i].Expanded) ? '' : 'height: 1px') + '"';
      };
      html +='>';
      // table
      html +='<table cellpadding="0px"';
      if(this.TableCellSpacings !=null){
        html +=' cellspacing="' + this.TableCellSpacings[1] + '"';
      };
      if(this.TableClasses !=null){
        html +=' class="' + this.TableClasses[1] + '"';
      };
      if(ie4 || ns6){
        html +=' style="position:relative; margin-top: 1px"';
      };
      html +='>';
      for(var j =0; j < this.Items[i].Items.length; j++){
        // separator
        if(this.Separators !=null){
          html +='<tr>';
          html +='<td>';
          html +='<img src="' + this.Separators[1] + '">';
          html +='</td>';
          html +='</tr>';
        };
        // menu item
        html +='<tr>';
        // cell
        html +='<td id="MenuitemCell_' + this.Name + '_' + i + '_' + j + '" valign="middle" nowrap="true" onmouseover="' + this.Items[i].Items[j].GetGlobalReference() + '.HighlightCell()" onmouseout="' + this.Items[i].Items[j].GetGlobalReference() + '.RestoreCell()" onclick="' + this.Items[i].Items[j].GetGlobalReference() + '.NavigateCell()"';
        if(this.Items[i].Items[j].Items.length > 0){
          if(this.Items[i].Items[j].Active()){
            if(this.ActiveSubmenuCellCssClasses !=null){
              html +=' class="' + this.ActiveSubmenuCellCssClasses[1] + '"';
            };
          }else{
            if(this.SubmenuCellCssClasses !=null){
              html +=' class="' + this.SubmenuCellCssClasses[1] + '"';
            };
          };
        }else{
          if(this.Items[i].Items[j].Active()){
            if(this.ActiveCellCssClasses !=null){
              html +=' class="' + this.ActiveCellCssClasses[1] + '"';
            };
          }else{
            if(this.CellCssClasses !=null){
              html +=' class="' + this.CellCssClasses[1] + '"';
            };
          };
        };
        html +='>';
        // image
        html +=this.GenerateImage(this.Items[i].Items[j].Active() ? this.ActiveImages : this.Images, 1);
        // link
        html +='<a';
        if(this.Items[i].Items[j].Active()){
          if(this.ActiveLinkCssClasses !=null){
            html +=' class="' + this.ActiveLinkCssClasses[1] + '"';
          };
        }else{
          if(this.LinkCssClasses !=null){
            html +=' class="' + this.LinkCssClasses[1] + '"';
          }
        };
        if(ie4 || ns6){
          if(this.Items[i].Items[j].Reference !=""){
            html +=' href="' + this.Items[i].Items[j].Reference +  '"';
          };
        };
        if(ns4){
          var item =this.Items[i].Items[j];
          if((item.Reference =="") && (item.Items.length > 0)){
            item =item.Items[0];
          };
          html +=' href="' + item.Reference + '"';
          if(item.InExternalWindow()){
            html +=' target="_blank"';
          };
        };
        html +='>' + this.Items[i].Items[j].Caption + '</a>';
        // subitems (Level 2) // not tested under NS4
        if(this.Items[i].Items[j].Items.length > 0){
          htmlPopup +='<div id="SubmenuContainer' + i + '_' + j + '" onmouseover="' + this.Items[i].Items[j].GetGlobalReference() + '.KeepSubmenu()" onmouseout="' + this.Items[i].Items[j].GetGlobalReference() + '.CloseSubmenu()"';
          htmlPopup +=' style="display:none; position:absolute; z-index:1; overflow: hidden"';
          htmlPopup +='>';
          // table
          htmlPopup +='<table cellpadding="0px"';
          if(this.TableCellSpacings !=null){
            htmlPopup +=' cellspacing="' + this.TableCellSpacings[2] + '"';
          };          
          if(this.TableClasses !=null){
            htmlPopup +=' class="' + this.TableClasses[2] + '"';
          };
          htmlPopup +='>';
          for(var k =0; k < this.Items[i].Items[j].Items.length; k++){
            // separator
            if(this.Separators !=null){
              htmlPopup +='<tr>';
              htmlPopup +='<td>';
              htmlPopup +='<img src="' + this.Separators[2] + '">';
              htmlPopup +='</td>';
              htmlPopup +='</tr>';
            };
            // menu item
            htmlPopup +='<tr>';
            // cell
            htmlPopup +='<td id="MenuitemCell_' + this.Name + '_' + i + '_' + j + '_' + k + '" valign="middle" nowrap="true" onmouseover="' + this.Items[i].Items[j].Items[k].GetGlobalReference() + '.HighlightCell()" onmouseout="' + this.Items[i].Items[j].Items[k].GetGlobalReference() + '.RestoreCell()" onclick="' + this.Items[i].Items[j].Items[k].GetGlobalReference() + '.NavigateCell(true)"';
            if(this.Items[i].Items[j].Items[k].Active()){
              if(this.ActiveCellCssClasses !=null){
                htmlPopup +=' class="' + this.ActiveCellCssClasses[2] + '"';
              };
            }else{
              if(this.CellCssClasses !=null){
                htmlPopup +=' class="' + this.CellCssClasses[2] + '"';
              };
            };
            htmlPopup +='>';
            // image
            htmlPopup +=this.GenerateImage(this.Items[i].Items[j].Items[k].Active() ? this.ActiveImages : this.Images, 2);
            // link
            htmlPopup +='<a';
            if(this.Items[i].Items[j].Items[k].Active()){
              if(this.ActiveLinkCssClasses !=null){
                htmlPopup +=' class="' + this.ActiveLinkCssClasses[2] + '"';
              };
            }else{
              if(this.LinkCssClasses !=null){
                htmlPopup +=' class="' + this.LinkCssClasses[2] + '"';
              }
            };
            if(ie4 || ns6){
              if(this.Items[i].Items[j].Items[k].Reference !=""){
                htmlPopup +=' href="' + this.Items[i].Items[j].Items[k].Reference +  '"';
              };
            };
            if(ns4){
              var item =this.Items[i].Items[j].Items[k];
              if((item.Reference =="") && (item.Items.length > 0)){
                item =item.Items[0];
              };
              htmlPopup +=' href="' + item.Reference + '"';
              if(item.InExternalWindow()){
                htmlPopup +=' target="_blank"';
              };
            };
            htmlPopup +='>' + this.Items[i].Items[j].Items[k].Caption + '</a>';
            htmlPopup +='</td>';
            htmlPopup +='</tr>';
          };
          htmlPopup +='</table>';
          // shadow
          if(ie6){
            htmlPopup +='<div style="position:relative; z-index:-1; background-color:black; border:solid 1px black; filter:progid:DXImageTransform.Microsoft.Blur(PixelRadius=\'2\',MakeShadow=\'true\',ShadowOpacity=\'0.3\')"></div>';
          };
          htmlPopup +='</div>';
        };
        html +='</td>';
        html +='</tr>';
      };
      html +='</table>';
      html +='</div>';
      if(ie6){
        html +='<t:Animate id="SubmenuContainer' + i + 'Animate" targetElement="SubmenuContainer' + i + '" attributeName="height" dur="0.4" fill="hold" />';
        html +='<t:TransitionFilter id="SubmenuContainer' + i + 'TransitionFilter" targetElement="SubmenuContainer' + i + '" type="fade" dur="0.4" />';
      };
      html +='</td>';
      html +='</tr>';
    };
    // separator
    if(this.Separators !=null){
      html +='<tr>';
      html +='<td>';
      html +='<img src="' + this.Separators[0] + '">';
      html +='</td>';
      html +='</tr>';
    };
  };
  html +='</table>';
  html +='</div>';
  return html + htmlPopup;
};
function CMenu_AssignParameters(images, hotImages, activeImages, separators, linkCssClasses, hotLinkCssClasses, activeLinkCssClasses, cellCssClasses, hotCellCssClasses, activeCellCssClasses, externalWindowFileExtensions, imageWidths, imageHeights, tableClasses, submenuCellCssClasses, hotSubmenuCellCssClasses, activeSubmenuCellCssClasses, tableCellSpacings){
  this.Images =images;                                             // string[] // default images per level
  this.HotImages =hotImages;                                       // string[] // hover images per level
  this.ActiveImages =activeImages;                                 // string[] // active images per level
  this.Separators =separators;                                     // string[] // items separator images per level
  this.LinkCssClasses =linkCssClasses;                             // string[] // default link classes per level
  this.HotLinkCssClasses =hotLinkCssClasses;                       // string[] // hover link classes per level
  this.ActiveLinkCssClasses =activeLinkCssClasses;                 // string[] // active link classes per level
  this.CellCssClasses =cellCssClasses;                             // string[] // default cell classes per level
  this.HotCellCssClasses =hotCellCssClasses;                       // string[] // hover cell classes per level
  this.ActiveCellCssClasses =activeCellCssClasses;                 // string[] // active cell classes per level
  this.ExternalWindowFileExtensions =externalWindowFileExtensions; // string[] // filename extensions (w/o dot), which links open in a new window
  this.ImageWidths =imageWidths;                                   // string[] // image widths per level
  this.ImageHeights =imageHeights;                                 // string[] // image heights per level
  this.TableClasses =tableClasses;                                 // string[] // table classes per level
  this.SubmenuCellCssClasses =submenuCellCssClasses;               // string[] // default cell (w/ submenu) classes per level
  this.HotSubmenuCellCssClasses =hotSubmenuCellCssClasses;         // string[] // hover cell (w/ submenu) classes per level
  this.ActiveSubmenuCellCssClasses =activeSubmenuCellCssClasses;   // string[] // active cell (w/ submenu) classes per level
  this.TableCellSpacings =tableCellSpacings;                       // int[]    // table cell spacings per level
  if(this.SubmenuCellCssClasses ==null){
    this.SubmenuCellCssClasses =this.CellCssClasses;
  };
  if(this.HotSubmenuCellCssClasses ==null){
    this.HotSubmenuCellCssClasses =this.HotCellCssClasses;
  };
  if(this.ActiveSubmenuCellCssClasses ==null){
    this.ActiveSubmenuCellCssClasses =this.ActiveCellCssClasses;
  };
};
// CMenuItem
function CMenuItem(caption, reference, articleId, groupId){
  // common (inherited) properties
  this.ClassName ="CMenuItem"; // string
  this.Items =new Array();     // CMenuItem[]   // subitems
  this.Parent =null;           // CMenuTemplate // parent menu item
  this.Menu =null;             // CMenu         // menu
  this.Level =0;               // int           // menu item level
  // properties
  this.Caption =caption;               // string              // menu item caption
  this.Reference =reference;           // string              // menu item URL
  this.ArticleId =articleId;           // int                 // article ID (must be unique)
  this.GroupId =groupId;               // int                 // group ID (not used)
  this.Expanded =false;                // boolean             // true if submenu is open
  this.Index =0;                       // int                 // menu item index
  this.fTableCell =null;               // IHTMLCellElement    // cached value for TableCell() method
  this.fActive =false;                 // boolean             // cached value for Active() method
  this.fActiveCached =false;           // boolean             // true => fActive is valid
  this.fSubmenuContainer =null;        // IHTMLElement        // cached value for SubmenuContainer() method
  this.fSubmenuTable =null;            // IHTMLTableElement   // cached value for SubmenuTable() method
  this.Hot =false;                     // boolean             // indicates that the menu item is currently hot
  this.Add =CMenuTemplate_Add;
  this.HasArticle =CMenuTemplate_HasArticle;
  this.GenerateMenu =CMenuTemplate_GenerateMenu;
  this.GenerateName =CMenuTemplate_GenerateName;
  this.FindExpandedSibling =CMenuItem_FindExpandedSibling;
  this.FindExpandedSubitem =CMenuItem_FindExpandedSubitem;
  this.FindHotSibling =CMenuItem_FindHotSibling;
  this.InExternalWindow =CMenuItem_InExternalWindow;
  this.GetGlobalReference =CMenuItem_GetGlobalReference;
  this.Active =CMenuItem_Active;
  this.TableCell =CMenuItem_TableCell;
  this.SubmenuContainer =CMenuItem_SubmenuContainer;
  this.SubmenuTable =CMenuItem_SubmenuTable;
  this.HighlightCell =CMenuItem_HighlightCell;
  this.RestoreCell =CMenuItem_RestoreCell;
  this.NavigateCell =CMenuItem_NavigateCell;
  this.Expand =CMenuItem_Expand;
  this.Collapse =CMenuItem_Collapse;
  this.KeepSubmenu =CMenuItem_KeepSubmenu;
  this.CloseSubmenu =CMenuItem_CloseSubmenu;
};
function CMenuItem_HighlightCell(){ // is not called by Netscape 4
  var tableCell =this.TableCell();
  var link;
  var image =null;
  if(ie4){
    var elementIndex =0;
    if(tableCell.children[elementIndex].tagName =="IMG"){
      image =tableCell.children[elementIndex];
      elementIndex++;
    };
    link =tableCell.children[elementIndex];
    tableCell.style.cursor ="hand";
  };
  if(ns6){
    var elementIndex =0;
    if(tableCell.childNodes[elementIndex].tagName =="IMG"){
      image =tableCell.childNodes[elementIndex];
      elementIndex++;
    };
    link =tableCell.childNodes[elementIndex];
    tableCell.style.cursor ="pointer";
  };
  // cell
  if(this.Items.length > 0){
    if(this.Active()){
      if(this.Menu.ActiveSubmenuCellCssClasses !=null){
        tableCell.className =this.Menu.ActiveSubmenuCellCssClasses[this.Level];
      };
    }else{
      if(this.Menu.HotSubmenuCellCssClasses !=null){
        tableCell.className =this.Menu.HotSubmenuCellCssClasses[this.Level];
      };
    };
  }else{
    if(this.Active()){
      if(this.Menu.ActiveCellCssClasses !=null){
        tableCell.className =this.Menu.ActiveCellCssClasses[this.Level];
      };
    }else{
      if(this.Menu.HotCellCssClasses !=null){
        tableCell.className =this.Menu.HotCellCssClasses[this.Level];
      };
    };
  };
  // image
  if(image !=null){
    if(this.Active()){
      if(this.Menu.ActiveImages !=null){
        image.src =this.Menu.ActiveImages[this.Level];
      };
    }else{
      if(this.Menu.HotImages !=null){
        image.src =this.Menu.HotImages[this.Level];
      };
    };
  };
  // link
  if(this.Active()){
    if(this.Menu.ActiveLinkCssClasses !=null){
      link.className =this.Menu.ActiveLinkCssClasses[this.Level];
    };
  }else{
    if(this.Menu.HotLinkCssClasses !=null){
      link.className =this.Menu.HotLinkCssClasses[this.Level];
    };
  };
  // submenu
  switch(this.Level){
    case 0:
      // collapsing submenu submenus
      var expandedSubitem =this.FindExpandedSubitem();
      if(expandedSubitem !=null){
        expandedSubitem.Collapse();
      };
      break;
    case 1:
      // collapsing currently expanded sibling
      var expandedSibling =this.FindExpandedSibling();
      if(expandedSibling !=null){
        expandedSibling.Collapse();
      };
      // expanding submenu
      if(this.Items.length > 0){
        this.Expand(tableCell);
      };
      break;
  };
  // updating state
  this.Hot =true;
  if(ns6){
    var hotSibling =this.FindHotSibling();
    if(hotSibling !=null){
      hotSibling.RestoreCell();
    };
  };
};
function CMenuItem_RestoreCell(){ // is not called by Netscape 4
  var tableCell =this.TableCell();
  var link;
  var image =null;
  if(ie4){
    var elementIndex =0;
    if(tableCell.children[elementIndex].tagName =="IMG"){
      image =tableCell.children[elementIndex];
      elementIndex++;
    };
    link =tableCell.children[elementIndex];
  };
  if(ns6){
    var elementIndex =0;
    if(tableCell.childNodes[elementIndex].tagName =="IMG"){
      image =tableCell.childNodes[elementIndex];
      elementIndex++;
    };
    link =tableCell.childNodes[elementIndex];
  };
  // cell
  if(this.Items.length > 0){
    if(this.Active()){
      if(this.Menu.ActiveSubmenuCellCssClasses !=null){
        tableCell.className =this.Menu.ActiveSubmenuCellCssClasses[this.Level];
      };
    }else{
      if(this.Menu.SubmenuCellCssClasses !=null){
        tableCell.className =this.Menu.SubmenuCellCssClasses[this.Level];
      };    
    };
  }else{
    if(this.Active()){
      if(this.Menu.ActiveCellCssClasses !=null){
        tableCell.className =this.Menu.ActiveCellCssClasses[this.Level];
      };
    }else{
      if(this.Menu.CellCssClasses !=null){
        tableCell.className =this.Menu.CellCssClasses[this.Level];
      };    
    };
  };
  // image
  if(image !=null){
    if(this.Active()){
      if(this.Menu.ActiveImages !=null){
        image.src =this.Menu.ActiveImages[this.Level];
      };
    }else{
      if(this.Menu.Images !=null){
        image.src =this.Menu.Images[this.Level];
      };
    };
  };
  // link
  if(this.Active()){
    if(this.Menu.ActiveLinkCssClasses !=null){
      link.className =this.Menu.ActiveLinkCssClasses[this.Level];
    };
  }else{
    if(this.Menu.LinkCssClasses !=null){
      link.className =this.Menu.LinkCssClasses[this.Level];
    };
  };
  // updating state
  this.Hot =false;
};
function CMenuItem_GetGlobalReference(){
  return ((this.Parent.ClassName =="CMenu") ? this.Menu.Name : this.Parent.GetGlobalReference()) + ".Items[" + this.Index + "]";
};
function CMenuItem_FindExpandedSibling(){
  for(var i =0; i < this.Parent.Items.length; i++){
    var item =this.Parent.Items[i];
    if(item.Expanded && (item !=this) && (!item.Active() || (item.Level >=1))){
      return item;
    };
  };
  return null;
};
function CMenuItem_FindExpandedSubitem(){
  for(var i =0; i < this.Items.length; i++){
    var item =this.Items[i];
    if(item.Expanded && (!item.Active() || (item.Level >=1))){
      return item;
    };
  };
  return null;
};
function CMenuItem_FindHotSibling(){
  for(var i =0; i < this.Parent.Items.length; i++){
    var item =this.Parent.Items[i];
    if(item.Hot && (item !=this)){
      return item;
    };
  };
  return null;
};
function CMenuItem_InExternalWindow(){
  for(var i =0; i < this.Menu.ExternalWindowFileExtensions.length; i++){
    var index =this.Reference.indexOf("." + this.Menu.ExternalWindowFileExtensions[i]);
    if(this.Reference.length ==index + this.Menu.ExternalWindowFileExtensions[i].length + 1){
      return true;
    };
  };
  return false;
};
function CMenuItem_NavigateCell(){ // is not called by Netscape 4
  if(this.Reference !=""){
    if(this.InExternalWindow()){
      open(this.Reference);
    }else{
      location.href =this.Reference;
    };
  }else{
    // collapsing currently expanded sibling
    var expandedSibling =this.FindExpandedSibling();
    if(expandedSibling !=null){
      expandedSibling.Collapse();
    };
    // expanding/collapsing the item
    if(this.Items.length > 0){
      if(this.Expanded){
        if(ie4){ // workaround for IE 4, the code doesn't interfere w/ IE 5+
          this.HighlightCell(); 
        };
        this.Collapse();
      }else{
        this.Expand(this.TableCell());
      };      
    };
  };
};
function CMenuItem_Expand(alignmentElement){
  switch(this.Level){
    case 0:
      if(ie4 && !ie6 || ns6){
        var submenuContainer =this.SubmenuContainer();
        submenuContainer.style.display ="";
      };
      if(ie6){
        var submenuTable =this.SubmenuTable();
        var animateElement =document.getElementById(this.GenerateName("SubmenuAnimate"));
        var transitionFilter =document.getElementById(this.GenerateName("SubmenuTransitionFilter"));
        animateElement.from =1;
        animateElement.to =submenuTable.offsetHeight + 1;
        transitionFilter.mode ="in";
        try{
          animateElement.beginElement();
          transitionFilter.beginElement();
        }catch(e){
          document.getElementById(animateElement.targetElement).style.height =animateElement.to;
        };
      };
      break;
    case 1:
      var mainMenuContainer =document.getElementById(this.Menu.GenerateName("MenuContainer"));
      var submenuContainer =this.SubmenuContainer();
      submenuContainer.style.left =mainMenuContainer.offsetWidth;
      if(ie5){
        submenuContainer.style.top =GetAbsoluteTop(alignmentElement) - 2;
      };
      if(ns6){
        submenuContainer.style.top =GetAbsoluteTop(alignmentElement) - 1;
      }
      submenuContainer.style.display ="";
      if(ie6){
        var submenuTable =this.SubmenuTable();
        var shadowElement =submenuContainer.children[1];
        shadowElement.style.top ="-" + (submenuTable.offsetHeight - 1);
        shadowElement.style.left =1;
        shadowElement.style.width =submenuTable.offsetWidth;
        shadowElement.style.height =submenuTable.offsetHeight; 
        submenuContainer.style.height =shadowElement.clientHeight + 8;
      };
      break;
  };
  this.Expanded =true;
};
function CMenuItem_Collapse(){
  switch(this.Level){
    case 0:
      if(ie4 && !ie6 || ns6){
        var submenuContainer =this.SubmenuContainer();
        submenuContainer.style.display ="none";
      };
      if(ie6){
        var submenuTable =this.SubmenuTable();
        var animateElement =document.getElementById(this.GenerateName("SubmenuAnimate"));
        var transitionFilter =document.getElementById(this.GenerateName("SubmenuTransitionFilter"));
        animateElement.from =submenuTable.offsetHeight + 1;
        animateElement.to =1;
        transitionFilter.mode ="out";
        try{
          animateElement.beginElement();
          transitionFilter.beginElement();
        }catch(e){
          document.getElementById(animateElement.targetElement).style.height =animateElement.to;
        };
      };
      break;
    case 1:
      var mainMenuContainer =document.getElementById("MenuContainer" + this.Menu.Name);
      var submenuContainer =this.SubmenuContainer();
      if(submenuContainer !=null){
        submenuContainer.style.display ="none";
      };
      break;
  };
  this.Expanded =false;
};
function CMenuItem_Active(){
  if(!this.fActiveCached){
    this.fActive =(this.ArticleId ==this.Menu.ActiveArticleId) || (this.HasArticle(this.Menu.ActiveArticleId));
    this.fActiveCached =true;
  };
  return this.fActive;
};
function CMenuItem_KeepSubmenu(){ // is not called by Netscape 4
  var submenuContainer =this.SubmenuContainer();
  submenuContainer.style.display ="";
};
function CMenuItem_CloseSubmenu(){ // is not called by Netscape 4
  var submenuContainer =this.SubmenuContainer();
  submenuContainer.style.display ="none";
};
function CMenuItem_TableCell(){ // is not called by Netscape 4
  if(this.fTableCell ==null){
    this.fTableCell =document.getElementById(this.GenerateName("MenuitemCell"));
  };
  return this.fTableCell;
};
function CMenuItem_SubmenuContainer(){ // is not called by Netscape 4
  if(this.fSubmenuContainer ==null){
    this.fSubmenuContainer =document.getElementById(this.GenerateName("MenuContainer"));
  };
  return this.fSubmenuContainer;
};
function CMenuItem_SubmenuTable(){ // is not called by Netscape 4
  if(this.fSubmenuTable ==null){
    var submenuContainer =this.SubmenuContainer();
    if(ie4){
      this.fSubmenuTable =submenuContainer.children[0];
    };
    if(ns6){
      this.fSubmenuTable =submenuContainer.childNodes[0];
    };
  };
  return this.fSubmenuTable;
};
