-(function () {
- $('#header').addClass('fixed');
- if ($('#header').css('position') === 'fixed') {
- $('.navigation').before($('.navigation').clone().addClass('spacer')).addClass('fixed');
- $('#outer > .right_bar, #outer > .left_bar').addClass('display');
- }
-})();
+(function ($) {
+
+ var $nav_float = $('#nav_flow').clone().attr('id','nav_float').appendTo('#outer');
+
+ var floating = false;
+
+ $(window).bind('load resize scroll',function () {
+ var header_height = $('#header').height();
+ var top = $(this).scrollTop();
+
+ if( top > header_height ){
+ if( !floating ){
+ $nav_float.show();
+ $('#nav_flow').css('visibility','hidden');
+ floating = true;
+ }
+ } else {
+ if( floating ){
+ $nav_float.hide();
+ $('#nav_flow').css('visibility','visible');
+ floating = false;
+ }
+ }
+ });
+
+ $('#outer > .right_bar, #outer > .left_bar').addClass('display');
+})(jQuery);