// datos de los BANNERS
// id: un identificador para el banner;
// link: el enlace del banner;
// foto: el nombre de la imagen;
// ancho y alto.
// es importante que respete la estructura del array
var banners =[
{
"id":"Gira_01",
"link":"",
"foto":"bajoqueta_rock_02.jpg",
"ancho":"254",
"alto":"191"
},
{
"id":"Gira_02",
"link":"",
"foto":"danza_invisible.jpg",
"ancho":"254",
"alto":"191"
},
{
"id":"Gira_03",
"link":"",
"foto":"david_civera.jpg",
"ancho":"254",
"alto":"191"
},
{
"id":"Gira_04",
"link":"",
"foto":"emilio_solo.jpg",
"ancho":"254",
"alto":"191"
},
{
"id":"Gira_05",
"link":"",
"foto":"gira_ariel_rot.jpg",
"ancho":"254",
"alto":"191"
},
{
"id":"Gira_06",
"link":"",
"foto":"gira_premonicion_bisbal.jpg",
"ancho":"254",
"alto":"191"
},
{
"id":"Gira_07",
"link":"",
"foto":"gira_soraya_02.jpg",
"ancho":"254",
"alto":"191"
},
{
"id":"Gira_08",
"link":"",
"foto":"los_diablos.jpg",
"ancho":"254",
"alto":"191"
},
{
"id":"Gira_09",
"link":"",
"foto":"los_lunnis.jpg",
"ancho":"254",
"alto":"191"
},
{
"id":"Gira_10",
"link":"",
"foto":"maria_mar_bonet.jpg",
"ancho":"254",
"alto":"191"
},
{
"id":"Gira_11",
"link":"",
"foto":"suenyo_morfeo.jpg",
"ancho":"254",
"alto":"191"
},
{
"id":"Gira_12",
"link":"",
"foto":"te_regalo_italia.jpg",
"ancho":"254",
"alto":"191"
},
{
"id":"Gira_13",
"link":"",
"foto":"vol_ras.jpg",
"ancho":"254",
"alto":"191"
}
]

// variables modificables por el usuario.
// var carpetaBanners: ruta relativa a la carpeta de las imagenes;
// var cambiaBanner: si 1 el banner cambia cada cierto tiempo; si 0 no;
// var tiempoActualizacion: si cambiaBanner==1 este es el tiempo (en milisegundos)
// de exposición de un banner;
// var nuevaVentana: si 1 abre en una nueva ventana; si 0 en la misma;
var carpetaBanners = "images/banner_conciertos";
var cambiarBanner = 1;
var tiempoActualizacion = 3000;
var nuevaVentana = 1;
// variables internas del script; no modificar.
var bannerActual,bannerNuevo;
var numeroBanners = banners.length;
var texto = "";
// función que maneja el rotador de banners.
function rotaBanner()
{
// mensaje mientras cambia banner
document.getElementById("capa_banner").innerHTML = "Rotando Banner";
do
{
bannerNuevo = Math.round(Math.random()*(numeroBanners-1));
}while (bannerNuevo == bannerActual);
bannerActual = bannerNuevo;
// prepara el texto
texto += "<a href='" + banners[bannerActual]['link'] + "'";
if (nuevaVentana == 1)
{
texto += " target='flotante_centro'";
}
texto += "><img src='" + carpetaBanners + "/" + banners[bannerActual]['foto'] + "'";
texto += "width='" + banners[bannerActual]['ancho'];
texto += "' height='" + banners[bannerActual]['alto'] + "' ";
texto += "border='0'>"
texto += "</a>";
// escribe el texto
document.getElementById("capa_banner").innerHTML = texto;
texto = "";
// si cambiaBanner==1 inicia un contador setTimeout
if(cambiarBanner == 1)
{
setTimeout("rotaBanner()",tiempoActualizacion);
}
}
function rotaBanner2()
{
// mensaje mientras cambia banner
document.getElementById("capa_banner2").innerHTML = "Rotando Banner";
do
{
bannerNuevo = Math.round(Math.random()*(numeroBanners-1));
}while (bannerNuevo == bannerActual);
bannerActual = bannerNuevo;
// prepara el texto
texto += "<a href='" + banners[bannerActual]['link'] + "'";
if (nuevaVentana == 1)
{
texto += " target='flotante_centro'";
}
texto += "><img src='" + carpetaBanners + "/" + banners[bannerActual]['foto'] + "'";
texto += "width='" + banners[bannerActual]['ancho'];
texto += "' height='" + banners[bannerActual]['alto'] + "' ";
texto += "border='0'>"
texto += "</a>";
// escribe el texto
document.getElementById("capa_banner2").innerHTML = texto;
texto = "";
// si cambiaBanner==1 inicia un contador setTimeout
if(cambiarBanner == 1)
{
setTimeout("rotaBanner2()",tiempoActualizacion);
}
}
function rotaBanner3()
{
// mensaje mientras cambia banner
document.getElementById("capa_banner3").innerHTML = "Rotando Banner";
do
{
bannerNuevo = Math.round(Math.random()*(numeroBanners-1));
}while (bannerNuevo == bannerActual);
bannerActual = bannerNuevo;
// prepara el texto
texto += "<a href='" + banners[bannerActual]['link'] + "'";
if (nuevaVentana == 1)
{
texto += " target='flotante_centro'";
}
texto += "><img src='" + carpetaBanners + "/" + banners[bannerActual]['foto'] + "'";
texto += "width='" + banners[bannerActual]['ancho'];
texto += "' height='" + banners[bannerActual]['alto'] + "' ";
texto += "border='0'>"
texto += "</a>";
// escribe el texto
document.getElementById("capa_banner3").innerHTML = texto;
texto = "";
// si cambiaBanner==1 inicia un contador setTimeout
if(cambiarBanner == 1)
{
setTimeout("rotaBanner3()",tiempoActualizacion);
}
}