//Desarrollado por Jesus Liñán
//ribosomatic.com
//Puedes hacer lo que quieras con el código
//pero visita la web cuando te acuerdes

/*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,numero){
	divResultado = document.getElementById('resultado');
	var valordepende = document.getElementById(numero)
	var x = valordepende.value
    var fragment_url = datos+'?Id='+x; 
  //	ajax=objetoAjax();
    peticion.open("GET", fragment_url,true); 
//	ajax.open("GET", datos);
	peticion.onreadystatechange=function() {
		if (peticion.readyState==4) {
			divResultado.innerHTML = peticion.responseText
		}
	}
	peticion.send(null)
}

function SubirVector(id, variable ,dato){
	
    var fragment_url = 'Vector.php?id='+id+'&variable='+variable+'&dato='+dato; 
  //	ajax=objetoAjax();
    peticion.open("GET", fragment_url,true); 
//	ajax.open("GET", datos);
	peticion.onreadystatechange=function() {
		if (peticion.readyState==4) {
			
		}
	}
	peticion.send(null)
}

function MostrarExiste(datos,numero,i,div,as){
	divExiste = document.getElementById(div);
    var fragment_url = datos+'?Id='+numero+'&v='+i+'&asoc='+as; 
  //	ajax=objetoAjax();
    peticion.open("GET", fragment_url,true); 
//	ajax.open("GET", datos);
	peticion.onreadystatechange=function() {
		if (peticion.readyState==4) {

			divExiste.innerHTML = peticion.responseText
		}
	}
	peticion.send(null)
	//SubirVector();
}
