(function($) {
    $.fn.iedfscreen = function(options) {
		// valori di default
        var config = {
            'image': '/images/logo.png',
            'fade': 3000
        };
        // codice del plugin
		 
        if (options) $.extend(config, options);
		
		
		return this.each(function() {
			var obj = $(this);
			obj.html('<div id="iedfscreen_loader"></div>');
			
			var image1 = $("<img />").attr("style", "z-index:-999; min-height:100%; min-width:1024px; width:100%; height:auto; position:fixed; top:0; left:0;").attr("src", config.image).load(function() {
				//alert(config.image+" - "+image1+" - "+this);
				obj.fadeOut(50).empty().fadeIn(0);
				obj.append(this).hide().fadeIn(config.fade);
				
			});
		});  
    }
})(jQuery);
