(function ($) {
    function fix_search_label() {
        // Set the search label inside the input field
        var $label = $('#search label'),
            $input = $('#search input[name=q]'),
            savedLabel = $label.text();
        $label.remove();
        $input.addClass('caps').val(savedLabel);
        $input.focus(function () {
            if ($(this).val() === savedLabel) {
                $(this).val('').removeClass('caps');
            }
        });
        $input.blur(function () {
            if ($(this).val() === '') {
                $(this).addClass('caps').val(savedLabel);
            }
        });
    }
    $(function () {
        fix_search_label();
    });
})(jQuery);

