// JavaScript Document

function FixDiv(filetype) {
	if (filetype == "terms") {
		var offset = 85;
	} else {
		if (filetype == "help") {
			var offset = 86;
		} else {
			if (filetype == "helpBasic") {
				var offset = 84;
			}
		}
	}
	var myInnerDiv = document.getElementById('divInside');
	var myOuterDiv = document.getElementById('divOutside');
	if (myInnerDiv) {
		myInnerDiv.style.pixelHeight = myOuterDiv.style.pixelHeight - offset;
	}
}

function FixHeader() {
	if (document.getElementById("divResults")) {
		document.getElementById("divResults").scrollTop = document.getElementById("divResults").scrollTop + 2;
	}
}

function getTZ_old() {
	document.Form1.TimeZone.value = new Date().getTimezoneOffset();
	document.Form1.TimeZone.value = -document.Form1.TimeZone.value;
}

function SaySorry()
{
	var winstring = 'resizable=no,status=no,location=no,toolbar=no,titlebar=no,menubar=no,width=420,height=197,left=' + ((window.screen.availWidth - 420) / 2) + ',top=' + ((window.screen.availHeight - 197) / 2);
	sorry_window = window.open('Sorry.aspx', '_blank', winstring);
	sorry_window.focus();		
}

function SayThanks(thanksfile) {
	var winstring = 'resizable=no,status=no,location=no,toolbar=no,titlebar=no,menubar=no,width=420,height=197,left=' + ((window.screen.availWidth - 420) / 2) + ',top=' + ((window.screen.availHeight - 197) / 2);
	thanks_window = window.open(thanksfile, '_blank', winstring);
	thanks_window.focus();		
}

function setTableHeight(tblID1, tblID2) {
	var objID1 = document.getElementById(tblID1);
	var objID2 = document.getElementById(tblID2);
	if (objID1.clientHeight > objID2.clientHeight) {
		objID2.height = objID1.clientHeight + 2;
	} else {
		objID1.height = objID2.clientHeight + 2;
	}
}

function ShowBusy() {
    window.status = "Please wait...";
	document.body.style.cursor ="wait";
	return true;
}

function ShowHelp(helpfile) {
	var winstring = 'resizable=no,status=no,location=no,toolbar=no,titlebar=no,menubar=no,width=485,height=350,left=' + ((window.screen.availWidth - 485) / 2) + ',top=' + ((window.screen.availHeight - 350) / 2);
	reghelp_window = window.open(helpfile, '_blank', winstring);
	reghelp_window.focus();	
}

function ShowHelpReg(registered, helpfile1, helpfile2) {
	var winstring = 'resizable=no,status=no,location=no,toolbar=no,titlebar=no,menubar=no,width=485,height=350,left=' + ((window.screen.availWidth - 485) / 2) + ',top=' + ((window.screen.availHeight - 350) / 2);
	if (registered) {
		reghelp_window = window.open(helpfile1, '_blank', winstring);
	} else {
		reghelp_window = window.open(helpfile2, '_blank', winstring);
	}
	reghelp_window.focus();
}

function ShowIntro(introFile) {
	var winstring = 'resizable=no,status=no,location=no,toolbar=no,titlebar=no,menubar=no,width=420,height=195,left=' + ((window.screen.availWidth - 420) / 2) + ',top=' + ((window.screen.availHeight - 195) / 2);
	regintro_window = window.open(introFile, '_blank', winstring);
	regintro_window.focus();			
}

function ShowIntroAuth(authenticated, introFile1, introFile2) {
	var winstring = 'resizable=no,status=no,location=no,toolbar=no,titlebar=no,menubar=no,width=420,height=197,left=' + ((window.screen.availWidth - 420) / 2) + ',top=' + ((window.screen.availHeight - 197) / 2);
	if (authenticated) {
		regintro_window = window.open(introFile1, '_blank', winstring);	
	} else {
		regintro_window = window.open(introFile2, '_blank', winstring);
	}
	regintro_window.focus();		
}
		
function ShowNotBusy() {
    window.status = "Done";
	document.body.style.cursor ="default";
	return true;
}

function ShowTerms()	{
	var winstring = 'resizable=no,status=no,location=no,toolbar=no,titlebar=no,menubar=no,width=485,height=350,left=' + ((window.screen.availWidth - 485) / 2) + ',top=' + ((window.screen.availHeight - 350) / 2);
	terms_window = window.open('Terms.aspx', '_blank', winstring);
	terms_window.focus();	
}

function ShowSnapshot(reportName)	{
	var winstring = 'resizable=yes,status=no,location=no,toolbar=no,titlebar=no,menubar=no,width=900,height=600,left=' + ((window.screen.availWidth - 900) / 2) + ',top=' + ((window.screen.availHeight - 600) / 2);
	terms_window = window.open(reportName, '_blank', winstring);
	terms_window.focus();	
}
