

	// ajax Function for clearing any options already displyed if a grade has been selected and then changed

	function clearOptions()
	{
		var classes = document.getElementById("classes");

		// Remove any options currently in the list

			classes.options.length = 0;

		// Set New Options

			optionItem = new Option( '', '',  true, true);
			classes.options[0] = optionItem;

		// Hide any Information

			var obj = document.getElementById('classInformation')
			obj.style.display = 'none';
	}



	// ajax Function for returning Classes after Grade has been selected


	function listClasses(server)
	{

		// Clear existing information

			var clear = clearOptions();


		// Get the required information

			var ajax = new sack();

			var gradeObj = document.getElementById('grade').value;
			var fileServer = server;

			function returnClasses()
			{
				if( gradeObj >= '1' )
				{
					ajax.requestFile = fileServer + '/ajax/listClasses.php?grade=' + gradeObj;
					ajax.onCompletion = displayClasses;
					ajax.runAJAX();
				}
			}

			function displayClasses()
			{
				var obj = document.getElementById('classes');
				eval(ajax.response);
			}

		var action = returnClasses();
	}



	// ajax Function for returning the selected Class Information

	function getInformation(server)
	{
		var ajax = new sack();

		var gradeObj = document.getElementById('grade').value;
		var classObj = document.getElementById('classes').value;
		var fileServer = server;

		var obj = document.getElementById('classInformation')
		obj.style.display = 'none';

		function returnInformation()
		{
			if( gradeObj >= '1' )
			{
				ajax.requestFile = fileServer + '/ajax/getInformation.php?grade=' + gradeObj + '&class=' + classObj;
				ajax.onCompletion = displayInformation;
				ajax.runAJAX();
			}
		}

		function displayInformation()
		{
			var obj = document.getElementById('classInformation');
			obj.style.display = 'block';
			obj.innerHTML = ajax.response;
		}

		var action = returnInformation();
	}