/* DHTML SlideShow - Copyright Berg 2007 */
var slideShow_count = 1;
var slideShow_timer;
var slideShow_scroll = 10000;
var slideShow_total = 0;
var slideShow_pause = false;
var slideShow_direction = 1;
var slideShow_fadeDuration = 1000;
var t;
function SlideShow_Pause()
{
slideShow_pause = !slideShow_pause;
if (slideShow_pause && slideShow_timer)
window.clearTimeout(slideShow_timer);
else
_PlaySlideShow();
}
function SlideShow_PlayForwards()
{
slideShow_direction = 1;
_PlaySlideShow();
}
function SlideShow_PlayBackwards()
{
slideShow_direction = -1;
_PlaySlideShow();
}
function _PlaySlideShow()
{
//fade out current slide
var img = new Fx.Style('slide_' + slideShow_count + "_image", 'opacity', {duration: slideShow_fadeDuration, transition: Fx.Transitions.linear});
img.start(1, 0);
var txt = new Fx.Style('slide_' + slideShow_count + "_text", 'opacity', {duration: slideShow_fadeDuration, transition: Fx.Transitions.linear});
txt.start(1, 0);
//update count
if(slideShow_direction==1)
if(slideShow_count < slideShow_total)
slideShow_count = slideShow_count + 1;
else
slideShow_count = 1;
else
if(slideShow_count > 1)
slideShow_count = slideShow_count - 1;
else
slideShow_count=slideShow_total;
//fade in new slide
var img2 = new Fx.Style('slide_' + slideShow_count + "_image", 'opacity', {duration: slideShow_fadeDuration, transition: Fx.Transitions.linear});
img2.start(0, 1);
var txt2 = new Fx.Style('slide_' + slideShow_count + "_text", 'opacity', {duration: slideShow_fadeDuration, transition: Fx.Transitions.linear});
txt2.start(0, 1);
//update counter
_ShowCounter();
//recurse
window.clearTimeout(slideShow_timer);
slideShow_timer = setTimeout("_PlaySlideShow();", slideShow_scroll);
}
function _ShowCounter()
{
var s = document.getElementById("counter");
if (s)
s.innerHTML = slideShow_count + "/" + slideShow_total;
}
function SlideShow_Play()
{
var ss = document.getElementById("slideShow");
if (ss)
ss.style.visibility = "visible";
for (var i=1 ; i < 20; i++)
if (document.getElementById("slide_"+i+"_image"))
slideShow_total++;
else
break;
_ShowCounter();
if (slideShow_total > 1) {
window.clearTimeout(slideShow_timer);
slideShow_timer = setTimeout("_PlaySlideShow();", slideShow_scroll);
}
}