
/* Create a new XMLHttpRequest object to talk to the Web server */
var xmlHttp = false;
try {
	xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
	try {
		xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	} catch (e2) {
		xmlHttp = false;
	}
}
if (!xmlHttp && typeof XMLHttpRequest != 'undefined') 
{
	xmlHttp = new XMLHttpRequest();
}

function callServer(url, section) 
{
  xmlHttp.open("GET", url, true);
  xmlHttp.onreadystatechange = function() { callBackUpdatePage(section); }
  xmlHttp.send(null);
}
function callBackUpdatePage(section) 
{
  if (xmlHttp.readyState == 4) 
  {
    var response = xmlHttp.responseText;
    if( section == "AJAXtheme" )
    {
    	document.getElementById("AJAXtheme").innerHTML = response.substring(response.indexOf('<sp'+'an id'+'="AJ'+'AX'+'th'+'eme">')+21, response.indexOf('</sp'+'an>'+'</bo'+'dy>'));
    }
    else if( section == "AJAXsearchresults" )
    {
    	document.getElementById("AJAXsearchresults").innerHTML = response.substring(response.indexOf('<sp'+'an id'+'="AJ'+'AX'+'se'+'arch'+'res'+'ul'+'ts">')+29, response.indexOf('</ta'+'ble>'+'</sp'+'an>'));
    }
    else if( section == "AJAXpdfviewer" )
    {
    	//document.getElementById("AJAXpdfviewer").innerHTML = response.substring(response.indexOf('<sp'+'an id'+'="AJ'+'AX'+'pd'+'fv'+'ie'+'wer">')+25, response.indexOf('</ta'+'ble>'+'</sp'+'an>'));
    	document.getElementById("AJAXpdfviewer").innerHTML = response.substring(response.indexOf('<sp'+'an id'+'="AJ'+'AX'+'pd'+'fv'+'ie'+'wer">')+25, response.indexOf('</sp'+'an>'+'<!--'+'#'+'-->'));
    }
  }
}

