/* parchment/pngfix.js -- See PHP for credits and license
 * Correctly handle PNG transparency in Win IE 5.5 & 6.
 */
function fixpng(img) { // png images handling for IE5.5/6
  if(document.all && (IEver = parseFloat(navigator.appVersion.split("MSIE")[1]))
    && (IEver >= 5.5) && (IEver < 7) && document.body.filters && img) {
    imgName = img.src.toLowerCase();
    if(imgName.substring(imgName.length - 3, imgName.length) == "png")
      img.outerHTML = "<span "
        + (img.id ? "id='" + img.id + "' " : "")
        + (img.className ? "class='" + img.className + "' " : "")
        + (img.title ? "title=\"" + img.title + "\" " : "")
        + "style=\"width:" + img.width + "px;height:" + img.height + "px;"
        + (img.align == "left" ? "float:left;" : (img.align == "right" ? "float:right;" : ""))
        + (img.parentElement.href ? "cursor:hand;" : "")
        + "display:inline-block;" + img.style.cssText + ";"
        + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"
        + img.src + "',sizingMethod='scale');\"></span>";
    }
}

