// Ramdom image slide show animation
// (C) 2005 Ian Burman - Agora International 
// GPL Free for all users, but leave in this  header

// Displays a sequence of overlayed images - pauses - then displays a 2nd sequence - cycles
var ImagesPerSequence=3  //Max 9 - create a DIV for each with an img tag ID=ImageX etc - use z-index of DIV
var SequencesPerSet=3

// Multiple Image sets possible with a different set displayed ramdomdly on refresh
// each Image Set must be in a separate numbered folder:eg images\animation0 images\animation1 etc
var NumImageSets=1

// *****************************************************
var c=0
var t=0
var m=0
var nImgSet=Math.floor(Math.random()*NumImageSets)
var lCount=0

function timedShow()
{
c=c+1
m=m+1
lCount=lCount+1

// debug count check code
// document.getElementById('txt').value=c
// document.getElementById('txt2').value=m
// document.getElementById('txt3').value=lCount

// Popoulate image tags first time round
if (lCount==1) {
   C=4
   var j=1
   for (j=1;j<=SequencesPerSet*10;j++) 	{

	if (j<=ImagesPerSequence || j>10 && j<=ImagesPerSequence+10 || j>20 && j<=ImagesPerSequence+20) {
	    document.getElementById('Image'+j).src="images/Animation"+nImgSet+"/"+j+".gif"
	}
   }
}

//Expand images sequencially
if (c>0 && c<(ImagesPerSequence+1)) {
    if (document.getElementById('Image1').complete) {

	if (m==1 || m==11 || m==21) {
	document.getElementById('Image1').src="images/Animation"+nImgSet+"/"+m+".gif"
	document.getElementById('Image1').width="150"
	document.getElementById('Image1').height="205"

	}
	if (m==2 || m==12 || m==22) {
	document.getElementById('Image2').src="images/Animation"+nImgSet+"/"+m+".gif"
	document.getElementById('Image2').width="100"

	}
	if (m==3 || m==13 || m==23) {	
	document.getElementById('Image3').src="images/Animation"+nImgSet+"/"+m+".gif"
	document.getElementById('Image3').width="150"
	document.getElementById('Image3').height="112"
 
	}

    }
}
if (c==10 ) {
	document.getElementById('Image1').width="0"
	document.getElementById('Image2').width="0"
	document.getElementById('Image3').width="0"
	c=0
}

if (m>((10*SequencesPerSet)-1)) {
	m=0
}
t=setTimeout("timedShow()",1000)
}

function stopCount()
{
clearTimeout(t)
}
