function createRequestObject() {
	var ro;
	var browser = navigator.appName;
	if(browser == "Microsoft Internet Explorer") {
		ro = new ActiveXObject("Microsoft.XMLHTTP");	
	} else {
		ro = new XMLHttpRequest();	
	}
	return ro;
}

var http = createRequestObject();

// PINTO EL LISTADO DE FICHAS PORTADA
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
function handlemostrar_pagina(){
	if(http.readyState == 4) {
		var txt = http.responseText;
		if (txt.substr(0,5) == 'ERROR'){
			alert('Se produjo un error:\n'+txt);
		} else {
			
			//var temp= txt.split('<!--**********-->');
			//alert(temp[0]);
			
			//alert(txt)
			
			//$('#contenedor_post').fadeOut('slow', function(e){
				$('#contenedor_post').html(txt);
				//document.getElementById('contenedor_post').innerHTML= txt
			//$('#contenedor_post').fadeIn('slow');															 
			//});
			
		}
	}
	
}

function mostrar_pagina(pag){
	
	var ranNum= Math.floor(Math.random()*100000);
	url_envio= './'+pag+'?rnd='+ranNum;
	//alert(url_envio);
	http.open('get',url_envio);
	http.onreadystatechange = handlemostrar_pagina;
	http.send(null);
}


