
// NUMBER OF SECONDS TO REFRESH IMAGE
var tRefreshSeconds = 3 * 1000
var numberOfImages = 4

// IMAGE NAME 
var imageNameList = new Array(numberOfImages);
imageNameList[1]='img_c/bigpic01.jpg';
imageNameList[2]='img_c/bigpic02.jpg';
imageNameList[3]='img_c/bigpic03.jpg';
imageNameList[4]='img_c/bigpic04.jpg';
//imageNameList[1]='img_c/bigpic01.jpg';
//imageNameList[2]='img_c/bigpic01.jpg';
//imageNameList[3]='img_c/bigpic02.jpg';
//imageNameList[4]='img_c/bigpic02.jpg';
//imageNameList[5]='img_c/bigpic02.jpg';
//imageNameList[6]='img_c/bigpic03.jpg';
//imageNameList[7]='img_c/bigpic03.jpg';

// IMAGE LIST
var imageList = new Array(numberOfImages);
imageList[1]='img_c/hm_text00.gif';
imageList[2]='img_c/hm_text00.gif';
imageList[3]='img_c/hm_text00.gif';
//imageList[1]='img_c/hm_text01a.gif';
//imageList[2]='img_c/hm_text01b.gif';
//imageList[3]='img_c/hm_text02a.gif';
//imageList[4]='img_c/hm_text02b.gif';
//imageList[5]='img_c/hm_text02c.gif';
//imageList[6]='img_c/hm_text03a.gif';
//imageList[7]='img_c/hm_text03b.gif';


var curImageIndex = 1;

var timerID = 0;
var tStart  = null;
var theTime = "0";

function UpdateTimer() {

   if(timerID) {
      clearTimeout(timerID);
      clockID  = 0;
   }

   if(!tStart) {tStart   = new Date();}

   var   tDate = new Date();
   var   tDiff = tDate.getTime() - tStart.getTime();

   tDate.setTime(tDiff);
   theTime = "" + tDate.getMinutes() + ":" + tDate.getSeconds();

   if (curImageIndex < numberOfImages) {
   	curImageIndex++;
   } else {
	curImageIndex=1;
   }
   refreshImage();

   timerID = setTimeout("UpdateTimer()", tRefreshSeconds);
}

function StartTimer() {

   tStart   = new Date();
   theTime = "00:00";
   timerID  = setTimeout("UpdateTimer()", tRefreshSeconds);
}

function StopTimer() {

   if(timerID) {
      clearTimeout(timerID);
      timerID  = 0;
   }
   tStart = null;
}

function ResetTimer() {

   tStart = null;
   theTime = "00:00";
   curImageIndex = 1;
   refreshImage();
}

function refreshImage() {
    document.image_name.src=imageNameList[curImageIndex];
    document.image_pic.src=imageList[curImageIndex];
}


