﻿// JScript File

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
	document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}

function infoPop(iW, iH) {
	var infoPopup = document.getElementById("infoPopup");
	var infoFrame = document.getElementById("infoIFrame");
    var ypos = 0;
    var winH = 0;
    var xpos = 0;
    var winW = 0;
	
	if(navigator.appName == "Microsoft Internet Explorer"){
		if (!iW){
			iW = parseInt(infoPopup.currentStyle.width);
		}
		if (!iH) {
			iH = parseInt(infoPopup.currentStyle.height);
		}
        ypos = document.documentElement.scrollTop;
        winH = document.documentElement.clientHeight;
        xpos = document.documentElement.scrollLeft;
        winW = document.documentElement.clientWidth;
		
	} else {
		if (!iW){
			iW = parseInt(document.defaultView.getComputedStyle(infoPopup, '').getPropertyValue("width"));
		}
		if (!iH){
			iH = parseInt(document.defaultView.getComputedStyle(infoPopup, '').getPropertyValue("height"));
		}
		ypos = window.pageYOffset;
		winH = window.innerHeight;
		xpos = window.pageXOffset;
		winW = window.innerWidth;
	}
	
	iWpx = iW.toString() + "px";
	iHpx = iH.toString() + "px";
	infoPopup.style.width = iWpx;
	infoPopup.style.height = iHpx;
	infoFrame.style.width = iWpx;
	infoFrame.style.height = iHpx;
	var yVal = Math.round((winH-iH)/2)+ypos;
	if(yVal<25) yVal = 25;
	yVal = yVal.toString()+"px";
	var xVal = Math.round((winW-iW)/2)+xpos;
	xVal = xVal.toString()+"px";
	infoPopup.style.top = yVal;
	infoPopup.style.left = xVal;
	infoPopup.style.display = "block";
}

function infoPopResize(){
	var infoPopup = parent.document.getElementById("infoPopup");
	var infoScrollDiv = document.getElementById("infoScrollDiv");	
	if (navigator.appName == "Microsoft Internet Explorer"){
		iH = parseInt(infoPopup.currentStyle.height);
		iW = parseInt(infoPopup.currentStyle.width);
		var isdPadd = parseInt(infoScrollDiv.currentStyle.padding);
		var isT = parseInt(infoScrollDiv.currentStyle.top);
		var isW = iW - isdPadd*2;
		var isH = iH - isT - isdPadd*2;
	} else {
		iH = parseInt(document.defaultView.getComputedStyle(infoPopup, '').getPropertyValue("height"));
		iW = parseInt(document.defaultView.getComputedStyle(infoPopup, '').getPropertyValue("width"));
		var isdPadd = parseInt(document.defaultView.getComputedStyle(infoScrollDiv, '').getPropertyValue("padding-left"));
		var isT = parseInt(document.defaultView.getComputedStyle(infoPopup, '').getPropertyValue("top"));
		var isW = iW - isdPadd*2;
		var isH = iH - isT - isdPadd*4;
	}
	iWpx = iW.toString() + "px";
	iHpx = iH.toString() + "px";
	infoScrollDiv.style.width = isW.toString()+"px";
	infoScrollDiv.style.height = isH.toString()+"px";
}
	
function closeInfoPopup(){
	parent.document.getElementById("infoPopup").style.display="none";
}
