// JavaScript Document
	var RefreshContentReq;

		function RefreshContentXMLDoc(url) {

			// branch for native XMLHttpRequest object
			if (window.XMLHttpRequest) {
				RefreshContentReq = new XMLHttpRequest();
				RefreshContentReq.onreadystatechange = processRefreshContentChange;
				RefreshContentReq.open("GET", url, true);
				RefreshContentReq.send(null);
			// branch for IE/Windows ActiveX version
			} 
			else if (window.ActiveXObject) {
				RefreshContentReq = new ActiveXObject("Microsoft.XMLHTTP");
				if (RefreshContentReq) {
					RefreshContentReq.onreadystatechange = processRefreshContentChange;
					RefreshContentReq.open("GET", url, true);
					RefreshContentReq.send();
				}
			}
		}
		
		function processRefreshContentChange() {
		
			if(RefreshContentReq.readyState == 1){
				// No need to load anything until its done
			}
			// only if RefreshContentReq shows "complete"
			if (RefreshContentReq.readyState == 4) {
				// only if "OK"
				if (RefreshContentReq.status == 200) {
					// the goodnes
					var response = RefreshContentReq.responseText;
					
					// Check valid response, if its valid then load the search again and then load the existing courses
					if(trim(response) != "") {
						// Load in the content
						document.getElementById('buffer_load').innerHTML = response;
						
						// Increment the content
						currentContentID++;
						
						// If its greater than the max, set back to 1
						if(currentContentID > maxContentID) {
							currentContentID = 1;
						}
					} //ENd data not in error
				} 
				else {
					alert("There was a problem retrieving the XML data:\n" + RefreshContentReq.statusText);
				}
			}
		}
		
		function loadContent(pageID,contentID) {

			// Input mode
			url  = JSBase +'/includes/scripts/load_buffer_content.php?pageID='+ encodeURIComponent(pageID) +'&contentID='+ encodeURIComponent(contentID);
			RefreshContentXMLDoc(url);

		}
