$(document).ready(function() {
	$("#nav li a").hover(
		function () {
			$(this).animate({ color: "#ffff00" }, "slow")
		}, 
		function () {
			$(this).animate({ color: "#cc9999" }, "fast")
		}
	);
	$("#subnav li a").hover(
		function () {
			$(this).animate({ color: "#ffff00" }, "slow")
		}, 
		function () {
			$(this).animate({ color: "#cc9999" }, "fast")
		}
	);
	// Gallery
	$('#goto1').click(function() { 
	    $('#featured').cycle(0);
		for (i=1;i<=7;i++)
		{
			document.getElementById("ccontainer" + i).style.display = "none";
		}
		document.getElementById("tab").style.display = "block";
		document.getElementById("ccontainer1").style.display = "block";
	    return false; 
	}); 
	$('#goto2').click(function() { 
		$('#featured').cycle(1);
		for (i=1;i<=7;i++)
		{
			document.getElementById("ccontainer" + i).style.display = "none";
		}
		//document.getElementById("ccontainer2").style.display = "block";
		document.getElementById("tab").style.display = "none";
		return false; 
	}); 
	$('#goto3').click(function() { 
		$('#featured').cycle(2);
		for (i=1;i<=7;i++)
		{
			document.getElementById("ccontainer" + i).style.display = "none";
		}
		document.getElementById("tab").style.display = "block";
		document.getElementById("ccontainer3").style.display = "block";
		return false; 
	}); 
	$('#goto4').click(function() { 
		$('#featured').cycle(3);
		for (i=1;i<=7;i++)
		{
			document.getElementById("ccontainer" + i).style.display = "none";
		}
		document.getElementById("tab").style.display = "block";
		document.getElementById("ccontainer4").style.display = "block";
		return false; 
	}); 
	$('#goto5').click(function() { 
		$('#featured').cycle(4);
		for (i=1;i<=7;i++)
		{
			document.getElementById("ccontainer" + i).style.display = "none";
		}
		document.getElementById("tab").style.display = "block";
		document.getElementById("ccontainer5").style.display = "block";
		return false; 
	}); 
	$('#goto6').click(function() { 
		$('#featured').cycle(5);
		for (i=1;i<=7;i++)
		{
			document.getElementById("ccontainer" + i).style.display = "none";
		}
		document.getElementById("tab").style.display = "block";
		document.getElementById("ccontainer6").style.display = "block";
		return false; 
	}); 
	$('#goto7').click(function() { 
		$('#featured').cycle(6);
		for (i=1;i<=7;i++)
		{
			document.getElementById("ccontainer" + i).style.display = "none";
		}
		document.getElementById("tab").style.display = "block";
		document.getElementById("ccontainer7").style.display = "block";
		return false; 
	}); 
				
	// Up/Down Links
	$("#up").hover(
		function () {
			$('#innercontent').stop();
			$("#innercontent").animate({"bottom": "0"}, 1000);
			}, 
		function () {
			$('#innercontent').stop();
	});
	$("#down").hover(
		function () {
			$('#innercontent').stop();
			$("#innercontent").animate({"top": "0"}, 1000);
		}, 
		function () {
			$('#innercontent').stop();
	});	

	// Tabs
	$(".accordiontab").hover(
		function () {
			$(this).stop();
			$(this).animate({"left": "290px"}, "slow");
		}, 
		function () {
			$(this).stop();
			$(this).animate({"left": "865px"}, "slow");
	});	
			
	$("#tab").hover(
		function () {
			$('#tab').stop();
			$("#tab").animate({"left": "630px"}, "slow");
		}, 
		function () {
			$('#tab').stop();
			$("#tab").animate({"left": "865px"}, "slow");
	});	

	// Subnav
	var subnav = false;
	trigger = function fade() {
		if (subnav == false){$("#subnav").fadeOut("slow");}
	}
	$(".gtrigger").hover(
	  function () {
		subnav = true;
		$("#subnav").fadeIn("slow");
	  }, 
	  function () {
		subnav = false;
		setTimeout('trigger()', 200);
	  }
	);
	$("#subnav").hover(
	  function () {
		subnav = true;
	  }, 
	  function () {
		subnav = false;
		setTimeout('trigger()', 200);
	  }
	);

});