function headerInit() {
    var searchInput = $('#searchInput');

    $('#searchForm').submit(function(e) {
        if (searchInput.val() == (_('COMMON_SEARCH') + '...') || $.trim(searchInput.val()) == '') {
            alert(_('HEADER_SEARCH_EMPTY'));
            searchInput.focus();
            e.preventDefault();
            return;
        }
        $(this).attr('action', $(this).attr('action') + $.trim(searchInput.val()));
    });

    searchInput.focus(function() {
        if ($(this).val() == _('COMMON_SEARCH') + '...') {
            $(this).val('');
        }
    });

    searchInput.blur(function() {
        if ($.trim($(this).val()) == '')
            $(this).val(_('COMMON_SEARCH') + '...');
    });
}

function handleInputClick(obj) {
    var o = $('#' + obj);
    o.click(function(e) {
        e.preventDefault();
        o.val('');
        return;
    });
}

$(document).ready(headerInit);
