(function(a){a.ifixpng=function(b){a.ifixpng.pixel=b};a.ifixpng.regexp={bg:/^url\(["']?(.*\.png([?].*)?)["']?\)$/i,img:/.*\.png([?].*)?$/i},a.ifixpng.getPixel=function(){return a.ifixpng.pixel||"images/pixel.gif"};var b={base:a("base").attr("href"),ltie7:a.browser.msie&&a.browser.version<7,filter:function(a){return"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=crop,src='"+a+"')"}};a.fn.ifixpng=b.ltie7?function(){function c(c,d,e,f,g){c.css({filter:b.filter(d),width:e,height:f}).attr({src:a.ifixpng.getPixel()}).positionFix()}return this.each(function(){var d=a(this);if(d.is("img")||d.is("input")){var e,f;if(this.src&&this.src.match(a.ifixpng.regexp.img)){e=b.base&&this.src.substring(0,1)!="/"&&this.src.indexOf(b.base)===-1?b.base+this.src:this.src;if(!this.width||!this.height){a(new Image).one("load",function(){c(d,e,this.width,this.height);a(this).remove()}).attr("src",e)}else c(d,e,this.width,this.height)}}else if(this.style){var g=d.css("backgroundImage");if(g&&g.match(a.ifixpng.regexp.bg)&&this.currentStyle.backgroundRepeat=="no-repeat"){g=RegExp.$1;var h=this.currentStyle.backgroundPositionX||0,i=this.currentStyle.backgroundPositionY||0;if(h||i){var j={},f;if(typeof h!="undefined"){if(h=="left")j.left=0;else if(h=="right")j.right=d.width()%2===1?-1:0;else j.left=h}if(typeof i!="undefined"){if(i=="bottom")j.bottom=d.height()%2===1?-1:0;else if(i=="top")j.top=0;else j.top=i}f=new Image;a(f).one("load",function(){var c,e,f={},h;if(/center|%/.test(j.top)){f.top="(this.parentNode.offsetHeight - this.offsetHeight) * "+(j.top=="center"?.5:parseInt(j.top)/100);delete j.top}if(/center|%/.test(j.left)){f.left="(this.parentNode.offsetWidth - this.offsetWidth) * "+(j.left=="center"?.5:parseInt(j.left)/100);delete j.left}d.positionFix().css({backgroundImage:"none"}).prepend(a("<div></div>").css(j).css({width:this.width,height:this.height,position:"absolute",filter:b.filter(g)}));if(f.top||f.left){var i=d.children(":first")[0];for(h in f)i.style.setExpression(h,f[h],"JavaScript")}a(this).remove()});f.src=g}else{d.css({backgroundImage:"none",filter:b.filter(g)})}}}})}:function(){return this};a.fn.positionFix=function(){return this.each(function(){var b=a(this);if(b.css("position")!="absolute")b.css({position:"relative"})})}})(jQuery)

