// some variables to save
	var currentPosition;
	var currentVolume;
	var currentItem;

	// these functions are caught by the JavascriptView object of the player.
	function sendEvent(typ,prm) { thisMovie("mpl").sendEvent(typ,prm); };
	function getUpdate(typ,pr1,pr2,pid) {
		if(typ == "time") { currentPosition = pr1; }
		else if(typ == "volume") { currentVolume = pr1; }
		var id = document.getElementById(typ);
		id.innerHTML = affiche_heure(pr1);
	}

	// This is a javascript handler for the player and is always needed.
	function thisMovie(movieName) {
	    if(navigator.appName.indexOf("Microsoft") != -1) {
			return window[movieName];
		} else {
			return document[movieName];
			//return document.getElementById(movieName);
		}
	}

	function loadFile(obj) { thisMovie("mpl").loadFile(obj); };

	function affiche_heure(seconde) {
		var secondes_abs = Math.round(seconde);
		var secondes_rel = secondes_abs % 60;
		var minutes_abs = Math.round(Math.abs(Math.round(secondes_abs-30)/60));
		minutes_abs  = (minutes_abs < 1) ? 0 : minutes_abs;
		
		var nombre_secondes ="" + ((secondes_rel > 9) ? secondes_rel : "0" + secondes_rel);
		var nombre_minutes ="" + ((minutes_abs > 9) ? minutes_abs : "0" + minutes_abs);
		return nombre_minutes + ":" + nombre_secondes;
	}
