//Set the interval for retrieving comments

function getComments(){
	var comments;  // The variable that makes Ajax possible!
	
	try{
		// Opera 8.0+, Firefox, Safari
		comments = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			comments = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				comments = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Your browser does not support XMLHttpRequest, real-time Username checking may not work!");
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	comments.onreadystatechange = function(){
		if(comments.readyState == 4){
                        
                        var commentsDisplay = document.getElementById('comments');
			commentsDisplay.innerHTML = comments.responseText;
		}
	}
        
	comments.open("POST", "/includes/get-comments.php", true);
	comments.send(null);
};

getComments();

setInterval(getComments, 18000);
