var xhr = new Array(); // ARRAY OF XML-HTTP REQUESTS
var xi = new Array(0); // ARRAY OF XML-HTTP REQUEST INDEXES
xi[0] = 1; // FIRST INDEX SET TO 1 MAKING IT AVAILABLE
function xhrRequest(type) {
	if (!type) {
		type = 'html';
	}
	// xhrsend IS THE xi POSITION THAT GETS PASSED BACK
	// INITIALIZED TO THE LENGTH OF THE ARRAY(LAST POSITION + 1)
	// IN CASE A FREE RESOURCE ISN'T FOUND IN THE LOOP
	var xhrsend = xi.length; 
	
	// GO THROUGH AVAILABLE xi VALUES
	for (var i=0; i<xi.length; i++) {
		// IF IT'S 1 (AVAILABLE), ALLOCATE IT FOR USE AND BREAK
		if (xi[i] == 1) {
			xi[i] = 0;
			xhrsend = i;
			break;
		}
	}
	// SET TO 0 SINCE IT'S NOW ALLOCATED FOR USE
	xi[xhrsend] = 0;
	// SET UP THE REQUEST
	if (window.ActiveXObject) {
		try {
			xhr[xhrsend] = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				xhr[xhrsend] = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	} else if (window.XMLHttpRequest) {
		xhr[xhrsend] = new XMLHttpRequest();
		if (xhr[xhrsend].overrideMimeType) {
			xhr[xhrsend].overrideMimeType('text/' + type);
		}
	}
	return (xhrsend);
}
function fcn(url, reqType, objID) {
	var xhri = xhrRequest('html');			
	var obj = document.getElementById(objID);
	obj.innerHTML = "<img src='/images/ajax-loader.gif' alt='' width='12' height='12'/>";
//	alert("fcn works");
//	obj.innerHTML = "<img src='/images/ajax-loader.gif' alt='' width='24' height='24' /><span class='style1'>LOADING . . . .</span>";
	xhr[xhri].open('POST', url, true);
	xhr[xhri].setRequestHeader( "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT" );
	xhr[xhri].onreadystatechange = function() {
	try
	{
		if(xhr[xhri].status !== undefined && xhr[xhri].status != 0){
			httpStatus = xhr[xhri].status;
		}
		else{
			httpStatus = 13030;
		}
		}
		catch(e){
		// 13030 is the custom code to indicate the condition -- in	Mozilla/FF --
		// when the o object's status and statusText properties are
		// unavailable, and a query attempt throws an exception.
		httpStatus = 13030;
	}
	if (xhr[xhri].readyState == 4 && xhr[xhri].status == 200) {
//			alert(xhr[xhri].responseText);
			obj.innerHTML = (xhr[xhri].responseText);
			xi[xhri] = 1;
			xhr[xhri] = null;
		}
	};
	xhr[xhri].send(null);
}

function doNothing(){}