$(document).ready(function()
{
	$('#mid_section_div div').hide(); // Hide all divs
	$('#mid_section_div div:first').show(); // Show the first div
	$('#basictab_ul ul li a:first').addClass('current_first'); // Set the class of the first link to active
	$('#basictab_ul ul li a').click(function()
	{ 
		$('#basictab_ul ul li a').removeClass('current_first'); // Remove active class from all links
		$(this).parent().addClass('current'); //Set clicked link class to active
		var currentTab = $(this).attr('href'); // Set variable currentTab to value of href attribute of clicked link
		var exploded = currentTab.split('#sc');
		for(i=1;i<=5;i++)
		{
			if(exploded[1] == i)
			{
				if(i == 1)
				{
					$('#sc_'+exploded[1]).addClass('current_first'); // Add active class from all links
				}
				else
				{
					$('#sc_'+i).addClass('current'); // Add active class from all links
				}	
			}
			else
			{
				$('#sc_'+i).removeClass('current'); // Remove active class from all links
			}
		}		
		$(currentTab).show();
		$('#mid_section_div div').hide(); // Hide all divs
		$(currentTab).show(); // Show div with id equal to variable currentTab
		return false;
	});
});