UserBox = Class.create();
UserBox.click = function(elt) {
  window.location = elt.getElementsByTagName('a')[0].href;
}

UserBox.setup_hovers = function() {
  document.observe("dom:loaded", function() {
    $$('.hoveruser .user_thumb').each(function(user_node) {new UserBox(user_node);});
  });
};

UserBox.prototype = {
  node: null,
  
  initialize: function(user_node)
  {
    this.node = user_node;
    this.node.onmouseover = this.hover.bind(this, true);
    this.node.onmouseout = this.hover.bind(this, false);
  },
  
  hover: function(show)
  {
    var title_hover = document.getElementsByClassName('thumb_title_hover', this.node)[0];
     
    if (title_hover)
    {
      if (show && title_hover.style.display=='none')
      {
        Element.show(title_hover);
      } else {
        Element.hide(title_hover);
      }
    }  
  }
};

