/*
* Mediaplayer View representation 
*/
function Mediaplayer(div){
  
  /****************************************************************************************/
  /* class inherits*/
	/**************/
  this._extends = view;
  this._extends(new controller());
  
  /****************************************************************************************/
  /* class attributes */
	/****************/
  
  /****************************************************************************************/
  /* class graphical methods */
	/***********************/
  
  /*
    * contruct the screen GUI representation
    */
  this.construct = function(div){
    div.innerHTML+="\
      <fieldset class='fondVert'>\
      <div class='closerPere'><div class='closer' id='divCloserMediaplayer'></div></div>\
      <legend id='divMediaplayerLegend'>&nbsp;Lecteur multimédia&nbsp;</legend>\
      <div id='divMediaplayerContent'></div>\
      </fieldset>\
    ";
     this.closer = new Button(getById('divCloserMediaplayer'), {name:'&nbsp;X&nbsp;', event:'PressCloser', params:null, title:'Fermer'});
     this.closer.controller.addListener(this);
    };
    this.construct(div);	
  
  /****************************************************************************************/
  /* class event Handler methods */
	/***************************/

  this.onPressCloser = function(params){
    debug('[MEDIAPLAYER] onPressCloser');
    getById('divMediaplayer').style.display = 'none';
    }

  this.onDisplayMedia = function(params){
    debug('[MEDIAPLAYER] onDisplayMedia ' + params.link);
    getById('divMediaplayer').style.display = 'inline';
    getById('divMediaplayerContent').innerHTML = '<img width="100%" src="' + params.link + '"/>';
    }


}; // end class Mediaplayer




