$(document).ready(function(){

  $('#sub_active').css("opacity","1");

  	//When page loads...
	$(".feedcontent").hide(); //Hide all content
	$("ul.feeds li:last").addClass("active").show(); //Activate first tab
	$(".feedcontent:last").show(); //Show first tab content

	//On Click Event
	$("ul.feeds li").click(function() {

		$("ul.feeds li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".feedcontent").hide(); //Hide all tab content

		var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active ID content
		return false;
	});

  $('.flickr img').css("opacity","0").load(
    function () { $(this).animate({opacity:1}); })
  ;
  
  $('.feed a img, .content a img').hover(
    function () { $(this).stop().animate({opacity:0.7},1); }, 
    function () { $(this).stop().animate({opacity:1},400); }
  );
  
  $('#featured a img').hover(
    function () { $(this).animate({opacity:0.8},200); }, 
    function () { $(this).animate({opacity:1},200); }
  );
  
  $('#main_nav li a').hover(
    function () { $(this).stop().animate({opacity:0.7},100); },
    function () { $(this).stop().animate({opacity:0},400); }
  );
    
  $('#main_nav li').hover(
    function () { $(this).stop().animate({backgroundPosition:'0px 26px'},100); },
    function () { $(this).stop().animate({backgroundPosition:'-9px 26px'},400); }
  );
  
  $('.sub_link').hover(
    function () { $(this).stop().animate({opacity:0.6,paddingLeft:'40px'},20); },
    function () { $(this).stop().animate({opacity:0.8,paddingLeft:'30px'},400); }
  );
  
  $('#sub_active').hover(
    function () { $(this).stop().animate({opacity:1},100); },
    function () { $(this).stop().animate({opacity:1},200); }
  );
  
  $('.article').hover(
    function () { $(this).stop().animate({opacity:0.3},100); },
    function () { $(this).stop().animate({opacity:0},400); }
  );

  $('.ft_nav').hover(
  	function() { $(this).animate({top: "-="+"18px", opacity:'0.95'}, 150); },
    function() { $(this).animate({top: "18px", opacity:'1'}, 150);
  });

  $('.rounded').corners();
  
  $('#featured').cycle({timeout: 10000,speed: 1000,prev:'#prev',next:'#next'});

});