if((BrowserDetect.browser == "Explorer" && BrowserDetect.version >= 5.5 && BrowserDetect.version < 7) && (window.attachEvent))
{
    var correctPNG = function()
    {
        if (document.body.filters)
        {
            for(var i=0; i<document.images.length; i++)
            {
	            var img = document.images[i];
	            var imgName = img.src.toUpperCase();
	            if (imgName.substring(imgName.length - 3, imgName.length) == "PNG")
	            {
	                var parent = img.parentElement;
                    var imgID = (img.id) ? "id='" + img.id + "' " : "";
                    var imgClass = (img.className) ? "class='" + img.className + "' " : "";
                    var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' ";
                    var imgStyle = "display:inline-block;" + img.style.cssText;
                    if (img.align == "left") imgStyle = "float:left;" + imgStyle;
                    if (img.align == "right") imgStyle = "float:right;" + imgStyle;
                    if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle;
                    var strNewHTML = "<span " + imgID + imgClass + imgTitle
                        + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
                        + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
                        + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>";
                    i--;
    	        
	                // if parent is a link and it implements a dreamweaver mouseover then replace the link too
	                if(parent.nodeName == 'A' && parent.onmouseover && /MM_swapImage/.test(parent.onmouseover))
	                {
	                    // match onmouseover
	                    var omoMatch = /MM_swapImage\(\'([^\']*)\',\'\',\'([^\']*)/.exec(parent.onmouseover);	                	                
    	                
	                    var linkID = (parent.id) ? "id='" + parent.id + "' " : "";
	                    var linkClass = (parent.className) ? "class='" + parent.className + "' " : "";
	                    var linkStyle = (parent.style) ? "style='" + parent.style.cssText + "' " : "";
	                    var strNewA = "<a " + linkID + linkClass + linkStyle + "href=\"" + 
	                                    parent.href + "\" onmouseover=\"MM_swapImagePNG('" + 
	                                    omoMatch[1] + "','','" + omoMatch[2] + "',1)\" " +
	                                    "onmouseout=\"MM_swapImgPNGRestore()\">" + strNewHTML + "</a>";
	                    parent.outerHTML = strNewA;
	                }
	                else
	                {
                        img.outerHTML = strNewHTML;
	                }
    	                
                }
            }
        }
    }

    addLoadEvent(correctPNG);   
}
