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