	///////////////////////////////
	// Timer for auto transition
	var secs
	var timerID = null
	var timerRunning = false
	var delay = 1000
	
	function InitializeTimer()
	{
		// Set the length of the timer, in seconds
		secs = 10
		StopTheClock()
		StartTheTimer()
	}
	
	function StopTheClock()
	{
		if(timerRunning)
			clearTimeout(timerID)
		timerRunning = false
	}
	
	function StartTheTimer()
	{
		if (secs==0)
		{
			StopTheClock()
			// Here's where you put something useful that's
			// supposed to happen after the allotted time.
			// For example, you could display a message:
			var CurrentTab = $('.Selected').attr('id');
			$('.Selected').removeClass('Selected');
			if (CurrentTab == "Tab1") {
				$('#Tab2').addClass('Selected');
				$('.View').hide();
				$('#View2').fadeIn('slow');
				InitializeTimer();
			} else if (CurrentTab == "Tab2") {
				$('#Tab3').addClass('Selected');
				$('.View').hide();
				$('#View3').fadeIn('slow');
				InitializeTimer();
			} else if (CurrentTab == "Tab3") {
				$('#Tab1').addClass('Selected');
				$('.View').hide();
				$('#View1').fadeIn('slow');
				InitializeTimer();
			} else {
				InitializeTimer();
			}
			
		}
		else
		{
			//self.status = secs
			secs = secs - 1
			timerRunning = true
			timerID = self.setTimeout("StartTheTimer()", delay)
		}
	}
		
	



$(document).ready(function() {
	
	// Set default view
	$('.View').hide();
	$('#View1').show();
	$('#Tab1').addClass('Selected');
	
	//Start timer
	InitializeTimer();
	
	
	////////////////////////////////////////////
	// When a tab is clicked, show its corresponding .View and hide all other .Views
	$('.Tab').click(function() {
		
		// Remove .Selected class from tabs, then add it to the newly clicked .Tab
		$('.Selected').removeClass('Selected');
		$(this).addClass('Selected');
		
		StopTheClock();
		
		// Sore the id of the clicked .Tab
		var SelectedTab = $(this).attr('id');
		var SelectedTabNumber = SelectedTab.substr(3,1);
		
		// Hide all .Views, then show the selected .View
		$('.View').hide();
		$('#View'+SelectedTabNumber).fadeIn('slow');
		
	});
	
		
});


