function createRequestObject() {
		var req;
		if(window.XMLHttpRequest){
			// Firefox, Safari, Opera...
			req = new XMLHttpRequest();
		} else if(window.ActiveXObject) {
			// Internet Explorer 5+
			req = new ActiveXObject("Microsoft.XMLHTTP");
		} else {
			// There is an error creating the object,
			// just as an old browser is being used.
			alert('There was a problem with your browser, please upgrade.');
		}
		return req;
	}
	
	// Make the XMLHttpRequest object
	var http = createRequestObject();
	
	function sendRequestGet(ajaxget) {
		// Open PHP script for requests
		http.open('get', ajaxphpscript+'?ajaxget='+ajaxget);
		http.onreadystatechange = handleResponseGet;
		http.send(null);
	}
	
	function sendRequestPost(ajaxpost) {
		// Open PHP script for requests
		http.open('post', ajaxphpscript);
		http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
		http.onreadystatechange = handleResponsePost;
		http.send('ajaxpost='+ajaxpost);
	}
	
	function handleResponseGet() {
		if(http.readyState == 4 && http.status == 200){
			// Text returned from PHP script
			var response = http.responseText;
			if(response) {
				// Update ajaxTest content
				document.getElementById("ajaxmessage").innerHTML = response;
			}
		}
	}
	
	function handleResponsePost() {
		if(http.readyState == 4 && http.status == 200){
			// Text returned from PHP script
			var response = http.responseText;
			if(response) {
				// Update ajaxTest2 content
				document.getElementById("ajaxmessage").innerHTML = response;
			}
		}
	}