/*
 
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="/.devel/ahansford/2008/pngfix.js"></script>
<![endif]-->

*/

	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") {
			pngfix(img);
		}
	}

	function pngfix (e) {
		var ID = (e.id) ? "id='" + e.id + "' " : "";
		var Class = (e.className) ? "class='" + e.className + "' " : "";
		var Title = (e.title) ? "title='" + e.title + "' " : "title='" + e.alt + "' ";
		var oc = (e.onclick) ? ' onclick="'+e.onclick.toString().replace(/^.*anonymous[^\{]*\{/, '').replace(/\}[^\}]*$/, '').replace(/\n/, '')+'" ' : '';
		var Style = "display:inline-block;" + e.style.cssText;
		if (e.align == "left") Style = "float:left;" + Style;
		if (e.align == "right") Style = "float:right;" + Style;
		if (e.parentElement.href) Style = "cursor:hand;" + Style;
		var strNewHTML = "<span " + ID + Class + Title + oc + " style=\"" + "width:" + e.width + "px; height:" + e.height + "px;" + Style + ";" + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader" + "(src=\'" + e.src + "\', sizingMethod='scale');\"></span>";
		e.outerHTML = strNewHTML;
	}