function fixedHeight() {
  var docHeight = $(window).height();
  if (docHeight > 650) {
    $("body").addClass("fixed");
  }
  else {
    $("body").removeClass("fixed");
  }
}

function hideOnScroll(e) {
  if ($("body").hasClass("fixed")) {
    $("#sub_wrapper").css("clip", "rect(" + $(window).scrollTop() + "px auto auto 0)");
  }
}

$(document).ready(function(){
  if (!($.browser.msie && parseInt($.browser.version) <= 6)) {
    fixedHeight();
    $(window).resize(fixedHeight);
    hideOnScroll();
    $(window).scroll(hideOnScroll);
  }
})
