// JavaScript Document

//Controls the story swapping on the homepage and category page
function swapStory(story)
{
	
	//hides all stories
	$("#story1").hide();
	$("#story2").hide();
	$("#story3").hide();
	
	//removes selected class from tabs
	$("#tab1").removeClass("selected");
	$("#tab2").removeClass("selected");
	$("#tab3").removeClass("selected");
	
	//assigns selected class to tab and shows story
	if (story == "3")
		$("#tab" + story).addClass("selected last");
	else
		$("#tab" + story).addClass("selected");
		
	$("#story" + story).css("display" , "inline");
	
}

//Controls the Login Popup from the header
function login()
{
	if ($("#loginPopup").css("display") == "block")	
		$("#loginPopup").fadeOut();	
	else
	{
		$("#loginPopup").fadeIn();
		$("#loginPopup #username").focus();
	}
}