<!-- 
/*
TODO:
	handle AJAX Failure

1) Decorate upper & lower school select lists to handle content update dynamically
	"calendarSelect" class labels html select lists
	Iterate
		use href & attach to callback event
		
2) Callback event: On selection, pull calendar XML and display in
	"calendarAreaContent" id element
	Get Xml
	iterate and load into page
	
DEPENDS
	grui 
		grui-dom-event
*/
if (typeof GR == "undefined") {
	GR ={};
}
if (typeof GR.calendar == "undefined") {
	GR.calendar ={};
}
GR.calendar.pageLoader = function(){
	GR.calendar.decorateSchoolSelects();
};

GR.calendar.decorateSchoolSelects = function(){
	var calendarSelectNodes = HRGR.util.Dom.getElementsByClassName('calendarSelect');
	var optionCollection = HRGR.util.Dom.getElementsByClassName('cal_option', 'option');
	for(var i=0; i<calendarSelectNodes.length;i++){
		var obj = { selectNode: calendarSelectNodes[i], collection: optionCollection};
		HRGR.util.Event.addListener(calendarSelectNodes[i],"change",GR.calendar.selectSchool,obj);
	}
}; //END GR.calendar.decorateSchoolSelects 

GR.calendar.selectSchool = function(e,obj){
	//obj.collection
	var sXmlUrl = obj.selectNode.value;
	if(typeof sXmlUrl == 'undefined' || sXmlUrl == '' || sXmlUrl.length < 1) { return false;	}
	var ajaxCall = HRGR.util.Connect.asyncRequest('GET', sXmlUrl, GR.calendar.callbackXmlReqObj, null); 
	return false;
}; //END GR.calendar.clickSchool

GR.calendar.callbackXmlReqObj = {
	success: function(o) { GR.calendar.parseXmlIntoPage(o.responseXML)},
  	failure: function(o) { alert("failure"); }  	
}; //END GR.calendar.callbackXmlReq

GR.calendar.parseXmlIntoPage = function(textXml){
	var ele = document.getElementById("calendarAreaContent");
	var root = textXml.documentElement;
	var schoolContentNodes = root.getElementsByTagName('citi:schoolcontent');
	if(schoolContentNodes.length == 0) {
		schoolContentNodes = root.getElementsByTagName('schoolcontent');
	}
	var schoolContent = schoolContentNodes[0].firstChild.nodeValue;
	ele.innerHTML=schoolContent;
	//alert(textXml);
}; //END GR.calendar.parseXmlIntoPage


/*
*/

// MAIN ----------------------------------------------------------------
HRGR.util.Event.addListener(window, "load", GR.calendar.pageLoader);

-->