$(document).ready(function() {
    var $header = $("#mainSearch"),
        $clone = $header.before($header.clone().addClass("clone"));

    $(window).on("scroll", function() {
        var fromTop = $("html,body").scrollTop();
        $clone.toggleClass("down", (fromTop > 400));
    });
});
@@ -1,8 +1,10 @@
+/*
 $(docume
@@ -22,24 +22,24 @@
 unction() %7B%0A
-
     var $hea
@@ -230,21 +230,24 @@
        $
-clone
+(window)
 .toggleC
@@ -288,8 +288,255 @@
  %7D);%0A%7D);
+*/%0A%0A%0A$(document).ready(function() %7B%0A%0A%09var $search = $(%22mainSearch%22);%0A%0A%09$(window).on(%22scroll%22, function() %7B%0A%0A%09%09var fromTop = $(%22html, body%22).scrollTop();%0A%09%09var pos = $search.position();%0A%09%09$search.toggleClass(%22down%22, (fromTop %3E pos.top));%0A%0A%09%7D);%0A%0A%7D);

test searchbar