	var http_request = false;

   function makeRequest(url, parameters) {
      http_request = false;
      if (window.XMLHttpRequest) { // Mozilla, Safari,...
         http_request = new XMLHttpRequest();
         if (http_request.overrideMimeType) {
         	// set type accordingly to anticipated content type
            //http_request.overrideMimeType('text/xml');
            http_request.overrideMimeType('text/html');
         }
      } else if (window.ActiveXObject) { // IE
         try {
            http_request = new ActiveXObject("Msxml2.XMLHTTP");
         } catch (e) {
            try {
               http_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
         }
      }
      if (!http_request) {
         alert('Cannot create XMLHTTP instance');
         return false;
      }
      http_request.onreadystatechange = alertContents;
      http_request.open('GET', url + parameters, true);
      http_request.send(null);
   }

   function alertContents() {
      if (http_request.readyState == 4) {
         if (http_request.status == 200) {
           	//alert(http_request.responseText);
            //result = http_request.responseText;
            
            result = eval(http_request.responseText);
            
            //alert(result[2]);
            document.getElementById(result[0]).className = result[2]; 
                       
            alert(document.getElementById(result[0]).className);
         } else {
            alert('There was a problem with the request.');
         }
      }
   }
   
  
   
  //

function call_printUpdateDocuments() {
	agent.call('','printUpdateDocuments','callback_printUpdateDocuments');
	// Set a timeout to repeat this call every two seconds, controlled by the client.
	setTimeout('call_printUpdateDocuments()',20000);
}

function callback_printUpdateDocuments(str) {
	//alert(str);
	document.getElementById('divUpdateDocuments').innerHTML = str;
	//document.getElementById('divUpdateDocuments').innerHTML = "cheese";
}

function initDocuments()  {
	call_printUpdateDocuments();
}

// FORUMS

function call_printUpdateForums() {
	agent.call('','printUpdateForums','callback_printUpdateForums');
	// Set a timeout to repeat this call every two seconds, controlled by the client.
	setTimeout('call_printUpdateForums()',20000);
}

function callback_printUpdateForums(str) {
	document.getElementById('divUpdateForums').innerHTML = str;
}

function initForums()  {
	call_printUpdateForums();
}

// my faculty selection subject boxes

	//banners
	function call_printUpdate_banners() {
		agent.call('','printUpdateBanners','callback_printUpdate_banners');
		// Set a timeout to repeat this call every two seconds, controlled by the client.
		setTimeout('call_printUpdate_banners()',20000);
	}

	function callback_printUpdate_banners(str) {
		//document.getElementById('divBanners').innerHTML = str;
		document.getElementById('divBanners').innerHTML = "cheese";
	}

	function init_banners()  {
		call_printUpdate_banners();
	}


	//tripos subjects
	function call_printUpdate_my_fac_tripos_subjects() {
		agent.call('','printUpdate_my_fac_tripos_subjects','callback_printUpdate_my_fac_tripos_subjects');
		// Set a timeout to repeat this call every two seconds, controlled by the client.
		setTimeout('call_printUpdate_my_fac_tripos_subjects()',10000);
	}

	function callback_printUpdate_my_fac_tripos_subjects(str) {
		document.getElementById('divUpdate_my_fac_tripos_subjects').innerHTML = str;
	}

	function init_my_fac_tripos_subjects()  {
		call_printUpdate_my_fac_tripos_subjects();
	}

	//llm subjects
	function call_printUpdate_my_fac_llm_subjects() {
		agent.call('','printUpdate_my_fac_llm_subjects','callback_printUpdate_my_fac_llm_subjects');
		// Set a timeout to repeat this call every two seconds, controlled by the client.
		setTimeout('call_printUpdate_my_fac_llm_subjects()',10000);
	}

	function callback_printUpdate_my_fac_llm_subjects(str) {
		document.getElementById('divUpdate_my_fac_llm_subjects').innerHTML = str;
	}

	function init_my_fac_llm_subjects()  {
		call_printUpdate_my_fac_llm_subjects();
	}

	// other course and subjects
	function call_printUpdate_my_fac_other_subjects() {
		agent.call('','printUpdate_my_fac_other_subjects','callback_printUpdate_my_fac_other_subjects');
		// Set a timeout to repeat this call every two seconds, controlled by the client.
		setTimeout('call_printUpdate_my_fac_other_subjects()',10000);
	}

	function callback_printUpdate_my_fac_other_subjects(str) {
		document.getElementById('divUpdate_my_fac_other_subjects').innerHTML = str;
	}

	function init_my_fac_other_subjects()  {
		call_printUpdate_my_fac_other_subjects();
	}

	// selected my faculty pages

	function call_printUpdateResources() {
		agent.call('','printUpdateResources','callback_printUpdateResources');
		// Set a timeout to repeat this call every two seconds, controlled by the client.
		setTimeout('call_printUpdateResources()',1000);
	}

	function callback_printUpdateResources(str) {
		document.getElementById('divUpdateResources').innerHTML = str;
	}

	function initResources()  {
		call_printUpdateResources();
	}

	// selection box document classificatins (document upload wizard)

	// selected my faculty pages

	function call_printDocCatSelection() {
		agent.call('','printUpdateDocCatSelection','callback_printDocCatSelection');
		// Set a timeout to repeat this call every two seconds, controlled by the client.
		setTimeout('call_printDocCatSelection()',2000);
	}

	function callback_printDocCatSelection(str) {
		document.getElementById('divDocCatSelection').innerHTML = str;
	}

	function initDocCatSelection()  {
		call_printDocCatSelection();
	}
// my faculty selection boxes end
