var existingWindowOnLoad = window.onload;

if (navigator.appName == "Microsoft Internet Explorer" && parseFloat(navigator.appVersion.split("MSIE")[1]) < 7)
{
    window.onload = function()
    {
        if (existingWindowOnLoad)
            existingWindowOnLoad();

        fixPng();
    };
}

function fixPng()
{
    var img, imgName, imgID, imgClass, imgTitle, imgStyle, strNewHTML
    
    for (var i = 0; i < document.images.length; i++)
    {
        img = document.images[i]
        imgName = img.src.toUpperCase()

        if (imgName.substring(imgName.length - 3, imgName.length) == "PNG")
        {
            imgID = (img.id) ? "id='" + img.id + "' " : ""
            imgClass = (img.className) ? "class='" + img.className + "' " : ""
            imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
            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

            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>" 

            img.outerHTML = strNewHTML

            i = i - 1
        }
    }
}
