// JavaScript Document

//#######################################################################
// Constant variables for all scripts
//#######################################################################
var ScrnSize = "UnCommon"
var isIE = false;
var isNetscape = false;
var helpHeight;
var helpWidth;
var helpPointWidth;
var helpPointHeight;
var csHeight;
var csWidth;
var csPointWidth;
var csPointHeight;
var processHeight;
var processWidth;
var processPointWidth;
var processPointHeight;
var ppHeight;
var ppWidth;
var ppPointWidth;
var ppPointHeight;
var promptHeight;
var promptWidth;
var promptPointWidth;
var promptPointHeight;
var popupFlag = false;
var WaitWindow;


//############################################################################
// Determine if Netscape browser or IE Browser
//############################################################################

if (navigator.appVersion.indexOf("4.") != -1 && navigator.appName.indexOf("Explorer") != -1)
{
	isIE = true;
}
if (navigator.appVersion.indexOf("4.") != -1 && navigator.appName.indexOf("Netscape") != -1)
{
	isNetscape = true;
}

//############################################################################
// Determine size of popup screens that are displayed
// Determine center point of screen for popups to appear
// It does this for both Netscape and IE as they handle resolution differently
//############################################################################

if(isNetscape)
{
	helpHeight = 440;
	helpWidth = 440;
	promptHeight = 245;
	promptWidth = 400;
	csHeight = 250;
	csWidth = 400;
	processHeight = 85;
	processWidth = 200;
	ppHeight = 440;
	ppWidth = 380;
	
} else {
	helpHeight = 440;
	helpWidth = 470;
	promptHeight = 240;
	promptWidth = 420;
	csHeight = 260;
	csWidth = 436;
	processHeight = 85;
	processWidth = 200;
	ppHeight = 440;
	ppWidth = 436;
	
}

promptPointWidth = (screen.width - promptWidth) / 2; 
helpPointWidth = (screen.width - helpWidth) / 2; 
csPointWidth = (screen.width - csWidth) / 2; 
processPointWidth = (screen.width - processWidth) / 2;
ppPointWidth = (screen.width - ppWidth) / 2; 

promptPointHeight = (screen.height - promptHeight) / 2;
helpPointHeight = (screen.height - helpHeight) / 2;
csPointHeight = (screen.height - csHeight) / 2;
processPointHeight = (screen.height - processHeight) / 2;
ppPointHeight = (screen.height - ppHeight) / 2;




//#############################################################################################
// If a popup successfully opens it will call setPopupFlag()
// If setPopupFlag() is not called by popup window due to popup blocker, automatically logout.
//##############################################################################################

var loopCounter = 0;
function verifyPopUp(){
	if (!popupFlag){
		if (loopCounter > 10){
			window.location = "blocked.asp";
		} else {
			loopCounter++;
			setTimeout("verifyPopUp()",1000);
		}
	}
}

function setPopupFlag(){
	popupFlag = true;
}

//############################################################################
// Open Help Menu based on Browser / Resolutions settings determined above.
//############################################################################

function openHelp(myInPage) {
	myPage = "NTAWebHelp.aspx?pg=" + myInPage;
	window.open(myPage,'help','location=no,status=no,menubar=no,resizeable=no,scrollbars=yes,toolbar=no,width='+ helpWidth + ',height=' + helpHeight + ',left=' + helpPointWidth + ',top=' + helpPointHeight + ',screenx=' + helpPointWidth + ',screeny=' + helpPointHeight);
}
//############################################################################
// Open Confirmation Page based on Browser / Resolutions settings determined above.
//############################################################################

function openConf(myInPage) {
	myPage = "NTAConfirmation.aspx?pg=" + myInPage;
	window.open(myPage,'Confirmation','location=no,status=no,menubar=no,resizeable=no,scrollbars=yes,toolbar=no,width='+ helpWidth + ',height=' + helpHeight + ',left=' + helpPointWidth + ',top=' + helpPointHeight + ',screenx=' + helpPointWidth + ',screeny=' + helpPointHeight);
}
//############################################################################
// Open Message Page based on Browser / Resolutions settings determined above.
//############################################################################

function openMess(myInPage) {
	myPage = "NTAMessage.aspx?pg=" + myInPage;
	window.open(myPage,'NTAMessage','location=no,status=no,menubar=no,resizeable=no,scrollbars=yes,toolbar=no,width='+ helpWidth + ',height=' + helpHeight + ',left=' + helpPointWidth + ',top=' + helpPointHeight + ',screenx=' + helpPointWidth + ',screeny=' + helpPointHeight);
}
//############################################################################
// Open Processing Window while page loads.
//############################################################################

function goProcess(){
	WaitWindow = window.open('processing.asp','WaitWindow','location=no,status=no,menubar=no,resizeable=no,scrollbars=no,toolbar=no,width='+ processWidth + ',height='+ processHeight + ',left=' + processPointWidth + ',top=' + processPointHeight + ',screenx=' + processPointWidth + ',screeny=' + processPointHeight);
}

//############################################################################
// Open Privacy Policy based on Browser / Resolutions settings determined above.
//############################################################################

function openPP() {
	myPage = "help/pp.asp";
	window.open(myPage,'pp','location=no,status=no,menubar=no,resizeable=no,scrollbars=yes,toolbar=no,width='+ ppWidth + ',height=' + ppHeight + ',left=' + ppPointWidth + ',top=' + ppPointHeight + ',screenx=' + ppPointWidth + ',screeny=' + ppPointHeight);
}

function maximize() {
	window.moveTo(0,0);
	if (document.all) {window.resizeTo(screen.availWidth,screen.availHeight);}
	else if (document.layers) {
		if
	(window.outerheight<screen.availHeight||window.outerwidth<screen.availWidth){
	window.outerHeight = screen.availHeight;
	window.outerWidth = screen.availWidth;
			}
		}
	}
	
				