$(document).ready(function(){

	$('#tabs div.tab-content').hide();
	
	
	var myFile = document.location.toString();
	
	if (myFile.match('#')) {
  		// click the navigation item corresponding to the anchor
  		var myAnchor = '#' + myFile.split('#')[1];
		$('#tabs ul.tab-strip li.active').removeClass('active');
  		$('#tabs ul.tab-strip li a[href="' + myAnchor + '"]').parent().addClass('active');
	} else {
  		// click the first navigation item
  		$('#tabs ul.tab-strip li:first').addClass('active');
	}
	
    var currentTab = $('#tabs ul.tab-strip li.active a');
    if (currentTab.length > 0) {
        var currentTabHref = currentTab.attr('href');
        $(currentTabHref).show();
    }
	
	$('#tabs ul.tab-strip li a').click(function(){ 
												
		  $('#tabs ul.tab-strip li').removeClass('active');
		  $(this).parent().addClass('active'); 
		  
		  var currentTab = $(this).attr('href'); 
		  
		  $('#tabs div.tab-content').hide();
		  $(currentTab).show();
		  
		  return false;
	  
	});

});
