$(document).ready(function(){
	$('#tab-control>li:first').addClass('current');
	$('#tabcontrol>li:first').addClass('first');	// default to first tab
	
	var imgsrc	= $('li.first img').attr('src');
	$('li.first img').attr('src', imgsrc.replace(/_off/i, '_on')); // replace image with ON image
	
	$('#tabs').removeClass('hidden');	// show the tab control bar
	$('div.tabcontent').hide();		// hide all tab content areas
	$('#'+$('li.current').attr('id')+'-content').show();	// show the current tab
	
	// Handle tab click events
	$('#tab-control>li').click(function(){
		var imgsrc	= $('#tab-control>li.current img').attr('src');
		$('#tab-control>li.current img').attr('src', imgsrc.replace(/_on/i, '_off'));
		
		$('#tab-control>li').removeClass('current');
		$(this).addClass('current');
		
		$('#'+this.id+' img').attr('src', $('#'+this.id+' img').attr('src').replace(/_off/i, '_on'));
		// Focus tab content
		$('div.tabcontent').hide();			// hide all tabs
		$('#'+this.id+'-content').show();	// show selected tab content
	});

});