

// JavaScript Document

/*
 * Tab panel script 
 * powered by jQuery (http://www.jquery.com)
 * 
 * written by Stefan Isfeld
 * 
 *
 */
 
$(document).ready(function(){
	/* CONFIG */
	
	$( "#tabContainer2 #tabContent0" ).css( {"display":"block"} );
	$( "#listTab2 .tabItem").css( {"background":"url(/pics/sports/sport_basic/result_tab_dn.jpg) no-repeat"} );
	$( "#listTab2 .tabItem a").css( {"color":"white" }  );
	$( "#listTab2 .tabItem:first").css( {"background":"url(/pics/sports/sport_basic/result_tab_up.jpg) no-repeat"} );
	$( "#listTab2 .tabItem:first a").css( {"color":"black" } );
	/* CONFIG */
	
	// Switch content when a tab is clickrd
	$("li.tabItem").click(function(){
		// Get the tab that was clicked
		tabId = $(this).attr("id");
		divElement = eval("document.getElementById('"+tabId+"').parentNode");
		filter = "#" + $(divElement).attr("id") +" ." + $(this).attr("class");
		
		// Highlight the clicked tab
		$(filter).css( {"background":"url(/pics/sports/sport_basic/result_tab_dn.jpg) no-repeat"} );
		$(this).css( {"background":"url(/pics/sports/sport_basic/result_tab_up.jpg) no-repeat"} );
		bGround = 'url(/pics/sports/sport_basic/result_tab_up.jpg) no-repeat';
		
		$( "#listTab2 .tabItem a").css( {"color":"white" }  );
		filter = "#" + $(this).attr("id") + " a";
		$( filter).css( {"color":"black" }  );
		
		// Get the class name of the content container
		divElement = eval("document.getElementById('tabContent"+tabId+"').parentNode");
		filter = "#" + $(divElement).attr("id") + " div.tabCont";

		// Turn on the matching content
		$( filter ).css( {"display":"none"} );
		$( "#tabContent"  + tabId ).css( {"display":"block"} );
	});	
	
	//**********************************************
	var bGround;
	$(".tabItem").mouseover(function() {
		bGround = $(this).css("background");
		whichId = "#" + $(this).attr("id") + " a";
		//alert(whichId);
		$(this).css( {"background":"url(/pics/sports/sport_basic/result_tab_ov.jpg) no-repeat" } );
		$(whichId).css( {"color":"black" } );

		}).mouseout(function() {
			if ("url(/pics/sports/sport_basic/result_tab_up.jpg) no-repeat" ==  bGround ) {
				$(this).css(  {"background":"url(/pics/sports/sport_basic/result_tab_up.jpg) no-repeat"} );
				$(whichId).css( {"color":"black" } );
			} else {
				$(this).css(  {"background":"url(/pics/sports/sport_basic/result_tab_dn.jpg) no-repeat"} );
				$(whichId).css( {"color":"white" } );
			}
			});	
 
});
