I have this script that shows a picture slide show from a database... <script language="javascript"> var imgArray=new Array({$num_pictures}); var switchImage={$set_slideShow_sec}; var switchImageCountFrom={$set_slideShow_count_from}; {foreach item=image from=$image_list} imgArray[{$image.nr}]="{$image.file}"; {/foreach} </script> Code (markup): However it lacks controllers...you know "<< prev | next >>". And I have no idea as I'm a noob to JS... Hmm...This thing uses Smarty Engine so I don't know what the variables are set to...I can look if it's needed.