( function($) {
    $.fn.overlabel = function() {
        this.filter('label[for]').each( function() {
            var label = $( this );
            var id = label.attr( 'for' );
            var field = document.getElementById( id );
 
            if(!field) return;
 
            label.addClass('overlabel-apply');
 
            var hide_label = function() { label.css('display', 'none') };
            var show_label = function() { this.value || label.css('display', 'inherit') };
 
            $( field ).focus( hide_label ).blur( show_label ).each( show_label );
 
            return;
        } );
    };
} )(jQuery);