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