2 * Correctly handle PNG transparency in Win IE 5.5 & 6.
3 * http://homepage.ntlworld.com/bobosola. Updated 18-Jan-2006.
5 * Use in <HEAD> with DEFER keyword wrapped in conditional comments:
8 * <script defer type="text/javascript" src="pngfix.js"></script>
13 var arVersion = navigator.appVersion.split("MSIE"),
14 version = parseFloat(arVersion[1]),
17 try { filters = !!document.body.filters }
20 if (version >= 5.5 && filters) {
21 $A(document.images).each(function(img) {
22 if (!img.src.toLowerCase().endsWith('png')) return;
24 var span = new Element('span', { id: img.id, className: img.className, title: (img.title || img.alt) }).
26 display: 'inline-block',
27 width: img.width + 'px',
28 height: img.height + 'px',
29 filter: 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' + img.src + '", sizingMethod="scale")'
31 setStyle(img.style.cssText);
33 if (img.align == "left") span.setStyle("float: left");
34 else if (img.align == "right") span.setStyle("float: right");
35 if (img.parentElement.href) span.setStyle("cursor: hand");