title: Javascript: Problem with switching between html textarea and nicedit
body: <p>I am using <a href="http://nicedit.com/index.php" rel="nofollow noreferrer">nicedit</a>.</p>
  <p>I have been trying to create a default html textarea that gets turned into a nicedit textfield when you click on it. I want it to revert to a plain html textarea when it loses focus. I have been able to do this successfully when using just one textarea, however, when I use two textareas strange things happen (in Firefox). I use the following script:</p>
  <pre><code>&lt;script type=&quot;text/javascript&quot; src=&quot;http://js.nicedit.com/nicEdit-latest.js&quot;&gt;&lt;/script&gt; &lt;script type=&quot;text/javascript&quot;&gt; 
  
  function fieldname_1()
  {
     area = new nicEditor({fullPanel : true}).panelInstance('fieldname');
     area.addEvent('blur', function() 
     {
        area.removeInstance('fieldname');
        area = null;
        document.getElementById(&quot;fieldname&quot;).onclick=function(){fieldname_2()}
     });
  }
  
  function fieldname_2()
  {
     area = new nicEditor({fullPanel : true}).panelInstance('fieldname');
     area.addEvent('blur', function() 
     {
        area.removeInstance('fieldname');
        area = null;
        document.getElementById(&quot;fieldname&quot;).onclick=function(){fieldname_1()}
     });
  }
  
  function fieldname2_1()
  {
     area = new nicEditor({fullPanel : true}).panelInstance('fieldname2');
     area.addEvent('blur', function() 
     {
        area.removeInstance('fieldname2');
        area = null;
        document.getElementById(&quot;fieldname2&quot;).onclick=function(){fieldname2_2()}
     });
  }
  
  function fieldname2_2()
  {
     area = new nicEditor({fullPanel : true}).panelInstance('fieldname2');
     area.addEvent('blur', function() 
     {
        area.removeInstance('fieldname2');
        area = null;
        document.getElementById(&quot;fieldname2&quot;).onclick=function(){fieldname2_1()}
     });
  }
  
  &lt;/script&gt;
  
  &lt;TEXTAREA id=&quot;fieldname&quot; cols=&quot;35&quot; onclick=&quot;fieldname_1();&quot; &gt;&lt;/TEXTAREA&gt;
  &lt;br&gt;&lt;br&gt;&lt;br&gt;
  &lt;TEXTAREA id=&quot;fieldname2&quot; cols=&quot;35&quot; onclick=&quot;fieldname2_1();&quot; &gt;Test text&lt;/TEXTAREA&gt;
  </code></pre>
  <p>The first textarea you click and unfocus from works perfectly, however, the second textarea you click will not disappear when trying to unfocus. What am I doing wrong?</p>