	var serviceAvailable = false;
	function sendGetRequest(url, callback) {
		var xhr = new XMLHttpRequest();

		xhr.open("GET", url);
		xhr.onreadystatechange=function() {
			if(xhr.readyState != 4) return;
			if (xhr.responseText) {
				serviceAvailable = true;
				callback(xhr.responseText);
			}
		}
		xhr.send(null);
	}

	function load() {
		sendGetRequest("http://www.4htechclub.org/gadgets/calendarGadget.txt", function(data) {
			if (serviceAvailable) {
				document.getElementById("calendar").innerHTML = data;
			} else {
				document.getElementById("calendar").innerHTML = "Service Not Available.  <a href='javascript:load()'>Retry</a>";
			}
			setTimeout("load()", 30 * 60 * 1000);
			serviceAvailable = false;
		});
	}
	function scroll(dir) {
		window.scrollBy(0, dir * 20);
		var scroll = document.getElementById("scroll");
		scroll.style.top = (parseInt(scroll.style.top, 10) + dir * 20) + "px";
	}

window.onload = function() {
	load();
	document.getElementById("scroll").style.top = "15px";
}
