// JavaScript Document

/*
 * Tab panel script 
 * powered by jQuery (http://www.jquery.com)
 * 
 * written by Stefan Isfeld
 * 
 *
 */
 
$(document).ready(function(){
	/* CONFIG */
	$( "#tabContainer #tabContent0" ).css( {"display":"block"} );
	$( "#listTab .tabItem:first").css( {"background":"#FAEC12"} );
	
	/* 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":"#FF9C00"} );
		$(this).css( {"background":"#FAEC12"} );
		color = "#FAEC12";
		
		// 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 color;
	$(".tabItem").mouseover(function() {
		//$(this).attr('src','images/mvp_ov.gif');
		color = $(this).css("background-color");
		$(this).css( {"background":"#D6E904"} );
		//alert(color);

		}).mouseout(function() {
			//$(this).attr('src','images/mvp_up.gif');
			$(this).css( {"background": color } );
			//alert(color);
			});	

   
});