function slideSwitch(fadeTime) {
    var $active = $('#slideshow DIV DIV.active');

    if ( $active.length == 0 ) $active = $('#slideshow DIV DIV:last');

    var $next =  $active.next().length ? $active.next() : $('#slideshow DIV DIV:first');

    $active.addClass('last-active');
    $active.removeClass('active last-active')
    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, fadeTime);
}

function AddHelp() {
    $(".help").tooltip({
        track: true,
        fade: 250
    });
}

function AddBackToTop() {
    $('.faq dd').append('<a href="#questions">Back to Top</a>');
}

function checkAgreement(){
    buttonLabel = (typeof buttonLabel == 'undefined')?  'I Accept' : buttonLabel ;

    if(!$('#agreeCheck1').is(':checked') || !$('#agreeCheck2').is(':checked')){
        alert("Please check the box that you agree to the:\n  -  Web Publisher Agreement\n  -  Code of Conduct\n\nAnd then click on the \""+buttonLabel+"\" button.");
        return false;
    }
    return true;
}
