// define which browser is used
var IE = document.all?true:false;

function onEnterSubmit(formName) {
	if (window.event.keyCode == 13) {
		document.all[formName].submit();
	} else { return false; }
}

function openWindow(targetUrl, windowWidth, windowHeight) {
	var windowTop = (screen.height - windowHeight) / 3;
	var windowLeft = (screen.width - windowWidth) / 2;
	
	newWindow = open(targetUrl,"newWindow","scrollbars=yes,resizable=yes,status=yes,directories=no,menubar=no,toolbar=no,top=" + windowTop + ",left=" + windowLeft + ",width=" + windowWidth + ",height=" + windowHeight + "");
	newWindow.focus();
}


function openReport(targetUrl, windowWidth, windowHeight) {
	var windowTop = (screen.height - windowHeight) / 3;
	var windowLeft = (screen.width - windowWidth) / 2;
	
	reportWindow = open(targetUrl,"reportWindow","scrollbars=yes,resizable=no,status=yes,directories=no,menubar=no,toolbar=no,top=" + windowTop + ",left=" + windowLeft + ",width=" + windowWidth + ",height=" + windowHeight + "");
	reportWindow.focus();
}

function openFullWindow(targetUrl, windowWidth, windowHeight) {
	var windowTop = (screen.height - windowHeight) / 3;
	var windowLeft = (screen.width - windowWidth) / 2;
	window.open(targetUrl,"","scrollbars=yes,resizable=yes,status=no,top=" + windowTop + ",left=" + windowLeft + ",width=" + windowWidth + ",height=" + windowHeight + "");
}

function showCursor(wait) {
	doc = document.all;
	for(i = 0; i < doc.length; i++) {
		if (wait) { doc(i).style.cursor = 'wait'; } else { doc(i).style.cursor = 'auto'; }
	}
}