/**
 * navigation always visible
 *
 * adapted from »Scroll/Follow Sidebar, Multiple Techniques«
 * http://css-tricks.com/scrollfollow-sidebar/
 */

$(function() {

	var $weather    = $("#weather");
    var $navigation = $("#menu"),
    $window         = $(window),
    offset          = $navigation.offset(),
    topPadding      = 0;

    $window.scroll(function() {
        if ($window.scrollTop() > 280 ) {  //offset.top - topPadding
            $navigation.css({'position' : 'fixed', 'top' : topPadding});
            $weather.css({'position' : 'fixed', 'top' : 35 + $navigation.height()});
        } else {
            $navigation.css({'position' : 'static', 'top' : 0});
            $weather.css({'position' : 'static', 'top' : 0});
        }
    });
});
