
/**
* Fixes MS Internet Explorers inability to display transparent PNG files
*
* USAGE: Just include this file on the pages with the PNG files, and add a: 
* onload="ie_png_fix('images/my_blank_image.gif')" - to the body tag.
*
* This script may be used freely in any way, 
* as long as this notice remains with the script.
*
* @author Kimmo Hernborg <kimmo@kei-kun.net>
*/
function ie_png_fix(blankImage) {
    if (navigator.platform.indexOf("Win") > -1 && 
        ( navigator.userAgent.indexOf("MSIE") > -1 || 
        navigator.userAgent.indexOf("msie") > -1 ) ) {

        var re = /.*?\.png$/i;

        for (var i=0; i<document.images.length; i++) {
            if (re.test(document.images[i].src)) {
                var png = document.images[i].src;
                document.images[i].src = blankImage;
                document.images[i].style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+png+"')";
            }
        }
    }
}


