<public:component lightWeight="true">
	<public:attach event="onpropertychange" onevent="propertyChanged()" />
	<public:attach event="onbeforeprint" onevent="beforePrint()" for="window"/>
	<public:attach event="onafterprint" onevent="afterPrint()" for="window"/>
	<script>

	/**
	 * PNG Behavior
	 *
	 * This script was created by Erik Arvidsson (http://webfx.eae.net/contact.html#erik)
	 * for WebFX (http://webfx.eae.net)
	 * Copyright 2002-2004
	 *
	 * For usage see license at http://webfx.eae.net/license.html
	 *
	 * Version: 1.02
	 * 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
	 *          2004-05-09  When printing revert to original
	 *
	 * Changes made by Giso Stallenberg (giso@connectholland.nl)
	 * Fri 2006 Oct 10
	 * - Made standalone by including in phpscript that returns transparent gif image
	 * - Width and height for png no longer required, because it will be catched before src is replaced and set when source is replaced
	 * - Does no longer fire when IE userAgent version is 7
	 */

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

	var realSrc;
	var blankSrc = "none";
	var isPrinting = false;

	if (supported) fixImage();

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

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

	function fixImage() {
		// get src
		var src = element.currentStyle.backgroundImage;
		// check for real change
		if (src == realSrc && /\.png['"]{1,1}\)$/i.test(src)) {
			element.runtimeStyle.backgroundImage = blankSrc;
			return;
		}

		if ( ! new RegExp(blankSrc).test(src)) {
			// backup old src
			realSrc = src;
		}
		
		cleanSrc = realSrc.match(/url\((")([^\1]*)\1\)/i)[2];
		
		// test for png
		if (/\.png$/i.test(cleanSrc)) {
			// set blank image
			if (!element.currentStyle.hasLayout) {
				element.runtimeStyle.zoom = 1.0;
			}
			element.runtimeStyle.backgroundImage = blankSrc;
			
			if (element.canHaveChildren) {
				// Here some shit should be appended
				// set filter
				element.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src=" + cleanSrc + ",sizingMethod=scale)";
			}
			else {
				// set filter
				element.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src=" + cleanSrc + ",sizingMethod=scale)";
			}
		}
		else {
			// remove filter
			element.runtimeStyle.filter = "";
		}
	}

	function beforePrint() {
		isPrinting = true;
		element.style.backgroundImage = realSrc;
		element.runtimeStyle.filter = "";
		realSrc = null;
	}

	function afterPrint() {
		isPrinting = false;
		fixImage();
	}

	</script>
</public:component>
