(function($){
    $.fn.extend({
        inputHint: function(options) {
        
            var defaults = {
                attr: {'id':'', 'name':''}
            };
             
            var options = $.extend(defaults, options);
         
            return this.each(function() {
                var o = options;
                var $field = $(this);

                $hint = $field.clone();
                
                $hint.attr(o.attr);
                $hint.css(o.css);
                
                $field.after($hint);
                $hint = $field.next();
                
                if ($field.val() == '') {
                    $hint.show();
                    $field.hide();
                }
                else {
                    $hint.hide();
                    $field.show();
                }
                
                $hint.bind('focus', function() {
                    $(this).hide();
                    $field.show();
                    $field.focus();
                });
                
                $(this).bind('blur', function() {
                    if($(this).val() == '') {
                        $(this).next().show();
                        $(this).hide();
                    }
                });
                
            });
        }
    });
})(jQuery);
