title: Issue Closing Message Boxes cookie
body: <p>I'm having some issue to implement a Closing Message Boxes fonction to my button. <br> 
  I'm quite a beginner and i don't totally understand the fonction.
  To generate my button i'm using php and css. <br><br>
  <strong>Here is the PHP code</strong> (this code is inside a div with the class "ajouer2"):</p>
  
  <pre><code>[php]
  require_once('lib/Browser.php');
  $browser = new Browser();
  if( $browser-&gt;getBrowser() == Browser::BROWSER_FIREFOX) {
  echo ("&lt;img src='http://www.monsite.fr/wp-content/uploads/2015/03/Firefox_2013_logoXS.png' height='50' width='50'&gt;&lt;a onclick='addEngine()' class='firefox'&gt; Ajouter à firefox&lt;/a&gt;");
  }else if( $browser-&gt;getBrowser() == Browser::BROWSER_EDGE) {
  echo ("&lt;img src='http://www.monsite.fr/wp-content/uploads/2016/01/edge_blue_logoXS.png' height='50' width=50'&gt;&lt;a href='http://www.monsite.fr/ajouter-a/' target='_blank' class='firefox'&gt; Ajouter à Edge&lt;/a&gt;");
  }else if( $browser-&gt;getBrowser() == Browser::BROWSER_CHROME) {
  echo ("&lt;img src='http://www.monsite.fr/wp-content/uploads/2015/03/chrome_2013_logoXS.png' height='50' width=50'&gt;&lt;a href='https://chrome.google.com/webstore/...' target='_blank' class='firefox'&gt; Ajouter à &gt;Chrome&lt;/a&gt;");
  }else if( $browser-&gt;getBrowser() == Browser::BROWSER_SAFARI) {
  echo ("&lt;img src='http://www.monsite.fr/wp-content/uploads/2015/05/safari_logoXS2.png' height='50' width='50'&gt;&lt;a class='firefox'&gt; Bientôt sur Safari&lt;/a&gt;");
  }else if( $browser-&gt;getBrowser() == Browser::BROWSER_IE) {
  echo ("&lt;img src='http://www.monsite.fr/wp-content/uploads/2015/03/explorer_logoXS.png' height='50' width='50'&gt;&lt;a onclick='AddSearch ()' class='firefox'&gt; Ajouter à Int. Explorer&lt;/a&gt;");
  }else if( $browser-&gt;getBrowser() == Browser::BROWSER_OPERA) {
  echo ("&lt;img src='http://www.monsite.fr/wp-content/uploads/2015/03/opera_2013_logoXS.png' height='50' width='50'&gt;&lt;a class='firefox'&gt; Bientôt sur Opera&lt;/a&gt;");
  }
  [/php]
  </code></pre>
  
  <p><strong>The CSS that go with it to style the button:</strong> </p>
  
  <pre><code>.ajouter2
  {
      display: inline-block;
      border-radius: 0px;
      width: 173px;
      height: 47px;
      margin-left:20px;
      background-color: #f7f7f7;
      border-color: #f7f7f7;
  }
  </code></pre>
  
  <p><strong>My javascript to do the fonction:</strong></p>
  
  <pre><code>    &lt;script&gt;
  function closeBox(toClose) {
     document.getElementById(toClose).style.display = "none";
     setCookie(toClose, "closed", 365);
  }
  function setCookie(cName, value, expiredays) {
     var expDate = new Date();
     expDate.setDate(expDate.getDate()+expiredays);
     document.cookie=cName + "=" + escape(value) +
     ";expires=" + expDate.toGMTString();
  }
  function loadMsg(msgClass) {
     msg = document.getElementsByTagName("div");
     for (i=0; i&lt;msg.length; i++) {
        if(msg[i].className == msgClass) {
           if(document.cookie.indexOf(msg[i].id) == -1) {
              msg[i].style.display = "block";
           }
        }
     }
  }
  &lt;/script&gt;
  </code></pre>
  
  <p><strong>The div that goes with it:</strong></p>
  
  <pre><code>&lt;body onload="loadMsg('msgbox');"&gt;
     &lt;div id="message-1" class="msgbox"&gt;
        &lt;a href="#" class="close" onclick="closeBox('message-1'); return false;" title="Close This"&gt;X&lt;/a&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>My problem is to mix all that together. <br>
  I would like to give this fonction to my PHP (ajouter2) button, but I can't figure it out. <br>
  I don't know how to edit the <code>"loadMsg(msgClass)"</code> part to make it target my button.</p>
  
  <p>If someone could help me to understand the function or mix it with my code. <br>
  Thanks.</p>