
var g_active_mp3player = 0;	// set to id of currently active player


function playmp3( divid, media_path )  {	
	if (g_active_mp3player == divid) { return; }
	
    $('#'+g_active_mp3player+'_1').remove();
    g_active_mp3player = 0;
	
	// create flash div for player
    $('#'+divid).flash(
        { id: divid+"_1",
		  'class': 'mp3player',
          src: '/assets/flash/player-t1.swf',
          width: 290,
          height: 24,
		  wmode: 'transparent'  },
        { version: 7 },
        function(htmlOptions) {
            $this = $(this);
            htmlOptions.flashvars.soundFile = media_path;
			htmlOptions.flashvars.autostart = 'yes';
            $this.before($.fn.flash.transform(htmlOptions));						
			g_active_mp3player = divid;
        }
    );

}


