/*  iCms 3 level dropdown menu ver. 1.0   */
/*  Author: fedek6 catch me at:           */
/*  http://parmezan.homelinux.org         */
/*  "Luke I am your Hacker!"              */
/*  Tested on: ff 3.0, ie 6               */
var amenu = {
  objMenu:null,
  getMenu:function(strName) {
    this.objMenu = document.getElementById(strName);
  },
  icmsHover:function() {
    var arrLis = this.objMenu.getElementsByTagName('li');
    var arrDivs = this.objMenu.getElementsByTagName('div');
    for(var i=0; i<arrLis.length; i++) {
      if(arrLis[i].parentNode.className == 'lvl2') { continue; }
      arrLis[i].onmouseover = function() {
        this.className = 'over';
      }
      arrLis[i].onmouseout = function() {
        this.className = '';
      }
    }
    for(var i=0; i<arrDivs.length; i++) {
      arrDivs[i].onmouseover = function() {
        this.className = 'hover';
      }
      arrDivs[i].onmouseout = function() {
        this.className = 'none';
      }
    }
  },
  ieBHack:function() {
    var arrUls = this.objMenu.getElementsByTagName('ul');
    for(var i=0; i<arrUls.length; i++) {
      if(arrUls[i].className == 'lvl2') {
        arrUls[i].firstChild.className = 'amenu_ie_bhack';
      }
    }
  },
  initMenu:function(strName) {
    this.getMenu(strName);
    this.icmsHover();
    this.ieBHack();
  }
}