// This Javascript is written by Peter Velichkov (www.creonfx.com)
// and is distributed under the following license : http://creativecommons.org/licenses/by-sa/3.0/
// Use and modify all you want just keep this comment. Thanksfunction fixPNG(){
// Thanks Peter, I had to modify it a bit 

// Make sure this only happens for ie6 (i dont want it's faults screwing with the browsers that make an effort)
if (Browser.Engine.name=='trident' && Browser.Engine.version < 5) {
	window.addEvent('domready', function(){
		$$('*').each(function(el){
			var imgURL = el.getStyle('background-image');
			var imgURLLength = imgURL.length;
			if ( imgURL != 'none' && imgURL.substring(imgURLLength  - 5, imgURLLength  - 2) == 'png'){
				el.setStyles({
					background: '',
					filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled='true', sizingMethod='crop', src='" + imgURL.substring(5,imgURLLength  - 2) + "')"
				});
			};
			if(el.get('tag') == 'img' && el.getProperty('src').substring(el.getProperty('src').length  - 3) == 'png'){
				var imgReplacer = new Element('input', {
					'styles': {
						'filter': "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled='true', sizingMethod='crop', src='" + el.getProperty('src') + "')",
						'position': 'relative',
						'background': 'transparent'
					},
					'title': el.getProperty('alt')
				});
				imgReplacer.setStyles(el.getStyles('padding','margin','border','height','width'));
				imgReplacer.setProperties(el.getProperties('id','class'));
				imgReplacer.disabled = true;
				imgReplacer.replaces(el);
			};
		});
	});
}
