//Copyright Psand Ltd. 2002.
//Author L.Hempelskunt sinister@computertorture.com
//Free Software released under GPL - http://www.gnu.org

//swap_image.js v1.0 6/2/02
//Rotates an image at regular intervals

  //Set file path.
var sFile_path='/images/rot_images/front/';  
  //Set file extension.
var sExt='.jpg'         
  //Set number of images (0.jpg to 10.jpg)
var iImg_quantity=9;
  //set image id to rotate
var sId='thumb';
  //set rotate time interval
var iInterval=30000;

var iNext=0;				
var iNow=1;

iImg_quantity++;

function cacheImage(){
iNext=Math.floor(Math.random()*iImg_quantity); //decide next "dood" to show
var im_1=new Image();                     //cache next "dood" in advance
im_1.src=sFile_path+iNext+sExt;
}

function rotateImage(){
if(document.images[sId]){
document.images[sId].src=sFile_path+iNow+sExt;
iNow=iNext;
ident=window.setTimeout("cacheImage(); rotateImage();",iInterval);	
}
}

cacheImage();
ident=window.setTimeout("cacheImage(); rotateImage();",30000);	
