var pic_width=640;var pic_height=480;var pics;var numpics;var thenum=0;imgName="img1";var timer;var delay=250;var mode;function startup(imgList){var tokens=imgList.tokenize(","," ",true);pics=new Array(tokens.length);numpics=tokens.length;for(var i=0;i<tokens.length;i++){pics[i]=new Image();pics[i].src=tokens[i]}if(document.images){document.write("<IMG SRC='"+pics[thenum].src+"' border='0' name='img1'>\n");document.write("<BR><FORM><INPUT TYPE='button' value='Previous Image' onClick='halt(); change_it_prev();'>&nbsp;&nbsp;&nbsp;");document.write("<input type='button' value='<' onClick='rev()'>&nbsp;&nbsp;&nbsp;");document.write("<input type='button' value='Slower' onClick='slow()'>&nbsp;&nbsp;&nbsp;");document.write("<input type='button' value='Stop' onClick='halt()'>&nbsp;&nbsp;&nbsp;");document.write("<input type='button' value='Faster' onClick='fast()'>&nbsp;&nbsp;&nbsp;");document.write("<input type='button' value='>' onClick='fwd()'>&nbsp;&nbsp;&nbsp;");document.write("<INPUT TYPE='button' value='Next Image' onClick='halt(); change_it_next()'>");document.write("</FORM>")}}function halt(){clearInterval(timer);mode="";delay=250}function updateTimer(func){clearInterval(timer);timer=setInterval(mode,delay)}function fwd(){mode="change_it_next()";updateTimer()}function rev(){mode="change_it_prev()";updateTimer()}function slow(){if(delay<1000){delay=delay+50;updateTimer()}}function fast(){if(delay>50){delay=delay-50;updateTimer()}}function change_it_prev(){thenum-=1;if(thenum<0){document[imgName].src=pics[numpics-1].src;thenum=numpics-1}else{document[imgName].src=pics[thenum].src}}function change_it_next(){thenum+=1;if(thenum>numpics-1){document[imgName].src=pics[0].src;thenum=0}else{document[imgName].src=pics[thenum].src}};