/** * Behebt den PNG Bug im IE6 * @param {Object} node - IMG Node welches verbessert werden soll * by henbug seaofsin.de */ function correctPNG(node) { if(navigator.userAgent.search(/MSIE/) > 0 && navigator.userAgent != "Mozilla/4.0 (compatible; MSIE 6.0; Windows 98)") { var img = node; var imgName = img.src.toUpperCase(); if (imgName.substring(imgName.length-3, imgName.length) == "PNG") { var oSpan = document.createElement('span'); oSpan.id = img.id; oSpan.className = img.className; oSpan.title = img.title; oSpan.style.cssText = img.style.cssText oSpan.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'" + img.src + "\', sizingMethod='image')"; // Float if(img.align == "left" || img.align == "right") { if (img.align == "left") { iFloat = "left"; } if (img.align == "right") { iFloat = "right"; } oSpan.style.styleFloat = iFloat; } if(img.parentElement.href) { oSpan.style.cursor = "pointer"; } if(img.onclick) { oSpan.onclick = img.onclick; } if(img.onmouseover) { oSpan.onmouseover = img.onmouseover; } if(img.onmouseout) { oSpan.onmouseout = img.onmouseout; } oSpan.innerHTML = ' '; oSpan.style.display = 'inline-block'; oSpan.style.height = img.height + 'px'; oSpan.style.width = img.width + 'px'; img.outerHTML = oSpan.outerHTML; } } }