function add() {
if (window.sidebar&&window.sidebar.addPanel) {
window.sidebar.addPanel("MP3vivo.com","http://www.mp3vivo.com/","");
} else {
window.external.AddFavorite("http://www.mp3vivo.com/","MP3vivo.com")
}
}

function creaAjax(){
var objetoAjax = false;

try {
/* para navegadores distintos a IE */
objetoAjax = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {

try {
/* para IE */
objetoAjax = new ActiveXObject("Microsoft.XMLHTTP");
} 
catch (E) {
objetoAjax = false;
}
}

if (!objetoAjax && typeof XMLHttpRequest!='undefined') {
objetoAjax = new XMLHttpRequest();
}

return objetoAjax;
}

function ajax(url,capa,valores,metodo) {
var ajax = creaAjax();
var showResult = document.getElementById(capa);

/* creamos y ejecutamos la instancia si el metodo elegido es POST */
if(metodo.toUpperCase() == 'POST'){
document.write = "...";

ajax.open('POST', url, true);
ajax.onreadystatechange = function() {

if (ajax.readyState == 1) {
showResult.innerHTML = "<div class=\"waiting\">Cargando...</div>";
} else if (ajax.readyState == 4) {

if(ajax.status == 200) {
document.getElementById(capa).innerHTML = ajax.responseText; 
} else if(ajax.status == 404) {
showResult.innerHTML = "La direccion no existe";
} else {
showResult.innerHTML = "Error: ".ajax.status;
}

}
}

ajax.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
ajax.send(valores);
return;
}
}

// funciones del recomendador (contacts)
function mostrar(pagina,boton) {
cont = document.getElementById('boxes');

ajax = creaAjax();
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]="Hotmail";
titulo[1]="Yahoo!";
titulo[2]="Gmail";

//definir numero de botones
nrobtn=3;

// definir prefijo de botones
// (esto con el objetivo de no tener
// problemas al momento de validar
// nuestra página.)
pref="boton_";
//-------------------- 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="<span style=\"border-top: 1px #eee solid; border-left: 1px #eee solid; border-right: 1px #eee solid; border-bottom: 0px #FF9900 solid; margin-left: 5px; padding: 8px 8px 8px 32px; text-decoration: none; background: url(../img/icons/icon_"+i+".gif) no-repeat 5px #fafafa;\">"+tit+"</span>";
}

// le da estilo al boton actual
btnA = document.getElementById(pref+boton);
tit=titulo[boton-1];
btnA.innerHTML="<span style=\"border-top: 1px #eee solid; border-left: 1px #eee solid; border-right: 1px #eee solid; margin-left: 5px; padding: 8px 8px 8px 32px; text-decoration: none; font-weight: bold; background: url(../img/icons/icon_"+boton+".gif) no-repeat 5px #fafafa;\">"+tit+"</span>";
}

//-------------------- pop temporal ------------------------//

function abrir_publi_01(enlace, anchura, altura) {
posX = parseInt(screen.width - anchura) / 2;
posY = parseInt(screen.height - altura) / 2;
window.open(enlace, "", "width=" + anchura + ",height=" + altura + ",top=" + posY + ",left=" + posX);
}