function nuevoAjax() { 

	var xmlhttp = false; 
	
	try  { 
		// Creacion del objeto AJAX para navegadores no IE
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); 
	}
	
	catch(e) { 
		try { 
			// Creacion del objet AJAX para IE 
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); 
		} 
		catch(E) { xmlhttp = false; }
	}
	
	if (!xmlhttp && typeof XMLHttpRequest != 'undefined') { xmlhttp = new XMLHttpRequest(); } 

	return xmlhttp; 
	
}

function cargaChat() {
	
	var ajax = nuevoAjax();
	var capa = document.getElementById("smschat");
	
	ajax.open("POST", "smschat.php", true);
	ajax.setRequestHeader ("Content-Type", "application/x-www-form-urlencoded");
	ajax.send("");

	ajax.onreadystatechange = function() {
		if (ajax.readyState == 4) {
			capa.innerHTML = ajax.responseText;
		}
	}	
	
}
