

(function($){
$(function() {
	$('body').addClass('js');
	$('.jcarousel-next,.jcarousel-prev').show();
    $("#carousel").jCarouselLite({
        btnNext: ".jcarousel-next",
        btnPrev: ".jcarousel-prev",
        //auto: 5000,
        speed: 1000,
        easing:'easeInOutCubic'
    });
});
})(jQuery);

(function($){

$(function() {
	//$("#politics, #action, #accountability").hide();

    $("#tab-nav li a").click(function() {

        // Figure out current list via CSS class
        var curList = $("#tab-nav li a.current").attr("href");

        // List moving to
        var $newList = $(this);

        // Set outer wrapper height to height of current inner list
        var curListHeight = $("#all-tabs-wrap").height();
        $("#all-tabs-wrap").height(curListHeight);

        // Remove highlighting - Add to just-clicked tab
        $("#tab-nav li a").removeClass("current");
        $newList.addClass("current");

        // Figure out ID of new list
        var listID = $newList.attr("href");
        var listRel = $newList.attr("rel");

        if (listID != curList) {

            // Fade out current list
            $(curList).fadeOut(300, function() {
				
                // Fade in new list on callback
                $(listID).fadeIn();
				
				//Adjust outer wrapper to fit new list snuggly
				var newHeight = $(listID).height();
				$("#all-tabs-wrap").animate({
				    height: newHeight
				});
				
				if ( $(listID).children(".preloader").length > 0 ) {
					$.get("/fronttab?tab="+listRel,function(msg){
						$(listID).html(msg);
						//Adjust outer wrapper to fit new list snuggly
						var newHeight = $(listID).height();
						$("#all-tabs-wrap").animate({
						    height: newHeight
						});
					});
				}

            });

        }        

        // Don't behave like a regular link
        return false;
    });

});
})(jQuery);