﻿
String.prototype.trim = function() {
    return this.replace(/^\s*/, "").replace(/\s*$/, "");
}

$(document).ready(function() {

    var searchFieldsChanged = false;
    var searchDefaultText = '';
    var searchFields = $(".search-query");

    searchFields.focus(function() {
        if (!searchFieldsChanged) {
            searchDefaultText = $(this).attr('value');
            searchFieldsChanged = true;
        }

        if ($(this).attr('value') == searchDefaultText) {
            $(this).attr('value', '');
        }
    });

    searchFields.blur(function() {
        if ($(this).attr('value').trim() == '') {
            // $(this).attr('value', searchDefaultText);
        }
    });

});
