// handles the response received from the server

AjaxUpdater = {};

AjaxUpdater.initialize = function()
{
    AjaxUpdater.isUpdating = false;
}
AjaxUpdater.initialize();


AjaxUpdater.Update = function(method, url, params, callback)
{
    if(callback == undefined || callback == "") { callback = AjaxUpdater.onResponse; }
    Ajax.makeRequest(method, url, params, callback);
    AjaxUpdater.isUpdating = true;
}
// the default response callback function
AjaxUpdater.onResponse = function()
{
    if(Ajax.checkReadyState('loading') == 200)
    {
		// now its ready so it's not updating
        AjaxUpdater.isUpdating = false;
    }
}




function pageResponse()
{
	
	if(Ajax.checkReadyState('listing_container') == "200"){
		var textResponse = Ajax.getResponse();
		
 		// display the user message
		var myDiv = document.getElementById("listing_container");
		document.getElementById("loadresult").innerHTML = textResponse;
		return false;
	}
  
}

/**************For Article***********************************/
function get_enrollment_result(enrollment_no)
{
	alert(enrollment_no);
	 try
    {
		if(typeof enrollment_no == 'undefined') enrollment_no=0;
		
		// create the params string
		var url = "result.php";
		//var params = 'page='+pageNumber+'&search='+searchQuery+getVars;
		var params = 'enrollmentid='+enrollment_no;
		
		AjaxUpdater.Update("GET",url,params,pageResponse);
		return false;
    }
    // display the error in case of failure
    catch (e)
    {
      alert("Can't connect to server:\n" + e.toString());
      return false;
    }
	
}
/****************** Testimonial*****************************************/

