// for PNGs:
// 1. use rollover function disabled for pre-7 IE (fnRoll)
// 2. establish functions that
//		a. compensate for disabled rollover (PNGswap), and
//		b. display PNGs in IE6 and create the conditions to activate alternate rollover function (correctPNG)
// 3. define version variables and conditionally enable onload event
// 4. remember to also pre-load rollover-images (function in sitescript.js)
// 5. if PNGs aren't rolled-over, feel free to
//		a. exclude functions fnRoll & PNGswap, and
//		b. use instead commented-out variable definition in function correctPNG

function fnRoll(imgName,strSrc) {
	if (document.images&&!(document.all&&version<7)) document[imgName].src = strSrc;
}
function PNGswap(myID) {
//	Note:
//	1. onload events allow only conditional activation of this function
//	2. rollover-image filenames must have something like "on" and "off" to distinguish them
	strOver =	"_on";
	strOff =	"_off";
	oSpan = 	document.all[myID];
	currentAlphaImg = oSpan.filters(0).src;
	oSpan.filters(0).src = (currentAlphaImg.indexOf(strOver) != -1) ? currentAlphaImg.replace(strOver,strOff) : currentAlphaImg.replace(strOff,strOver);
}
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.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');\"";
			if (img.id) strNewHTML += " onmouseover=\"PNGswap('" + img.id + "')\" onmouseout=\"PNGswap('" + img.id +"')\"";
			strNewHTML += "></span>";
//			alternate variable definition if PNGs aren't rolled-over
//			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;
		}
	}
}
arVersion =	navigator.appVersion.split("MSIE");
version =	parseFloat(arVersion[1]);
if (document.all && version < 7 && version >= 5.5) window.attachEvent("onload", correctPNG);