calling custom jquery methods
<p>So I have code like this:</p>

<pre><code>&lt;script language="javascript"&gt;
$(function(){
    function hellothere(strng){
        showalert(strng);
    }
    function showalert(showit){
        alert(showit);
    }
});
&lt;/script&gt;
&lt;input type="button" onclick="hellothere('hi');" value="jquery"/&gt;
</code></pre>

<p>When I click on the button though, it throws a javascript error (Object expected).
I have also tried the following but they also throw javascript errors (Object does not support this property).</p>

<pre><code>&lt;input type="button" onclick="$.hellothere('hi');" value="jquery"/&gt;
</code></pre>

<p>and</p>

<pre><code>&lt;input type="button" onclick="$.fn.hellothere('hi');" value="jquery"/&gt;
</code></pre>

<p>What am I missing?</p>

<p><strong>UPDATE</strong>: This is what's happening, to clarify alittle.
I have a button:</p>

<pre><code>&lt;input type="button" class="mybutton" value="jquery"/&gt;
</code></pre>

<p>On page load, I assign an onclick event to the button with the $():</p>

<pre><code>$(function(){
     $(".mybutton").click(function(){
     //Do some stuff
     mybuttoncallback(dataprocessed);

     });

     function senditoff(finaldata){
          //send the data off
     }
});
</code></pre>

<p>So this button is on a couple pages but is does different things with the data that's processed.  So the 'mybuttoncallback' is a javascript method that is local to the page itself since different pages may handle the data differently.</p>

<pre><code>function mybuttoncallback(thedata){
    //process the data
    senditoff(hereitis);
}
</code></pre>

<p>The 'senditoff' method is in the jquery code since all the pages send it off the same way.
I would prefer not to move anything out of the $() because many pages would have to change.
(The 'senditoff' method is the 'hellothere' method from the previous example.)</p>

<p>So have can the javascript method call the jquery 'senditoff' method??</p>
