var IEPNGFix=window.IEPNGFix||{}; IEPNGFix.tileBG=function(b,e,d){var a=this.data[b.uniqueID],k=Math.max(b.clientWidth,b.scrollWidth),l=Math.max(b.clientHeight,b.scrollHeight),n=b.currentStyle.backgroundPositionX,o=b.currentStyle.backgroundPositionY,p=b.currentStyle.backgroundRepeat;if(!a.tiles)a.tiles={elm:b,src:"",cache:[],img:new Image,old:{}};a=a.tiles;var h=a.img.width,i=a.img.height;if(e){if(!d&&e!=a.src){a.img.onload=function(){this.onload=null;IEPNGFix.tileBG(b,e,1)};return a.img.src=e}}else{if(a.src)d=1;h=i=0}a.src=e;if(!(!d&& k==a.old.w&&l==a.old.h&&n==a.old.x&&o==a.old.y&&p==a.old.r)){d={top:"0%",left:"0%",center:"50%",bottom:"100%",right:"100%"};var c,f;c=d[n]||n;d=d[o]||o;if(f=c.match(/(\d+)%/))c=Math.round((k-h)*(parseInt(f[1])/100));if(f=d.match(/(\d+)%/))d=Math.round((l-i)*(parseInt(f[1])/100));c=parseInt(c);d=parseInt(d);var q={repeat:1,"repeat-x":1}[p],r={repeat:1,"repeat-y":1}[p];if(q){c%=h;if(c>0)c-=h}if(r){d%=i;if(d>0)d-=i}this.hook.enabled=0;if(!{relative:1,absolute:1}[b.currentStyle.position])b.style.position= "relative";f=0;q=q?k:c+0.1;var j;r=r?l:d+0.1;var m,g,s;if(h&&i)for(c=c;c<q;c+=h)for(j=d;j<r;j+=i){s=0;if(!a.cache[f]){a.cache[f]=document.createElement("div");s=1}var t=c+h>k?k-c:h,u=j+i>l?l-j:i;m=a.cache[f];g=m.style;g.behavior="none";g.left=c+"px";g.top=j+"px";g.width=t+"px";g.height=u+"px";g.clip="rect("+(j<0?0-j:0)+"px,"+t+"px,"+u+"px,"+(c<0?0-c:0)+"px)";g.display="block";if(s){g.position="absolute";g.zIndex=-999;b.firstChild?b.insertBefore(m,b.firstChild):b.appendChild(m)}this.fix(m,e,0);f++}for(;f< a.cache.length;){this.fix(a.cache[f],"",0);a.cache[f++].style.display="none"}this.hook.enabled=1;a.old={w:k,h:l,x:n,y:o,r:p}}};IEPNGFix.update=function(){for(var b in IEPNGFix.data){var e=IEPNGFix.data[b].tiles;e&&e.elm&&e.src&&IEPNGFix.tileBG(e.elm,e.src)}};IEPNGFix.update.timer=0;window.attachEvent&&!window.opera&&window.attachEvent("onresize",function(){clearTimeout(IEPNGFix.update.timer);IEPNGFix.update.timer=setTimeout(IEPNGFix.update,100)});
