(function ($) {

  $(window).load(function() {

      $(".animate-me .content").each(function() {
        $(this).show('slide', {direction: 'up'}, 500, function(){$(this).parent().removeClass("animate-me");});
      });

      $(window).scroll($.throttle(250, fadeScroll));
      fadeScroll();

  });

  function fadeScroll() {
    var top = $(window).scrollTop();
    var docY = $(window).height() + top - 30;
    var hc = $('#header-collapsed');
    var hct = hc.css("top");

    if (top > 90 && hct === "-50px") {
      hc.animate({top: 0}, 250, "swing");
    } else if (top < 90 && hct !== "-50px") {
      hc.animate({top: -50}, 250, "swing");
    }

    $('.fadein').each(function() {
      if ($(this).offset().top < docY) {
        $(this).fadeTo(1000, 1);
        $(this).removeClass('fadein');
      }
    });
  }
} (jQuery));
;
/*
 * jQuery throttle / debounce - v1.1 - 3/7/2010
 * http://benalman.com/projects/jquery-throttle-debounce-plugin/
 * 
 * Copyright (c) 2010 "Cowboy" Ben Alman
 * Dual licensed under the MIT and GPL licenses.
 * http://benalman.com/about/license/
 */
(function(b,c){var $=b.jQuery||b.Cowboy||(b.Cowboy={}),a;$.throttle=a=function(e,f,j,i){var h,d=0;if(typeof f!=="boolean"){i=j;j=f;f=c}function g(){var o=this,m=+new Date()-d,n=arguments;function l(){d=+new Date();j.apply(o,n)}function k(){h=c}if(i&&!h){l()}h&&clearTimeout(h);if(i===c&&m>e){l()}else{if(f!==true){h=setTimeout(i?k:l,i===c?e-m:e)}}}if($.guid){g.guid=j.guid=j.guid||$.guid++}return g};$.debounce=function(d,e,f){return f===c?a(d,e,false):a(d,f,e!==false)}})(this);;

