
/* --------------------------------------------------------------------------
   MUSIC PLAYER OPTIONS */

var currentPlayerId = "";

function sendEvent(playerId, typ, prm) {
    document.getElementById(playerId).sendEvent(typ,prm);
}

function getUpdate(typ,pr1,pr2,pid) {
    // stop all players first:
	if (pid != "null" && typ == "state" && pr1 == 2) {
        if (currentPlayerId != "") {
            sendEvent(currentPlayerId, 'stop');
        }
        currentPlayerId = pid;
    }
}

function createPlayer(replaceElement, playerId, file) {
	var so = new SWFObject("/lib/components/mp3player.swf", playerId, "17", "19", "9", "#996600");
	so.addVariable("file", file);
    so.addVariable("displayheight", "0");
	//so.addVariable("enablejs", "true");
	so.addVariable("volume", "75");
	so.addVariable("javascriptid", playerId);

	so.addVariable("backcolor","0x996600");
	so.addVariable("frontcolor","0xFFFFFF");
	so.addVariable("lightcolor","0xD6B98B");
	so.addVariable("screencolor","0x996600");

	so.write(replaceElement);
}

