Javascript tab help (Go to last selected tab upon refresh)

IN PROGRESS
Bids
9
Avg Bid (USD)
$30
Project Budget (USD)
$30 - $250

Project Description:
I decided to find some javascript code online that allowed me to create "tabs" into different divs.

The problem is that when I refresh the page, it automatically goes back to the first tab. I've tried all different variations of the code, but not coming with the answer. I also tried setting the "currentTab" as the last clicked, but I think I'm just not using correct syntax because currentTab doesn't get created until the tab is clicked.

Anyway, here's the code:

<script type="text/javascript">
$(document).ready(function(){
$('#user_content .maintab').hide(); // Hide all divs that are 'hideable'
$('#user_content #top').show();
$('#user_content div:first').show(); // Show the first div
$('#user_content ul li:first').addClass('first'); // Set the class of the first link to active

$('#user_content ul li a').click(

function(){ // When any link is clicked
$('#user_content ul li').removeClass('active'); // Remove active class from all links
$('#user_content ul li').removeClass('first');

//alert($(this).attr('href'));
if($(this).attr('href')=='#user_profile_overview'){
$(this).parent().addClass('first');
}
else{
$(this).parent().addClass('active'); // Set clicked link class to active
}

var currentTab = $(this).attr('href'); // Set variable currentTab to value of href attribute of clicked link

//alert(currentTab);

$('#user_content .maintab').hide(); // Hide all divs that are 'hideable'
$('#user_content #top').show();
$(currentTab).show(); // Show div with id equal to variable currentTab

return false;
});
});
</script>


If you can help me fix this small issue that'd be great. I will not accept any bids that are more than the minimum amount. This job is too small to give anymore than that. Thanks

Skills required:
AJAX, Javascript, jQuery / Prototype
About the employer:
Verified
Public Clarification Board
Bids are hidden by the project creator. Log in as the employer to view bids or to bid on this project.
You will not be able to bid on this project if you are not qualified in one of the job categories. To see your qualifications click here.


$ 30
in 1 days
$ 30
in 1 days
$ 30
in 1 days
$ 30
in 0 days
Hire Tomcat253
$ 30
in 1 days
Hire sanjuintelligo
$ 30
in 0 days
$ 30
in 0 days
$ 30
in 1 days
$ 30
in 0 days