what's wrong with this jQuery method?
<p>I have this method:</p>

<pre><code>function replaceRightClickIcefacesMethod() {
    var oldName = jQuery(".singlePaneOfGlassBlock").attr("oncontextmenu");
    oldName = oldName.replace('Ice.Menu.contextMenuPopup', 'contextMenuPopupUpdated');

    jQuery(".singlePaneOfGlassBlock").attr("oncontextmenu", oldName);
}
</code></pre>

<p>I do not understand why Firebug reports: </p>

<blockquote>
<pre><code>oldName.replace is not a function
</code></pre>
</blockquote>

<p>Do you see any issue? For me it's just weird...</p>

<p><strong>UPDATE</strong>: Just notice that oldName returns a function, if I do alert(oldName):</p>

<pre><code>function oncontextmenu(event) {
Ice.Menu.contextMenuPopup(event, "j_id88:sectionContextMenu_sub", "j_id88:j_id111:0:j_id123:0:j_id124");
return false;
</code></pre>

<p>}</p>
