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 setFooter() {
	if (document.getElementById) {
		var windowHeight = getWindowHeight();
		if (windowHeight > 0) {
			var footerElement = document.getElementById('footer'); //grab handle for footer
			var contentHeight = document.getElementById('content').offsetHeight+180;  //get distance from top of screen to bottom of content div
			var rightcolHeight = 0;
			
			var rightColElement = document.getElementById("rightcol"); //check for existence of rightcol
			if (rightColElement != null)
			{
				rightcolHeight = document.getElementById('rightcol').offsetHeight+180; //get distance from top of screen to bottom of rightcol div
			}
            
			var useHeight = 0;  
			var columnDif = 0;  

			if (contentHeight>rightcolHeight) {
                useHeight = contentHeight;  // longest column = content column so set useHeight to that column's height
            } else {
                useHeight = rightcolHeight;  //longest column = rightcol so set useHeight to that column's height
				columnDif = rightcolHeight-contentHeight; //grab the difference between the two columns since the rightcol is absolute and the footer is relative to the content column
            }
			if (windowHeight - useHeight >= 0) {
				footerElement.style.top = windowHeight-(useHeight-columnDif) + 'px';  //
			}
			else {
				if(columnDif>0) { footerElement.style.top = columnDif + 'px'; } else { footerElement.style.top = '0px'; }
			}
		}
	}
}


window.onresize = function() {
	setFooter();
}


var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height)
{
   if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  
   popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

function pageLoad() {
	setFooter();
	P7_initPM(0,0,0,-20,10);
	p7H_initPM(1,7,0,-20,10);
	
	if (typeof pageSrc != 'undefined') {
		if(pageSrc == "home") {   
			var flashObj = ""
			flashObj =  '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="175" height="235" id="home_flash">'
			flashObj += '<param name="allowScriptAccess" value="sameDomain" />'
			flashObj += '<param name="movie" value="flash/home_flash.swf" /><param name="loop" value="false" /><param name="menu" value="false" /><param name="quality" value="best" /><param name="bgcolor" value="#d4eaf9" /><embed src="flash/home_flash.swf" loop="false" menu="false" quality="best" bgcolor="#d4eaf9" width="175" height="235" name="home_flash" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'
			flashObj += '</object>'
			document.getElementById('flashspot').innerHTML = flashObj;  	
		}
	}
}
