fila=[]
ifila=0

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

function ajax(){
	xmlhttp.open("GET",fila[ifila][1],false);
	xmlhttp.onreadystatechange=function(){
		if (xmlhttp.readyState == 4) {
			switch(fila[ifila][2]){
				case "carregadiv":
					document.getElementById(fila[ifila][0]).innerHTML = xmlhttp.responseText;
				break;
			}
			ifila++;
			if(ifila < fila.length){
				setTimeout("ajax()",1);
			}
		}
	}
	xmlhttp.send(null);
}

function preencheCalendario(url){

	document.getElementById('extcal-div').innerHTML = "<div style='text-align:center; padding-top:40px; height:140px;'><img src='modules/extcal/images/ajax-loader.gif' /></div>";
	//window.open(url);
	xmlhttp.open("GET", url,true);	
	xmlhttp.onreadystatechange=function(){
		if (xmlhttp.readyState==4){
			document.getElementById('extcal-div').innerHTML = xmlhttp.responseText;
		}
	}
	xmlhttp.send(null);
}
