/**
 * Thanks http://www.tizag.com/ajaxTutorial/index.php for an awesome ajax tutorial!
 *
 * Creates an ajax get request.  The parameter url determines the address to make the request to and the parameter
 * handler should be a function with a single parameter that will handle the ajax request.  An example would be:
 * function ajaxTest(text){
 *    alert(text);
 * }
 * Which would create an alert with whatever response was received from the ajax request.
 * @Param url the address you want to make a get request to
 * @Param handler the function to handle the response - should take a single parameter which is the response text
 */
function ajaxGetRequest(url, handler){
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} 
	catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
			handler(ajaxRequest.responseText);
		}
	}
	
	ajaxRequest.open("GET", url, true);
	ajaxRequest.send(null); 
}
