/* 
	Javascript to style odd/even table rows
	Derived from 'Zebra Tables' by David F. Miller (http://www.alistapart.com/articles/zebratables/)
	
	Modified by Jop de Klein, february 2005
        Modified by Dustin DeYoung, November 2007
	jop at validweb.nl
	http://validweb.nl/artikelen/javascript/better-zebra-tables/
*/

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

		//var tables = document.getElementByClass("sortable");

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