var videoisdown = false;
var videofirstrun = true;
var slideshow_interval = 0;
var slideshow_item = 0;
var slideshow_paused = false;
function slideshow_goto (target,isclick) { if(isclick && !slideshow_paused){clearInterval(slideshow_interval);
slideshow_interval = setInterval(slideshow_goto,slideshow_swapcount);
if(target == -1){target = slideshow_captions.length - 1;
}if(target == slideshow_captions.length){target = 0;
}} else {target = slideshow_item + 1;
if(target == slideshow_captions.length){target = 0;
}}if(document.getElementById('sl'+slideshow_item)){document.getElementById('sl'+slideshow_item).className = 'off';
}if(document.getElementById('sl'+target)){document.getElementById('sl'+target).className = 'on';
}slideshow_item = target;
$("#sl_main").stop();
$("#sl_caption").stop();
$("#sl_main").css({ opacity: "1" });
$("#sl_caption").css({ opacity: "1" });
$("#sl_caption").fadeOut("fast", function () { document.getElementById('sl_caption').innerHTML = slideshow_captions[target];
$("#sl_caption").fadeIn("fast") });
$("#sl_main").fadeOut("fast", function () { document.getElementById('sl_main').innerHTML = '
';
$("#sl_main").fadeIn("fast");
});
}
function slideshow_pausemanage () { if(slideshow_paused){ slideshow_paused = false;
slideshow_interval = setInterval(slideshow_goto,slideshow_swapcount);
document.getElementById("slideshow_pause").style.backgroundColor = "#cc2222";
} else { slideshow_paused = true;
clearInterval(slideshow_interval);
document.getElementById("slideshow_pause").style.backgroundColor = "#4e8dd4";
}}
function videotoggle () {
if(videoisdown){
if(document.getElementById('videoshow')){
document.getElementById('videoshow').style.backgroundColor = '#ff0000';
document.getElementById('videoshow').innerHTML = 'OPEN VIDEO »';
}
$('#videospace').slideUp("fast", function () { document.getElementById('videospace').style.display = 'none'; });
videoisdown = false;
} else {
if(videofirstrun){
var varcheck = new Array();
if(typeof(currentchapter) != 'undefined'){
varcheck.current = currentchapter;
}
if(document.getElementById('videospace')){
document.getElementById('videospace').innerHTML = '

You\'ll need Flash 9 or better to view this content. Download it now