function NW(mypage, myname, w, h) {
	if (w > screen.width) {
		w = screen.width - 40;
	}
	if (h > screen.height) {
		h = screen.height - 100;
	}
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2 - 30;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',toolbar=no,location=no,status=yes,menubar=no,scrollbars=yes,resizable=yes';
	win = window.open(mypage, myname, winprops);
	win.window.focus();
}

function CheckMail(){
 var email = document.login.email.value;
 if(email != "") self.location.href='check_email.php?chk=0&email='+ email;
  else self.location.href='forgot_password.php';
}

function checkBirthday(targetinput) {
//	datearray = targetinput.value.split("-");
	datearray = targetinput.split("-");
	Today = new Date();
	year = Today.getFullYear();
	if (datearray.length != 3 || datearray[0].length != 4 || isNaN(datearray[0]) || datearray[0] < 1900 || datearray[0] > 2000 || datearray[1].length != 2 || isNaN(datearray[1]) || datearray[1] < 1 || datearray[1] > 12 || datearray[2].length != 2 || isNaN(datearray[2]) || datearray[2] < 1 || datearray[2] > 31) {
		alert("Please enter correct date!");
		return 0;
	}
	else if (year - datearray[0] < 18) {
		if (!confirm('Your birthday entry indicates that you are under legal gambling age for all jurisdictions.\nIf your entry is in error, please close this window and correct it now.\nIf the entry is correct, please exit the registration.\nAll SGS registrants are required to show proof of age at a gaming venue to validate their account.\nAny SGS account that is not validated prior to first use will not function.\n\nPress OK to correct your birthday or CANCEL to exit SGS registration.')) {
			window.location = 'http://www.safegamingsystem.com/';
		}
		return 0;
	}
return 1;
}