(function($){$.fn.really_preload_essential=function(options){var defaults={url_resource:'',skin:'black',call_back_function:'none',photo_width:'',photo_height:'',border:'none',border_color:'black',effects:'fade',slide_time:'1000'};var options=$.extend(defaults,options);return this.each(function(){$(this).empty();$(this).css({'height':options.photo_height+'px','width':options.photo_width+'px','text-align':'center'});var element=$(this);var counter=0;var script='';$('script').each(function(){if($(this).attr('src')!=null){var script_dir=$(this).attr('src').split('/');if(script_dir[script_dir.length-1]=='jquery.really_preload_essential.js'){for(i=0;i

loading content...

');$("#preloader").css({'margin-top':(options.photo_height/2)-($("#preloader").height()/2)+'px'});var image_object=new Array;var array_verifier=""+options.url_resource.constructor+"";if(array_verifier.indexOf('Array')!=-1){while(counter<=options.url_resource.length-1){image_object[counter]=new Image();image_object[counter].src=options.url_resource[counter];counter++;}}else{image_object[0]=new Image();image_object[0].src=options.url_resource;} counter=0;var resource_lenght;if(image_object.length>1){resource_lenght=options.url_resource.length-1;}else{resource_lenght=0;} waiting_load();function waiting_load(){if(resource_lenght!=0){var first_condition='!image_object[counter].complete&&counter');$("#resource_container").css({'position':'relative','width':options.photo_width+'px','height':options.photo_height+'px','overflow':'hidden'});counter=0;$("#resource_container").append('');while(counter<=resource_lenght){$("#resource_container ul").append('
  • ');counter++;} $("#resource_container ul").css({'list-style-type':'none','margin':'0px','padding':'0px'});$("#resource_container li").css({'margin':'0px','padding':'0px','width':options.photo_width+'px','height':options.photo_height+'px','overflow':'hidden'});if(options.border=="yes"){$("#resource_container").css({'border':'solid 1px '+options.border_color});} element.css({'display':'none'});element.fadeIn(2000,function(){if(options.effects=="fade"){$(".element_charged").css({'position':'absolute'});if(resource_lenght!=0){fade_effect();}}else if(options.effects=="slide"){$("#resource_container ul").css({'position':'absolute','width':(options.photo_width*counter)+'px'});$(".element_charged").css({'float':'left'});if(resource_lenght!=0){slide_effect();}} if(options.call_back_function!='none'){eval(options.call_back_function);}});});}} function fade_effect(){var fade_counter=0;$(".element_charged").css({'opacity':'0'});$("#element_0").css({'opacity':'1'});setInterval(function(){$("#element_"+fade_counter).animate({'opacity':'0'},1000);if(fade_counter==(counter-1)){$("#element_0").animate({'opacity':'1'},1000);}else{$("#element_"+(fade_counter+1)).animate({'opacity':'1'},1000);} if(fade_counter<(counter-1)){fade_counter++;}else{fade_counter=0;}},options.slide_time);} function slide_effect(){var fade_counter=0;setInterval(function(){if(fade_counter==(counter-1)){$("#resource_container ul").animate({'left':'0px'},1000);}else{$("#resource_container ul").animate({'left':'-='+options.photo_width},1000);} if(fade_counter<(counter-1)){fade_counter++;}else{fade_counter=0;}},options.slide_time);}});};})(jQuery);