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