Noob question about using jquery cookies plugin

Noob question about using jquery cookies plugin

hello.
I am trying to do newsletter subscription pop up using this tutorial

I set up simplemodal succesfully and if I put $("#basic-modal-content").modal(); script at the end of page everything works perfectly.
Now as per tutorial I need to set up jquery cookies plugin.
I loaded the plugin and replaced jquery.cookie.js code with:

$(document).ready(function () {

  if ($.cookie("newsletter") != 1) {
    $('#basic-modal-content').modal({
      onClose: function() { 
        $.cookie("newsletter", "1", { expires: 7 }); 
        $.modal.close(); 
      }
    });
  }

});

and nothing happens. so can anybody help me with this as I am very unfamiliar with coding :(
p.s. author of tutorial tells about " Additionally, when using modal dialogs for features such as a newsletter subscription prompt, consider setting a different cookie following the window's closure which sets a cookie which never expires, just to make sure the user doesn't attempt to again subscribe to the newsletter." It is nice feature and I would like to have it so maybe any help with that too.