function fixPNG(img) {
    if (ie6!='6') return;
    var imgName = img.src.toUpperCase()
    if (!img.parentElement) return;
    if (imgName.substring(imgName.length-3, imgName.length) == "PNG") {
        var span=document.createElement('SPAN');
        if (img.title) span.title=img.title;
        if (img.className) span.className=img.className;
        var str="display:inline-block;"+img.style.cssText+';';
        if (img.align=='left') {
            str+='float:left;';
        } else if (img.align=='right') {
            str+='float:right;';
        }
        if (img.parentElement.href) {
            str+='cursor:pointer;';
        }
        if (img.height) {
            str+='height:'+img.height+'px;';
        }
        if (img.width) {
           str+='width:'+img.width+'px;';
        }
        str+="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+img.src+"', sizingMethod='crop');";
        span.style.cssText=str;
        if (img.onclick) span.onclick=img.onclick;
        img.parentNode.replaceChild(span,img);
    }
}

function correctPNG() {
    if (ie6!='6') {return;}
    var max=document.images.length;
    for(var i=0; i<=max; i++) {
        var img = document.images[i];
        if (img) {
            var imgName = img.src.toUpperCase();            
            if (imgName.substring(imgName.length-3, imgName.length) == "PNG") {
                if (!imgName.match(/IMGUSER/)&&!imgName.match(/BT\_/)) {
                    //alert(i+'='+img.src);                
                    if (img.style.display!='none') {
                        fixPNG(img);
                        i--;
                    }
                }
            }                
        }
    }
}

var ie6;
function fixallpng() {
    try {
        ie6=getInternetExplorerVersion();
        if (ie6>0) {
            correctPNG();
        }
    } catch(e) {
    }
}

window.onload=fixallpng;
