$(function($){
	$.fn.fixPNG = function() {
		return this.each(function () {
			var image = $(this).css('backgroundImage');
			if (image.match(/^url\(["']?(.*\.png)["']?\)$/i)) {
				image = RegExp.$1;
				$(this).css({
					'backgroundImage': 'none',
					'filter': "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=" + ($(this).css('backgroundRepeat') == 'no-repeat' ? 'crop' : 'scale') + ", src='" + image + "')"
				}).each(function () {
					var position = $(this).css('position');
					if (position != 'absolute' && position != 'relative')
						$(this).css('position', 'relative');
				});
			}
			if (image = $(this).attr('src')) {
				$(this).wrap('<div style="height: '+$(this).height()+'px; width: '+$(this).width()+'px; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='+image+');" />').hide();
			}
		});
	};

	if ($.browser.msie && parseInt($.browser.version.substr(0, 1)) < 7) {
		$('.png').fixPNG();
	}
});
