$(document).ready(function() {

    $('.clear_on_focus').focus(function() {
        if ($(this).val() === $(this).attr('title'))    {
            $(this).val('');
        }
    }).blur(function() {
        if ($(this).val() === '')    {
            $(this).val($(this).attr('title'));
        }
    });
    
    $("#loading").ajaxStart(function() {
        $(this).show();
    }).ajaxStop(function() {
        $(this).hide();
    }); 
    
    (function($){  
        $.fn.block = function(options) {  
            var defaults = {  
                'background-color' : 'transparent',  
                'z-index': 10  
            };
            var options = $.extend(defaults, options);            
            
            return this.each(function() {
                div = $('<div></div>').css( options );
                div.attr( 'class' , 'jqp-block-elem' );
                e = $(this);
                pos = e.position();
                w = e.outerWidth();
                h = e.outerHeight();
                positioning = {
                    'position' : 'absolute',
                    'top' : pos.top, 
                    'left' : pos.left, 
                    'height' : h+'px',
                    'width' : w+'px'
                };
                div.css( positioning );
                e.append( div );
            });  
        };  
    })(jQuery);
    
});
