function addLoadEvent(func, param) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = function() {
	func(param);
    }
  } else {
    window.onload = function() {
      oldonload();
      func(param);
    }
  }
}

function addClass(element,value) {
  if (!element.className) {
    element.className = value;
  } else {
    newClassName = element.className;
    newClassName+= " ";
    newClassName+= value;
    element.className = newClassName;
  }
}


function stripeTables(tableId) {
  if(!document.getElementsByTagName) return false;
	var tTable = document.getElementById(tableId);
	if ( tTable ) {
	var tbodies = tTable.getElementsByTagName("tbody");
	for (var i=0; i<tbodies.length; i++) {
		var odd = true;
		var rows = tbodies[i].getElementsByTagName("tr");
		for (var j=0; j<rows.length; j++) {
			if ( rows[j].parentNode != tbodies[i] ) {
				continue;
			}
			if (odd == false) {
				odd = true;
			} else {
				addClass(rows[j],"odd");
				odd = false;
			}
		}
	}
	}
  return true;
}
function highlightRows(tableId) {
  if(!document.getElementsByTagName) return false;
  var tTable = document.getElementById(tableId);
  if ( tTable ) {
  var tbodies = tTable.getElementsByTagName("tbody");
  for (var j=0; j<tbodies.length; j++) {
     if ( tbodies[j].id == "nohighlight" ) return false;
     var rows = tbodies[j].getElementsByTagName("tr");
     for (var i=0; i<rows.length; i++) {
           rows[i].oldClassName = rows[i].className
           rows[i].onmouseover = function() {
              if( this.className.indexOf("selected") == -1)
                 addClass(this,"highlight");
           }
           rows[i].onmouseout = function() {
              if( this.className.indexOf("selected") == -1)
                 this.className = this.oldClassName
           }
     }
  }
  }
  return true;
}
if ( typeof(skipstdtablestripes) == 'undefined' ) {
addLoadEvent(stripeTables, 'stdtablelist');
addLoadEvent(stripeTables, 'stdtablelist2');
addLoadEvent(stripeTables, 'greytablelist');
addLoadEvent(highlightRows, 'stdtablelist');
addLoadEvent(highlightRows, 'stdtablelist2');
addLoadEvent(highlightRows, 'greytablelist');
}

