<public:component>

	<public:attach event="onpropertychange" onevent="propertyChanged()" />
	
	<script>
		var supported = /MSIE (5\.5)|[6]/.test(navigator.userAgent) && navigator.platform == "Win32";
		var realSrc;
		var blankSrc = "i/tr.gif";
		
		if (supported)
		{
			if(this.src)
				fixImage();
				
			else if(this.currentStyle.backgroundImage)
				fixBackground();
		}
		
	
		function propertyChanged() {
			if (event.propertyName == 'src' && supported) fixImage();
		}
	
		function fixImage() {
			if (/\.png$/.test(this.src.toLowerCase())) {
				this.resetPNG = true;
				this.pngSrc = this.src;
				this.src = blankSrc;
				this.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.pngSrc + "',sizingMethod='scale')";
			}
			else if (this.resetPNG) {
				this.resetPNG = false;
			}
			else if (this.pngSrc) {
				this.pngSrc = false;
				this.runtimeStyle.filter = '';
			}
		}
		
		function fixBackground() {
			var url = this.currentStyle.backgroundImage;
			url = url.replace(/^url[(]["]/ ,"");
			url = url.replace(/["][)]$/ ,"");
			
			if (/\.png$/.test(url.toLowerCase())) {
			
				if(this.currentStyle.backgroundRepeat == 'repeat')
					this.pngSizingMethod = "scale";
				else
					this.pngSizingMethod = "crop";
				
				this.resetPNG = true;
				this.pngSrc = url;
				this.runtimeStyle.backgroundImage = "none";
				this.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.pngSrc + "',sizingMethod='" + this.pngSizingMethod + "')";
			}
			else if (this.resetPNG) {
				this.resetPNG = false;
			}
			else if (this.pngSrc) {
				this.pngSrc = false;
				this.runtimeStyle.filter = '';
			}
		}
	
	</script>
</public:component>