/* 
====================================================================
     JavaScripts by Dr Jian Dong Xu
	27 September 2007 Created

     JD Show Poem - For display poem dynamically.

     Please feel free for your personal use by attaching this note.

     Features:
     1. Show next poem with a timer
     2. Show next poem by clicking on the poem

====================================================================
*/


var currentNum = 3;
var isTimeOut = 0;

function changeImage()
{
var i;
var firstNum= 1;
var lastNum= 3;
var theImages = new Array();


theImages[1]="photos/txh001.png"
theImages[2]="photos/txh002.png"
theImages[3]="photos/txh003.png"

//theImages[1]="a1.gif"
//theImages[2]="a2.gif"
//theImages[3]="a3.gif"

i = currentNum + 1;

if (i>lastNum) 
    i = firstNum;

   document.images.theImage.src=theImages[i];

   currentNum = i;

   //alert("theImages["+i+"]="+theImages[i]);

   //isTimeOut = setTimeout("changeImage()", 20000);


    //if(isTimeOut) {
	//clearTimeout(isTimeOut);
	//alert("isTimeOut="+isTimeOut);
//	isTimeOut = 0;

//    }

}


function autoChangeImage()
{

	isTimeOut = setTimeout("autoChangeImage()", 20000);
	changeImage();

}


