var timerID = null; // use to stop animation var tI = 500 // time Interval var max_Pic = 200; // Max pictures var frame = 0; // current frame var imgSrc = new Array( max_Pic ); for (i=1; i <= max_Pic; i++) { imgSrc[i-1] = new Image(480,360); imgSrc[i-1].src="Kyrill"+"\\"+"cam"+i+".jpg"; // document.write(imgSrc[i-1].src + "\n\n"); } function mygoto(url){ location = url; return true; } function forwrd(){ if ( timerID == null ){ frame += Math.floor( max_Pic / 4 ); if ( frame > max_Pic ) frame = 0; if ( frame < max_Pic ) document.animImg.src = imgSrc[frame].src; // only use defined frames } else{ frame += Math.floor( max_Pic / 2 ); if ( frame > max_Pic ) frame = 0; } return false; } function fastff(){ frame = max_Pic; if ( timerID == null ){ document.animImg.src = imgSrc[frame].src; // only use defined frames } return false; } function slowff(){ if ( timerID == null ){ frame++; if ( frame > max_Pic ) frame = 0; if ( frame <= max_Pic ) document.animImg.src = imgSrc[frame].src; // only use defined frames } return false; } function slowrw(){ if ( timerID == null ){ frame--; if ( frame < 0 ) frame = max_Pic - 1; if ( frame > 0 ) document.animImg.src = imgSrc[frame].src; // only use defined frames } return false; } function fastrw(){ if ( timerID == null ){ if ( frame > max_Pic ){ frame -= Math.floor( max_Pic / 12 ); } else{ frame -= Math.floor( max_Pic / 6 ); if ( frame < 0 ) frame = max_Pic - 1; } if ( frame > 0 ) document.animImg.src = imgSrc[frame].src; // only use defined frames } else{ if ( frame > max_Pic ){ frame -= Math.floor( max_Pic / 12 ); } else{ frame -= Math.floor( max_Pic / 6 ); if ( frame < 0 ) frame = max_Pic - 1; } } return false; } function rewind(){ frame = 0; if ( timerID == null ){ document.animImg.src = imgSrc[frame].src; // only use defined frames } return false; } function decrease(){ animateStop(); if ( tI < 1000 ) tI += 100; animateStart(); return false; } function increase(){ animateStop(); if ( tI > 100 ) tI -= 100; animateStart(); return false; } function rerun(){ animateStart(); return false; } function animateStart(){ if ( timerID == null ){ if ( frame > max_Pic ) frame = 0; Startup(); } else{ animateStop(); Startup(); } return false; } function Startup() { timerID = setInterval('IntervalTask()', tI); } function animateStop(){ if ( timerID ) clearInterval( timerID ); timerID = null; return false; } function IntervalTask() { if ( frame < 0 ) frame = 0 // insure frame is positive if ( frame <= max_Pic - 1 ) document.animImg.src = imgSrc[frame].src; // only use defined frames frame++; if ( frame > (max_Pic - 1) ) frame = 0;// animateStop(); // rewind to the begining }