//Browser Support Code
function ajaxFunction(){
	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 does not support Javascript, please upgrade your software.");
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
			var ajaxDisplay = document.getElementById('ajaxDiv');
			ajaxDisplay.innerHTML = ajaxRequest.responseText;
		}else{
			var ajaxDisplay = document.getElementById('ajaxDiv');
			ajaxDisplay.innerHTML = "<h4 style='color:white; background-color:red;'>Loading...</h4>";
		}
	}
	var category = document.getElementById('category').value;
	var review_id = document.getElementById('review_id').value;
	var name = document.getElementById('name').value;
	var uc_url = document.getElementById('uc_url').value;
	var comment = document.getElementById('comment').value;
	comment = comment.replace(/\n/g, "br44ax4");
	comment = comment.replace(/#/g, "pound");
	comment = comment.replace(/&/g, "and");
	comment = comment.replace(/\+/g, "plus");
	var rating = document.getElementById('rating').value;
	var queryString = "?name=" + name + "&uc_url=" + uc_url + "&comment=" + comment + "&rating=" + rating + "&category=" + category + "&review_id=" + review_id;
	ajaxRequest.open("GET", "ajax-comment.php" + queryString, true);
	ajaxRequest.send(null); 
}

