javascript clone function breaks with jQuery
<p>I found this wonderful clone function for javascript (<a href="http://my.opera.com/GreyWyvern/blog/show.dml/1725165" rel="nofollow">http://my.opera.com/GreyWyvern/blog/show.dml/1725165</a>), but it breaks with jquery with the error:</p>

<blockquote>
  <p>Uncaught TypeError: Object function [removed] has no method 'replace'</p>
</blockquote>

<p>Here's the function:</p>

<pre><code>Object.prototype.clone = function() {
    var newObj = (this instanceof Array) ? [] : {};
    for (i in this) 
    {
        if (i == 'clone') continue;

        if (this[i] &amp;&amp; typeof this[i] == "object")
            newObj[i] = this[i].clone();
        else 
            newObj[i] = this[i]
    } 
    return newObj;
};
</code></pre>

<p>What does replace have to do with anything?</p>
