/*
 
Correctly handle PNG transparency in Win IE 5.5 & 6.
http://homepage.ntlworld.com/bobosola. Updated 18-Jan-2006.

Use in <HEAD> with DEFER keyword wrapped in conditional comments:
<!--[if lt IE 7]>
<script defer type="text/javascript" src="pngfix.js"></script>
<![endif]-->

*/

function fixPNG(){
var arVersion = navigator.appVersion.split("MSIE")
var version = parseFloat(arVersion[1])

if ((version >= 5.5) && (version < 7) && (document.body.filters)) 
	{
	   for(var i=0; i<document.images.length; i++)
	   {
		  var img = document.images[i]
		  var imgName = img.src.toUpperCase()
		  if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
		  {
		var span = document.createElement('span');    
		span.id = img.id;    
		span.className = img.className;
		span.title = img.title ? img.title : img.alt;    
		span.style.cssText = img.style.cssText;
		span.style.display = 'inline-block';
		span.style.float = img.align ? img.align : 'none';
		span.style.width = img.offsetWidth + 'px';
		span.style.height = img.offsetHeight + 'px';
		span.setAttribute('tagvalue',img.getAttribute('tagvalue'));
		if(img.parentElement.href){
		 span.style.cursor = 'hand';
		}
		span.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'" + img.src + "\', sizingMethod='scale')";
		span.onclick = img.onclick;
		img.parentNode.replaceChild(span,img);
			i = i-1
		  }
	   }
	}
}

fixPNG();