// global.js

var isDOM = (document.getElementById)?true:false;
var isIE4 = ((document.all)&&(!isDOM))?true:false;
var isNS4 = (document.layers)?true:false;
var isIE = (document.all)?true:false;
var isNS6 = ((isDOM)&&(!isIE))?true:false;
var isMac = (navigator.appVersion.indexOf("Mac") != -1)?true:false;
var isMacIE45 = (parseFloat(navigator.appVersion.substr(navigator.appVersion.indexOf("MSIE")+5))<5)&&(isMac)?true:false;
var isMacIE5 = (parseFloat(navigator.appVersion.substr(navigator.appVersion.indexOf("MSIE")+5))>=5)&&(isMac)?true:false;
var isUNIX = (navigator.userAgent.indexOf("X11") != -1)?true:false;

// fixes a resize/DHTML issue with Netscape 4.x browsers
if (document.layers) {
	origWinWidth = window.innerWidth;
	origWinHeight = window.innerHeight;
	
	window.onresize = function() {
		currWinWidth = window.innerWidth;
		currWinHeight = window.innerHeight;
		if((origWinWidth != currWinWidth) || (origWinHeight != currWinHeight)) location.reload();
	}
} else if (isIE) {
	window.onresize = reloadPage;
}

function reloadPage() {
	setTimeout("window.location.reload(0)",500);
}

// retrieves inner window height for tables
function getWindowHeight() {
	h = (isIE)?document.body.offsetHeight:window.innerHeight;
	if (isNS4) h+=4;
	if (isMacIE5) h-=8;
	if (isMacIE45) h-=8;
	return h;
}

// sets Height and Width Variables for Framesets
if (isMacIE45){
	frameh = 144;
	framew = 130;
} else if (isMacIE5){
	frameh = 144;
	framew = 130;
} else if (isMac){
	frameh = 144;
	framew = 130;
} else if (isIE4){
	frameh = 135;
	framew = 130;
} else if (isIE){
	frameh = 135;
	framew = 130;
} else if (isNS4){
	frameh = 144;
	framew = 138;
} else if (isNS6){
	frameh = 143;
	framew = 138;
}

// creates Pop-up Window
var newWindow = null;

function NewWindow(mypage, myname, w, h, scroll, resize, menu, toolbar, status, location) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable='+resize+',menubar='+menu+',toolbar='+toolbar+',status='+status+',location='+location
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function closeWindow() {
if (newWindow != null) {
    newWindow.close();
	newWindow = null;
    }
}

