$(document).ready(function() {
	
	//	Set initial css positioning values for users who have JS disabled
	$('div.divItems').css('visibility', 'hidden');
	$('div.divItems').css('display', 'none');
		
	//	Declare some variables
	var	tabContainer	=	'#tabButtons';
	var selectedTab		=	'#tabButtons li.ui-tabs-selected';	
	var activeBG		=	{'background' : 'transparent url(images/mag_feat/mag_ActiveBG.png) top left no-repeat'};
	var	inactiveBG		=	{'background' : 'transparent url(images/mag_feat/mag_inactiveBG.jpg) top left repeat-y'};
	
	//	Begin the fun
	$(tabContainer).tabs({ selected: 0 });	
	//Start with the 1st tab	

	$(tabContainer).tabs('rotate', 5000, false);	
	//Rotate the tabs every 5 seconds or until the user makes a selection					

	$(tabContainer).bind('tabsselect', function(event, ui) {	
	//First minimize the open tab and reposition the number
		$(selectedTab).css('background-color', '#173456');
		$(selectedTab).css(inactiveBG);
														
	});
	
	$(tabContainer).bind('tabsshow', function(event, ui) {		
	//Open the target tab and display the hidden data
		$(selectedTab).css(activeBG);
	});
});