function doajax(){
			var xmlhttp=false;
			/* for IE...*/
			try{
				xmlhttp = new ActiveXObject('Msxml2.XMLHTTP');
			}catch(e){
				try{
					xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');
				}catch(E){
					xmlhttp = false;
				}
			}
			/* for Mozilla...*/
			if(!xmlhttp && typeof XMLHttpRequest!='undefined'){
				xmlhttp = new XMLHttpRequest();
			}
			return xmlhttp;
		}
		
		
function pegarHTML(Req, idd){
	//alert(Req.readyState);
	if (Req.readyState==4){
			var a=document.getElementById(idd);
				if(a){
			
					a.innerHTML=Req.responseText;
				}
	}
	
}




function getnewHTML(iddiv, peticion, filtro){
	    var Req=doajax();
		if (Req){
			var a=document.getElementById(iddiv);
			//a.innerHTML='loading...'
			
			a.innerHTML='<div id="loading" >...cargando...</div>';
			
			
			Req.onreadystatechange=function (){
				pegarHTML(Req, iddiv);
			}
			Req.open("GET", "jsincrono.php?peticion="+peticion+"&filtro="+filtro, true);
			//Req.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
			Req.send(null);
			
		}
		
}



		
