function BoiteNote(id_config, colonne, position, reduite, config)
{
  this.base = Boite;
  this.base(id_config, colonne, position, reduite);
  this.config = config;
  this.refreshOnLoad = false;

  this.modifier = function(obj)
  {
      var couleur = obj.color.value;
      document.getElementById('div_'+this.id_config).className = 'divConteneur_'+couleur;
      Effect.DropOut('config', {duration:0.2});
      new Ajax.Request('module_web/flux/ajax/modifier.php',
	               {
                         method: 'post', 
                         postBody: 'type='+NOTE+'&color='+couleur+'&id='+this.id_config
                        });
  }
}
BoiteNote.prototype = new Boite;

BoiteNote.nouvelleBoite = function(obj)
{
      var couleur  = obj.color.value;
      new Ajax.Request('module_web/flux/ajax/ajouter.php',
	        {
                  method: 'post', 
                  postBody: 'type_boite='+NOTE+'&colonne='+1+'&reduite='+0+'&color='+couleur,
                  onSuccess: BoiteNote.ecrireNouvelleBoite
                });
}

BoiteNote.ecrireNouvelleBoite = function(t)
{
  var idNewBoite = Boite.ecrireNouvelleBoite(t, BoiteNote);
  new Ajax.InPlaceEditor("webnote_"+idNewBoite, "module_web/flux/ajax/modifier.php", {rows:15,cols:35,okButton: false, cancelLink: false, submitOnBlur: true, callback: postModifWebnote, formId: idNewBoite, highlightcolor: 'transparent'});
}

function postModifWebnote(form)
{
  var retour = Form.serialize(form);
  retour += '&type='+NOTE+'&id='+form.id;
  return retour;
}


/* Hack pour IE qui fait n'importe quoi */
Object.extend(Ajax.InPlaceEditor.prototype, {
    getText: function()
             {
               var retour = this.element.innerHTML;
               var regex = /<br _extended="true">/gi
               retour = retour.replace(regex, "\n");
	       return retour;
             }
});
