var swfMp3Player2 = new Object();
                
/**
 * Initialisation
 */
swfMp3Player2.onInit = function()
{
    console.log("Audioplayer INIT: swf edition");
    this.position = 0;
};
/**
 * Update
 */
swfMp3Player2.onUpdate = function()
{
    console.log('AudioPlayer: tick'+this.position);
};

function getFlashObject2()
{
    return document.getElementById("swfPlayer2");
}
function play2(file)
{
    if (swfMp3Player2.position == 0) {
        console.log("Audioplayer PLAY: "+file);
        getFlashObject2().SetVariable("method:setUrl", file);
    }
    getFlashObject2().SetVariable("method:play", "");
    getFlashObject2().SetVariable("enabled", "true");
}
function pause2()
{
    getFlashObject2().SetVariable("method:pause", "");
}
function stop2()
{
    getFlashObject2().SetVariable("method:stop", "");
}
function setPosition2(v)
{
    var position;
    
    if(document.getElementById("inputPosition"))
    	position = document.getElementById("inputPosition").value;
    
    if(v)
    	position = v;
    
    getFlashObject2().SetVariable("method:setPosition", position);
}
function setVolume2()
{
    var volume = document.getElementById("inputVolume").value;
    getFlashObject2().SetVariable("method:setVolume", volume);
}