title: Is this a good practice object for diplaying messages?
body: <p>It works, I've tested it.  What I want to know is - is this good practice.  Obviously I could have just used an associative array and called it.  But I wanted to encapuslate it into an object with state.</p>
  
  <pre><code>var View_message = function(div)
  {    this.messages = 
      {
          empty: 'Please complete all fields',
          empty_bm: 'Please enter both a title and url',
          name: 'Only letters or dashes for the name field',
          email: 'Please enter a valid email',
          same: 'Please make emails equal',
          taken: 'Sorry that email is taken',
          pass: 'Please enter a valid password, 6-40 characters',
          validate: 'Please contact &lt;a class="d" href="mailto:support@archemarks.com"&gt;support&lt;/a&gt; to reset your password',
          url:  'Pleae enter a valid url'
      }; 
      this.div = div; 
  }; 
  
  View_message.prototype.display = function(type) 
  {
      document.getElementById(this.div).innerHTML=this.messages[type];
  };
  
  obj_view = new View_message('test_id')
  obj_view.display('empty');
  </code></pre>