function loadChatRefresh() {
	setTimeout("chatRefresh()", 30000);
}

function chatRefresh() {
	var xhr=null;
	if (window.XMLHttpRequest) { 
		xhr = new XMLHttpRequest();
	}
	else if (window.ActiveXObject) 
	{
		xhr = new ActiveXObject("Microsoft.XMLHTTP");
	}
	
	xhr.onreadystatechange = function() {
		messageReceived(xhr);
	};
	
	//on appelle le fichier reponse.txt
	xhr.open("GET", "http://www.triplax.com/discussions/1-ajax.html", true);
	xhr.send(null);
	
	setTimeout("chatRefresh()", 30000);
}

function messageReceived(xhr) {
	if (xhr.readyState == 4) {
		$oChatWindow = document.getElementById("ens_messages");
		$oChatWindow.innerHTML = xhr.responseText;
	}
}
