/*!
 * 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){a("body").on("click","a[data-reveal-id]",function(b){b.preventDefault();var c=a(this).attr("data-reveal-id");a("#"+c).reveal(a(this).data())}),a.fn.reveal=function(b){var c={animation:"fadeAndPop",animationspeed:300,closeonbackgroundclick:!0,dismissmodalclass:"close-reveal-modal"},b=a.extend({},c,b);return this.each(function(){function c(){h=!1}function d(){h=!0}var e=a(this),f=parseInt(e.css("top")),g=e.height()+f,h=!1,i=a(".reveal-modal-bg");0==i.length&&(i=a('<div class="reveal-modal-bg" />').insertAfter(e)),e.bind("reveal:open",function(){i.unbind("click.modalEvent"),a("."+b.dismissmodalclass).unbind("click.modalEvent"),h||(d(),"fadeAndPop"==b.animation&&(e.css({top:a(document).scrollTop()-g,opacity:0,visibility:"visible"}),i.fadeIn(b.animationspeed/2),e.delay(b.animationspeed/2).animate({top:a(document).scrollTop()+f+"px",opacity:1},b.animationspeed,c())),"fade"==b.animation&&(e.css({opacity:0,visibility:"visible",top:a(document).scrollTop()+f}),i.fadeIn(b.animationspeed/2),e.delay(b.animationspeed/2).animate({opacity:1},b.animationspeed,c())),"none"==b.animation&&(e.css({visibility:"visible",top:a(document).scrollTop()+f}),i.css({display:"block"}),c())),e.unbind("reveal:open")}),e.bind("reveal:close",function(){h||(d(),"fadeAndPop"==b.animation&&(i.delay(b.animationspeed).fadeOut(b.animationspeed),e.animate({top:a(document).scrollTop()-g+"px",opacity:0},b.animationspeed/2,function(){e.css({top:f,opacity:1,visibility:"hidden"}),c()})),"fade"==b.animation&&(i.delay(b.animationspeed).fadeOut(b.animationspeed),e.animate({opacity:0},b.animationspeed,function(){e.css({opacity:1,visibility:"hidden",top:f}),c()})),"none"==b.animation&&(e.css({visibility:"hidden",top:f}),i.css({display:"none"}))),e.unbind("reveal:close")}),e.trigger("reveal:open");a("."+b.dismissmodalclass).bind("click.modalEvent",function(){e.trigger("reveal:close")});b.closeonbackgroundclick&&(i.css({cursor:"pointer"}),i.bind("click.modalEvent",function(){e.trigger("reveal:close")})),a("body").keyup(function(a){27===a.which&&e.trigger("reveal:close")})})}}(opjq);