// ///////////////////////////////////////////////////////////////////////
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;
			var imgAttribs = img.attributes;
			for (var j=0; j<imgAttribs.length; j++) {
				var imgAttrib = imgAttribs[j];
				if (imgAttrib.nodeName == "align") {		  
					if (imgAttrib.nodeValue == "left") imgStyle = "float:left;" + imgStyle;
					if (imgAttrib.nodeValue == "right") imgStyle = "float:right;" + imgStyle;
					break;
				}
			}
			var strNewHTML = "<span " + imgID + imgClass + imgTitle;
			strNewHTML += " style=\"" + "width:" + img.width + "px; height:" + document.body.offsetHeight + "px;" + imgStyle + ";";
			strNewHTML += "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader";
			strNewHTML += "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" ;
			img.outerHTML = strNewHTML;
			i = i-1;
		}
	}
}
// ///////////////////////////////////////////////////////////////////////
function getWindowHeight() {
	var windowHeight = 0;
	if (typeof(window.innerHeight) == 'number') {
		windowHeight = window.innerHeight;
	} else {
		if (document.documentElement && document.documentElement.clientHeight) {
			windowHeight = document.documentElement.clientHeight;
		} else {
			if (document.body && document.body.clientHeight) {
				windowHeight = document.body.clientHeight;
			}
		}
	}
	return windowHeight;
}
function getContentHeight(){
	contentHeight = document.getElementById("contentArea").offsetHeight;
}
function updateShadow(){
	var windowHeight = getWindowHeight();
	var shadowHeight = (contentHeight > windowHeight)? contentHeight : windowHeight;
	document.getElementById("shLeft").style.height = shadowHeight;
	document.getElementById("shRight").style.height = shadowHeight;
}
// ///////////////////////////////////////////////////////////////////////
// convert all characters to lowercase to simplify testing
  	var app = navigator.appVersion.toLowerCase();
  	// ** PLATFORM CHECK **
  	var isWin = (app.indexOf("win") != -1) ? true:false;
	// ** BROWSER CHECK **
	var isIE4 = (document.all);
if (isWin && isIE4) {
	window.attachEvent("onload", correctPng);
	window.attachEvent("onload", getContentHeight);
	window.attachEvent("onresize", updateShadow);
}