/*
* Menu View representation 
*/
function Menu(div,controller){
  
  /****************************************************************************************/
  /* class inherits*/
	/**************/
  this._extends = view;
  this._extends(controller);
  
  /****************************************************************************************/
  /* class attributes */
	/****************/
  buttonsActions = [
    {
    id:0,
    prefix:'.:',
    name:'Poster un message',
    event:'SendMsg',
    params:null,
    title:'Poster un message'
    },
    {
    id:1,
    prefix:'.:',
    name:'Poster un fichier',
    event:'SendPhoto',
    params:null,
    title:'Uploader un fichier .jpg, .gif, .png, .pdf, .doc, .xls < 2Mo'
    }
  ]; 
  buttonsNavigation = [
    {
    id:0,
    prefix:'.:',
    name:'Accueil',
    event:'RefreshItems',
    params:{keywords:35},
    title:'Accueil'
    },
    {
    id:1,
    prefix:'.:',
    name:'Blackboard',
    event:'RefreshItems',
    params:{keywords:0},
    title:'AccĂder aux news'
    },
    {
    id:2,
    prefix:'.:',
    name:'Riders',
    event:'RefreshItems',
    params:{keywords:257},
    title:'Listing des riders'
    },
    {
    id:3,
    prefix:'.:',
    name:'Photos',
    event:'RefreshItems',
    params:{keywords:5},
    title:'Vos photos'
    },
    {
    id:4,
    name:'Articles',
    prefix:'.:',
    event:'RefreshItems',
    params:{keywords:3},
    title:'Les articles'
    },
    {
    id:5,
    prefix:'.:',
    name:'VidĂ©os',
    event:'RefreshItems',
    params:{keywords:1},
    title:'VidĂ©os'
    },
    {
    id:6,
    prefix:'.:',
    name:'Fichiers',
    event:'RefreshItems',
    params:{keywords:312},
    title:'Fichiers uploadĂ©s'
    },
    {
    id:7,
    prefix:'.:',
    name:'Vie associative',
    event:'RefreshItems',
    params:{keywords:37},
    title:'Infos pratiques'
    },
    {
    id:8,
    prefix:'.:',
    name:'Liens',
    event:'RefreshItems',
    params:{keywords:2},
    title:'Liens'
    },
    {
    id:9,
    prefix:'.:',
    name:'Contact',
    event:'RefreshItems',
    params:{keywords:36},
    title:'Nous contacter'
    },
    {
    id:10,
    prefix:'.:',
    name:'Aide',
    event:'RefreshItems',
    params:{keywords:4},
    title:'Infos sur le site'
    }
  ];
  /****************************************************************************************/
  /* class graphical methods */
	/***********************/


  /****************************************************************************************/
  /* class buttons event handler */
  /**************************/
  
  /*
    * contruct the screen GUI representation
    */
  this.construct = function(div){
    div.innerHTML+="\
      <fieldset class='fondVert'><legend>Navigation</legend>\
        <div id='divNavigation'></div>\
      </fieldset>\
      <fieldset class='fondVert'><legend>Actions</legend>\
        <div id='divActions'></div>\
        <!--a href='./signin.php'>.:Sign in</a><br/-->\
        <a href='./logout.php'>.:Log out</a>\
      </fieldset>\
      <fieldset class='fondVert'><legend>Goodies</legend>\
        <center>\
        <a href='http://ridersenbray.com/REB06/podCast.php'>\
          <img  style='margin:2px;' src='http://www.pochoirs.de/reblog/bilder/rssfeed.gif' border='0'  alt='PodCast REB' title='PodCast REB'/></a><br/>\
        <img src='http://www.google.com/logos/Logo_25wht.gif' style='cursor:pointer' border='0' alt='Google AdSense' title='liens sponsoris&eacute;s' onmouseup='getById(\"divGoogleAds\").style.display= \"inline\";'/>\
        </center>\
      </fieldset>\
      <p style='text-align:center'>g&eacute;n&eacute;r&eacute; par phpObjGen en <i>" + tempsDeTraitement + "</i> ms.</p>\
      <p style='text-align:center'><a href='http://validator.w3.org/check?uri=referer'>\
           <img  style='margin:2px;' src='../img/xhtml_valid.gif' border='0' alt='Valid XHTML 1.0 Transitional' title='Validation XHTML  1.0 Transitional'/></a>\
         <a href='http://jigsaw.w3.org/css-validator/check/referer'>\
           <img style='margin:2px;' src='../img/css_valid.gif' border='0' alt='Valid CSS' title='Validation CSS'/></a>\
      </p>\
      ";
    buttonsNavigation.each(function(buttonNavigation){
      getById('divNavigation').innerHTML += '<div id=\'divMenuButtonNavigation' + buttonNavigation.id + '\' class=\'button\'></div>';
    });
    buttonsNavigation.each(function(buttonNavigation){
      button = new Button(getById('divMenuButtonNavigation' + buttonNavigation.id),  buttonNavigation);
      button.controller.addListener(_items); //
      button.controller.addListener(_formulaire); //
    });
    buttonsActions.each(function(buttonAction){
      getById('divActions').innerHTML += '<div id=\'divMenuButtonActions' + buttonAction.id + '\' class=\'button\'></div>';
    })
    buttonsActions.each(function(buttonAction){
      button = new Button(getById('divMenuButtonActions' + buttonAction.id),  buttonAction);
      button.controller.addListener(_formulaire); //
    })
  };
  this.construct(div, this);	

  /* class event Handler methods */
	/***************************/
  
}; // end class Menu




