var xmlhttp;
function create_request()
{
	if(window.ActiveXObject)
	{
		xmlhttp= new ActiveXObject("Microsoft.XMLHTTP");
	}
	else
	if(window.XMLHttpRequest)
	{
		xmlhttp=new XMLHttpRequest();
	}
}

function ajax(url,destination)
{
	create_request();
	xmlhttp.open("GET",url,true);
	xmlhttp.onreadystatechange=function () {change_state(destination);};
	xmlhttp.send(null);
}

function change_state(destination)
{
	if(xmlhttp.readyState==4)
	{
		var temp = xmlhttp.responseText;
		while(true) 
		{
			var sindex = temp.indexOf("<script"+">");
			if(sindex < 0) break;
			var eindex = temp.indexOf("</"+"script>",sindex);
			var js = temp.substring(sindex+8,eindex);           
			eval(js);
			temp = temp.substring(eindex+9);
		}  
		document.getElementById(destination).innerHTML=xmlhttp.responseText;
	}	
	else
	document.getElementById(destination).innerHTML="<img src=images/preloader.gif>";
}
