
function mp3PlayerV2(id, div, mp3, play, noPlaylist, continuous, autoload) {
    if (typeof play == 'undefined') play = 0;
    if (typeof noPlaylist == 'undefined') noPlaylist = 0;
    if (typeof continuous == 'undefined') continuous = 0;
    if (typeof autoload == 'undefined') autoload = 0;
    
    if (AC_FL_RunContent == 0) {
        alert("This page requires AC_RunActiveContent.js.");
    } else {
        $('#'+div).html( AC_FL_RunContent(
            'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0',
            'width', '300',
            'height', '20',
            'src', '/mp3player_thin',
            'quality', 'high',
            'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
            'align', 'middle',
            'play', 'true',
            'loop', 'true',
            'scale', 'showall',
            'wmode', 'transparent',
            'devicefont', 'false',
            'id', id,
//            'bgcolor', 'transparent',
            'name', id,
            'menu', 'false',
            'allowFullScreen', 'false',
            'allowScriptAccess','always',
            'swLiveConnect', 'true',
            'movie', '/mp3player_thin',
            'salign', '',            
            'flashvars', 'song='+encodeURIComponent(mp3)+'&autoplay=' + ((play) ? 'true' : 'false') + '&noPlaylist=' + ((noPlaylist) ? 'true' : 'false')+'&continuous=' + ((continuous) ? 'true' : 'false')+'&autoload=' + ((autoload) ? 'true' : 'false')+'&myID='+id           
        ));
    }
    
    this.mp3 = mp3;
    this.id = id;
    this.div = div;
}

mp3PlayerV2.prototype.playMP3 = function () {
    try {
        obj = (aks_isIE && 0) ? eval('document.all.'+this.id) : eval('document.'+this.id);
//        console.log(obj);
        if (obj) obj.SetVariable("mustPlay", 1);
    } catch(err) {}
}

mp3PlayerV2.prototype.setMP3 = function (song) {
    try {
        obj = (aks_isIE && 0) ? eval('document.all.'+this.id) : eval('document.'+this.id);
        if (obj) {
            obj.SetVariable("songValuePlay", song);
            this.mp3 = song;
        }
    } catch(err) {}  
}

mp3PlayerV2.prototype.pauseMP3 = function () {
    try {
        obj = (aks_isIE && 0) ? eval('document.all.'+this.id) : eval('document.'+this.id);
        if (obj) obj.SetVariable("mustPause", 1);
    } catch(err) {} 
}

mp3PlayerV2.prototype.remove = function () {
    $('#'+this.div).html('');    
}