<!-- // calendar script
	//id of element to change
	var calendarID = "calendar";
	//calendar URL
	
	var calendarURL = "/tools/descalendar/index.php";

	var xmlhttp=false;
	/*@cc_on @*/
	/*@if (@_jscript_version >= 5)
	// JScript gives us Conditional compilation, we can cope with old IE versions.
	// and security blocked creation of the objects.
	 try {
	  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	 } catch (e) {
	  try {
	   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	  } catch (E) {
	   xmlhttp = false;
	  }
	 }
	@end @*/
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
		try {
			xmlhttp = new XMLHttpRequest();
		} catch (e) {
			xmlhttp=false;
		}
	}
	if (!xmlhttp && window.createRequest) {
		try {
			xmlhttp = window.createRequest();
		} catch (e) {
			xmlhttp=false;
		}
	}


	function getCalendar(){
		var strCalendar = '';
		
		var objCalendar = document.getElementById(calendarID);
		if(xmlhttp){
			xmlhttp.open("GET",calendarURL,true);
			xmlhttp.onreadystatechange=function() {
				if (xmlhttp.readyState==4) {
					strCalendar = xmlhttp.responseText;
					//now, make sure it 
					if(strCalendar.indexOf('<table id="calendartable">')==0){
						objCalendar.innerHTML = strCalendar;
					}else{
						objCalendar.innerHTML = "Calendar Unavailable";
					}
				}
			}
			 xmlhttp.send(null);
		}
		

	}
	
	// now, need to call getCalendar on load
	// this function was developed by Simon Willison to allow adding onload events without blowing away other existing ones
	function addLoadEvent(func) {
		var oldonload = window.onload;
		if (typeof window.onload != 'function') {
			window.onload = func;
		} else {
			window.onload = function() {
				if (oldonload) {
					oldonload();
				}
				func();
			}
		}
	}
	
	//use the above function to generate the calendar
	addLoadEvent(getCalendar);
	/* 
	addLoadEvent(function() {
		more code to run on page load 
	}
	*/

-->		
