try{
    xmlhttp = new XMLHttpRequest();
}catch(ee){
    try{
        xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    }catch(e){
        try{
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        }catch(E){
            xmlhttp = false;
        }
    }
}

var ajaxLastResult;
var ajaxLine = new Array;
var ajaxReady = true;
var ajax = new Object();

function ajaxGet(URL, func)
	{
		var texto;

		ajaxReady = false;

    	xmlhttp.open("GET", URL, true);
		xmlhttp.onreadystatechange=function()
			{
				if (xmlhttp.readyState==4)
					{
						texto = xmlhttp.responseText;
						texto = texto.replace(/\+/g," ");
						texto = unescape(texto);
						
						ajaxLastResult = texto;
												
						setTimeout(func, 1);

						ajaxReady = true;
					}
			}
    	xmlhttp.send(null);
	}
function ajaxGet_embedjs(URL, func)
	{
		var texto;

		ajaxReady = false;

    	xmlhttp.open("GET", URL, true);
		xmlhttp.onreadystatechange=function()
			{
				if (xmlhttp.readyState==4)
					{
						texto = xmlhttp.responseText;
						texto = texto.replace(/\+/g," ");
						texto = unescape(texto);
						texto = texto.split('<!-- ENDJS -->');

						if(texto.length == 2)
							{
								ajaxLastResult = texto[1];
								eval(texto[0]);
							}
						else
							ajaxLastResult = texto[0];
												
						setTimeout(func, 1);

						ajaxReady = true;
					}
			}
    	xmlhttp.send(null);
	}