/*
	 Initialize and render the MenuBar when its elements are ready 
	 to be scripted.
*/

YAHOO.util.Event.onContentReady("navigation", function () {

	/*
		 Instantiate a MenuBar:  The first argument passed to the 
		 constructor is the id of the element in the page 
		 representing the MenuBar; the second is an object literal 
		 of configuration properties.
	*/

	var oMenuBar = new YAHOO.widget.MenuBar("navigation");
	
	/*
		 Call the "render" method with no arguments since the 
		 markup for this MenuBar instance is already exists in 
		 the page.
	*/

	oMenuBar.render();

});

// This function will clear the class of the overall YUI div if the sidebar doesn't exist
YAHOO.util.Event.onDOMReady(function () {
	if (!document.getElementById('sidebarInside') && !document.getElementById('sidebarFront')) {
		document.getElementById('doc4').className = "";
	}
});


var stripe = function() {
  var tables = document.getElementsByTagName("table");  

  for(var x=0;x!=tables.length;x++){
	var table = tables[x];
	if (! table) { return; }
	
	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 += " even";
		
		even = !even;
	  }
	}
  }
}

window.onload = stripe;
