function toggle()
{
    if (top.top_frame.playing == true) {
        stop();
    } else {
        start();
        scroll_title();
    }
}

function start()
{
    top.top_frame.loadCurrentSong();
    showStart();
}

function showStart()
{
    top.top_frame.playing = true;
    $('#player-play').html("STOP");
    scroll_title();
}

function stop()
{
    top.top_frame.top_soundObj.stop();
    showStop();
}

function showStop()
{
    top.top_frame.playing = false;
    $('#player-play').html("PLAY");
}

function volumeUp()
{
    temp = top.top_frame.top_gVolume;
    if (temp + 20 <= 100) {
        top.top_frame.top_soundObj.setVolume(temp + 20);
        top.top_frame.top_gVolume = temp + 20;
    } else {
        top.top_frame.top_soundObj.setVolume(100);
        top.top_frame.top_gVolume = 100;
    }
}

function volumeDown()
{
    temp = top.top_frame.top_gVolume;
    if (temp - 20 >= 0) {
        top.top_frame.top_soundObj.setVolume(temp - 20);
        top.top_frame.top_gVolume = temp - 20;
    } else {
        top.top_frame.top_soundObj.setVolume(0);
        top.top_frame.top_gVolume = 0;
    }
}
    
var scroll = true;

function scroll_title() {
    if (scroll) {
        $('#player-info').html("<ul><li><span>"+top.top_frame.top_scrollingText+"</span></li></ul>");
        $('#player-info ul').liScroll();
    }
}

function load_player() {
    if (top.top_frame.playing) {
        showStart();
    }
}
