var TopMenuWatcher = Class.create();
TopMenuWatcher.prototype = {

  initialize: function(item, cell) {
    this.item = $(item);
    this.cell = $(cell);
    this.color = '#cccccc';
    this.item.onmouseover = this.setBackground.bindAsEventListener(this);
    this.item.onmouseout  = this.removeBackground.bindAsEventListener(this);
  },

  setBackground: function(evt) {
    if (!Element.hasClassName(this.cell, 'hover'))
    this.cell.style.backgroundColor = this.color;
  },

  removeBackground: function(evt) {
    if (!Element.hasClassName(this.cell, 'hover'))
    this.cell.style.backgroundColor = "#7DB3DF";
  }
};

var menuitems,i;
var watcher = new Array(50);
menuitems = document.getElementsByTagName('li');
for(i in menuitems){
  if(/customi/.test(menuitems[i].className)) {
    watcher[i] = new TopMenuWatcher('item_'+menuitems[i].id, menuitems[i].id);
  }
}