$(document).ready(function() {
	
	$('#features-content').hide();
	$('#benefits').addClass('current');
	$('.tab-content').addClass('position');
	$('.nav-button').attr('href' , '#');
	
	$('.nav-button').click(function(){
		
		// get the id name of the click control to help select the corresponding content
		var name = $(this).attr('id');
		
		// check if corresponding content is hidden first before switching content
		if ($('#' + name +'-content').is(':hidden')) {
		
			// switch the button state
			$('.nav-button').removeClass('current');
			$(this).addClass('current');
			
			// crossfade content
			$('.tab-content').hide();
			$('#' + name + '-content').show(); 
		}
		
		return(false);
	
	});

});