var _musicFile;
var _onImg;
var _offImg;

function MusicOn() {
	container = document.getElementById(_buttonId);
	img = document.createElement('img');
	img.src = _offImg;
	img.onclick = function() { MusicOff(); } 
	img.alt="Music Off";
	if (container.firstChild!=null) container.removeChild(container.firstChild);
	container.appendChild(img);
	document.getElementById(_playerId).Play();
	
	//if (el!=null) el.innerHTML = '<img src="' + _offImg + '" alt="Music Off" onClick="MusicOff()"/>';
	/*if ((document.getElementById(_playerId)) && (document.all))
		document.getElementById(_playerId).Play();	*/
}

function MusicOff() {
	container = document.getElementById(_buttonId);
	img = document.createElement('img');
	img.src = _onImg;
	img.onclick = function() { MusicOn(); } 
	img.alt="Music On";
	if (container.firstChild!=null) container.removeChild(container.firstChild);
	container.appendChild(img);
	document.getElementById(_playerId).Stop();

	/*if (document.getElementById(_playerId).all) 
  		document.getElementById(_playerId).Stop();*/
}


function ConfigBackgroundSound(musicFile, onImg, offImg, playerId, buttonId) {	
	_musicFile = musicFile;
	_onImg = onImg;
	_offImg = offImg;
	_playerId = playerId;
	_buttonId = buttonId;
}

