// SOUNDS
var player_on = true;
var sound_current = 1;
var sound_enabled = true;

// gets player
function get_sp() {
    return document.getElementById('sound_player');
}

// player listener
var sp_listener = new Object();
sp_listener.onInit = function() {
    this.position = 0;
    get_sp().SetVariable('method:setVolume', 100);
};

// plays next sound
function play_sound() {
    if ( ! sound_enabled || player_on) {
        return;
    }
    // loop
    if (sound_current > sound_num) {
        sound_current = 1;
    }
    // sets flash player
    get_sp().SetVariable('method:setUrl', 'sounds/_'+sounds_table[sound_current]+'.mp3');
    get_sp().SetVariable('method:play', '');
    ++sound_current;
}

// stops sound
function stop_sound() {
    get_sp().SetVariable('method:stop', '');
}
