	// Set path to PHP script
	var phpscript_send = 'send2.php';
	
	function createRequestObject_send() {
	
		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 creating the XMLHttpRequest object');
		}
	
		return req;
	
	}
	
	// Make the XMLHttpRequest object
	var http = createRequestObject_send();
	
	
	function sendRequestPost_send() {
		
		var name = document.getElementById('name').value;
		var email = document.getElementById('email').value;
		var phone = document.getElementById('phone').value;
		var office_name = document.getElementById('office_name').value;
		var class_or_event = document.getElementById('class_or_event').value;
		var date_of_class = document.getElementById('date_of_class').value;
		var email_comments = document.getElementById('email_comments').value;

	
		// Open PHP script for requests
		http.open('post', phpscript_send);
		http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
		http.onreadystatechange = handleResponsePost_send;
		http.send('name=' + name + '&email=' + email + '&phone=' + phone + '&office_name=' + office_name + '&class_or_event=' + class_or_event + '&date_of_class=' + date_of_class + '&email_comments=' + email_comments);
	
	}
	
	
	function handleResponsePost_send() {
	if(http.readyState == 1){ 
			document.getElementById("response_contact").innerHTML = "Please wait, loading..." ; 
		} else if(http.readyState == 4 && http.status == 200){
	
			// Text returned from PHP script
			var response_contact = http.responseText;

			if (response_contact) {
				// Update ajaxTest2 content
				document.getElementById("response_contact").innerHTML = response_contact;
			}

			var varthankyou_contact = http.responseText.indexOf('Your message was sent');

			if (varthankyou_contact != -1) {
				document.getElementById('myForm').reset();
			}

		}
	}