//Script for scrolling Product Images
var iProduct=1;

var rProduct=0; //This variable contains the number of loaded images.
var addressProduct='Productslidingimages/';
function ChangeProductImage(){ 
  var ourimage=document.getElementById("slideImg");
  if (document.all && ourimage.filters){
    ourimage.filters.revealTrans.Transition=Math.floor(Math.random()*23); 
    ourimage.filters.revealTrans.stop();
    ourimage.filters.revealTrans.apply(); 
    ourimage.filters.revealTrans.play();
  }
  if(iProduct>7){ // Number of our images is 4.
    iProduct=0;
  }
  iProduct++;
  document.getElementById("slideImg").src = addressProduct + 'slideimage-' + iProduct + '.jpg';
} 

function SetItProduct(){
  setTimeout("ChangeProductImage()",3000); // ChangeImage() function is executed each 4 seconds.
}
 
function startProductSlide() {
  rProduct++;
  if(rProduct==7){// If rProduct reaches 3 (if third image was loaded) then show the first image and set the timer for starting the slideshow with SetIt() function.
    document.getElementById("ProductslideDiv").innerHTML='';
    document.getElementById("ProductslideDiv").innerHTML='<img id="slideImg" src="' + addressProduct + 'slideimage-1.jpg" width="220" height="170" border="0" style="filter:revealTrans(duration=1,transition=12)" onload="SetItProduct();" />';
  }
}





