﻿function createRequestObject_ajax() { 
	var req_ajax; 
	if(window.XMLHttpRequest){ 
		// Firefox, Safari, Opera... 
		req_ajax = new XMLHttpRequest(); 
	} else if(window.ActiveXObject) { 
		// Internet Explorer 5+ 
		req_ajax = new ActiveXObject("Microsoft.XMLHTTP"); 
	} else { 
		// old browser is being used. 
		return 'Problem creating the XMLHttpRequest object'; 
	} 
	return req_ajax; 
} 
// Make the XMLHttpRequest object 
var http_ajax = createRequestObject_ajax(); 

function sendRequest_ajax(ID) { 

// Open server script for requests 
http_ajax.open('get', 'tools/ajax-info.aspx?ID=' + ID,false); 
http_ajax.onreadystatechange = handleResponse_ajax; 
http_ajax.send(null); 
return handleResponse_ajax() 
} 
function handleResponse_ajax() { 
if(http_ajax.readyState == 4 && http_ajax.status == 200){ 
	// Text returned FROM the server script 
	var response_ajax = http_ajax.responseText; 
	if(response_ajax) { 
		// UPDATE ajaxTest content 
	return response_ajax;
	} 
} 
else
	{
	return "<table border=0 cellpadding=2 cellspacing=2 ><tr><td width=16 height=16><img width=16 height=16 src='ajaxtabs/loading.gif' border=0 align=middle /></td><td><font face=tahoma style=font-size:11px;>Loading content...</font></td></tr></table>";
	}
} 
function GetInfo(ID)
{
return sendRequest_ajax(ID);
}
