(function(a){a.preLoadImages=function(g,f){var c=[],d,e,b=0;if(typeof g!="undefined"){if(a.isArray(g)){e=g.length;for(d=0;d<e;d++){c[d]=new Image();c[d].onload=function(){b++;if(b==e){if(a.isFunction(f)){f()}}};c[d].src=g[d]}}else{c[0]=new Image();c[0].onload=function(){if(a.isFunction(f)){f()}};c[0].src=g}}c=undefined};a.preLoadCSSImages=function(h){var o=[],s,q=[],r=0,t,f=new RegExp("url((.*)) ","i"),l;var j=document.styleSheets,p,d,n,k,m,u,b,e;for(b=0;b<j.length;b++){var g=j[b];if(typeof g.href=="string"&&g.href.length>0){l=g.href.split("/");l.pop();p=l.join("/")+"/"}else{p="./"}d=g.cssRules?g.cssRules:g.rules;for(e=0;e<d.length;e++){n=d[e];m=n.cssText?n.cssText:n.style.cssText;k=f.exec(m);if(k!=null){u=k[1].substring(1,k[1].indexOf(")",1));if(u.substring(0,4)=="http"){q[q.length]=u}else{if(k[1].substring(1,2)=="/"){var c=p.split("/");c.pop();c.pop();p2x=c.join("/");q[q.length]=p2x+u}else{q[q.length]=p+u}}}}}t=q.length;for(s=0;s<t;s++){o[s]=new Image();o[s].onload=function(){r++;if(r==t){if(a.isFunction(h)){h()}}};o[s].src=q[s]}};a.preLoadAllImages=function(c,b){if(typeof c!="undefined"){if(a.isFunction(c)){b=c}else{if(!a.isArray(c)){c=[c]}}}a.preLoadCSSImages(function(){if(c.length>0){a.preLoadImages(c,function(){b()})}else{b()}})}})(jQuery);