function imageRotator(id, name, pause) { this.ID = id; this.Name = name; this.Current = 0; this.Images = new Array(); this.ImgPL = new Array(); this.Titles = new Array(); this.URLs = new Array(); this.Pause = pause; this.addItem = addItem; this.rotate = rotate; this.go = go; } function addItem(sImg, sTitle, sUrl){ var i = this.Images.length; this.Images[i] = sImg; this.Titles[i] = sTitle; this.URLs[i] = sUrl; this.ImgPL[i] = new Image(); } function rotate(){ this.Current = this.Current + 1; if(this.Current > (this.Images.length - 1)){ this.Current = 0; } if(this.ImgPL[this.Current].src == ""){ this.ImgPL[this.Current].src = "fotos/" + this.Images[this.Current]; } var obj = document.getElementById(this.Name); if (document.all){ obj.style.filter="blendTrans(duration=2)"; obj.style.filter="blendTrans(duration=CrossFadeDuration)"; obj.filters.blendTrans.Apply(); } //obj.src = this.ImgPL[this.Current].src; obj.src = "fotos/" + this.Images[this.Current]; if (document.all) obj.filters.blendTrans.Play(); setTimeout(this.ID + ".rotate();", this.Pause); } function go(){ window.location.href = this.URLs[this.Current]; } function randOrd(){ return (Math.round(Math.random())-0.5); } var imgRot1 = new imageRotator("imgRot1" ,"imgRotator", 7000); //Random array... aPics = new Array(); aPics[0] = 'foto99.jpg';aPics[1] = 'foto98.jpg';aPics[2] = 'foto97.jpg';aPics[3] = 'foto96.jpg';aPics[4] = 'foto95.jpg';aPics[5] = 'foto94.jpg';aPics[6] = 'foto93.jpg';aPics[7] = 'foto92.jpg';aPics[8] = 'foto91.jpg';aPics[9] = 'foto90.jpg';aPics[10] = 'foto89.jpg';aPics[11] = 'foto88.jpg';aPics[12] = 'foto87.jpg';aPics[13] = 'foto86.jpg';aPics[14] = 'foto85.jpg';aPics[15] = 'foto84.jpg';aPics[16] = 'foto83.jpg';aPics[17] = 'foto82.jpg';aPics[18] = 'foto81.jpg';aPics[19] = 'foto80.jpg';aPics[20] = 'foto79.jpg';aPics[21] = 'foto78.jpg';aPics[22] = 'foto77.jpg';aPics[23] = 'foto76.jpg';aPics[24] = 'foto75.jpg';aPics[25] = 'foto74.jpg';aPics[26] = 'foto73.jpg';aPics[27] = 'foto72.jpg';aPics[28] = 'foto71.jpg';aPics[29] = 'foto70.jpg';aPics[30] = 'foto69.jpg';aPics[31] = 'foto68.jpg';aPics[32] = 'foto67.jpg';aPics[33] = 'foto66.jpg';aPics[34] = 'foto65.jpg';aPics[35] = 'foto64.jpg';aPics[36] = 'foto63.jpg';aPics[37] = 'foto62.jpg';aPics[38] = 'foto61.jpg';aPics[39] = 'foto60.jpg';aPics[40] = 'foto59.jpg';aPics[41] = 'foto58.jpg';aPics[42] = 'foto57.jpg';aPics[43] = 'foto56.jpg';aPics[44] = 'foto55.jpg';aPics[45] = 'foto54.jpg';aPics[46] = 'foto53.jpg';aPics[47] = 'foto52.jpg';aPics[48] = 'foto51.jpg';aPics[49] = 'foto50.jpg';aPics[50] = 'foto40.jpg';aPics[51] = 'foto39.jpg';aPics[52] = 'foto38.jpg';aPics[53] = 'foto37.jpg';aPics[54] = 'foto36.jpg';aPics[55] = 'foto35.jpg';aPics[56] = 'foto34.jpg';aPics[57] = 'foto33.jpg';aPics[58] = 'foto32.jpg';aPics[59] = 'foto31.jpg';aPics[60] = 'foto30.jpg';aPics[61] = 'foto29.jpg';aPics[62] = 'foto28.jpg';aPics[63] = 'foto26.jpg';aPics[64] = 'foto25.jpg';aPics[65] = 'foto24.jpg';aPics[66] = 'foto23.jpg';aPics[67] = 'foto22.jpg';aPics[68] = 'foto21.jpg';aPics[69] = 'foto20.jpg';aPics[70] = 'foto19.jpg';aPics[71] = 'foto18.jpg';aPics[72] = 'foto17.jpg';aPics[73] = 'foto16.jpg';aPics[74] = 'foto15.jpg';aPics[75] = 'foto14.jpg';aPics[76] = 'foto13.jpg';aPics[77] = 'foto12.jpg';aPics[78] = 'foto11.jpg';aPics[79] = 'foto10.jpg';aPics[80] = 'foto09.jpg';aPics[81] = 'foto08.jpg';aPics[82] = 'foto07.jpg';aPics[83] = 'foto06.jpg';aPics[84] = 'foto05.jpg';aPics[85] = 'foto04.jpg';aPics[86] = 'foto03.jpg';aPics[87] = 'foto02.jpg';aPics[88] = 'foto01.jpg';aPics[89] = 'Thumbs.db'; aPics.sort(randOrd); for(i=0;i<100;i++){ imgRot1.addItem(aPics[i],"",""); } imgRot1.rotate();