title: jQuery: Modal window onload with fancybox + cookies
body: <p>I've got a script I'm using that loads the window, sets the cookie but and the window doesn't appear again if the user clicks "No Thanks" but I want the window not to appear if they also click "Take the Survey". I tried adding the second ID here <code>$('#modal_close, #modal_exit').live('click', function(e) {</code> but it doesn't work. Instead of going to the survey link, it goes to the page the modal is firing from. Any clues and/or help?</p>
  
  <pre><code>$(document).ready(function(){
  </code></pre>
  
  <p>// MODAL BOX if the requested cookie does not have the value I am looking for show the modal box</p>
  
  <pre><code>if($.cookie("cookieName") != 'true')
  {
      var _message_to_show = 'Window Content Goes Here';
  
      // on page load show the modal box
      // more info about the options you can find on the fancybox site
      $.fancybox(
          _message_to_show,
          {
              'width'             : 550,
              'height'            : 275,
              'transitionIn'      : 'fade',
              'transitionOut'     : 'fade',
              'centerOnScroll'    : 'true',
              'overlayOpacity'    : 0.8,
              'overlayColor'      : '#000',
              'modal'             : 'true',
      'padding'       : 5
          }
      );
  
      // in the message is a link with the id "modal_close"
      // when you click on that link the modal will close and the cookie is set to "true"
      // path "/" means it's active for the entire root site.. if you set it to "/admin" will be active on the "admin" folder
      // expires in 7 days
      // "modal" is the name i gave the cookie, you can name it anything you want
      $('#modal_close').live('click', function(e) {
          e.preventDefault();
          $.cookie("cookieName", "true", { path: '/', expires: 7 });    
          $.fancybox.close()
      });
  }    
  </code></pre>
  
  <p>});</p>