(function($){
    $.fn.fadeform = function(options){
        
        var options = jQuery.extend({}, options);
        
        $this = $(this);
        init($this);
        //console.log('--- fadeform ---');
        function init(jObj) {
            //console.log(jObj);
            
            jObj.fadeTo("fast", 0.5);
            
            // создать div
            var offset = jObj.offset();
            var left = offset.left;
            var top = offset.top;
            //console.log(offset);
            var height = jObj.height();
            var width = jObj.width();
            $('html').append('<div class="fader" style="height:'+height+'px; width:'+width+'px; top:'+top+'px; left:'+left+'px;"></div>');
            
            // положить сверху
            // задисейблить submit
            // добавить куртилку
        }
    };
    
    $.fn.fadeform_clear = function(interval_name){
        clearInterval(window[interval_name]);
        $(this).fadeTo("fast", 1);
        $('.fader').remove();
    };
    
})(jQuery);
