title: Show week number with Javascript?
body: <p>I have the following code that is used to show the name of the current day, followed by a set phrase.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt; 
      &lt;!-- 
      // Array of day names
      var dayNames = new Array(
      "It's Sunday, the weekend is nearly over",
      "Yay! Another Monday",
       "Hello Tuesday, at least you're not Monday",
       "It's Wednesday. Halfway through the week already",
       "It's Thursday.",
       "It's Friday - Hurray for the weekend",
      "Saturday Night Fever");
      var now = new Date();
      document.write(dayNames[now.getDay()] + ".");
       // --&gt;
  &lt;/script&gt;
  </code></pre>
  
  <p>What I would like to do is have the current week number in brackets after the phrase. I have found the following code:</p>
  
  <pre><code>Date.prototype.getWeek = function() {
      var onejan = new Date(this.getFullYear(),0,1);
      return Math.ceil((((this - onejan) / 86400000) + onejan.getDay()+1)/7);
  } 
  </code></pre>
  
  <p>Which was taken from <a href="http://javascript.about.com/library/blweekyear.htm">http://javascript.about.com/library/blweekyear.htm</a> but I have no idea how to add it to existing javascript code.</p>