function ajaxSubmitter( resultsContainer ) {

	this.resultsContainer = resultsContainer;


	this.makeRequest = function(url, elementsToUpdate, valuesToUpdate ) {
		var httpRequest;
	
		if (window.XMLHttpRequest) { // Mozilla, Safari, ...
			httpRequest = new XMLHttpRequest();
			if (httpRequest.overrideMimeType) {
				httpRequest.overrideMimeType('text/xml');
			}
		} else if (window.ActiveXObject) { // IE
			try {
				httpRequest = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e) {
				try {
					httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
				} catch (e) {}
			}
		}
	
		if (!httpRequest) {
			this.resultsContainer.innerHTML = '<p class="error">Giving up :( Cannot create an XMLHTTP instance</p>';
			return false;
		} else {
			this.resultsContainer.innerHTML = '';
		}
		
		httpRequest.submitter = this;
		httpRequest.onreadystatechange = function() { this.submitter.getResponse(httpRequest, elementsToUpdate, valuesToUpdate); };
		httpRequest.open('GET', url, true);
		httpRequest.send('');
	
	}

	this.getResponse = function(httpRequest, elementsToUpdate, valuesToUpdate) {
		if (httpRequest.readyState == 4) {
			if (httpRequest.status == 200) {
				if (httpRequest.responseText.indexOf('<input type="hidden" name="success"/>') != -1) {
					// Check to see if an array or single element was passed in
					if (elementsToUpdate.constructor.toString().indexOf("Array") != -1) { 
						// if its an array update all the elements
						for ( i = 0; i < elementsToUpdate.length; i++ ) {
							if (typeof elementsToUpdate[i] != 'undefined' ){
								if (typeof valuesToUpdate[i] == 'undefined') valuesToUpdate[i] = '';
								elementsToUpdate[i].innerHTML = valuesToUpdate[i];
							}
						}
					// if its not an array only update the single element if defined
					} else if (typeof elementsToUpdate != 'undefined' ){
						if (typeof valuesToUpdate == 'undefined') valuesToUpdate = '';
						elementsToUpdate.innerHTML = valuesToUpdate;
					}
					this.resultsContainer.innerHTML = '';
				} else {
					this.resultsContainer.innerHTML = httpRequest.responseText;
				}
			} else {
				this.resultsContainer.innerHTML = '<p class="error">There was a problem with the request.</p>';
			}
		}
	}
}