// JavaScript Document
$clicked = $("#navigation #home-button");

$(document).ready(function(){
	$("#navigation li").click(function(){
		
		$clicked = $(this);
		
		if($clicked.css("opacity") != "1" && $clicked.is(":not(animated)"))
		{
			$clicked.animate({
				opacity: 2,
				borderWidth: 3
			}, 600 );
			
			var idToLoad = $clicked.attr("id").split('-');
			$("#content").find("div:visible").fadeOut("fast", function(){
				$(this).parent().find("#"+idToLoad[0]).fadeIn();
			})
		}
		
		$clicked.siblings().animate({
			opacity: 5,
			borderWidth: 1
		}, 600 );
		
	});
	
	$("#right-main li").click(function(){
		$clicked = $(this);

		if($clicked.attr("class") == "nav" && $clicked.is(":not(animated)"))
		{
			var idToLoad = $clicked.attr("id").split('-');
			$("#content").find("div:visible").fadeOut("fast", function(){
				$("#content").find("#"+idToLoad[0]).fadeIn();
			})
		}
	});
});

