/*
 * ncdt java functions
*/
function ncdt()
{
/*
 * selects the courses when the schools have been set
 * changes the inner html for the courses form element
*/
function doCourses(schoolEl)
	{
	//alert("do courses for "+ schoolEl.value);
	//alert("the node: "+ theNode +" the parent: " + theParent + " the basePath is: " + basePath);
	//set the posing vars
	var vars = "school="+schoolEl.value+"&doCourseAjax=1";
	http.open('post', window.location, true);
	//headers must be set for sending the post variables
	http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	http.setRequestHeader("Content-length", vars.length);
	http.setRequestHeader("Connection", "close");
	//uncomment the lower line when ready - at the moment just using ajax to set sessions
	http.onreadystatechange = outCourses;
	http.send(vars);
	}
	//define the variable
	this.doCourses = doCourses;

/*
 * outputs the inner html for the courses receiving the ajax response
*/
function outCourses()
	{
	if(http.readyState == 4)
			{
			var response = http.responseText;
			var courseBox = document.getElementById('courses_drop');
			courseBox.innerHTML = response;
			}
	}
	//define the variable
	this.outCourses = outCourses;

}
//set the class
var ncdt = new ncdt;

