$(document).ready(function(){
	$('#tabs > div').hide();
	$('#tabs div:first').show();
	$('#tabs ul li:first').addClass('active');
	$('#tabs ul li a').click(function(){ 
		$('#tabs ul li').removeClass('active');
		$(this).parent().addClass('active'); 
		var currentTab = $(this).attr('href');	 
		$('#tabs > div').hide();
		$(currentTab).show();
		
		var tabsplit = currentTab.split("-")
		window.location = "#" + tabsplit[1]; 
		return false;
	});
	var hashedTab =  window.location.hash;
	hashedTab = hashedTab.split("#");
	hashedTab = "#tab-" + hashedTab[1];
	$('#tabs ul li a[href^="'+hashedTab+'"]').trigger('click');
});
