/*!
	Forces use of DirectX transparency filter for image tags with "transparent-png-icon" as class.

	The result: correct alpha blending for normal (32x32) PNG icons in Internet Explorer.
*/
function fixIEPNGAlpha()
{
	try
	{
		var imageList = document.getElementsByTagName('IMG');

		for(var i = 0; i < imageList.length; i++)
		{
			var image = imageList[i];

			if(!image.src)
				continue;

			//if(image.src.match(/\.png$/i) || (image.className == 'transparent-png-icon'))
			if(image.className == 'transparent-png-icon')
			{
				image.runtimeStyle.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + image.src + '\', sizingMethod=\'scale\')';
				image.src = (image.width == 16) ? emptyIcon16 : emptyIcon32;
			}
		}
	}
	catch(exception)
	{
	}
}

if(BrowserInfo.isIE)
{
	// Detect IE5.5+
	version = 0;

	if(navigator.appVersion.indexOf('MSIE') >= 0)
	{
		elements = navigator.appVersion.split('MSIE')
		version = parseFloat(elements[1])
	}

	if(version < 7)
		eventManager.addCallback('window_onload', fixIEPNGAlpha);
}

