jQuery(window).load(function() { 
	var i = jQuery('#footer').height();

    footerHeight(i);
});

jQuery(document).ready(function() {

    var i = jQuery('#footer').height();

    footerHeight(i);



    jQuery(window).bind('resize', function() {

        footerHeight(i);

    });



    jQuery("div.reveal").hide();

    jQuery("a.reveal").click(function() {

        jQuery("div.reveal", jQuery(this).parent().parent()).slideToggle("slow");

        if (jQuery(this).hasClass("btn-up")) {

            jQuery(this).removeClass("btn-up").addClass("btn-down").html("<span><span>Show more</span></span>");

        } else {

            jQuery(this).removeClass("btn-down").addClass("btn-up").html("<span><span>Show less</span></span>");

        }

        return false;

    });





    jQuery("div.recent-campaign").hover(

        function() {

            jQuery("h3, p", jQuery(this)).removeClass("mid-blue").addClass("light-blue");

            jQuery("img", jQuery(this)).css("border-color", "#2da6cd");

        },

        function() {

            jQuery("h3, p", jQuery(this)).removeClass("light-blue").addClass("mid-blue");

            jQuery("img", jQuery(this)).css("border-color", "#0181ac");

        }

    ).click(function() {

        var href = jQuery("a.recent-campaign-link", jQuery(this)).attr("href");

        window.location = href;

    });





    if (jQuery("#video-carousel-content").length > 0) {



        jQuery("#video-carousel-content").jCarouselLite({

            visible: 1,

            scroll: 1,

            speed: 1900,

            btnNext: '#btn-video-next',

            btnPrev: '#btn-video-prev'

        });



    } // end.



    if (jQuery("#image-carousel-content").length > 0) {



        jQuery("#image-carousel-content").jCarouselLite({

            visible: 1,

            scroll: 1,

            speed: 1900,

            btnNext: '#btn-image-next',

            btnPrev: '#btn-image-prev'

        });



    } // end.



    if (jQuery("#audio-carousel-content").length > 0) {



        jQuery("#audio-carousel-content").jCarouselLite({

            visible: 1,

            scroll: 1,

            speed: 1900,

            btnNext: '#btn-audio-next',

            btnPrev: '#btn-audio-prev'

        });



    } // end.



    jQuery("div.tab-content").hide();

    jQuery("div.tab-content:first").show();

    jQuery("div.tab a").click(function() {

        var id = jQuery(this).parent().attr("id");

        var num = id.substr(id.length - 1, 1);

        jQuery("div.tab").removeClass("on");

        jQuery(this).parent().addClass("on");

        jQuery("div.tab-content").hide();

        jQuery("#tab-content-" + num).show();

        return false;

    });           

    

});





function footerHeight(i) {

	var h = jQuery(window).height()-jQuery('#footer').offset().top;

	if(h > i) {

		jQuery('#footer').height(h);

	} else {

		jQuery('#footer').height(i);

	}

}
