function openCentered(theURL, winName, width, height, scrollbars) {
	if(scrollbars) scrollbars = 'scrollbars=yes';
	else scrollbars = '';
	window.open(theURL,winName,scrollbars + ',location=no,menubars=no,toolbars=no,width=' + width + ',height=' + height + ',left=' + ((screen.width/2)-(width/2)) + ',top=' + ((screen.height/2)-(height/2) - 10));
}
function forceNumbers(e) {
	if ((e.keyCode < 48) || (e.keyCode > 57)) {
		if (e.keyCode == 13) {
			return true;
		} else {
			return false;
		}
	}
}

function moveToNext(value, maxLength, goTo) {
	if (value.length >= maxLength) {
		goTo.focus();
		return true;
	}
}

function fitWindow(moveMe, centerVertically) {
	x = document.getElementById('wrapper');
	height = x.offsetHeight + 47;
	if(height > 640) height = 640;
	width = x.offsetWidth + 18;
	self.resizeTo(width,height);
	if(moveMe == true) {
		if(centerVertically == true) {
			self.moveTo(screen.width/2 - width/2, screen.height/2 - height/2);
		} else {
			self.moveTo(screen.width/2 - width/2, 60);
		}
	}
}
