function init(notice) {
	var f = document.form1;

	if (window.screen) {
		if (screen.width) f.screenw.value = screen.width;
		if (screen.height) f.screenh.value = screen.height;
		if (screen.colorDepth) f.screend.value = screen.colorDepth;
	}

	if (document.form1.uid && document.form1.uid.type == "text") document.form1.uid.focus();

	if (notice)
		window.open("notice.asp","notice","left=0,top=0,width=350,height=225,resizable=no,scrollbars=no");
}

function view_help(pagelocation) {
	popWin = window.open(pagelocation, 'newwindowWin', 'toolbar=no,location=no,resizable=yes,scrollbars=yes,width=500,height=325,left=0,top=0')
}

function checkKey(e) {
	var keyPressed = (document.all) ? event.keyCode : e.keyCode;
	if (keyPressed == 13) {
		submitForm();
		return false;
	}
}

function openWindow(loc, winWd, winHt, winCen, winSize, winScroll) {
	var winLeft = (winCen) ? (screen.width  - winWd) / 2 : 0;
	var winTop  = (winCen) ? (screen.height - winHt) / 2 : 0;
	var winName = (loc.indexOf("/") == -1) ? loc.split(".")[0] : (loc.indexOf(".") == -1) ? loc.split("/")[loc.split("/").length-1].split(".")[0] : String(new Date().getTime());
	winSize     = (winSize)   ? "yes" : "no";
	winScroll   = (winScroll) ? "yes" : "no";

	var popWin  = window.open(loc, winName, "toolbar=no,location=no,status=no,resizable=" + winSize + ",scrollbars=" + winScroll + ",width=" + winWd + ",height=" + winHt + ",left=" + winLeft + ",top=" + winTop);

	popWin.focus();
}

function submitForm() {
	if (document.all && window.external) window.external.AutoCompleteSaveForm(form1);
	document.form1.submit();
}

if (document.layers)                 { document.captureEvents(Event.KEYDOWN); }
if (document.layers || document.all) { document.onkeydown = checkKey; }
if (document.addEventListener)       { document.addEventListener('keydown', checkKey, true); }