// Set slideShowSpeed (milliseconds) var slideShowSpeed = 8000; var Pic = new Array() // don't touch this // to add more images, just continue // the pattern, adding to the array below //Pic[0] = '/images/nokia6110_4.jpg'; //Pic[1] = '/images/phones/C702_1.jpg'; //Pic[2] = '/images/phones/bbstorm_1.jpg'; Pic[0] = '/images/phones/handy0.jpg'; Pic[1] = '/images/phones/handy1.jpg'; Pic[2] = '/images/phones/handy3.jpg'; Pic[3] = '/images/phones/handy4.jpg'; Pic[4] = '/images/phones/handy6.jpg'; var p = Pic.length; var curIdx = 0; var nextImageTimeout; var inAnimation = false; var preLoad = new Array() for (i = 0; i < p; i++){ preLoad[i] = new Image() preLoad[i].src = Pic[i] } function changeImageAnimated(){ inAnimation = true; opacity("phone", 100, 0, 1000, "changeImage()"); } function finished(){ inAnimation = false; } function changeImage(){ curIdx++; if (curIdx > (p-1)) curIdx=0; document.images.SlideShow.src = preLoad[curIdx].src; opacity("phone", 0, 100, 2000, "finished()"); nextImageTimeout = setTimeout("changeImageAnimated()", slideShowSpeed); } function mymousehover(){ if (!inAnimation) { clearTimeout(nextImageTimeout); changeImageAnimated(); } } // document.images.SlideShow.src = preLoad[curIdx].src; nextImageTimeout = setTimeout("changeImageAnimated()", slideShowSpeed); function opacity(id, opacStart, opacEnd, millisec, cbFinished) { var speed = Math.round(millisec / 100); var timer = 0; if(opacStart > opacEnd) { for(i = opacStart; i >= opacEnd; i--) { setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); timer++; } } else if(opacStart < opacEnd) { for(i = opacStart; i <= opacEnd; i++) { setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); timer++; } } if (cbFinished) { setTimeout(cbFinished, ((timer+30) * speed)); } } //change the opacity for different browsers function changeOpac(opacity, id) { var object = document.getElementById(id).style; object.opacityPercent = opacity; object.opacity = (opacity / 100); object.MozOpacity = (opacity / 100); object.KhtmlOpacity = (opacity / 100); object.filter = "alpha(opacity=" + opacity + ")"; }