<!--

var loadingimg = url_of_img + "/_default/icon_loading.gif";

var bustcache = 1;
var bustcacheparam = "";

function createXMLHttpRequest()
{
	var http = null;

	if(window.XMLHttpRequest)
	{
		http = new XMLHttpRequest();

		if(http.overrideMimeType)
		{
			//http.overrideMimeType('text/xml');
		}
	}
	else if(window.ActiveXObject)
	{
		try
		{
			http = new ActiveXObject("Msxml2.XMLHTTP")
		} 
		catch(e)
		{
			try
			{
				http = new ActiveXObject("Microsoft.XMLHTTP")
			}
			catch(e){}
		}
	}

	if(!http)
	{
		alert('Giving up: AJAX cannot create an XMLHTTP instance');
		return false;
	}

	return http;
}

var http = createXMLHttpRequest(); 

function getAjaxContent(query, container, image)
{
	var url = query;
	
	if (!image){
		document.getElementById(container).innerHTML = "<img src='" + loadingimg + "' valign='absmiddle'>";
	} else {
		document.getElementById(container).innerHTML = "<img src='" + url_of_img + "/_default/" + image + "' valign='absmiddle'>";
	}
	http.abort();

	http.onreadystatechange = function()
	{
		loadAjaxContent(http, container);
	}

	if(bustcache)
	{
		bustcacheparam = (url.indexOf("?") != -1) ? "&t=" + new Date().getTime() : "?" + new Date().getTime();
	}

	http.open('GET', url + bustcacheparam, true);
	//http.setRequestHeader("AJAX_TOKEN", ajaxtoken);
	http.send(null);
	return;
}

function loadAjaxContent(http, container)
{
	if(http.readyState == 4 && (http.status == 200 || window.location.href.indexOf("http") == -1))
	{
		//alert(http.responseText);
		document.getElementById(container).innerHTML = http.responseText;
	}
}

//-->
