title: Set cookie to hide div when button is clicked
body: <p>I'm trying to display a div (containing terms and conditions) which is shown by default unless a cookie is set to hide it. </p>
  
  <p>I have added my code here to a <a href="http://jsfiddle.net/v6ddf/" rel="nofollow">JSFiddle</a></p>
  
  <p>Any ideas why my code isn't working? </p>
  
  <p>JavaScript</p>
  
  <pre><code>    function TermsAndConditions(){
     days=30;
     myDate = new Date();
     myDate.setTime(myDate.getTime()+(days*24*60*60*1000));
     document.cookie = 'TermsAndConditions=Accepted; expires=' + myDate.toGMTString();
  }
  if ($.cookie("TermsAndConditions") !== Accepted)
  {
      $("#terms-and-conditions").hide();
  } 
  </code></pre>
  
  <p>HTML</p>
  
  <p></p>
  
  <pre><code>  &lt;h1&gt;Terms and Conditions&lt;/h1&gt;
      &lt;p&gt;Example Content&lt;/p&gt;
  
    &lt;span class="accept-button"&gt;&lt;a href="#" onclick="TermsAndConditions()"&gt;Accept&lt;/a&gt;&lt;/span&gt;&lt;/div
  
  &gt;
  </code></pre>