﻿var prmpopup;
function popupModal(fname, wname, xwidth, xheight){
	var PopUpWin = null;
	var browserversion = parseInt(navigator.appVersion);
	if (browserversion >= 4) {
		PopLeft = (screen.width - xwidth) / 2;
		PopTop = (screen.height - xheight) / 2;
	} else {
		PopLeft = 0;
		PopTop = 0;
	}
	if (!PopUpWin || PopUpWin.closed()){
		PopUpWin = window.open(fname, wname, 'toolbar=0,location=center,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,width=' + xwidth + ',height=' + xheight + ',left=' + PopLeft + ',top=' + PopTop);
		prmpopup = PopUpWin;
		PopUpWin.focus();
	}
	if (navigator.appName == 'Netscape') PopUpWin.focus();
}
function popupModalScroll(fname, wname, xwidth, xheight){
	var PopUpWin = null;
	var browserversion = parseInt(navigator.appVersion);
	if (browserversion >= 4) {
		PopLeft = (screen.width - xwidth) / 2;
		PopTop = (screen.height - xheight) / 2;
	} else {
		PopLeft = 0;
		PopTop = 0;
	}
	if (!PopUpWin || PopUpWin.closed()){
		PopUpWin = window.open(fname, wname, 'toolbar=0,location=center,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=' + xwidth + ',height=' + xheight + ',left=' + PopLeft + ',top=' + PopTop);
		prmpopup = PopUpWin;
		PopUpWin.focus();
	}
	if (navigator.appName == 'Netscape') PopUpWin.focus();
}

function openModal(fname, xwidth, xheight, strArgs){
	var strParams = 'dialogWidth:' + xwidth + 'px; dialogHeight:' + xheight + 'px; center:yes; help:no; status:no;';
	return window.showModalDialog(fname, strArgs, strParams);
}
function openModeless(fname, xwidth, xheight, strArgs){
	var strParams = 'dialogWidth:' + xwidth + 'px; dialogHeight:' + xheight + 'px; center:yes; help:no; status:no; resizable:yes;';
	return window.showModelessDialog(fname, strArgs, strParams);
}
function popNav(url,name,features) {
	if (popBox && !popBox.closed) {
		popBox.close();
	}
	popBox = window.open(url,name,features);
}