function getHTTPObject() {
	var xmlhttp;
	/*@cc_on
	@if (@_jscript_version >= 5)
		try {
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (E) {
			xmlhttp = false;
			}
		}
	@else
	xmlhttp = false;
	@end @*/
	if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
		try {
			xmlhttp = new XMLHttpRequest();
		xmlhttp.overrideMimeType("text/xml"); 
		} catch (e) {
			xmlhttp = false;
		}
	}
	return xmlhttp;
}

function ti(stat,value){
	if(value==undefined){
		value='';
	}
	divID='ajaxStatus';
	file='assets/php/tntinteraction.php';
	params = 'stat='+stat+'&value='+value;
	var http = getHTTPObject();
	//for encoded params from formsubmits and such
	params = decodeURI(params);
	var url = file+'?'+params;
	var now = new Date();
	var openFuncExists = false;
	var timeoutId;
	// hack to get IE to refresh all the time by making each url unique by adding a timestamp onto it. (ie tries to cache everything)
	if (url.indexOf("?") > -1) // this url has get params somewhere
	{
		if (url.substr(url.length-1) == "&") // has a & at the end, no need to append another
		{
			url = url + "t=" + now.getTime();
		}
		else // no & on the end, append it
		{
			url = url + "&t=" + now.getTime();
		}
	}
	else // no params on this url. append a ?
	{
		url = url + "?t=" + now.getTime();
	}
	// end IE hack		
	
	http.open("GET", url, true);
	http.onreadystatechange = function() {
		if (http.readyState == 4) {
			//if (http.status == 200)
			//{
				window.clearTimeout(timeoutId);
				var output = http.responseText;
				
				document.getElementById(divID).innerHTML = output;
			//}
		}
	}
	http.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
	http.send(null);
	
	timeoutId = window.setTimeout(
		function() {
			switch (http.readyState) {
				case 1:
				case 2:
				case 3:
					http.abort();
					document.getElementById(divID).innerHTML = "<h2>Error Loading Data</h2>";
					alert("The action you are trying to preform has taken to long.  If this was a search, try limited the criteria.");
					break;
				default:
					break;
			}
		},
		60000 // sixty seconds
	);
}