function centerPositioning(x, y) {
	var theTop = (screen.height/2)-(y/2) - 40;
	var theLeft = (screen.width/2)-(x/2);
	if (navigator.appName == "Netscape") {
		theLocation = "screenY=" + theTop + ",screenX=" + theLeft;
	} else {		
		theLocation = "top=" + theTop + ",left=" + theLeft;
	}
	return theLocation;
}

function integersonly() {
	if (event.keyCode<48||event.keyCode>57)
		return false;
}

function charactersOnly() {
	if (!((event.keyCode > 47 && event.keyCode < 58) || 
		(event.keyCode > 64 && event.keyCode < 90) ||
		(event.keyCode > 96 && event.keyCode < 123)))
		return false;
}

function floatsonly() {
	if (!((event.keyCode>47 && event.keyCode<58) || event.keyCode==46))
		return false;
}

function thefocus() {
	self.focus();
}

function windowOpen(href, name, xSize, ySize, toolsVisibility) {
	
	if (toolsVisibility == 0) {
		var theWindow = window.open(href, name,
						"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width=" + xSize + ",height=" + ySize + "," + centerPositioning(xSize, ySize));
		theWindow.focus();
	} else {
		var theWindow = window.open(href, name,
						"toolbar=no,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=yes,width=" + xSize + ",height=" + ySize + "," + centerPositioning(xSize, ySize));
		theWindow.focus();
	}
}

function comeBack() {
	window.history.back();
}
