title: Replace a list of emoticons with their images
body: <p>I have an array with:</p>
  
  <pre><code>emoticons = {
     ':-)' : 'smile1.gif',
     ':)'  : 'smile2.gif',
     ':D'  : 'smile3.gif'     
  }
  </code></pre>
  
  <p>then i have a variabile with the text.</p>
  
  <pre><code>var text = 'this is a simple test :)';
  </code></pre>
  
  <p>and a variable with the url of the website</p>
  
  <pre><code>var url = "http://www.domain.com/";
  </code></pre>
  
  <p>How to write a function that replace the symbols with their images?</p>
  
  <p>The <code>&lt;img&gt;</code> tag result should be:</p>
  
  <pre><code>&lt;img src="http://www.domain.com/simple2.gif" /&gt;
  </code></pre>
  
  <p>(I have to concatenate the url varible to the name of the image).</p>
  
  <p>THank you very much!</p>