/*

Correctly handle PNG transparency in Win IE 5.5 & 6.
http://homepage.ntlworld.com/bobosola. Updated 18-Jan-2006.

Adapted for Wikipedia by Remember_the_dot

http://homepage.ntlworld.com/bobosola/pnginfo.htm states "This page contains more information for the curious or those who wish to amend the script for special needs", which I take as permission to modify or adapt this script freely. I release my changes into the public domain.

*/

if (navigator.appName == "Microsoft Internet Explorer") {
	var version = navigator.appVersion.substr(22, 3);
	if (version == "6.0" || version == "5.5")
	{
   		window.attachEvent("onload", PngFixAll)
	}
}


function PngFixAll(){
	if (document.body.filters){	
		var documentImages = document.images;
		
		for (var i = 0;i < documentImages.length;i++){
		  var img = documentImages[i];
		  PngFixImage(img, false);
		}
	}
}

function PngFixImage(Obj, bCheck){
	var imgSrc = Obj.src;
	
	if (imgSrc.substr(imgSrc.length - 3).toLowerCase() == "png" && !Obj.useMap)
	{  
		if (((bCheck)&&((document.body.filters)&&(!(BrowserPngSupport()))))||(!(bCheck))){
			Obj.src = "/images/blank.gif";
			Obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + encodeURI(imgSrc) + "');";
		}
	}
}

