
// Handles switching the active tab image and showing the right content for the selected tab 
$(document).ready(function() {

	// Initial setting
	ShowNews();
	//ShowTweets();
	
	// Handling the News tab click event
	$('#tab-news').click(function() {
		ShowNews();
	});		 	

	// Handling the Tweets tab click event
	$('#tab-tweets').click(function() {
		ShowTweets();
	});
});

function ShowNews() {
	$('#tabbar').addClass('tabbar-news');
	$('#tabbar').removeClass('tabbar-tweets');
	$('#tab-news-link').addClass('active');
	$('#tab-news-link').removeClass('inactive');
	$('#tab-news-link').addClass('active');
	$('#tab-tweets-link').removeClass('active');
	$('#tab-tweets-link').addClass('inactive');
	$('#tab-tweets-content').hide();
	$('#tab-news-content').show();	
}

function ShowTweets() {
	$('#tabbar').removeClass('tabbar-news');
	$('#tabbar').addClass('tabbar-tweets');
	$('#tab-news-link').removeClass('active');
	$('#tab-news-link').addClass('inactive');
	$('#tab-tweets-link').removeClass('inactive');
	$('#tab-tweets-link').addClass('active');
	$('#tab-tweets-content').show();
	$('#tab-news-content').hide();
}
