/**
 * Welcome to the Web Application Forge JavaScript Library
 *
 * 
 */

var DualStripedTables =
{
  init: function()
  {
    var tables = waf.getElementsByClass("dataTable");

    for (var i = 0; i < tables.length; i++)
    {
      var tbodys = tables[i].getElementsByTagName("tbody");
      
      for (var j = 0; j < tbodys.length; j++)
      {
        var rows = tbodys[j].getElementsByTagName("tr");

        for (var k = 0; k < rows.length; k++)
        {
        	var rowAltClass = (k & 1) ? "altRow1" : "altRow2";
			waf.addClass(rows[k], rowAltClass);
        }
      }
    }
  }
};

waf.start(DualStripedTables);