	$(document).ready(function(){
		paintRows();
	});
	
	
	function paintRows() {
	    $("table.roundTable tr:even, table.#groupAtable tr:even, table.#groupBtable tr:even, table.#SF2 tr:even, table.#SF1 tr:even, table.#F1 tr:even, table.#F2 tr:even, table.#playoffsTable tr:even").addClass("evenRow");
	    $("table.roundTable tr:odd, table.#groupAtable tr:odd, table.#groupBtable tr:odd, table.#SF2 tr:odd, table.#SF1 tr:odd, table.#F2 tr:odd, table.#F1 tr:odd, table.#playoffsTable tr:odd").addClass("oddRow");
		$("table.#groupAtable tr:eq(2) td, table.#groupBtable tr:eq(2) td").css("border-bottom", "dashed 1px #999");
	}
	
	function clickRows() {
		$('#teams tr').click(function() {
			$(this).siblings().removeClass("currentRow");
			paintRows();
			$(this).removeClass("evenRow oddRow hoverRow")
			$(this).addClass("currentRow");
			if($(this).children("td.roster").children("img").length==0) {
				$("#noRoster").siblings().fadeOut(function() {
					$("#noRoster").fadeIn();
				});
			} else showRoster($(this).attr('id'));		
		});
	}
	function hoverRows() {
	    $("#teams tr:even").hover(function(){

			if(! $(this).is('.currentRow'))
			$(this).addClass("hoverRow");
		}, function() {
			if(! $(this).is('.currentRow')) {
				$(this).removeClass("hoverRow");
				$(this).addClass("evenRow");
			}
		});
	    $("#teams tr:odd").hover(function(){
			if(! $(this).is('.currentRow'))
			$(this).addClass("hoverRow");
		}, function() {
			if(! $(this).is('.currentRow')) {
				$(this).removeClass("hoverRow");
				$(this).addClass("evenRow");
			}
		});
	}
	function showRoster(areaId) {
		var srclen = $('#'+areaId).attr('id').length-3;
		var rosterId =  $('#'+areaId).attr('id').substring(0, srclen) ;
		if($('#'+rosterId).length > 0) {
			$('#'+rosterId).siblings().fadeOut(function() {
				$('#'+rosterId).fadeIn();			
			});
		} 
	}