title: Modal popup works in FireFox but not other browers
body: <p>I've developed a modal popup, which makes a popup screen, when clicking on a button.</p>
  
  <p>It's either the AddToBasketButton click event, or the AskqlnkBtn click event which will open the window.</p>
  
  <p>My code works perfectly in FireFox, but not in Internet Explorer / Chrome.</p>
  
  <p>There is no visible JavaScript errors when running the code (as far as I can tell).</p>
  
  <p>When clicking the links in the old browsers, the screen gets darkened, so the loadPopup must work somehow.</p>
  
  <p><strong>See the problem yourself:</strong></p>
  
  <p>If you want to experience the code on my website, <a href="http://www.hcemballering.dk/omsnoeringsmaskine" rel="nofollow">you can see it here.</a> . If you go down to the "Læg i kurv" button, then you can try it out for yourselves.</p>
  
  <p><strong>Any ideas what could be wrong?</strong> I've been looking at it for some hours, and have no clue!</p>
  
  <p><strong>My code</strong>:</p>
  
  <pre><code>function loadPopup() {
          //loads popup only if it is disabled  
          if ($('#&lt;%=bgPopup.ClientID %&gt;').data("state") == 0) {
              $('#&lt;%=bgPopup.ClientID %&gt;').css({
                  "opacity": "0.7"
              });
              $('#&lt;%=bgPopup.ClientID %&gt;').fadeIn("medium");
              $('#&lt;%=ReportError.ClientID%&gt;').fadeIn("medium");
              $('#&lt;%=bgPopup.ClientID %&gt;').data("state", 1);
          }
      }
  
      function disablePopup() {
          if ($('#&lt;%=bgPopup.ClientID %&gt;').data("state") == 1) {
              $('#&lt;%=bgPopup.ClientID %&gt;').fadeOut("medium");
              $('#&lt;%=ReportError.ClientID %&gt;').fadeOut("medium");
              $('#&lt;%=bgPopup.ClientID %&gt;').data("state", 0);
          }
      }
  
      function setOrdering() {
          $("#contact-headline").text('Bestil produkt');
          $("#contact-messagelbl").text('Evt. kommentar');
          $('#&lt;%=ContactTypeHiddenLbl.ClientID %&gt;').val("bestil");
      }
  
      function setQuestions() {
          $("#contact-headline").text('Stil spørgsmål');
          $("#contact-messagelbl").text('Indtast dit spørgsmål');
          $('#&lt;%=ContactTypeHiddenLbl.ClientID %&gt;').val("spørgsmål");
      }
  
      function centerPopup() {
          $('#&lt;%=ReportError.ClientID%&gt;').center();
      }
  
      function resetContactControls() {
          $('#&lt;%=ContactMailBox.ClientID %&gt;').val('');
          $('#&lt;%=ContactPhoneBox.ClientID %&gt;').val('');
          $('#&lt;%=ReportMessageBox.ClientID %&gt;').val('');
          $('#&lt;%=AskQuestionProductBtn.ClientID %&gt;').show();
          $('#contact-statuslbl').val('');
      }
  
      jQuery.fn.center = function () {
          this.css("position", "absolute");
          this.css("top", Math.max(0, (($(window).height() - this.outerHeight()) / 2) +
              $(window).scrollTop()) + "px");
          this.css("left", Math.max(0, (($(window).width() - this.outerWidth()) / 2) +
              $(window).scrollLeft()) + "px");
          return this;
      };
  
      $(document).ready(function() {
          var mouseIsInside = true;
  
          $('#&lt;%=ReportError.ClientID%&gt;').hover(function () {
              mouseIsInside = true;
          }, function () {
              mouseIsInside = false;
          });
  
          $("body").mouseup(function () {
              if (!mouseIsInside) {
                  disablePopup();
              }
          });
  
      });
  
          $('#&lt;%=bgPopup.ClientID %&gt;').data("state", 0);
  
          $('#&lt;%=AddToBasketButton.ClientID %&gt;').click(function () {
              resetContactControls();
              centerPopup();
              loadPopup();
              setOrdering();
          });
  
          $('#&lt;%=AskqlnkBtn.ClientID %&gt;').click(function () {
              resetContactControls();
              centerPopup();
              loadPopup();
              setQuestions();
          });
  
          $('#&lt;%=PopupCloseLnk.ClientID %&gt;').click(function () {
              disablePopup();
          });
  
          $(document).keypress(function (e) {
              if (e.keyCode == 27) {
                  disablePopup();
              }
          });
  
  
      $(window).resize(function () {
          centerPopup();
      });
  </code></pre>