Proper use of jquery $(document).ready() when declaring functions called within ready()
<p>I have gotten into the habit of starting jquery coding with the ready function <code>$(function(){...});</code> and putting all functions called from ready within ready.</p>

<p>Then I realized that some of the functions put into the ready function probably didn't need to be there. </p>

<p>For example, simple functions used by events in document ready could be declared outside of it:</p>

<pre><code>function checkEmail(objelement){
   var emailRx = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
   return emailRx.test(objelement.val()) ? true : false;
}
</code></pre>

<p>Then used inside of it:</p>

<pre><code>//code snippet for example

$(function(){

$("form[name='contactform']").submit(function(){
    $("input[type=text]").each(function(){
        if($(this).attr("id") == "email" &amp;&amp; !checkEmail($(this))) { 
            $(this).prev().css("color","red");
       }
    });
});

});
</code></pre>

<p>I searched through many SO previous questions and couldn't seem to find an answer.</p>

<p>Is it better, worse, or no different to declare functions outside of ready in this manner?</p>
