',
+
+ btnTpl: {
+ download:
+ '' +
+ '' +
+ "",
+
+ zoom:
+ '",
+
+ close:
+ '",
+
+ // Arrows
+ arrowLeft:
+ '",
+
+ arrowRight:
+ '",
+
+ // This small close button will be appended to your html/inline/ajax content by default,
+ // if "smallBtn" option is not set to false
+ smallBtn:
+ '"
+ },
+
+ // Container is injected into this element
+ parentEl: "body",
+
+ // Hide browser vertical scrollbars; use at your own risk
+ hideScrollbar: true,
+
+ // Focus handling
+ // ==============
+
+ // Try to focus on the first focusable element after opening
+ autoFocus: true,
+
+ // Put focus back to active element after closing
+ backFocus: true,
+
+ // Do not let user to focus on element outside modal content
+ trapFocus: true,
+
+ // Module specific options
+ // =======================
+
+ fullScreen: {
+ autoStart: false
+ },
+
+ // Set `touch: false` to disable panning/swiping
+ touch: {
+ vertical: true, // Allow to drag content vertically
+ momentum: true // Continue movement after releasing mouse/touch when panning
+ },
+
+ // Hash value when initializing manually,
+ // set `false` to disable hash change
+ hash: null,
+
+ // Customize or add new media types
+ // Example:
+ /*
+ media : {
+ youtube : {
+ params : {
+ autoplay : 0
+ }
+ }
+ }
+ */
+ media: {},
+
+ slideShow: {
+ autoStart: false,
+ speed: 3000
+ },
+
+ thumbs: {
+ autoStart: false, // Display thumbnails on opening
+ hideOnClose: true, // Hide thumbnail grid when closing animation starts
+ parentEl: ".fancybox-container", // Container is injected into this element
+ axis: "y" // Vertical (y) or horizontal (x) scrolling
+ },
+
+ // Use mousewheel to navigate gallery
+ // If 'auto' - enabled for images only
+ wheel: "auto",
+
+ // Callbacks
+ //==========
+
+ // See Documentation/API/Events for more information
+ // Example:
+ /*
+ afterShow: function( instance, current ) {
+ console.info( 'Clicked element:' );
+ console.info( current.opts.$orig );
+ }
+ */
+
+ onInit: $.noop, // When instance has been initialized
+
+ beforeLoad: $.noop, // Before the content of a slide is being loaded
+ afterLoad: $.noop, // When the content of a slide is done loading
+
+ beforeShow: $.noop, // Before open animation starts
+ afterShow: $.noop, // When content is done loading and animating
+
+ beforeClose: $.noop, // Before the instance attempts to close. Return false to cancel the close.
+ afterClose: $.noop, // After instance has been closed
+
+ onActivate: $.noop, // When instance is brought to front
+ onDeactivate: $.noop, // When other instance has been activated
+
+ // Interaction
+ // ===========
+
+ // Use options below to customize taken action when user clicks or double clicks on the fancyBox area,
+ // each option can be string or method that returns value.
+ //
+ // Possible values:
+ // "close" - close instance
+ // "next" - move to next gallery item
+ // "nextOrClose" - move to next gallery item or close if gallery has only one item
+ // "toggleControls" - show/hide controls
+ // "zoom" - zoom image (if loaded)
+ // false - do nothing
+
+ // Clicked on the content
+ clickContent: function(current, event) {
+ return current.type === "image" ? "zoom" : false;
+ },
+
+ // Clicked on the slide
+ clickSlide: "close",
+
+ // Clicked on the background (backdrop) element;
+ // if you have not changed the layout, then most likely you need to use `clickSlide` option
+ clickOutside: "close",
+
+ // Same as previous two, but for double click
+ dblclickContent: false,
+ dblclickSlide: false,
+ dblclickOutside: false,
+
+ // Custom options when mobile device is detected
+ // =============================================
+
+ mobile: {
+ preventCaptionOverlap: false,
+ idleTime: false,
+ clickContent: function(current, event) {
+ return current.type === "image" ? "toggleControls" : false;
+ },
+ clickSlide: function(current, event) {
+ return current.type === "image" ? "toggleControls" : "close";
+ },
+ dblclickContent: function(current, event) {
+ return current.type === "image" ? "zoom" : false;
+ },
+ dblclickSlide: function(current, event) {
+ return current.type === "image" ? "zoom" : false;
+ }
+ },
+
+ // Internationalization
+ // ====================
+
+ lang: "en",
+ i18n: {
+ en: {
+ CLOSE: "Close",
+ NEXT: "Next",
+ PREV: "Previous",
+ ERROR: "The requested content cannot be loaded. Please try again later.",
+ PLAY_START: "Start slideshow",
+ PLAY_STOP: "Pause slideshow",
+ FULL_SCREEN: "Full screen",
+ THUMBS: "Thumbnails",
+ DOWNLOAD: "Download",
+ SHARE: "Share",
+ ZOOM: "Zoom"
+ },
+ de: {
+ CLOSE: "Schließen",
+ NEXT: "Weiter",
+ PREV: "Zurück",
+ ERROR: "Die angeforderten Daten konnten nicht geladen werden. Bitte versuchen Sie es später nochmal.",
+ PLAY_START: "Diaschau starten",
+ PLAY_STOP: "Diaschau beenden",
+ FULL_SCREEN: "Vollbild",
+ THUMBS: "Vorschaubilder",
+ DOWNLOAD: "Herunterladen",
+ SHARE: "Teilen",
+ ZOOM: "Vergrößern"
+ }
+ }
+ };
+
+ // Few useful variables and methods
+ // ================================
+
+ var $W = $(window);
+ var $D = $(document);
+
+ var called = 0;
+
+ // Check if an object is a jQuery object and not a native JavaScript object
+ // ========================================================================
+ var isQuery = function(obj) {
+ return obj && obj.hasOwnProperty && obj instanceof $;
+ };
+
+ // Handle multiple browsers for "requestAnimationFrame" and "cancelAnimationFrame"
+ // ===============================================================================
+ var requestAFrame = (function() {
+ return (
+ window.requestAnimationFrame ||
+ window.webkitRequestAnimationFrame ||
+ window.mozRequestAnimationFrame ||
+ window.oRequestAnimationFrame ||
+ // if all else fails, use setTimeout
+ function(callback) {
+ return window.setTimeout(callback, 1000 / 60);
+ }
+ );
+ })();
+
+ var cancelAFrame = (function() {
+ return (
+ window.cancelAnimationFrame ||
+ window.webkitCancelAnimationFrame ||
+ window.mozCancelAnimationFrame ||
+ window.oCancelAnimationFrame ||
+ function(id) {
+ window.clearTimeout(id);
+ }
+ );
+ })();
+
+ // Detect the supported transition-end event property name
+ // =======================================================
+ var transitionEnd = (function() {
+ var el = document.createElement("fakeelement"),
+ t;
+
+ var transitions = {
+ transition: "transitionend",
+ OTransition: "oTransitionEnd",
+ MozTransition: "transitionend",
+ WebkitTransition: "webkitTransitionEnd"
+ };
+
+ for (t in transitions) {
+ if (el.style[t] !== undefined) {
+ return transitions[t];
+ }
+ }
+
+ return "transitionend";
+ })();
+
+ // Force redraw on an element.
+ // This helps in cases where the browser doesn't redraw an updated element properly
+ // ================================================================================
+ var forceRedraw = function($el) {
+ return $el && $el.length && $el[0].offsetHeight;
+ };
+
+ // Exclude array (`buttons`) options from deep merging
+ // ===================================================
+ var mergeOpts = function(opts1, opts2) {
+ var rez = $.extend(true, {}, opts1, opts2);
+
+ $.each(opts2, function(key, value) {
+ if ($.isArray(value)) {
+ rez[key] = value;
+ }
+ });
+
+ return rez;
+ };
+
+ // How much of an element is visible in viewport
+ // =============================================
+
+ var inViewport = function(elem) {
+ var elemCenter, rez;
+
+ if (!elem || elem.ownerDocument !== document) {
+ return false;
+ }
+
+ $(".fancybox-container").css("pointer-events", "none");
+
+ elemCenter = {
+ x: elem.getBoundingClientRect().left + elem.offsetWidth / 2,
+ y: elem.getBoundingClientRect().top + elem.offsetHeight / 2
+ };
+
+ rez = document.elementFromPoint(elemCenter.x, elemCenter.y) === elem;
+
+ $(".fancybox-container").css("pointer-events", "");
+
+ return rez;
+ };
+
+ // Class definition
+ // ================
+
+ var FancyBox = function(content, opts, index) {
+ var self = this;
+
+ self.opts = mergeOpts({index: index}, $.fancybox.defaults);
+
+ if ($.isPlainObject(opts)) {
+ self.opts = mergeOpts(self.opts, opts);
+ }
+
+ if ($.fancybox.isMobile) {
+ self.opts = mergeOpts(self.opts, self.opts.mobile);
+ }
+
+ self.id = self.opts.id || ++called;
+
+ self.currIndex = parseInt(self.opts.index, 10) || 0;
+ self.prevIndex = null;
+
+ self.prevPos = null;
+ self.currPos = 0;
+
+ self.firstRun = true;
+
+ // All group items
+ self.group = [];
+
+ // Existing slides (for current, next and previous gallery items)
+ self.slides = {};
+
+ // Create group elements
+ self.addContent(content);
+
+ if (!self.group.length) {
+ return;
+ }
+
+ self.init();
+ };
+
+ $.extend(FancyBox.prototype, {
+ // Create DOM structure
+ // ====================
+
+ init: function() {
+ var self = this,
+ firstItem = self.group[self.currIndex],
+ firstItemOpts = firstItem.opts,
+ $container,
+ buttonStr;
+
+ if (firstItemOpts.closeExisting) {
+ $.fancybox.close(true);
+ }
+
+ // Hide scrollbars
+ // ===============
+
+ $("body").addClass("fancybox-active");
+
+ if (
+ !$.fancybox.getInstance() &&
+ firstItemOpts.hideScrollbar !== false &&
+ !$.fancybox.isMobile &&
+ document.body.scrollHeight > window.innerHeight
+ ) {
+ $("head").append(
+ '"
+ );
+
+ $("body").addClass("compensate-for-scrollbar");
+ }
+
+ // Build html markup and set references
+ // ====================================
+
+ // Build html code for buttons and insert into main template
+ buttonStr = "";
+
+ $.each(firstItemOpts.buttons, function(index, value) {
+ buttonStr += firstItemOpts.btnTpl[value] || "";
+ });
+
+ // Create markup from base template, it will be initially hidden to
+ // avoid unnecessary work like painting while initializing is not complete
+ $container = $(
+ self.translate(
+ self,
+ firstItemOpts.baseTpl
+ .replace("{{buttons}}", buttonStr)
+ .replace("{{arrows}}", firstItemOpts.btnTpl.arrowLeft + firstItemOpts.btnTpl.arrowRight)
+ )
+ )
+ .attr("id", "fancybox-container-" + self.id)
+ .addClass(firstItemOpts.baseClass)
+ .data("FancyBox", self)
+ .appendTo(firstItemOpts.parentEl);
+
+ // Create object holding references to jQuery wrapped nodes
+ self.$refs = {
+ container: $container
+ };
+
+ ["bg", "inner", "infobar", "toolbar", "stage", "caption", "navigation"].forEach(function(item) {
+ self.$refs[item] = $container.find(".fancybox-" + item);
+ });
+
+ self.trigger("onInit");
+
+ // Enable events, deactive previous instances
+ self.activate();
+
+ // Build slides, load and reveal content
+ self.jumpTo(self.currIndex);
+ },
+
+ // Simple i18n support - replaces object keys found in template
+ // with corresponding values
+ // ============================================================
+
+ translate: function(obj, str) {
+ var arr = obj.opts.i18n[obj.opts.lang] || obj.opts.i18n.en;
+
+ return str.replace(/\{\{(\w+)\}\}/g, function(match, n) {
+ return arr[n] === undefined ? match : arr[n];
+ });
+ },
+
+ // Populate current group with fresh content
+ // Check if each object has valid type and content
+ // ===============================================
+
+ addContent: function(content) {
+ var self = this,
+ items = $.makeArray(content),
+ thumbs;
+
+ $.each(items, function(i, item) {
+ var obj = {},
+ opts = {},
+ $item,
+ type,
+ found,
+ src,
+ srcParts;
+
+ // Step 1 - Make sure we have an object
+ // ====================================
+
+ if ($.isPlainObject(item)) {
+ // We probably have manual usage here, something like
+ // $.fancybox.open( [ { src : "image.jpg", type : "image" } ] )
+
+ obj = item;
+ opts = item.opts || item;
+ } else if ($.type(item) === "object" && $(item).length) {
+ // Here we probably have jQuery collection returned by some selector
+ $item = $(item);
+
+ // Support attributes like `data-options='{"touch" : false}'` and `data-touch='false'`
+ opts = $item.data() || {};
+ opts = $.extend(true, {}, opts, opts.options);
+
+ // Here we store clicked element
+ opts.$orig = $item;
+
+ obj.src = self.opts.src || opts.src || $item.attr("href");
+
+ // Assume that simple syntax is used, for example:
+ // `$.fancybox.open( $("#test"), {} );`
+ if (!obj.type && !obj.src) {
+ obj.type = "inline";
+ obj.src = item;
+ }
+ } else {
+ // Assume we have a simple html code, for example:
+ // $.fancybox.open( '
Hi!
' );
+ obj = {
+ type: "html",
+ src: item + ""
+ };
+ }
+
+ // Each gallery object has full collection of options
+ obj.opts = $.extend(true, {}, self.opts, opts);
+
+ // Do not merge buttons array
+ if ($.isArray(opts.buttons)) {
+ obj.opts.buttons = opts.buttons;
+ }
+
+ if ($.fancybox.isMobile && obj.opts.mobile) {
+ obj.opts = mergeOpts(obj.opts, obj.opts.mobile);
+ }
+
+ // Step 2 - Make sure we have content type, if not - try to guess
+ // ==============================================================
+
+ type = obj.type || obj.opts.type;
+ src = obj.src || "";
+
+ if (!type && src) {
+ if ((found = src.match(/\.(mp4|mov|ogv|webm)((\?|#).*)?$/i))) {
+ type = "video";
+
+ if (!obj.opts.video.format) {
+ obj.opts.video.format = "video/" + (found[1] === "ogv" ? "ogg" : found[1]);
+ }
+ } else if (src.match(/(^data:image\/[a-z0-9+\/=]*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg|ico)((\?|#).*)?$)/i)) {
+ type = "image";
+ } else if (src.match(/\.(pdf)((\?|#).*)?$/i)) {
+ type = "iframe";
+ obj = $.extend(true, obj, {contentType: "pdf", opts: {iframe: {preload: false}}});
+ } else if (src.charAt(0) === "#") {
+ type = "inline";
+ }
+ }
+
+ if (type) {
+ obj.type = type;
+ } else {
+ self.trigger("objectNeedsType", obj);
+ }
+
+ if (!obj.contentType) {
+ obj.contentType = $.inArray(obj.type, ["html", "inline", "ajax"]) > -1 ? "html" : obj.type;
+ }
+
+ // Step 3 - Some adjustments
+ // =========================
+
+ obj.index = self.group.length;
+
+ if (obj.opts.smallBtn == "auto") {
+ obj.opts.smallBtn = $.inArray(obj.type, ["html", "inline", "ajax"]) > -1;
+ }
+
+ if (obj.opts.toolbar === "auto") {
+ obj.opts.toolbar = !obj.opts.smallBtn;
+ }
+
+ // Find thumbnail image, check if exists and if is in the viewport
+ obj.$thumb = obj.opts.$thumb || null;
+
+ if (obj.opts.$trigger && obj.index === self.opts.index) {
+ obj.$thumb = obj.opts.$trigger.find("img:first");
+
+ if (obj.$thumb.length) {
+ obj.opts.$orig = obj.opts.$trigger;
+ }
+ }
+
+ if (!(obj.$thumb && obj.$thumb.length) && obj.opts.$orig) {
+ obj.$thumb = obj.opts.$orig.find("img:first");
+ }
+
+ if (obj.$thumb && !obj.$thumb.length) {
+ obj.$thumb = null;
+ }
+
+ obj.thumb = obj.opts.thumb || (obj.$thumb ? obj.$thumb[0].src : null);
+
+ // "caption" is a "special" option, it can be used to customize caption per gallery item
+ if ($.type(obj.opts.caption) === "function") {
+ obj.opts.caption = obj.opts.caption.apply(item, [self, obj]);
+ }
+
+ if ($.type(self.opts.caption) === "function") {
+ obj.opts.caption = self.opts.caption.apply(item, [self, obj]);
+ }
+
+ // Make sure we have caption as a string or jQuery object
+ if (!(obj.opts.caption instanceof $)) {
+ obj.opts.caption = obj.opts.caption === undefined ? "" : obj.opts.caption + "";
+ }
+
+ // Check if url contains "filter" used to filter the content
+ // Example: "ajax.html #something"
+ if (obj.type === "ajax") {
+ srcParts = src.split(/\s+/, 2);
+
+ if (srcParts.length > 1) {
+ obj.src = srcParts.shift();
+
+ obj.opts.filter = srcParts.shift();
+ }
+ }
+
+ // Hide all buttons and disable interactivity for modal items
+ if (obj.opts.modal) {
+ obj.opts = $.extend(true, obj.opts, {
+ trapFocus: true,
+ // Remove buttons
+ infobar: 0,
+ toolbar: 0,
+
+ smallBtn: 0,
+
+ // Disable keyboard navigation
+ keyboard: 0,
+
+ // Disable some modules
+ slideShow: 0,
+ fullScreen: 0,
+ thumbs: 0,
+ touch: 0,
+
+ // Disable click event handlers
+ clickContent: false,
+ clickSlide: false,
+ clickOutside: false,
+ dblclickContent: false,
+ dblclickSlide: false,
+ dblclickOutside: false
+ });
+ }
+
+ // Step 4 - Add processed object to group
+ // ======================================
+
+ self.group.push(obj);
+ });
+
+ // Update controls if gallery is already opened
+ if (Object.keys(self.slides).length) {
+ self.updateControls();
+
+ // Update thumbnails, if needed
+ thumbs = self.Thumbs;
+
+ if (thumbs && thumbs.isActive) {
+ thumbs.create();
+
+ thumbs.focus();
+ }
+ }
+ },
+
+ // Attach an event handler functions for:
+ // - navigation buttons
+ // - browser scrolling, resizing;
+ // - focusing
+ // - keyboard
+ // - detecting inactivity
+ // ======================================
+
+ addEvents: function() {
+ var self = this;
+
+ self.removeEvents();
+
+ // Make navigation elements clickable
+ // ==================================
+
+ self.$refs.container
+ .on("click.fb-close", "[data-fancybox-close]", function(e) {
+ e.stopPropagation();
+ e.preventDefault();
+
+ self.close(e);
+ })
+ .on("touchstart.fb-prev click.fb-prev", "[data-fancybox-prev]", function(e) {
+ e.stopPropagation();
+ e.preventDefault();
+
+ self.previous();
+ })
+ .on("touchstart.fb-next click.fb-next", "[data-fancybox-next]", function(e) {
+ e.stopPropagation();
+ e.preventDefault();
+
+ self.next();
+ })
+ .on("click.fb", "[data-fancybox-zoom]", function(e) {
+ // Click handler for zoom button
+ self[self.isScaledDown() ? "scaleToActual" : "scaleToFit"]();
+ });
+
+ // Handle page scrolling and browser resizing
+ // ==========================================
+
+ $W.on("orientationchange.fb resize.fb", function(e) {
+ if (e && e.originalEvent && e.originalEvent.type === "resize") {
+ if (self.requestId) {
+ cancelAFrame(self.requestId);
+ }
+
+ self.requestId = requestAFrame(function() {
+ self.update(e);
+ });
+ } else {
+ if (self.current && self.current.type === "iframe") {
+ self.$refs.stage.hide();
+ }
+
+ setTimeout(
+ function() {
+ self.$refs.stage.show();
+
+ self.update(e);
+ },
+ $.fancybox.isMobile ? 600 : 250
+ );
+ }
+ });
+
+ $D.on("keydown.fb", function(e) {
+ var instance = $.fancybox ? $.fancybox.getInstance() : null,
+ current = instance.current,
+ keycode = e.keyCode || e.which;
+
+ // Trap keyboard focus inside of the modal
+ // =======================================
+
+ if (keycode == 9) {
+ if (current.opts.trapFocus) {
+ self.focus(e);
+ }
+
+ return;
+ }
+
+ // Enable keyboard navigation
+ // ==========================
+
+ if (!current.opts.keyboard || e.ctrlKey || e.altKey || e.shiftKey || $(e.target).is("input,textarea,video,audio")) {
+ return;
+ }
+
+ // Backspace and Esc keys
+ if (keycode === 8 || keycode === 27) {
+ e.preventDefault();
+
+ self.close(e);
+
+ return;
+ }
+
+ // Left arrow and Up arrow
+ if (keycode === 37 || keycode === 38) {
+ e.preventDefault();
+
+ self.previous();
+
+ return;
+ }
+
+ // Righ arrow and Down arrow
+ if (keycode === 39 || keycode === 40) {
+ e.preventDefault();
+
+ self.next();
+
+ return;
+ }
+
+ self.trigger("afterKeydown", e, keycode);
+ });
+
+ // Hide controls after some inactivity period
+ if (self.group[self.currIndex].opts.idleTime) {
+ self.idleSecondsCounter = 0;
+
+ $D.on(
+ "mousemove.fb-idle mouseleave.fb-idle mousedown.fb-idle touchstart.fb-idle touchmove.fb-idle scroll.fb-idle keydown.fb-idle",
+ function(e) {
+ self.idleSecondsCounter = 0;
+
+ if (self.isIdle) {
+ self.showControls();
+ }
+
+ self.isIdle = false;
+ }
+ );
+
+ self.idleInterval = window.setInterval(function() {
+ self.idleSecondsCounter++;
+
+ if (self.idleSecondsCounter >= self.group[self.currIndex].opts.idleTime && !self.isDragging) {
+ self.isIdle = true;
+ self.idleSecondsCounter = 0;
+
+ self.hideControls();
+ }
+ }, 1000);
+ }
+ },
+
+ // Remove events added by the core
+ // ===============================
+
+ removeEvents: function() {
+ var self = this;
+
+ $W.off("orientationchange.fb resize.fb");
+ $D.off("keydown.fb .fb-idle");
+
+ this.$refs.container.off(".fb-close .fb-prev .fb-next");
+
+ if (self.idleInterval) {
+ window.clearInterval(self.idleInterval);
+
+ self.idleInterval = null;
+ }
+ },
+
+ // Change to previous gallery item
+ // ===============================
+
+ previous: function(duration) {
+ return this.jumpTo(this.currPos - 1, duration);
+ },
+
+ // Change to next gallery item
+ // ===========================
+
+ next: function(duration) {
+ return this.jumpTo(this.currPos + 1, duration);
+ },
+
+ // Switch to selected gallery item
+ // ===============================
+
+ jumpTo: function(pos, duration) {
+ var self = this,
+ groupLen = self.group.length,
+ firstRun,
+ isMoved,
+ loop,
+ current,
+ previous,
+ slidePos,
+ stagePos,
+ prop,
+ diff;
+
+ if (self.isDragging || self.isClosing || (self.isAnimating && self.firstRun)) {
+ return;
+ }
+
+ // Should loop?
+ pos = parseInt(pos, 10);
+ loop = self.current ? self.current.opts.loop : self.opts.loop;
+
+ if (!loop && (pos < 0 || pos >= groupLen)) {
+ return false;
+ }
+
+ // Check if opening for the first time; this helps to speed things up
+ firstRun = self.firstRun = !Object.keys(self.slides).length;
+
+ // Create slides
+ previous = self.current;
+
+ self.prevIndex = self.currIndex;
+ self.prevPos = self.currPos;
+
+ current = self.createSlide(pos);
+
+ if (groupLen > 1) {
+ if (loop || current.index < groupLen - 1) {
+ self.createSlide(pos + 1);
+ }
+
+ if (loop || current.index > 0) {
+ self.createSlide(pos - 1);
+ }
+ }
+
+ self.current = current;
+ self.currIndex = current.index;
+ self.currPos = current.pos;
+
+ self.trigger("beforeShow", firstRun);
+
+ self.updateControls();
+
+ // Validate duration length
+ current.forcedDuration = undefined;
+
+ if ($.isNumeric(duration)) {
+ current.forcedDuration = duration;
+ } else {
+ duration = current.opts[firstRun ? "animationDuration" : "transitionDuration"];
+ }
+
+ duration = parseInt(duration, 10);
+
+ // Check if user has swiped the slides or if still animating
+ isMoved = self.isMoved(current);
+
+ // Make sure current slide is visible
+ current.$slide.addClass("fancybox-slide--current");
+
+ // Fresh start - reveal container, current slide and start loading content
+ if (firstRun) {
+ if (current.opts.animationEffect && duration) {
+ self.$refs.container.css("transition-duration", duration + "ms");
+ }
+
+ self.$refs.container.addClass("fancybox-is-open").trigger("focus");
+
+ // Attempt to load content into slide
+ // This will later call `afterLoad` -> `revealContent`
+ self.loadSlide(current);
+
+ self.preload("image");
+
+ return;
+ }
+
+ // Get actual slide/stage positions (before cleaning up)
+ slidePos = $.fancybox.getTranslate(previous.$slide);
+ stagePos = $.fancybox.getTranslate(self.$refs.stage);
+
+ // Clean up all slides
+ $.each(self.slides, function(index, slide) {
+ $.fancybox.stop(slide.$slide, true);
+ });
+
+ if (previous.pos !== current.pos) {
+ previous.isComplete = false;
+ }
+
+ previous.$slide.removeClass("fancybox-slide--complete fancybox-slide--current");
+
+ // If slides are out of place, then animate them to correct position
+ if (isMoved) {
+ // Calculate horizontal swipe distance
+ diff = slidePos.left - (previous.pos * slidePos.width + previous.pos * previous.opts.gutter);
+
+ $.each(self.slides, function(index, slide) {
+ slide.$slide.removeClass("fancybox-animated").removeClass(function(index, className) {
+ return (className.match(/(^|\s)fancybox-fx-\S+/g) || []).join(" ");
+ });
+
+ // Make sure that each slide is in equal distance
+ // This is mostly needed for freshly added slides, because they are not yet positioned
+ var leftPos = slide.pos * slidePos.width + slide.pos * slide.opts.gutter;
+
+ $.fancybox.setTranslate(slide.$slide, {top: 0, left: leftPos - stagePos.left + diff});
+
+ if (slide.pos !== current.pos) {
+ slide.$slide.addClass("fancybox-slide--" + (slide.pos > current.pos ? "next" : "previous"));
+ }
+
+ // Redraw to make sure that transition will start
+ forceRedraw(slide.$slide);
+
+ // Animate the slide
+ $.fancybox.animate(
+ slide.$slide,
+ {
+ top: 0,
+ left: (slide.pos - current.pos) * slidePos.width + (slide.pos - current.pos) * slide.opts.gutter
+ },
+ duration,
+ function() {
+ slide.$slide
+ .css({
+ transform: "",
+ opacity: ""
+ })
+ .removeClass("fancybox-slide--next fancybox-slide--previous");
+
+ if (slide.pos === self.currPos) {
+ self.complete();
+ }
+ }
+ );
+ });
+ } else if (duration && current.opts.transitionEffect) {
+ // Set transition effect for previously active slide
+ prop = "fancybox-animated fancybox-fx-" + current.opts.transitionEffect;
+
+ previous.$slide.addClass("fancybox-slide--" + (previous.pos > current.pos ? "next" : "previous"));
+
+ $.fancybox.animate(
+ previous.$slide,
+ prop,
+ duration,
+ function() {
+ previous.$slide.removeClass(prop).removeClass("fancybox-slide--next fancybox-slide--previous");
+ },
+ false
+ );
+ }
+
+ if (current.isLoaded) {
+ self.revealContent(current);
+ } else {
+ self.loadSlide(current);
+ }
+
+ self.preload("image");
+ },
+
+ // Create new "slide" element
+ // These are gallery items that are actually added to DOM
+ // =======================================================
+
+ createSlide: function(pos) {
+ var self = this,
+ $slide,
+ index;
+
+ index = pos % self.group.length;
+ index = index < 0 ? self.group.length + index : index;
+
+ if (!self.slides[pos] && self.group[index]) {
+ $slide = $('').appendTo(self.$refs.stage);
+
+ self.slides[pos] = $.extend(true, {}, self.group[index], {
+ pos: pos,
+ $slide: $slide,
+ isLoaded: false
+ });
+
+ self.updateSlide(self.slides[pos]);
+ }
+
+ return self.slides[pos];
+ },
+
+ // Scale image to the actual size of the image;
+ // x and y values should be relative to the slide
+ // ==============================================
+
+ scaleToActual: function(x, y, duration) {
+ var self = this,
+ current = self.current,
+ $content = current.$content,
+ canvasWidth = $.fancybox.getTranslate(current.$slide).width,
+ canvasHeight = $.fancybox.getTranslate(current.$slide).height,
+ newImgWidth = current.width,
+ newImgHeight = current.height,
+ imgPos,
+ posX,
+ posY,
+ scaleX,
+ scaleY;
+
+ if (self.isAnimating || self.isMoved() || !$content || !(current.type == "image" && current.isLoaded && !current.hasError)) {
+ return;
+ }
+
+ self.isAnimating = true;
+
+ $.fancybox.stop($content);
+
+ x = x === undefined ? canvasWidth * 0.5 : x;
+ y = y === undefined ? canvasHeight * 0.5 : y;
+
+ imgPos = $.fancybox.getTranslate($content);
+
+ imgPos.top -= $.fancybox.getTranslate(current.$slide).top;
+ imgPos.left -= $.fancybox.getTranslate(current.$slide).left;
+
+ scaleX = newImgWidth / imgPos.width;
+ scaleY = newImgHeight / imgPos.height;
+
+ // Get center position for original image
+ posX = canvasWidth * 0.5 - newImgWidth * 0.5;
+ posY = canvasHeight * 0.5 - newImgHeight * 0.5;
+
+ // Make sure image does not move away from edges
+ if (newImgWidth > canvasWidth) {
+ posX = imgPos.left * scaleX - (x * scaleX - x);
+
+ if (posX > 0) {
+ posX = 0;
+ }
+
+ if (posX < canvasWidth - newImgWidth) {
+ posX = canvasWidth - newImgWidth;
+ }
+ }
+
+ if (newImgHeight > canvasHeight) {
+ posY = imgPos.top * scaleY - (y * scaleY - y);
+
+ if (posY > 0) {
+ posY = 0;
+ }
+
+ if (posY < canvasHeight - newImgHeight) {
+ posY = canvasHeight - newImgHeight;
+ }
+ }
+
+ self.updateCursor(newImgWidth, newImgHeight);
+
+ $.fancybox.animate(
+ $content,
+ {
+ top: posY,
+ left: posX,
+ scaleX: scaleX,
+ scaleY: scaleY
+ },
+ duration || 366,
+ function() {
+ self.isAnimating = false;
+ }
+ );
+
+ // Stop slideshow
+ if (self.SlideShow && self.SlideShow.isActive) {
+ self.SlideShow.stop();
+ }
+ },
+
+ // Scale image to fit inside parent element
+ // ========================================
+
+ scaleToFit: function(duration) {
+ var self = this,
+ current = self.current,
+ $content = current.$content,
+ end;
+
+ if (self.isAnimating || self.isMoved() || !$content || !(current.type == "image" && current.isLoaded && !current.hasError)) {
+ return;
+ }
+
+ self.isAnimating = true;
+
+ $.fancybox.stop($content);
+
+ end = self.getFitPos(current);
+
+ self.updateCursor(end.width, end.height);
+
+ $.fancybox.animate(
+ $content,
+ {
+ top: end.top,
+ left: end.left,
+ scaleX: end.width / $content.width(),
+ scaleY: end.height / $content.height()
+ },
+ duration || 366,
+ function() {
+ self.isAnimating = false;
+ }
+ );
+ },
+
+ // Calculate image size to fit inside viewport
+ // ===========================================
+
+ getFitPos: function(slide) {
+ var self = this,
+ $content = slide.$content,
+ $slide = slide.$slide,
+ width = slide.width || slide.opts.width,
+ height = slide.height || slide.opts.height,
+ maxWidth,
+ maxHeight,
+ minRatio,
+ aspectRatio,
+ rez = {};
+
+ if (!slide.isLoaded || !$content || !$content.length) {
+ return false;
+ }
+
+ maxWidth = $.fancybox.getTranslate(self.$refs.stage).width;
+ maxHeight = $.fancybox.getTranslate(self.$refs.stage).height;
+
+ maxWidth -=
+ parseFloat($slide.css("paddingLeft")) +
+ parseFloat($slide.css("paddingRight")) +
+ parseFloat($content.css("marginLeft")) +
+ parseFloat($content.css("marginRight"));
+
+ maxHeight -=
+ parseFloat($slide.css("paddingTop")) +
+ parseFloat($slide.css("paddingBottom")) +
+ parseFloat($content.css("marginTop")) +
+ parseFloat($content.css("marginBottom"));
+
+ if (!width || !height) {
+ width = maxWidth;
+ height = maxHeight;
+ }
+
+ minRatio = Math.min(1, maxWidth / width, maxHeight / height);
+
+ width = minRatio * width;
+ height = minRatio * height;
+
+ // Adjust width/height to precisely fit into container
+ if (width > maxWidth - 0.5) {
+ width = maxWidth;
+ }
+
+ if (height > maxHeight - 0.5) {
+ height = maxHeight;
+ }
+
+ if (slide.type === "image") {
+ rez.top = Math.floor((maxHeight - height) * 0.5) + parseFloat($slide.css("paddingTop"));
+ rez.left = Math.floor((maxWidth - width) * 0.5) + parseFloat($slide.css("paddingLeft"));
+ } else if (slide.contentType === "video") {
+ // Force aspect ratio for the video
+ // "I say the whole world must learn of our peaceful ways… by force!"
+ aspectRatio = slide.opts.width && slide.opts.height ? width / height : slide.opts.ratio || 16 / 9;
+
+ if (height > width / aspectRatio) {
+ height = width / aspectRatio;
+ } else if (width > height * aspectRatio) {
+ width = height * aspectRatio;
+ }
+ }
+
+ rez.width = width;
+ rez.height = height;
+
+ return rez;
+ },
+
+ // Update content size and position for all slides
+ // ==============================================
+
+ update: function(e) {
+ var self = this;
+
+ $.each(self.slides, function(key, slide) {
+ self.updateSlide(slide, e);
+ });
+ },
+
+ // Update slide content position and size
+ // ======================================
+
+ updateSlide: function(slide, e) {
+ var self = this,
+ $content = slide && slide.$content,
+ width = slide.width || slide.opts.width,
+ height = slide.height || slide.opts.height,
+ $slide = slide.$slide;
+
+ // First, prevent caption overlap, if needed
+ self.adjustCaption(slide);
+
+ // Then resize content to fit inside the slide
+ if ($content && (width || height || slide.contentType === "video") && !slide.hasError) {
+ $.fancybox.stop($content);
+
+ $.fancybox.setTranslate($content, self.getFitPos(slide));
+
+ if (slide.pos === self.currPos) {
+ self.isAnimating = false;
+
+ self.updateCursor();
+ }
+ }
+
+ // Then some adjustments
+ self.adjustLayout(slide);
+
+ if ($slide.length) {
+ $slide.trigger("refresh");
+
+ if (slide.pos === self.currPos) {
+ self.$refs.toolbar
+ .add(self.$refs.navigation.find(".fancybox-button--arrow_right"))
+ .toggleClass("compensate-for-scrollbar", $slide.get(0).scrollHeight > $slide.get(0).clientHeight);
+ }
+ }
+
+ self.trigger("onUpdate", slide, e);
+ },
+
+ // Horizontally center slide
+ // =========================
+
+ centerSlide: function(duration) {
+ var self = this,
+ current = self.current,
+ $slide = current.$slide;
+
+ if (self.isClosing || !current) {
+ return;
+ }
+
+ $slide.siblings().css({
+ transform: "",
+ opacity: ""
+ });
+
+ $slide
+ .parent()
+ .children()
+ .removeClass("fancybox-slide--previous fancybox-slide--next");
+
+ $.fancybox.animate(
+ $slide,
+ {
+ top: 0,
+ left: 0,
+ opacity: 1
+ },
+ duration === undefined ? 0 : duration,
+ function() {
+ // Clean up
+ $slide.css({
+ transform: "",
+ opacity: ""
+ });
+
+ if (!current.isComplete) {
+ self.complete();
+ }
+ },
+ false
+ );
+ },
+
+ // Check if current slide is moved (swiped)
+ // ========================================
+
+ isMoved: function(slide) {
+ var current = slide || this.current,
+ slidePos,
+ stagePos;
+
+ if (!current) {
+ return false;
+ }
+
+ stagePos = $.fancybox.getTranslate(this.$refs.stage);
+ slidePos = $.fancybox.getTranslate(current.$slide);
+
+ return (
+ !current.$slide.hasClass("fancybox-animated") &&
+ (Math.abs(slidePos.top - stagePos.top) > 0.5 || Math.abs(slidePos.left - stagePos.left) > 0.5)
+ );
+ },
+
+ // Update cursor style depending if content can be zoomed
+ // ======================================================
+
+ updateCursor: function(nextWidth, nextHeight) {
+ var self = this,
+ current = self.current,
+ $container = self.$refs.container,
+ canPan,
+ isZoomable;
+
+ if (!current || self.isClosing || !self.Guestures) {
+ return;
+ }
+
+ $container.removeClass("fancybox-is-zoomable fancybox-can-zoomIn fancybox-can-zoomOut fancybox-can-swipe fancybox-can-pan");
+
+ canPan = self.canPan(nextWidth, nextHeight);
+
+ isZoomable = canPan ? true : self.isZoomable();
+
+ $container.toggleClass("fancybox-is-zoomable", isZoomable);
+
+ $("[data-fancybox-zoom]").prop("disabled", !isZoomable);
+
+ if (canPan) {
+ $container.addClass("fancybox-can-pan");
+ } else if (
+ isZoomable &&
+ (current.opts.clickContent === "zoom" || ($.isFunction(current.opts.clickContent) && current.opts.clickContent(current) == "zoom"))
+ ) {
+ $container.addClass("fancybox-can-zoomIn");
+ } else if (current.opts.touch && (current.opts.touch.vertical || self.group.length > 1) && current.contentType !== "video") {
+ $container.addClass("fancybox-can-swipe");
+ }
+ },
+
+ // Check if current slide is zoomable
+ // ==================================
+
+ isZoomable: function() {
+ var self = this,
+ current = self.current,
+ fitPos;
+
+ // Assume that slide is zoomable if:
+ // - image is still loading
+ // - actual size of the image is smaller than available area
+ if (current && !self.isClosing && current.type === "image" && !current.hasError) {
+ if (!current.isLoaded) {
+ return true;
+ }
+
+ fitPos = self.getFitPos(current);
+
+ if (fitPos && (current.width > fitPos.width || current.height > fitPos.height)) {
+ return true;
+ }
+ }
+
+ return false;
+ },
+
+ // Check if current image dimensions are smaller than actual
+ // =========================================================
+
+ isScaledDown: function(nextWidth, nextHeight) {
+ var self = this,
+ rez = false,
+ current = self.current,
+ $content = current.$content;
+
+ if (nextWidth !== undefined && nextHeight !== undefined) {
+ rez = nextWidth < current.width && nextHeight < current.height;
+ } else if ($content) {
+ rez = $.fancybox.getTranslate($content);
+ rez = rez.width < current.width && rez.height < current.height;
+ }
+
+ return rez;
+ },
+
+ // Check if image dimensions exceed parent element
+ // ===============================================
+
+ canPan: function(nextWidth, nextHeight) {
+ var self = this,
+ current = self.current,
+ pos = null,
+ rez = false;
+
+ if (current.type === "image" && (current.isComplete || (nextWidth && nextHeight)) && !current.hasError) {
+ rez = self.getFitPos(current);
+
+ if (nextWidth !== undefined && nextHeight !== undefined) {
+ pos = {width: nextWidth, height: nextHeight};
+ } else if (current.isComplete) {
+ pos = $.fancybox.getTranslate(current.$content);
+ }
+
+ if (pos && rez) {
+ rez = Math.abs(pos.width - rez.width) > 1.5 || Math.abs(pos.height - rez.height) > 1.5;
+ }
+ }
+
+ return rez;
+ },
+
+ // Load content into the slide
+ // ===========================
+
+ loadSlide: function(slide) {
+ var self = this,
+ type,
+ $slide,
+ ajaxLoad;
+
+ if (slide.isLoading || slide.isLoaded) {
+ return;
+ }
+
+ slide.isLoading = true;
+
+ if (self.trigger("beforeLoad", slide) === false) {
+ slide.isLoading = false;
+
+ return false;
+ }
+
+ type = slide.type;
+ $slide = slide.$slide;
+
+ $slide
+ .off("refresh")
+ .trigger("onReset")
+ .addClass(slide.opts.slideClass);
+
+ // Create content depending on the type
+ switch (type) {
+ case "image":
+ self.setImage(slide);
+
+ break;
+
+ case "iframe":
+ self.setIframe(slide);
+
+ break;
+
+ case "html":
+ self.setContent(slide, slide.src || slide.content);
+
+ break;
+
+ case "video":
+ self.setContent(
+ slide,
+ slide.opts.video.tpl
+ .replace(/\{\{src\}\}/gi, slide.src)
+ .replace("{{format}}", slide.opts.videoFormat || slide.opts.video.format || "")
+ .replace("{{poster}}", slide.thumb || "")
+ );
+
+ break;
+
+ case "inline":
+ if ($(slide.src).length) {
+ self.setContent(slide, $(slide.src));
+ } else {
+ self.setError(slide);
+ }
+
+ break;
+
+ case "ajax":
+ self.showLoading(slide);
+
+ ajaxLoad = $.ajax(
+ $.extend({}, slide.opts.ajax.settings, {
+ url: slide.src,
+ success: function(data, textStatus) {
+ if (textStatus === "success") {
+ self.setContent(slide, data);
+ }
+ },
+ error: function(jqXHR, textStatus) {
+ if (jqXHR && textStatus !== "abort") {
+ self.setError(slide);
+ }
+ }
+ })
+ );
+
+ $slide.one("onReset", function() {
+ ajaxLoad.abort();
+ });
+
+ break;
+
+ default:
+ self.setError(slide);
+
+ break;
+ }
+
+ return true;
+ },
+
+ // Use thumbnail image, if possible
+ // ================================
+
+ setImage: function(slide) {
+ var self = this,
+ ghost;
+
+ // Check if need to show loading icon
+ setTimeout(function() {
+ var $img = slide.$image;
+
+ if (!self.isClosing && slide.isLoading && (!$img || !$img.length || !$img[0].complete) && !slide.hasError) {
+ self.showLoading(slide);
+ }
+ }, 50);
+
+ //Check if image has srcset
+ self.checkSrcset(slide);
+
+ // This will be wrapper containing both ghost and actual image
+ slide.$content = $('')
+ .addClass("fancybox-is-hidden")
+ .appendTo(slide.$slide.addClass("fancybox-slide--image"));
+
+ // If we have a thumbnail, we can display it while actual image is loading
+ // Users will not stare at black screen and actual image will appear gradually
+ if (slide.opts.preload !== false && slide.opts.width && slide.opts.height && slide.thumb) {
+ slide.width = slide.opts.width;
+ slide.height = slide.opts.height;
+
+ ghost = document.createElement("img");
+
+ ghost.onerror = function() {
+ $(this).remove();
+
+ slide.$ghost = null;
+ };
+
+ ghost.onload = function() {
+ self.afterLoad(slide);
+ };
+
+ slide.$ghost = $(ghost)
+ .addClass("fancybox-image")
+ .appendTo(slide.$content)
+ .attr("src", slide.thumb);
+ }
+
+ // Start loading actual image
+ self.setBigImage(slide);
+ },
+
+ // Check if image has srcset and get the source
+ // ============================================
+ checkSrcset: function(slide) {
+ var srcset = slide.opts.srcset || slide.opts.image.srcset,
+ found,
+ temp,
+ pxRatio,
+ windowWidth;
+
+ // If we have "srcset", then we need to find first matching "src" value.
+ // This is necessary, because when you set an src attribute, the browser will preload the image
+ // before any javascript or even CSS is applied.
+ if (srcset) {
+ pxRatio = window.devicePixelRatio || 1;
+ windowWidth = window.innerWidth * pxRatio;
+
+ temp = srcset.split(",").map(function(el) {
+ var ret = {};
+
+ el.trim()
+ .split(/\s+/)
+ .forEach(function(el, i) {
+ var value = parseInt(el.substring(0, el.length - 1), 10);
+
+ if (i === 0) {
+ return (ret.url = el);
+ }
+
+ if (value) {
+ ret.value = value;
+ ret.postfix = el[el.length - 1];
+ }
+ });
+
+ return ret;
+ });
+
+ // Sort by value
+ temp.sort(function(a, b) {
+ return a.value - b.value;
+ });
+
+ // Ok, now we have an array of all srcset values
+ for (var j = 0; j < temp.length; j++) {
+ var el = temp[j];
+
+ if ((el.postfix === "w" && el.value >= windowWidth) || (el.postfix === "x" && el.value >= pxRatio)) {
+ found = el;
+ break;
+ }
+ }
+
+ // If not found, take the last one
+ if (!found && temp.length) {
+ found = temp[temp.length - 1];
+ }
+
+ if (found) {
+ slide.src = found.url;
+
+ // If we have default width/height values, we can calculate height for matching source
+ if (slide.width && slide.height && found.postfix == "w") {
+ slide.height = (slide.width / slide.height) * found.value;
+ slide.width = found.value;
+ }
+
+ slide.opts.srcset = srcset;
+ }
+ }
+ },
+
+ // Create full-size image
+ // ======================
+
+ setBigImage: function(slide) {
+ var self = this,
+ img = document.createElement("img"),
+ $img = $(img);
+
+ slide.$image = $img
+ .one("error", function() {
+ self.setError(slide);
+ })
+ .one("load", function() {
+ var sizes;
+
+ if (!slide.$ghost) {
+ self.resolveImageSlideSize(slide, this.naturalWidth, this.naturalHeight);
+
+ self.afterLoad(slide);
+ }
+
+ if (self.isClosing) {
+ return;
+ }
+
+ if (slide.opts.srcset) {
+ sizes = slide.opts.sizes;
+
+ if (!sizes || sizes === "auto") {
+ sizes =
+ (slide.width / slide.height > 1 && $W.width() / $W.height() > 1 ? "100" : Math.round((slide.width / slide.height) * 100)) +
+ "vw";
+ }
+
+ $img.attr("sizes", sizes).attr("srcset", slide.opts.srcset);
+ }
+
+ // Hide temporary image after some delay
+ if (slide.$ghost) {
+ setTimeout(function() {
+ if (slide.$ghost && !self.isClosing) {
+ slide.$ghost.hide();
+ }
+ }, Math.min(300, Math.max(1000, slide.height / 1600)));
+ }
+
+ self.hideLoading(slide);
+ })
+ .addClass("fancybox-image")
+ .attr("src", slide.src)
+ .appendTo(slide.$content);
+
+ if ((img.complete || img.readyState == "complete") && $img.naturalWidth && $img.naturalHeight) {
+ $img.trigger("load");
+ } else if (img.error) {
+ $img.trigger("error");
+ }
+ },
+
+ // Computes the slide size from image size and maxWidth/maxHeight
+ // ==============================================================
+
+ resolveImageSlideSize: function(slide, imgWidth, imgHeight) {
+ var maxWidth = parseInt(slide.opts.width, 10),
+ maxHeight = parseInt(slide.opts.height, 10);
+
+ // Sets the default values from the image
+ slide.width = imgWidth;
+ slide.height = imgHeight;
+
+ if (maxWidth > 0) {
+ slide.width = maxWidth;
+ slide.height = Math.floor((maxWidth * imgHeight) / imgWidth);
+ }
+
+ if (maxHeight > 0) {
+ slide.width = Math.floor((maxHeight * imgWidth) / imgHeight);
+ slide.height = maxHeight;
+ }
+ },
+
+ // Create iframe wrapper, iframe and bindings
+ // ==========================================
+
+ setIframe: function(slide) {
+ var self = this,
+ opts = slide.opts.iframe,
+ $slide = slide.$slide,
+ $iframe;
+
+ slide.$content = $('')
+ .css(opts.css)
+ .appendTo($slide);
+
+ $slide.addClass("fancybox-slide--" + slide.contentType);
+
+ slide.$iframe = $iframe = $(opts.tpl.replace(/\{rnd\}/g, new Date().getTime()))
+ .attr(opts.attr)
+ .appendTo(slide.$content);
+
+ if (opts.preload) {
+ self.showLoading(slide);
+
+ // Unfortunately, it is not always possible to determine if iframe is successfully loaded
+ // (due to browser security policy)
+
+ $iframe.on("load.fb error.fb", function(e) {
+ this.isReady = 1;
+
+ slide.$slide.trigger("refresh");
+
+ self.afterLoad(slide);
+ });
+
+ // Recalculate iframe content size
+ // ===============================
+
+ $slide.on("refresh.fb", function() {
+ var $content = slide.$content,
+ frameWidth = opts.css.width,
+ frameHeight = opts.css.height,
+ $contents,
+ $body;
+
+ if ($iframe[0].isReady !== 1) {
+ return;
+ }
+
+ try {
+ $contents = $iframe.contents();
+ $body = $contents.find("body");
+ } catch (ignore) {}
+
+ // Calculate content dimensions, if it is accessible
+ if ($body && $body.length && $body.children().length) {
+ // Avoid scrolling to top (if multiple instances)
+ $slide.css("overflow", "visible");
+
+ $content.css({
+ width: "100%",
+ "max-width": "100%",
+ height: "9999px"
+ });
+
+ if (frameWidth === undefined) {
+ frameWidth = Math.ceil(Math.max($body[0].clientWidth, $body.outerWidth(true)));
+ }
+
+ $content.css("width", frameWidth ? frameWidth : "").css("max-width", "");
+
+ if (frameHeight === undefined) {
+ frameHeight = Math.ceil(Math.max($body[0].clientHeight, $body.outerHeight(true)));
+ }
+
+ $content.css("height", frameHeight ? frameHeight : "");
+
+ $slide.css("overflow", "auto");
+ }
+
+ $content.removeClass("fancybox-is-hidden");
+ });
+ } else {
+ self.afterLoad(slide);
+ }
+
+ $iframe.attr("src", slide.src);
+
+ // Remove iframe if closing or changing gallery item
+ $slide.one("onReset", function() {
+ // This helps IE not to throw errors when closing
+ try {
+ $(this)
+ .find("iframe")
+ .hide()
+ .unbind()
+ .attr("src", "//about:blank");
+ } catch (ignore) {}
+
+ $(this)
+ .off("refresh.fb")
+ .empty();
+
+ slide.isLoaded = false;
+ slide.isRevealed = false;
+ });
+ },
+
+ // Wrap and append content to the slide
+ // ======================================
+
+ setContent: function(slide, content) {
+ var self = this;
+
+ if (self.isClosing) {
+ return;
+ }
+
+ self.hideLoading(slide);
+
+ if (slide.$content) {
+ $.fancybox.stop(slide.$content);
+ }
+
+ slide.$slide.empty();
+
+ // If content is a jQuery object, then it will be moved to the slide.
+ // The placeholder is created so we will know where to put it back.
+ if (isQuery(content) && content.parent().length) {
+ // Make sure content is not already moved to fancyBox
+ if (content.hasClass("fancybox-content") || content.parent().hasClass("fancybox-content")) {
+ content.parents(".fancybox-slide").trigger("onReset");
+ }
+
+ // Create temporary element marking original place of the content
+ slide.$placeholder = $("
")
+ .hide()
+ .insertAfter(content);
+
+ // Make sure content is visible
+ content.css("display", "inline-block");
+ } else if (!slide.hasError) {
+ // If content is just a plain text, try to convert it to html
+ if ($.type(content) === "string") {
+ content = $("
")
+ .append($.trim(content))
+ .contents();
+ }
+
+ // If "filter" option is provided, then filter content
+ if (slide.opts.filter) {
+ content = $("
').appendTo("body"),b=a.children(),b=b.innerWidth()-b.height(99).innerWidth();a.remove();return b});if(f.support.fixedPosition===v){a=f.support;d=f('').appendTo("body");var e=20===
+d[0].offsetTop||15===d[0].offsetTop;d.remove();a.fixedPosition=e}f.extend(b.defaults,{scrollbarWidth:f.scrollbarWidth(),fixed:f.support.fixedPosition,parent:f("body")});a=f(r).width();J.addClass("fancybox-lock-test");d=f(r).width();J.removeClass("fancybox-lock-test");f("").appendTo("head")})})(window,document,jQuery);
\ No newline at end of file
diff --git a/Ausgabe/common/fancybox/load_fancybox.js b/Ausgabe/common/fancybox/load_fancybox.js
new file mode 100755
index 0000000000000000000000000000000000000000..14cac825823be5ef1497d16a2e80bc0b47469fcc
--- /dev/null
+++ b/Ausgabe/common/fancybox/load_fancybox.js
@@ -0,0 +1,8 @@
+ $(document).ready(function() {
+ /*
+ * Simple image gallery. Uses default settings
+ */
+
+ $('.fancybox').fancybox();
+
+ });
\ No newline at end of file
diff --git a/Ausgabe/common/images/Mein_Logo.png b/Ausgabe/common/images/Mein_Logo.png
new file mode 100755
index 0000000000000000000000000000000000000000..48ad74856ce7e44a8265cad14208adc11efcb475
Binary files /dev/null and b/Ausgabe/common/images/Mein_Logo.png differ
diff --git a/Ausgabe/common/images/blank.png b/Ausgabe/common/images/blank.png
new file mode 100755
index 0000000000000000000000000000000000000000..764bf4f0c3bb4a09960b04b6fa9c9024bca703bc
Binary files /dev/null and b/Ausgabe/common/images/blank.png differ
diff --git a/Ausgabe/common/images/callouts/1.png b/Ausgabe/common/images/callouts/1.png
new file mode 100755
index 0000000000000000000000000000000000000000..7d473430b7bec514f7de12f5769fe7c5859e8c5d
Binary files /dev/null and b/Ausgabe/common/images/callouts/1.png differ
diff --git a/Ausgabe/common/images/callouts/10.png b/Ausgabe/common/images/callouts/10.png
new file mode 100755
index 0000000000000000000000000000000000000000..997bbc8246a316e040e0804174ba260e219d7d33
Binary files /dev/null and b/Ausgabe/common/images/callouts/10.png differ
diff --git a/Ausgabe/common/images/callouts/11.png b/Ausgabe/common/images/callouts/11.png
new file mode 100755
index 0000000000000000000000000000000000000000..ce47dac3f52ac49017749a3fea53db57d006993c
Binary files /dev/null and b/Ausgabe/common/images/callouts/11.png differ
diff --git a/Ausgabe/common/images/callouts/12.png b/Ausgabe/common/images/callouts/12.png
new file mode 100755
index 0000000000000000000000000000000000000000..31daf4e2f25b6712499ee32de9c2e3b050b691ca
Binary files /dev/null and b/Ausgabe/common/images/callouts/12.png differ
diff --git a/Ausgabe/common/images/callouts/13.png b/Ausgabe/common/images/callouts/13.png
new file mode 100755
index 0000000000000000000000000000000000000000..14021a89c2ed3d4881afea6e3a315bce4f95efce
Binary files /dev/null and b/Ausgabe/common/images/callouts/13.png differ
diff --git a/Ausgabe/common/images/callouts/14.png b/Ausgabe/common/images/callouts/14.png
new file mode 100755
index 0000000000000000000000000000000000000000..64014b75fe2e84d45ed861974c72462727979360
Binary files /dev/null and b/Ausgabe/common/images/callouts/14.png differ
diff --git a/Ausgabe/common/images/callouts/15.png b/Ausgabe/common/images/callouts/15.png
new file mode 100755
index 0000000000000000000000000000000000000000..0d65765fcf13dcfd87914744dec8bda115e4adf1
Binary files /dev/null and b/Ausgabe/common/images/callouts/15.png differ
diff --git a/Ausgabe/common/images/callouts/2.png b/Ausgabe/common/images/callouts/2.png
new file mode 100755
index 0000000000000000000000000000000000000000..5d09341b2f6d2ea2d1d5dad5d980f14b4b05dfd2
Binary files /dev/null and b/Ausgabe/common/images/callouts/2.png differ
diff --git a/Ausgabe/common/images/callouts/3.png b/Ausgabe/common/images/callouts/3.png
new file mode 100755
index 0000000000000000000000000000000000000000..ef7b70047158970cf4e09f1bab2954d39c2d596b
Binary files /dev/null and b/Ausgabe/common/images/callouts/3.png differ
diff --git a/Ausgabe/common/images/callouts/4.png b/Ausgabe/common/images/callouts/4.png
new file mode 100755
index 0000000000000000000000000000000000000000..adb8364eb5d21ecdd4086e16110b62ddcb42aa4a
Binary files /dev/null and b/Ausgabe/common/images/callouts/4.png differ
diff --git a/Ausgabe/common/images/callouts/5.png b/Ausgabe/common/images/callouts/5.png
new file mode 100755
index 0000000000000000000000000000000000000000..4d7eb460021e845981861d77614539314f553993
Binary files /dev/null and b/Ausgabe/common/images/callouts/5.png differ
diff --git a/Ausgabe/common/images/callouts/6.png b/Ausgabe/common/images/callouts/6.png
new file mode 100755
index 0000000000000000000000000000000000000000..0ba694af6c07d947d219b45a629bd32c60a0f5fe
Binary files /dev/null and b/Ausgabe/common/images/callouts/6.png differ
diff --git a/Ausgabe/common/images/callouts/7.png b/Ausgabe/common/images/callouts/7.png
new file mode 100755
index 0000000000000000000000000000000000000000..472e96f8ac36862c5645732f2fff19d06ee11a8e
Binary files /dev/null and b/Ausgabe/common/images/callouts/7.png differ
diff --git a/Ausgabe/common/images/callouts/8.png b/Ausgabe/common/images/callouts/8.png
new file mode 100755
index 0000000000000000000000000000000000000000..5e60973c213b37df93666c5a00724f34493974ae
Binary files /dev/null and b/Ausgabe/common/images/callouts/8.png differ
diff --git a/Ausgabe/common/images/callouts/9.png b/Ausgabe/common/images/callouts/9.png
new file mode 100755
index 0000000000000000000000000000000000000000..a0676d26cc2ff1de12c4ecdeefb44a0d71bc6bde
Binary files /dev/null and b/Ausgabe/common/images/callouts/9.png differ
diff --git a/Ausgabe/common/images/callouts/ChangeLog b/Ausgabe/common/images/callouts/ChangeLog
new file mode 100755
index 0000000000000000000000000000000000000000..3bfd951e344a2454137daed2e88861fdd10af1b6
--- /dev/null
+++ b/Ausgabe/common/images/callouts/ChangeLog
@@ -0,0 +1,15 @@
+2002-05-17 Norman Walsh
+
+ * 11.gif, 11.png, 12.gif, 12.png, 13.gif, 13.png, 14.gif, 14.png, 15.gif, 15.png:
+ New file.
+
+2002-01-28 Norman Walsh
+
+ * 1.gif, 10.gif, 2.gif, 3.gif, 4.gif, 5.gif, 6.gif, 7.gif, 8.gif, 9.gif:
+ New file.
+
+2001-04-02 Norman Walsh
+
+ * 1.png, 10.png, 2.png, 3.png, 4.png, 5.png, 6.png, 7.png, 8.png, 9.png:
+ New file.
+
diff --git a/Ausgabe/common/images/caution.png b/Ausgabe/common/images/caution.png
new file mode 100755
index 0000000000000000000000000000000000000000..5b7809ca4a9c8d778087522e5ce04b6e90099595
Binary files /dev/null and b/Ausgabe/common/images/caution.png differ
diff --git a/Ausgabe/common/images/changelog b/Ausgabe/common/images/changelog
new file mode 100755
index 0000000000000000000000000000000000000000..07c29d35420d20ec59913864764cd06b8bf98163
--- /dev/null
+++ b/Ausgabe/common/images/changelog
@@ -0,0 +1,17 @@
+2002-02-11 Norman Walsh
+
+ * draft.png: Updated draft image
+
+2002-01-29 Norman Walsh
+
+ * blank.png, draft.png: New file.
+
+2001-11-06 Robert Stayton
+
+ * home.gif, next.gif, prev.gif, up.gif: New file.
+
+2001-04-02 Norman Walsh
+
+ * caution.gif, caution.png, caution.tif, home.png, important.gif, important.png, important.tif, next.png, note.gif, note.png, note.tif, prev.png, tip.gif, tip.png, tip.tif, toc-blank.png, toc-minus.png, toc-plus.png, up.png, warning.gif, warning.png, warning.tif:
+ New file.
+
diff --git a/Ausgabe/common/images/draft.png b/Ausgabe/common/images/draft.png
new file mode 100755
index 0000000000000000000000000000000000000000..0084708c9b8287c51efa6b40b8d492854191455e
Binary files /dev/null and b/Ausgabe/common/images/draft.png differ
diff --git a/Ausgabe/common/images/firebird_logo_400x400.png b/Ausgabe/common/images/firebird_logo_400x400.png
new file mode 100755
index 0000000000000000000000000000000000000000..7330af107c60e76469a7578b60de5fb041be6559
Binary files /dev/null and b/Ausgabe/common/images/firebird_logo_400x400.png differ
diff --git a/Ausgabe/common/images/home.png b/Ausgabe/common/images/home.png
new file mode 100755
index 0000000000000000000000000000000000000000..cbb711de712dcf06597a3a8a3d95f6fefda1f245
Binary files /dev/null and b/Ausgabe/common/images/home.png differ
diff --git a/Ausgabe/common/images/important.png b/Ausgabe/common/images/important.png
new file mode 100755
index 0000000000000000000000000000000000000000..12c90f607a1b27ddde0a7d922ae255e8c90e883e
Binary files /dev/null and b/Ausgabe/common/images/important.png differ
diff --git a/Ausgabe/common/images/next.png b/Ausgabe/common/images/next.png
new file mode 100755
index 0000000000000000000000000000000000000000..45835bf89ac0eca3ad69c4d8397cd5edad2f8782
Binary files /dev/null and b/Ausgabe/common/images/next.png differ
diff --git a/Ausgabe/common/images/note.png b/Ausgabe/common/images/note.png
new file mode 100755
index 0000000000000000000000000000000000000000..d0c3c645ab9af6318035b026dd86944b9ddc9114
Binary files /dev/null and b/Ausgabe/common/images/note.png differ
diff --git a/Ausgabe/common/images/note_22.png b/Ausgabe/common/images/note_22.png
new file mode 100755
index 0000000000000000000000000000000000000000..d0c3c645ab9af6318035b026dd86944b9ddc9114
Binary files /dev/null and b/Ausgabe/common/images/note_22.png differ
diff --git a/Ausgabe/common/images/prev.png b/Ausgabe/common/images/prev.png
new file mode 100755
index 0000000000000000000000000000000000000000..cf24654f8a9d6826bf5ee3f6b640d0b34f44d2ed
Binary files /dev/null and b/Ausgabe/common/images/prev.png differ
diff --git a/Ausgabe/common/images/tip.png b/Ausgabe/common/images/tip.png
new file mode 100755
index 0000000000000000000000000000000000000000..5c4aab3bb3543191c360387c4af9a3cbaa051345
Binary files /dev/null and b/Ausgabe/common/images/tip.png differ
diff --git a/Ausgabe/common/images/toc-blank.png b/Ausgabe/common/images/toc-blank.png
new file mode 100755
index 0000000000000000000000000000000000000000..6ffad17a0c7a78deaae58716e8071cc40cb0b8e0
Binary files /dev/null and b/Ausgabe/common/images/toc-blank.png differ
diff --git a/Ausgabe/common/images/toc-minus.png b/Ausgabe/common/images/toc-minus.png
new file mode 100755
index 0000000000000000000000000000000000000000..abbb020c8e2d6705ebc2f0fc17deed30f2977a46
Binary files /dev/null and b/Ausgabe/common/images/toc-minus.png differ
diff --git a/Ausgabe/common/images/toc-plus.png b/Ausgabe/common/images/toc-plus.png
new file mode 100755
index 0000000000000000000000000000000000000000..941312ce0dab168e0efcc5b572e387259880e541
Binary files /dev/null and b/Ausgabe/common/images/toc-plus.png differ
diff --git a/Ausgabe/common/images/up.png b/Ausgabe/common/images/up.png
new file mode 100755
index 0000000000000000000000000000000000000000..07634de26b325b09b6686543e3743ec58426e64b
Binary files /dev/null and b/Ausgabe/common/images/up.png differ
diff --git a/Ausgabe/common/images/warning.png b/Ausgabe/common/images/warning.png
new file mode 100755
index 0000000000000000000000000000000000000000..1c33db8f34a8b42b373179b46a2d8d8a10e061a9
Binary files /dev/null and b/Ausgabe/common/images/warning.png differ
diff --git a/Ausgabe/common/lib/jquery-1.10.1.min.js b/Ausgabe/common/lib/jquery-1.10.1.min.js
new file mode 100755
index 0000000000000000000000000000000000000000..e407e7699240159f728d40f453901aa3eaf6ab8e
--- /dev/null
+++ b/Ausgabe/common/lib/jquery-1.10.1.min.js
@@ -0,0 +1,6 @@
+/*! jQuery v1.10.1 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license
+//@ sourceMappingURL=jquery-1.10.1.min.map
+*/
+(function(e,t){var n,r,i=typeof t,o=e.location,a=e.document,s=a.documentElement,l=e.jQuery,u=e.$,c={},p=[],f="1.10.1",d=p.concat,h=p.push,g=p.slice,m=p.indexOf,y=c.toString,v=c.hasOwnProperty,b=f.trim,x=function(e,t){return new x.fn.init(e,t,r)},w=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=/\S+/g,C=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,k=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,E=/^[\],:{}\s]*$/,S=/(?:^|:|,)(?:\s*\[)+/g,A=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,j=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,D=/^-ms-/,L=/-([\da-z])/gi,H=function(e,t){return t.toUpperCase()},q=function(e){(a.addEventListener||"load"===e.type||"complete"===a.readyState)&&(_(),x.ready())},_=function(){a.addEventListener?(a.removeEventListener("DOMContentLoaded",q,!1),e.removeEventListener("load",q,!1)):(a.detachEvent("onreadystatechange",q),e.detachEvent("onload",q))};x.fn=x.prototype={jquery:f,constructor:x,init:function(e,n,r){var i,o;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof x?n[0]:n,x.merge(this,x.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:a,!0)),k.test(i[1])&&x.isPlainObject(n))for(i in n)x.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(o=a.getElementById(i[2]),o&&o.parentNode){if(o.id!==i[2])return r.find(e);this.length=1,this[0]=o}return this.context=a,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):x.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),x.makeArray(e,this))},selector:"",length:0,toArray:function(){return g.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=x.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return x.each(this,e,t)},ready:function(e){return x.ready.promise().done(e),this},slice:function(){return this.pushStack(g.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(x.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:h,sort:[].sort,splice:[].splice},x.fn.init.prototype=x.fn,x.extend=x.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),"object"==typeof s||x.isFunction(s)||(s={}),u===l&&(s=this,--l);u>l;l++)if(null!=(o=arguments[l]))for(i in o)e=s[i],r=o[i],s!==r&&(c&&r&&(x.isPlainObject(r)||(n=x.isArray(r)))?(n?(n=!1,a=e&&x.isArray(e)?e:[]):a=e&&x.isPlainObject(e)?e:{},s[i]=x.extend(c,a,r)):r!==t&&(s[i]=r));return s},x.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),noConflict:function(t){return e.$===x&&(e.$=u),t&&e.jQuery===x&&(e.jQuery=l),x},isReady:!1,readyWait:1,holdReady:function(e){e?x.readyWait++:x.ready(!0)},ready:function(e){if(e===!0?!--x.readyWait:!x.isReady){if(!a.body)return setTimeout(x.ready);x.isReady=!0,e!==!0&&--x.readyWait>0||(n.resolveWith(a,[x]),x.fn.trigger&&x(a).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===x.type(e)},isArray:Array.isArray||function(e){return"array"===x.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?c[y.call(e)]||"object":typeof e},isPlainObject:function(e){var n;if(!e||"object"!==x.type(e)||e.nodeType||x.isWindow(e))return!1;try{if(e.constructor&&!v.call(e,"constructor")&&!v.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(r){return!1}if(x.support.ownLast)for(n in e)return v.call(e,n);for(n in e);return n===t||v.call(e,n)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||a;var r=k.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=x.buildFragment([e],t,i),i&&x(i).remove(),x.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=x.trim(n),n&&E.test(n.replace(A,"@").replace(j,"]").replace(S,"")))?Function("return "+n)():(x.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||x.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&x.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(D,"ms-").replace(L,H)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,a=M(e);if(n){if(a){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(a){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:b&&!b.call("\ufeff\u00a0")?function(e){return null==e?"":b.call(e)}:function(e){return null==e?"":(e+"").replace(C,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(M(Object(e))?x.merge(n,"string"==typeof e?[e]:e):h.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(m)return m.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else while(n[o]!==t)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,a=M(e),s=[];if(a)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(s[s.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(s[s.length]=r);return d.apply([],s)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(o=e[n],n=e,e=o),x.isFunction(e)?(r=g.call(arguments,2),i=function(){return e.apply(n||this,r.concat(g.call(arguments)))},i.guid=e.guid=e.guid||x.guid++,i):t},access:function(e,n,r,i,o,a,s){var l=0,u=e.length,c=null==r;if("object"===x.type(r)){o=!0;for(l in r)x.access(e,n,l,r[l],!0,a,s)}else if(i!==t&&(o=!0,x.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(x(e),n)})),n))for(;u>l;l++)n(e[l],r,s?i:i.call(e[l],l,n(e[l],r)));return o?e:c?n.call(e):u?n(e[0],r):a},now:function(){return(new Date).getTime()},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),x.ready.promise=function(t){if(!n)if(n=x.Deferred(),"complete"===a.readyState)setTimeout(x.ready);else if(a.addEventListener)a.addEventListener("DOMContentLoaded",q,!1),e.addEventListener("load",q,!1);else{a.attachEvent("onreadystatechange",q),e.attachEvent("onload",q);var r=!1;try{r=null==e.frameElement&&a.documentElement}catch(i){}r&&r.doScroll&&function o(){if(!x.isReady){try{r.doScroll("left")}catch(e){return setTimeout(o,50)}_(),x.ready()}}()}return n.promise(t)},x.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){c["[object "+t+"]"]=t.toLowerCase()});function M(e){var t=e.length,n=x.type(e);return x.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}r=x(a),function(e,t){var n,r,i,o,a,s,l,u,c,p,f,d,h,g,m,y,v,b="sizzle"+-new Date,w=e.document,T=0,C=0,N=lt(),k=lt(),E=lt(),S=!1,A=function(){return 0},j=typeof t,D=1<<31,L={}.hasOwnProperty,H=[],q=H.pop,_=H.push,M=H.push,O=H.slice,F=H.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},B="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",P="[\\x20\\t\\r\\n\\f]",R="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",W=R.replace("w","w#"),$="\\["+P+"*("+R+")"+P+"*(?:([*^$|!~]?=)"+P+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+W+")|)|)"+P+"*\\]",I=":("+R+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+$.replace(3,8)+")*)|.*)\\)|)",z=RegExp("^"+P+"+|((?:^|[^\\\\])(?:\\\\.)*)"+P+"+$","g"),X=RegExp("^"+P+"*,"+P+"*"),U=RegExp("^"+P+"*([>+~]|"+P+")"+P+"*"),V=RegExp(P+"*[+~]"),Y=RegExp("="+P+"*([^\\]'\"]*)"+P+"*\\]","g"),J=RegExp(I),G=RegExp("^"+W+"$"),Q={ID:RegExp("^#("+R+")"),CLASS:RegExp("^\\.("+R+")"),TAG:RegExp("^("+R.replace("w","w*")+")"),ATTR:RegExp("^"+$),PSEUDO:RegExp("^"+I),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+P+"*(even|odd|(([+-]|)(\\d*)n|)"+P+"*(?:([+-]|)"+P+"*(\\d+)|))"+P+"*\\)|)","i"),bool:RegExp("^(?:"+B+")$","i"),needsContext:RegExp("^"+P+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+P+"*((?:-\\d)?\\d*)"+P+"*\\)|)(?=[^-]|$)","i")},K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,et=/^(?:input|select|textarea|button)$/i,tt=/^h\d$/i,nt=/'|\\/g,rt=RegExp("\\\\([\\da-f]{1,6}"+P+"?|("+P+")|.)","ig"),it=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(55296|r>>10,56320|1023&r)};try{M.apply(H=O.call(w.childNodes),w.childNodes),H[w.childNodes.length].nodeType}catch(ot){M={apply:H.length?function(e,t){_.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function at(e,t,n,i){var o,a,s,l,u,c,d,m,y,x;if((t?t.ownerDocument||t:w)!==f&&p(t),t=t||f,n=n||[],!e||"string"!=typeof e)return n;if(1!==(l=t.nodeType)&&9!==l)return[];if(h&&!i){if(o=Z.exec(e))if(s=o[1]){if(9===l){if(a=t.getElementById(s),!a||!a.parentNode)return n;if(a.id===s)return n.push(a),n}else if(t.ownerDocument&&(a=t.ownerDocument.getElementById(s))&&v(t,a)&&a.id===s)return n.push(a),n}else{if(o[2])return M.apply(n,t.getElementsByTagName(e)),n;if((s=o[3])&&r.getElementsByClassName&&t.getElementsByClassName)return M.apply(n,t.getElementsByClassName(s)),n}if(r.qsa&&(!g||!g.test(e))){if(m=d=b,y=t,x=9===l&&e,1===l&&"object"!==t.nodeName.toLowerCase()){c=bt(e),(d=t.getAttribute("id"))?m=d.replace(nt,"\\$&"):t.setAttribute("id",m),m="[id='"+m+"'] ",u=c.length;while(u--)c[u]=m+xt(c[u]);y=V.test(e)&&t.parentNode||t,x=c.join(",")}if(x)try{return M.apply(n,y.querySelectorAll(x)),n}catch(T){}finally{d||t.removeAttribute("id")}}}return At(e.replace(z,"$1"),t,n,i)}function st(e){return K.test(e+"")}function lt(){var e=[];function t(n,r){return e.push(n+=" ")>o.cacheLength&&delete t[e.shift()],t[n]=r}return t}function ut(e){return e[b]=!0,e}function ct(e){var t=f.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function pt(e,t,n){e=e.split("|");var r,i=e.length,a=n?null:t;while(i--)(r=o.attrHandle[e[i]])&&r!==t||(o.attrHandle[e[i]]=a)}function ft(e,t){var n=e.getAttributeNode(t);return n&&n.specified?n.value:e[t]===!0?t.toLowerCase():null}function dt(e,t){return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}function ht(e){return"input"===e.nodeName.toLowerCase()?e.defaultValue:t}function gt(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||D)-(~e.sourceIndex||D);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function mt(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function yt(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function vt(e){return ut(function(t){return t=+t,ut(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}s=at.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},r=at.support={},p=at.setDocument=function(e){var n=e?e.ownerDocument||e:w,i=n.parentWindow;return n!==f&&9===n.nodeType&&n.documentElement?(f=n,d=n.documentElement,h=!s(n),i&&i.frameElement&&i.attachEvent("onbeforeunload",function(){p()}),r.attributes=ct(function(e){return e.innerHTML="",pt("type|href|height|width",dt,"#"===e.firstChild.getAttribute("href")),pt(B,ft,null==e.getAttribute("disabled")),e.className="i",!e.getAttribute("className")}),r.input=ct(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")}),pt("value",ht,r.attributes&&r.input),r.getElementsByTagName=ct(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),r.getElementsByClassName=ct(function(e){return e.innerHTML="",e.firstChild.className="i",2===e.getElementsByClassName("i").length}),r.getById=ct(function(e){return d.appendChild(e).id=b,!n.getElementsByName||!n.getElementsByName(b).length}),r.getById?(o.find.ID=function(e,t){if(typeof t.getElementById!==j&&h){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){return e.getAttribute("id")===t}}):(delete o.find.ID,o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){var n=typeof e.getAttributeNode!==j&&e.getAttributeNode("id");return n&&n.value===t}}),o.find.TAG=r.getElementsByTagName?function(e,n){return typeof n.getElementsByTagName!==j?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},o.find.CLASS=r.getElementsByClassName&&function(e,n){return typeof n.getElementsByClassName!==j&&h?n.getElementsByClassName(e):t},m=[],g=[],(r.qsa=st(n.querySelectorAll))&&(ct(function(e){e.innerHTML="",e.querySelectorAll("[selected]").length||g.push("\\["+P+"*(?:value|"+B+")"),e.querySelectorAll(":checked").length||g.push(":checked")}),ct(function(e){var t=n.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("t",""),e.querySelectorAll("[t^='']").length&&g.push("[*^$]="+P+"*(?:''|\"\")"),e.querySelectorAll(":enabled").length||g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")})),(r.matchesSelector=st(y=d.webkitMatchesSelector||d.mozMatchesSelector||d.oMatchesSelector||d.msMatchesSelector))&&ct(function(e){r.disconnectedMatch=y.call(e,"div"),y.call(e,"[s!='']:x"),m.push("!=",I)}),g=g.length&&RegExp(g.join("|")),m=m.length&&RegExp(m.join("|")),v=st(d.contains)||d.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},r.sortDetached=ct(function(e){return 1&e.compareDocumentPosition(n.createElement("div"))}),A=d.compareDocumentPosition?function(e,t){if(e===t)return S=!0,0;var i=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t);return i?1&i||!r.sortDetached&&t.compareDocumentPosition(e)===i?e===n||v(w,e)?-1:t===n||v(w,t)?1:c?F.call(c,e)-F.call(c,t):0:4&i?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,o=e.parentNode,a=t.parentNode,s=[e],l=[t];if(e===t)return S=!0,0;if(!o||!a)return e===n?-1:t===n?1:o?-1:a?1:c?F.call(c,e)-F.call(c,t):0;if(o===a)return gt(e,t);r=e;while(r=r.parentNode)s.unshift(r);r=t;while(r=r.parentNode)l.unshift(r);while(s[i]===l[i])i++;return i?gt(s[i],l[i]):s[i]===w?-1:l[i]===w?1:0},n):f},at.matches=function(e,t){return at(e,null,null,t)},at.matchesSelector=function(e,t){if((e.ownerDocument||e)!==f&&p(e),t=t.replace(Y,"='$1']"),!(!r.matchesSelector||!h||m&&m.test(t)||g&&g.test(t)))try{var n=y.call(e,t);if(n||r.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(i){}return at(t,f,null,[e]).length>0},at.contains=function(e,t){return(e.ownerDocument||e)!==f&&p(e),v(e,t)},at.attr=function(e,n){(e.ownerDocument||e)!==f&&p(e);var i=o.attrHandle[n.toLowerCase()],a=i&&L.call(o.attrHandle,n.toLowerCase())?i(e,n,!h):t;return a===t?r.attributes||!h?e.getAttribute(n):(a=e.getAttributeNode(n))&&a.specified?a.value:null:a},at.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},at.uniqueSort=function(e){var t,n=[],i=0,o=0;if(S=!r.detectDuplicates,c=!r.sortStable&&e.slice(0),e.sort(A),S){while(t=e[o++])t===e[o]&&(i=n.push(o));while(i--)e.splice(n[i],1)}return e},a=at.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=a(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=a(t);return n},o=at.selectors={cacheLength:50,createPseudo:ut,match:Q,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(rt,it),e[3]=(e[4]||e[5]||"").replace(rt,it),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||at.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&at.error(e[0]),e},PSEUDO:function(e){var n,r=!e[5]&&e[2];return Q.CHILD.test(e[0])?null:(e[3]&&e[4]!==t?e[2]=e[4]:r&&J.test(r)&&(n=bt(r,!0))&&(n=r.indexOf(")",r.length-n)-r.length)&&(e[0]=e[0].slice(0,n),e[2]=r.slice(0,n)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(rt,it).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=N[e+" "];return t||(t=RegExp("(^|"+P+")"+e+"("+P+"|$)"))&&N(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==j&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=at.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var u,c,p,f,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!l&&!s;if(m){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){c=m[b]||(m[b]={}),u=c[e]||[],d=u[0]===T&&u[1],f=u[0]===T&&u[2],p=d&&m.childNodes[d];while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if(1===p.nodeType&&++f&&p===t){c[e]=[T,d,f];break}}else if(v&&(u=(t[b]||(t[b]={}))[e])&&u[0]===T)f=u[1];else while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===y:1===p.nodeType)&&++f&&(v&&((p[b]||(p[b]={}))[e]=[T,f]),p===t))break;return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=o.pseudos[e]||o.setFilters[e.toLowerCase()]||at.error("unsupported pseudo: "+e);return r[b]?r(t):r.length>1?(n=[e,e,"",t],o.setFilters.hasOwnProperty(e.toLowerCase())?ut(function(e,n){var i,o=r(e,t),a=o.length;while(a--)i=F.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:ut(function(e){var t=[],n=[],r=l(e.replace(z,"$1"));return r[b]?ut(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:ut(function(e){return function(t){return at(e,t).length>0}}),contains:ut(function(e){return function(t){return(t.textContent||t.innerText||a(t)).indexOf(e)>-1}}),lang:ut(function(e){return G.test(e||"")||at.error("unsupported lang: "+e),e=e.replace(rt,it).toLowerCase(),function(t){var n;do if(n=h?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===d},focus:function(e){return e===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!o.pseudos.empty(e)},header:function(e){return tt.test(e.nodeName)},input:function(e){return et.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:vt(function(){return[0]}),last:vt(function(e,t){return[t-1]}),eq:vt(function(e,t,n){return[0>n?n+t:n]}),even:vt(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:vt(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:vt(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:vt(function(e,t,n){var r=0>n?n+t:n;for(;t>++r;)e.push(r);return e})}};for(n in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})o.pseudos[n]=mt(n);for(n in{submit:!0,reset:!0})o.pseudos[n]=yt(n);function bt(e,t){var n,r,i,a,s,l,u,c=k[e+" "];if(c)return t?0:c.slice(0);s=e,l=[],u=o.preFilter;while(s){(!n||(r=X.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),l.push(i=[])),n=!1,(r=U.exec(s))&&(n=r.shift(),i.push({value:n,type:r[0].replace(z," ")}),s=s.slice(n.length));for(a in o.filter)!(r=Q[a].exec(s))||u[a]&&!(r=u[a](r))||(n=r.shift(),i.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?at.error(e):k(e,l).slice(0)}function xt(e){var t=0,n=e.length,r="";for(;n>t;t++)r+=e[t].value;return r}function wt(e,t,n){var r=t.dir,o=n&&"parentNode"===r,a=C++;return t.first?function(t,n,i){while(t=t[r])if(1===t.nodeType||o)return e(t,n,i)}:function(t,n,s){var l,u,c,p=T+" "+a;if(s){while(t=t[r])if((1===t.nodeType||o)&&e(t,n,s))return!0}else while(t=t[r])if(1===t.nodeType||o)if(c=t[b]||(t[b]={}),(u=c[r])&&u[0]===p){if((l=u[1])===!0||l===i)return l===!0}else if(u=c[r]=[p],u[1]=e(t,n,s)||i,u[1]===!0)return!0}}function Tt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function Ct(e,t,n,r,i){var o,a=[],s=0,l=e.length,u=null!=t;for(;l>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),u&&t.push(s));return a}function Nt(e,t,n,r,i,o){return r&&!r[b]&&(r=Nt(r)),i&&!i[b]&&(i=Nt(i,o)),ut(function(o,a,s,l){var u,c,p,f=[],d=[],h=a.length,g=o||St(t||"*",s.nodeType?[s]:s,[]),m=!e||!o&&t?g:Ct(g,f,e,s,l),y=n?i||(o?e:h||r)?[]:a:m;if(n&&n(m,y,s,l),r){u=Ct(y,d),r(u,[],s,l),c=u.length;while(c--)(p=u[c])&&(y[d[c]]=!(m[d[c]]=p))}if(o){if(i||e){if(i){u=[],c=y.length;while(c--)(p=y[c])&&u.push(m[c]=p);i(null,y=[],u,l)}c=y.length;while(c--)(p=y[c])&&(u=i?F.call(o,p):f[c])>-1&&(o[u]=!(a[u]=p))}}else y=Ct(y===a?y.splice(h,y.length):y),i?i(null,a,y,l):M.apply(a,y)})}function kt(e){var t,n,r,i=e.length,a=o.relative[e[0].type],s=a||o.relative[" "],l=a?1:0,c=wt(function(e){return e===t},s,!0),p=wt(function(e){return F.call(t,e)>-1},s,!0),f=[function(e,n,r){return!a&&(r||n!==u)||((t=n).nodeType?c(e,n,r):p(e,n,r))}];for(;i>l;l++)if(n=o.relative[e[l].type])f=[wt(Tt(f),n)];else{if(n=o.filter[e[l].type].apply(null,e[l].matches),n[b]){for(r=++l;i>r;r++)if(o.relative[e[r].type])break;return Nt(l>1&&Tt(f),l>1&&xt(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(z,"$1"),n,r>l&&kt(e.slice(l,r)),i>r&&kt(e=e.slice(r)),i>r&&xt(e))}f.push(n)}return Tt(f)}function Et(e,t){var n=0,r=t.length>0,a=e.length>0,s=function(s,l,c,p,d){var h,g,m,y=[],v=0,b="0",x=s&&[],w=null!=d,C=u,N=s||a&&o.find.TAG("*",d&&l.parentNode||l),k=T+=null==C?1:Math.random()||.1;for(w&&(u=l!==f&&l,i=n);null!=(h=N[b]);b++){if(a&&h){g=0;while(m=e[g++])if(m(h,l,c)){p.push(h);break}w&&(T=k,i=++n)}r&&((h=!m&&h)&&v--,s&&x.push(h))}if(v+=b,r&&b!==v){g=0;while(m=t[g++])m(x,y,l,c);if(s){if(v>0)while(b--)x[b]||y[b]||(y[b]=q.call(p));y=Ct(y)}M.apply(p,y),w&&!s&&y.length>0&&v+t.length>1&&at.uniqueSort(p)}return w&&(T=k,u=C),x};return r?ut(s):s}l=at.compile=function(e,t){var n,r=[],i=[],o=E[e+" "];if(!o){t||(t=bt(e)),n=t.length;while(n--)o=kt(t[n]),o[b]?r.push(o):i.push(o);o=E(e,Et(i,r))}return o};function St(e,t,n){var r=0,i=t.length;for(;i>r;r++)at(e,t[r],n);return n}function At(e,t,n,i){var a,s,u,c,p,f=bt(e);if(!i&&1===f.length){if(s=f[0]=f[0].slice(0),s.length>2&&"ID"===(u=s[0]).type&&r.getById&&9===t.nodeType&&h&&o.relative[s[1].type]){if(t=(o.find.ID(u.matches[0].replace(rt,it),t)||[])[0],!t)return n;e=e.slice(s.shift().value.length)}a=Q.needsContext.test(e)?0:s.length;while(a--){if(u=s[a],o.relative[c=u.type])break;if((p=o.find[c])&&(i=p(u.matches[0].replace(rt,it),V.test(s[0].type)&&t.parentNode||t))){if(s.splice(a,1),e=i.length&&xt(s),!e)return M.apply(n,i),n;break}}}return l(e,f)(i,t,!h,n,V.test(e)),n}o.pseudos.nth=o.pseudos.eq;function jt(){}jt.prototype=o.filters=o.pseudos,o.setFilters=new jt,r.sortStable=b.split("").sort(A).join("")===b,p(),[0,0].sort(A),r.detectDuplicates=S,x.find=at,x.expr=at.selectors,x.expr[":"]=x.expr.pseudos,x.unique=at.uniqueSort,x.text=at.getText,x.isXMLDoc=at.isXML,x.contains=at.contains}(e);var O={};function F(e){var t=O[e]={};return x.each(e.match(T)||[],function(e,n){t[n]=!0}),t}x.Callbacks=function(e){e="string"==typeof e?O[e]||F(e):x.extend({},e);var n,r,i,o,a,s,l=[],u=!e.once&&[],c=function(t){for(r=e.memory&&t,i=!0,a=s||0,s=0,o=l.length,n=!0;l&&o>a;a++)if(l[a].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,l&&(u?u.length&&c(u.shift()):r?l=[]:p.disable())},p={add:function(){if(l){var t=l.length;(function i(t){x.each(t,function(t,n){var r=x.type(n);"function"===r?e.unique&&p.has(n)||l.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=l.length:r&&(s=t,c(r))}return this},remove:function(){return l&&x.each(arguments,function(e,t){var r;while((r=x.inArray(t,l,r))>-1)l.splice(r,1),n&&(o>=r&&o--,a>=r&&a--)}),this},has:function(e){return e?x.inArray(e,l)>-1:!(!l||!l.length)},empty:function(){return l=[],o=0,this},disable:function(){return l=u=r=t,this},disabled:function(){return!l},lock:function(){return u=t,r||p.disable(),this},locked:function(){return!u},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],!l||i&&!u||(n?u.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},x.extend({Deferred:function(e){var t=[["resolve","done",x.Callbacks("once memory"),"resolved"],["reject","fail",x.Callbacks("once memory"),"rejected"],["notify","progress",x.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return x.Deferred(function(n){x.each(t,function(t,o){var a=o[0],s=x.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&x.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?x.extend(e,r):r}},i={};return r.pipe=r.then,x.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=g.call(arguments),r=n.length,i=1!==r||e&&x.isFunction(e.promise)?r:0,o=1===i?e:x.Deferred(),a=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?g.call(arguments):r,n===s?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},s,l,u;if(r>1)for(s=Array(r),l=Array(r),u=Array(r);r>t;t++)n[t]&&x.isFunction(n[t].promise)?n[t].promise().done(a(t,u,n)).fail(o.reject).progress(a(t,l,s)):--i;return i||o.resolveWith(u,n),o.promise()}}),x.support=function(t){var n,r,o,s,l,u,c,p,f,d=a.createElement("div");if(d.setAttribute("className","t"),d.innerHTML="
a",n=d.getElementsByTagName("*")||[],r=d.getElementsByTagName("a")[0],!r||!r.style||!n.length)return t;s=a.createElement("select"),u=s.appendChild(a.createElement("option")),o=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t.getSetAttribute="t"!==d.className,t.leadingWhitespace=3===d.firstChild.nodeType,t.tbody=!d.getElementsByTagName("tbody").length,t.htmlSerialize=!!d.getElementsByTagName("link").length,t.style=/top/.test(r.getAttribute("style")),t.hrefNormalized="/a"===r.getAttribute("href"),t.opacity=/^0.5/.test(r.style.opacity),t.cssFloat=!!r.style.cssFloat,t.checkOn=!!o.value,t.optSelected=u.selected,t.enctype=!!a.createElement("form").enctype,t.html5Clone="<:nav>"!==a.createElement("nav").cloneNode(!0).outerHTML,t.inlineBlockNeedsLayout=!1,t.shrinkWrapBlocks=!1,t.pixelPosition=!1,t.deleteExpando=!0,t.noCloneEvent=!0,t.reliableMarginRight=!0,t.boxSizingReliable=!0,o.checked=!0,t.noCloneChecked=o.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!u.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}o=a.createElement("input"),o.setAttribute("value",""),t.input=""===o.getAttribute("value"),o.value="t",o.setAttribute("type","radio"),t.radioValue="t"===o.value,o.setAttribute("checked","t"),o.setAttribute("name","t"),l=a.createDocumentFragment(),l.appendChild(o),t.appendChecked=o.checked,t.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bubbles"]=c in e||d.attributes[c].expando===!1;d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip;for(f in x(t))break;return t.ownLast="0"!==f,x(function(){var n,r,o,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",l=a.getElementsByTagName("body")[0];l&&(n=a.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",l.appendChild(n).appendChild(d),d.innerHTML="