/*
* Button View representation 
*/
function Button(div,params){
  
  /****************************************************************************************/
  /* class inherits*/
	/**************/
  this._extends = view;
  this._extends(new controller());
  
  /****************************************************************************************/
  /* class attributes */
	/****************/
  
  /****************************************************************************************/
  /* class graphical methods */
	/***********************/


  /****************************************************************************************/
  /* class buttons event handler */
  /**************************/
  this.onmousedown = function(self,div){
    return function(){ div.style.color = "#666666";}
  };
  this.onmouseover = function(self,div){
    return function(){ div.style.color = "#990000";}
  };
  this.onmouseup = function(self,div,params){
    return function(){
      self.controller.send(params.event, params.params);
      div.style.color = "#660000";
    }
  };
  this.onmouseout = function(self,div){
    return function(){ div.style.color = "#660000";}
  };

  /*
    * contruct the screen GUI representation
    */
  this.construct = function(div,params){
    if (undefined===params.prefix) div.innerHTML = params.name; 
    else div.innerHTML = params.prefix + params.name;
    if(undefined===params.title) div.title = 'title';
    else div.title = params.title;
    div.onmouseup   = this.onmouseup(this,div,{event:params.event,params:params.params});
    div.onmousedown   = this.onmousedown(this,div);
    div.onmouseover   = this.onmouseover(this,div);
    div.onmouseout   = this.onmouseout(this,div);
    };
  this.construct(div, params);	
  /****************************************************************************************/
  /* class event Handler methods */
	/***************************/
  
}; // end class Menu




