//<![CDATA[
var myListener = new Object();
myListener.onInit = function()
{
	this.position = 0;
};
myListener.onUpdate = function()
{
	/*document.getElementById("info_playing").innerHTML = this.isPlaying;
	document.getElementById("info_url").innerHTML = this.url;
	document.getElementById("info_volume").innerHTML = this.volume;
	document.getElementById("info_position").innerHTML = this.position;
	document.getElementById("info_duration").innerHTML = this.duration;
	document.getElementById("info_bytes").innerHTML = this.bytesLoaded + "/" + this.bytesTotal + " (" + this.bytesPercent + "%)";*/
	
	var isPlaying = (this.isPlaying == "true");
};

function getFlashObject()
{
	return document.getElementById("myFlash");
}
function play(lachanson)
{
	if (myListener.position == 0) {
		getFlashObject().SetVariable("method:setUrl", "./music/"+lachanson+".mp3");
	}
	getFlashObject().SetVariable("method:play", "");
	getFlashObject().SetVariable("enabled", "true");
}
function pause()
{
	getFlashObject().SetVariable("method:pause", "");
}
function stop()
{
	getFlashObject().SetVariable("method:stop", "");
}
function setPosition(position)
{
	getFlashObject().SetVariable("method:setPosition", position);
}
function setVolume(volume)
{
	getFlashObject().SetVariable("method:setVolume", volume);
}
//]]>
