// JavaScript Document

// PNG FIX ------------------------------------------------------------------------------------------ 

function fixPNG(myImage) 
{
	new Element('span', {
		'id': myImage.id,
		'class': myImage.get('class'),
		'title': myImage.get('title') || myImage.get('alt'),
		'styles': $extend({
			'display': 'inline-block',
			'width': myImage.width,
			'height': myImage.height,
			'filter': 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + myImage.src + '\', sizingMethod=\'scale\')'
		}, myImage.getStyles('float', 'padding', 'margin'))
	}).replaces(myImage);
}

window.addEvent('load', function() {
	var version = parseFloat((navigator.appVersion.split("MSIE"))[1])
	if ( Browser.Engine.trident && (version >= 5.5) && (version < 7) && (document.body.filters) )
	{
		$$(document.images).each(function(el)
		{
			if ( $(el).getProperty('src').toLowerCase().indexOf('.png') > 0 )
				fixPNG(el);
		});
	}
});