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 MostrarPagina(pagina,boton,titulo,nrobtn)
  {
	cont = document.getElementById("contenido");

	ajax=objetoAjax();

    ajax.open("GET", pagina);
    ajax.onreadystatechange = function()
	  {
		if (ajax.readyState == 4 && ajax.status == 200) 
		  {
			cont.innerHTML = ajax.responseText;
	 	  }
	  }
	ajax.send(null);

    //----------- configuraciones previas -------------//
	//definir prefijo de botones
	pref="boton_";
	
	//-------------------- fin ------------------------//

	//quita el estilo a todos los botones
	for(i=1;i<=nrobtn;i++)
	  {
		tit=titulo[i-1];
		//Pintamos el texto del botón
		btn=document.getElementById(pref+i);
		btn.innerHTML="<span class='tab-inactivo-link'>"+tit+"</span>";

		//Pintamos el cuadro del botón
		cuadro_btn = document.getElementById("celda_"+i);
	    //Para Firefox
		cuadro_btn.setAttribute("class", "tab-inactivo");
		//Para IE
		cuadro_btn.setAttribute("className", "tab-inactivo");
	  }

	//le da estilo al boton actual
	tit=titulo[boton-1];
	//Pintamos el texto del botón activo.
	btnA = document.getElementById(pref+boton);
	btnA.innerHTML="<span class='tab-activo-link'>"+tit+"</span>";
	//Pintamos el cuadro del botón activo
	var cuadro_btnA = document.getElementById("celda_"+boton);
    //Para Firefox
	cuadro_btnA.setAttribute("class", "tab-activo");
    //Para IE
	cuadro_btnA.setAttribute("className", "tab-activo");
  }
