Hi all,

I had a redirect script in my web page which has stopped working. I wonder if somebody could tell me what is wrong with this code? I tried adding an alert to the function to see if it was running and the alert doesn't display so I assume that means it isn't running.

Here is the javascript code:

Code JavaScript:
<script>
redirTime = "5000";
redirURL = "index.php?/category/5/start-1?slide=true";
 
 function redirTimer() 
 
   { 
 
    settime=self.setTimeout("self.location.href = redirURL;",redirTime); 
    document.getElementById('slideshow').innerHTML='<a href=# onclick="stopredir()">Stop Slideshow</a>';
    document.getElementById('next-nav').innerHTML='<a class="next-link" href="index.php?/category/5/start-1?slide=true" rel="next"><img class="next-icon" src="/gallery/themes/default/images/next.png" /></a>';
	document.getElementById('prev-nav').innerHTML='<a class="prev-link" href="/?slide=true" rel="prev"><img class="prev-icon" src="/gallery/themes/default/images/prev.png" /></a>';
 
	alert(Redirect Script is running);
 
 
   { 
 
 
      function stopredir()
 
       { 
 
        window.clearTimeout(settime);
        document.getElementById('slideshow').innerHTML='<a href=# onclick="redirTimer()">Start Slideshow</a>';
        document.getElementById('next-nav').innerHTML='<a class="next-link" href="index.php?/category/5/start-1?slide=false" rel="next"><img class="next-icon" src="/gallery/themes/default/images/next.png" /></a>';
        document.getElementById('prev-nav').innerHTML='<a class="prev-link" href="/?slide=false" rel="prev"><img class="prev-icon" src="/gallery/themes/default/images/prev.png" /></a>';
 
   { 
 
</script>

And this is the Body tag to show that I am calling it on page load:

Code HTML4Strict:
<body id="theCategoryPage" onload="redirTimer()">

I hope somebody can help me. I've been trying to get this working all day.