var PageSoundController = new Object();
PageSoundController.lecteurs = new Object();
PageSoundController.playing = null;

PageSoundController.register = function(sId){
	var oObject = window.document.getElementById(sId);
	
	if(oObject){
		PageSoundController.lecteurs[sId] = true;
	}//end if
	
}//end function

PageSoundController.requireFocus = function(sId){

	if(PageSoundController.lecteurs[sId] == undefined){
		return false;
	}//end if

	if(PageSoundController.playing != null){
		alert("Vous devez arrêter la lecture en cours avant d'écouter cette piste");
		return false;
	}//end if
	
	PageSoundController.playing = sId;
		
	return true;
	
}//end function

PageSoundController.releaseFocus = function(sId){

	if(PageSoundController.lecteurs[sId] == undefined){
		return false;
	}//end if

	if(PageSoundController.playing != null){
		PageSoundController.playing = null;
	}//end if
	
	return true;
	
}//end function
