var headerImgs = Array(); headerImgs[0]="header-img/010-fuengirola.jpg"; headerImgs[1]="header-img/020-fuengirola.jpg"; headerImgs[2]="header-img/030-fuengirola.jpg"; headerImgs[3]="header-img/040-Barcas.jpg"; headerImgs[4]="header-img/050-castillo.jpg"; headerImgs[5]="header-img/060-bahia.jpg"; headerImgs[6]="header-img/070-Plaza de la Hispanidad.jpg"; headerImgs[7]="header-img/080-Plaza Virgen del Carmen.jpg"; headerImgs[8]="header-img/090-puente.jpg"; headerImgs[9]="header-img/100-Parque del Castillo.jpg"; headerImgs[10]="header-img/110-Plaza de la Constitucion.jpg"; headerImgs[11]="header-img/120-Torreblanca.jpg"; function precarga() { if (!document.images) return; var ar = new Array(); var arguments = precarga.arguments; for (var i = 0; i < arguments.length; i++) { ar[i] = new Image(); ar[i].src = arguments[i]; } } function setOpacity(obj, opacity) { opacity = (opacity == 100)?99.999:opacity; if (obj != null) { // IE/Win obj.style.filter = "alpha(opacity="+opacity+")"; // Safari<1.2, Konqueror obj.style.KHTMLOpacity = opacity/100; // Older Mozilla and Firefox obj.style.MozOpacity = opacity/100; // Safari 1.2, newer Firefox and Mozilla, CSS3 obj.style.opacity = opacity/100; } } function mifadeOut(objId,opacity) { if (document.getElementById) { obj = document.getElementById(objId); if(opacity >= 0) { setOpacity(obj, opacity); opacity -= 10; window.setTimeout("mifadeOut('"+objId+"',"+opacity+")", 70); } else { if('RANDOM' == 'SECUANCIAL'){ obj.style.backgroundImage = "url('"+headerImgs[headerCont]+"')"; mifadeIn(objId,opacity); headerCont = (headerCont + 1)%headerImgs.length; setTimeout("mifadeOut('"+objId+"', 100)", 4000); } else if('RANDOM' == 'RANDOM'){ obj.style.backgroundImage = "url('"+headerImgs[headerCont]+"')"; mifadeIn(objId,opacity); var tempCont = headerCont; while(tempCont == headerCont){ tempCont = Math.floor(headerImgs.length*Math.random()); } headerCont = tempCont; setTimeout("mifadeOut('"+objId+"', 100)", 4000); } } } } function mifadeIn(objId,opacity) { if (document.getElementById) { obj = document.getElementById(objId); if (opacity <= 100) { setOpacity(obj, opacity); opacity += 10; window.setTimeout("mifadeIn('"+objId+"',"+opacity+")", 70); } } } headerCont = Math.floor(headerImgs.length*Math.random()); setTimeout("mifadeOut('header-img', 100)", 0);