diff --git a/Rakefile b/Rakefile index 66e273b..decba5d 100644 --- a/Rakefile +++ b/Rakefile @@ -45,7 +45,7 @@ task :update do def convert css = asset('fotorama.css') - scss = asset('fotorama.css.scss') + scss = asset('fotorama.scss') scss.open('w') do |io| io << css.read diff --git a/lib/fotoramajs/version.rb b/lib/fotoramajs/version.rb index 1222b4a..39fb885 100644 --- a/lib/fotoramajs/version.rb +++ b/lib/fotoramajs/version.rb @@ -1,3 +1,3 @@ module Fotoramajs - VERSION = "4.6.3.2" + VERSION = "4.6.4" end diff --git a/vendor/assets/javascripts/fotorama.js b/vendor/assets/javascripts/fotorama.js index 29536b2..5081132 100644 --- a/vendor/assets/javascripts/fotorama.js +++ b/vendor/assets/javascripts/fotorama.js @@ -1,3705 +1,5 @@ /*! - * Fotorama 4.6.3 | http://fotorama.io/license/ + * Fotorama 4.6.4 | http://fotorama.io/license/ */ -fotoramaVersion = '4.6.3'; -(function (window, document, location, $, undefined) { - "use strict"; -var _fotoramaClass = 'fotorama', - _fullscreenClass = 'fullscreen', - - wrapClass = _fotoramaClass + '__wrap', - wrapCss2Class = wrapClass + '--css2', - wrapCss3Class = wrapClass + '--css3', - wrapVideoClass = wrapClass + '--video', - wrapFadeClass = wrapClass + '--fade', - wrapSlideClass = wrapClass + '--slide', - wrapNoControlsClass = wrapClass + '--no-controls', - wrapNoShadowsClass = wrapClass + '--no-shadows', - wrapPanYClass = wrapClass + '--pan-y', - wrapRtlClass = wrapClass + '--rtl', - wrapOnlyActiveClass = wrapClass + '--only-active', - wrapNoCaptionsClass = wrapClass + '--no-captions', - wrapToggleArrowsClass = wrapClass + '--toggle-arrows', - - stageClass = _fotoramaClass + '__stage', - stageFrameClass = stageClass + '__frame', - stageFrameVideoClass = stageFrameClass + '--video', - stageShaftClass = stageClass + '__shaft', - - grabClass = _fotoramaClass + '__grab', - pointerClass = _fotoramaClass + '__pointer', - - arrClass = _fotoramaClass + '__arr', - arrDisabledClass = arrClass + '--disabled', - arrPrevClass = arrClass + '--prev', - arrNextClass = arrClass + '--next', - arrArrClass = arrClass + '__arr', - - navClass = _fotoramaClass + '__nav', - navWrapClass = navClass + '-wrap', - navShaftClass = navClass + '__shaft', - navDotsClass = navClass + '--dots', - navThumbsClass = navClass + '--thumbs', - navFrameClass = navClass + '__frame', - navFrameDotClass = navFrameClass + '--dot', - navFrameThumbClass = navFrameClass + '--thumb', - - fadeClass = _fotoramaClass + '__fade', - fadeFrontClass = fadeClass + '-front', - fadeRearClass = fadeClass + '-rear', - - shadowClass = _fotoramaClass + '__shadow', - shadowsClass = shadowClass + 's', - shadowsLeftClass = shadowsClass + '--left', - shadowsRightClass = shadowsClass + '--right', - - activeClass = _fotoramaClass + '__active', - selectClass = _fotoramaClass + '__select', - - hiddenClass = _fotoramaClass + '--hidden', - - fullscreenClass = _fotoramaClass + '--fullscreen', - fullscreenIconClass = _fotoramaClass + '__fullscreen-icon', - - errorClass = _fotoramaClass + '__error', - loadingClass = _fotoramaClass + '__loading', - loadedClass = _fotoramaClass + '__loaded', - loadedFullClass = loadedClass + '--full', - loadedImgClass = loadedClass + '--img', - - grabbingClass = _fotoramaClass + '__grabbing', - - imgClass = _fotoramaClass + '__img', - imgFullClass = imgClass + '--full', - - dotClass = _fotoramaClass + '__dot', - thumbClass = _fotoramaClass + '__thumb', - thumbBorderClass = thumbClass + '-border', - - htmlClass = _fotoramaClass + '__html', - - videoClass = _fotoramaClass + '__video', - videoPlayClass = videoClass + '-play', - videoCloseClass = videoClass + '-close', - - captionClass = _fotoramaClass + '__caption', - captionWrapClass = _fotoramaClass + '__caption__wrap', - - spinnerClass = _fotoramaClass + '__spinner', - - buttonAttributes = '" tabindex="0" role="button'; -var JQUERY_VERSION = $ && $.fn.jquery.split('.'); - -if (!JQUERY_VERSION - || JQUERY_VERSION[0] < 1 - || (JQUERY_VERSION[0] == 1 && JQUERY_VERSION[1] < 8)) { - throw 'Fotorama requires jQuery 1.8 or later and will not run without it.'; -} -// My Underscore :-) -var _ = {}; -/* Modernizr 2.6.2 (Custom Build) | MIT & BSD - * Build: http://modernizr.com/download/#-csstransforms3d-prefixed-teststyles-testprop-testallprops-prefixes-domprefixes - */ - -var Modernizr = (function (window, document, undefined) { - - var version = '2.6.2', - - Modernizr = {}, - - docElement = document.documentElement, - - mod = 'modernizr', - modElem = document.createElement(mod), - mStyle = modElem.style, - - inputElem, - - toString = {}.toString, - - prefixes = ' -webkit- -moz- -o- -ms- '.split(' '), - - omPrefixes = 'Webkit Moz O ms', - - cssomPrefixes = omPrefixes.split(' '), - - domPrefixes = omPrefixes.toLowerCase().split(' '), - - tests = {}, - inputs = {}, - attrs = {}, - - classes = [], - - slice = classes.slice, - - featureName, - - injectElementWithStyles = function (rule, callback, nodes, testnames) { - - var style, ret, node, docOverflow, - div = document.createElement('div'), - body = document.body, - fakeBody = body || document.createElement('body'); - - if (parseInt(nodes, 10)) { - while (nodes--) { - node = document.createElement('div'); - node.id = testnames ? testnames[nodes] : mod + (nodes + 1); - div.appendChild(node); - } - } - - style = ['­', ''].join(''); - div.id = mod; - (body ? div : fakeBody).innerHTML += style; - fakeBody.appendChild(div); - if (!body) { - fakeBody.style.background = ''; - fakeBody.style.overflow = 'hidden'; - docOverflow = docElement.style.overflow; - docElement.style.overflow = 'hidden'; - docElement.appendChild(fakeBody); - } - - ret = callback(div, rule); - if (!body) { - fakeBody.parentNode.removeChild(fakeBody); - docElement.style.overflow = docOverflow; - } else { - div.parentNode.removeChild(div); - } - - return !!ret; - - }, - _hasOwnProperty = ({}).hasOwnProperty, hasOwnProp; - - if (!is(_hasOwnProperty, 'undefined') && !is(_hasOwnProperty.call, 'undefined')) { - hasOwnProp = function (object, property) { - return _hasOwnProperty.call(object, property); - }; - } - else { - hasOwnProp = function (object, property) { - return ((property in object) && is(object.constructor.prototype[property], 'undefined')); - }; - } - - - if (!Function.prototype.bind) { - Function.prototype.bind = function bind (that) { - - var target = this; - - if (typeof target != "function") { - throw new TypeError(); - } - - var args = slice.call(arguments, 1), - bound = function () { - - if (this instanceof bound) { - - var F = function () { - }; - F.prototype = target.prototype; - var self = new F(); - - var result = target.apply( - self, - args.concat(slice.call(arguments)) - ); - if (Object(result) === result) { - return result; - } - return self; - - } else { - - return target.apply( - that, - args.concat(slice.call(arguments)) - ); - - } - - }; - - return bound; - }; - } - - function setCss (str) { - mStyle.cssText = str; - } - - function setCssAll (str1, str2) { - return setCss(prefixes.join(str1 + ';') + ( str2 || '' )); - } - - function is (obj, type) { - return typeof obj === type; - } - - function contains (str, substr) { - return !!~('' + str).indexOf(substr); - } - - function testProps (props, prefixed) { - for (var i in props) { - var prop = props[i]; - if (!contains(prop, "-") && mStyle[prop] !== undefined) { - return prefixed == 'pfx' ? prop : true; - } - } - return false; - } - - function testDOMProps (props, obj, elem) { - for (var i in props) { - var item = obj[props[i]]; - if (item !== undefined) { - - if (elem === false) return props[i]; - - if (is(item, 'function')) { - return item.bind(elem || obj); - } - - return item; - } - } - return false; - } - - function testPropsAll (prop, prefixed, elem) { - - var ucProp = prop.charAt(0).toUpperCase() + prop.slice(1), - props = (prop + ' ' + cssomPrefixes.join(ucProp + ' ') + ucProp).split(' '); - - if (is(prefixed, "string") || is(prefixed, "undefined")) { - return testProps(props, prefixed); - - } else { - props = (prop + ' ' + (domPrefixes).join(ucProp + ' ') + ucProp).split(' '); - return testDOMProps(props, prefixed, elem); - } - } - - tests['csstransforms3d'] = function () { - - var ret = !!testPropsAll('perspective'); - -// Chrome fails that test, ignore -// if (ret && 'webkitPerspective' in docElement.style) { -// -// injectElementWithStyles('@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}', function (node, rule) { -// ret = node.offsetLeft === 9 && node.offsetHeight === 3; -// }); -// } - return ret; - }; - - for (var feature in tests) { - if (hasOwnProp(tests, feature)) { - featureName = feature.toLowerCase(); - Modernizr[featureName] = tests[feature](); - - classes.push((Modernizr[featureName] ? '' : 'no-') + featureName); - } - } - - Modernizr.addTest = function (feature, test) { - if (typeof feature == 'object') { - for (var key in feature) { - if (hasOwnProp(feature, key)) { - Modernizr.addTest(key, feature[ key ]); - } - } - } else { - - feature = feature.toLowerCase(); - - if (Modernizr[feature] !== undefined) { - return Modernizr; - } - - test = typeof test == 'function' ? test() : test; - - if (typeof enableClasses !== "undefined" && enableClasses) { - docElement.className += ' ' + (test ? '' : 'no-') + feature; - } - Modernizr[feature] = test; - - } - - return Modernizr; - }; - - - setCss(''); - modElem = inputElem = null; - - - Modernizr._version = version; - - Modernizr._prefixes = prefixes; - Modernizr._domPrefixes = domPrefixes; - Modernizr._cssomPrefixes = cssomPrefixes; - - Modernizr.testProp = function (prop) { - return testProps([prop]); - }; - - Modernizr.testAllProps = testPropsAll; - - Modernizr.testStyles = injectElementWithStyles; - Modernizr.prefixed = function (prop, obj, elem) { - if (!obj) { - return testPropsAll(prop, 'pfx'); - } else { - return testPropsAll(prop, obj, elem); - } - }; - - return Modernizr; -})(window, document); -var fullScreenApi = { - ok: false, - is: function () { - return false; - }, - request: function () { - }, - cancel: function () { - }, - event: '', - prefix: '' - }, - browserPrefixes = 'webkit moz o ms khtml'.split(' '); - -// check for native support -if (typeof document.cancelFullScreen != 'undefined') { - fullScreenApi.ok = true; -} else { - // check for fullscreen support by vendor prefix - for (var i = 0, il = browserPrefixes.length; i < il; i++) { - fullScreenApi.prefix = browserPrefixes[i]; - if (typeof document[fullScreenApi.prefix + 'CancelFullScreen' ] != 'undefined') { - fullScreenApi.ok = true; - break; - } - } -} - -// update methods to do something useful -if (fullScreenApi.ok) { - fullScreenApi.event = fullScreenApi.prefix + 'fullscreenchange'; - fullScreenApi.is = function () { - switch (this.prefix) { - case '': - return document.fullScreen; - case 'webkit': - return document.webkitIsFullScreen; - default: - return document[this.prefix + 'FullScreen']; - } - }; - fullScreenApi.request = function (el) { - return (this.prefix === '') ? el.requestFullScreen() : el[this.prefix + 'RequestFullScreen'](); - }; - fullScreenApi.cancel = function (el) { - return (this.prefix === '') ? document.cancelFullScreen() : document[this.prefix + 'CancelFullScreen'](); - }; -} -//fgnass.github.com/spin.js#v1.3.2 - -/** - * Copyright (c) 2011-2013 Felix Gnass - * Licensed under the MIT license - */ - -var Spinner, - spinnerDefaults = { - lines: 12, // The number of lines to draw - length: 5, // The length of each line - width: 2, // The line thickness - radius: 7, // The radius of the inner circle - corners: 1, // Corner roundness (0..1) - rotate: 15, // The rotation offset - color: 'rgba(128, 128, 128, .75)', - hwaccel: true - }, - spinnerOverride = { - top: 'auto', - left: 'auto', - className: '' - }; - -(function(root, factory) { - - /* CommonJS */ - //if (typeof exports == 'object') module.exports = factory() - - /* AMD module */ - //else if (typeof define == 'function' && define.amd) define(factory) - - /* Browser global */ - //else root.Spinner = factory() - - Spinner = factory(); -} -(this, function() { - "use strict"; - - var prefixes = ['webkit', 'Moz', 'ms', 'O'] /* Vendor prefixes */ - , animations = {} /* Animation rules keyed by their name */ - , useCssAnimations /* Whether to use CSS animations or setTimeout */ - - /** - * Utility function to create elements. If no tag name is given, - * a DIV is created. Optionally properties can be passed. - */ - function createEl(tag, prop) { - var el = document.createElement(tag || 'div') - , n - - for(n in prop) el[n] = prop[n] - return el - } - - /** - * Appends children and returns the parent. - */ - function ins(parent /* child1, child2, ...*/) { - for (var i=1, n=arguments.length; i> 1) : parseInt(o.left, 10) + mid) + 'px', - top: (o.top == 'auto' ? tp.y-ep.y + (target.offsetHeight >> 1) : parseInt(o.top, 10) + mid) + 'px' - }) - } - - el.setAttribute('role', 'progressbar') - self.lines(el, self.opts) - - if (!useCssAnimations) { - // No CSS animation support, use setTimeout() instead - var i = 0 - , start = (o.lines - 1) * (1 - o.direction) / 2 - , alpha - , fps = o.fps - , f = fps/o.speed - , ostep = (1-o.opacity) / (f*o.trail / 100) - , astep = f/o.lines - - ;(function anim() { - i++; - for (var j = 0; j < o.lines; j++) { - alpha = Math.max(1 - (i + (o.lines - j) * astep) % f * ostep, o.opacity) - - self.opacity(el, j * o.direction + start, alpha, o) - } - self.timeout = self.el && setTimeout(anim, ~~(1000/fps)) - })() - } - return self - }, - - /** - * Stops and removes the Spinner. - */ - stop: function() { - var el = this.el - if (el) { - clearTimeout(this.timeout) - if (el.parentNode) el.parentNode.removeChild(el) - this.el = undefined - } - return this - }, - - /** - * Internal method that draws the individual lines. Will be overwritten - * in VML fallback mode below. - */ - lines: function(el, o) { - var i = 0 - , start = (o.lines - 1) * (1 - o.direction) / 2 - , seg - - function fill(color, shadow) { - return css(createEl(), { - position: 'absolute', - width: (o.length+o.width) + 'px', - height: o.width + 'px', - background: color, - boxShadow: shadow, - transformOrigin: 'left', - transform: 'rotate(' + ~~(360/o.lines*i+o.rotate) + 'deg) translate(' + o.radius+'px' +',0)', - borderRadius: (o.corners * o.width>>1) + 'px' - }) - } - - for (; i < o.lines; i++) { - seg = css(createEl(), { - position: 'absolute', - top: 1+~(o.width/2) + 'px', - transform: o.hwaccel ? 'translate3d(0,0,0)' : '', - opacity: o.opacity, - animation: useCssAnimations && addAnimation(o.opacity, o.trail, start + i * o.direction, o.lines) + ' ' + 1/o.speed + 's linear infinite' - }) - - if (o.shadow) ins(seg, css(fill('#000', '0 0 4px ' + '#000'), {top: 2+'px'})) - ins(el, ins(seg, fill(getColor(o.color, i), '0 0 1px rgba(0,0,0,.1)'))) - } - return el - }, - - /** - * Internal method that adjusts the opacity of a single line. - * Will be overwritten in VML fallback mode below. - */ - opacity: function(el, i, val) { - if (i < el.childNodes.length) el.childNodes[i].style.opacity = val - } - - }) - - - function initVML() { - - /* Utility function to create a VML tag */ - function vml(tag, attr) { - return createEl('<' + tag + ' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">', attr) - } - - // No CSS transforms but VML support, add a CSS rule for VML elements: - sheet.addRule('.spin-vml', 'behavior:url(#default#VML)') - - Spinner.prototype.lines = function(el, o) { - var r = o.length+o.width - , s = 2*r - - function grp() { - return css( - vml('group', { - coordsize: s + ' ' + s, - coordorigin: -r + ' ' + -r - }), - { width: s, height: s } - ) - } - - var margin = -(o.width+o.length)*2 + 'px' - , g = css(grp(), {position: 'absolute', top: margin, left: margin}) - , i - - function seg(i, dx, filter) { - ins(g, - ins(css(grp(), {rotation: 360 / o.lines * i + 'deg', left: ~~dx}), - ins(css(vml('roundrect', {arcsize: o.corners}), { - width: r, - height: o.width, - left: o.radius, - top: -o.width>>1, - filter: filter - }), - vml('fill', {color: getColor(o.color, i), opacity: o.opacity}), - vml('stroke', {opacity: 0}) // transparent stroke to fix color bleeding upon opacity change - ) - ) - ) - } - - if (o.shadow) - for (i = 1; i <= o.lines; i++) - seg(i, -2, 'progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)') - - for (i = 1; i <= o.lines; i++) seg(i) - return ins(el, g) - } - - Spinner.prototype.opacity = function(el, i, val, o) { - var c = el.firstChild - o = o.shadow && o.lines || 0 - if (c && i+o < c.childNodes.length) { - c = c.childNodes[i+o]; c = c && c.firstChild; c = c && c.firstChild - if (c) c.opacity = val - } - } - } - - var probe = css(createEl('group'), {behavior: 'url(#default#VML)'}) - - if (!vendor(probe, 'transform') && probe.adj) initVML() - else useCssAnimations = vendor(probe, 'animation') - - return Spinner - -})); - -/* Bez v1.0.10-g5ae0136 - * http://github.com/rdallasgray/bez - * - * A plugin to convert CSS3 cubic-bezier co-ordinates to jQuery-compatible easing functions - * - * With thanks to Nikolay Nemshilov for clarification on the cubic-bezier maths - * See http://st-on-it.blogspot.com/2011/05/calculating-cubic-bezier-function.html - * - * Copyright 2011 Robert Dallas Gray. All rights reserved. - * Provided under the FreeBSD license: https://github.com/rdallasgray/bez/blob/master/LICENSE.txt - */ -function bez (coOrdArray) { - var encodedFuncName = "bez_" + $.makeArray(arguments).join("_").replace(".", "p"); - if (typeof $['easing'][encodedFuncName] !== "function") { - var polyBez = function (p1, p2) { - var A = [null, null], - B = [null, null], - C = [null, null], - bezCoOrd = function (t, ax) { - C[ax] = 3 * p1[ax]; - B[ax] = 3 * (p2[ax] - p1[ax]) - C[ax]; - A[ax] = 1 - C[ax] - B[ax]; - return t * (C[ax] + t * (B[ax] + t * A[ax])); - }, - xDeriv = function (t) { - return C[0] + t * (2 * B[0] + 3 * A[0] * t); - }, - xForT = function (t) { - var x = t, i = 0, z; - while (++i < 14) { - z = bezCoOrd(x, 0) - t; - if (Math.abs(z) < 1e-3) break; - x -= z / xDeriv(x); - } - return x; - }; - return function (t) { - return bezCoOrd(xForT(t), 1); - } - }; - $['easing'][encodedFuncName] = function (x, t, b, c, d) { - return c * polyBez([coOrdArray[0], coOrdArray[1]], [coOrdArray[2], coOrdArray[3]])(t / d) + b; - } - } - return encodedFuncName; -} -var $WINDOW = $(window), - $DOCUMENT = $(document), - $HTML, - $BODY, - - QUIRKS_FORCE = location.hash.replace('#', '') === 'quirks', - TRANSFORMS3D = Modernizr.csstransforms3d, - CSS3 = TRANSFORMS3D && !QUIRKS_FORCE, - COMPAT = TRANSFORMS3D || document.compatMode === 'CSS1Compat', - FULLSCREEN = fullScreenApi.ok, - - MOBILE = navigator.userAgent.match(/Android|webOS|iPhone|iPad|iPod|BlackBerry|Windows Phone/i), - SLOW = !CSS3 || MOBILE, - - MS_POINTER = navigator.msPointerEnabled, - - WHEEL = "onwheel" in document.createElement("div") ? "wheel" : document.onmousewheel !== undefined ? "mousewheel" : "DOMMouseScroll", - - TOUCH_TIMEOUT = 250, - TRANSITION_DURATION = 300, - - SCROLL_LOCK_TIMEOUT = 1400, - - AUTOPLAY_INTERVAL = 5000, - MARGIN = 2, - THUMB_SIZE = 64, - - WIDTH = 500, - HEIGHT = 333, - - STAGE_FRAME_KEY = '$stageFrame', - NAV_DOT_FRAME_KEY = '$navDotFrame', - NAV_THUMB_FRAME_KEY = '$navThumbFrame', - - AUTO = 'auto', - - BEZIER = bez([.1, 0, .25, 1]), - - MAX_WIDTH = 99999, - - FIFTYFIFTY = '50%', - - OPTIONS = { - // dimensions - width: null, // 500 || '100%' - minwidth: null, - maxwidth: '100%', // '100%' - height: null, - minheight: null, - maxheight: null, - - ratio: null, // '16/9' || 500/333 || 1.5 - - margin: MARGIN, - glimpse: 0, - - fit: 'contain', // 'cover' || 'scaledown' || 'none' - - position: FIFTYFIFTY, - thumbposition: FIFTYFIFTY, - - // navigation, thumbs - nav: 'dots', // 'thumbs' || false - navposition: 'bottom', // 'top' - navwidth: null, - thumbwidth: THUMB_SIZE, - thumbheight: THUMB_SIZE, - thumbmargin: MARGIN, - thumbborderwidth: MARGIN, - thumbfit: 'cover', // 'contain' || 'scaledown' || 'none' - - allowfullscreen: false, // true || 'native' - - transition: 'slide', // 'crossfade' || 'dissolve' - clicktransition: null, - transitionduration: TRANSITION_DURATION, - - captions: true, - - hash: false, - startindex: 0, - - loop: false, - - autoplay: false, - stopautoplayontouch: true, - - keyboard: false, - - arrows: true, - click: true, - swipe: true, - trackpad: false, - - enableifsingleframe: false, - - controlsonstart: true, - - shuffle: false, - - direction: 'ltr', // 'rtl' - - shadows: true, - spinner: null - }, - - KEYBOARD_OPTIONS = { - left: true, - right: true, - down: false, - up: false, - space: false, - home: false, - end: false - }; -function noop () {} - -function minMaxLimit (value, min, max) { - return Math.max(isNaN(min) ? -Infinity : min, Math.min(isNaN(max) ? Infinity : max, value)); -} - -function readTransform (css) { - return css.match(/ma/) && css.match(/-?\d+(?!d)/g)[css.match(/3d/) ? 12 : 4]; -} - -function readPosition ($el) { - if (CSS3) { - return +readTransform($el.css('transform')); - } else { - return +$el.css('left').replace('px', ''); - } -} - -function getTranslate (pos/*, _001*/) { - var obj = {}; - if (CSS3) { - obj.transform = 'translate3d(' + (pos/* + (_001 ? 0.001 : 0)*/) + 'px,0,0)'; // 0.001 to remove Retina artifacts - } else { - obj.left = pos; - } - return obj; -} - -function getDuration (time) { - return {'transition-duration': time + 'ms'}; -} - -function unlessNaN (value, alternative) { - return isNaN(value) ? alternative : value; -} - -function numberFromMeasure (value, measure) { - return unlessNaN(+String(value).replace(measure || 'px', '')); -} - -function numberFromPercent (value) { - return /%$/.test(value) ? numberFromMeasure(value, '%') : undefined; -} - -function numberFromWhatever (value, whole) { - return unlessNaN(numberFromPercent(value) / 100 * whole, numberFromMeasure(value)); -} - -function measureIsValid (value) { - return (!isNaN(numberFromMeasure(value)) || !isNaN(numberFromMeasure(value, '%'))) && value; -} - -function getPosByIndex (index, side, margin, baseIndex) { - //console.log('getPosByIndex', index, side, margin, baseIndex); - //console.log((index - (baseIndex || 0)) * (side + (margin || 0))); - - return (index - (baseIndex || 0)) * (side + (margin || 0)); -} - -function getIndexByPos (pos, side, margin, baseIndex) { - return -Math.round(pos / (side + (margin || 0)) - (baseIndex || 0)); -} - -function bindTransitionEnd ($el) { - var elData = $el.data(); - - if (elData.tEnd) return; - - var el = $el[0], - transitionEndEvent = { - WebkitTransition: 'webkitTransitionEnd', - MozTransition: 'transitionend', - OTransition: 'oTransitionEnd otransitionend', - msTransition: 'MSTransitionEnd', - transition: 'transitionend' - }; - addEvent(el, transitionEndEvent[Modernizr.prefixed('transition')], function (e) { - elData.tProp && e.propertyName.match(elData.tProp) && elData.onEndFn(); - }); - elData.tEnd = true; -} - -function afterTransition ($el, property, fn, time) { - var ok, - elData = $el.data(); - - if (elData) { - elData.onEndFn = function () { - if (ok) return; - ok = true; - clearTimeout(elData.tT); - fn(); - }; - elData.tProp = property; - - // Passive call, just in case of fail of native transition-end event - clearTimeout(elData.tT); - elData.tT = setTimeout(function () { - elData.onEndFn(); - }, time * 1.5); - - bindTransitionEnd($el); - } -} - - -function stop ($el, left/*, _001*/) { - if ($el.length) { - var elData = $el.data(); - if (CSS3) { - $el.css(getDuration(0)); - elData.onEndFn = noop; - clearTimeout(elData.tT); - } else { - $el.stop(); - } - var lockedLeft = getNumber(left, function () { - return readPosition($el); - }); - - $el.css(getTranslate(lockedLeft/*, _001*/));//.width(); // `.width()` for reflow - return lockedLeft; - } -} - -function getNumber () { - var number; - for (var _i = 0, _l = arguments.length; _i < _l; _i++) { - number = _i ? arguments[_i]() : arguments[_i]; - if (typeof number === 'number') { - break; - } - } - - return number; -} - -function edgeResistance (pos, edge) { - return Math.round(pos + ((edge - pos) / 1.5)); -} - -function getProtocol () { - getProtocol.p = getProtocol.p || (location.protocol === 'https:' ? 'https://' : 'http://'); - return getProtocol.p; -} - -function parseHref (href) { - var a = document.createElement('a'); - a.href = href; - return a; -} - -function findVideoId (href, forceVideo) { - if (typeof href !== 'string') return href; - href = parseHref(href); - - var id, - type; - - if (href.host.match(/youtube\.com/) && href.search) { - //.log(); - id = href.search.split('v=')[1]; - if (id) { - var ampersandPosition = id.indexOf('&'); - if (ampersandPosition !== -1) { - id = id.substring(0, ampersandPosition); - } - type = 'youtube'; - } - } else if (href.host.match(/youtube\.com|youtu\.be/)) { - id = href.pathname.replace(/^\/(embed\/|v\/)?/, '').replace(/\/.*/, ''); - type = 'youtube'; - } else if (href.host.match(/vimeo\.com/)) { - type = 'vimeo'; - id = href.pathname.replace(/^\/(video\/)?/, '').replace(/\/.*/, ''); - } - - if ((!id || !type) && forceVideo) { - id = href.href; - type = 'custom'; - } - - return id ? {id: id, type: type, s: href.search.replace(/^\?/, ''), p: getProtocol()} : false; -} - -function getVideoThumbs (dataFrame, data, fotorama) { - var img, thumb, video = dataFrame.video; - if (video.type === 'youtube') { - thumb = getProtocol() + 'img.youtube.com/vi/' + video.id + '/default.jpg'; - img = thumb.replace(/\/default.jpg$/, '/hqdefault.jpg'); - dataFrame.thumbsReady = true; - } else if (video.type === 'vimeo') { - $.ajax({ - url: getProtocol() + 'vimeo.com/api/v2/video/' + video.id + '.json', - dataType: 'jsonp', - success: function (json) { - dataFrame.thumbsReady = true; - updateData(data, {img: json[0].thumbnail_large, thumb: json[0].thumbnail_small}, dataFrame.i, fotorama); - } - }); - } else { - dataFrame.thumbsReady = true; - } - - return { - img: img, - thumb: thumb - } -} - -function updateData (data, _dataFrame, i, fotorama) { - for (var _i = 0, _l = data.length; _i < _l; _i++) { - var dataFrame = data[_i]; - - if (dataFrame.i === i && dataFrame.thumbsReady) { - var clear = {videoReady: true}; - clear[STAGE_FRAME_KEY] = clear[NAV_THUMB_FRAME_KEY] = clear[NAV_DOT_FRAME_KEY] = false; - - fotorama.splice(_i, 1, $.extend( - {}, - dataFrame, - clear, - _dataFrame - )); - - break; - } - } -} - -function getDataFromHtml ($el) { - var data = []; - - function getDataFromImg ($img, imgData, checkVideo) { - var $child = $img.children('img').eq(0), - _imgHref = $img.attr('href'), - _imgSrc = $img.attr('src'), - _thumbSrc = $child.attr('src'), - _video = imgData.video, - video = checkVideo ? findVideoId(_imgHref, _video === true) : false; - - if (video) { - _imgHref = false; - } else { - video = _video; - } - - getDimensions($img, $child, $.extend(imgData, { - video: video, - img: imgData.img || _imgHref || _imgSrc || _thumbSrc, - thumb: imgData.thumb || _thumbSrc || _imgSrc || _imgHref - })); - } - - function getDimensions ($img, $child, imgData) { - var separateThumbFLAG = imgData.thumb && imgData.img !== imgData.thumb, - width = numberFromMeasure(imgData.width || $img.attr('width')), - height = numberFromMeasure(imgData.height || $img.attr('height')); - - $.extend(imgData, { - width: width, - height: height, - thumbratio: getRatio(imgData.thumbratio || (numberFromMeasure(imgData.thumbwidth || ($child && $child.attr('width')) || separateThumbFLAG || width) / numberFromMeasure(imgData.thumbheight || ($child && $child.attr('height')) || separateThumbFLAG || height))) - }); - } - - $el.children().each(function () { - var $this = $(this), - dataFrame = optionsToLowerCase($.extend($this.data(), {id: $this.attr('id')})); - if ($this.is('a, img')) { - getDataFromImg($this, dataFrame, true); - } else if (!$this.is(':empty')) { - getDimensions($this, null, $.extend(dataFrame, { - html: this, - _html: $this.html() // Because of IE - })); - } else return; - - data.push(dataFrame); - }); - - return data; -} - -function isHidden (el) { - return el.offsetWidth === 0 && el.offsetHeight === 0; -} - -function isDetached (el) { - return !$.contains(document.documentElement, el); -} - -function waitFor (test, fn, timeout, i) { - if (!waitFor.i) { - waitFor.i = 1; - waitFor.ii = [true]; - } - - i = i || waitFor.i; - - if (typeof waitFor.ii[i] === 'undefined') { - waitFor.ii[i] = true; - } - - if (test()) { - fn(); - } else { - waitFor.ii[i] && setTimeout(function () { - waitFor.ii[i] && waitFor(test, fn, timeout, i); - }, timeout || 100); - } - - return waitFor.i++; -} - -waitFor.stop = function (i) { - waitFor.ii[i] = false; -}; - -function setHash (hash) { - ////console.time('setHash ' + hash); - location.replace(location.protocol - + '//' - + location.host - + location.pathname.replace(/^\/?/, '/') - + location.search - + '#' + hash); - ////console.timeEnd('setHash ' + hash); -} - -function fit ($el, measuresToFit, method, position) { - var elData = $el.data(), - measures = elData.measures; - - if (measures && (!elData.l || - elData.l.W !== measures.width || - elData.l.H !== measures.height || - elData.l.r !== measures.ratio || - elData.l.w !== measuresToFit.w || - elData.l.h !== measuresToFit.h || - elData.l.m !== method || - elData.l.p !== position)) { - - console.log('fit'); - - var width = measures.width, - height = measures.height, - ratio = measuresToFit.w / measuresToFit.h, - biggerRatioFLAG = measures.ratio >= ratio, - fitFLAG = method === 'scaledown', - containFLAG = method === 'contain', - coverFLAG = method === 'cover', - pos = parsePosition(position); - - if (biggerRatioFLAG && (fitFLAG || containFLAG) || !biggerRatioFLAG && coverFLAG) { - width = minMaxLimit(measuresToFit.w, 0, fitFLAG ? width : Infinity); - height = width / measures.ratio; - } else if (biggerRatioFLAG && coverFLAG || !biggerRatioFLAG && (fitFLAG || containFLAG)) { - height = minMaxLimit(measuresToFit.h, 0, fitFLAG ? height : Infinity); - width = height * measures.ratio; - } - - $el.css({ - width: width, - height: height, - left: numberFromWhatever(pos.x, measuresToFit.w - width), - top: numberFromWhatever(pos.y, measuresToFit.h- height) - }); - - elData.l = { - W: measures.width, - H: measures.height, - r: measures.ratio, - w: measuresToFit.w, - h: measuresToFit.h, - m: method, - p: position - }; - } - - return true; -} - -function setStyle ($el, style) { - var el = $el[0]; - if (el.styleSheet) { - el.styleSheet.cssText = style; - } else { - $el.html(style); - } -} - -function findShadowEdge (pos, min, max) { - return min === max ? false : pos <= min ? 'left' : pos >= max ? 'right' : 'left right'; -} - -function getIndexFromHash (hash, data, ok, startindex) { - if (!ok) return false; - if (!isNaN(hash)) return hash - (startindex ? 0 : 1); - - var index; - - for (var _i = 0, _l = data.length; _i < _l; _i++) { - var dataFrame = data[_i]; - - if (dataFrame.id === hash) { - index = _i; - break; - } - } - - return index; -} - -function smartClick ($el, fn, _options) { - _options = _options || {}; - - $el.each(function () { - var $this = $(this), - thisData = $this.data(), - startEvent; - - if (thisData.clickOn) return; - - thisData.clickOn = true; - - $.extend(touch($this, { - onStart: function (e) { - startEvent = e; - (_options.onStart || noop).call(this, e); - }, - onMove: _options.onMove || noop, - onTouchEnd: _options.onTouchEnd || noop, - onEnd: function (result) { - //console.log('smartClick → result.moved', result.moved); - if (result.moved) return; - fn.call(this, startEvent); - } - }), {noMove: true}); - }); -} - -function div (classes, child) { - return '
' + (child || '') + '
'; -} - -// Fisher–Yates Shuffle -// http://bost.ocks.org/mike/shuffle/ -function shuffle (array) { - // While there remain elements to shuffle - var l = array.length; - while (l) { - // Pick a remaining element - var i = Math.floor(Math.random() * l--); - - // And swap it with the current element - var t = array[l]; - array[l] = array[i]; - array[i] = t; - } - - return array; -} - -function clone (array) { - return Object.prototype.toString.call(array) == '[object Array]' - && $.map(array, function (frame) { - return $.extend({}, frame); - }); -} - -function lockScroll ($el, left, top) { - $el - .scrollLeft(left || 0) - .scrollTop(top || 0); -} - -function optionsToLowerCase (options) { - if (options) { - var opts = {}; - $.each(options, function (key, value) { - opts[key.toLowerCase()] = value; - }); - - return opts; - } -} - -function getRatio (_ratio) { - if (!_ratio) return; - var ratio = +_ratio; - if (!isNaN(ratio)) { - return ratio; - } else { - ratio = _ratio.split('/'); - return +ratio[0] / +ratio[1] || undefined; - } -} - -function addEvent (el, e, fn, bool) { - if (!e) return; - el.addEventListener ? el.addEventListener(e, fn, !!bool) : el.attachEvent('on'+e, fn); -} - -function elIsDisabled (el) { - return !!el.getAttribute('disabled'); -} - -function disableAttr (FLAG) { - return {tabindex: FLAG * -1 + '', disabled: FLAG}; -} - -function addEnterUp (el, fn) { - addEvent(el, 'keyup', function (e) { - elIsDisabled(el) || e.keyCode == 13 && fn.call(el, e); - }); -} - -function addFocus (el, fn) { - addEvent(el, 'focus', el.onfocusin = function (e) { - fn.call(el, e); - }, true); -} - -function stopEvent (e, stopPropagation) { - e.preventDefault ? e.preventDefault() : (e.returnValue = false); - stopPropagation && e.stopPropagation && e.stopPropagation(); -} - -function getDirectionSign (forward) { - return forward ? '>' : '<'; -} - -function parsePosition (rule) { - rule = (rule + '').split(/\s+/); - return { - x: measureIsValid(rule[0]) || FIFTYFIFTY, - y: measureIsValid(rule[1]) || FIFTYFIFTY - } -} -function slide ($el, options) { - var elData = $el.data(), - elPos = Math.round(options.pos), - onEndFn = function () { - elData.sliding = false; - (options.onEnd || noop)(); - }; - - if (typeof options.overPos !== 'undefined' && options.overPos !== options.pos) { - elPos = options.overPos; - onEndFn = function () { - slide($el, $.extend({}, options, {overPos: options.pos, time: Math.max(TRANSITION_DURATION, options.time / 2)})) - }; - } - - //////console.time('var translate = $.extend'); - var translate = $.extend(getTranslate(elPos/*, options._001*/), options.width && {width: options.width}); - //////console.timeEnd('var translate = $.extend'); - - elData.sliding = true; - - if (CSS3) { - $el.css($.extend(getDuration(options.time), translate)); - if (options.time > 10) { - //////console.time('afterTransition'); - afterTransition($el, 'transform', onEndFn, options.time); - //////console.timeEnd('afterTransition'); - } else { - onEndFn(); - } - } else { - $el.stop().animate(translate, options.time, BEZIER, onEndFn); - } -} - -function fade ($el1, $el2, $frames, options, fadeStack, chain) { - var chainedFLAG = typeof chain !== 'undefined'; - if (!chainedFLAG) { - fadeStack.push(arguments); - Array.prototype.push.call(arguments, fadeStack.length); - if (fadeStack.length > 1) return; - } - - $el1 = $el1 || $($el1); - $el2 = $el2 || $($el2); - - var _$el1 = $el1[0], - _$el2 = $el2[0], - crossfadeFLAG = options.method === 'crossfade', - onEndFn = function () { - if (!onEndFn.done) { - onEndFn.done = true; - var args = (chainedFLAG || fadeStack.shift()) && fadeStack.shift(); - args && fade.apply(this, args); - (options.onEnd || noop)(!!args); - } - }, - time = options.time / (chain || 1); - - $frames.removeClass(fadeRearClass + ' ' + fadeFrontClass); - - $el1 - .stop() - .addClass(fadeRearClass); - $el2 - .stop() - .addClass(fadeFrontClass); - - crossfadeFLAG && _$el2 && $el1.fadeTo(0, 0); - - $el1.fadeTo(crossfadeFLAG ? time : 0, 1, crossfadeFLAG && onEndFn); - $el2.fadeTo(time, 0, onEndFn); - - (_$el1 && crossfadeFLAG) || _$el2 || onEndFn(); -} -var lastEvent, - moveEventType, - preventEvent, - preventEventTimeout; - -function extendEvent (e) { - var touch = (e.touches || [])[0] || e; - e._x = touch.pageX; - e._y = touch.clientY; - e._now = $.now(); -} - -function touch ($el, options) { - var el = $el[0], - tail = {}, - touchEnabledFLAG, - startEvent, - $target, - controlTouch, - touchFLAG, - targetIsSelectFLAG, - targetIsLinkFlag, - tolerance, - moved; - - function onStart (e) { - $target = $(e.target); - tail.checked = targetIsSelectFLAG = targetIsLinkFlag = moved = false; - - if (touchEnabledFLAG - || tail.flow - || (e.touches && e.touches.length > 1) - || e.which > 1 - || (lastEvent && lastEvent.type !== e.type && preventEvent) - || (targetIsSelectFLAG = options.select && $target.is(options.select, el))) return targetIsSelectFLAG; - - touchFLAG = e.type === 'touchstart'; - targetIsLinkFlag = $target.is('a, a *', el); - controlTouch = tail.control; - - tolerance = (tail.noMove || tail.noSwipe || controlTouch) ? 16 : !tail.snap ? 4 : 0; - - extendEvent(e); - - startEvent = lastEvent = e; - moveEventType = e.type.replace(/down|start/, 'move').replace(/Down/, 'Move'); - - (options.onStart || noop).call(el, e, {control: controlTouch, $target: $target}); - - touchEnabledFLAG = tail.flow = true; - - if (!touchFLAG || tail.go) stopEvent(e); - } - - function onMove (e) { - if ((e.touches && e.touches.length > 1) - || (MS_POINTER && !e.isPrimary) - || moveEventType !== e.type - || !touchEnabledFLAG) { - touchEnabledFLAG && onEnd(); - (options.onTouchEnd || noop)(); - return; - } - - extendEvent(e); - - var xDiff = Math.abs(e._x - startEvent._x), // opt _x → _pageX - yDiff = Math.abs(e._y - startEvent._y), - xyDiff = xDiff - yDiff, - xWin = (tail.go || tail.x || xyDiff >= 0) && !tail.noSwipe, - yWin = xyDiff < 0; - - if (touchFLAG && !tail.checked) { - if (touchEnabledFLAG = xWin) { - stopEvent(e); - } - } else { - //console.log('onMove e.preventDefault'); - stopEvent(e); - (options.onMove || noop).call(el, e, {touch: touchFLAG}); - } - - if (!moved && Math.sqrt(Math.pow(xDiff, 2) + Math.pow(yDiff, 2)) > tolerance) { - moved = true; - } - - tail.checked = tail.checked || xWin || yWin; - } - - function onEnd (e) { - ////console.time('touch.js onEnd'); - - (options.onTouchEnd || noop)(); - - var _touchEnabledFLAG = touchEnabledFLAG; - tail.control = touchEnabledFLAG = false; - - if (_touchEnabledFLAG) { - tail.flow = false; - } - - if (!_touchEnabledFLAG || (targetIsLinkFlag && !tail.checked)) return; - - e && stopEvent(e); - - preventEvent = true; - clearTimeout(preventEventTimeout); - preventEventTimeout = setTimeout(function () { - preventEvent = false; - }, 1000); - - (options.onEnd || noop).call(el, {moved: moved, $target: $target, control: controlTouch, touch: touchFLAG, startEvent: startEvent, aborted: !e || e.type === 'MSPointerCancel'}); - ////console.timeEnd('touch.js onEnd'); - } - - function onOtherStart () { - if (tail.flow) return; - setTimeout(function () { - tail.flow = true; - }, 10); - } - - function onOtherEnd () { - if (!tail.flow) return; - setTimeout(function () { - tail.flow = false; - }, TOUCH_TIMEOUT); - } - - if (MS_POINTER) { - addEvent(el, 'MSPointerDown', onStart); - addEvent(document, 'MSPointerMove', onMove); - addEvent(document,'MSPointerCancel', onEnd); - addEvent(document, 'MSPointerUp', onEnd); - } else { - addEvent(el, 'touchstart', onStart); - addEvent(el, 'touchmove', onMove); - addEvent(el, 'touchend', onEnd); - - addEvent(document, 'touchstart', onOtherStart); - addEvent(document, 'touchend', onOtherEnd); - addEvent(document, 'touchcancel', onOtherEnd); - - $WINDOW.on('scroll', onOtherEnd); - - $el.on('mousedown', onStart); - $DOCUMENT - .on('mousemove', onMove) - .on('mouseup', onEnd); - } - - $el.on('click', 'a', function (e) { - tail.checked && stopEvent(e); - }); - - return tail; -} - -function moveOnTouch ($el, options) { - var el = $el[0], - elData = $el.data(), - tail = {}, - startCoo, - coo, - startElPos, - moveElPos, - edge, - moveTrack, - startTime, - endTime, - min, - max, - snap, - slowFLAG, - controlFLAG, - moved, - tracked; - - function startTracking (e, noStop) { - tracked = true; - startCoo = coo = e._x; - startTime = e._now; - - moveTrack = [ - [startTime, startCoo] - ]; - - startElPos = moveElPos = tail.noMove || noStop ? 0 : stop($el, (options.getPos || noop)()/*, options._001*/); - - (options.onStart || noop).call(el, e); - } - - function onStart (e, result) { - min = tail.min; - max = tail.max; - snap = tail.snap; - - slowFLAG = e.altKey; - tracked = moved = false; - - controlFLAG = result.control; - - if (!controlFLAG && !elData.sliding) { - startTracking(e); - } - } - - function onMove (e, result) { - if (!tail.noSwipe) { - if (!tracked) { - startTracking(e); - } - - coo = e._x; - - moveTrack.push([e._now, coo]); - - moveElPos = startElPos - (startCoo - coo); - - edge = findShadowEdge(moveElPos, min, max); - - if (moveElPos <= min) { - moveElPos = edgeResistance(moveElPos, min); - } else if (moveElPos >= max) { - moveElPos = edgeResistance(moveElPos, max); - } - - if (!tail.noMove) { - $el.css(getTranslate(moveElPos/*, options._001*/)); - if (!moved) { - moved = true; - // only for mouse - result.touch || MS_POINTER || $el.addClass(grabbingClass); - } - - (options.onMove || noop).call(el, e, {pos: moveElPos, edge: edge}); - } - } - } - - function onEnd (result) { - ////console.time('moveontouch.js onEnd'); - if (tail.noSwipe && result.moved) return; - - if (!tracked) { - startTracking(result.startEvent, true); - } - - //console.log('onEnd'); - - result.touch || MS_POINTER || $el.removeClass(grabbingClass); - - endTime = $.now(); - - var _backTimeIdeal = endTime - TOUCH_TIMEOUT, - _backTime, - _timeDiff, - _timeDiffLast, - backTime = null, - backCoo, - virtualPos, - limitPos, - newPos, - overPos, - time = TRANSITION_DURATION, - speed, - friction = options.friction; - - for (var _i = moveTrack.length - 1; _i >= 0; _i--) { - _backTime = moveTrack[_i][0]; - _timeDiff = Math.abs(_backTime - _backTimeIdeal); - if (backTime === null || _timeDiff < _timeDiffLast) { - backTime = _backTime; - backCoo = moveTrack[_i][1]; - } else if (backTime === _backTimeIdeal || _timeDiff > _timeDiffLast) { - break; - } - _timeDiffLast = _timeDiff; - } - - newPos = minMaxLimit(moveElPos, min, max); - - var cooDiff = backCoo - coo, - forwardFLAG = cooDiff >= 0, - timeDiff = endTime - backTime, - longTouchFLAG = timeDiff > TOUCH_TIMEOUT, - swipeFLAG = !longTouchFLAG && moveElPos !== startElPos && newPos === moveElPos; - - if (snap) { - newPos = minMaxLimit(Math[swipeFLAG ? (forwardFLAG ? 'floor' : 'ceil') : 'round'](moveElPos / snap) * snap, min, max); - min = max = newPos; - } - - if (swipeFLAG && (snap || newPos === moveElPos)) { - speed = -(cooDiff / timeDiff); - time *= minMaxLimit(Math.abs(speed), options.timeLow, options.timeHigh); - virtualPos = Math.round(moveElPos + speed * time / friction); - - if (!snap) { - newPos = virtualPos; - } - - if (!forwardFLAG && virtualPos > max || forwardFLAG && virtualPos < min) { - limitPos = forwardFLAG ? min : max; - overPos = virtualPos - limitPos; - if (!snap) { - newPos = limitPos; - } - overPos = minMaxLimit(newPos + overPos * .03, limitPos - 50, limitPos + 50); - time = Math.abs((moveElPos - overPos) / (speed / friction)); - } - } - - time *= slowFLAG ? 10 : 1; - - (options.onEnd || noop).call(el, $.extend(result, {moved: result.moved || longTouchFLAG && snap, pos: moveElPos, newPos: newPos, overPos: overPos, time: time})); - } - - tail = $.extend(touch(options.$wrap, $.extend({}, options, { - onStart: onStart, - onMove: onMove, - onEnd: onEnd - })), tail); - - return tail; -} -function wheel ($el, options) { - var el = $el[0], - lockFLAG, - lastDirection, - lastNow, - tail = { - prevent: {} - }; - - addEvent(el, WHEEL, function (e) { - var yDelta = e.wheelDeltaY || -1 * e.deltaY || 0, - xDelta = e.wheelDeltaX || -1 * e.deltaX || 0, - xWin = Math.abs(xDelta) && !Math.abs(yDelta), - direction = getDirectionSign(xDelta < 0), - sameDirection = lastDirection === direction, - now = $.now(), - tooFast = now - lastNow < TOUCH_TIMEOUT; - - lastDirection = direction; - lastNow = now; - - if (!xWin || !tail.ok || tail.prevent[direction] && !lockFLAG) { - return; - } else { - stopEvent(e, true); - if (lockFLAG && sameDirection && tooFast) { - return; - } - } - - if (options.shift) { - lockFLAG = true; - clearTimeout(tail.t); - tail.t = setTimeout(function () { - lockFLAG = false; - }, SCROLL_LOCK_TIMEOUT); - } - - (options.onEnd || noop)(e, options.shift ? direction : xDelta); - - }); - - return tail; -} -jQuery.Fotorama = function ($fotorama, opts) { - $HTML = $('html'); - $BODY = $('body'); - - var that = this, - stamp = $.now(), - stampClass = _fotoramaClass + stamp, - fotorama = $fotorama[0], - data, - dataFrameCount = 1, - fotoramaData = $fotorama.data(), - size, - - $style = $(''), - - $anchor = $(div(hiddenClass)), - $wrap = $(div(wrapClass)), - $stage = $(div(stageClass)).appendTo($wrap), - stage = $stage[0], - - $stageShaft = $(div(stageShaftClass)).appendTo($stage), - $stageFrame = $(), - $arrPrev = $(div(arrClass + ' ' + arrPrevClass + buttonAttributes)), - $arrNext = $(div(arrClass + ' ' + arrNextClass + buttonAttributes)), - $arrs = $arrPrev.add($arrNext).appendTo($stage), - $navWrap = $(div(navWrapClass)), - $nav = $(div(navClass)).appendTo($navWrap), - $navShaft = $(div(navShaftClass)).appendTo($nav), - $navFrame, - $navDotFrame = $(), - $navThumbFrame = $(), - - stageShaftData = $stageShaft.data(), - navShaftData = $navShaft.data(), - - $thumbBorder = $(div(thumbBorderClass)).appendTo($navShaft), - - $fullscreenIcon = $(div(fullscreenIconClass + buttonAttributes)), - fullscreenIcon = $fullscreenIcon[0], - $videoPlay = $(div(videoPlayClass)), - $videoClose = $(div(videoCloseClass)).appendTo($stage), - videoClose = $videoClose[0], - - spinner, - $spinner = $(div(spinnerClass)), - - $videoPlaying, - - activeIndex = false, - activeFrame, - activeIndexes, - repositionIndex, - dirtyIndex, - lastActiveIndex, - prevIndex, - nextIndex, - nextAutoplayIndex, - startIndex, - - o_loop, - o_nav, - o_navThumbs, - o_navTop, - o_allowFullScreen, - o_nativeFullScreen, - o_fade, - o_thumbSide, - o_thumbSide2, - o_transitionDuration, - o_transition, - o_shadows, - o_rtl, - o_keyboard, - lastOptions = {}, - - measures = {}, - measuresSetFLAG, - - stageShaftTouchTail = {}, - stageWheelTail = {}, - navShaftTouchTail = {}, - navWheelTail = {}, - - scrollTop, - scrollLeft, - - showedFLAG, - pausedAutoplayFLAG, - stoppedAutoplayFLAG, - - toDeactivate = {}, - toDetach = {}, - - measuresStash, - - touchedFLAG, - - hoverFLAG, - - navFrameKey, - stageLeft = 0, - - fadeStack = []; - - $wrap[STAGE_FRAME_KEY] = $(div(stageFrameClass)); - $wrap[NAV_THUMB_FRAME_KEY] = $(div(navFrameClass + ' ' + navFrameThumbClass + buttonAttributes, div(thumbClass))); - $wrap[NAV_DOT_FRAME_KEY] = $(div(navFrameClass + ' ' + navFrameDotClass + buttonAttributes, div(dotClass))); - - toDeactivate[STAGE_FRAME_KEY] = []; - toDeactivate[NAV_THUMB_FRAME_KEY] = []; - toDeactivate[NAV_DOT_FRAME_KEY] = []; - toDetach[STAGE_FRAME_KEY] = {}; - - $wrap - .addClass(CSS3 ? wrapCss3Class : wrapCss2Class) - .toggleClass(wrapNoControlsClass, !opts.controlsonstart); - - fotoramaData.fotorama = this; - - function checkForVideo () { - $.each(data, function (i, dataFrame) { - if (!dataFrame.i) { - dataFrame.i = dataFrameCount++; - var video = findVideoId(dataFrame.video, true); - if (video) { - var thumbs = {}; - dataFrame.video = video; - if (!dataFrame.img && !dataFrame.thumb) { - thumbs = getVideoThumbs(dataFrame, data, that); - } else { - dataFrame.thumbsReady = true; - } - updateData(data, {img: thumbs.img, thumb: thumbs.thumb}, dataFrame.i, that); - } - } - }); - } - - function allowKey (key) { - return o_keyboard[key] || that.fullScreen; - } - - function bindGlobalEvents (FLAG) { - var keydownCommon = 'keydown.' + _fotoramaClass, - localStamp = _fotoramaClass + stamp, - keydownLocal = 'keydown.' + localStamp, - resizeLocal = 'resize.' + localStamp + ' ' + 'orientationchange.' + localStamp; - - if (FLAG) { - $DOCUMENT - .on(keydownLocal, function (e) { - var catched, - index; - - if ($videoPlaying && e.keyCode === 27) { - catched = true; - unloadVideo($videoPlaying, true, true); - } else if (that.fullScreen || (opts.keyboard && !that.index)) { - if (e.keyCode === 27) { - catched = true; - that.cancelFullScreen(); - } else if ((e.shiftKey && e.keyCode === 32 && allowKey('space')) || (e.keyCode === 37 && allowKey('left')) || (e.keyCode === 38 && allowKey('up'))) { - index = '<'; - } else if ((e.keyCode === 32 && allowKey('space')) || (e.keyCode === 39 && allowKey('right')) || (e.keyCode === 40 && allowKey('down'))) { - index = '>'; - } else if (e.keyCode === 36 && allowKey('home')) { - index = '<<'; - } else if (e.keyCode === 35 && allowKey('end')) { - index = '>>'; - } - } - - (catched || index) && stopEvent(e); - index && that.show({index: index, slow: e.altKey, user: true}); - }); - - if (!that.index) { - $DOCUMENT - .off(keydownCommon) - .on(keydownCommon, 'textarea, input, select', function (e) { - !$BODY.hasClass(_fullscreenClass) && e.stopPropagation(); - }); - } - - $WINDOW.on(resizeLocal, that.resize); - } else { - $DOCUMENT.off(keydownLocal); - $WINDOW.off(resizeLocal); - } - } - - function appendElements (FLAG) { - if (FLAG === appendElements.f) return; - - if (FLAG) { - $fotorama - .html('') - .addClass(_fotoramaClass + ' ' + stampClass) - .append($wrap) - .before($style) - .before($anchor); - - addInstance(that); - } else { - $wrap.detach(); - $style.detach(); - $anchor.detach(); - $fotorama - .html(fotoramaData.urtext) - .removeClass(stampClass); - - hideInstance(that); - } - - bindGlobalEvents(FLAG); - appendElements.f = FLAG; - } - - function setData () { - data = that.data = data || clone(opts.data) || getDataFromHtml($fotorama); - size = that.size = data.length; - - !ready.ok && opts.shuffle && shuffle(data); - - checkForVideo(); - - activeIndex = limitIndex(activeIndex); - - size && appendElements(true); - } - - function stageNoMove () { - var _noMove = (size < 2 && !opts.enableifsingleframe) || $videoPlaying; - stageShaftTouchTail.noMove = _noMove || o_fade; - stageShaftTouchTail.noSwipe = _noMove || !opts.swipe; - - !o_transition && $stageShaft.toggleClass(grabClass, !opts.click && !stageShaftTouchTail.noMove && !stageShaftTouchTail.noSwipe); - MS_POINTER && $wrap.toggleClass(wrapPanYClass, !stageShaftTouchTail.noSwipe); - } - - function setAutoplayInterval (interval) { - if (interval === true) interval = ''; - opts.autoplay = Math.max(+interval || AUTOPLAY_INTERVAL, o_transitionDuration * 1.5); - } - - /** - * Options on the fly - * */ - function setOptions () { - that.options = opts = optionsToLowerCase(opts); - - o_fade = (opts.transition === 'crossfade' || opts.transition === 'dissolve'); - - o_loop = opts.loop && (size > 2 || (o_fade && (!o_transition || o_transition !== 'slide'))); - - o_transitionDuration = +opts.transitionduration || TRANSITION_DURATION; - - o_rtl = opts.direction === 'rtl'; - - o_keyboard = $.extend({}, opts.keyboard && KEYBOARD_OPTIONS, opts.keyboard); - - var classes = {add: [], remove: []}; - - function addOrRemoveClass (FLAG, value) { - classes[FLAG ? 'add' : 'remove'].push(value); - } - - if (size > 1 || opts.enableifsingleframe) { - o_nav = opts.nav; - o_navTop = opts.navposition === 'top'; - classes.remove.push(selectClass); - - $arrs.toggle(!!opts.arrows); - } else { - o_nav = false; - $arrs.hide(); - } - - spinnerStop(); - spinner = new Spinner($.extend(spinnerDefaults, opts.spinner, spinnerOverride, {direction: o_rtl ? -1 : 1})); - - arrsUpdate(); - stageWheelUpdate(); - - if (opts.autoplay) setAutoplayInterval(opts.autoplay); - - o_thumbSide = numberFromMeasure(opts.thumbwidth) || THUMB_SIZE; - o_thumbSide2 = numberFromMeasure(opts.thumbheight) || THUMB_SIZE; - - stageWheelTail.ok = navWheelTail.ok = opts.trackpad && !SLOW; - - stageNoMove(); - - extendMeasures(opts, [measures]); - - o_navThumbs = o_nav === 'thumbs'; - - if (o_navThumbs) { - frameDraw(size, 'navThumb'); - - $navFrame = $navThumbFrame; - navFrameKey = NAV_THUMB_FRAME_KEY; - - setStyle($style, $.Fotorama.jst.style({w: o_thumbSide, h: o_thumbSide2, b: opts.thumbborderwidth, m: opts.thumbmargin, s: stamp, q: !COMPAT})); - - $nav - .addClass(navThumbsClass) - .removeClass(navDotsClass); - } else if (o_nav === 'dots') { - frameDraw(size, 'navDot'); - - $navFrame = $navDotFrame; - navFrameKey = NAV_DOT_FRAME_KEY; - - $nav - .addClass(navDotsClass) - .removeClass(navThumbsClass); - } else { - o_nav = false; - $nav.removeClass(navThumbsClass + ' ' + navDotsClass); - } - - if (o_nav) { - if (o_navTop) { - $navWrap.insertBefore($stage); - } else { - $navWrap.insertAfter($stage); - } - frameAppend.nav = false; - frameAppend($navFrame, $navShaft, 'nav'); - } - - o_allowFullScreen = opts.allowfullscreen; - - if (o_allowFullScreen) { - $fullscreenIcon.prependTo($stage); - o_nativeFullScreen = FULLSCREEN && o_allowFullScreen === 'native'; - } else { - $fullscreenIcon.detach(); - o_nativeFullScreen = false; - } - - addOrRemoveClass(o_fade, wrapFadeClass); - addOrRemoveClass(!o_fade, wrapSlideClass); - addOrRemoveClass(!opts.captions, wrapNoCaptionsClass); - addOrRemoveClass(o_rtl, wrapRtlClass); - addOrRemoveClass(opts.arrows !== 'always', wrapToggleArrowsClass); - - o_shadows = opts.shadows && !SLOW; - addOrRemoveClass(!o_shadows, wrapNoShadowsClass); - - $wrap - .addClass(classes.add.join(' ')) - .removeClass(classes.remove.join(' ')); - - lastOptions = $.extend({}, opts); - } - - function normalizeIndex (index) { - return index < 0 ? (size + (index % size)) % size : index >= size ? index % size : index; - } - - function limitIndex (index) { - return minMaxLimit(index, 0, size - 1); - } - - function edgeIndex (index) { - return o_loop ? normalizeIndex(index) : limitIndex(index); - } - - function getPrevIndex (index) { - return index > 0 || o_loop ? index - 1 : false; - } - - function getNextIndex (index) { - return index < size - 1 || o_loop ? index + 1 : false; - } - - function setStageShaftMinmaxAndSnap () { - stageShaftTouchTail.min = o_loop ? -Infinity : -getPosByIndex(size - 1, measures.w, opts.margin, repositionIndex); - stageShaftTouchTail.max = o_loop ? Infinity : -getPosByIndex(0, measures.w, opts.margin, repositionIndex); - stageShaftTouchTail.snap = measures.w + opts.margin; - } - - function setNavShaftMinMax () { - //////console.log('setNavShaftMinMax', measures.nw); - navShaftTouchTail.min = Math.min(0, measures.nw - $navShaft.width()); - navShaftTouchTail.max = 0; - $navShaft.toggleClass(grabClass, !(navShaftTouchTail.noMove = navShaftTouchTail.min === navShaftTouchTail.max)); - } - - function eachIndex (indexes, type, fn) { - if (typeof indexes === 'number') { - indexes = new Array(indexes); - var rangeFLAG = true; - } - return $.each(indexes, function (i, index) { - if (rangeFLAG) index = i; - if (typeof index === 'number') { - var dataFrame = data[normalizeIndex(index)]; - - if (dataFrame) { - var key = '$' + type + 'Frame', - $frame = dataFrame[key]; - - fn.call(this, i, index, dataFrame, $frame, key, $frame && $frame.data()); - } - } - }); - } - - function setMeasures (width, height, ratio, index) { - if (!measuresSetFLAG || (measuresSetFLAG === '*' && index === startIndex)) { - - ////console.log('setMeasures', index, opts.width, opts.height); - - width = measureIsValid(opts.width) || measureIsValid(width) || WIDTH; - height = measureIsValid(opts.height) || measureIsValid(height) || HEIGHT; - that.resize({ - width: width, - ratio: opts.ratio || ratio || width / height - }, 0, index !== startIndex && '*'); - } - } - - function loadImg (indexes, type, specialMeasures, method, position, again) { - eachIndex(indexes, type, function (i, index, dataFrame, $frame, key, frameData) { - - if (!$frame) return; - - var fullFLAG = that.fullScreen && dataFrame.full && dataFrame.full !== dataFrame.img && !frameData.$full && type === 'stage'; - - if (frameData.$img && !again && !fullFLAG) return; - - var img = new Image(), - $img = $(img), - imgData = $img.data(); - - frameData[fullFLAG ? '$full' : '$img'] = $img; - - var srcKey = type === 'stage' ? (fullFLAG ? 'full' : 'img') : 'thumb', - src = dataFrame[srcKey], - dummy = fullFLAG ? null : dataFrame[type === 'stage' ? 'thumb' : 'img']; - - if (type === 'navThumb') $frame = frameData.$wrap; - - function triggerTriggerEvent (event) { - var _index = normalizeIndex(index); - triggerEvent(event, { - index: _index, - src: src, - frame: data[_index] - }); - } - - function error () { - $img.remove(); - - $.Fotorama.cache[src] = 'error'; - - if ((!dataFrame.html || type !== 'stage') && dummy && dummy !== src) { - dataFrame[srcKey] = src = dummy; - loadImg([index], type, specialMeasures, method, position, true); - } else { - if (src && !dataFrame.html && !fullFLAG) { - $frame - .trigger('f:error') - .removeClass(loadingClass) - .addClass(errorClass); - - triggerTriggerEvent('error'); - } else if (type === 'stage') { - $frame - .trigger('f:load') - .removeClass(loadingClass + ' ' + errorClass) - .addClass(loadedClass); - - triggerTriggerEvent('load'); - setMeasures(); - } - - frameData.state = 'error'; - - if (size > 1 && data[index] === dataFrame && !dataFrame.html && !dataFrame.deleted && !dataFrame.video && !fullFLAG) { - dataFrame.deleted = true; - that.splice(index, 1); - } - } - } - - function loaded () { - ////console.log('loaded: ' + src); - - //console.log('$.Fotorama.measures[src]', $.Fotorama.measures[src]); - - $.Fotorama.measures[src] = imgData.measures = $.Fotorama.measures[src] || { - width: img.width, - height: img.height, - ratio: img.width / img.height - }; - - setMeasures(imgData.measures.width, imgData.measures.height, imgData.measures.ratio, index); - - $img - .off('load error') - .addClass(imgClass + (fullFLAG ? ' ' + imgFullClass : '')) - .prependTo($frame); - - fit($img, ($.isFunction(specialMeasures) ? specialMeasures() : specialMeasures) || measures, method || dataFrame.fit || opts.fit, position || dataFrame.position || opts.position); - - $.Fotorama.cache[src] = frameData.state = 'loaded'; - - setTimeout(function () { - $frame - .trigger('f:load') - .removeClass(loadingClass + ' ' + errorClass) - .addClass(loadedClass + ' ' + (fullFLAG ? loadedFullClass : loadedImgClass)); - - if (type === 'stage') { - triggerTriggerEvent('load'); - } else if (dataFrame.thumbratio === AUTO || !dataFrame.thumbratio && opts.thumbratio === AUTO) { - // danger! reflow for all thumbnails - dataFrame.thumbratio = imgData.measures.ratio; - reset(); - } - }, 0); - } - - if (!src) { - error(); - return; - } - - function waitAndLoad () { - var _i = 10; - waitFor(function () { - return !touchedFLAG || !_i-- && !SLOW; - }, function () { - loaded(); - }); - } - - if (!$.Fotorama.cache[src]) { - $.Fotorama.cache[src] = '*'; - - $img - .on('load', waitAndLoad) - .on('error', error); - } else { - (function justWait () { - if ($.Fotorama.cache[src] === 'error') { - error(); - } else if ($.Fotorama.cache[src] === 'loaded') { - //console.log('take from cache: ' + src); - setTimeout(waitAndLoad, 0); - } else { - setTimeout(justWait, 100); - } - })(); - } - - frameData.state = ''; - img.src = src; - }); - } - - function spinnerSpin ($el) { - $spinner.append(spinner.spin().el).appendTo($el); - } - - function spinnerStop () { - $spinner.detach(); - spinner && spinner.stop(); - } - - function updateFotoramaState () { - var $frame = activeFrame[STAGE_FRAME_KEY]; - - if ($frame && !$frame.data().state) { - spinnerSpin($frame); - $frame.on('f:load f:error', function () { - $frame.off('f:load f:error'); - spinnerStop(); - }); - } - } - - function addNavFrameEvents (frame) { - addEnterUp(frame, onNavFrameClick); - addFocus(frame, function () { - - setTimeout(function () { - lockScroll($nav); - }, 0); - slideNavShaft({time: o_transitionDuration, guessIndex: $(this).data().eq, minMax: navShaftTouchTail}); - }); - } - - function frameDraw (indexes, type) { - eachIndex(indexes, type, function (i, index, dataFrame, $frame, key, frameData) { - if ($frame) return; - - $frame = dataFrame[key] = $wrap[key].clone(); - frameData = $frame.data(); - frameData.data = dataFrame; - var frame = $frame[0]; - - if (type === 'stage') { - - if (dataFrame.html) { - $('
') - .append( - dataFrame._html ? $(dataFrame.html) - .removeAttr('id') - .html(dataFrame._html) // Because of IE - : dataFrame.html - ) - .appendTo($frame); - } - - dataFrame.caption && $(div(captionClass, div(captionWrapClass, dataFrame.caption))).appendTo($frame); - - dataFrame.video && $frame - .addClass(stageFrameVideoClass) - .append($videoPlay.clone()); - - // This solves tabbing problems - addFocus(frame, function () { - setTimeout(function () { - lockScroll($stage); - }, 0); - clickToShow({index: frameData.eq, user: true}); - }); - - $stageFrame = $stageFrame.add($frame); - } else if (type === 'navDot') { - addNavFrameEvents(frame); - $navDotFrame = $navDotFrame.add($frame); - } else if (type === 'navThumb') { - addNavFrameEvents(frame); - frameData.$wrap = $frame.children(':first'); - $navThumbFrame = $navThumbFrame.add($frame); - if (dataFrame.video) { - frameData.$wrap.append($videoPlay.clone()); - } - } - }); - } - - function callFit ($img, measuresToFit, method, position) { - return $img && $img.length && fit($img, measuresToFit, method, position); - } - - function stageFramePosition (indexes) { - eachIndex(indexes, 'stage', function (i, index, dataFrame, $frame, key, frameData) { - if (!$frame) return; - - var normalizedIndex = normalizeIndex(index), - method = dataFrame.fit || opts.fit, - position = dataFrame.position || opts.position; - frameData.eq = normalizedIndex; - - toDetach[STAGE_FRAME_KEY][normalizedIndex] = $frame.css($.extend({left: o_fade ? 0 : getPosByIndex(index, measures.w, opts.margin, repositionIndex)}, o_fade && getDuration(0))); - - if (isDetached($frame[0])) { - $frame.appendTo($stageShaft); - unloadVideo(dataFrame.$video); - } - - callFit(frameData.$img, measures, method, position); - callFit(frameData.$full, measures, method, position); - }); - } - - function thumbsDraw (pos, loadFLAG) { - if (o_nav !== 'thumbs' || isNaN(pos)) return; - - var leftLimit = -pos, - rightLimit = -pos + measures.nw; - - $navThumbFrame.each(function () { - var $this = $(this), - thisData = $this.data(), - eq = thisData.eq, - getSpecialMeasures = function () { - return { - h: o_thumbSide2, - w: thisData.w - } - }, - specialMeasures = getSpecialMeasures(), - dataFrame = data[eq] || {}, - method = dataFrame.thumbfit || opts.thumbfit, - position = dataFrame.thumbposition || opts.thumbposition; - - specialMeasures.w = thisData.w; - - if (thisData.l + thisData.w < leftLimit - || thisData.l > rightLimit - || callFit(thisData.$img, specialMeasures, method, position)) return; - - loadFLAG && loadImg([eq], 'navThumb', getSpecialMeasures, method, position); - }); - } - - function frameAppend ($frames, $shaft, type) { - if (!frameAppend[type]) { - - var thumbsFLAG = type === 'nav' && o_navThumbs, - left = 0; - - $shaft.append( - $frames - .filter(function () { - var actual, - $this = $(this), - frameData = $this.data(); - for (var _i = 0, _l = data.length; _i < _l; _i++) { - if (frameData.data === data[_i]) { - actual = true; - frameData.eq = _i; - break; - } - } - return actual || $this.remove() && false; - }) - .sort(function (a, b) { - return $(a).data().eq - $(b).data().eq; - }) - .each(function () { - - if (!thumbsFLAG) return; - - var $this = $(this), - frameData = $this.data(), - thumbwidth = Math.round(o_thumbSide2 * frameData.data.thumbratio) || o_thumbSide; - - frameData.l = left; - frameData.w = thumbwidth; - - $this.css({width: thumbwidth}); - - left += thumbwidth + opts.thumbmargin; - }) - ); - - frameAppend[type] = true; - } - } - - function getDirection (x) { - return x - stageLeft > measures.w / 3; - } - - function disableDirrection (i) { - return !o_loop && (!(activeIndex + i) || !(activeIndex - size + i)) && !$videoPlaying; - } - - function arrsUpdate () { - var disablePrev = disableDirrection(0), - disableNext = disableDirrection(1); - $arrPrev - .toggleClass(arrDisabledClass, disablePrev) - .attr(disableAttr(disablePrev)); - $arrNext - .toggleClass(arrDisabledClass, disableNext) - .attr(disableAttr(disableNext)); - } - - function stageWheelUpdate () { - if (stageWheelTail.ok) { - stageWheelTail.prevent = {'<': disableDirrection(0), '>': disableDirrection(1)}; - } - } - - function getNavFrameBounds ($navFrame) { - var navFrameData = $navFrame.data(), - left, - width; - - if (o_navThumbs) { - left = navFrameData.l; - width = navFrameData.w; - } else { - left = $navFrame.position().left; - width = $navFrame.width(); - } - - return { - c: left + width / 2, - min: -left + opts.thumbmargin * 10, - max: -left + measures.w - width - opts.thumbmargin * 10 - }; - } - - function slideThumbBorder (time) { - var navFrameData = activeFrame[navFrameKey].data(); - slide($thumbBorder, { - time: time * 1.2, - pos: navFrameData.l, - width: navFrameData.w - opts.thumbborderwidth * 2 - }); - } - - function slideNavShaft (options) { - //console.log('slideNavShaft', options.guessIndex, options.keep, slideNavShaft.l); - var $guessNavFrame = data[options.guessIndex][navFrameKey]; - if ($guessNavFrame) { - var overflowFLAG = navShaftTouchTail.min !== navShaftTouchTail.max, - minMax = options.minMax || overflowFLAG && getNavFrameBounds(activeFrame[navFrameKey]), - l = overflowFLAG && (options.keep && slideNavShaft.l ? slideNavShaft.l : minMaxLimit((options.coo || measures.nw / 2) - getNavFrameBounds($guessNavFrame).c, minMax.min, minMax.max)), - pos = overflowFLAG && minMaxLimit(l, navShaftTouchTail.min, navShaftTouchTail.max), - time = options.time * 1.1; - - slide($navShaft, { - time: time, - pos: pos || 0, - onEnd: function () { - thumbsDraw(pos, true); - } - }); - - //if (time) thumbsDraw(pos); - - setShadow($nav, findShadowEdge(pos, navShaftTouchTail.min, navShaftTouchTail.max)); - slideNavShaft.l = l; - } - } - - function navUpdate () { - deactivateFrames(navFrameKey); - toDeactivate[navFrameKey].push(activeFrame[navFrameKey].addClass(activeClass)); - } - - function deactivateFrames (key) { - var _toDeactivate = toDeactivate[key]; - - while (_toDeactivate.length) { - _toDeactivate.shift().removeClass(activeClass); - } - } - - function detachFrames (key) { - var _toDetach = toDetach[key]; - - ////console.log('_toDetach', _toDetach); - ////console.log('activeIndexes', activeIndexes); - - $.each(activeIndexes, function (i, index) { - delete _toDetach[normalizeIndex(index)]; - }); - - $.each(_toDetach, function (index, $frame) { - delete _toDetach[index]; - ////console.log('Detach', index); - $frame.detach(); - }); - } - - function stageShaftReposition (skipOnEnd) { - - repositionIndex = dirtyIndex = activeIndex; - - var $frame = activeFrame[STAGE_FRAME_KEY]; - - if ($frame) { - deactivateFrames(STAGE_FRAME_KEY); - toDeactivate[STAGE_FRAME_KEY].push($frame.addClass(activeClass)); - - skipOnEnd || that.show.onEnd(true); - stop($stageShaft, 0, true); - - detachFrames(STAGE_FRAME_KEY); - stageFramePosition(activeIndexes); - setStageShaftMinmaxAndSnap(); - setNavShaftMinMax(); - } - } - - function extendMeasures (options, measuresArray) { - if (!options) return; - - $.each(measuresArray, function (i, measures) { - if (!measures) return; - - $.extend(measures, { - width: options.width || measures.width, - height: options.height, - minwidth: options.minwidth, - maxwidth: options.maxwidth, - minheight: options.minheight, - maxheight: options.maxheight, - ratio: getRatio(options.ratio) - }) - }); - } - - function triggerEvent (event, extra) { - $fotorama.trigger(_fotoramaClass + ':' + event, [that, extra]); - } - - function onTouchStart () { - clearTimeout(onTouchEnd.t); - touchedFLAG = 1; - - if (opts.stopautoplayontouch) { - that.stopAutoplay(); - } else { - pausedAutoplayFLAG = true; - } - } - - function onTouchEnd () { - if (!touchedFLAG) return; - if (!opts.stopautoplayontouch) { - releaseAutoplay(); - changeAutoplay(); - } - - onTouchEnd.t = setTimeout(function () { - touchedFLAG = 0; - }, TRANSITION_DURATION + TOUCH_TIMEOUT); - ////console.timeEnd('onTouchEnd'); - } - - function releaseAutoplay () { - //console.log('releaseAutoplay'); - pausedAutoplayFLAG = !!($videoPlaying || stoppedAutoplayFLAG); - } - - function changeAutoplay () { - //console.log('changeAutoplay'); - - clearTimeout(changeAutoplay.t); - waitFor.stop(changeAutoplay.w); - - if (!opts.autoplay || pausedAutoplayFLAG) { - if (that.autoplay) { - that.autoplay = false; - triggerEvent('stopautoplay'); - } - - return; - } - - //console.log('changeAutoplay continue'); - - if (!that.autoplay) { - that.autoplay = true; - triggerEvent('startautoplay'); - } - - var _activeIndex = activeIndex; - - - var frameData = activeFrame[STAGE_FRAME_KEY].data(); - changeAutoplay.w = waitFor(function () { - //console.log('wait for the state of the current frame'); - return frameData.state || _activeIndex !== activeIndex; - }, function () { - //console.log('the current frame is ready'); - changeAutoplay.t = setTimeout(function () { - //console.log('changeAutoplay.t setTimeout', pausedAutoplayFLAG, _activeIndex !== activeIndex); - if (pausedAutoplayFLAG || _activeIndex !== activeIndex) return; - - var _nextAutoplayIndex = nextAutoplayIndex, - nextFrameData = data[_nextAutoplayIndex][STAGE_FRAME_KEY].data(); - - changeAutoplay.w = waitFor(function () { - //console.log('wait for the state of the next frame'); - return nextFrameData.state || _nextAutoplayIndex !== nextAutoplayIndex; - }, function () { - if (pausedAutoplayFLAG || _nextAutoplayIndex !== nextAutoplayIndex) return; - that.show(o_loop ? getDirectionSign(!o_rtl) : nextAutoplayIndex); - }); - }, opts.autoplay); - }); - - } - - that.startAutoplay = function (interval) { - if (that.autoplay) return this; - pausedAutoplayFLAG = stoppedAutoplayFLAG = false; - setAutoplayInterval(interval || opts.autoplay); - changeAutoplay(); - - return this; - }; - - that.stopAutoplay = function () { - if (that.autoplay) { - pausedAutoplayFLAG = stoppedAutoplayFLAG = true; - changeAutoplay(); - } - return this; - }; - - that.show = function (options) { - //console.log('that.show'); - ////console.time('that.show prepare'); - var index; - - if (typeof options !== 'object') { - index = options; - options = {}; - } else { - index = options.index; - } - - index = index === '>' ? dirtyIndex + 1 : index === '<' ? dirtyIndex - 1 : index === '<<' ? 0 : index === '>>' ? size - 1 : index; - index = isNaN(index) ? getIndexFromHash(index, data, true) : index; - index = typeof index === 'undefined' ? activeIndex || 0 : index; - - that.activeIndex = activeIndex = edgeIndex(index); - prevIndex = getPrevIndex(activeIndex); - nextIndex = getNextIndex(activeIndex); - nextAutoplayIndex = normalizeIndex(activeIndex + (o_rtl ? -1 : 1)); - activeIndexes = [activeIndex, prevIndex, nextIndex]; - - dirtyIndex = o_loop ? index : activeIndex; - - var diffIndex = Math.abs(lastActiveIndex - dirtyIndex), - time = getNumber(options.time, function () { - return Math.min(o_transitionDuration * (1 + (diffIndex - 1) / 12), o_transitionDuration * 2); - }), - overPos = options.overPos; - - if (options.slow) time *= 10; - - var _activeFrame = activeFrame; - that.activeFrame = activeFrame = data[activeIndex]; - ////console.timeEnd('that.show prepare'); - - var silent = _activeFrame === activeFrame && !options.user; - - //setTimeout(function () { - ////console.time('unloadVideo'); - unloadVideo($videoPlaying, activeFrame.i !== data[normalizeIndex(repositionIndex)].i); - ////console.timeEnd('unloadVideo'); - ////console.time('frameDraw'); - frameDraw(activeIndexes, 'stage'); - ////console.timeEnd('frameDraw'); - ////console.time('stageFramePosition'); - stageFramePosition(SLOW ? [dirtyIndex] : [dirtyIndex, getPrevIndex(dirtyIndex), getNextIndex(dirtyIndex)]); - ////console.timeEnd('stageFramePosition'); - ////console.time('updateTouchTails'); - updateTouchTails('go', true); - ////console.timeEnd('updateTouchTails'); - ////console.time('triggerEvent'); - - silent || triggerEvent('show', { - user: options.user, - time: time - }); - ////console.timeEnd('triggerEvent'); - //}, 0); - - ////console.time('bind onEnd'); - - pausedAutoplayFLAG = true; - - var onEnd = that.show.onEnd = function (skipReposition) { - if (onEnd.ok) return; - onEnd.ok = true; - - skipReposition || stageShaftReposition(true); - - if (!silent) { - triggerEvent('showend', { - user: options.user - }); - } - - //console.log('o_transition', o_transition); - - if (!skipReposition && o_transition && o_transition !== opts.transition) { - //console.log('set transition back to: ' + o_transition); - that.setOptions({transition: o_transition}); - o_transition = false; - return; - } - - updateFotoramaState(); - loadImg(activeIndexes, 'stage'); - - updateTouchTails('go', false); - stageWheelUpdate(); - - stageCursor(); - releaseAutoplay(); - changeAutoplay(); - }; - ////console.timeEnd('bind onEnd'); - - if (!o_fade) { - ////console.time('slide'); - slide($stageShaft, { - pos: -getPosByIndex(dirtyIndex, measures.w, opts.margin, repositionIndex), - overPos: overPos, - time: time, - onEnd: onEnd/*, - _001: true*/ - }); - ////console.timeEnd('slide'); - } else { - var $activeFrame = activeFrame[STAGE_FRAME_KEY], - $prevActiveFrame = activeIndex !== lastActiveIndex ? data[lastActiveIndex][STAGE_FRAME_KEY] : null; - - fade($activeFrame, $prevActiveFrame, $stageFrame, { - time: time, - method: opts.transition, - onEnd: onEnd - }, fadeStack); - } - - ////console.time('arrsUpdate'); - arrsUpdate(); - ////console.timeEnd('arrsUpdate'); - - if (o_nav) { - ////console.time('navUpdate'); - navUpdate(); - ////console.timeEnd('navUpdate'); - - ////console.time('slideNavShaft'); - var guessIndex = limitIndex(activeIndex + minMaxLimit(dirtyIndex - lastActiveIndex, -1, 1)); - slideNavShaft({time: time, coo: guessIndex !== activeIndex && options.coo, guessIndex: typeof options.coo !== 'undefined' ? guessIndex : activeIndex, keep: silent}); - ////console.timeEnd('slideNavShaft'); - - ////console.time('slideThumbBorder'); - if (o_navThumbs) slideThumbBorder(time); - ////console.timeEnd('slideThumbBorder'); - } - - ////console.time('that.show end'); - showedFLAG = typeof lastActiveIndex !== 'undefined' && lastActiveIndex !== activeIndex; - lastActiveIndex = activeIndex; - opts.hash && showedFLAG && !that.eq && setHash(activeFrame.id || activeIndex + 1); - ////console.timeEnd('that.show end'); - - ////console.timeEnd('that.show'); - - return this; - }; - - that.requestFullScreen = function () { - if (o_allowFullScreen && !that.fullScreen) { - scrollTop = $WINDOW.scrollTop(); - scrollLeft = $WINDOW.scrollLeft(); - - lockScroll($WINDOW); - - updateTouchTails('x', true); - - measuresStash = $.extend({}, measures); - - $fotorama - .addClass(fullscreenClass) - .appendTo($BODY.addClass(_fullscreenClass)); - - $HTML.addClass(_fullscreenClass); - - unloadVideo($videoPlaying, true, true); - - that.fullScreen = true; - - if (o_nativeFullScreen) { - fullScreenApi.request(fotorama); - } - - that.resize(); - loadImg(activeIndexes, 'stage'); - updateFotoramaState(); - - triggerEvent('fullscreenenter'); - } - - return this; - }; - - function cancelFullScreen () { - if (that.fullScreen) { - that.fullScreen = false; - - if (FULLSCREEN) { - fullScreenApi.cancel(fotorama); - } - - $BODY.removeClass(_fullscreenClass); - $HTML.removeClass(_fullscreenClass); - - $fotorama - .removeClass(fullscreenClass) - .insertAfter($anchor); - - measures = $.extend({}, measuresStash); - - unloadVideo($videoPlaying, true, true); - - updateTouchTails('x', false); - - that.resize(); - loadImg(activeIndexes, 'stage'); - - lockScroll($WINDOW, scrollLeft, scrollTop); - - triggerEvent('fullscreenexit'); - } - } - - that.cancelFullScreen = function () { - if (o_nativeFullScreen && fullScreenApi.is()) { - fullScreenApi.cancel(document); - } else { - cancelFullScreen(); - } - - return this; - }; - - that.toggleFullScreen = function () { - return that[(that.fullScreen ? 'cancel' : 'request') + 'FullScreen'](); - }; - - addEvent(document, fullScreenApi.event, function () { - if (data && !fullScreenApi.is() && !$videoPlaying) { - cancelFullScreen(); - } - }); - - that.resize = function (options) { - if (!data) return this; - - var time = arguments[1] || 0, - setFLAG = arguments[2]; - - extendMeasures(!that.fullScreen ? optionsToLowerCase(options) : {width: '100%', maxwidth: null, minwidth: null, height: '100%', maxheight: null, minheight: null}, [measures, setFLAG || that.fullScreen || opts]); - - var width = measures.width, - height = measures.height, - ratio = measures.ratio, - windowHeight = $WINDOW.height() - (o_nav ? $nav.height() : 0); - - if (measureIsValid(width)) { - $wrap - .addClass(wrapOnlyActiveClass) - .css({width: width, minWidth: measures.minwidth || 0, maxWidth: measures.maxwidth || MAX_WIDTH}); - - width = measures.W = measures.w = $wrap.width(); - measures.nw = o_nav && numberFromWhatever(opts.navwidth, width) || width; - - if (opts.glimpse) { - // Glimpse - measures.w -= Math.round((numberFromWhatever(opts.glimpse, width) || 0) * 2); - } - - $stageShaft.css({width: measures.w, marginLeft: (measures.W - measures.w) / 2}); - - ////console.log('measures.W', measures.W); - ////console.log('measures.w', measures.w); - - height = numberFromWhatever(height, windowHeight); - - height = height || (ratio && width / ratio); - - if (height) { - width = Math.round(width); - height = measures.h = Math.round(minMaxLimit(height, numberFromWhatever(measures.minheight, windowHeight), numberFromWhatever(measures.maxheight, windowHeight))); - - $stage - .stop() - .animate({width: width, height: height}, time, function () { - $wrap.removeClass(wrapOnlyActiveClass); - }); - - stageShaftReposition(); - - if (o_nav) { - $nav - .stop() - .animate({width: measures.nw}, time); - - slideNavShaft({guessIndex: activeIndex, time: time, keep: true}); - if (o_navThumbs && frameAppend.nav) slideThumbBorder(time); - } - - measuresSetFLAG = setFLAG || true; - - ready(); - } - } - - stageLeft = $stage.offset().left; - - return this; - }; - - that.setOptions = function (options) { - $.extend(opts, options); - reset(); - return this; - }; - - that.shuffle = function () { - data && shuffle(data) && reset(); - return this; - }; - - function setShadow ($el, edge) { - ////console.time('setShadow'); - if (o_shadows) { - $el.removeClass(shadowsLeftClass + ' ' + shadowsRightClass); - edge && !$videoPlaying && $el.addClass(edge.replace(/^|\s/g, ' ' + shadowsClass + '--')); - } - ////console.timeEnd('setShadow'); - } - - that.destroy = function () { - that.cancelFullScreen(); - that.stopAutoplay(); - - data = that.data = null; - - appendElements(); - - activeIndexes = []; - detachFrames(STAGE_FRAME_KEY); - - reset.ok = false; - - return this; - }; - - that.playVideo = function () { - var dataFrame = activeFrame, - video = dataFrame.video, - _activeIndex = activeIndex; - - if (typeof video === 'object' && dataFrame.videoReady) { - o_nativeFullScreen && that.fullScreen && that.cancelFullScreen(); - - waitFor(function () { - return !fullScreenApi.is() || _activeIndex !== activeIndex; - }, function () { - if (_activeIndex === activeIndex) { - dataFrame.$video = dataFrame.$video || $($.Fotorama.jst.video(video)); - dataFrame.$video.appendTo(dataFrame[STAGE_FRAME_KEY]); - - $wrap.addClass(wrapVideoClass); - $videoPlaying = dataFrame.$video; - - stageNoMove(); - - $arrs.blur(); - $fullscreenIcon.blur(); - - triggerEvent('loadvideo'); - } - }); - } - - return this; - }; - - that.stopVideo = function () { - unloadVideo($videoPlaying, true, true); - return this; - }; - - function unloadVideo ($video, unloadActiveFLAG, releaseAutoplayFLAG) { - if (unloadActiveFLAG) { - $wrap.removeClass(wrapVideoClass); - $videoPlaying = false; - - stageNoMove(); - } - - if ($video && $video !== $videoPlaying) { - $video.remove(); - triggerEvent('unloadvideo'); - } - - if (releaseAutoplayFLAG) { - releaseAutoplay(); - changeAutoplay(); - } - } - - function toggleControlsClass (FLAG) { - $wrap.toggleClass(wrapNoControlsClass, FLAG); - } - - function stageCursor (e) { - if (stageShaftTouchTail.flow) return; - - var x = e ? e.pageX : stageCursor.x, - pointerFLAG = x && !disableDirrection(getDirection(x)) && opts.click; - - if (stageCursor.p !== pointerFLAG - && $stage.toggleClass(pointerClass, pointerFLAG)) { - stageCursor.p = pointerFLAG; - stageCursor.x = x; - } - } - - $stage.on('mousemove', stageCursor); - - function clickToShow (showOptions) { - clearTimeout(clickToShow.t); - - if (opts.clicktransition && opts.clicktransition !== opts.transition) { - //console.log('change transition to: ' + opts.clicktransition); - - // this timeout is for yield events flow - setTimeout(function () { - // save original transition for later - var _o_transition = opts.transition; - - that.setOptions({transition: opts.clicktransition}); - - // now safe to pass base transition to o_transition, so that.show will restor it - o_transition = _o_transition; - // this timeout is here to prevent jerking in some browsers - clickToShow.t = setTimeout(function () { - that.show(showOptions); - }, 10); - }, 0); - } else { - that.show(showOptions); - } - } - - function onStageTap (e, toggleControlsFLAG) { - ////console.time('onStageTap'); - var target = e.target, - $target = $(target); - - if ($target.hasClass(videoPlayClass)) { - that.playVideo(); - } else if (target === fullscreenIcon) { - that.toggleFullScreen(); - } else if ($videoPlaying) { - target === videoClose && unloadVideo($videoPlaying, true, true); - } else { - if (toggleControlsFLAG) { - toggleControlsClass(); - } else if (opts.click) { - - clickToShow({index: e.shiftKey || getDirectionSign(getDirection(e._x)), slow: e.altKey, user: true}); - } - } - ////console.timeEnd('onStageTap'); - } - - function updateTouchTails (key, value) { - stageShaftTouchTail[key] = navShaftTouchTail[key] = value; - } - - stageShaftTouchTail = moveOnTouch($stageShaft, { - onStart: onTouchStart, - onMove: function (e, result) { - setShadow($stage, result.edge); - }, - onTouchEnd: onTouchEnd, - onEnd: function (result) { - ////console.time('stageShaftTouchTail.onEnd'); - setShadow($stage); - - ////console.log('result', result); - - var toggleControlsFLAG = (MS_POINTER && !hoverFLAG || result.touch) && opts.arrows && opts.arrows !== 'always'; - - if (result.moved || (toggleControlsFLAG && result.pos !== result.newPos && !result.control)) { - var index = getIndexByPos(result.newPos, measures.w, opts.margin, repositionIndex); - that.show({ - index: index, - time: o_fade ? o_transitionDuration : result.time, - overPos: result.overPos, - user: true - }); - } else if (!result.aborted && !result.control) { - onStageTap(result.startEvent, toggleControlsFLAG); - } - ////console.timeEnd('stageShaftTouchTail.onEnd'); - }, -// getPos: function () { -// return -getPosByIndex(dirtyIndex, measures.w, opts.margin, repositionIndex); -// }, - //_001: true, - timeLow: 1, - timeHigh: 1, - friction: 2, - select: '.' + selectClass + ', .' + selectClass + ' *', - $wrap: $stage - }); - - navShaftTouchTail = moveOnTouch($navShaft, { - onStart: onTouchStart, - onMove: function (e, result) { - setShadow($nav, result.edge); - }, - onTouchEnd: onTouchEnd, - onEnd: function (result) { - - function onEnd () { - slideNavShaft.l = result.newPos; - releaseAutoplay(); - changeAutoplay(); - thumbsDraw(result.newPos, true); - } - - if (!result.moved) { - var target = result.$target.closest('.' + navFrameClass, $navShaft)[0]; - target && onNavFrameClick.call(target, result.startEvent); - } else if (result.pos !== result.newPos) { - pausedAutoplayFLAG = true; - slide($navShaft, { - time: result.time, - pos: result.newPos, - overPos: result.overPos, - onEnd: onEnd - }); - thumbsDraw(result.newPos); - o_shadows && setShadow($nav, findShadowEdge(result.newPos, navShaftTouchTail.min, navShaftTouchTail.max)); - } else { - onEnd(); - } - }, - timeLow: .5, - timeHigh: 2, - friction: 5, - $wrap: $nav - }); - - stageWheelTail = wheel($stage, { - shift: true, - onEnd: function (e, direction) { - ////console.log('wheel $stage onEnd', direction); - onTouchStart(); - onTouchEnd(); - that.show({index: direction, slow: e.altKey}) - } - }); - - navWheelTail = wheel($nav, { - onEnd: function (e, direction) { - ////console.log('wheel $nav onEnd', direction); - onTouchStart(); - onTouchEnd(); - var newPos = stop($navShaft) + direction * .25; - $navShaft.css(getTranslate(minMaxLimit(newPos, navShaftTouchTail.min, navShaftTouchTail.max))); - o_shadows && setShadow($nav, findShadowEdge(newPos, navShaftTouchTail.min, navShaftTouchTail.max)); - navWheelTail.prevent = {'<': newPos >= navShaftTouchTail.max, '>': newPos <= navShaftTouchTail.min}; - clearTimeout(navWheelTail.t); - navWheelTail.t = setTimeout(function () { - slideNavShaft.l = newPos; - thumbsDraw(newPos, true) - }, TOUCH_TIMEOUT); - thumbsDraw(newPos); - } - }); - - $wrap.hover( - function () { - setTimeout(function () { - if (touchedFLAG) return; - toggleControlsClass(!(hoverFLAG = true)); - }, 0); - }, function () { - if (!hoverFLAG) return; - toggleControlsClass(!(hoverFLAG = false)); - } - ); - - function onNavFrameClick (e) { - var index = $(this).data().eq; - clickToShow({index: index, slow: e.altKey, user: true, coo: e._x - $nav.offset().left}); - } - - function onArrClick (e) { - clickToShow({index: $arrs.index(this) ? '>' : '<', slow: e.altKey, user: true}); - } - - smartClick($arrs, function (e) { - stopEvent(e); - onArrClick.call(this, e); - }, { - onStart: function () { - onTouchStart(); - stageShaftTouchTail.control = true; - }, - onTouchEnd: onTouchEnd - }); - - function addFocusOnControls (el) { - addFocus(el, function () { - setTimeout(function () { - lockScroll($stage); - }, 0); - toggleControlsClass(false); - }); - } - - $arrs.each(function () { - addEnterUp(this, function (e) { - onArrClick.call(this, e); - }); - addFocusOnControls(this); - }); - - addEnterUp(fullscreenIcon, that.toggleFullScreen); - addFocusOnControls(fullscreenIcon); - - function reset () { - setData(); - setOptions(); - - if (!reset.i) { - reset.i = true; - // Only once - var _startindex = opts.startindex; - if (_startindex || opts.hash && location.hash) { - startIndex = getIndexFromHash(_startindex || location.hash.replace(/^#/, ''), data, that.index === 0 || _startindex, _startindex); - } - activeIndex = repositionIndex = dirtyIndex = lastActiveIndex = startIndex = edgeIndex(startIndex) || 0;/*(o_rtl ? size - 1 : 0)*///; - } - - if (size) { - if (changeToRtl()) return; - - if ($videoPlaying) { - unloadVideo($videoPlaying, true); - } - - activeIndexes = []; - detachFrames(STAGE_FRAME_KEY); - - reset.ok = true; - - that.show({index: activeIndex, time: 0}); - that.resize(); - } else { - that.destroy(); - } - } - - function changeToRtl () { - ////console.log('changeToRtl'); - if (!changeToRtl.f === o_rtl) { - changeToRtl.f = o_rtl; - activeIndex = size - 1 - activeIndex; - ////console.log('changeToRtl execute, activeIndex is', activeIndex); - that.reverse(); - - return true; - } - } - - $.each('load push pop shift unshift reverse sort splice'.split(' '), function (i, method) { - that[method] = function () { - data = data || []; - if (method !== 'load') { - Array.prototype[method].apply(data, arguments); - } else if (arguments[0] && typeof arguments[0] === 'object' && arguments[0].length) { - data = clone(arguments[0]); - } - reset(); - return that; - } - }); - - function ready () { - if (!ready.ok) { - ready.ok = true; - triggerEvent('ready'); - } - } - - reset(); -}; - - -$.fn.fotorama = function (opts) { - return this.each(function () { - var that = this, - $fotorama = $(this), - fotoramaData = $fotorama.data(), - fotorama = fotoramaData.fotorama; - - if (!fotorama) { - waitFor(function () { - return !isHidden(that); - }, function () { - fotoramaData.urtext = $fotorama.html(); - new $.Fotorama($fotorama, - /* Priority for options: - * 1.
- * 2. $('div').fotorama({loop: false}) - * 3. Defaults */ - $.extend( - {}, - OPTIONS, - window.fotoramaDefaults, - opts, - fotoramaData - ) - ); - }); - } else { - fotorama.setOptions(opts, true); - } - }); -}; -$.Fotorama.instances = []; - -function calculateIndexes () { - $.each($.Fotorama.instances, function (index, instance) { - instance.index = index; - }); -} - -function addInstance (instance) { - $.Fotorama.instances.push(instance); - calculateIndexes(); -} - -function hideInstance (instance) { - $.Fotorama.instances.splice(instance.index, 1); - calculateIndexes(); -} -$.Fotorama.cache = {}; -$.Fotorama.measures = {}; -$ = $ || {}; -$.Fotorama = $.Fotorama || {}; -$.Fotorama.jst = $.Fotorama.jst || {}; - -$.Fotorama.jst.style = function(v) { -var __t, __p = '', __e = _.escape; -__p += '.fotorama' + -((__t = ( v.s )) == null ? '' : __t) + -' .fotorama__nav--thumbs .fotorama__nav__frame{\npadding:' + -((__t = ( v.m )) == null ? '' : __t) + -'px;\nheight:' + -((__t = ( v.h )) == null ? '' : __t) + -'px}\n.fotorama' + -((__t = ( v.s )) == null ? '' : __t) + -' .fotorama__thumb-border{\nheight:' + -((__t = ( v.h - v.b * (v.q ? 0 : 2) )) == null ? '' : __t) + -'px;\nborder-width:' + -((__t = ( v.b )) == null ? '' : __t) + -'px;\nmargin-top:' + -((__t = ( v.m )) == null ? '' : __t) + -'px}'; -return __p -}; - -$.Fotorama.jst.video = function(v) { -var __t, __p = '', __e = _.escape, __j = Array.prototype.join; -function print() { __p += __j.call(arguments, '') } -__p += '
\n'; -return __p -}; -$(function () { - $('.' + _fotoramaClass + ':not([data-auto="false"])').fotorama(); -}); -})(window, document, location, typeof jQuery !== 'undefined' && jQuery); +fotoramaVersion="4.6.4",function(a,b,c,d,e){"use strict";function f(a){var b="bez_"+d.makeArray(arguments).join("_").replace(".","p");if("function"!=typeof d.easing[b]){var c=function(a,b){var c=[null,null],d=[null,null],e=[null,null],f=function(f,g){return e[g]=3*a[g],d[g]=3*(b[g]-a[g])-e[g],c[g]=1-e[g]-d[g],f*(e[g]+f*(d[g]+f*c[g]))},g=function(a){return e[0]+a*(2*d[0]+3*c[0]*a)},h=function(a){for(var b,c=a,d=0;++d<14&&(b=f(c,0)-a,!(Math.abs(b)<.001));)c-=b/g(c);return c};return function(a){return f(h(a),1)}};d.easing[b]=function(b,d,e,f,g){return f*c([a[0],a[1]],[a[2],a[3]])(d/g)+e}}return b}function g(){}function h(a,b,c){return Math.max(isNaN(b)?-1/0:b,Math.min(isNaN(c)?1/0:c,a))}function i(a){return a.match(/ma/)&&a.match(/-?\d+(?!d)/g)[a.match(/3d/)?12:4]}function j(a){return Ic?+i(a.css("transform")):+a.css("left").replace("px","")}function k(a){var b={};return Ic?b.transform="translate3d("+a+"px,0,0)":b.left=a,b}function l(a){return{"transition-duration":a+"ms"}}function m(a,b){return isNaN(a)?b:a}function n(a,b){return m(+String(a).replace(b||"px",""))}function o(a){return/%$/.test(a)?n(a,"%"):e}function p(a,b){return m(o(a)/100*b,n(a))}function q(a){return(!isNaN(n(a))||!isNaN(n(a,"%")))&&a}function r(a,b,c,d){return(a-(d||0))*(b+(c||0))}function s(a,b,c,d){return-Math.round(a/(b+(c||0))-(d||0))}function t(a){var b=a.data();if(!b.tEnd){var c=a[0],d={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",msTransition:"MSTransitionEnd",transition:"transitionend"};T(c,d[uc.prefixed("transition")],function(a){b.tProp&&a.propertyName.match(b.tProp)&&b.onEndFn()}),b.tEnd=!0}}function u(a,b,c,d){var e,f=a.data();f&&(f.onEndFn=function(){e||(e=!0,clearTimeout(f.tT),c())},f.tProp=b,clearTimeout(f.tT),f.tT=setTimeout(function(){f.onEndFn()},1.5*d),t(a))}function v(a,b){if(a.length){var c=a.data();Ic?(a.css(l(0)),c.onEndFn=g,clearTimeout(c.tT)):a.stop();var d=w(b,function(){return j(a)});return a.css(k(d)),d}}function w(){for(var a,b=0,c=arguments.length;c>b&&(a=b?arguments[b]():arguments[b],"number"!=typeof a);b++);return a}function x(a,b){return Math.round(a+(b-a)/1.5)}function y(){return y.p=y.p||("https:"===c.protocol?"https://":"http://"),y.p}function z(a){var c=b.createElement("a");return c.href=a,c}function A(a,b){if("string"!=typeof a)return a;a=z(a);var c,d;if(a.host.match(/youtube\.com/)&&a.search){if(c=a.search.split("v=")[1]){var e=c.indexOf("&");-1!==e&&(c=c.substring(0,e)),d="youtube"}}else a.host.match(/youtube\.com|youtu\.be/)?(c=a.pathname.replace(/^\/(embed\/|v\/)?/,"").replace(/\/.*/,""),d="youtube"):a.host.match(/vimeo\.com/)&&(d="vimeo",c=a.pathname.replace(/^\/(video\/)?/,"").replace(/\/.*/,""));return c&&d||!b||(c=a.href,d="custom"),c?{id:c,type:d,s:a.search.replace(/^\?/,""),p:y()}:!1}function B(a,b,c){var e,f,g=a.video;return"youtube"===g.type?(f=y()+"img.youtube.com/vi/"+g.id+"/default.jpg",e=f.replace(/\/default.jpg$/,"/hqdefault.jpg"),a.thumbsReady=!0):"vimeo"===g.type?d.ajax({url:y()+"vimeo.com/api/v2/video/"+g.id+".json",dataType:"jsonp",success:function(d){a.thumbsReady=!0,C(b,{img:d[0].thumbnail_large,thumb:d[0].thumbnail_small},a.i,c)}}):a.thumbsReady=!0,{img:e,thumb:f}}function C(a,b,c,e){for(var f=0,g=a.length;g>f;f++){var h=a[f];if(h.i===c&&h.thumbsReady){var i={videoReady:!0};i[Xc]=i[Zc]=i[Yc]=!1,e.splice(f,1,d.extend({},h,i,b));break}}}function D(a){function b(a,b,e){var f=a.children("img").eq(0),g=a.attr("href"),h=a.attr("src"),i=f.attr("src"),j=b.video,k=e?A(g,j===!0):!1;k?g=!1:k=j,c(a,f,d.extend(b,{video:k,img:b.img||g||h||i,thumb:b.thumb||i||h||g}))}function c(a,b,c){var e=c.thumb&&c.img!==c.thumb,f=n(c.width||a.attr("width")),g=n(c.height||a.attr("height"));d.extend(c,{width:f,height:g,thumbratio:S(c.thumbratio||n(c.thumbwidth||b&&b.attr("width")||e||f)/n(c.thumbheight||b&&b.attr("height")||e||g))})}var e=[];return a.children().each(function(){var a=d(this),f=R(d.extend(a.data(),{id:a.attr("id")}));if(a.is("a, img"))b(a,f,!0);else{if(a.is(":empty"))return;c(a,null,d.extend(f,{html:this,_html:a.html()}))}e.push(f)}),e}function E(a){return 0===a.offsetWidth&&0===a.offsetHeight}function F(a){return!d.contains(b.documentElement,a)}function G(a,b,c,d){return G.i||(G.i=1,G.ii=[!0]),d=d||G.i,"undefined"==typeof G.ii[d]&&(G.ii[d]=!0),a()?b():G.ii[d]&&setTimeout(function(){G.ii[d]&&G(a,b,c,d)},c||100),G.i++}function H(a){c.replace(c.protocol+"//"+c.host+c.pathname.replace(/^\/?/,"/")+c.search+"#"+a)}function I(a,b,c,d){var e=a.data(),f=e.measures;if(f&&(!e.l||e.l.W!==f.width||e.l.H!==f.height||e.l.r!==f.ratio||e.l.w!==b.w||e.l.h!==b.h||e.l.m!==c||e.l.p!==d)){var g=f.width,i=f.height,j=b.w/b.h,k=f.ratio>=j,l="scaledown"===c,m="contain"===c,n="cover"===c,o=$(d);k&&(l||m)||!k&&n?(g=h(b.w,0,l?g:1/0),i=g/f.ratio):(k&&n||!k&&(l||m))&&(i=h(b.h,0,l?i:1/0),g=i*f.ratio),a.css({width:g,height:i,left:p(o.x,b.w-g),top:p(o.y,b.h-i)}),e.l={W:f.width,H:f.height,r:f.ratio,w:b.w,h:b.h,m:c,p:d}}return!0}function J(a,b){var c=a[0];c.styleSheet?c.styleSheet.cssText=b:a.html(b)}function K(a,b,c){return b===c?!1:b>=a?"left":a>=c?"right":"left right"}function L(a,b,c,d){if(!c)return!1;if(!isNaN(a))return a-(d?0:1);for(var e,f=0,g=b.length;g>f;f++){var h=b[f];if(h.id===a){e=f;break}}return e}function M(a,b,c){c=c||{},a.each(function(){var a,e=d(this),f=e.data();f.clickOn||(f.clickOn=!0,d.extend(cb(e,{onStart:function(b){a=b,(c.onStart||g).call(this,b)},onMove:c.onMove||g,onTouchEnd:c.onTouchEnd||g,onEnd:function(c){c.moved||b.call(this,a)}}),{noMove:!0}))})}function N(a,b){return'
'+(b||"")+"
"}function O(a){for(var b=a.length;b;){var c=Math.floor(Math.random()*b--),d=a[b];a[b]=a[c],a[c]=d}return a}function P(a){return"[object Array]"==Object.prototype.toString.call(a)&&d.map(a,function(a){return d.extend({},a)})}function Q(a,b,c){a.scrollLeft(b||0).scrollTop(c||0)}function R(a){if(a){var b={};return d.each(a,function(a,c){b[a.toLowerCase()]=c}),b}}function S(a){if(a){var b=+a;return isNaN(b)?(b=a.split("/"),+b[0]/+b[1]||e):b}}function T(a,b,c,d){b&&(a.addEventListener?a.addEventListener(b,c,!!d):a.attachEvent("on"+b,c))}function U(a){return!!a.getAttribute("disabled")}function V(a){return{tabindex:-1*a+"",disabled:a}}function W(a,b){T(a,"keyup",function(c){U(a)||13==c.keyCode&&b.call(a,c)})}function X(a,b){T(a,"focus",a.onfocusin=function(c){b.call(a,c)},!0)}function Y(a,b){a.preventDefault?a.preventDefault():a.returnValue=!1,b&&a.stopPropagation&&a.stopPropagation()}function Z(a){return a?">":"<"}function $(a){return a=(a+"").split(/\s+/),{x:q(a[0])||bd,y:q(a[1])||bd}}function _(a,b){var c=a.data(),e=Math.round(b.pos),f=function(){c.sliding=!1,(b.onEnd||g)()};"undefined"!=typeof b.overPos&&b.overPos!==b.pos&&(e=b.overPos,f=function(){_(a,d.extend({},b,{overPos:b.pos,time:Math.max(Qc,b.time/2)}))});var h=d.extend(k(e),b.width&&{width:b.width});c.sliding=!0,Ic?(a.css(d.extend(l(b.time),h)),b.time>10?u(a,"transform",f,b.time):f()):a.stop().animate(h,b.time,_c,f)}function ab(a,b,c,e,f,h){var i="undefined"!=typeof h;if(i||(f.push(arguments),Array.prototype.push.call(arguments,f.length),!(f.length>1))){a=a||d(a),b=b||d(b);var j=a[0],k=b[0],l="crossfade"===e.method,m=function(){if(!m.done){m.done=!0;var a=(i||f.shift())&&f.shift();a&&ab.apply(this,a),(e.onEnd||g)(!!a)}},n=e.time/(h||1);c.removeClass(Rb+" "+Qb),a.stop().addClass(Rb),b.stop().addClass(Qb),l&&k&&a.fadeTo(0,0),a.fadeTo(l?n:0,1,l&&m),b.fadeTo(n,0,m),j&&l||k||m()}}function bb(a){var b=(a.touches||[])[0]||a;a._x=b.pageX,a._y=b.clientY,a._now=d.now()}function cb(a,c){function e(a){return m=d(a.target),u.checked=p=q=s=!1,k||u.flow||a.touches&&a.touches.length>1||a.which>1||ed&&ed.type!==a.type&&gd||(p=c.select&&m.is(c.select,t))?p:(o="touchstart"===a.type,q=m.is("a, a *",t),n=u.control,r=u.noMove||u.noSwipe||n?16:u.snap?0:4,bb(a),l=ed=a,fd=a.type.replace(/down|start/,"move").replace(/Down/,"Move"),(c.onStart||g).call(t,a,{control:n,$target:m}),k=u.flow=!0,void((!o||u.go)&&Y(a)))}function f(a){if(a.touches&&a.touches.length>1||Nc&&!a.isPrimary||fd!==a.type||!k)return k&&h(),void(c.onTouchEnd||g)();bb(a);var b=Math.abs(a._x-l._x),d=Math.abs(a._y-l._y),e=b-d,f=(u.go||u.x||e>=0)&&!u.noSwipe,i=0>e;o&&!u.checked?(k=f)&&Y(a):(Y(a),(c.onMove||g).call(t,a,{touch:o})),!s&&Math.sqrt(Math.pow(b,2)+Math.pow(d,2))>r&&(s=!0),u.checked=u.checked||f||i}function h(a){(c.onTouchEnd||g)();var b=k;u.control=k=!1,b&&(u.flow=!1),!b||q&&!u.checked||(a&&Y(a),gd=!0,clearTimeout(hd),hd=setTimeout(function(){gd=!1},1e3),(c.onEnd||g).call(t,{moved:s,$target:m,control:n,touch:o,startEvent:l,aborted:!a||"MSPointerCancel"===a.type}))}function i(){u.flow||setTimeout(function(){u.flow=!0},10)}function j(){u.flow&&setTimeout(function(){u.flow=!1},Pc)}var k,l,m,n,o,p,q,r,s,t=a[0],u={};return Nc?(T(t,"MSPointerDown",e),T(b,"MSPointerMove",f),T(b,"MSPointerCancel",h),T(b,"MSPointerUp",h)):(T(t,"touchstart",e),T(t,"touchmove",f),T(t,"touchend",h),T(b,"touchstart",i),T(b,"touchend",j),T(b,"touchcancel",j),Ec.on("scroll",j),a.on("mousedown",e),Fc.on("mousemove",f).on("mouseup",h)),a.on("click","a",function(a){u.checked&&Y(a)}),u}function db(a,b){function c(c,d){A=!0,j=l=c._x,q=c._now,p=[[q,j]],m=n=D.noMove||d?0:v(a,(b.getPos||g)()),(b.onStart||g).call(B,c)}function e(a,b){s=D.min,t=D.max,u=D.snap,w=a.altKey,A=z=!1,y=b.control,y||C.sliding||c(a)}function f(d,e){D.noSwipe||(A||c(d),l=d._x,p.push([d._now,l]),n=m-(j-l),o=K(n,s,t),s>=n?n=x(n,s):n>=t&&(n=x(n,t)),D.noMove||(a.css(k(n)),z||(z=!0,e.touch||Nc||a.addClass(ec)),(b.onMove||g).call(B,d,{pos:n,edge:o})))}function i(e){if(!D.noSwipe||!e.moved){A||c(e.startEvent,!0),e.touch||Nc||a.removeClass(ec),r=d.now();for(var f,i,j,k,o,q,v,x,y,z=r-Pc,C=null,E=Qc,F=b.friction,G=p.length-1;G>=0;G--){if(f=p[G][0],i=Math.abs(f-z),null===C||j>i)C=f,k=p[G][1];else if(C===z||i>j)break;j=i}v=h(n,s,t);var H=k-l,I=H>=0,J=r-C,K=J>Pc,L=!K&&n!==m&&v===n;u&&(v=h(Math[L?I?"floor":"ceil":"round"](n/u)*u,s,t),s=t=v),L&&(u||v===n)&&(y=-(H/J),E*=h(Math.abs(y),b.timeLow,b.timeHigh),o=Math.round(n+y*E/F),u||(v=o),(!I&&o>t||I&&s>o)&&(q=I?s:t,x=o-q,u||(v=q),x=h(v+.03*x,q-50,q+50),E=Math.abs((n-x)/(y/F)))),E*=w?10:1,(b.onEnd||g).call(B,d.extend(e,{moved:e.moved||K&&u,pos:n,newPos:v,overPos:x,time:E}))}}var j,l,m,n,o,p,q,r,s,t,u,w,y,z,A,B=a[0],C=a.data(),D={};return D=d.extend(cb(b.$wrap,d.extend({},b,{onStart:e,onMove:f,onEnd:i})),D)}function eb(a,b){var c,e,f,h=a[0],i={prevent:{}};return T(h,Oc,function(a){var h=a.wheelDeltaY||-1*a.deltaY||0,j=a.wheelDeltaX||-1*a.deltaX||0,k=Math.abs(j)&&!Math.abs(h),l=Z(0>j),m=e===l,n=d.now(),o=Pc>n-f;e=l,f=n,k&&i.ok&&(!i.prevent[l]||c)&&(Y(a,!0),c&&m&&o||(b.shift&&(c=!0,clearTimeout(i.t),i.t=setTimeout(function(){c=!1},Rc)),(b.onEnd||g)(a,b.shift?l:j)))}),i}function fb(){d.each(d.Fotorama.instances,function(a,b){b.index=a})}function gb(a){d.Fotorama.instances.push(a),fb()}function hb(a){d.Fotorama.instances.splice(a.index,1),fb()}var ib="fotorama",jb="fullscreen",kb=ib+"__wrap",lb=kb+"--css2",mb=kb+"--css3",nb=kb+"--video",ob=kb+"--fade",pb=kb+"--slide",qb=kb+"--no-controls",rb=kb+"--no-shadows",sb=kb+"--pan-y",tb=kb+"--rtl",ub=kb+"--only-active",vb=kb+"--no-captions",wb=kb+"--toggle-arrows",xb=ib+"__stage",yb=xb+"__frame",zb=yb+"--video",Ab=xb+"__shaft",Bb=ib+"__grab",Cb=ib+"__pointer",Db=ib+"__arr",Eb=Db+"--disabled",Fb=Db+"--prev",Gb=Db+"--next",Hb=ib+"__nav",Ib=Hb+"-wrap",Jb=Hb+"__shaft",Kb=Hb+"--dots",Lb=Hb+"--thumbs",Mb=Hb+"__frame",Nb=Mb+"--dot",Ob=Mb+"--thumb",Pb=ib+"__fade",Qb=Pb+"-front",Rb=Pb+"-rear",Sb=ib+"__shadow",Tb=Sb+"s",Ub=Tb+"--left",Vb=Tb+"--right",Wb=ib+"__active",Xb=ib+"__select",Yb=ib+"--hidden",Zb=ib+"--fullscreen",$b=ib+"__fullscreen-icon",_b=ib+"__error",ac=ib+"__loading",bc=ib+"__loaded",cc=bc+"--full",dc=bc+"--img",ec=ib+"__grabbing",fc=ib+"__img",gc=fc+"--full",hc=ib+"__dot",ic=ib+"__thumb",jc=ic+"-border",kc=ib+"__html",lc=ib+"__video",mc=lc+"-play",nc=lc+"-close",oc=ib+"__caption",pc=ib+"__caption__wrap",qc=ib+"__spinner",rc='" tabindex="0" role="button',sc=d&&d.fn.jquery.split(".");if(!sc||sc[0]<1||1==sc[0]&&sc[1]<8)throw"Fotorama requires jQuery 1.8 or later and will not run without it.";var tc={},uc=function(a,b,c){function d(a){r.cssText=a}function e(a,b){return typeof a===b}function f(a,b){return!!~(""+a).indexOf(b)}function g(a,b){for(var d in a){var e=a[d];if(!f(e,"-")&&r[e]!==c)return"pfx"==b?e:!0}return!1}function h(a,b,d){for(var f in a){var g=b[a[f]];if(g!==c)return d===!1?a[f]:e(g,"function")?g.bind(d||b):g}return!1}function i(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),f=(a+" "+u.join(d+" ")+d).split(" ");return e(b,"string")||e(b,"undefined")?g(f,b):(f=(a+" "+v.join(d+" ")+d).split(" "),h(f,b,c))}var j,k,l,m="2.6.2",n={},o=b.documentElement,p="modernizr",q=b.createElement(p),r=q.style,s=({}.toString," -webkit- -moz- -o- -ms- ".split(" ")),t="Webkit Moz O ms",u=t.split(" "),v=t.toLowerCase().split(" "),w={},x=[],y=x.slice,z=function(a,c,d,e){var f,g,h,i,j=b.createElement("div"),k=b.body,l=k||b.createElement("body");if(parseInt(d,10))for(;d--;)h=b.createElement("div"),h.id=e?e[d]:p+(d+1),j.appendChild(h);return f=["­",'"].join(""),j.id=p,(k?j:l).innerHTML+=f,l.appendChild(j),k||(l.style.background="",l.style.overflow="hidden",i=o.style.overflow,o.style.overflow="hidden",o.appendChild(l)),g=c(j,a),k?j.parentNode.removeChild(j):(l.parentNode.removeChild(l),o.style.overflow=i),!!g},A={}.hasOwnProperty;l=e(A,"undefined")||e(A.call,"undefined")?function(a,b){return b in a&&e(a.constructor.prototype[b],"undefined")}:function(a,b){return A.call(a,b)},Function.prototype.bind||(Function.prototype.bind=function(a){var b=this;if("function"!=typeof b)throw new TypeError;var c=y.call(arguments,1),d=function(){if(this instanceof d){var e=function(){};e.prototype=b.prototype;var f=new e,g=b.apply(f,c.concat(y.call(arguments)));return Object(g)===g?g:f}return b.apply(a,c.concat(y.call(arguments)))};return d}),w.csstransforms3d=function(){var a=!!i("perspective");return a};for(var B in w)l(w,B)&&(k=B.toLowerCase(),n[k]=w[B](),x.push((n[k]?"":"no-")+k));return n.addTest=function(a,b){if("object"==typeof a)for(var d in a)l(a,d)&&n.addTest(d,a[d]);else{if(a=a.toLowerCase(),n[a]!==c)return n;b="function"==typeof b?b():b,"undefined"!=typeof enableClasses&&enableClasses&&(o.className+=" "+(b?"":"no-")+a),n[a]=b}return n},d(""),q=j=null,n._version=m,n._prefixes=s,n._domPrefixes=v,n._cssomPrefixes=u,n.testProp=function(a){return g([a])},n.testAllProps=i,n.testStyles=z,n.prefixed=function(a,b,c){return b?i(a,b,c):i(a,"pfx")},n}(a,b),vc={ok:!1,is:function(){return!1},request:function(){},cancel:function(){},event:"",prefix:""},wc="webkit moz o ms khtml".split(" ");if("undefined"!=typeof b.cancelFullScreen)vc.ok=!0;else for(var xc=0,yc=wc.length;yc>xc;xc++)if(vc.prefix=wc[xc],"undefined"!=typeof b[vc.prefix+"CancelFullScreen"]){vc.ok=!0;break}vc.ok&&(vc.event=vc.prefix+"fullscreenchange",vc.is=function(){switch(this.prefix){case"":return b.fullScreen;case"webkit":return b.webkitIsFullScreen;default:return b[this.prefix+"FullScreen"]}},vc.request=function(a){return""===this.prefix?a.requestFullScreen():a[this.prefix+"RequestFullScreen"]()},vc.cancel=function(){return""===this.prefix?b.cancelFullScreen():b[this.prefix+"CancelFullScreen"]()});var zc,Ac={lines:12,length:5,width:2,radius:7,corners:1,rotate:15,color:"rgba(128, 128, 128, .75)",hwaccel:!0},Bc={top:"auto",left:"auto",className:""};!function(a,b){zc=b()}(this,function(){function a(a,c){var d,e=b.createElement(a||"div");for(d in c)e[d]=c[d];return e}function c(a){for(var b=1,c=arguments.length;c>b;b++)a.appendChild(arguments[b]);return a}function d(a,b,c,d){var e=["opacity",b,~~(100*a),c,d].join("-"),f=.01+c/d*100,g=Math.max(1-(1-a)/b*(100-f),a),h=m.substring(0,m.indexOf("Animation")).toLowerCase(),i=h&&"-"+h+"-"||"";return o[e]||(p.insertRule("@"+i+"keyframes "+e+"{0%{opacity:"+g+"}"+f+"%{opacity:"+a+"}"+(f+.01)+"%{opacity:1}"+(f+b)%100+"%{opacity:"+a+"}100%{opacity:"+g+"}}",p.cssRules.length),o[e]=1),e}function f(a,b){var c,d,f=a.style;for(b=b.charAt(0).toUpperCase()+b.slice(1),d=0;d',c)}p.addRule(".spin-vml","behavior:url(#default#VML)"),k.prototype.lines=function(a,d){function e(){return g(b("group",{coordsize:k+" "+k,coordorigin:-i+" "+-i}),{width:k,height:k})}function f(a,f,h){c(m,c(g(e(),{rotation:360/d.lines*a+"deg",left:~~f}),c(g(b("roundrect",{arcsize:d.corners}),{width:i,height:d.width,left:d.radius,top:-d.width>>1,filter:h}),b("fill",{color:j(d.color,a),opacity:d.opacity}),b("stroke",{opacity:0}))))}var h,i=d.length+d.width,k=2*i,l=2*-(d.width+d.length)+"px",m=g(e(),{position:"absolute",top:l,left:l});if(d.shadow)for(h=1;h<=d.lines;h++)f(h,-2,"progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)");for(h=1;h<=d.lines;h++)f(h);return c(a,m)},k.prototype.opacity=function(a,b,c,d){var e=a.firstChild;d=d.shadow&&d.lines||0,e&&b+d>1):parseInt(f.left,10)+j)+"px",top:("auto"==f.top?d.y-c.y+(b.offsetHeight>>1):parseInt(f.top,10)+j)+"px"})),h.setAttribute("role","progressbar"),e.lines(h,e.opts),!m){var k,l=0,n=(f.lines-1)*(1-f.direction)/2,o=f.fps,p=o/f.speed,q=(1-f.opacity)/(p*f.trail/100),r=p/f.lines;!function s(){l++;for(var a=0;a>1)+"px"})}for(var h,i=0,k=(e.lines-1)*(1-e.direction)/2;i":36===a.keyCode&&g("home")?c="<<":35===a.keyCode&&g("end")&&(c=">>")),(b||c)&&Y(a),c&&ie.show({index:c,slow:a.altKey,user:!0})}),ie.index||Fc.off(b).on(b,"textarea, input, select",function(a){!Dc.hasClass(jb)&&a.stopPropagation()}),Ec.on(f,ie.resize)):(Fc.off(d),Ec.off(f))}function j(b){b!==j.f&&(b?(a.html("").addClass(ib+" "+ke).append(qe).before(oe).before(pe),gb(ie)):(qe.detach(),oe.detach(),pe.detach(),a.html(ne.urtext).removeClass(ke),hb(ie)),i(b),j.f=b)}function m(){yd=ie.data=yd||P(e.data)||D(a),zd=ie.size=yd.length,!xd.ok&&e.shuffle&&O(yd),f(),Je=y(Je),zd&&j(!0)}function o(){var a=2>zd&&!e.enableifsingleframe||Cd;Me.noMove=a||Sd,Me.noSwipe=a||!e.swipe,!Wd&&se.toggleClass(Bb,!e.click&&!Me.noMove&&!Me.noSwipe),Nc&&qe.toggleClass(sb,!Me.noSwipe)}function t(a){a===!0&&(a=""),e.autoplay=Math.max(+a||Sc,1.5*Vd)}function u(){function a(a,c){b[a?"add":"remove"].push(c)}ie.options=e=R(e),Sd="crossfade"===e.transition||"dissolve"===e.transition,Md=e.loop&&(zd>2||Sd&&(!Wd||"slide"!==Wd)),Vd=+e.transitionduration||Qc,Yd="rtl"===e.direction,Zd=d.extend({},e.keyboard&&dd,e.keyboard);var b={add:[],remove:[]};zd>1||e.enableifsingleframe?(Nd=e.nav,Pd="top"===e.navposition,b.remove.push(Xb),we.toggle(!!e.arrows)):(Nd=!1,we.hide()),Rb(),Bd=new zc(d.extend(Ac,e.spinner,Bc,{direction:Yd?-1:1})),Gc(),Hc(),e.autoplay&&t(e.autoplay),Td=n(e.thumbwidth)||Uc,Ud=n(e.thumbheight)||Uc,Ne.ok=Pe.ok=e.trackpad&&!Mc,o(),ed(e,[Le]),Od="thumbs"===Nd,Od?(lc(zd,"navThumb"),Ad=Be,he=Zc,J(oe,d.Fotorama.jst.style({w:Td,h:Ud,b:e.thumbborderwidth,m:e.thumbmargin,s:je,q:!Jc})),ye.addClass(Lb).removeClass(Kb)):"dots"===Nd?(lc(zd,"navDot"),Ad=Ae,he=Yc,ye.addClass(Kb).removeClass(Lb)):(Nd=!1,ye.removeClass(Lb+" "+Kb)),Nd&&(Pd?xe.insertBefore(re):xe.insertAfter(re),wc.nav=!1,wc(Ad,ze,"nav")),Qd=e.allowfullscreen,Qd?(De.prependTo(re),Rd=Kc&&"native"===Qd):(De.detach(),Rd=!1),a(Sd,ob),a(!Sd,pb),a(!e.captions,vb),a(Yd,tb),a("always"!==e.arrows,wb),Xd=e.shadows&&!Mc,a(!Xd,rb),qe.addClass(b.add.join(" ")).removeClass(b.remove.join(" ")),Ke=d.extend({},e)}function x(a){return 0>a?(zd+a%zd)%zd:a>=zd?a%zd:a}function y(a){return h(a,0,zd-1)}function z(a){return Md?x(a):y(a)}function E(a){return a>0||Md?a-1:!1}function U(a){return zd-1>a||Md?a+1:!1}function $(){Me.min=Md?-1/0:-r(zd-1,Le.w,e.margin,Fd),Me.max=Md?1/0:-r(0,Le.w,e.margin,Fd),Me.snap=Le.w+e.margin}function bb(){Oe.min=Math.min(0,Le.nw-ze.width()),Oe.max=0,ze.toggleClass(Bb,!(Oe.noMove=Oe.min===Oe.max))}function cb(a,b,c){if("number"==typeof a){a=new Array(a);var e=!0}return d.each(a,function(a,d){if(e&&(d=a),"number"==typeof d){var f=yd[x(d)];if(f){var g="$"+b+"Frame",h=f[g];c.call(this,a,d,f,h,g,h&&h.data())}}})}function fb(a,b,c,d){(!$d||"*"===$d&&d===Ld)&&(a=q(e.width)||q(a)||Vc,b=q(e.height)||q(b)||Wc,ie.resize({width:a,ratio:e.ratio||c||a/b},0,d!==Ld&&"*"))}function Pb(a,b,c,f,g,h){cb(a,b,function(a,i,j,k,l,m){function n(a){var b=x(i);fd(a,{index:b,src:w,frame:yd[b]})}function o(){t.remove(),d.Fotorama.cache[w]="error",j.html&&"stage"===b||!y||y===w?(!w||j.html||r?"stage"===b&&(k.trigger("f:load").removeClass(ac+" "+_b).addClass(bc),n("load"),fb()):(k.trigger("f:error").removeClass(ac).addClass(_b),n("error")),m.state="error",!(zd>1&&yd[i]===j)||j.html||j.deleted||j.video||r||(j.deleted=!0,ie.splice(i,1))):(j[v]=w=y,Pb([i],b,c,f,g,!0))}function p(){d.Fotorama.measures[w]=u.measures=d.Fotorama.measures[w]||{width:s.width,height:s.height,ratio:s.width/s.height},fb(u.measures.width,u.measures.height,u.measures.ratio,i),t.off("load error").addClass(fc+(r?" "+gc:"")).prependTo(k),I(t,(d.isFunction(c)?c():c)||Le,f||j.fit||e.fit,g||j.position||e.position),d.Fotorama.cache[w]=m.state="loaded",setTimeout(function(){k.trigger("f:load").removeClass(ac+" "+_b).addClass(bc+" "+(r?cc:dc)),"stage"===b?n("load"):(j.thumbratio===$c||!j.thumbratio&&e.thumbratio===$c)&&(j.thumbratio=u.measures.ratio,vd())},0)}function q(){var a=10;G(function(){return!fe||!a--&&!Mc},function(){p()})}if(k){var r=ie.fullScreen&&j.full&&j.full!==j.img&&!m.$full&&"stage"===b;if(!m.$img||h||r){var s=new Image,t=d(s),u=t.data();m[r?"$full":"$img"]=t;var v="stage"===b?r?"full":"img":"thumb",w=j[v],y=r?null:j["stage"===b?"thumb":"img"];if("navThumb"===b&&(k=m.$wrap),!w)return void o();d.Fotorama.cache[w]?!function z(){"error"===d.Fotorama.cache[w]?o():"loaded"===d.Fotorama.cache[w]?setTimeout(q,0):setTimeout(z,100)}():(d.Fotorama.cache[w]="*",t.on("load",q).on("error",o)),m.state="",s.src=w}}})}function Qb(a){Ie.append(Bd.spin().el).appendTo(a)}function Rb(){Ie.detach(),Bd&&Bd.stop()}function Sb(){var a=Dd[Xc];a&&!a.data().state&&(Qb(a),a.on("f:load f:error",function(){a.off("f:load f:error"),Rb()}))}function ec(a){W(a,sd),X(a,function(){setTimeout(function(){Q(ye)},0),Rc({time:Vd,guessIndex:d(this).data().eq,minMax:Oe})})}function lc(a,b){cb(a,b,function(a,c,e,f,g,h){if(!f){f=e[g]=qe[g].clone(),h=f.data(),h.data=e;var i=f[0];"stage"===b?(e.html&&d('
').append(e._html?d(e.html).removeAttr("id").html(e._html):e.html).appendTo(f),e.caption&&d(N(oc,N(pc,e.caption))).appendTo(f),e.video&&f.addClass(zb).append(Fe.clone()),X(i,function(){setTimeout(function(){Q(re)},0),pd({index:h.eq,user:!0})}),te=te.add(f)):"navDot"===b?(ec(i),Ae=Ae.add(f)):"navThumb"===b&&(ec(i),h.$wrap=f.children(":first"),Be=Be.add(f),e.video&&h.$wrap.append(Fe.clone()))}})}function sc(a,b,c,d){return a&&a.length&&I(a,b,c,d)}function tc(a){cb(a,"stage",function(a,b,c,f,g,h){if(f){var i=x(b),j=c.fit||e.fit,k=c.position||e.position;h.eq=i,Re[Xc][i]=f.css(d.extend({left:Sd?0:r(b,Le.w,e.margin,Fd)},Sd&&l(0))),F(f[0])&&(f.appendTo(se),md(c.$video)),sc(h.$img,Le,j,k),sc(h.$full,Le,j,k)}})}function uc(a,b){if("thumbs"===Nd&&!isNaN(a)){var c=-a,f=-a+Le.nw;Be.each(function(){var a=d(this),g=a.data(),h=g.eq,i=function(){return{h:Ud,w:g.w}},j=i(),k=yd[h]||{},l=k.thumbfit||e.thumbfit,m=k.thumbposition||e.thumbposition;j.w=g.w,g.l+g.wf||sc(g.$img,j,l,m)||b&&Pb([h],"navThumb",i,l,m)})}}function wc(a,b,c){if(!wc[c]){var f="nav"===c&&Od,g=0;b.append(a.filter(function(){for(var a,b=d(this),c=b.data(),e=0,f=yd.length;f>e;e++)if(c.data===yd[e]){a=!0,c.eq=e;break}return a||b.remove()&&!1}).sort(function(a,b){return d(a).data().eq-d(b).data().eq}).each(function(){if(f){var a=d(this),b=a.data(),c=Math.round(Ud*b.data.thumbratio)||Td;b.l=g,b.w=c,a.css({width:c}),g+=c+e.thumbmargin}})),wc[c]=!0}}function xc(a){return a-Se>Le.w/3}function yc(a){return!(Md||Je+a&&Je-zd+a||Cd)}function Gc(){var a=yc(0),b=yc(1);ue.toggleClass(Eb,a).attr(V(a)),ve.toggleClass(Eb,b).attr(V(b))}function Hc(){Ne.ok&&(Ne.prevent={"<":yc(0),">":yc(1)})}function Lc(a){var b,c,d=a.data();return Od?(b=d.l,c=d.w):(b=a.position().left,c=a.width()),{c:b+c/2,min:-b+10*e.thumbmargin,max:-b+Le.w-c-10*e.thumbmargin}}function Oc(a){var b=Dd[he].data();_(Ce,{time:1.2*a,pos:b.l,width:b.w-2*e.thumbborderwidth})}function Rc(a){var b=yd[a.guessIndex][he];if(b){var c=Oe.min!==Oe.max,d=a.minMax||c&&Lc(Dd[he]),e=c&&(a.keep&&Rc.l?Rc.l:h((a.coo||Le.nw/2)-Lc(b).c,d.min,d.max)),f=c&&h(e,Oe.min,Oe.max),g=1.1*a.time;_(ze,{time:g,pos:f||0,onEnd:function(){uc(f,!0)}}),ld(ye,K(f,Oe.min,Oe.max)),Rc.l=e}}function Tc(){_c(he),Qe[he].push(Dd[he].addClass(Wb))}function _c(a){for(var b=Qe[a];b.length;)b.shift().removeClass(Wb)}function bd(a){var b=Re[a];d.each(Ed,function(a,c){delete b[x(c)]}),d.each(b,function(a,c){delete b[a],c.detach()})}function cd(a){Fd=Gd=Je;var b=Dd[Xc];b&&(_c(Xc),Qe[Xc].push(b.addClass(Wb)),a||ie.show.onEnd(!0),v(se,0,!0),bd(Xc),tc(Ed),$(),bb())}function ed(a,b){a&&d.each(b,function(b,c){c&&d.extend(c,{width:a.width||c.width,height:a.height,minwidth:a.minwidth,maxwidth:a.maxwidth,minheight:a.minheight,maxheight:a.maxheight,ratio:S(a.ratio)})})}function fd(b,c){a.trigger(ib+":"+b,[ie,c])}function gd(){clearTimeout(hd.t),fe=1,e.stopautoplayontouch?ie.stopAutoplay():ce=!0}function hd(){fe&&(e.stopautoplayontouch||(id(),jd()),hd.t=setTimeout(function(){fe=0},Qc+Pc))}function id(){ce=!(!Cd&&!de)}function jd(){if(clearTimeout(jd.t),G.stop(jd.w),!e.autoplay||ce)return void(ie.autoplay&&(ie.autoplay=!1,fd("stopautoplay")));ie.autoplay||(ie.autoplay=!0,fd("startautoplay"));var a=Je,b=Dd[Xc].data();jd.w=G(function(){return b.state||a!==Je},function(){jd.t=setTimeout(function(){if(!ce&&a===Je){var b=Kd,c=yd[b][Xc].data();jd.w=G(function(){return c.state||b!==Kd},function(){ce||b!==Kd||ie.show(Md?Z(!Yd):Kd)})}},e.autoplay)})}function kd(){ie.fullScreen&&(ie.fullScreen=!1,Kc&&vc.cancel(le),Dc.removeClass(jb),Cc.removeClass(jb),a.removeClass(Zb).insertAfter(pe),Le=d.extend({},ee),md(Cd,!0,!0),rd("x",!1),ie.resize(),Pb(Ed,"stage"),Q(Ec,ae,_d),fd("fullscreenexit"))}function ld(a,b){Xd&&(a.removeClass(Ub+" "+Vb),b&&!Cd&&a.addClass(b.replace(/^|\s/g," "+Tb+"--")))}function md(a,b,c){b&&(qe.removeClass(nb),Cd=!1,o()),a&&a!==Cd&&(a.remove(),fd("unloadvideo")),c&&(id(),jd())}function nd(a){qe.toggleClass(qb,a)}function od(a){if(!Me.flow){var b=a?a.pageX:od.x,c=b&&!yc(xc(b))&&e.click;od.p!==c&&re.toggleClass(Cb,c)&&(od.p=c,od.x=b)}}function pd(a){clearTimeout(pd.t),e.clicktransition&&e.clicktransition!==e.transition?setTimeout(function(){var b=e.transition;ie.setOptions({transition:e.clicktransition}),Wd=b,pd.t=setTimeout(function(){ie.show(a)},10)},0):ie.show(a)}function qd(a,b){var c=a.target,f=d(c);f.hasClass(mc)?ie.playVideo():c===Ee?ie.toggleFullScreen():Cd?c===He&&md(Cd,!0,!0):b?nd():e.click&&pd({index:a.shiftKey||Z(xc(a._x)),slow:a.altKey,user:!0})}function rd(a,b){Me[a]=Oe[a]=b}function sd(a){var b=d(this).data().eq;pd({index:b,slow:a.altKey,user:!0,coo:a._x-ye.offset().left})}function td(a){pd({index:we.index(this)?">":"<",slow:a.altKey,user:!0})}function ud(a){X(a,function(){setTimeout(function(){Q(re)},0),nd(!1)})}function vd(){if(m(),u(),!vd.i){vd.i=!0;var a=e.startindex;(a||e.hash&&c.hash)&&(Ld=L(a||c.hash.replace(/^#/,""),yd,0===ie.index||a,a)),Je=Fd=Gd=Hd=Ld=z(Ld)||0}if(zd){if(wd())return;Cd&&md(Cd,!0),Ed=[],bd(Xc),vd.ok=!0,ie.show({index:Je,time:0}),ie.resize()}else ie.destroy()}function wd(){return!wd.f===Yd?(wd.f=Yd,Je=zd-1-Je,ie.reverse(),!0):void 0}function xd(){xd.ok||(xd.ok=!0,fd("ready"))}Cc=d("html"),Dc=d("body");var yd,zd,Ad,Bd,Cd,Dd,Ed,Fd,Gd,Hd,Id,Jd,Kd,Ld,Md,Nd,Od,Pd,Qd,Rd,Sd,Td,Ud,Vd,Wd,Xd,Yd,Zd,$d,_d,ae,be,ce,de,ee,fe,ge,he,ie=this,je=d.now(),ke=ib+je,le=a[0],me=1,ne=a.data(),oe=d(""),pe=d(N(Yb)),qe=d(N(kb)),re=d(N(xb)).appendTo(qe),se=(re[0],d(N(Ab)).appendTo(re)),te=d(),ue=d(N(Db+" "+Fb+rc)),ve=d(N(Db+" "+Gb+rc)),we=ue.add(ve).appendTo(re),xe=d(N(Ib)),ye=d(N(Hb)).appendTo(xe),ze=d(N(Jb)).appendTo(ye),Ae=d(),Be=d(),Ce=(se.data(),ze.data(),d(N(jc)).appendTo(ze)),De=d(N($b+rc)),Ee=De[0],Fe=d(N(mc)),Ge=d(N(nc)).appendTo(re),He=Ge[0],Ie=d(N(qc)),Je=!1,Ke={},Le={},Me={},Ne={},Oe={},Pe={},Qe={},Re={},Se=0,Te=[]; +qe[Xc]=d(N(yb)),qe[Zc]=d(N(Mb+" "+Ob+rc,N(ic))),qe[Yc]=d(N(Mb+" "+Nb+rc,N(hc))),Qe[Xc]=[],Qe[Zc]=[],Qe[Yc]=[],Re[Xc]={},qe.addClass(Ic?mb:lb).toggleClass(qb,!e.controlsonstart),ne.fotorama=this,ie.startAutoplay=function(a){return ie.autoplay?this:(ce=de=!1,t(a||e.autoplay),jd(),this)},ie.stopAutoplay=function(){return ie.autoplay&&(ce=de=!0,jd()),this},ie.show=function(a){var b;"object"!=typeof a?(b=a,a={}):b=a.index,b=">"===b?Gd+1:"<"===b?Gd-1:"<<"===b?0:">>"===b?zd-1:b,b=isNaN(b)?L(b,yd,!0):b,b="undefined"==typeof b?Je||0:b,ie.activeIndex=Je=z(b),Id=E(Je),Jd=U(Je),Kd=x(Je+(Yd?-1:1)),Ed=[Je,Id,Jd],Gd=Md?b:Je;var c=Math.abs(Hd-Gd),d=w(a.time,function(){return Math.min(Vd*(1+(c-1)/12),2*Vd)}),f=a.overPos;a.slow&&(d*=10);var g=Dd;ie.activeFrame=Dd=yd[Je];var i=g===Dd&&!a.user;md(Cd,Dd.i!==yd[x(Fd)].i),lc(Ed,"stage"),tc(Mc?[Gd]:[Gd,E(Gd),U(Gd)]),rd("go",!0),i||fd("show",{user:a.user,time:d}),ce=!0;var j=ie.show.onEnd=function(b){if(!j.ok){if(j.ok=!0,b||cd(!0),i||fd("showend",{user:a.user}),!b&&Wd&&Wd!==e.transition)return ie.setOptions({transition:Wd}),void(Wd=!1);Sb(),Pb(Ed,"stage"),rd("go",!1),Hc(),od(),id(),jd()}};if(Sd){var k=Dd[Xc],l=Je!==Hd?yd[Hd][Xc]:null;ab(k,l,te,{time:d,method:e.transition,onEnd:j},Te)}else _(se,{pos:-r(Gd,Le.w,e.margin,Fd),overPos:f,time:d,onEnd:j});if(Gc(),Nd){Tc();var m=y(Je+h(Gd-Hd,-1,1));Rc({time:d,coo:m!==Je&&a.coo,guessIndex:"undefined"!=typeof a.coo?m:Je,keep:i}),Od&&Oc(d)}return be="undefined"!=typeof Hd&&Hd!==Je,Hd=Je,e.hash&&be&&!ie.eq&&H(Dd.id||Je+1),this},ie.requestFullScreen=function(){return Qd&&!ie.fullScreen&&(_d=Ec.scrollTop(),ae=Ec.scrollLeft(),Q(Ec),rd("x",!0),ee=d.extend({},Le),a.addClass(Zb).appendTo(Dc.addClass(jb)),Cc.addClass(jb),md(Cd,!0,!0),ie.fullScreen=!0,Rd&&vc.request(le),ie.resize(),Pb(Ed,"stage"),Sb(),fd("fullscreenenter")),this},ie.cancelFullScreen=function(){return Rd&&vc.is()?vc.cancel(b):kd(),this},ie.toggleFullScreen=function(){return ie[(ie.fullScreen?"cancel":"request")+"FullScreen"]()},T(b,vc.event,function(){!yd||vc.is()||Cd||kd()}),ie.resize=function(a){if(!yd)return this;var b=arguments[1]||0,c=arguments[2];ed(ie.fullScreen?{width:"100%",maxwidth:null,minwidth:null,height:"100%",maxheight:null,minheight:null}:R(a),[Le,c||ie.fullScreen||e]);var d=Le.width,f=Le.height,g=Le.ratio,i=Ec.height()-(Nd?ye.height():0);return q(d)&&(qe.addClass(ub).css({width:d,minWidth:Le.minwidth||0,maxWidth:Le.maxwidth||ad}),d=Le.W=Le.w=qe.width(),Le.nw=Nd&&p(e.navwidth,d)||d,e.glimpse&&(Le.w-=Math.round(2*(p(e.glimpse,d)||0))),se.css({width:Le.w,marginLeft:(Le.W-Le.w)/2}),f=p(f,i),f=f||g&&d/g,f&&(d=Math.round(d),f=Le.h=Math.round(h(f,p(Le.minheight,i),p(Le.maxheight,i))),re.stop().animate({width:d,height:f},b,function(){qe.removeClass(ub)}),cd(),Nd&&(ye.stop().animate({width:Le.nw},b),Rc({guessIndex:Je,time:b,keep:!0}),Od&&wc.nav&&Oc(b)),$d=c||!0,xd())),Se=re.offset().left,this},ie.setOptions=function(a){return d.extend(e,a),vd(),this},ie.shuffle=function(){return yd&&O(yd)&&vd(),this},ie.destroy=function(){return ie.cancelFullScreen(),ie.stopAutoplay(),yd=ie.data=null,j(),Ed=[],bd(Xc),vd.ok=!1,this},ie.playVideo=function(){var a=Dd,b=a.video,c=Je;return"object"==typeof b&&a.videoReady&&(Rd&&ie.fullScreen&&ie.cancelFullScreen(),G(function(){return!vc.is()||c!==Je},function(){c===Je&&(a.$video=a.$video||d(d.Fotorama.jst.video(b)),a.$video.appendTo(a[Xc]),qe.addClass(nb),Cd=a.$video,o(),we.blur(),De.blur(),fd("loadvideo"))})),this},ie.stopVideo=function(){return md(Cd,!0,!0),this},re.on("mousemove",od),Me=db(se,{onStart:gd,onMove:function(a,b){ld(re,b.edge)},onTouchEnd:hd,onEnd:function(a){ld(re);var b=(Nc&&!ge||a.touch)&&e.arrows&&"always"!==e.arrows;if(a.moved||b&&a.pos!==a.newPos&&!a.control){var c=s(a.newPos,Le.w,e.margin,Fd);ie.show({index:c,time:Sd?Vd:a.time,overPos:a.overPos,user:!0})}else a.aborted||a.control||qd(a.startEvent,b)},timeLow:1,timeHigh:1,friction:2,select:"."+Xb+", ."+Xb+" *",$wrap:re}),Oe=db(ze,{onStart:gd,onMove:function(a,b){ld(ye,b.edge)},onTouchEnd:hd,onEnd:function(a){function b(){Rc.l=a.newPos,id(),jd(),uc(a.newPos,!0)}if(a.moved)a.pos!==a.newPos?(ce=!0,_(ze,{time:a.time,pos:a.newPos,overPos:a.overPos,onEnd:b}),uc(a.newPos),Xd&&ld(ye,K(a.newPos,Oe.min,Oe.max))):b();else{var c=a.$target.closest("."+Mb,ze)[0];c&&sd.call(c,a.startEvent)}},timeLow:.5,timeHigh:2,friction:5,$wrap:ye}),Ne=eb(re,{shift:!0,onEnd:function(a,b){gd(),hd(),ie.show({index:b,slow:a.altKey})}}),Pe=eb(ye,{onEnd:function(a,b){gd(),hd();var c=v(ze)+.25*b;ze.css(k(h(c,Oe.min,Oe.max))),Xd&&ld(ye,K(c,Oe.min,Oe.max)),Pe.prevent={"<":c>=Oe.max,">":c<=Oe.min},clearTimeout(Pe.t),Pe.t=setTimeout(function(){Rc.l=c,uc(c,!0)},Pc),uc(c)}}),qe.hover(function(){setTimeout(function(){fe||nd(!(ge=!0))},0)},function(){ge&&nd(!(ge=!1))}),M(we,function(a){Y(a),td.call(this,a)},{onStart:function(){gd(),Me.control=!0},onTouchEnd:hd}),we.each(function(){W(this,function(a){td.call(this,a)}),ud(this)}),W(Ee,ie.toggleFullScreen),ud(Ee),d.each("load push pop shift unshift reverse sort splice".split(" "),function(a,b){ie[b]=function(){return yd=yd||[],"load"!==b?Array.prototype[b].apply(yd,arguments):arguments[0]&&"object"==typeof arguments[0]&&arguments[0].length&&(yd=P(arguments[0])),vd(),ie}}),vd()},d.fn.fotorama=function(b){return this.each(function(){var c=this,e=d(this),f=e.data(),g=f.fotorama;g?g.setOptions(b,!0):G(function(){return!E(c)},function(){f.urtext=e.html(),new d.Fotorama(e,d.extend({},cd,a.fotoramaDefaults,b,f))})})},d.Fotorama.instances=[],d.Fotorama.cache={},d.Fotorama.measures={},d=d||{},d.Fotorama=d.Fotorama||{},d.Fotorama.jst=d.Fotorama.jst||{},d.Fotorama.jst.style=function(a){{var b,c="";tc.escape}return c+=".fotorama"+(null==(b=a.s)?"":b)+" .fotorama__nav--thumbs .fotorama__nav__frame{\npadding:"+(null==(b=a.m)?"":b)+"px;\nheight:"+(null==(b=a.h)?"":b)+"px}\n.fotorama"+(null==(b=a.s)?"":b)+" .fotorama__thumb-border{\nheight:"+(null==(b=a.h-a.b*(a.q?0:2))?"":b)+"px;\nborder-width:"+(null==(b=a.b)?"":b)+"px;\nmargin-top:"+(null==(b=a.m)?"":b)+"px}"},d.Fotorama.jst.video=function(a){function b(){c+=d.call(arguments,"")}var c="",d=(tc.escape,Array.prototype.join);return c+='
\n'},d(function(){d("."+ib+':not([data-auto="false"])').fotorama()})}(window,document,location,"undefined"!=typeof jQuery&&jQuery); \ No newline at end of file diff --git a/vendor/assets/stylesheets/fotorama.scss b/vendor/assets/stylesheets/fotorama.scss index 37b6c30..b83b60a 100644 --- a/vendor/assets/stylesheets/fotorama.scss +++ b/vendor/assets/stylesheets/fotorama.scss @@ -1,4 +1,4 @@ /*! - * Fotorama 4.6.3 | http://fotorama.io/license/ + * Fotorama 4.6.4 | http://fotorama.io/license/ */ -.fotorama__arr:focus:after,.fotorama__fullscreen-icon:focus:after,.fotorama__html,.fotorama__img,.fotorama__nav__frame:focus .fotorama__dot:after,.fotorama__nav__frame:focus .fotorama__thumb:after,.fotorama__stage__frame,.fotorama__stage__shaft,.fotorama__video iframe{position:absolute;width:100%;height:100%;top:0;right:0;left:0;bottom:0}.fotorama--fullscreen,.fotorama__img{max-width:99999px!important;max-height:99999px!important;min-width:0!important;min-height:0!important;border-radius:0!important;box-shadow:none!important;padding:0!important}.fotorama__wrap .fotorama__grab{cursor:move;cursor:-webkit-grab;cursor:-o-grab;cursor:-ms-grab;cursor:grab}.fotorama__grabbing *{cursor:move;cursor:-webkit-grabbing;cursor:-o-grabbing;cursor:-ms-grabbing;cursor:grabbing}.fotorama__spinner{position:absolute!important;top:50%!important;left:50%!important}.fotorama__wrap--css3 .fotorama__arr,.fotorama__wrap--css3 .fotorama__fullscreen-icon,.fotorama__wrap--css3 .fotorama__nav__shaft,.fotorama__wrap--css3 .fotorama__stage__shaft,.fotorama__wrap--css3 .fotorama__thumb-border,.fotorama__wrap--css3 .fotorama__video-close,.fotorama__wrap--css3 .fotorama__video-play{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.fotorama__caption,.fotorama__nav:after,.fotorama__nav:before,.fotorama__stage:after,.fotorama__stage:before,.fotorama__wrap--css3 .fotorama__html,.fotorama__wrap--css3 .fotorama__nav,.fotorama__wrap--css3 .fotorama__spinner,.fotorama__wrap--css3 .fotorama__stage,.fotorama__wrap--css3 .fotorama__stage .fotorama__img,.fotorama__wrap--css3 .fotorama__stage__frame{-webkit-transform:translateZ(0);transform:translateZ(0)}.fotorama__arr:focus,.fotorama__fullscreen-icon:focus,.fotorama__nav__frame{outline:0}.fotorama__arr:focus:after,.fotorama__fullscreen-icon:focus:after,.fotorama__nav__frame:focus .fotorama__dot:after,.fotorama__nav__frame:focus .fotorama__thumb:after{content:'';border-radius:inherit;background-color:rgba(0,175,234,.5)}.fotorama__wrap--video .fotorama__stage,.fotorama__wrap--video .fotorama__stage__frame--video,.fotorama__wrap--video .fotorama__stage__frame--video .fotorama__html,.fotorama__wrap--video .fotorama__stage__frame--video .fotorama__img,.fotorama__wrap--video .fotorama__stage__shaft{-webkit-transform:none!important;transform:none!important}.fotorama__wrap--css3 .fotorama__nav__shaft,.fotorama__wrap--css3 .fotorama__stage__shaft,.fotorama__wrap--css3 .fotorama__thumb-border{transition-property:-webkit-transform,width;transition-property:transform,width;transition-timing-function:cubic-bezier(0.1,0,.25,1);transition-duration:0ms}.fotorama__arr,.fotorama__fullscreen-icon,.fotorama__no-select,.fotorama__video-close,.fotorama__video-play,.fotorama__wrap{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.fotorama__select{-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text}.fotorama__nav,.fotorama__nav__frame{margin:auto;padding:0}.fotorama__caption__wrap,.fotorama__nav__frame,.fotorama__nav__shaft{-moz-box-orient:vertical;display:inline-block;vertical-align:middle;*display:inline;*zoom:1}.fotorama__nav__frame,.fotorama__thumb-border{box-sizing:content-box}.fotorama__caption__wrap{box-sizing:border-box}.fotorama--hidden,.fotorama__load{position:absolute;left:-99999px;top:-99999px;z-index:-1}.fotorama__arr,.fotorama__fullscreen-icon,.fotorama__nav,.fotorama__nav__frame,.fotorama__nav__shaft,.fotorama__stage__frame,.fotorama__stage__shaft,.fotorama__video-close,.fotorama__video-play{-webkit-tap-highlight-color:transparent}.fotorama__arr,.fotorama__fullscreen-icon,.fotorama__video-close,.fotorama__video-play{background:image-url("fotorama.png") no-repeat}@media (-webkit-min-device-pixel-ratio:1.5),(min-resolution:2dppx){.fotorama__arr,.fotorama__fullscreen-icon,.fotorama__video-close,.fotorama__video-play{background:image-url("fotorama@2x.png") 0 0/96px 160px no-repeat}}.fotorama__thumb{background-color:#7f7f7f;background-color:rgba(127,127,127,.2)}@media print{.fotorama__arr,.fotorama__fullscreen-icon,.fotorama__thumb-border,.fotorama__video-close,.fotorama__video-play{background:none!important}}.fotorama{min-width:1px;overflow:hidden}.fotorama:not(.fotorama--unobtrusive)>*:not(:first-child){display:none}.fullscreen{width:100%!important;height:100%!important;max-width:100%!important;max-height:100%!important;margin:0!important;padding:0!important;overflow:hidden!important;background:#000}.fotorama--fullscreen{position:absolute!important;top:0!important;left:0!important;right:0!important;bottom:0!important;float:none!important;z-index:2147483647!important;background:#000;width:100%!important;height:100%!important;margin:0!important}.fotorama--fullscreen .fotorama__nav,.fotorama--fullscreen .fotorama__stage{background:#000}.fotorama__wrap{-webkit-text-size-adjust:100%;position:relative;direction:ltr;z-index:0}.fotorama__wrap--rtl .fotorama__stage__frame{direction:rtl}.fotorama__nav,.fotorama__stage{overflow:hidden;position:relative;max-width:100%}.fotorama__wrap--pan-y{-ms-touch-action:pan-y}.fotorama__wrap .fotorama__pointer{cursor:pointer}.fotorama__wrap--slide .fotorama__stage__frame{opacity:1!important}.fotorama__stage__frame{overflow:hidden}.fotorama__stage__frame.fotorama__active{z-index:8}.fotorama__wrap--fade .fotorama__stage__frame{display:none}.fotorama__wrap--fade .fotorama__fade-front,.fotorama__wrap--fade .fotorama__fade-rear,.fotorama__wrap--fade .fotorama__stage__frame.fotorama__active{display:block;left:0;top:0}.fotorama__wrap--fade .fotorama__fade-front{z-index:8}.fotorama__wrap--fade .fotorama__fade-rear{z-index:7}.fotorama__wrap--fade .fotorama__fade-rear.fotorama__active{z-index:9}.fotorama__wrap--fade .fotorama__stage .fotorama__shadow{display:none}.fotorama__img{-ms-filter:"alpha(Opacity=0)";filter:alpha(opacity=0);opacity:0;border:none!important}.fotorama__error .fotorama__img,.fotorama__loaded .fotorama__img{-ms-filter:"alpha(Opacity=100)";filter:alpha(opacity=100);opacity:1}.fotorama--fullscreen .fotorama__loaded--full .fotorama__img,.fotorama__img--full{display:none}.fotorama--fullscreen .fotorama__loaded--full .fotorama__img--full{display:block}.fotorama__wrap--only-active .fotorama__nav,.fotorama__wrap--only-active .fotorama__stage{max-width:99999px!important}.fotorama__wrap--only-active .fotorama__stage__frame{visibility:hidden}.fotorama__wrap--only-active .fotorama__stage__frame.fotorama__active{visibility:visible}.fotorama__nav{font-size:0;line-height:0;text-align:center;display:none;white-space:nowrap;z-index:5}.fotorama__nav__shaft{position:relative;left:0;top:0;text-align:left}.fotorama__nav__frame{position:relative;cursor:pointer}.fotorama__nav--dots{display:block}.fotorama__nav--dots .fotorama__nav__frame{width:18px;height:30px}.fotorama__nav--dots .fotorama__nav__frame--thumb,.fotorama__nav--dots .fotorama__thumb-border{display:none}.fotorama__nav--thumbs{display:block}.fotorama__nav--thumbs .fotorama__nav__frame{padding-left:0!important}.fotorama__nav--thumbs .fotorama__nav__frame:last-child{padding-right:0!important}.fotorama__nav--thumbs .fotorama__nav__frame--dot{display:none}.fotorama__dot{display:block;width:4px;height:4px;position:relative;top:12px;left:6px;border-radius:6px;border:1px solid #7f7f7f}.fotorama__nav__frame:focus .fotorama__dot:after{padding:1px;top:-1px;left:-1px}.fotorama__nav__frame.fotorama__active .fotorama__dot{width:0;height:0;border-width:3px}.fotorama__nav__frame.fotorama__active .fotorama__dot:after{padding:3px;top:-3px;left:-3px}.fotorama__thumb{overflow:hidden;position:relative;width:100%;height:100%}.fotorama__nav__frame:focus .fotorama__thumb{z-index:2}.fotorama__thumb-border{position:absolute;z-index:9;top:0;left:0;border-style:solid;border-color:#00afea;background-image:linear-gradient(to bottom right,rgba(255,255,255,.25),rgba(64,64,64,.1))}.fotorama__caption{position:absolute;z-index:12;bottom:0;left:0;right:0;font-family:'Helvetica Neue',Arial,sans-serif;font-size:14px;line-height:1.5;color:#000}.fotorama__caption a{text-decoration:none;color:#000;border-bottom:1px solid;border-color:rgba(0,0,0,.5)}.fotorama__caption a:hover{color:#333;border-color:rgba(51,51,51,.5)}.fotorama__wrap--rtl .fotorama__caption{left:auto;right:0}.fotorama__wrap--no-captions .fotorama__caption,.fotorama__wrap--video .fotorama__caption{display:none}.fotorama__caption__wrap{background-color:#fff;background-color:rgba(255,255,255,.9);padding:5px 10px}@-webkit-keyframes spinner{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes spinner{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.fotorama__wrap--css3 .fotorama__spinner{-webkit-animation:spinner 24s infinite linear;animation:spinner 24s infinite linear}.fotorama__wrap--css3 .fotorama__html,.fotorama__wrap--css3 .fotorama__stage .fotorama__img{transition-property:opacity;transition-timing-function:linear;transition-duration:.3s}.fotorama__wrap--video .fotorama__stage__frame--video .fotorama__html,.fotorama__wrap--video .fotorama__stage__frame--video .fotorama__img{-ms-filter:"alpha(Opacity=0)";filter:alpha(opacity=0);opacity:0}.fotorama__select{cursor:auto}.fotorama__video{top:32px;right:0;bottom:0;left:0;position:absolute;z-index:10}@-moz-document url-prefix(){.fotorama__active{box-shadow:0 0 0 transparent}}.fotorama__arr,.fotorama__fullscreen-icon,.fotorama__video-close,.fotorama__video-play{position:absolute;z-index:11;cursor:pointer}.fotorama__arr{position:absolute;width:32px;height:32px;top:50%;margin-top:-16px}.fotorama__arr--prev{left:2px;background-position:0 0}.fotorama__arr--next{right:2px;background-position:-32px 0}.fotorama__arr--disabled{pointer-events:none;cursor:default;*display:none;opacity:.1}.fotorama__fullscreen-icon{width:32px;height:32px;top:2px;right:2px;background-position:0 -32px;z-index:20}.fotorama__arr:focus,.fotorama__fullscreen-icon:focus{border-radius:50%}.fotorama--fullscreen .fotorama__fullscreen-icon{background-position:-32px -32px}.fotorama__video-play{width:96px;height:96px;left:50%;top:50%;margin-left:-48px;margin-top:-48px;background-position:0 -64px;opacity:0}.fotorama__wrap--css2 .fotorama__video-play,.fotorama__wrap--video .fotorama__stage .fotorama__video-play{display:none}.fotorama__error .fotorama__video-play,.fotorama__loaded .fotorama__video-play,.fotorama__nav__frame .fotorama__video-play{opacity:1;display:block}.fotorama__nav__frame .fotorama__video-play{width:32px;height:32px;margin-left:-16px;margin-top:-16px;background-position:-64px -32px}.fotorama__video-close{width:32px;height:32px;top:0;right:0;background-position:-64px 0;z-index:20;opacity:0}.fotorama__wrap--css2 .fotorama__video-close{display:none}.fotorama__wrap--css3 .fotorama__video-close{-webkit-transform:translate3d(32px,-32px,0);transform:translate3d(32px,-32px,0)}.fotorama__wrap--video .fotorama__video-close{display:block;opacity:1}.fotorama__wrap--css3.fotorama__wrap--video .fotorama__video-close{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.fotorama__wrap--no-controls.fotorama__wrap--toggle-arrows .fotorama__arr,.fotorama__wrap--no-controls.fotorama__wrap--toggle-arrows .fotorama__fullscreen-icon{opacity:0}.fotorama__wrap--no-controls.fotorama__wrap--toggle-arrows .fotorama__arr:focus,.fotorama__wrap--no-controls.fotorama__wrap--toggle-arrows .fotorama__fullscreen-icon:focus{opacity:1}.fotorama__wrap--video .fotorama__arr,.fotorama__wrap--video .fotorama__fullscreen-icon{opacity:0!important}.fotorama__wrap--css2.fotorama__wrap--no-controls.fotorama__wrap--toggle-arrows .fotorama__arr,.fotorama__wrap--css2.fotorama__wrap--no-controls.fotorama__wrap--toggle-arrows .fotorama__fullscreen-icon{display:none}.fotorama__wrap--css2.fotorama__wrap--no-controls.fotorama__wrap--toggle-arrows .fotorama__arr:focus,.fotorama__wrap--css2.fotorama__wrap--no-controls.fotorama__wrap--toggle-arrows .fotorama__fullscreen-icon:focus{display:block}.fotorama__wrap--css2.fotorama__wrap--video .fotorama__arr,.fotorama__wrap--css2.fotorama__wrap--video .fotorama__fullscreen-icon{display:none!important}.fotorama__wrap--css3.fotorama__wrap--no-controls.fotorama__wrap--slide.fotorama__wrap--toggle-arrows .fotorama__fullscreen-icon:not(:focus){-webkit-transform:translate3d(32px,-32px,0);transform:translate3d(32px,-32px,0)}.fotorama__wrap--css3.fotorama__wrap--no-controls.fotorama__wrap--slide.fotorama__wrap--toggle-arrows .fotorama__arr--prev:not(:focus){-webkit-transform:translate3d(-48px,0,0);transform:translate3d(-48px,0,0)}.fotorama__wrap--css3.fotorama__wrap--no-controls.fotorama__wrap--slide.fotorama__wrap--toggle-arrows .fotorama__arr--next:not(:focus){-webkit-transform:translate3d(48px,0,0);transform:translate3d(48px,0,0)}.fotorama__wrap--css3.fotorama__wrap--video .fotorama__fullscreen-icon{-webkit-transform:translate3d(32px,-32px,0)!important;transform:translate3d(32px,-32px,0)!important}.fotorama__wrap--css3.fotorama__wrap--video .fotorama__arr--prev{-webkit-transform:translate3d(-48px,0,0)!important;transform:translate3d(-48px,0,0)!important}.fotorama__wrap--css3.fotorama__wrap--video .fotorama__arr--next{-webkit-transform:translate3d(48px,0,0)!important;transform:translate3d(48px,0,0)!important}.fotorama__wrap--css3 .fotorama__arr:not(:focus),.fotorama__wrap--css3 .fotorama__fullscreen-icon:not(:focus),.fotorama__wrap--css3 .fotorama__video-close:not(:focus),.fotorama__wrap--css3 .fotorama__video-play:not(:focus){transition-property:-webkit-transform,opacity;transition-property:transform,opacity;transition-duration:.3s}.fotorama__nav:after,.fotorama__nav:before,.fotorama__stage:after,.fotorama__stage:before{content:"";display:block;position:absolute;text-decoration:none;top:0;bottom:0;width:10px;height:auto;z-index:10;pointer-events:none;background-repeat:no-repeat;background-size:1px 100%,5px 100%}.fotorama__nav:before,.fotorama__stage:before{background-image:linear-gradient(transparent,rgba(0,0,0,.2) 25%,rgba(0,0,0,.3) 75%,transparent),radial-gradient(farthest-side at 0 50%,rgba(0,0,0,.4),transparent);background-position:0 0,0 0;left:-10px}.fotorama__nav.fotorama__shadows--left:before,.fotorama__stage.fotorama__shadows--left:before{left:0}.fotorama__nav:after,.fotorama__stage:after{background-image:linear-gradient(transparent,rgba(0,0,0,.2) 25%,rgba(0,0,0,.3) 75%,transparent),radial-gradient(farthest-side at 100% 50%,rgba(0,0,0,.4),transparent);background-position:100% 0,100% 0;right:-10px}.fotorama__nav.fotorama__shadows--right:after,.fotorama__stage.fotorama__shadows--right:after{right:0}.fotorama--fullscreen .fotorama__nav:after,.fotorama--fullscreen .fotorama__nav:before,.fotorama--fullscreen .fotorama__stage:after,.fotorama--fullscreen .fotorama__stage:before,.fotorama__wrap--fade .fotorama__stage:after,.fotorama__wrap--fade .fotorama__stage:before,.fotorama__wrap--no-shadows .fotorama__nav:after,.fotorama__wrap--no-shadows .fotorama__nav:before,.fotorama__wrap--no-shadows .fotorama__stage:after,.fotorama__wrap--no-shadows .fotorama__stage:before{display:none} +.fotorama__arr:focus:after,.fotorama__fullscreen-icon:focus:after,.fotorama__html,.fotorama__img,.fotorama__nav__frame:focus .fotorama__dot:after,.fotorama__nav__frame:focus .fotorama__thumb:after,.fotorama__stage__frame,.fotorama__stage__shaft,.fotorama__video iframe{position:absolute;width:100%;height:100%;top:0;right:0;left:0;bottom:0}.fotorama--fullscreen,.fotorama__img{max-width:99999px!important;max-height:99999px!important;min-width:0!important;min-height:0!important;border-radius:0!important;box-shadow:none!important;padding:0!important}.fotorama__wrap .fotorama__grab{cursor:move;cursor:-webkit-grab;cursor:-o-grab;cursor:-ms-grab;cursor:grab}.fotorama__grabbing *{cursor:move;cursor:-webkit-grabbing;cursor:-o-grabbing;cursor:-ms-grabbing;cursor:grabbing}.fotorama__spinner{position:absolute!important;top:50%!important;left:50%!important}.fotorama__wrap--css3 .fotorama__arr,.fotorama__wrap--css3 .fotorama__fullscreen-icon,.fotorama__wrap--css3 .fotorama__nav__shaft,.fotorama__wrap--css3 .fotorama__stage__shaft,.fotorama__wrap--css3 .fotorama__thumb-border,.fotorama__wrap--css3 .fotorama__video-close,.fotorama__wrap--css3 .fotorama__video-play{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.fotorama__caption,.fotorama__nav:after,.fotorama__nav:before,.fotorama__stage:after,.fotorama__stage:before,.fotorama__wrap--css3 .fotorama__html,.fotorama__wrap--css3 .fotorama__nav,.fotorama__wrap--css3 .fotorama__spinner,.fotorama__wrap--css3 .fotorama__stage,.fotorama__wrap--css3 .fotorama__stage .fotorama__img,.fotorama__wrap--css3 .fotorama__stage__frame{-webkit-transform:translateZ(0);transform:translateZ(0)}.fotorama__arr:focus,.fotorama__fullscreen-icon:focus,.fotorama__nav__frame{outline:0}.fotorama__arr:focus:after,.fotorama__fullscreen-icon:focus:after,.fotorama__nav__frame:focus .fotorama__dot:after,.fotorama__nav__frame:focus .fotorama__thumb:after{content:'';border-radius:inherit;background-color:rgba(0,175,234,.5)}.fotorama__wrap--video .fotorama__stage,.fotorama__wrap--video .fotorama__stage__frame--video,.fotorama__wrap--video .fotorama__stage__frame--video .fotorama__html,.fotorama__wrap--video .fotorama__stage__frame--video .fotorama__img,.fotorama__wrap--video .fotorama__stage__shaft{-webkit-transform:none!important;transform:none!important}.fotorama__wrap--css3 .fotorama__nav__shaft,.fotorama__wrap--css3 .fotorama__stage__shaft,.fotorama__wrap--css3 .fotorama__thumb-border{transition-property:-webkit-transform,width;transition-property:transform,width;transition-timing-function:cubic-bezier(0.1,0,.25,1);transition-duration:0ms}.fotorama__arr,.fotorama__fullscreen-icon,.fotorama__no-select,.fotorama__video-close,.fotorama__video-play,.fotorama__wrap{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.fotorama__select{-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text}.fotorama__nav,.fotorama__nav__frame{margin:auto;padding:0}.fotorama__caption__wrap,.fotorama__nav__frame,.fotorama__nav__shaft{-moz-box-orient:vertical;display:inline-block;vertical-align:middle;*display:inline;*zoom:1}.fotorama__nav__frame,.fotorama__thumb-border{box-sizing:content-box}.fotorama__caption__wrap{box-sizing:border-box}.fotorama--hidden,.fotorama__load{position:absolute;left:-99999px;top:-99999px;z-index:-1}.fotorama__arr,.fotorama__fullscreen-icon,.fotorama__nav,.fotorama__nav__frame,.fotorama__nav__shaft,.fotorama__stage__frame,.fotorama__stage__shaft,.fotorama__video-close,.fotorama__video-play{-webkit-tap-highlight-color:transparent}.fotorama__arr,.fotorama__fullscreen-icon,.fotorama__video-close,.fotorama__video-play{background:image-url("fotorama.png") no-repeat}@media (-webkit-min-device-pixel-ratio:1.5),(min-resolution:2dppx){.fotorama__arr,.fotorama__fullscreen-icon,.fotorama__video-close,.fotorama__video-play{background:image-url("fotorama@2x.png") 0 0/96px 160px no-repeat}}.fotorama__thumb{background-color:#7f7f7f;background-color:rgba(127,127,127,.2)}@media print{.fotorama__arr,.fotorama__fullscreen-icon,.fotorama__thumb-border,.fotorama__video-close,.fotorama__video-play{background:none!important}}.fotorama{min-width:1px;overflow:hidden}.fotorama:not(.fotorama--unobtrusive)>*:not(:first-child){display:none}.fullscreen{width:100%!important;height:100%!important;max-width:100%!important;max-height:100%!important;margin:0!important;padding:0!important;overflow:hidden!important;background:#000}.fotorama--fullscreen{position:absolute!important;top:0!important;left:0!important;right:0!important;bottom:0!important;float:none!important;z-index:2147483647!important;background:#000;width:100%!important;height:100%!important;margin:0!important}.fotorama--fullscreen .fotorama__nav,.fotorama--fullscreen .fotorama__stage{background:#000}.fotorama__wrap{-webkit-text-size-adjust:100%;position:relative;direction:ltr;z-index:0}.fotorama__wrap--rtl .fotorama__stage__frame{direction:rtl}.fotorama__nav,.fotorama__stage{overflow:hidden;position:relative;max-width:100%}.fotorama__wrap--pan-y{-ms-touch-action:pan-y}.fotorama__wrap .fotorama__pointer{cursor:pointer}.fotorama__wrap--slide .fotorama__stage__frame{opacity:1!important}.fotorama__stage__frame{overflow:hidden}.fotorama__stage__frame.fotorama__active{z-index:8}.fotorama__wrap--fade .fotorama__stage__frame{display:none}.fotorama__wrap--fade .fotorama__fade-front,.fotorama__wrap--fade .fotorama__fade-rear,.fotorama__wrap--fade .fotorama__stage__frame.fotorama__active{display:block;left:0;top:0}.fotorama__wrap--fade .fotorama__fade-front{z-index:8}.fotorama__wrap--fade .fotorama__fade-rear{z-index:7}.fotorama__wrap--fade .fotorama__fade-rear.fotorama__active{z-index:9}.fotorama__wrap--fade .fotorama__stage .fotorama__shadow{display:none}.fotorama__img{-ms-filter:"alpha(Opacity=0)";filter:alpha(opacity=0);opacity:0;border:none!important}.fotorama__error .fotorama__img,.fotorama__loaded .fotorama__img{-ms-filter:"alpha(Opacity=100)";filter:alpha(opacity=100);opacity:1}.fotorama--fullscreen .fotorama__loaded--full .fotorama__img,.fotorama__img--full{display:none}.fotorama--fullscreen .fotorama__loaded--full .fotorama__img--full{display:block}.fotorama__wrap--only-active .fotorama__nav,.fotorama__wrap--only-active .fotorama__stage{max-width:99999px!important}.fotorama__wrap--only-active .fotorama__stage__frame{visibility:hidden}.fotorama__wrap--only-active .fotorama__stage__frame.fotorama__active{visibility:visible}.fotorama__nav{font-size:0;line-height:0;text-align:center;display:none;white-space:nowrap;z-index:5}.fotorama__nav__shaft{position:relative;left:0;top:0;text-align:left}.fotorama__nav__frame{position:relative;cursor:pointer}.fotorama__nav--dots{display:block}.fotorama__nav--dots .fotorama__nav__frame{width:18px;height:30px}.fotorama__nav--dots .fotorama__nav__frame--thumb,.fotorama__nav--dots .fotorama__thumb-border{display:none}.fotorama__nav--thumbs{display:block}.fotorama__nav--thumbs .fotorama__nav__frame{padding-left:0!important}.fotorama__nav--thumbs .fotorama__nav__frame:last-child{padding-right:0!important}.fotorama__nav--thumbs .fotorama__nav__frame--dot{display:none}.fotorama__dot{display:block;width:4px;height:4px;position:relative;top:12px;left:6px;border-radius:6px;border:1px solid #7f7f7f}.fotorama__nav__frame:focus .fotorama__dot:after{padding:1px;top:-1px;left:-1px}.fotorama__nav__frame.fotorama__active .fotorama__dot{width:0;height:0;border-width:3px}.fotorama__nav__frame.fotorama__active .fotorama__dot:after{padding:3px;top:-3px;left:-3px}.fotorama__thumb{overflow:hidden;position:relative;width:100%;height:100%}.fotorama__nav__frame:focus .fotorama__thumb{z-index:2}.fotorama__thumb-border{position:absolute;z-index:9;top:0;left:0;border-style:solid;border-color:#00afea;background-image:linear-gradient(to bottom right,rgba(255,255,255,.25),rgba(64,64,64,.1))}.fotorama__caption{position:absolute;z-index:12;bottom:0;left:0;right:0;font-family:'Helvetica Neue',Arial,sans-serif;font-size:14px;line-height:1.5;color:#000}.fotorama__caption a{text-decoration:none;color:#000;border-bottom:1px solid;border-color:rgba(0,0,0,.5)}.fotorama__caption a:hover{color:#333;border-color:rgba(51,51,51,.5)}.fotorama__wrap--rtl .fotorama__caption{left:auto;right:0}.fotorama__wrap--no-captions .fotorama__caption,.fotorama__wrap--video .fotorama__caption{display:none}.fotorama__caption__wrap{background-color:#fff;background-color:rgba(255,255,255,.9);padding:5px 10px}@-webkit-keyframes spinner{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes spinner{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.fotorama__wrap--css3 .fotorama__spinner{-webkit-animation:spinner 24s infinite linear;animation:spinner 24s infinite linear}.fotorama__wrap--css3 .fotorama__html,.fotorama__wrap--css3 .fotorama__stage .fotorama__img{transition-property:opacity;transition-timing-function:linear;transition-duration:.3s}.fotorama__wrap--video .fotorama__stage__frame--video .fotorama__html,.fotorama__wrap--video .fotorama__stage__frame--video .fotorama__img{-ms-filter:"alpha(Opacity=0)";filter:alpha(opacity=0);opacity:0}.fotorama__select{cursor:auto}.fotorama__video{top:32px;right:0;bottom:0;left:0;position:absolute;z-index:10}@-moz-document url-prefix(){.fotorama__active{box-shadow:0 0 0 transparent}}.fotorama__arr,.fotorama__fullscreen-icon,.fotorama__video-close,.fotorama__video-play{position:absolute;z-index:11;cursor:pointer}.fotorama__arr{position:absolute;width:32px;height:32px;top:50%;margin-top:-16px}.fotorama__arr--prev{left:2px;background-position:0 0}.fotorama__arr--next{right:2px;background-position:-32px 0}.fotorama__arr--disabled{pointer-events:none;cursor:default;*display:none;opacity:.1}.fotorama__fullscreen-icon{width:32px;height:32px;top:2px;right:2px;background-position:0 -32px;z-index:20}.fotorama__arr:focus,.fotorama__fullscreen-icon:focus{border-radius:50%}.fotorama--fullscreen .fotorama__fullscreen-icon{background-position:-32px -32px}.fotorama__video-play{width:96px;height:96px;left:50%;top:50%;margin-left:-48px;margin-top:-48px;background-position:0 -64px;opacity:0}.fotorama__wrap--css2 .fotorama__video-play,.fotorama__wrap--video .fotorama__stage .fotorama__video-play{display:none}.fotorama__error .fotorama__video-play,.fotorama__loaded .fotorama__video-play,.fotorama__nav__frame .fotorama__video-play{opacity:1;display:block}.fotorama__nav__frame .fotorama__video-play{width:32px;height:32px;margin-left:-16px;margin-top:-16px;background-position:-64px -32px}.fotorama__video-close{width:32px;height:32px;top:0;right:0;background-position:-64px 0;z-index:20;opacity:0}.fotorama__wrap--css2 .fotorama__video-close{display:none}.fotorama__wrap--css3 .fotorama__video-close{-webkit-transform:translate3d(32px,-32px,0);transform:translate3d(32px,-32px,0)}.fotorama__wrap--video .fotorama__video-close{display:block;opacity:1}.fotorama__wrap--css3.fotorama__wrap--video .fotorama__video-close{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.fotorama__wrap--no-controls.fotorama__wrap--toggle-arrows .fotorama__arr,.fotorama__wrap--no-controls.fotorama__wrap--toggle-arrows .fotorama__fullscreen-icon{opacity:0}.fotorama__wrap--no-controls.fotorama__wrap--toggle-arrows .fotorama__arr:focus,.fotorama__wrap--no-controls.fotorama__wrap--toggle-arrows .fotorama__fullscreen-icon:focus{opacity:1}.fotorama__wrap--video .fotorama__arr,.fotorama__wrap--video .fotorama__fullscreen-icon{opacity:0!important}.fotorama__wrap--css2.fotorama__wrap--no-controls.fotorama__wrap--toggle-arrows .fotorama__arr,.fotorama__wrap--css2.fotorama__wrap--no-controls.fotorama__wrap--toggle-arrows .fotorama__fullscreen-icon{display:none}.fotorama__wrap--css2.fotorama__wrap--no-controls.fotorama__wrap--toggle-arrows .fotorama__arr:focus,.fotorama__wrap--css2.fotorama__wrap--no-controls.fotorama__wrap--toggle-arrows .fotorama__fullscreen-icon:focus{display:block}.fotorama__wrap--css2.fotorama__wrap--video .fotorama__arr,.fotorama__wrap--css2.fotorama__wrap--video .fotorama__fullscreen-icon{display:none!important}.fotorama__wrap--css3.fotorama__wrap--no-controls.fotorama__wrap--slide.fotorama__wrap--toggle-arrows .fotorama__fullscreen-icon:not(:focus){-webkit-transform:translate3d(32px,-32px,0);transform:translate3d(32px,-32px,0)}.fotorama__wrap--css3.fotorama__wrap--no-controls.fotorama__wrap--slide.fotorama__wrap--toggle-arrows .fotorama__arr--prev:not(:focus){-webkit-transform:translate3d(-48px,0,0);transform:translate3d(-48px,0,0)}.fotorama__wrap--css3.fotorama__wrap--no-controls.fotorama__wrap--slide.fotorama__wrap--toggle-arrows .fotorama__arr--next:not(:focus){-webkit-transform:translate3d(48px,0,0);transform:translate3d(48px,0,0)}.fotorama__wrap--css3.fotorama__wrap--video .fotorama__fullscreen-icon{-webkit-transform:translate3d(32px,-32px,0)!important;transform:translate3d(32px,-32px,0)!important}.fotorama__wrap--css3.fotorama__wrap--video .fotorama__arr--prev{-webkit-transform:translate3d(-48px,0,0)!important;transform:translate3d(-48px,0,0)!important}.fotorama__wrap--css3.fotorama__wrap--video .fotorama__arr--next{-webkit-transform:translate3d(48px,0,0)!important;transform:translate3d(48px,0,0)!important}.fotorama__wrap--css3 .fotorama__arr:not(:focus),.fotorama__wrap--css3 .fotorama__fullscreen-icon:not(:focus),.fotorama__wrap--css3 .fotorama__video-close:not(:focus),.fotorama__wrap--css3 .fotorama__video-play:not(:focus){transition-property:-webkit-transform,opacity;transition-property:transform,opacity;transition-duration:.3s}.fotorama__nav:after,.fotorama__nav:before,.fotorama__stage:after,.fotorama__stage:before{content:"";display:block;position:absolute;text-decoration:none;top:0;bottom:0;width:10px;height:auto;z-index:10;pointer-events:none;background-repeat:no-repeat;background-size:1px 100%,5px 100%}.fotorama__nav:before,.fotorama__stage:before{background-image:linear-gradient(transparent,rgba(0,0,0,.2) 25%,rgba(0,0,0,.3) 75%,transparent),radial-gradient(farthest-side at 0 50%,rgba(0,0,0,.4),transparent);background-position:0 0,0 0;left:-10px}.fotorama__nav.fotorama__shadows--left:before,.fotorama__stage.fotorama__shadows--left:before{left:0}.fotorama__nav:after,.fotorama__stage:after{background-image:linear-gradient(transparent,rgba(0,0,0,.2) 25%,rgba(0,0,0,.3) 75%,transparent),radial-gradient(farthest-side at 100% 50%,rgba(0,0,0,.4),transparent);background-position:100% 0,100% 0;right:-10px}.fotorama__nav.fotorama__shadows--right:after,.fotorama__stage.fotorama__shadows--right:after{right:0}.fotorama--fullscreen .fotorama__nav:after,.fotorama--fullscreen .fotorama__nav:before,.fotorama--fullscreen .fotorama__stage:after,.fotorama--fullscreen .fotorama__stage:before,.fotorama__wrap--fade .fotorama__stage:after,.fotorama__wrap--fade .fotorama__stage:before,.fotorama__wrap--no-shadows .fotorama__nav:after,.fotorama__wrap--no-shadows .fotorama__nav:before,.fotorama__wrap--no-shadows .fotorama__stage:after,.fotorama__wrap--no-shadows .fotorama__stage:before{display:none} \ No newline at end of file