title: Javascript alert shows up twice
body: <p>I am trying to use a module called disclaimer in Drupal 7 but the Alert "You must enter the year you were born in." Shows up twice and then proceeds to redirect to the URL you are not supposed to see until you verify you are over 18.</p>
  
  <p>I tried the suggestions and it still showed up twice. I think the problem may be the enter button action. Here is the function for that.</p>
  
  <pre><code> Drupal.behaviors.disclaimer = {
    attach: function (context, settings) {
      // action on enter button
      $('#disclaimer_enter', context).click(function () {
        var check = true;
        // age form is set
        if (settings.disclaimer.ageform == 1) {
          var check = Drupal.checkAge();
        }
        // everything good, add cookie and close colorbox
        if (check) {
          $.cookie(settings.disclaimer.cookie_name, '1', { path: settings.disclaimer.cookie_path });
          $.colorbox.remove();
        }
      });
    },
  };
  </code></pre>
  
  <p>}</p>
  
  <pre><code>    Drupal.checkAge = function () {
      var now = new Date();
      var date = now.getDate();
      var month = now.getMonth() + 1;
      var year = now.getFullYear();
      var optmonth = jQuery("#edit-disclaimer-age-month option:selected").val();
      var optday = jQuery("#edit-disclaimer-age-day option:selected").val();
      var optyear = jQuery("#edit-disclaimer-age-year option:selected").val();
      var age = year - optyear;
      if (optmonth &gt; month) {age--;} else {if(optmonth == month &amp;&amp; optday &gt;= date) {age--;}}
      // if current year, form not set
      if (optyear == year) {
        alert(Drupal.t("You must enter the year you were born in."));
        return alert;
      // if under age, alert and redirect !
      } else if (age &lt; Drupal.settings.disclaimer.limit) {
        alert(Drupal.t("Sorry, you are Under age limit and are prohibited from entering this site!"));
        location.replace(Drupal.settings.disclaimer.exiturl);
        return false;
      } else {
        // age limit ok
        return true;
      }
    }
  </code></pre>