/*
  Simple jQuery plugin for managing default values on forms.
  Useful if you want to save space and not use labels.
  
  By: Tim Gieseking
*/

jQuery.fn.defaultvalues = function() {
    
    var txt = jQuery(this).find("input[type=text],textarea");
    
    txt.focus(function() {
        if ($(this).val() === $(this)[0].defaultValue)
        {
            $(this).select();
        }   
    }).blur(function() {
        if ($(this).val() === '')
        {
            $(this).val($(this)[0].defaultValue);
        }
    }).click(function() {
        $(this).trigger('focus');
    });

}