function onUpdate(){}
function onInit(){}



 var myListener = new Object();
                
/**
 * Initialisation
 */
myListener.onInit = function()
{
	this.position = 0;
};
/**
 * Update
 */
myListener.onUpdate = function()
{	alert("DSA");

	document.getElementById("timeline").innerHTML = " "+this.position+"/"+this.duration;
	if(this.isPlaying){
		if(this.position>this.duration-1000){
			player.next();
		}
	}
};


var player = new Object();
player.canciones = new Array(
				'audio/01aranjuez_allegro_spirito.mp3',
				'audio/02aranjuez_adagio.mp3',
				'audio/03aranjuez_allegro_gentile.mp3',
				'audio/04gentilhombre_villano_y_ricercare.mp3',
				'audio/05gentilhombre_espanoleta.mp3',
				'audio/06gentilhombre_danza_de_las_hachas.mp3',
				'audio/07gentilhombre_canario.mp3',
				'audio/08sonatina_allegretto.mp3',
				'audio/09sonatina_andante.mp3',
				'audio/10sonatina_allegro.mp3',
				'audio/11a_minor_prelude.mp3'
				);
player.current = 0;
player._getFlashObject = function(){
	return document.getElementById("myMP3Player");
};
player.loadFile = function(url_mp3){
	this._getFlashObject().SetVariable("method:setUrl", url_mp3);
};
player.play = function(){
	this._getFlashObject().SetVariable("method:play", "");
};
player.pause = function(){
	this._getFlashObject().SetVariable("method:pause", "");
};
player.stop = function(){
	this._getFlashObject().SetVariable("method:stop", "");
};
player.next = function(){
	if(this.current<this.canciones.length-1){
		this.current++;
		this.pause();
		this.loadFile(this.canciones[this.current]);
		this.play();
	}
};
player.previous = function(){
	if(this.current>0){
		this.current--;
		this.pause();
		this.loadFile(this.canciones[this.current]);
		this.play();
	}
};
