title: Have div display ONLY on first time visit (cookies?)
body: <p>I'm trying to have a div display on the very first time a user visits my site. I'm pretty sure I do this by using cookies, which I have limited experience with and am have a hard time understanding. Most tutorials I've found online only talk about having cookies prompt a user to input something like a name, and have it recall it later, which not what I want at all. I simply want the cookie to check if the user has been to my site before, and if not, display a div that is normally hidden.</p>
  
  <p>Here's something I've tried and failed to get to work.</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;head&gt;
     &lt;script type="text/javascript" src="annoy.js"&gt;&lt;/script&gt;
     &lt;script type="text/javascript" src="scripts.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  
  ...
  &lt;body&gt;
      &lt;div id="overbox3"&gt;
           &lt;div id="infobox3"&gt;
                &lt;p&gt;This is the cookie box&lt;/p&gt;
                &lt;br /&gt;
                &lt;p&gt;it should only show once &lt;/p&gt;
                &lt;br/&gt;&lt;br/&gt;
           &lt;/div&gt;&lt;!-- end infobox3 --&gt; 
      &lt;/div&gt; &lt;!-- end overbox3 --&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>CSS (not really relevant since this works fine):</p>
  
  <pre><code>#overbox3 {
           position: fixed;
           top: 0px;
           left: 0px;
           width: 100%;
           height: 100%; 
           background: rgba(64, 64, 64, 0.5);
           z-index: 999999;
           display: none;
      }
  
      #infobox3 {
          margin: auto;
          position: absolute;
          left: 35%;
          top: 20%;
          height: 300px;
           width: 400px;
          background-color: white;
          border: 1px solid red;
      }
  </code></pre>
  
  <p>Relevant content of scripts.js:</p>
  
  <pre><code>function popbox3() {
      $('#overbox3').toggle();
  }
  </code></pre>
  
  <p>And what I assume is the problem, the content of annoy.js:</p>
  
  <pre><code>    function GetCookie(name) {
          var arg=name+"=";
          var alen=arg.length;
          var clen=document.cookie.length;
          var i=0;
  
          while (i&lt;clen) {
              var j=i+alen;
                  if (document.cookie.substring(i,j)==arg)
                      return "here";
                  i=document.cookie.indexOf(" ",i)+1;
                  if (i==0) 
                      break;
          }
  
          return null;
      }
  
      var visit=GetCookie("COOKIE1");
  
      if (visit==null){
      var expire=new Date();
  
      popbox3();
  
      expire=new Date(expire.getTime()+7776000000);
      document.cookie="COOKIE1=here; expires="+expire;
  }
  </code></pre>
  
  <p>From my understanding, the cookie is supposed to be calling the function popbox3() only if the user has not visited, which would toggle the display of the hidden div. But as of now, nothing is working. Any clarification or help here would be greatly appreciated. Thanks in advance. </p>