addEV(window, "load", init);

function play()
{
	var mp3 = document.getElementById("mp3player");

	if (!mp3.hasChildNodes())
	{
		var fc = document.createElement("div");

		fc.setAttribute('id', 'flashcontent');
		mp3.appendChild(fc);
		var ie_bug_killer = Math.random();
		var so = new SWFObject("xspf_player.swf?ie_bug_killer=" + ie_bug_killer, "soplayer", "1", "1", "7", "#FF6600");
		so.addVariable("song_url", "zzz.mp3");
		so.addVariable("autoplay", "true");
		so.addVariable("repeat_playlist", "true");
		so.write("flashcontent");
	}
}

function stop()
{
	var fc = document.getElementById('mp3player');
	if (fc.hasChildNodes())
		fc.removeChild(fc.firstChild);
}

function init()
{
	play();
}

function addEV(obj, name, method)
{
	if (obj.addEventListener)
	{
		obj.addEventListener(name, method, false);
	}
	else if (obj.attachEvent)
	{
		obj.attachEvent('on' + name, method);
	}
}

