var slideSpeed = 200;

$(document).ready(function() {
		
	$("#whatsNew").click(didClickWhatsNew);
	$("#notifyPro").click(didClickNotifyPro);
	$("#accountTypes").click(didClickAccountTypes);
	$("#preview").click(didClickPreview);
	$("#notifications").click(didClickNotifications);
	$("#markRead").click(didClickMarkRead);
	$("#sendReply").click(didClickSendReply);
	
	$(".feature").click(didClickFeature);
	
});

function purchaseNotify()
{
	$("#purchaseNotify").submit();
}

function didClickFeature(event)
{
	$(".selectedFeature").removeClass("selectedBackground");
	$(".selectedFeature").removeClass("selectedFeature");
	
	
	$(this).removeClass("featureHover");
	
	$(this).addClass("selectedBackground");
	$(this).addClass("selectedFeature");
}

function clickedPurchaseNotify()
{
	if ($(".purchaseInfo").hasClass("hidden"))
	{
		$(".purchaseInfo").slideDown(slideSpeed * speedMultiplier, function() { $(".purchaseInfo").removeClass("hidden"); });
	}
	else
	{
		$(".purchaseInfo").slideUp(slideSpeed * speedMultiplier, function() { $(".purchaseInfo").addClass("hidden"); });
	}
}

function didClickWhatsNew(event)
{
	genericFadeTo("notifyWhatsNew");
}

function didClickNotifyPro(event)
{
	genericFadeTo("notifyPro");
}

function didClickAccountTypes(event)
{
	genericFadeTo("notifyAccountTypes");
}

function didClickNotifications(event)
{
	genericFadeTo("notifyNotifications");
}

function didClickPreview(event)
{
	genericFadeTo("notifyPreview");
}

function didClickMarkRead(event)
{
	genericFadeTo("notifyMarkRead");
}

function didClickSendReply(event)
{
	genericFadeTo("notifySendReply");
}

function genericFadeTo(className)
{	
	$(".currentlyDisplayedFeature").fadeOut(0);
	$(".currentlyDisplayedFeature").removeClass("currentlyDisplayedFeature");
	
	$("." + className).fadeIn(0);
	$("." + className).addClass("currentlyDisplayedFeature");
}
