<public:component lightWeight="true">
<public:attach event="onpropertychange" onevent="propertyChanged()" />
<script>

/*
 * PNG Behavior
 *
 * This script was created by Erik Arvidsson (erik(at)eae.net)
 * for WebFX (http://webfx.eae.net)
 * Copyright 2002
 *
 * For usage see license at http://webfx.eae.net/license.html
 *
 * Version: 1.01
 * Created: 2001-??-??    First working version
 * Updated: 2002-03-28    Fixed issue when starting with a non png image and
 *                      switching between non png images
 *          2003-01-06    Fixed RegExp to correctly work with IE 5.0x
 *
 */

var supported = /MSIE ((5\.5)|[6789])/.test(navigator.userAgent) &&
                navigator.platform == "Win32";

var realSrc;
var blankSrc = "imgs/transparent.1x1.gif";

window.alert("hello!");

if (supported) fixImage();

function propertyChanged() {
    if (!supported) return;

    var pName = event.propertyName;
    if (pName != "src") return;
    // if not set to blank
    if (!new RegExp(blankSrc).test(src))
        fixImage();
};

function fixImage() {
    // get src
    var src = element.src;

    // check for real change
    if (src == realSrc && /\.png$/i.test(src)) {
        element.src = blankSrc;
        return;
    }

    if ( ! new RegExp(blankSrc).test(src)) {
        // backup old src
        realSrc = src;
    }

    // test for png
    if (/\.png$/i.test(realSrc)) {
        // set blank image
        element.src = blankSrc;
        // set filter
        element.runtimeStyle.filter = "progid:DXImageTransform.Microsoft." +
                    "AlphaImageLoader(src='" + src + "',sizingMethod='scale')";
    }
    else {
        // remove filter
        element.runtimeStyle.filter = "";
    }
}

</script>
</public:component>
