.replaceWith replace to function
<p>I'm trying to use .replaceWith to replace words to a function but it's not working I think the problem is that I didn't right the function correct but I don't know how to write it right. Can Anybody help me (it's only a miniscule.) Thank you.</p>

<pre><code>    &lt;script type="text/javascript" src="http://code.jquery.com/jquery-1.7.min.js"&gt;  
&lt;html&gt;
&lt;body&gt;

&lt;script type="text/javascript"&gt;

var d=new Date();
var weekday=new Array(7);
weekday[0]="Monday";
weekday[1]="Tuesday";
weekday[2]="Wednesday";
weekday[3]="Thursday";
weekday[4]="Friday";
weekday[5]="Monday";
weekday[6]="Monday";


&lt;/script&gt;


&lt;script type="text/javascript"&gt;

$(document).ready(function($){  
    $('div.Shipby').replaceWith(function(){
        return $("&lt;div&gt;").text("Orders placed now will ship " + weekday[d.getDay()]);
    }); 
}); 

&lt;/script&gt;

    &lt;div class="Shipby"&gt;
         Tomorrow.
    &lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>
