var ajaxOK = false;
var posResponse = 1;
var posResponse1 = 1;

function objetoAjax(){
	var xmlhttp=false;
	try {
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
		   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (E) {
			xmlhttp = false;
  		}
	}
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
		xmlhttp = new XMLHttpRequest();
	}
	return xmlhttp;
}

function MostrarConsulta(datos){
	ajax=objetoAjax();
	ajax.open("GET", datos);
	ajax.onreadystatechange=function() {
		if (ajax.readyState==4) {
			 if(ajax.status != 404){
				 if(posResponse==1)
				 {
					document.getElementById('contenido').innerHTML = ajax.responseText;
					document.getElementById('contenido_load').style.display= 'none';
				 }
			 }else{
			    alert(ajax.responseText);
			 }
		}
	}
	ajax.send(null)
}

function setContenido(id){
	posResponse = 1;
	var error = MostrarConsulta("callbacks.php?section="+id);
    if(error){
        alert(error);
    }
}
function destinoAjax(id)
{
	quitarArea = document.getElementById('contratista');
	document.getElementById('contenido').removeChild(quitarArea);
	document.getElementById('contenido_load').style.display= 'block';
	setContenido(id);
}

