function ajaxSend(url, callback) {
	function ajaxBindCallback() {
		if (ajaxRequest.readyState == 4) {
			if (ajaxRequest.status == 200) {
				if (ajaxCallback) {
					ajaxAct(ajaxRequest.responseXML);
				} else {
					alert('No callback defined.');
				}
			} else {
				alert("There was a problem retrieving the xml data:\n" + ajaxRequest.status + ":\t" + ajaxRequest.statusText + "\n" + ajaxRequest.responseText);
			}
		}
	}
	var ajaxRequest = null;
	var ajaxCallback = callback;
	if (window.XMLHttpRequest) {
		ajaxRequest = new XMLHttpRequest();
		ajaxRequest.onreadystatechange = ajaxBindCallback;
		ajaxRequest.open("GET", url, true);
		ajaxRequest.send(null);
	} else if (window.ActiveXObject) {
		ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
		if (ajaxRequest) {
			ajaxRequest.onreadystatechange = ajaxBindCallback;
			ajaxRequest.open("GET", url, true);
			ajaxRequest.send();
		}
	}
}

function ajaxAct(theData) {
	response = theData.documentElement;
	method = response.getElementsByTagName('method')[0].firstChild.data;
	resultCount = response.getElementsByTagName('resultcount')[0].firstChild.data;
	result = "";
	for (i=0; i<=resultCount; i++) {
		result += response.getElementsByTagName('result')[i].firstChild.data;
	}
	eval(method + '(result)');
}

function checkEmailExists(response) {
	Readout = document.getElementById('emailResponse');
	Readout.innerHTML = "";
	if (response == 1) {
		Readout.className = "error";
		Readout.innerHTML = "This email address is already in use by a member of the Fifty Lessons site &#8211; please sign in at the top of any page to review your current status and order Membership Packs and Tactical Packs accordingly.";
	} else {
		Readout.className = "hidden";
		Readout.innerHTML = "";
	}
}

function displayRating(response) {
	Readout = document.getElementById('ratingresult');
	Readout.innerHTML = "";
	Readout.innerHTML = response;
}

function displayVideo(response) {
	Readout = document.getElementById('videocontent');
	Readout.innerHTML = "";
	Readout.innerHTML = response;
}



