$(function()
{
	
	$("table").each(function(){
			$(this).find("tr").css({ 'background-color' : "#fff" })
				 			 
				 .filter(":even").css({ 'background-color' : "#DEECF5" })
				 
				 .filter(":first").css({"background-color" : "#A8CDE6" , "text-transform" : "uppercase" })
				 
				 .end().end().each(function()
				 {
					$(this).find("td:first").css("font-weight", "bold");
				 });
				 
	})
	
	var box_height = hr_height = $("#box .hr").height();
	var gb_height = $("#box .gb").height();
	var d_height =  $("#box .d") .height();
	
	if(gb_height > box_height) box_height = gb_height;
	if(d_height > box_height) box_height = d_height;
	
	box_height += 150;
	
	//console.log($("#box").height());
	/*
	console.log(hr_height);
	console.log(d_height);
	console.log(gb_height);
	*/
	
	$("#box").css("height", box_height);
	$("#box .hr, #box .gb, #box .d").css("display", "none");
	
	var selected_menu = 'hr';
	var selected_menu = $("#box ul .selected").text();	
	var old_menu = '';
	
	$("#box ."+selected_menu).addClass("active").css("display", "block");

	$("#box ul li a").each(function()
	{
		$(this).click(function(event)
		{
			if($(this).is(".selected"))
			{
				return false;
			}
			else
			{
				
				//var h = $("#box").height();

				//$("#box").height(h);

				$("#box .selected").removeClass("selected");
				
				old_menu = selected_menu;
				selected_menu = $(this).text();
				
				$(this).addClass("selected");
								
				$("#box ."+old_menu).fadeOut(200, function()
				{
					//console.log($("#box").height())
					$("#box ." + selected_menu).fadeIn(200);
				});
								
				//$("#box").css("height", "auto");
				
				
				
				return false;
				
			} // emd elsee
			
			
		}) // e
		
	}) // end #box ul li a .each()
	
})