!function(l){function e(e){var l,n,r;return this.length?((l=this[0]).ownerDocument?r=l.ownerDocument:l=(r=l).documentElement,null==e?r.exitFullscreen||r.webkitExitFullscreen||r.webkitCancelFullScreen||r.msExitFullscreen||r.mozCancelFullScreen?(e=c(r))&&(r.fullscreenElement||r.webkitFullscreenElement||r.webkitCurrentFullScreenElement||r.msFullscreenElement||r.mozFullScreenElement)||e:null:(e?(n=l.requestFullscreen||l.webkitRequestFullscreen||l.webkitRequestFullScreen||l.msRequestFullscreen||l.mozRequestFullScreen)&&n.call(l):(n=r.exitFullscreen||r.webkitExitFullscreen||r.webkitCancelFullScreen||r.msExitFullscreen||r.mozCancelFullScreen)&&c(r)&&n.call(r),this)):this}function c(e){return!!(e.fullscreenElement||e.msFullscreenElement||e.webkitIsFullScreen||e.mozFullScreen)}var n,r,u;l.fn.fullScreen=e,l.fn.toggleFullScreen=function(){return e.call(this,!e.call(this))},u=(n=document).webkitCancelFullScreen?(r="webkitfullscreenchange","webkitfullscreenerror"):n.msExitFullscreen?(r="MSFullscreenChange","MSFullscreenError"):n.mozCancelFullScreen?(r="mozfullscreenchange","mozfullscreenerror"):(r="fullscreenchange","fullscreenerror"),l(document).bind(r,function(e){l(document).trigger(new l.Event("fullscreenchange"))}),l(document).bind(u,function(e){l(document).trigger(new l.Event("fullscreenerror"))})}(jQuery);