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:{}};var a=a.tiles,i=a.img.width,j=a.img.height;if(e){if(!d&&e!=a.src)return a.img.onload=function(){this.onload=null;IEPNGFix.tileBG(b,e,1)},a.img.src=e}else a.src&&(d=1),i=j=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)){var d={top:"0%",left:"0%",center:"50%",bottom:"100%",right:"100%"},c,f;c=d[n]||n;d=d[o]||o;if(f=c.match(/(\d+)%/))c=Math.round((k-i)*(parseInt(f[1])/100));if(f=d.match(/(\d+)%/))d=Math.round((l-j)*(parseInt(f[1])/100));c=parseInt(c);var d=parseInt(d),q={repeat:1,"repeat-x":1}[p],r={repeat:1,"repeat-y":1}[p];q&&(c%=i,0<c&&(c-=i));r&&(d%=j,0<d&&(d-=j));this.hook.enabled=0;if(!{relative:1,absolute:1}[b.currentStyle.position])b.style.position=
"relative";f=0;var q=q?k:c+0.1,h,r=r?l:d+0.1,m,g,s;if(i&&j)for(;c<q;c+=i)for(h=d;h<r;h+=j){s=0;a.cache[f]||(a.cache[f]=document.createElement("div"),s=1);var t=Math.max(0,c+i>k?k-c:i),u=Math.max(0,h+j>l?l-h:j);m=a.cache[f];g=m.style;g.behavior="none";g.left=c-parseInt(b.currentStyle.paddingLeft)+"px";g.top=h+"px";g.width=t+"px";g.height=u+"px";g.clip="rect("+(0>h?0-h:0)+"px,"+t+"px,"+u+"px,"+(0>c?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)});
