/*
IE4 = (document.all) ? 1 : 0;

//Array containing all PNG images on the page
var PNGimageArray = new Array();
var isPrinting = false;

//Path to the blank image (1x1 transparent)
var blankSrc = "/images/blank.png";
if(IE4)
{
	//Captures print events
	window.attachEvent("onbeforeprint", function () { beforePrint(); } );
	window.attachEvent("onafterprint", function () { afterPrint(); } );   
}
			                                            
//Tests if element is a PNG image, and if so fixes it
function addPngImage(element){
	if(IE4)
	{		
		if (/\.png$/i.test(element.src)) {
			fixImage(element);
			element.attachEvent("onpropertychange", function () { propertyChanged(); } );
			PNGimageArray[PNGimageArray.length] = element;
		}		
	}
}

//Applies filter and changes source to blank
function fixImage(element) {
	element.width = element.width;
	element.height = element.height;
	element.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + element.src + "',sizingMethod='scale')";
	element.src = blankSrc;
}

//If property "src" is changed fixs image (not if it is changed to blank though)
function propertyChanged() {
	if (isPrinting) return;
	var element = event.srcElement;
	var pName = event.propertyName;
	if (pName != "src") return;
	if (!new RegExp(blankSrc).test(element.src))
		fixImage(element);

}

//Turns image back to original before print (Explorer can't print filters)
function beforePrint() {
window.status+=' print';
	isPrinting = true;
	var element;
	for(var i = 0; i < PNGimageArray.length; i++){	
		element = PNGimageArray[i];
		element.src = element.filters[0].src;
		element.runtimeStyle.filter = "";
	}
}

//Fixes image after print
function afterPrint() {
window.status+=' aftprint';
	isPrinting = false;
	var element;
	for(var i = 0; i < PNGimageArray.length; i++){
		element = PNGimageArray[i];
		fixImage(element);

	}
}
*/
function correctPNG() 
{

	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 imgID = (img.id) ? "id='" + img.id + "' " : ""
			var imgClass = (img.className) ? "class='" + img.className + "' " : ""
			var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
			var imgStyle = "display:inline-block;" + img.style.cssText 
			
			if(img.border != '')
			{
				if (img.align == "left") imgStyle = "float:left;" + imgStyle
				if (img.align == "right") imgStyle = "float:right;" + imgStyle
				if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle 
				var strNewHTML = "<span " + imgID + imgClass + imgTitle
					+ " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
					+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
					+ "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
				img.outerHTML = strNewHTML
				i = i-1
			}
		}
	}

	ipts=document.getElementsByTagName('input');
	for(var i=0; i<ipts.length; i++)
	{
		var ipt = ipts[i];
		if(ipt.type.toLowerCase() == "image")
		{
			var iptName = ipt.src.toUpperCase()
			if (iptName.substring(iptName.length-3, iptName.length) == "PNG")
			{			
				var iptID = (ipt.id) ? "id='" + ipt.id + "' " : ""
				var iptClass = (ipt.className) ? "class='" + ipt.className + "' " : ""
				var iptTitle = (ipt.title) ? "title='" + ipt.title + "' " : "title='" + ipt.alt + "' "
				var iptStyle = "display:inline-block;" + ipt.style.cssText 
				if (ipt.align == "left") iptStyle = "float:left;" + iptStyle
				if (ipt.align == "right") iptStyle = "float:right;" + iptStyle
				if (ipt.parentElement.href) iptStyle = "cursor:hand;" + iptStyle 
				var strNewHTML = "<span " + iptID + iptClass + iptTitle
					+ " style=\"" + "width:" + ipt.width + "px; height:" + ipt.height + "px;" + iptStyle + ";"
					+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
					+ "(src=\'" + ipt.src + "\', sizingMethod='scale');\"></span>" 
				ipt.outerHTML = strNewHTML
				//alert(strNewHTML +' '+ ipt.border);
				
				i = i-1
			}
		}
	}
}
IE4 = (document.all) ? 1 : 0;
if(IE4)
{
	window.attachEvent("onload", correctPNG);
}