var decorateTable =
{
   initialize: function()
   {
   var productTable = YAHOO.util.Dom.getElementsByClassName("products");
   for (var h = 0; h < productTable.length; h++)
       {
       var productBody = productTable[h].getElementsByTagName("tbody");
       var rows = productBody[0].getElementsByTagName("tr");
       this.addStripes(rows);   
       YAHOO.util.Event.addListener(rows, "mouseover", this.highLight); 
       YAHOO.util.Event.addListener(rows, "mouseout", this.removeHighLight);   
       }   
   },

   addStripes: function (rows) {
      for (var i = 0; i < rows.length; i+=2)
      {
      YAHOO.util.Dom.addClass(rows[i], 'productstripe'); 
      }
   },

   highLight: function()
   {
         YAHOO.util.Dom.addClass(this, "highlight");
   },

   removeHighLight: function()
   {
         YAHOO.util.Dom.removeClass(this, "highlight");
   }
  
};

function init() { 
decorateTable.initialize();
}

YAHOO.util.Event.onDOMReady(init);
