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");
       YAHOO.util.Event.addListener(rows, "mouseover", this.highLight); 
       YAHOO.util.Event.addListener(rows, "mouseout", this.removeHighLight); 
       YAHOO.util.Event.addListener(rows, "click", this.trToHyperLink)  
       this.addStripes(rows); 
       this.addHandCursor(rows);   
   }   
    },

   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");
   },
  
   trToHyperLink: function()
   {
   this.style.cursor = "hand";   
   var td = YAHOO.util.Dom.getFirstChild(this);
   var tdLink = YAHOO.util.Dom.getFirstChild(td);
   window.location.href = tdLink.href; 
   },

   addHandCursor: function(rows)
   {
       YAHOO.util.Dom.setStyle(rows, 'cursor', 'pointer'); 
   }
};

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

YAHOO.util.Event.onDOMReady(init);
