o: ActiveSupport::Cache::Entry	:@compressedF:@expires_in0:@created_atf1339391640.215884:@value"{I"
class:EFI"ProcessedAsset;�FI"logical_path;�F"jquery.really-sure.jsI"
pathname;�F"d/Users/michaelnorth/dev/projects/really_sure_rails/app/assets/javascripts/jquery.really-sure.jsI"content_type;�FI"application/javascript;�FI"
mtime;�FI"2012-06-11T01:12:40-04:00;�FI"length;�Fi�I"digest;�F"%2086d0f132af38011a67b76294235b9bI"source;�FI"�/*
 * jQuery Reveal Plugin 1.0
 * www.ZURB.com
 * Copyright 2010, ZURB
 * Free to use under the MIT license.
 * http://www.opensource.org/licenses/mit-license.php
*/



(function ($) {
  $('a[data-really-sure-id]').live('click', function (event) {
    event.preventDefault();
    var modalLocation = $(this).attr('data-really-sure-id');
    $('#' + modalLocation).really_sure($(this).data());
  });

  $.fn.really_sure = function (options) {
    var defaults = {
      animation: 'fadeAndPop',                // fade, fadeAndPop, none
      animationSpeed: 300,                    // how fast animtions are
      closeOnBackgroundClick: true,           // if you click background will modal close?
      dismissModalClass: 'close-really-sure-modal' // the class of a button or element that will close an open modal
    };
    var options = $.extend({}, defaults, options);

    return this.each(function () {
      var modal    = $(this),
        topMeasure = parseInt(modal.css('top')),
        topOffset  = modal.height() + topMeasure,
        locked     = false,
        modalBg    = $('.really-sure-modal-bg');

      if (modalBg.length == 0) {
        modalBg = $('<div class="really-sure-modal-bg" />').insertAfter(modal);
        modalBg.fadeTo('fast', 0.8);
      }

      function openAnimation() {
        modalBg.unbind('click.modalEvent');
        $('.' + options.dismissModalClass).unbind('click.modalEvent');
        if (!locked) {
          lockModal();
          if (options.animation == "fadeAndPop") {
            modal.css({'top': $(document).scrollTop() - topOffset, 'opacity': 0, 'visibility': 'visible'});
            modalBg.fadeIn(options.animationSpeed / 2);
            modal.delay(options.animationSpeed / 2).animate({
              "top": $(document).scrollTop() + topMeasure + 'px',
              "opacity": 1
            }, options.animationSpeed, unlockModal);
          }
          if (options.animation == "fade") {
            modal.css({'opacity': 0, 'visibility': 'visible', 'top': $(document).scrollTop() + topMeasure});
            modalBg.fadeIn(options.animationSpeed / 2);
            modal.delay(options.animationSpeed / 2).animate({
              "opacity": 1
            }, options.animationSpeed, unlockModal);
          }
          if (options.animation == "none") {
            modal.css({'visibility': 'visible', 'top': $(document).scrollTop() + topMeasure});
            modalBg.css({"display": "block"});
            unlockModal();
          }
        }
        modal.unbind('really-sure:open', openAnimation);
      }
      modal.bind('really-sure:open', openAnimation);

      function closeAnimation() {
        if (!locked) {
          lockModal();
          if (options.animation == "fadeAndPop") {
            modalBg.delay(options.animationSpeed).fadeOut(options.animationSpeed);
            modal.animate({
              "top":  $(document).scrollTop() - topOffset + 'px',
              "opacity": 0
            }, options.animationSpeed / 2, function () {
              modal.css({'top': topMeasure, 'opacity': 1, 'visibility': 'hidden'});
              unlockModal();
            });
          }
          if (options.animation == "fade") {
            modalBg.delay(options.animationSpeed).fadeOut(options.animationSpeed);
            modal.animate({
              "opacity" : 0
            }, options.animationSpeed, function () {
              modal.css({'opacity': 1, 'visibility': 'hidden', 'top': topMeasure});
              unlockModal();
            });
          }
          if (options.animation == "none") {
            modal.css({'visibility': 'hidden', 'top': topMeasure});
            modalBg.css({'display': 'none'});
          }
        }
        modal.unbind('really-sure:close', closeAnimation);
      }
      modal.bind('really-sure:close', closeAnimation);
      modal.trigger('really-sure:open');

      var closeButton = $('.' + options.dismissModalClass).bind('click.modalEvent', function () {
        modal.trigger('really-sure:close');
      });

      if (options.closeOnBackgroundClick) {
        modalBg.css({"cursor": "pointer"});
        modalBg.bind('click.modalEvent', function () {
          modal.trigger('really-sure:close');
        });
      }

      $('body').keyup(function (event) {
        if (event.which === 27) { // 27 is the keycode for the Escape key
          modal.trigger('really-sure:close');
        }
      });

      function unlockModal() {
        locked = false;
      }

      function lockModal() {
        locked = true;
      }
    });
  };
})(jQuery);
;�FI"dependency_digest;�F"%251cebc21e96da9d9f227163333fa6e1I"required_paths;�F["d/Users/michaelnorth/dev/projects/really_sure_rails/app/assets/javascripts/jquery.really-sure.jsI"dependency_paths;�F[{I"	path;�F"d/Users/michaelnorth/dev/projects/really_sure_rails/app/assets/javascripts/jquery.really-sure.jsI"
mtime;�FI"2012-06-11T01:12:40-04:00;�FI"digest;�F"%e61c344212517295b2a035423fb349feI"
_version;�F"%9f3b95dd7ea3030dc35985c0a8020862