$(function(){$.fn.preloadify=function(a){function k(d){if(g[d]==false){i++;a.oneachload(b[d]);g[d]=true}if(a.imagedelay==0&&a.delay==0)$(b[d]).css("visibility","visible").animate({opacity:1},700);else if(a.delay==0){j(b[d],e);e+=a.imagedelay}else if(a.imagedelay==0)j(b[d],a.delay);else{j(b[d],a.delay+e);e+=a.imagedelay}}function l(){h=setInterval(function(){if(i>=g.length){clearInterval(h);a.ondone()}else if(a.mode=="parallel")for(c=0;c<b.length;c++)b[c].complete==true&&k(c);else if(b[c].complete==
true){k(c);c++}},a.check_timer)}a=$.extend({delay:0,imagedelay:0,mode:"parallel",preload_parent:"a",check_timer:200,ondone:function(){},oneachload:function(){},fadein:700,force_icon:false},a);var f=$(this),h,c=0,e=a.imagedelay,i=0,b=f.find("img").css({display:"block",visibility:"hidden",opacity:0}),g=[],j=function(d,n){$(d).css("visibility","visible").delay(n).animate({opacity:1},a.fadein,function(){$(this).parent().removeClass("preloader")})};b.each(function(){$(this).parent(a.preload_parent).length==
0?$(this).wrap("<a class='preloader' />"):$(this).parent().addClass("preloader");g[c++]=false});b=$.makeArray(b);c=i=0;e=a.imagedelay;if(a.force_icon==true){f=$(".preloader").css("background-image");f=f.replace(/url\(|\)|"|'/g,"");var m=jQuery("<img />",{id:"loadingicon",src:f}).hide().appendTo("body");h=setInterval(function(){if(m[0].complete==true){clearInterval(h);setTimeout(function(){l()},a.check_timer);m.remove()}},50)}else l()}});