$(window).load(function() {
// On load animation
$('.bkgholder').css( {backgroundPosition: "-550px 50%"} );
$('.bkgholder').animate(
			{backgroundPosition:"(0 50%)"}, 
			{duration:1000});
			
$(".navigation, .movelogo").css( {display: "none"} );
$(".navigation, .movelogo").fadeIn(1500);

// Fade background on nav hover
$('.navigation a').click(function() {
    $('.bkgholder').fadeTo(700, 0.35, function() {
      // Animation complete.
    })
	});
	
// Flip nav on hover, thanks to Jonathan Snook at http://snook.ca		
$('ul.navbig li a')
	.css( {backgroundPosition: "0px -30px"} )
	.mouseover(function(){
		$(this).stop().animate(
			{backgroundPosition:"(0 0)"}, 
			{duration:300})
		})
	.mouseout(function(){
		$(this).stop().animate(
			{backgroundPosition:"(0 -30px)"}, 
			{duration:300})
		})
			
 $('ul.navsmall li a')
	.css( {backgroundPosition: "0px -20px"} )
	.mouseover(function(){
		$(this).stop().animate(
			{backgroundPosition:"(0 4px)"}, 
			{duration:300})
		})
	.mouseout(function(){
		$(this).stop().animate(
			{backgroundPosition:"(0 -20px)"}, 
			{duration:300})
		})

// Reveal and hide divs for navigation, thanks to Soh Tanaka at http://www.sohtanaka.com
$(".first li").click(function() {
	$('.tab-content').css( {left: "-520px", display: "none"} ); //Hide all tab content
	$(".first li").removeClass("active"); //Remove any "active" class
	$(this).addClass("active"); //Add "active" class to selected tab

	var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
	$(activeTab).css( {display: "block"} ); //Show all tab content
	$(activeTab).animate({
		"left": "0"
   		},1000, 'easeOutExpo'); //Fade in the active ID content
	});

// Refresh screen
$(".movelogo").click(function() {
	$('.tab-content').css( {left: "-520px", display: "none"} ); //Hide all tab content
	$(".first li").removeClass("active"); //Remove any "active" class
	$('.bkgholder').fadeTo(700, 1, function() {
      // Animation complete.
    })
	});
	
 });
