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