/*
 *  Allows to predefine a value for an input, textarea element compatible with val() function.
 *  Permite predefinir el value de un input, textarea o elemento compatible con la funcion val().
 *
 *  Ejemplo/Example: $(input).valpreset("String"); $(textarea).valpreset("String2");
 *	 
 *  By Emiliano Mateu - mateuemiliano@gmail.com - 03/04/2009
 **/
(function($){
    $.fn.valpreset = function(string)
    {
        this.each(function()
        {
            ($(this).val() === "") ? $(this).val(string) : null;
            $(this).focus(function() {($(this).val() === string) ? $(this).val("") : null;});
            $(this).blur(function()	 {($(this).val() === "") ? $(this).val(string) : null;});
        });
    }
})(jQuery);
