/* Inicia uma conexão externa
 *
 * Atraves dessa conexão é possivel executar outras paginas em back ground
 *
 */
function RequestHttp(){
	var xmlhttp;
	try {
		  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
	
		try {
		   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (E) {
		   xmlhttp = false;
		}
	}		
	
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
		try {
			xmlhttp = new XMLHttpRequest();
		} catch (e) {
			xmlhttp=false;
		}
	}
	if (!xmlhttp && window.createRequest) {
		try {
			xmlhttp = window.createRequest();
		} catch (e) {
			xmlhttp=false;
		}
	}
	return xmlhttp;
}

function carregaNoticias() {
	var xmlHttpRequest = new RequestHttp();		
						
	var container = document.getElementById("noticias");			
	container.innerHTML = "<div class='link'><br /><img src='images/loadingNoticia.gif' align='absmiddle' />&nbsp;Carregando not&iacute;cias...<br /></div>";
			
	xmlHttpRequest.onreadystatechange=function() {
		if (xmlHttpRequest.readyState == 4) {
			var container = document.getElementById("noticias");
			container.innerHTML = xmlHttpRequest.responseText;			
		}
	}
		
	xmlHttpRequest.open("GET", "/include/ajaxNoticia.php", true);	
	xmlHttpRequest.send(null);
}
