jQuery(document).ready(function($){	
    
	// if you let it set to 'false' it will show every time .. set it to 'true' and it will never show
    $.cookie("modal", 'true')

    /**
      *  MODAL BOX
      */
    // if the requested cookie does not have the value I am looking for show the modal box
    if($.cookie("modal") != 'true')
    {
        var _message_to_show = '<div class="modal-content"><img src="/fileadmin/sablony/img/porta_pf_2012.gif" alt="PF 2012"></div>';

         // on page load show the modal box
         $.fancybox(
             _message_to_show,
             {

             }
         );

         // 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
         // "modal" is the name i gave the cookie.. you can name it anything you want
         $('#fancybox-close').live('click', function(e) {
             e.preventDefault();
             $.cookie("modal", "true", { path: '/', expires: 7 });
             $.fancybox.close()
         });
     }

});
