Javascript New Operator
<p>I'm new to OOP based javascript. For testing purpose I've created a following snippet. I've created four buttons, on clikcing each button it will to different functions. When I click any of the buttons for the first time, it gives the predicted results. on the clicking any of the buttons for the second time , it gives me the following error</p>

<pre><code>classFunction = new classFunction();
</code></pre>

<p>The code which I've used is as below,</p>

<pre><code>&lt;html&gt;
  &lt;head&gt;
    &lt;script type="text/javascript"&gt;
      var classFunction;

      function classFunction() {
        this.publicVariable = 'Public Varibale';
        var privateVariable = 'Private Variable';

        this.publicMethod = function () {
          alert('Public Method');
        }

        function privateMethod() {
          alert('private Method');
        }

        return this;
      }

      function privateVariable() {
        classFunction = new classFunction();
        alert(classFunction.privateVariable);
      }

      function publicvariable() {
        classFunction = new classFunction();
        alert(classFunction.publicVariable);
      }

      function privateFunction() {
        classFunction = new classFunction();
        classFunction.privateMethod();
      }

      function publicFunction() {
        classFunction = new classFunction();
        classFunction.publicMethod();
      }
    &lt;/script&gt;
  &lt;/head&gt;

  &lt;body&gt;
    &lt;input type="button" value="Private Variable" onclick="privateVariable()" /&gt;
    &lt;input type="button" value="Public Variable" onclick="publicvariable()" /&gt;
    &lt;input type="button" value="Private Fucntion" onclick="privateFunction()" /&gt;
    &lt;input type="button" value="Public Function" onclick="publicFunction()" /&gt;
  &lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>Is there are any reason that the new operator will not be working for the second time?</p>

<p>Thanks in advance.</p>
