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 show(pagina,boton) {
cont = document.getElementById('vitrina');

ajax=objetoAjax();
cont.innerHTML = '<img src="waiting.gif" class="waiting" /><br /><span class="waiting_txt">Cargando...</span>';
ajax.open("GET", pagina, true);
ajax.onreadystatechange = function() {
if (ajax.readyState == 4 && ajax.status == 200) {
cont.innerHTML = ajax.responseText;
}
}

ajax.send(null);

//----------- configuraciones previas -------------//
// definir los titulos de los botones
titulo=new Array();
titulo[0]="Electr&oacute;nica";
titulo[1]="Computaci&oacute;n";
titulo[2]="Autos";
titulo[3]="Videojuegos";

//definir numero de botones
nrobtn=4;

// definir prefijo de botones
// (esto con el objetivo de no tener
// problemas al momento de validar
// nuestra página.)
pref="cat_";
//-------------------- fin ------------------------//

// quita el estilo a todos los botones
for(i=1;i<=nrobtn;i++){
tit=titulo[i-1];
btn=document.getElementById(pref+i);
btn.innerHTML=""+tit+"";
}

// le da estilo al boton actual
btnA = document.getElementById(pref+boton);
tit=titulo[boton-1];
btnA.innerHTML=""+tit+"";
}
