jQuery(document).ready(function(){

		var tabHeights = jQuery('ul#tabs-list').height();
		var tab1 = jQuery('#tab-1').outerHeight();

		if(tab1 > tabHeights){
			jQuery('ul#tabs-list').height(tab1);
		}
				
		jQuery('#tabs div').hide(); // Hide all divs
		jQuery('#tabs div:first').show(); // Show the first div
		jQuery('#tabs div:first div').show();
		jQuery('#tabs-list li:first').addClass('active'); // Set the class of the first link to active
		
		jQuery('#tabs-list li a').click(function(){ //When any link is clicked
			
			jQuery('#tabs-list li').removeClass('active'); // Remove active class from all links
			jQuery(this).parent().addClass('active'); //Set clicked link class to active
			
			
			var currentTab = jQuery(this).attr('href'); // Set variable currentTab to value of href attribute of clicked link
			jQuery('#tabs div').hide(); // Hide all divs
			jQuery('#tabs div div').show();
			jQuery(currentTab).show(); // Show div with id equal to variable currentTab
			var currentHeight = jQuery(currentTab).outerHeight();
			
			if(currentHeight > tabHeights){
				jQuery('ul#tabs-list').height(currentHeight);
			} else {
				jQuery('ul#tabs-list').height(tabHeights);
			}
			
			return false;
		
			});
		});
