var xmlHttp = null; // Defines that xmlHttp is a new variable.
function XMLrequest() {
	// Try to get the right object for different browser
	try {
		// Firefox, Opera 8.0+, Safari, IE7+
		xmlHttp = new XMLHttpRequest(); // xmlHttp is now a XMLHttpRequest.
	} catch (e) {
		// Internet Explorer
		try {
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	 
	xmlHttp.onreadystatechange = XMLstateChange;
}
	 
function XMLstateChange() {
	if (xmlHttp.readyState == 4){
		if (xmlHttp.status == 200) {
			//Set the main HTML of the body to the info provided by the AJAX Request
			document.getElementById('display').innerHTML = xmlHttp.responseText;
		}
	}
}
function request(url) {
	XMLrequest();
	xmlHttp.open('GET', url);
	xmlHttp.send(null);
	if(!xmlHttp.getResponseHeader("Date")){
		var cached = xmlHttp;
		XMLrequest();
		var ifModifiedSince = cached.getResponseHeader("Last-Modified");
		ifModifiedSince = (ifModifiedSince) ?
			ifModifiedSince : new Date(0); // January 1, 1970
		xmlHttp.open("GET", url, false);
		xmlHttp.setRequestHeader("If-Modified-Since", ifModifiedSince);
		xmlHttp.send("");
		if(xmlHttp.status == 304){
			xmlHttp = cached;
		}
	}
}

function onair() {
	request('includes/display_AJAX.php');
	setInterval("request('includes/display_AJAX.php');", 60000);
}

