<!--
window.onload = function () {
	// Register event handler.
	document.onkeydown = CaptureKeydown;
}

// Processes the keydown event to control keystrokes in the web app.
function CaptureKeydown(e) {
	if (!e) e = window.event;
	//alert(e.keyCode);
	
	// Capture backspace.
	if (e.keyCode == 8)
	{
		// Set default to ignore all.
		event.returnValue = false;
		
		// Allow inside of certain inputs...
		if (e.srcElement.type)
		{
			// text fields
			if (e.srcElement.type.indexOf("text") > -1 || e.srcElement.type.indexOf("password") > -1) event.returnValue = true;
		}
	}
	
	// Capture keystrokes that include CTRL key.
	if (e.ctrlKey)
	{
		// Allow CTRL + (C, V, X, Y, Z) keypress.
		if (e.keyCode == 67 || e.keyCode == 86 || e.keyCode == 88 
			|| e.keyCode == 89 || e.keyCode == 90) {
			// do nothing.
		}
		else {	// ignore others.
			event.returnValue = false;
		}
	}
}


var popUpWin;
var appRoot = '/LAMS/';

// Cleans up any open windows.
function CleanUpWindow() {
	if (popUpWin != null)
		popUpWin.close();
} 


// Opens a window.
function OpenWindow(url, winName) {
	//alert(url);
	// check optional param.
	if (winName == null) winName = 'mhfpopupwin';
	// Open window.
	popUpWin = window.open(url, winName, 'width=800,height=600,left=50,top=50,resizable');
}


// Opens a window for LAMS report.
function OpenReportWindow(reportNameEnum, paramPrompt) {
	var url = appRoot + 'Report/reportHome.aspx?rpt=' + reportNameEnum;
	if (paramPrompt == null) url = url + "&prompt=1";
	else url = url + "&prompt=" + paramPrompt;
		
	OpenWindow(url, 'mhfReportWin');
}


// Opens a window for LAMS report.
function OpenReportWindowURL(url) {
	OpenWindow(url, 'mhfReportWin');
}

document.body.onunload = CleanUpWindow;
// -->