//AJAX
function Inint_AJAX() {try { return new ActiveXObject("Msxml2.XMLHTTP");  } catch(e) {} //IEtry { return new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) {} //IEtry { return new XMLHttpRequest();          } catch(e) {} //Native Javascriptalert("Your browser does not support HTTP Request");return null;};

function SignUp_Validate(form) {var req = Inint_AJAX();
var thename = form.name.value;
var theemail = form.email.value;
var thebmonth = form.bmonth.value;
var thebday = form.bday.value;
var thebyear = form.byear.value;
req.onreadystatechange = function () { if (req.readyState==4) {      if (req.status==200) {
	var response = req.responseText;
	if (response == 'Underage') {
window.location.href=window.location.href;

	} else if (response == 'No Errors') {
	SignUp_Process(form);
	} else {
	document.getElementById('errormsg').innerHTML=response; //return value;
	}      } }};

var fields = "name="+thename+"&email="+theemail+"&bday="+thebmonth+"-"+thebday+"-"+thebyear;req.open("POST", "process_signupvalidate.php", true);req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=iso-8859-1");req.send(fields);};


function SignUp_Process(form) {var req = Inint_AJAX();
var thename = form.name.value;
var theemail = form.email.value;
var thebmonth = form.bmonth.value;
var thebday = form.bday.value;
var thebyear = form.byear.value;
req.onreadystatechange = function () { if (req.readyState==4) {      if (req.status==200) {
	var response = req.responseText;
	document.getElementById('signup').innerHTML=response; //return value;      } }};

var fields = "name="+thename+"&email="+theemail+"&bday="+thebmonth+"-"+thebday+"-"+thebyear;req.open("POST", "process_signup.php", true);req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=iso-8859-1");req.send(fields);};
