﻿var _soundButtonIndex = 0;
var _arSoundButtons = [];

function fn(e) {
	if (e.ref)
		_arSoundButtons.push(e.ref);
}

function addSoundButton(mp3Url, buttonUrl, elm, w, h) {
	var flashVars = { mp3Url:mp3Url, buttonId:"soundButton" + _soundButtonIndex };
	var attributes = { styleclass:"sound-button" };
	swfobject.embedSWF(buttonUrl, elm, w, h, "9.0.0", null, flashVars, null, attributes, fn);
	_soundButtonIndex++;
}

function stopOtherSoundButtons(sButtonId) {
	for (var i=0; i<_arSoundButtons.length; i++) {
		//alert(_arSoundButtons[i].parentNode.innerHTML)
		
		if (sButtonId != _arSoundButtons[i].id)
			_arSoundButtons[i].stopSound();
	}
}


