/* stripeTable:
alternates row color and highlights row on mouseover.
Style should be defined for tbody, ruled, even.
Including page should have a variable sTable to hold id of target table
and calls this function onload: window.onload = stripeTable;
Target table should have a body tag.*/

var stripeTable = function() {
	if (!document.getElementById(sTable))
	{
		return false;
	}
    var table = document.getElementById(sTable);
    var tbodies = table.getElementsByTagName("tbody");

    for (var h = 0; h < tbodies.length; h++) {
      var even = true;
      var trs = tbodies[h].getElementsByTagName("tr");
      
      for (var i = 0; i < trs.length; i++) {
        /*
        trs[i].onmouseover=function(){
          this.className += " ruled"; return false
        }
        trs[i].onmouseout=function(){
          this.className = this.className.replace("ruled", ""); return false
        }     */
        
        if(even)
          trs[i].className += " rowColor1";
        else
          trs[i].className += " rowColor2";
        even = !even;
      }
    }
}

/* highlightRow: 
Highlights row on mouseover. This should be used instead of the stripeTable
function above, when you don't need the table striping effect.
Including page should have a variable sTable to hold id of target table
and calls this function onload: window.onload = highlightRow;
Target table should have a body tag.*/

var highlightRow = function() {
	if (!document.getElementById(sTable))
	{
		return false;
	}
    var table = document.getElementById(sTable);
    var tbodies = table.getElementsByTagName("tbody");

    for (var h = 0; h < tbodies.length; h++) {

      var trs = tbodies[h].getElementsByTagName("tr");
      
      for (var i = 0; i < trs.length; i++) {
	  
        if (trs[i].className != "statHead" && trs[i].className != "tableHead" && trs[i].className != "sfHeader")
        {
            trs[i].onmouseover=function(){
              this.className += " ruled"; return false
            }
            trs[i].onmouseout=function(){
              this.className = this.className.replace("ruled", ""); return false
            }
        }
      }
    }
}





