function cargaDinamico (orig,dest)
{
	var	xmlhttp = "";
	var	destino = dest;
	var	url = orig;
	this.xmlhttpChange = function ()
	{
		// if xmlhttp shows "loaded"
		if (xmlhttp.readyState==4)
	    {		  
			if (xmlhttp.status==200) // if "OK"
				document.getElementById(destino).innerHTML = xmlhttp.responseText
		    else
				alert("Problema leyendo datos")
		}
	}	
	this.cargar = function ()
	{
		if (window.XMLHttpRequest) // code for Mozilla, etc.
		{
		  xmlhttp=new XMLHttpRequest();
		  xmlhttp.onreadystatechange=this.xmlhttpChange;
		  xmlhttp.open("GET",url,true);
		  xmlhttp.send(null);
		}		
		else if (window.ActiveXObject) // code for IE
		{
		  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		  if (xmlhttp)
		  {
			xmlhttp.onreadystatechange=this.xmlhttpChange;
			xmlhttp.open("GET",url,true);
			xmlhttp.send();
		  }
		}
	}
}

function carga_contenidos (origen, destino)
{
	pagina = new cargaDinamico(origen,destino);
	pagina.cargar ();
	//delete (pagina);
}