var musicPlayerApi = new Object();
		
/**
 * Initialisation
 */
musicPlayerApi.onInit = function()
{
	this.position = 0;
};
/**
 * Update
 */
musicPlayerApi.onUpdate = function()
{
	var isPlaying = (this.isPlaying == "true");
	
};

function pausecomp(millis)
{
	var date = new Date();
	var curDate = null;
	
	do { curDate = new Date(); }
	while(curDate-date < millis);
} 

function getFlashObject()
{
	return document.getElementById("musicPlayer");
}
function play(filename, songId)
{
	$('.song .playercontroller').removeClass('active');
	$('.song .' + songId).addClass('active');
	
	getFlashObject().SetVariable("method:setUrl", filename);
	
	getFlashObject().SetVariable("method:play", "");
	getFlashObject().SetVariable("enabled", "true");
}
function pause(songId)
{
	$('.song .' + songId).removeClass('active');
	getFlashObject().SetVariable("method:pause", "");
}
function stop(songId)
{
	$('.song .' + songId).removeClass('active');
	getFlashObject().SetVariable("method:stop", "");
}
function setPosition()
{
	var position = document.getElementById("inputPosition").value;
	getFlashObject().SetVariable("method:setPosition", position);
}
function setVolume()
{
	var volume = document.getElementById("inputVolume").value;
	getFlashObject().SetVariable("method:setVolume", volume);
}
