<!-- Slideshow code-->
show0 = new Image(31,31);show0.src = "$resPath/show.gif";
show1 = new Image(31,31);show1.src = "$resPath/show1.gif";
stop0 = new Image(31,31);stop0.src = "$resPath/stop.gif";
stop1 = new Image(31,31);stop1.src = "$resPath/stop1.gif";

var show_param = -1; // -1 = slideshow stopped
var delay = $slideShowDelay;
if(window.location.search.length > 1){
  var parms = window.location.search.substring(1,location.search.length).split("&");
    for(var i = 0; i < parms.length; i++) {		
      if(parms[i].substring(0, parms[i].indexOf("=")) == "show_param") 
        delay = show_param = parms[i].substring(parms[i].indexOf("=") + 1, parms[i].length);
}}
var show_delay = show_param;
function show_timer() {
  if(show_delay >= 0){
    show_delay--;
    if(show_delay < 0 && show_param > 0) {
      <ja:if exists="nextPage">window.location="$nextPage?show_param=" + show_param;</ja:if>
      <ja:else><ja:if test=<%=slideShowLoop == true%>>window.location="$firstPage?show_param=" + show_param;</ja:if><ja:else>show_down(); setTimeout('show_out()', 200);</ja:else></ja:else>
    }
    else { if(show_param > 0) { window.status='Time left: '+(show_delay+1)+' s'; }}
  }
  setTimeout('show_timer()', 1000);	
}
function show_over()
{ if(show_param >= 0) { document.show.src=stop1.src; }
  else { document.show.src=show1.src; }
  window.status='$text.startStopSlideShow - $text.changeSpeed';
}
function show_out()
{ if(show_param >= 0) { document.show.src=stop0.src; }
  else { document.show.src=show0.src; }
}
function show_down()
{ if(show_param >= 0) { show_param = -1; document.show.src=stop1.src; window.status=''; } 
  else { show_param = delay; document.show.src=show1.src; } 
  show_delay = show_param; 
}
function change_delay()
{ delay = prompt('$text.delay', (show_param < 0)? $slideShowDelay:show_param);
  show_param = show_delay = delay; document.show.src=show1.src;
}
