/* $DDRFreak: www/phpBB2/templates/subSilver/24bitpng.htc,v 1.1 2003/02/02 02:46:53 evn Exp $ */
<public:component	lightWeight="true">
<public:attach		event="onpropertychange"	onevent="propertyChanged()" />

	<script>
		var okbrowser =	/MSIE (5\.5)|[6789]/.test(navigator.userAgent) && navigator.platform == "Win32";
		var blankimg =	"http://www.ddrfreak.com/phpBB2/templates/subSilver/blank.gif";
		var realimg;

		if (okbrowser) makeTransparent();

		function propertyChanged() {
			// if this browser is not supported the let's not waste our time.
			if (!okbrowser) return;
			
			// if the source of the image hasn't changed we don't need to do this either.
			var propertyname = event.propertryName;
			if (propertyname != "src") return;

			// otherwise we set the image source to blank and then make it transparent.
			if (!new RegExp(blankimg).test(src)) makeTransparent();
		} //;

		function makeTransparent() {
			// get the source of the image	
			var src = element.src;

			// make sure something has changed with realimg
			if (src == realimg && /\.png$/i.test(src)) {
				element.src = blankimg;
				return;
			}
			
			if (!new RegExp(blankimg).test(src)) {
				//set the element src to blank
				element.src = blankimg;

				// Apply the image filter
				element.runtimeStyle.filter = "progid:DXImageTransform.Microsoft." + 
				"AlphaImageLoader(src='" + src +"',sizingMethod='fixed')";
			} else {
				// remove the image filter
				element.runtimeStyle.filter ="";
			}
		}
	</script>
</public:component>