',{'class':'exit-message'}).html('
Press ESC to exit
').appendTo($('body')).delay(2000).animate({opacity:0},500,function(){$(this).remove()})}},zoomOut:function(){$('#slider-bar').fadeIn();$('.exit-message').hide();$('.made').fadeIn();$('.zoom-icon').removeClass('zoom-icon-out').addClass('zoom-icon-in');setTimeout(function(){$('.magazine').addClass('animated').removeClass('zoom-in');resizeViewport()},0)}}});if($.isTouch)$('.magazine-viewport').bind('zoom.doubleTap',zoomTo);else $('.magazine-viewport').bind('zoom.tap',zoomTo);$(document).keydown(function(e){var i=37,o=39,n=27;switch(e.keyCode){case i:$('.magazine').turn('previous');e.preventDefault();break;case o:$('.magazine').turn('next');e.preventDefault();break;case n:$('.magazine-viewport').zoom('zoomOut');e.preventDefault();break}});Hash.on('^page/([0-9]*)$',{yep:function(e,i){var o=i[1];if(o!==undefined){if($('.magazine').turn('is'))$('.magazine').turn('page',o)}},nop:function(e){if($('.magazine').turn('is'))$('.magazine').turn('page',1)}});$(window).resize(function(){resizeViewport()}).bind('orientationchange',function(){resizeViewport()});if($.isTouch){$('.magazine').bind('touchstart',regionClick)}else{$('.magazine').click(regionClick)};$('.next-button').bind($.mouseEvents.over,function(){$(this).addClass('next-button-hover')}).bind($.mouseEvents.out,function(){$(this).removeClass('next-button-hover')}).bind($.mouseEvents.down,function(){$(this).addClass('next-button-down')}).bind($.mouseEvents.up,function(){$(this).removeClass('next-button-down')}).click(function(){$('.magazine').turn('next')});$('.previous-button').bind($.mouseEvents.over,function(){$(this).addClass('previous-button-hover')}).bind($.mouseEvents.out,function(){$(this).removeClass('previous-button-hover')}).bind($.mouseEvents.down,function(){$(this).addClass('previous-button-down')}).bind($.mouseEvents.up,function(){$(this).removeClass('previous-button-down')}).click(function(){$('.magazine').turn('previous')});$('#slider').slider({min:1,max:numberOfViews(e),start:function(i,e){if(!window._thumbPreview){_thumbPreview=$('',{'class':'thumbnail'}).html('');setPreview(e.value);_thumbPreview.appendTo($(e.handle))}else setPreview(e.value);moveBar(!1)},slide:function(e,i){setPreview(i.value)},stop:function(){if(window._thumbPreview)_thumbPreview.removeClass('show');$('.magazine').turn('page',Math.max(1,$(this).slider('value')*2-2))}});resizeViewport();$('.magazine').addClass('animated')};$('.zoom-icon').bind('mouseover',function(){if($(this).hasClass('zoom-icon-in'))$(this).addClass('zoom-icon-in-hover');if($(this).hasClass('zoom-icon-out'))$(this).addClass('zoom-icon-out-hover')}).bind('mouseout',function(){if($(this).hasClass('zoom-icon-in'))$(this).removeClass('zoom-icon-in-hover');if($(this).hasClass('zoom-icon-out'))$(this).removeClass('zoom-icon-out-hover')}).bind('click',function(){if($(this).hasClass('zoom-icon-in'))$('.magazine-viewport').zoom('zoomIn');else if($(this).hasClass('zoom-icon-out'))$('.magazine-viewport').zoom('zoomOut')});$('#canvas').hide();yepnope({test:Modernizr.csstransforms,yep:['lib/turn.min.js'],nope:['lib/turn.html4.min.js','css/jquery.ui.html4.css'],both:['lib/zoom.js','css/jquery.ui.css','js/magazine.js','css/magazine.css'],complete:loadApp});