function goProfile(educator){
    var  myDiv = document.getElementById('question');
	myDiv.innerHTML = "<span class='darkRed'>Working . . . </span>";
	
	if (educator == "Yes") {
		window.location = "profile2.php";
	}
	else {
		window.location = "profile.php";
	}
}

function makeHttpObject() {    
var xmlhttp=false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
 try {
  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 } catch (e) {
  try {
   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (E) {
   xmlhttp = false;
  }
 }
@end @*/
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
	try {
		xmlhttp = new XMLHttpRequest();
	} catch (e) {
		xmlhttp=false;
	}
}
if (!xmlhttp && window.createRequest) {
	try {
		xmlhttp = window.createRequest();
	} catch (e) {
		xmlhttp=false;
	}
}


return xmlhttp;
}



function checkID() {
	var  idDiv = document.getElementById('identifierText');
	idDiv.innerHTML = "<span class='darkRed'>Working . . . </span>";
	var sRequest = makeHttpObject();
	sRequest.onreadystatechange = function() { getResults(sRequest); };
   	sRequest.open("POST", 'checkIdentifier.php', true);
	sRequest.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	var param = "identifier=" + document.getElementById('identifier').value;
	sRequest.send(param);
	
}



function getResults(sRequest) {
	var  idDiv = document.getElementById('identifierText');
	if (sRequest.readyState == 4) {
		var response = sRequest.responseText;
		if (response != 'Okay') {
			idDiv.innerHTML = "<span class='darkRed'>Unique identifier not found. Try again or begin a new session.</span>";
		}
		else {
			window.location = "start.php";
			
		}
	}
}

function blockSubmit() {
				checkID();
				return false;
}
