var balloon = Class.create({
  testmich: 'huhi',
  elNames: null,
  initialize: function(ajElements)
  {
    this.elNames = ajElements;
  },
  
  prepareBubbles: function()
  {
    this.elNames.each(function(jItem) {
      $$(jItem.container).each(function(oItem) {
        
        // Fade in
        oItem.observe('mouseover', function(eElement) {
          var oItem = eElement.element().down(jItem.content);
          if ( oItem ) 
            oItem.appear({duration: 0.3});
        }.bindAsEventListener(this, jItem));
        
        // Fade out
        oItem.observe('mouseout', function(eElement) {
          var oItem = eElement.element().down(jItem.content)
          if ( oItem )
            oItem.fade({duration: 0.3});
        }.bindAsEventListener(this, jItem));
        
      }.bind(this));
    }.bind(this));
  }
});

var ajElements = [
  {
    container: '.tx-statuslights-pi1-description', 
    content: '.tx-statuslights-pi1-desc_inner'
  }
]

var b = new balloon(ajElements);

document.observe("dom:loaded", function() {
  b.prepareBubbles();
});

