// JavaScript Page

/*Notes:
1.	All png images in the HTML page have their class set to "visibility" -- which has its visibility attribute set to hidden.
this routine changes the class to "visibility_on", which has its visibility attribute set to visible.  By doing this it
prevents the unpleasant flashing of the image background when using IE6.
*/

function correctPNG() {
/*Correctly handle PNG transparency in Win IE 5.5 & 6. -- runs each time the page loads
How it works: takes all images (inside IMG tags) and reformats them into
a <span> tag with the image displayed with MS AlphaImageLoader filter.
*/
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 imgID = (img.id) ? "id='" + img.id + "' " : ""
			var imgClass = (img.className) ? "class='" + img.className + "_on" + "' " : ""
			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'); \"></span>" 
			img.outerHTML = strNewHTML
			i = i-1
		}
	}
} 
// this code runs for non IE6 browsers and just turns on the visibility for png images
else {
		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") {
			img.className = "visibility_on";
		}
	}

}

}