 function update(){
   if (! playFlag) { dregImg = imageLoading(); }
   thisImg++;
   if(thisImg == imgCnt) {
       thisImg = -1
       if (playFlag) clearTimeout(timerID)
   } else {
       document.images[0].src = dregImg[thisImg].src
       timerID = setTimeout('update()',millisec)
   }
   movieFlag = 1
 } 
 function endUpdate(){
   if (movieFlag) clearTimeout(timerID);
   if (loopFlag && pauseID != 0) clearTimeout(pauseID); 
   loopFlag = 0; 
 }
 function frameAdvance(){
   if (! playFlag) { dregImg = imageLoading(); }
   thisImg++;
   if(thisImg == imgCnt) {
       thisImg = 0
       if (movieFlag) clearTimeout(timerID)
   }
   document.images[0].src = dregImg[thisImg].src
 }
 function frameBack(){
   if (! playFlag) { dregImg = imageLoading(); } 
   thisImg--;
   if(thisImg < -1) {
       thisImg = imgCnt-2
       if (movieFlag) clearTimeout(timerID)
   } else if (thisImg < 0) {
       thisImg = imgCnt-1
       if (movieFlag) clearTimeout(timerID)
   } 
   document.images[0].src = dregImg[thisImg].src
 }
 function frameLast(){
   if (! playFlag) { dregImg = imageLoading(); }
   var arrLen = dregImg.length
   if (movieFlag) clearTimeout(timerID);
   if (loopFlag) clearTimeout(pauseID); 
   //document.images[0].src = dregImg[arrLen-1].src
   //thisImg = imgCnt-1
   document.images[0].src = dregImg[0].src
   thisImg = 0
   loopFlag = 0; 
 }
 function Loop(){
   if (! playFlag) { dregImg = imageLoading(); }
   thisImg++;
   if(thisImg == imgCnt) {
       thisImg = -1
       pauseID = setTimeout('Loop()',1000)
       return; 
   } 
   document.images[0].src = dregImg[thisImg].src
   timerID = setTimeout('Loop()',millisec)
   movieFlag = 1
   loopFlag = 1
 }
 function checkLoop(){
   (loopFlag) ? 'return' : Loop();
 } 
 function setSpeed(myform){
   idx = document.myform.speed.selectedIndex; 
   millisec = document.myform.speed.options[idx].value; 
 }
