(function($) {
    $.fn.placeholder = function() {
        if (!('placeholder' in document.createElement('input'))) {
            this.each(function() {
                var placeholder = $(this).attr('placeholder');
                
                $(this).val(placeholder).focus(function() {
                    if ($(this).val() == placeholder) {
                        $(this).val('');
                    }
                }).blur(function() {
                    if ($(this).val() == '') {
                        $(this).val(placeholder);
                    }
                });
            });
        }
    }
})(jQuery);
