var _slideShowAudioName = "slideShowAudio";
var _slideShowFullscreenAudioName = "slideShowAudioFullScreen";
    
function pauseSlideShowAudio(fullScreen) {
    if (getAudioFlashName(fullScreen) != null && getMovieObj(getAudioFlashName(fullScreen)) != null) {
        if (getMovieObj(getAudioFlashName(fullScreen)).pauseAudio)
            getMovieObj(getAudioFlashName(fullScreen)).pauseAudio();
    }
}

function resumeSlideShowAudio(fullScreen) {
    if (getAudioFlashName(fullScreen) != null && getMovieObj(getAudioFlashName(fullScreen)) != null) {
        if (getMovieObj(getAudioFlashName(fullScreen)).resumeAudio)
            getMovieObj(getAudioFlashName(fullScreen)).resumeAudio();
    }
}

function changeSlideShowSongUrl(url, playMusic, fullScreen) {
    if (getAudioFlashName(fullScreen) != null && getMovieObj(getAudioFlashName(fullScreen)) != null) {
        if (getMovieObj(getAudioFlashName(fullScreen)).playNewSong)
            getMovieObj(getAudioFlashName(fullScreen)).playNewSong(url, playMusic);
    }

    //  Also set the mute state to 'not muted' if we just changed the song:
    setMute("N");
}

function setVolume(volume, muted) {
    var fullscreen = ($('#wst_album_popup:visible').length != 0);
    if (getAudioFlashName(fullscreen) != null && getMovieObj(getAudioFlashName(fullscreen)) != null) {
        if (getMovieObj(getAudioFlashName(fullscreen)).doVolumeChange)
            getMovieObj(getAudioFlashName(fullscreen)).doVolumeChange(volume, muted);
    }
}

function setMute(muted) {
    if (getAudioFlashName(false) != null &&  getMovieObj(getAudioFlashName(false)) != null) {
        if (getMovieObj(getAudioFlashName(false)).doVolumeChange)
            getMovieObj(getAudioFlashName(false)).doVolumeChange(0, muted);
    }
}

function setMuteFullScreen(muted)
{
    if (getAudioFlashName(true) != null &&  getMovieObj(getAudioFlashName(true)) != null) {
        if (getMovieObj(getAudioFlashName(true)).doVolumeChange)
            getMovieObj(getAudioFlashName(true)).doVolumeChange(0, muted);
    }
}

function getMovieObj(movieName)
{
    return document.getElementById(movieName);
}

function getAudioFlashName(fullScreen) {
    setTimeout("", 1000);
    if(fullScreen)
        return _slideShowFullscreenAudioName;
      
    return _slideShowAudioName;
}

function regoutput(s)
{
    if (console)
        console.log("regout: " + s);
}

function fulloutput(s)
{
    if (console)
        console.log("fullout: " + s);
}