$(document).ready(function(){
	counter = 0;	
	$("#tabbed h3.section-header").each(function(){					  
							  
		prevW = $(this).prev().prev().width();					  
		
		counter += prevW;
		
		$(this).css("left",counter);
		counter+= 23;
	});
	
    $("#tabbed h3.section-header").click(function(){
						
		//alert("I was clicked!");
		var current_item = $(this).text();
		changeState(current_item);
		
											 
	});
		


	function changeState(ci){
		
		$("#tabbed h3.section-header").each(function(){
																	
			if($(this).text() == ci){

				if(!$(this).hasClass("active")){
					
					$(this).addClass("active");
					$(this).next().addClass("active");
				}
				
			} else {
				
				if($(this).hasClass("active")){
					
					$(this).removeClass("active");
					$(this).next().removeClass("active");
					  
				}
			}
					
		}); 
	
	}

});
