I have a problem in photo viewer

I have this code which by that user can chose the phoro viewer to be on a slide show every 5 second or not:

<p align=“center”><span id=“caption”>Caption</span> Slideshow
<a href=“javascript:void(enableSlideMode(5));”>On</a> /
<a href=“javascript:void(disableSlideMode());”>Off</a> </p>

But i want slideshow to be automatically on in the page…I donno what to do:(
I put this code but it goes to a loop for ever and doest stop and doesnt work every 5 second:

<script type=“text/javascript”>

I’d be greatful if some body can help