/**
 * Globally needed methods in here ONLY!
 */
var wub = wub || {};

$(document).ready(function(){
    wub.common.initSearchFields();
});

wub.common = {
    SEARCH_FIELD_CLASS: "search-field",
	/**
	 * inits the search-field clearer
	 */
    initSearchFields: function(){
        var searchFields = $('input.' + this.SEARCH_FIELD_CLASS);
        
        searchFields.each(function(index, el){
            var current = searchFields.eq(index);
            var defaultText = el.defaultValue;
            current.focus(function(){
                if (el.value == defaultText) 
                    el.value = "";
            });
            current.blur(function(){
                if (el.value == "") 
                    el.value = defaultText;
            });
            
        });
        
    }
};

