// page init
jQuery(function () {
jcf.customForms.replaceAll();
//initDropDown();
//initOpenClose();
//initLightbox();
//initAccordion();
initSameHeight();
//initPopups();
//initCarousel();
//initFitVids();
initDropDownClasses();
//initSlideShow();
//jQuery('input, textarea').placeholder();
//initTooltip();
//initMobileNav();
//initStickyHeader();
//initDottedText();
initMainNavigation();
initTimeline();
initAccordionChildFloating();
initBoxGrid();
initPlaceholders();
initMatchHeight();
initAffixes();
initFixedHeader();
});
function initFixedHeader(){
$(window).scroll(function(){
var sticky = $('.sticky-header'),
scroll = $(window).scrollTop();
var scrollTop = parseInt(sticky.data('scroll-top'));
if (scroll >= scrollTop) sticky.addClass('fixed');
else sticky.removeClass('fixed');
});
}
function initAffixes() {
$('#search-wrapper').affix(
{
offset: {
top: 200
}
}
);
}
function initMatchHeight(){
$('.panel.panel-stock-quote .panel-heading .panel-title').matchHeight();
$(window).resize(function () {
$('.panel.panel-stock-quote .panel-heading .panel-title').matchHeight();
});
}
function initPlaceholders(){
$('[placeholder]').focus(function() {
var input = $(this);
if (input.val() == input.attr('placeholder')) {
input.val('');
input.removeClass('placeholder');
}
}).blur(function() {
var input = $(this);
if (input.val() == '' || input.val() == input.attr('placeholder')) {
input.addClass('placeholder');
input.val(input.attr('placeholder'));
}
}).blur();
$('[placeholder]').parents('form').submit(function() {
$(this).find('[placeholder]').each(function() {
var input = $(this);
if (input.val() == input.attr('placeholder')) {
input.val('');
}
})
});
}
jQuery(window).load(function () {
initCustomOpenClose();
})
function initBoxGrid(){
var layoutType = $('#hfLayoutValue').val();
var typeClass = 'hfLayoutValue-' + $('#hfLayoutValue').val();
$(window).load(function () {
$.fn.matchHeight._beforeUpdate = function(event, groups){
$('.glance-box').find('.item').css('height','');
$(groups[0].elements[0]).closest('.glance-box').removeClass('match-height');
}
$.fn.matchHeight._afterUpdate = function(event, groups){
$('.glance-box').addClass('match-height');
}
$('.glance-box').addClass('match-height ' + typeClass);
if (layoutType == "2" || layoutType == "4") {
var height = 0;
height += parseInt($('.item:eq(2)').css("height").replace("px", ""));
height += parseInt($('.item:eq(3)').css("height").replace("px", ""));
$('.glance-box').find('.item:first').attr("style", "height:" + ((height) + 10) + "px");
} else if(layoutType == "3"){
$('.glance-box').find('.item').css('height', parseInt($('.glance-box .item:eq(0)').css('height').replace('px',''))+35 + 'px');
}
});
if ($("#hfLayoutValue").val() != "2" && $("#hfLayoutValue").val() != "4") {
$('.glance-box').find('.item').matchHeight(false);
}
else
{
$('.glance-box').find('.item').matchHeight(false);
}
}
function initAccordionChildFloating(){
$('.collapse').each(function(){
var container = $(this);
container.find('.contact').each(function(index, item){
var contact = $(item);
if (((index + 1) % 3) == 0) {
$('
').insertAfter(contact);
}
if (((index + 1) % 2) == 0) {
$('').insertAfter(contact);
}
});
});
}
function initMainNavigation() {
$(".nav-main > li").hoverIntent({
over: function () {
var target = $(this).find('.drop');
$(target).fadeIn("fast");
},
out: function () {
var target = $(this).find('.drop');
$(target).fadeOut("fast");
},
timeout: 200
});
}
function initTimeline() {
var $timeline_block = $('.cd-timeline-block');
//hide timeline blocks which are outside the viewport
$timeline_block.each(function () {
if ($(this).offset().top > $(window).scrollTop() + $(window).height() * 0.75) {
$(this).find('.cd-timeline-img, .cd-timeline-content').addClass('is-hidden');
}
});
//on scolling, show/animate timeline blocks when enter the viewport
$(window).on('scroll', function () {
$timeline_block.each(function () {
if ($(this).offset().top <= $(window).scrollTop() + $(window).height() * 0.75 && $(this).find('.cd-timeline-img').hasClass('is-hidden')) {
$(this).find('.cd-timeline-img, .cd-timeline-content').removeClass('is-hidden').addClass('bounce-in');
}
});
});
}
function initDottedText() {
var activeClass = 'active-text';
var isTouchDevice = ('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch;
var isWinPhoneDevice = navigator.msPointerEnabled && /MSIE 10.*Touch/.test(navigator.userAgent);
var event = isTouchDevice ? (isWinPhoneDevice ? 'MSPointerDown' : 'click') : 'click';
var animSpeed = 400;
jQuery('.tab-pane').each(function () {
var wrap = jQuery(this);
var opener = wrap.find('.more');
var slide = wrap.find('.text');
var slideWrap = slide.find('.text-holder');
var fixedHeight = wrap.attr('data-fixedheight');
var dottedText = slideWrap.find('p:first-child');
var slideHeight;
fixedHeight = +fixedHeight;
function refreshState() {
slideHeight = slideWrap.height();
if (slideHeight < fixedHeight) {
opener.hide();
} else if (slideHeight > fixedHeight) {
opener.show();
}
if (!wrap.hasClass(activeClass)) {
slide.css({ height: fixedHeight });
initDotted();
}
}
function refreshHeight() {
slideHeight = slideWrap.height();
slide.css({
height: slideHeight
})
}
opener.on(event, function (e) {
e.preventDefault();
if (!wrap.hasClass(activeClass)) {
wrap.addClass(activeClass);
destroyDotted();
slide.stop().animate({
height: slideWrap.height()
}, {
duration: animSpeed, complete: function () {
jQuery(window).on('load resize orientationchange', refreshHeight)
}
});
}
else {
wrap.removeClass(activeClass);
slide.stop().animate({ height: fixedHeight }, {
duration: animSpeed, complete: function () {
initDotted();
jQuery(window).on('load resize orientationchange', function () {
slide.css({
height: fixedHeight
})
})
}
});
}
if (wrap.hasClass(activeClass)) {
jQuery(window).off('load resize orientationchange', refreshHeight)
}
});
jQuery('a[data-toggle="tab"]').on('shown.bs.tab', updateDotted)
function initDotted() {
dottedText.dotdotdot({
height: fixedHeight,
watch: "window"
});
}
function updateDotted() {
dottedText.trigger('update');
}
function destroyDotted() {
dottedText.trigger('destroy');
}
ResponsiveHelper.addRange({
'..767': {
on: function () {
if (!wrap.hasClass(activeClass)) {
slide.css({ height: fixedHeight });
initDotted();
}
jQuery(window).on('load resize orientationchange', refreshState)
},
off: function () {
jQuery(window).on('load resize orientationchange', destroyDotted)
wrap.removeClass(activeClass);
slide.css({ height: '' });
destroyDotted();
jQuery('a[data-toggle="tab"]').off('shown.bs.tab', updateDotted)
jQuery(window).off('load resize orientationchange', refreshState);
}
}
});
});
}
function initStickyHeader() {
var header = jQuery('#header');
var win = jQuery(window);
setState();
win.on('resize scroll orientationchange load', setState);
function setState() {
if (win.scrollTop() > 30 && !header.hasClass('alt')) {
header.addClass('alt');
}
else if (win.scrollTop() <= 30 && header.hasClass('alt')) {
header.removeClass('alt');
}
}
}
// fade gallery init
function initSlideShow() {
jQuery('div.promo-block').fadeGallery({
slides: 'div.slide',
btnPrev: 'a.btn-prev',
btnNext: 'a.btn-next',
pagerLinks: '.icons li',
event: 'mouseover',
useSwipe: true,
autoRotation: false,
autoHeight: true,
switchTime: 3000,
animSpeed: 500,
onInit: function (self) {
var isTouchDevice = /MSIE 10.*Touch/.test(navigator.userAgent) || ('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch;
if (!isTouchDevice) self.gallery.addClass('desktop');
}
});
}
function initMobileNav() {
jQuery('.menu-opener').mobileMenu({
pageWrapper: '#wrapper',
initResolution: 1023,
animSpeed: 500
});
}
//open-close with custom start height
function initCustomOpenClose() {
var win = jQuery(window);
jQuery('.text-section').each(function () {
var holder = jQuery(this);
var opener = holder.find('.opener');
var slide = holder.find('.slide').wrapInner('');
var startHeight = parseInt(slide.css('maxHeight'));
slide.height(startHeight).css({ maxHeight: 'none' });
var slideHeight = slide.children().outerHeight(true);
var activeClass = 'active';
var timer;
function setHeight() {
slideHeight = slide.children().outerHeight(true);
holder.hasClass(activeClass) ? slide.css({ height: slideHeight }) : slide.css({ height: startHeight });
}
//set state on page load
setHeight();
win.on('resize load orientationchange', function () {
clearTimeout(timer);
timer = setTimeout(setHeight, 50);
});
//click handler
opener.bind('click', function (e) {
e.preventDefault();
if (holder.hasClass(activeClass)) {
holder.removeClass(activeClass);
slide.stop().animate({ height: startHeight });
}
else {
holder.addClass(activeClass);
slide.stop().animate({ height: slide.children().outerHeight(true) });
}
});
});
}
function initTooltip() {
jQuery('[data-toggle="tooltip"]').tooltip();
}
// animated navigation init
function initDropDown() {
var nav = jQuery('#nav');
function initMobileAccordion() {
nav.slideAccordion({
opener: 'span.arrow',
slider: 'div.drop',
collapsible: true,
animSpeed: 300
});
nav.find('.drop-list').slideAccordion({
opener: '>a',
slider: '>ul',
collapsible: false,
allowClickWhenExpanded: true,
animSpeed: 300
});
}
ResponsiveHelper.addRange({
'..1023': {
on: function () {
initMobileAccordion();
},
off: function () {
nav.trigger('destroy.accordion');
nav.find('.drop-list').trigger('destroy.accordion');
}
},
'1024..': {
on: function () {
initTouchNav();
nav.animDropdown({
items: 'li',
drop: '>.drop',
animSpeed: 400,
effect: 'fade'
});
},
off: function () {
nav.trigger('destroyAnimDrop');
if (window.mainTNav) {
window.mainTNav.destroy();
}
}
}
});
}
// scroll gallery init
function initCarousel() {
var win = jQuery(window);
jQuery('div.gallery').scrollGallery({
mask: 'div.mask',
slider: 'div.slideset',
slides: 'div.slide',
btnPrev: 'a.btn-prev',
btnNext: 'a.btn-next',
pagerLinks: '.pagination li',
stretchSlideToMask: ((win.width() < 768) ? true : false),
maskAutoSize: true,
autoRotation: false,
switchTime: 3000,
animSpeed: 500,
step: 1,
onInit: function (self) {
win.on('resize orientatinchange', function () {
self.options.stretchSlideToMask = (win.width() < 768) ? true : false
});
}
});
jQuery('div.carousel').each(function () {
var gallery = jQuery(this);
var captions = gallery.find('.carousel-caption').css({ opacity: 0 });
var slides = gallery.find('.slide');
var animDuration = 500;
var prevBtn = gallery.find('.btn-prev');
var nextBtn = gallery.find('.btn-next');
var timer;
slides.each(function () {
var slide = jQuery(this);
var caption = slide.find('.carousel-caption').css({ opacity: 0 });
slide.data('caption', caption);
});
gallery.scrollGallery({
mask: 'div.mask',
slider: 'div.slideset',
slides: 'div.slide',
btnPrev: 'a.prev',
btnNext: 'a.next',
pagerLinks: '.pagination li',
stretchSlideToMask: true,
maskAutoSize: true,
autoRotation: false,
switchTime: 3000,
animSpeed: 500,
step: 1,
onInit: function (self) {
var activeSlide = self.slides.filter('.active')
activeSlide.find('.carousel-caption').css({ opacity: 1 });
if (self.options.autoRotation) {
timer = setTimeout(function () {
activeSlide.find('.carousel-caption').stop().animate({ opacity: 0 }, animDuration);
}, self.options.switchTime - animDuration);
}
prevBtn.on('click', function (e) {
e.preventDefault();
clearTimeout(timer);
animOut(function () {
self.prevSlide();
});
});
nextBtn.on('click', function (e) {
e.preventDefault();
clearTimeout(timer);
animOut(function () {
self.nextSlide();
});
});
},
onChange: function (self) {
var activeSlide = slides.filter('.active');
activeSlide.find('.carousel-caption').stop().animate({ opacity: 1 }, animDuration);
if (self.options.autoRotation) {
clearTimeout(timer);
timer = setTimeout(function () {
activeSlide.find('.carousel-caption').stop().animate({ opacity: 0 }, animDuration);
}, self.options.switchTime - animDuration);
}
}
});
function animOut(callback) {
slides.filter('.active').find('.carousel-caption').stop().animate({ opacity: 0 }, {
duration: animDuration,
complete: function () {
return callback();
}
});
}
});
}
// accordion menu init
function initAccordion() {
jQuery('ul.accordion').slideAccordion({
opener: 'a.opener',
slider: 'div.slide',
animSpeed: 300
});
jQuery('ul.add-nav').slideAccordion({
opener: 'a.opener',
slider: 'ul',
animSpeed: 300
});
}
// align blocks height
function initSameHeight() {
jQuery('.article-list').sameHeight({
elements: '.text',
flexible: true,
multiLine: true,
biggestHeight: true
});
jQuery('#sidebar').sameHeight({
elements: '.box',
flexible: true,
multiLine: true,
biggestHeight: false,
useMinHeight: true
});
jQuery('.subsidiaries-list').sameHeight({
elements: 'li',
flexible: true,
multiLine: true,
biggestHeight: true
});
}
// open-close init
function initOpenClose() {
var isTouchDevice = /MSIE 10.*Touch/.test(navigator.userAgent) || ('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch;
jQuery('.menu').openClose({
activeClass: 'active',
opener: '.opener',
slider: '.slide',
animSpeed: 400,
effect: 'slide'
});
jQuery('div.open-close').openClose({
activeClass: 'active',
opener: '.opener',
slider: '.slide',
animSpeed: 400,
effect: 'fade',
animEnd: function (self, isOpened) {
if (isOpened) jQuery('html, body').animate({ scrollTop: self.holder.offset().top }, self.options.animSpeed);
}
});
jQuery('.search-open').openClose({
hideOnClickOutside: true,
activeClass: 'active',
opener: '.opener',
slider: '.search-form',
animSpeed: 400,
effect: 'none',
event: 'click'
});
jQuery('.hubspot-block').each(function () {
var holder = jQuery(this);
var slide = holder.find('.slider');
var opener = holder.find('.opener');
var animSpeed = 500;
opener.on('click', function (e) {
e.preventDefault();
holder.hasClass('active') ? hideSlide() : showSlide();
});
if (holder.hasClass('active')) showSlide(true);
else hideSlide(true);
function hideSlide(initial) {
holder.removeClass('active');
slide.stop().animate({ marginLeft: -slide.outerWidth() }, initial ? 0 : animSpeed);
}
function showSlide(initial) {
holder.addClass('active');
slide.stop().animate({ marginLeft: 0 }, initial ? 0 : animSpeed);
}
});
jQuery('.works-list').each(function () {
var items = jQuery(this).children();
items.each(function () {
var item = jQuery(this);
var mask = item.find('.mask');
var slide = item.find('.popup');
function showSlide() {
items.not(item).trigger('hideSlide');
item.addClass('hover');
mask.css({ height: slide.outerHeight() });
}
function hideSlide() {
item.removeClass('hover');
mask.css({ height: 0 });
}
if (!isTouchDevice) {
item.on({
'mouseenter': showSlide,
'mouseleave hideSlide': hideSlide
});
}
else {
item.on({
'touchstart MSPointerDown': function (e) {
if (!item.hasClass('hover')) {
e.preventDefault();
showSlide();
}
},
'hideSlide': hideSlide
});
jQuery('body').on('click', function (e) {
if (item.hasClass('hover') && !jQuery(e.target).closest(item).length) {
item.trigger('hideSlide');
}
});
}
});
});
}
// fancybox modal popup init
function initLightbox() {
jQuery('a.lightbox, a[data-rel*="lightbox"]').each(function () {
var link = jQuery(this);
link.attr('rel', link.attr('data-rel')).fancybox({
padding: 0,
margin: 0,
cyclic: false,
autoScale: true,
overlayShow: true,
overlayOpacity: 0.9,
overlayColor: '#000000',
titlePosition: 'inside',
onComplete: function (box) {
if (link.attr('href').indexOf('#') === 0) {
jQuery('#fancybox-content').find('a.close').unbind('click.fb').bind('click.fb', function (e) {
jQuery.fancybox.close();
e.preventDefault();
});
}
}
});
});
}
/* Fancybox overlay fix */
jQuery(function () {
// detect device type
var isTouchDevice = ('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch;
var isWinPhoneDevice = navigator.msPointerEnabled && /MSIE 10.*Touch/.test(navigator.userAgent);
// create stylesheet
var styleTag = jQuery(''; a.insertBefore(d, b); c = g.offsetWidth == 42; a.removeChild(d); return { matches: c, media: h } } })(document);
/*! Picturefill - Responsive Images that work today. (and mimic the proposed Picture element with span elements). Author: Scott Jehl, Filament Group, 2012 | License: MIT/GPLv2 */
; (function (a) { a.picturefill = function () { var b = a.document.getElementsByTagName("span"); for (var f = 0, l = b.length; f < l; f++) { if (b[f].getAttribute("data-picture") !== null) { var c = b[f].getElementsByTagName("span"), h = []; for (var e = 0, g = c.length; e < g; e++) { var d = c[e].getAttribute("data-media"); if (!d || (a.matchMedia && a.matchMedia(d).matches)) { h.push(c[e]) } } var m = b[f].getElementsByTagName("img")[0]; if (h.length) { var k = h.pop(); if (!m || m.parentNode.nodeName === "NOSCRIPT") { m = a.document.createElement("img"); m.alt = b[f].getAttribute("data-alt") } if (k.getAttribute("data-width")) { m.setAttribute("width", k.getAttribute("data-width")) } else { m.removeAttribute("width") } if (k.getAttribute("data-height")) { m.setAttribute("height", k.getAttribute("data-height")) } else { m.removeAttribute("height") } m.src = k.getAttribute("data-src"); k.appendChild(m) } else { if (m) { m.parentNode.removeChild(m) } } } } }; if (a.addEventListener) { a.addEventListener("resize", a.picturefill, false); a.addEventListener("DOMContentLoaded", function () { a.picturefill(); a.removeEventListener("load", a.picturefill, false) }, false); a.addEventListener("load", a.picturefill, false) } else { if (a.attachEvent) { a.attachEvent("onload", a.picturefill) } } }(this));
/*
* FancyBox - jQuery Plugin
* Simple and fancy lightbox alternative
*
* Examples and documentation at: http://fancybox.net
*
* Copyright (c) 2008 - 2010 Janis Skarnelis
* That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
*
* Version: 1.3.4 (11/11/2010)
* Requires: jQuery v1.3+
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*/
; (function (B) { var L, T, Q, M, d, m, J, A, O, z, C = 0, H = {}, j = [], e = 0, G = {}, y = [], f = null, o = new Image(), i = /\.(jpg|gif|png|bmp|jpeg)(.*)?$/i, k = /[^\.]\.(swf)\s*$/i, p, N = 1, h = 0, t = "", b, c, P = false, s = B.extend(B("")[0], { prop: 0 }), S = /MSIE 6/.test(navigator.userAgent) && B.browser.version < 7 && !window.XMLHttpRequest, r = function () { T.hide(); o.onerror = o.onload = null; if (f) { f.abort() } L.empty() }, x = function () { if (false === H.onError(j, C, H)) { T.hide(); P = false; return } H.titleShow = false; H.width = "auto"; H.height = "auto"; L.html('The requested content cannot be loaded.
Please try again later.
'); n() }, w = function () { var Z = j[C], W, Y, ab, aa, V, X; r(); H = B.extend({}, B.fn.fancybox.defaults, (typeof B(Z).data("fancybox") == "undefined" ? H : B(Z).data("fancybox"))); X = H.onStart(j, C, H); if (X === false) { P = false; return } else { if (typeof X == "object") { H = B.extend(H, X) } } ab = H.title || (Z.nodeName ? B(Z).attr("title") : Z.title) || ""; if (Z.nodeName && !H.orig) { H.orig = B(Z).children("img:first").length ? B(Z).children("img:first") : B(Z) } if (ab === "" && H.orig && H.titleFromAlt) { ab = H.orig.attr("alt") } W = H.href || (Z.nodeName ? B(Z).attr("href") : Z.href) || null; if ((/^(?:javascript)/i).test(W) || W == "#") { W = null } if (H.type) { Y = H.type; if (!W) { W = H.content } } else { if (H.content) { Y = "html" } else { if (W) { if (W.match(i)) { Y = "image" } else { if (W.match(k)) { Y = "swf" } else { if (B(Z).hasClass("iframe")) { Y = "iframe" } else { if (W.indexOf("#") === 0) { Y = "inline" } else { Y = "ajax" } } } } } } } if (!Y) { x(); return } if (Y == "inline") { Z = W.substr(W.indexOf("#")); Y = B(Z).length > 0 ? "inline" : "ajax" } H.type = Y; H.href = W; H.title = ab; if (H.autoDimensions) { if (H.type == "html" || H.type == "inline" || H.type == "ajax") { H.width = "auto"; H.height = "auto" } else { H.autoDimensions = false } } if (H.modal) { H.overlayShow = true; H.hideOnOverlayClick = false; H.hideOnContentClick = false; H.enableEscapeButton = false; H.showCloseButton = false } H.padding = parseInt(H.padding, 10); H.margin = parseInt(H.margin, 10); L.css("padding", (H.padding + H.margin)); B(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change", function () { B(this).replaceWith(m.children()) }); switch (Y) { case "html": L.html(H.content); n(); break; case "inline": if (B(Z).parent().is("#fancybox-content") === true) { P = false; return } B('').hide().insertBefore(B(Z)).bind("fancybox-cleanup", function () { B(this).replaceWith(m.children()) }).bind("fancybox-cancel", function () { B(this).replaceWith(L.children()) }); B(Z).appendTo(L); n(); break; case "image": P = false; B.fancybox.showActivity(); o = new Image(); o.onerror = function () { x() }; o.onload = function () { P = true; o.onerror = o.onload = null; F() }; o.src = W; break; case "swf": H.scrolling = "no"; aa = '"; L.html(aa); n(); break; case "ajax": P = false; B.fancybox.showActivity(); H.ajax.win = H.ajax.success; f = B.ajax(B.extend({}, H.ajax, { url: W, data: H.ajax.data || {}, dataType: "text", error: function (ac, ae, ad) { if (ac.status > 0) { x() } }, success: function (ad, af, ac) { var ae = typeof ac == "object" ? ac : f; if (ae.status == 200 || ae.status === 0) { if (typeof H.ajax.win == "function") { X = H.ajax.win(W, ad, af, ac); if (X === false) { T.hide(); return } else { if (typeof X == "string" || typeof X == "object") { ad = X } } } L.html(ad); n() } } })); break; case "iframe": E(); break } }, n = function () { var V = H.width, W = H.height; if (V.toString().indexOf("%") > -1) { V = parseInt((B(window).width() - (H.margin * 2)) * parseFloat(V) / 100, 10) + "px" } else { V = V == "auto" ? "auto" : V + "px" } if (W.toString().indexOf("%") > -1) { W = parseInt((B(window).height() - (H.margin * 2)) * parseFloat(W) / 100, 10) + "px" } else { W = W == "auto" ? "auto" : W + "px" } L.wrapInner(''); H.width = L.width(); H.height = L.height(); E() }, F = function () { H.width = o.width; H.height = o.height; B("").attr({ id: "fancybox-img", src: o.src, alt: H.title }).appendTo(L); E() }, E = function () { var W, V; T.hide(); if (M.is(":visible") && false === G.onCleanup(y, e, G)) { B('.fancybox-inline-tmp').trigger('fancybox-cancel'); P = false; return } P = true; B(m.add(Q)).unbind(); B(window).unbind("resize.fb scroll.fb"); B(document).unbind("keydown.fb"); if (M.is(":visible") && G.titlePosition !== "outside") { M.css("height", M.height()) } y = j; e = C; G = H; if (G.overlayShow) { Q.css({ "background-color": G.overlayColor, opacity: G.overlayOpacity, cursor: G.hideOnOverlayClick ? "pointer" : "auto", height: B(document).height() }); if (!Q.is(":visible")) { if (S) { B("select:not(#fancybox-tmp select)").filter(function () { return this.style.visibility !== "hidden" }).css({ visibility: "hidden" }).one("fancybox-cleanup", function () { this.style.visibility = "inherit" }) } Q.show() } } else { Q.hide() } c = R(); l(); if (M.is(":visible")) { B(J.add(O).add(z)).hide(); W = M.position(), b = { top: W.top, left: W.left, width: M.width(), height: M.height() }; V = (b.width == c.width && b.height == c.height); m.fadeTo(G.changeFade, 0.3, function () { var X = function () { m.html(L.contents()).fadeTo(G.changeFade, 1, v) }; B('.fancybox-inline-tmp').trigger('fancybox-change'); m.empty().removeAttr("filter").css({ "border-width": G.padding, width: c.width - G.padding * 2, height: H.autoDimensions ? "auto" : c.height - h - G.padding * 2 }); if (V) { X() } else { s.prop = 0; B(s).animate({ prop: 1 }, { duration: G.changeSpeed, easing: G.easingChange, step: U, complete: X }) } }); return } M.removeAttr("style"); m.css("border-width", G.padding); if (G.transitionIn == "elastic") { b = I(); m.html(L.contents()); M.show(); if (G.opacity) { c.opacity = 0 } s.prop = 0; B(s).animate({ prop: 1 }, { duration: G.speedIn, easing: G.easingIn, step: U, complete: v }); return } if (G.titlePosition == "inside" && h > 0) { A.show() } m.css({ width: c.width - G.padding * 2, height: H.autoDimensions ? "auto" : c.height - h - G.padding * 2 }).html(L.contents()); M.css(c).fadeIn(G.transitionIn == "none" ? 0 : G.speedIn, v) }, D = function (V) { if (V && V.length) { if (G.titlePosition == "float") { return '' } return '' + V + "
" } return false }, l = function () { t = G.title || ""; h = 0; A.empty().removeAttr("style").removeClass(); if (G.titleShow === false) { A.hide(); return } t = B.isFunction(G.titleFormat) ? G.titleFormat(t, y, e, G) : D(t); if (!t || t === "") { A.hide(); return } A.addClass("fancybox-title-" + G.titlePosition).html(t).appendTo("body").show(); switch (G.titlePosition) { case "inside": A.css({ width: c.width - (G.padding * 2), marginLeft: G.padding, marginRight: G.padding }); h = A.outerHeight(true); A.appendTo(d); c.height += h; break; case "over": A.css({ marginLeft: G.padding, width: c.width - (G.padding * 2), bottom: G.padding }).appendTo(d); break; case "float": A.css("left", parseInt((A.width() - c.width - 40) / 2, 10) * -1).appendTo(M); break; default: A.css({ width: c.width - (G.padding * 2), paddingLeft: G.padding, paddingRight: G.padding }).appendTo(M); break } A.hide() }, g = function () { if (G.enableEscapeButton || G.enableKeyboardNav) { B(document).bind("keydown.fb", function (V) { if (V.keyCode == 27 && G.enableEscapeButton) { V.preventDefault(); B.fancybox.close() } else { if ((V.keyCode == 37 || V.keyCode == 39) && G.enableKeyboardNav && V.target.tagName !== "INPUT" && V.target.tagName !== "TEXTAREA" && V.target.tagName !== "SELECT") { V.preventDefault(); B.fancybox[V.keyCode == 37 ? "prev" : "next"]() } } }) } if (!G.showNavArrows) { O.hide(); z.hide(); return } if ((G.cyclic && y.length > 1) || e !== 0) { O.show() } if ((G.cyclic && y.length > 1) || e != (y.length - 1)) { z.show() } }, v = function () { if (B.support.opacity === false) { m.get(0).style.removeAttribute("filter"); M.get(0).style.removeAttribute("filter") } if (H.autoDimensions) { m.css("height", "auto") } M.css("height", "auto"); if (t && t.length) { A.show() } if (G.showCloseButton) { J.show() } g(); if (G.hideOnContentClick) { m.bind("click", B.fancybox.close) } if (G.hideOnOverlayClick) { Q.bind("click", B.fancybox.close) } B(window).bind("resize.fb", B.fancybox.resize); if (G.centerOnScroll) { B(window).bind("scroll.fb", B.fancybox.center) } if (G.type == "iframe") { B('').appendTo(m) } M.show(); P = false; B.fancybox.center(); G.onComplete(y, e, G); K() }, K = function () { var V, W; if ((y.length - 1) > e) { V = y[e + 1].href; if (typeof V !== "undefined" && V.match(i)) { W = new Image(); W.src = V } } if (e > 0) { V = y[e - 1].href; if (typeof V !== "undefined" && V.match(i)) { W = new Image(); W.src = V } } }, U = function (W) { var V = { width: parseInt(b.width + (c.width - b.width) * W, 10), height: parseInt(b.height + (c.height - b.height) * W, 10), top: parseInt(b.top + (c.top - b.top) * W, 10), left: parseInt(b.left + (c.left - b.left) * W, 10) }; if (typeof c.opacity !== "undefined") { V.opacity = W < 0.5 ? 0.5 : W } M.css(V); m.css({ width: V.width - G.padding * 2, height: V.height - (h * W) - G.padding * 2 }) }, u = function () { return [B(window).width() - (G.margin * 2), B(window).height() - (G.margin * 2), B(document).scrollLeft() + G.margin, B(document).scrollTop() + G.margin] }, R = function () { var V = u(), Z = {}, W = G.autoScale, X = G.padding * 2, Y; if (G.width.toString().indexOf("%") > -1) { Z.width = parseInt((V[0] * parseFloat(G.width)) / 100, 10) } else { Z.width = G.width + X } if (G.height.toString().indexOf("%") > -1) { Z.height = parseInt((V[1] * parseFloat(G.height)) / 100, 10) } else { Z.height = G.height + X } if (W && (Z.width > V[0] || Z.height > V[1])) { if (H.type == "image" || H.type == "swf") { Y = (G.width) / (G.height); if ((Z.width) > V[0]) { Z.width = V[0]; Z.height = parseInt(((Z.width - X) / Y) + X, 10) } if ((Z.height) > V[1]) { Z.height = V[1]; Z.width = parseInt(((Z.height - X) * Y) + X, 10) } } else { Z.width = Math.min(Z.width, V[0]); Z.height = Math.min(Z.height, V[1]) } } Z.top = parseInt(Math.max(V[3] - 20, V[3] + ((V[1] - Z.height - 40) * 0.5)), 10); Z.left = parseInt(Math.max(V[2] - 20, V[2] + ((V[0] - Z.width - 40) * 0.5)), 10); return Z }, q = function (V) { var W = V.offset(); W.top += parseInt(V.css("paddingTop"), 10) || 0; W.left += parseInt(V.css("paddingLeft"), 10) || 0; W.top += parseInt(V.css("border-top-width"), 10) || 0; W.left += parseInt(V.css("border-left-width"), 10) || 0; W.width = V.width(); W.height = V.height(); return W }, I = function () { var Y = H.orig ? B(H.orig) : false, X = {}, W, V; if (Y && Y.length) { W = q(Y); X = { width: W.width + (G.padding * 2), height: W.height + (G.padding * 2), top: W.top - G.padding - 20, left: W.left - G.padding - 20 } } else { V = u(); X = { width: G.padding * 2, height: G.padding * 2, top: parseInt(V[3] + V[1] * 0.5, 10), left: parseInt(V[2] + V[0] * 0.5, 10) } } return X }, a = function () { if (!T.is(":visible")) { clearInterval(p); return } B("div", T).css("top", (N * -40) + "px"); N = (N + 1) % 12 }; B.fn.fancybox = function (V) { if (!B(this).length) { return this } B(this).data("fancybox", B.extend({}, V, (B.metadata ? B(this).metadata() : {}))).unbind("click.fb").bind("click.fb", function (X) { X.preventDefault(); if (P) { return } P = true; B(this).blur(); j = []; C = 0; var W = B(this).attr("rel") || ""; if (!W || W == "" || W === "nofollow") { j.push(this) } else { j = B('a[rel="' + W + '"], area[rel="' + W + '"]'); C = j.index(this) } w(); return }); return this }; B.fancybox = function (Y) { var X; if (P) { return } P = true; X = typeof arguments[1] !== "undefined" ? arguments[1] : {}; j = []; C = parseInt(X.index, 10) || 0; if (B.isArray(Y)) { for (var W = 0, V = Y.length; W < V; W++) { if (typeof Y[W] == "object") { B(Y[W]).data("fancybox", B.extend({}, X, Y[W])) } else { Y[W] = B({}).data("fancybox", B.extend({ content: Y[W] }, X)) } } j = jQuery.merge(j, Y) } else { if (typeof Y == "object") { B(Y).data("fancybox", B.extend({}, X, Y)) } else { Y = B({}).data("fancybox", B.extend({ content: Y }, X)) } j.push(Y) } if (C > j.length || C < 0) { C = 0 } w() }; B.fancybox.showActivity = function () { clearInterval(p); T.show(); p = setInterval(a, 66) }; B.fancybox.hideActivity = function () { T.hide() }; B.fancybox.next = function () { return B.fancybox.pos(e + 1) }; B.fancybox.prev = function () { return B.fancybox.pos(e - 1) }; B.fancybox.pos = function (V) { if (P) { return } V = parseInt(V); j = y; if (V > -1 && V < y.length) { C = V; w() } else { if (G.cyclic && y.length > 1) { C = V >= y.length ? 0 : y.length - 1; w() } } return }; B.fancybox.cancel = function () { if (P) { return } P = true; B('.fancybox-inline-tmp').trigger('fancybox-cancel'); r(); H.onCancel(j, C, H); P = false }; B.fancybox.close = function () { if (P || M.is(":hidden")) { return } P = true; if (G && false === G.onCleanup(y, e, G)) { P = false; return } r(); B(J.add(O).add(z)).hide(); B(m.add(Q)).unbind(); B(window).unbind("resize.fb scroll.fb"); B(document).unbind("keydown.fb"); if (G.type === "iframe") { m.find("iframe").attr("src", S && /^https/i.test(window.location.href || "") ? "javascript:void(false)" : "about:blank") } if (G.titlePosition !== "inside") { A.empty() } M.stop(); function V() { Q.fadeOut("fast"); A.empty().hide(); M.hide(); B('.fancybox-inline-tmp').trigger('fancybox-cleanup'); m.empty(); G.onClosed(y, e, G); y = H = []; e = C = 0; G = H = {}; P = false } if (G.transitionOut == "elastic") { b = I(); var W = M.position(); c = { top: W.top, left: W.left, width: M.width(), height: M.height() }; if (G.opacity) { c.opacity = 1 } A.empty().hide(); s.prop = 1; B(s).animate({ prop: 0 }, { duration: G.speedOut, easing: G.easingOut, step: U, complete: V }) } else { M.fadeOut(G.transitionOut == "none" ? 0 : G.speedOut, V) } }; B.fancybox.resize = function () { if (Q.is(":visible")) { Q.css("height", B(document).height()) } B.fancybox.center(true) }; B.fancybox.center = function () { var V, W; if (P) { return } W = arguments[0] === true ? 1 : 0; V = u(); if (!W && (M.width() > V[0] || M.height() > V[1])) { return } M.stop().animate({ top: parseInt(Math.max(V[3] - 20, V[3] + ((V[1] - m.height() - 40) * 0.5) - G.padding)), left: parseInt(Math.max(V[2] - 20, V[2] + ((V[0] - m.width() - 40) * 0.5) - G.padding)) }, typeof arguments[0] == "number" ? arguments[0] : 200) }; B.fancybox.init = function () { if (B("#fancybox-wrap").length) { return } B("body").append(L = B(''), T = B(''), Q = B(''), M = B('')); d = B('').append('').appendTo(M); d.append(m = B(''), J = B(''), A = B(''), O = B(''), z = B('')); J.click(B.fancybox.close); T.click(B.fancybox.cancel); O.click(function (V) { V.preventDefault(); B.fancybox.prev() }); z.click(function (V) { V.preventDefault(); B.fancybox.next() }); if (B.fn.mousewheel) { M.bind("mousewheel.fb", function (V, W) { if (P) { V.preventDefault() } else { if (B(V.target).get(0).clientHeight == 0 || B(V.target).get(0).scrollHeight === B(V.target).get(0).clientHeight) { V.preventDefault(); B.fancybox[W > 0 ? "prev" : "next"]() } } }) } if (B.support.opacity === false) { M.addClass("fancybox-ie") } if (S) { T.addClass("fancybox-ie6"); M.addClass("fancybox-ie6"); B('').prependTo(d) } }; B.fn.fancybox.defaults = { padding: 10, margin: 40, opacity: false, modal: false, cyclic: false, scrolling: "auto", width: 560, height: 340, autoScale: true, autoDimensions: true, centerOnScroll: false, ajax: {}, swf: { wmode: "transparent" }, hideOnOverlayClick: true, hideOnContentClick: false, overlayShow: true, overlayOpacity: 0.7, overlayColor: "#777", titleShow: true, titlePosition: "float", titleFormat: null, titleFromAlt: false, transitionIn: "fade", transitionOut: "fade", speedIn: 300, speedOut: 300, changeSpeed: 300, changeFade: "fast", easingIn: "swing", easingOut: "swing", showCloseButton: true, showNavArrows: true, enableEscapeButton: true, enableKeyboardNav: true, onStart: function () { }, onCancel: function () { }, onComplete: function () { }, onCleanup: function () { }, onClosed: function () { }, onError: function () { } }; B(document).ready(function () { B.fancybox.init() }) })(jQuery);
// side sliding mobile menu
jQuery.fn.mobileMenu = function (opt) {
var options = jQuery.extend({
pageWrapper: null,
animSpeed: 500,
initResolution: 767,
useSwipe: false,
fixedPanels: null,
fixedHeight: false,
fixedPosition: false
}, opt);
return this.each(function () {
var opener = jQuery(this),
win = jQuery(window),
body = jQuery('body'),
wrapper = body.find(options.pageWrapper),
initResolution = "'.." + options.initResolution + "'",
animSpeed = options.animSpeed,
isTouchDevice = /MSIE 10.*Touch/.test(navigator.userAgent) || ('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch,
navBlock,
fixedPanels,
obj = {};
obj[initResolution] = {
on: function () {
init();
},
off: function () {
destroy();
}
}
//init layouts
ResponsiveHelper.addRange(obj);
//init mobile menu function
function init() {
//preparation of html structure
if (!wrapper.length) {
body.wrapInner('');
wrapper = jQuery('#wrapper');
}
wrapper.wrap('');
if (options.fixedPosition) opener.parent().addClass('fixed');
if (options.fixedPanels) fixedPanels = wrapper.find(options.fixedPanels);
//set variables
var page = jQuery('#page');
navBlock = jQuery('#' + opener.attr('data-rel'))
navBlock.data('parent', navBlock.parent());
navBlock.appendTo(page).show();
var defWidth = navBlock.outerWidth();
//addition the necessary styles
wrapper.add(page).css({
overflow: 'hidden',
position: 'relative'
});
navBlock.css({
position: options.fixedPosition ? 'fixed' : 'absolute',
top: 0,
left: '100%'
});
//click handler
opener.bind('click', function (e) {
e.preventDefault();
page.hasClass('nav-active') ? hideMenu() : showMenu();
});
wrapper.on('click', function (e) {
if (!jQuery(e.target).closest(opener).length && page.hasClass('nav-active')) hideMenu();
});
//recalc sizes on window width change
win.bind('resize.Mobile orientationchange.Mobile', function () {
if (opener.hasClass('active')) {
defWidth = navBlock.outerWidth();
navBlock.css({ marginLeft: -defWidth });
wrapper.css({ left: -defWidth });
if (options.fixedHeight) page.css({ height: Math.max(win.height(), navBlock.outerHeight()) });
}
});
//show menu function
function showMenu() {
page.addClass('nav-active');
//crop extra space if option fixedHeight is active
if (options.fixedHeight) {
page.css({ height: Math.max(win.height(), navBlock.outerHeight()) });
}
defWidth = navBlock.outerWidth();
//animate menu
navBlock.stop().animate({
marginLeft: -defWidth
}, animSpeed);
wrapper.stop().animate({
left: -defWidth
}, animSpeed);
if (fixedPanels) {
fixedPanels.stop().animate({
marginLeft: -defWidth,
marginRight: defWidth
}, animSpeed);
}
if (options.fixedPosition) {
opener.parent().stop().animate({
marginLeft: -defWidth
}, animSpeed);
navBlock.css({
top: navBlock.offset().top,
position: 'absolute'
});
win.bind('scroll.Mobile', function () {
if (win.scrollTop() < navBlock.offset().top) {
navBlock.css('top', win.scrollTop());
}
});
}
}
//hide menu function
function hideMenu() {
//animate menu
navBlock.stop().animate({
marginLeft: 0
}, animSpeed);
wrapper.stop().animate({
left: 0
}, {
duration: animSpeed,
complete: function () {
page.removeClass('nav-active');
//remove fixed height of page
if (options.fixedHeight) page.css('height', '');
}
});
if (fixedPanels) {
fixedPanels.stop().animate({
marginLeft: 0,
marginRight: 0
}, animSpeed);
}
if (options.fixedPosition) {
opener.parent().stop().animate({
marginLeft: 0
}, animSpeed);
navBlock.css({
top: '',
position: 'fixed'
});
win.unbind('scroll.Mobile');
}
}
//enable swipe for menu opening on touch devices
if (options.useSwipe && isTouchDevice) {
Hammer(page).on("swipeleft", hideMenu).on("swiperight", showMenu);
}
}
//destroy mobile menu function
function destroy() {
win.unbind('resize.Mobile orientationchange.Mobile scroll.Mobile');
wrapper.stop().removeAttr('style');
navBlock.stop().removeAttr('style').appendTo(navBlock.data('parent'));
jQuery('.temp-wrap > *:first-child').unwrap();
opener.unbind('click');
}
});
}
/*
* jQuery SlideShow plugin
*/
; (function ($) {
function FadeGallery(options) {
this.options = $.extend({
slides: 'ul.slideset > li',
activeClass: 'active',
disabledClass: 'disabled',
btnPrev: 'a.btn-prev',
btnNext: 'a.btn-next',
generatePagination: false,
pagerList: '',
pagerListItem: ' ',
pagerListItemText: 'a',
pagerLinks: '.pagination li',
currentNumber: 'span.current-num',
totalNumber: 'span.total-num',
btnPlay: '.btn-play',
btnPause: '.btn-pause',
btnPlayPause: '.btn-play-pause',
galleryReadyClass: 'gallery-js-ready',
autorotationActiveClass: 'autorotation-active',
autorotationDisabledClass: 'autorotation-disabled',
autorotationStopAfterClick: false,
circularRotation: true,
switchSimultaneously: true,
disableWhileAnimating: false,
disableFadeIE: false,
autoRotation: false,
pauseOnHover: true,
autoHeight: false,
useSwipe: false,
swipeThreshold: 15,
switchTime: 4000,
animSpeed: 600,
event: 'click'
}, options);
this.init();
}
FadeGallery.prototype = {
init: function () {
if (this.options.holder) {
this.findElements();
this.attachEvents();
this.refreshState(true);
this.autoRotate();
this.makeCallback('onInit', this);
}
},
findElements: function () {
// control elements
this.gallery = $(this.options.holder).addClass(this.options.galleryReadyClass);
this.slides = this.gallery.find(this.options.slides);
this.slidesHolder = this.slides.eq(0).parent();
this.stepsCount = this.slides.length;
this.btnPrev = this.gallery.find(this.options.btnPrev);
this.btnNext = this.gallery.find(this.options.btnNext);
this.currentIndex = 0;
// disable fade effect in old IE
if (this.options.disableFadeIE && !$.support.opacity) {
this.options.animSpeed = 0;
}
// create gallery pagination
if (typeof this.options.generatePagination === 'string') {
this.pagerHolder = this.gallery.find(this.options.generatePagination).empty();
this.pagerList = $(this.options.pagerList).appendTo(this.pagerHolder);
for (var i = 0; i < this.stepsCount; i++) {
$(this.options.pagerListItem).appendTo(this.pagerList).find(this.options.pagerListItemText).text(i + 1);
}
this.pagerLinks = this.pagerList.children();
} else {
this.pagerLinks = this.gallery.find(this.options.pagerLinks);
}
// get start index
var activeSlide = this.slides.filter('.' + this.options.activeClass);
if (activeSlide.length) {
this.currentIndex = this.slides.index(activeSlide);
}
this.prevIndex = this.currentIndex;
// autorotation control buttons
this.btnPlay = this.gallery.find(this.options.btnPlay);
this.btnPause = this.gallery.find(this.options.btnPause);
this.btnPlayPause = this.gallery.find(this.options.btnPlayPause);
// misc elements
this.curNum = this.gallery.find(this.options.currentNumber);
this.allNum = this.gallery.find(this.options.totalNumber);
// handle flexible layout
this.slides.css({ display: 'block', opacity: 0 }).eq(this.currentIndex).css({
opacity: ''
});
},
attachEvents: function () {
var self = this;
// flexible layout handler
this.resizeHandler = function () {
self.onWindowResize();
};
$(window).bind('load resize orientationchange', this.resizeHandler);
if (this.btnPrev.length) {
this.btnPrevHandler = function (e) {
e.preventDefault();
self.prevSlide();
if (self.options.autorotationStopAfterClick) {
self.stopRotation();
}
};
this.btnPrev.bind(this.options.event, this.btnPrevHandler);
}
if (this.btnNext.length) {
this.btnNextHandler = function (e) {
e.preventDefault();
self.nextSlide();
if (self.options.autorotationStopAfterClick) {
self.stopRotation();
}
};
this.btnNext.bind(this.options.event, this.btnNextHandler);
}
if (this.pagerLinks.length) {
this.pagerLinksHandler = function (e) {
e.preventDefault();
self.numSlide(self.pagerLinks.index(e.currentTarget));
if (self.options.autorotationStopAfterClick) {
self.stopRotation();
}
console.log('xxx');
};
this.pagerLinks.bind(self.options.event, this.pagerLinksHandler);
}
if (this.pagerLinks.length) {
this.pagerLinksHandlerX = function (e) {
e.preventDefault();
self.numSlide(0);
console.log(this);
};
this.pagerLinks.bind("mouseout", this.pagerLinksHandlerX);
}
// autorotation buttons handler
if (this.btnPlay.length) {
this.btnPlayHandler = function (e) {
e.preventDefault();
self.startRotation();
};
this.btnPlay.bind(this.options.event, this.btnPlayHandler);
}
if (this.btnPause.length) {
this.btnPauseHandler = function (e) {
e.preventDefault();
self.stopRotation();
};
this.btnPause.bind(this.options.event, this.btnPauseHandler);
}
if (this.btnPlayPause.length) {
this.btnPlayPauseHandler = function (e) {
e.preventDefault();
if (!self.gallery.hasClass(self.options.autorotationActiveClass)) {
self.startRotation();
} else {
self.stopRotation();
}
};
this.btnPlayPause.bind(this.options.event, this.btnPlayPauseHandler);
}
// swipe gestures handler
if (this.options.useSwipe && window.Hammer && isTouchDevice) {
this.swipeHandler = Hammer(this.gallery[0], {
dragBlockHorizontal: true,
dragMinDistance: 1
}).on('release dragleft dragright', function (e) {
switch (e.type) {
case 'dragleft':
case 'dragright':
e.gesture.preventDefault();
break;
case 'release':
if (e.gesture.distance > self.options.swipeThreshold) {
if (e.gesture.direction === 'left') {
self.nextSlide();
} else if (e.gesture.direction === 'right') {
self.prevSlide();
}
}
}
});
}
// pause on hover handling
if (this.options.pauseOnHover) {
this.hoverHandler = function () {
if (self.options.autoRotation) {
self.galleryHover = true;
self.pauseRotation();
}
};
this.leaveHandler = function () {
if (self.options.autoRotation) {
self.galleryHover = false;
self.resumeRotation();
}
};
this.gallery.bind({ mouseenter: this.hoverHandler, mouseleave: this.leaveHandler });
}
},
onWindowResize: function () {
if (this.options.autoHeight) {
this.slidesHolder.css({ height: this.slides.eq(this.currentIndex).outerHeight(true) });
}
},
prevSlide: function () {
if (!(this.options.disableWhileAnimating && this.galleryAnimating)) {
this.prevIndex = this.currentIndex;
if (this.currentIndex > 0) {
this.currentIndex--;
this.switchSlide();
} else if (this.options.circularRotation) {
this.currentIndex = this.stepsCount - 1;
this.switchSlide();
}
}
},
nextSlide: function (fromAutoRotation) {
if (!(this.options.disableWhileAnimating && this.galleryAnimating)) {
this.prevIndex = this.currentIndex;
if (this.currentIndex < this.stepsCount - 1) {
this.currentIndex++;
this.switchSlide();
} else if (this.options.circularRotation || fromAutoRotation === true) {
this.currentIndex = 0;
this.switchSlide();
}
}
},
numSlide: function (c) {
if (this.currentIndex != c) {
this.prevIndex = this.currentIndex;
this.currentIndex = c;
this.switchSlide();
}
},
switchSlide: function () {
var self = this;
if (this.slides.length > 1) {
this.galleryAnimating = true;
if (!this.options.animSpeed) {
this.slides.eq(this.prevIndex).css({ opacity: 0 });
} else {
this.slides.eq(this.prevIndex).stop().animate({ opacity: 0 }, { duration: this.options.animSpeed });
}
this.switchNext = function () {
if (!self.options.animSpeed) {
self.slides.eq(self.currentIndex).css({ opacity: '' });
} else {
self.slides.eq(self.currentIndex).stop().animate({ opacity: 1 }, { duration: self.options.animSpeed });
}
clearTimeout(this.nextTimer);
this.nextTimer = setTimeout(function () {
self.slides.eq(self.currentIndex).css({ opacity: '' });
self.galleryAnimating = false;
self.autoRotate();
// onchange callback
self.makeCallback('onChange', self);
}, self.options.animSpeed);
};
if (this.options.switchSimultaneously) {
self.switchNext();
} else {
clearTimeout(this.switchTimer);
this.switchTimer = setTimeout(function () {
self.switchNext();
}, this.options.animSpeed);
}
this.refreshState();
// onchange callback
this.makeCallback('onBeforeChange', this);
}
},
refreshState: function (initial) {
this.slides.removeClass(this.options.activeClass).eq(this.currentIndex).addClass(this.options.activeClass);
this.pagerLinks.removeClass(this.options.activeClass).eq(this.currentIndex).addClass(this.options.activeClass);
this.curNum.html(this.currentIndex + 1);
this.allNum.html(this.stepsCount);
// initial refresh
if (this.options.autoHeight) {
if (initial) {
this.slidesHolder.css({ height: this.slides.eq(this.currentIndex).outerHeight(true) });
} else {
this.slidesHolder.stop().animate({ height: this.slides.eq(this.currentIndex).outerHeight(true) }, { duration: this.options.animSpeed });
}
}
// disabled state
if (!this.options.circularRotation) {
this.btnPrev.add(this.btnNext).removeClass(this.options.disabledClass);
if (this.currentIndex === 0) this.btnPrev.addClass(this.options.disabledClass);
if (this.currentIndex === this.stepsCount - 1) this.btnNext.addClass(this.options.disabledClass);
}
// add class if not enough slides
this.gallery.toggleClass('not-enough-slides', this.stepsCount === 1);
},
startRotation: function () {
this.options.autoRotation = true;
this.galleryHover = false;
this.autoRotationStopped = false;
this.resumeRotation();
},
stopRotation: function () {
this.galleryHover = true;
this.autoRotationStopped = true;
this.pauseRotation();
},
pauseRotation: function () {
this.gallery.addClass(this.options.autorotationDisabledClass);
this.gallery.removeClass(this.options.autorotationActiveClass);
clearTimeout(this.timer);
},
resumeRotation: function () {
if (!this.autoRotationStopped) {
this.gallery.addClass(this.options.autorotationActiveClass);
this.gallery.removeClass(this.options.autorotationDisabledClass);
this.autoRotate();
}
},
autoRotate: function () {
var self = this;
clearTimeout(this.timer);
if (this.options.autoRotation && !this.galleryHover && !this.autoRotationStopped) {
this.gallery.addClass(this.options.autorotationActiveClass);
this.timer = setTimeout(function () {
self.nextSlide(true);
}, this.options.switchTime);
} else {
this.pauseRotation();
}
},
makeCallback: function (name) {
if (typeof this.options[name] === 'function') {
var args = Array.prototype.slice.call(arguments);
args.shift();
this.options[name].apply(this, args);
}
},
destroy: function () {
// navigation buttons handler
this.btnPrev.unbind(this.options.event, this.btnPrevHandler);
this.btnNext.unbind(this.options.event, this.btnNextHandler);
this.pagerLinks.unbind(this.options.event, this.pagerLinksHandler);
$(window).unbind('load resize orientationchange', this.resizeHandler);
// remove autorotation handlers
this.stopRotation();
this.btnPlay.unbind(this.options.event, this.btnPlayHandler);
this.btnPause.unbind(this.options.event, this.btnPauseHandler);
this.btnPlayPause.unbind(this.options.event, this.btnPlayPauseHandler);
this.gallery.bind({ mouseenter: this.hoverHandler, mouseleave: this.leaveHandler });
// remove swipe handler if used
if (this.swipeHandler) {
this.swipeHandler.dispose();
}
if (typeof this.options.generatePagination === 'string') {
this.pagerHolder.empty();
}
// remove unneeded classes and styles
var unneededClasses = [this.options.galleryReadyClass, this.options.autorotationActiveClass, this.options.autorotationDisabledClass];
this.gallery.removeClass(unneededClasses.join(' '));
this.slidesHolder.add(this.slides).removeAttr('style');
}
};
// detect device type
var isTouchDevice = /MSIE 10.*Touch/.test(navigator.userAgent) || ('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch;
// jquery plugin
$.fn.fadeGallery = function (opt) {
return this.each(function () {
$(this).data('FadeGallery', new FadeGallery($.extend(opt, { holder: this })));
});
};
}(jQuery));
/*! Hammer.JS - v1.1.3 - 2014-05-20
* http://eightmedia.github.io/hammer.js
*
* Copyright (c) 2014 Jorik Tangelder ;
* Licensed under the MIT license */
!function (a, b) { "use strict"; function c() { d.READY || (s.determineEventTypes(), r.each(d.gestures, function (a) { u.register(a) }), s.onTouch(d.DOCUMENT, n, u.detect), s.onTouch(d.DOCUMENT, o, u.detect), d.READY = !0) } var d = function v(a, b) { return new v.Instance(a, b || {}) }; d.VERSION = "1.1.3", d.defaults = { behavior: { userSelect: "none", touchAction: "pan-y", touchCallout: "none", contentZooming: "none", userDrag: "none", tapHighlightColor: "rgba(0,0,0,0)" } }, d.DOCUMENT = document, d.HAS_POINTEREVENTS = navigator.pointerEnabled || navigator.msPointerEnabled, d.HAS_TOUCHEVENTS = "ontouchstart" in a, d.IS_MOBILE = /mobile|tablet|ip(ad|hone|od)|android|silk/i.test(navigator.userAgent), d.NO_MOUSEEVENTS = d.HAS_TOUCHEVENTS && d.IS_MOBILE || d.HAS_POINTEREVENTS, d.CALCULATE_INTERVAL = 25; var e = {}, f = d.DIRECTION_DOWN = "down", g = d.DIRECTION_LEFT = "left", h = d.DIRECTION_UP = "up", i = d.DIRECTION_RIGHT = "right", j = d.POINTER_MOUSE = "mouse", k = d.POINTER_TOUCH = "touch", l = d.POINTER_PEN = "pen", m = d.EVENT_START = "start", n = d.EVENT_MOVE = "move", o = d.EVENT_END = "end", p = d.EVENT_RELEASE = "release", q = d.EVENT_TOUCH = "touch"; d.READY = !1, d.plugins = d.plugins || {}, d.gestures = d.gestures || {}; var r = d.utils = { extend: function (a, c, d) { for (var e in c) !c.hasOwnProperty(e) || a[e] !== b && d || (a[e] = c[e]); return a }, on: function (a, b, c) { a.addEventListener(b, c, !1) }, off: function (a, b, c) { a.removeEventListener(b, c, !1) }, each: function (a, c, d) { var e, f; if ("forEach" in a) a.forEach(c, d); else if (a.length !== b) { for (e = 0, f = a.length; f > e; e++) if (c.call(d, a[e], e, a) === !1) return } else for (e in a) if (a.hasOwnProperty(e) && c.call(d, a[e], e, a) === !1) return }, inStr: function (a, b) { return a.indexOf(b) > -1 }, inArray: function (a, b) { if (a.indexOf) { var c = a.indexOf(b); return -1 === c ? !1 : c } for (var d = 0, e = a.length; e > d; d++) if (a[d] === b) return d; return !1 }, toArray: function (a) { return Array.prototype.slice.call(a, 0) }, hasParent: function (a, b) { for (; a;) { if (a == b) return !0; a = a.parentNode } return !1 }, getCenter: function (a) { var b = [], c = [], d = [], e = [], f = Math.min, g = Math.max; return 1 === a.length ? { pageX: a[0].pageX, pageY: a[0].pageY, clientX: a[0].clientX, clientY: a[0].clientY } : (r.each(a, function (a) { b.push(a.pageX), c.push(a.pageY), d.push(a.clientX), e.push(a.clientY) }), { pageX: (f.apply(Math, b) + g.apply(Math, b)) / 2, pageY: (f.apply(Math, c) + g.apply(Math, c)) / 2, clientX: (f.apply(Math, d) + g.apply(Math, d)) / 2, clientY: (f.apply(Math, e) + g.apply(Math, e)) / 2 }) }, getVelocity: function (a, b, c) { return { x: Math.abs(b / a) || 0, y: Math.abs(c / a) || 0 } }, getAngle: function (a, b) { var c = b.clientX - a.clientX, d = b.clientY - a.clientY; return 180 * Math.atan2(d, c) / Math.PI }, getDirection: function (a, b) { var c = Math.abs(a.clientX - b.clientX), d = Math.abs(a.clientY - b.clientY); return c >= d ? a.clientX - b.clientX > 0 ? g : i : a.clientY - b.clientY > 0 ? h : f }, getDistance: function (a, b) { var c = b.clientX - a.clientX, d = b.clientY - a.clientY; return Math.sqrt(c * c + d * d) }, getScale: function (a, b) { return a.length >= 2 && b.length >= 2 ? this.getDistance(b[0], b[1]) / this.getDistance(a[0], a[1]) : 1 }, getRotation: function (a, b) { return a.length >= 2 && b.length >= 2 ? this.getAngle(b[1], b[0]) - this.getAngle(a[1], a[0]) : 0 }, isVertical: function (a) { return a == h || a == f }, setPrefixedCss: function (a, b, c, d) { var e = ["", "Webkit", "Moz", "O", "ms"]; b = r.toCamelCase(b); for (var f = 0; f < e.length; f++) { var g = b; if (e[f] && (g = e[f] + g.slice(0, 1).toUpperCase() + g.slice(1)), g in a.style) { a.style[g] = (null == d || d) && c || ""; break } } }, toggleBehavior: function (a, b, c) { if (b && a && a.style) { r.each(b, function (b, d) { r.setPrefixedCss(a, d, b, c) }); var d = c && function () { return !1 }; "none" == b.userSelect && (a.onselectstart = d), "none" == b.userDrag && (a.ondragstart = d) } }, toCamelCase: function (a) { return a.replace(/[_-]([a-z])/g, function (a) { return a[1].toUpperCase() }) } }, s = d.event = { preventMouseEvents: !1, started: !1, shouldDetect: !1, on: function (a, b, c, d) { var e = b.split(" "); r.each(e, function (b) { r.on(a, b, c), d && d(b) }) }, off: function (a, b, c, d) { var e = b.split(" "); r.each(e, function (b) { r.off(a, b, c), d && d(b) }) }, onTouch: function (a, b, c) { var f = this, g = function (e) { var g, h = e.type.toLowerCase(), i = d.HAS_POINTEREVENTS, j = r.inStr(h, "mouse"); j && f.preventMouseEvents || (j && b == m && 0 === e.button ? (f.preventMouseEvents = !1, f.shouldDetect = !0) : i && b == m ? f.shouldDetect = 1 === e.buttons || t.matchType(k, e) : j || b != m || (f.preventMouseEvents = !0, f.shouldDetect = !0), i && b != o && t.updatePointer(b, e), f.shouldDetect && (g = f.doDetect.call(f, e, b, a, c)), g == o && (f.preventMouseEvents = !1, f.shouldDetect = !1, t.reset()), i && b == o && t.updatePointer(b, e)) }; return this.on(a, e[b], g), g }, doDetect: function (a, b, c, d) { var e = this.getTouchList(a, b), f = e.length, g = b, h = e.trigger, i = f; b == m ? h = q : b == o && (h = p, i = e.length - (a.changedTouches ? a.changedTouches.length : 1)), i > 0 && this.started && (g = n), this.started = !0; var j = this.collectEventData(c, g, e, a); return b != o && d.call(u, j), h && (j.changedLength = i, j.eventType = h, d.call(u, j), j.eventType = g, delete j.changedLength), g == o && (d.call(u, j), this.started = !1), g }, determineEventTypes: function () { var b; return b = d.HAS_POINTEREVENTS ? a.PointerEvent ? ["pointerdown", "pointermove", "pointerup pointercancel lostpointercapture"] : ["MSPointerDown", "MSPointerMove", "MSPointerUp MSPointerCancel MSLostPointerCapture"] : d.NO_MOUSEEVENTS ? ["touchstart", "touchmove", "touchend touchcancel"] : ["touchstart mousedown", "touchmove mousemove", "touchend touchcancel mouseup"], e[m] = b[0], e[n] = b[1], e[o] = b[2], e }, getTouchList: function (a, b) { if (d.HAS_POINTEREVENTS && !(navigator.msPointerEnabled && !navigator.pointerEnabled)) return t.getTouchList(); if (a.touches) { if (b == n) return a.touches; var c = [], e = [].concat(r.toArray(a.touches), r.toArray(a.changedTouches)), f = []; return r.each(e, function (a) { r.inArray(c, a.identifier) === !1 && f.push(a), c.push(a.identifier) }), f } return a.identifier = 1, [a] }, collectEventData: function (a, b, c, d) { var e = k; return r.inStr(d.type, "mouse") || t.matchType(j, d) ? e = j : t.matchType(l, d) && (e = l), { center: r.getCenter(c), timeStamp: Date.now(), target: d.target, touches: c, eventType: b, pointerType: e, srcEvent: d, preventDefault: function () { var a = this.srcEvent; a.preventManipulation && a.preventManipulation(), a.preventDefault && a.preventDefault() }, stopPropagation: function () { this.srcEvent.stopPropagation() }, stopDetect: function () { return u.stopDetect() } } } }, t = d.PointerEvent = { pointers: {}, getTouchList: function () { var a = []; return r.each(this.pointers, function (b) { a.push(b) }), a }, updatePointer: function (a, b) { a == o || a != o && 1 !== b.buttons ? delete this.pointers[b.pointerId] : (b.identifier = b.pointerId, this.pointers[b.pointerId] = b) }, matchType: function (a, b) { if (!b.pointerType) return !1; var c = b.pointerType, d = {}; return d[j] = c === (b.MSPOINTER_TYPE_MOUSE || j), d[k] = c === (b.MSPOINTER_TYPE_TOUCH || k), d[l] = c === (b.MSPOINTER_TYPE_PEN || l), d[a] }, reset: function () { this.pointers = {} } }, u = d.detection = { gestures: [], current: null, previous: null, stopped: !1, startDetect: function (a, b) { this.current || (this.stopped = !1, this.current = { inst: a, startEvent: r.extend({}, b), lastEvent: !1, lastCalcEvent: !1, futureCalcEvent: !1, lastCalcData: {}, name: "" }, this.detect(b)) }, detect: function (a) { if (this.current && !this.stopped) { a = this.extendEventData(a); var b = this.current.inst, c = b.options; return r.each(this.gestures, function (d) { !this.stopped && b.enabled && c[d.name] && d.handler.call(d, a, b) }, this), this.current && (this.current.lastEvent = a), a.eventType == o && this.stopDetect(), a } }, stopDetect: function () { this.previous = r.extend({}, this.current), this.current = null, this.stopped = !0 }, getCalculatedData: function (a, b, c, e, f) { var g = this.current, h = !1, i = g.lastCalcEvent, j = g.lastCalcData; i && a.timeStamp - i.timeStamp > d.CALCULATE_INTERVAL && (b = i.center, c = a.timeStamp - i.timeStamp, e = a.center.clientX - i.center.clientX, f = a.center.clientY - i.center.clientY, h = !0), (a.eventType == q || a.eventType == p) && (g.futureCalcEvent = a), (!g.lastCalcEvent || h) && (j.velocity = r.getVelocity(c, e, f), j.angle = r.getAngle(b, a.center), j.direction = r.getDirection(b, a.center), g.lastCalcEvent = g.futureCalcEvent || a, g.futureCalcEvent = a), a.velocityX = j.velocity.x, a.velocityY = j.velocity.y, a.interimAngle = j.angle, a.interimDirection = j.direction }, extendEventData: function (a) { var b = this.current, c = b.startEvent, d = b.lastEvent || c; (a.eventType == q || a.eventType == p) && (c.touches = [], r.each(a.touches, function (a) { c.touches.push({ clientX: a.clientX, clientY: a.clientY }) })); var e = a.timeStamp - c.timeStamp, f = a.center.clientX - c.center.clientX, g = a.center.clientY - c.center.clientY; return this.getCalculatedData(a, d.center, e, f, g), r.extend(a, { startEvent: c, deltaTime: e, deltaX: f, deltaY: g, distance: r.getDistance(c.center, a.center), angle: r.getAngle(c.center, a.center), direction: r.getDirection(c.center, a.center), scale: r.getScale(c.touches, a.touches), rotation: r.getRotation(c.touches, a.touches) }), a }, register: function (a) { var c = a.defaults || {}; return c[a.name] === b && (c[a.name] = !0), r.extend(d.defaults, c, !0), a.index = a.index || 1e3, this.gestures.push(a), this.gestures.sort(function (a, b) { return a.index < b.index ? -1 : a.index > b.index ? 1 : 0 }), this.gestures } }; d.Instance = function (a, b) { var e = this; c(), this.element = a, this.enabled = !0, r.each(b, function (a, c) { delete b[c], b[r.toCamelCase(c)] = a }), this.options = r.extend(r.extend({}, d.defaults), b || {}), this.options.behavior && r.toggleBehavior(this.element, this.options.behavior, !0), this.eventStartHandler = s.onTouch(a, m, function (a) { e.enabled && a.eventType == m ? u.startDetect(e, a) : a.eventType == q && u.detect(a) }), this.eventHandlers = [] }, d.Instance.prototype = { on: function (a, b) { var c = this; return s.on(c.element, a, b, function (a) { c.eventHandlers.push({ gesture: a, handler: b }) }), c }, off: function (a, b) { var c = this; return s.off(c.element, a, b, function (a) { var d = r.inArray({ gesture: a, handler: b }); d !== !1 && c.eventHandlers.splice(d, 1) }), c }, trigger: function (a, b) { b || (b = {}); var c = d.DOCUMENT.createEvent("Event"); c.initEvent(a, !0, !0), c.gesture = b; var e = this.element; return r.hasParent(b.target, e) && (e = b.target), e.dispatchEvent(c), this }, enable: function (a) { return this.enabled = a, this }, dispose: function () { var a, b; for (r.toggleBehavior(this.element, this.options.behavior, !1), a = -1; b = this.eventHandlers[++a];) r.off(this.element, b.gesture, b.handler); return this.eventHandlers = [], s.off(this.element, e[m], this.eventStartHandler), null } }, function (a) { function b(b, d) { var e = u.current; if (!(d.options.dragMaxTouches > 0 && b.touches.length > d.options.dragMaxTouches)) switch (b.eventType) { case m: c = !1; break; case n: if (b.distance < d.options.dragMinDistance && e.name != a) return; var j = e.startEvent.center; if (e.name != a && (e.name = a, d.options.dragDistanceCorrection && b.distance > 0)) { var k = Math.abs(d.options.dragMinDistance / b.distance); j.pageX += b.deltaX * k, j.pageY += b.deltaY * k, j.clientX += b.deltaX * k, j.clientY += b.deltaY * k, b = u.extendEventData(b) } (e.lastEvent.dragLockToAxis || d.options.dragLockToAxis && d.options.dragLockMinDistance <= b.distance) && (b.dragLockToAxis = !0); var l = e.lastEvent.direction; b.dragLockToAxis && l !== b.direction && (b.direction = r.isVertical(l) ? b.deltaY < 0 ? h : f : b.deltaX < 0 ? g : i), c || (d.trigger(a + "start", b), c = !0), d.trigger(a, b), d.trigger(a + b.direction, b); var q = r.isVertical(b.direction); (d.options.dragBlockVertical && q || d.options.dragBlockHorizontal && !q) && b.preventDefault(); break; case p: c && b.changedLength <= d.options.dragMaxTouches && (d.trigger(a + "end", b), c = !1); break; case o: c = !1 } } var c = !1; d.gestures.Drag = { name: a, index: 50, handler: b, defaults: { dragMinDistance: 10, dragDistanceCorrection: !0, dragMaxTouches: 1, dragBlockHorizontal: !1, dragBlockVertical: !1, dragLockToAxis: !1, dragLockMinDistance: 25 } } }("drag"), d.gestures.Gesture = { name: "gesture", index: 1337, handler: function (a, b) { b.trigger(this.name, a) } }, function (a) { function b(b, d) { var e = d.options, f = u.current; switch (b.eventType) { case m: clearTimeout(c), f.name = a, c = setTimeout(function () { f && f.name == a && d.trigger(a, b) }, e.holdTimeout); break; case n: b.distance > e.holdThreshold && clearTimeout(c); break; case p: clearTimeout(c) } } var c; d.gestures.Hold = { name: a, index: 10, defaults: { holdTimeout: 500, holdThreshold: 2 }, handler: b } }("hold"), d.gestures.Release = { name: "release", index: 1 / 0, handler: function (a, b) { a.eventType == p && b.trigger(this.name, a) } }, d.gestures.Swipe = { name: "swipe", index: 40, defaults: { swipeMinTouches: 1, swipeMaxTouches: 1, swipeVelocityX: .6, swipeVelocityY: .6 }, handler: function (a, b) { if (a.eventType == p) { var c = a.touches.length, d = b.options; if (c < d.swipeMinTouches || c > d.swipeMaxTouches) return; (a.velocityX > d.swipeVelocityX || a.velocityY > d.swipeVelocityY) && (b.trigger(this.name, a), b.trigger(this.name + a.direction, a)) } } }, function (a) { function b(b, d) { var e, f, g = d.options, h = u.current, i = u.previous; switch (b.eventType) { case m: c = !1; break; case n: c = c || b.distance > g.tapMaxDistance; break; case o: !r.inStr(b.srcEvent.type, "cancel") && b.deltaTime < g.tapMaxTime && !c && (e = i && i.lastEvent && b.timeStamp - i.lastEvent.timeStamp, f = !1, i && i.name == a && e && e < g.doubleTapInterval && b.distance < g.doubleTapDistance && (d.trigger("doubletap", b), f = !0), (!f || g.tapAlways) && (h.name = a, d.trigger(h.name, b))) } } var c = !1; d.gestures.Tap = { name: a, index: 100, handler: b, defaults: { tapMaxTime: 250, tapMaxDistance: 10, tapAlways: !0, doubleTapDistance: 20, doubleTapInterval: 300 } } }("tap"), d.gestures.Touch = { name: "touch", index: -1 / 0, defaults: { preventDefault: !1, preventMouse: !1 }, handler: function (a, b) { return b.options.preventMouse && a.pointerType == j ? void a.stopDetect() : (b.options.preventDefault && a.preventDefault(), void (a.eventType == q && b.trigger("touch", a))) } }, function (a) { function b(b, d) { switch (b.eventType) { case m: c = !1; break; case n: if (b.touches.length < 2) return; var e = Math.abs(1 - b.scale), f = Math.abs(b.rotation); if (e < d.options.transformMinScale && f < d.options.transformMinRotation) return; u.current.name = a, c || (d.trigger(a + "start", b), c = !0), d.trigger(a, b), f > d.options.transformMinRotation && d.trigger("rotate", b), e > d.options.transformMinScale && (d.trigger("pinch", b), d.trigger("pinch" + (b.scale < 1 ? "in" : "out"), b)); break; case p: c && b.changedLength < 2 && (d.trigger(a + "end", b), c = !1) } } var c = !1; d.gestures.Transform = { name: a, index: 45, defaults: { transformMinScale: .01, transformMinRotation: 1 }, handler: b } }("transform"), "function" == typeof define && define.amd ? define(function () { return d }) : "undefined" != typeof module && module.exports ? module.exports = d : a.Hammer = d }(window);
/*
* Responsive Layout helper
*/
ResponsiveHelper = (function (d) { var c = [], h, e = d(window), f = false; if (window.matchMedia) { if (window.Window && window.matchMedia === Window.prototype.matchMedia) { f = true } else { if (window.matchMedia.toString().indexOf("native") > -1) { f = true } } } function b() { var j = e.width(); if (j !== h) { h = j; d.each(c, function (k, l) { d.each(l.data, function (n, m) { if (m.currentActive && !g(m.range[0], m.range[1])) { m.currentActive = false; if (typeof m.disableCallback === "function") { m.disableCallback() } } }); d.each(l.data, function (n, m) { if (!m.currentActive && g(m.range[0], m.range[1])) { m.currentActive = true; if (typeof m.enableCallback === "function") { m.enableCallback() } } }) }) } } e.bind("load resize orientationchange", b); function g(k, j) { var l = ""; if (k > 0) { l += "(min-width: " + k + "px)" } if (j < Infinity) { l += (l ? " and " : "") + "(max-width: " + j + "px)" } return i(l, k, j) } function i(l, k, j) { if (window.matchMedia && f) { return matchMedia(l).matches } else { if (window.styleMedia) { return styleMedia.matchMedium(l) } else { if (window.media) { return media.matchMedium(l) } else { return h >= k && h <= j } } } } function a(m) { var j = m.split(".."); var l = parseInt(j[0], 10) || -Infinity; var k = parseInt(j[1], 10) || Infinity; return [l, k].sort(function (o, n) { return o - n }) } return { addRange: function (k) { var j = { data: {} }; d.each(k, function (m, l) { j.data[m] = { range: a(m), enableCallback: l.on, disableCallback: l.off } }); c.push(j); h = null; b() } } }(jQuery));
/*!
* FitVids 1.0.3
*
* Copyright 2013, Chris Coyier - http://css-tricks.com + Dave Rupert - http://daverupert.com
* Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/
* Released under the WTFPL license - http://sam.zoy.org/wtfpl/
*
* Date: Thu Sept 01 18:00:00 2011 -0500
*/
; (function (a) { a.fn.fitVids = function (b) { var c = { customSelector: null }; if (!document.getElementById("fit-vids-style")) { var f = document.createElement("div"), d = document.getElementsByTagName("base")[0] || document.getElementsByTagName("script")[0], e = ""; f.className = "fit-vids-style"; f.id = "fit-vids-style"; f.style.display = "none"; f.innerHTML = e; d.parentNode.insertBefore(f, d) } if (b) { a.extend(c, b) } return this.each(function () { var g = ["iframe[src*='player.vimeo.com']", "iframe[src*='youtube.com']", "iframe[src*='youtube-nocookie.com']", "iframe[src*='kickstarter.com'][src*='video.html']", "object", "embed"]; if (c.customSelector) { g.push(c.customSelector) } var h = a(this).find(g.join(",")); h = h.not("object object"); h.each(function () { var m = a(this); if (this.tagName.toLowerCase() === "embed" && m.parent("object").length || m.parent(".fluid-width-video-wrapper").length) { return } var i = (this.tagName.toLowerCase() === "object" || (m.attr("height") && !isNaN(parseInt(m.attr("height"), 10)))) ? parseInt(m.attr("height"), 10) : m.height(), j = !isNaN(parseInt(m.attr("width"), 10)) ? parseInt(m.attr("width"), 10) : m.width(), k = i / j; if (!m.attr("id")) { var l = "fitvid" + Math.floor(Math.random() * 999999); m.attr("id", l) } m.wrap('').parent(".fluid-width-video-wrapper").css("padding-top", (k * 100) + "%"); m.removeAttr("height").removeAttr("width") }) }) } })(window.jQuery || window.Zepto);
/*
* jQuery dotdotdot 1.6.16
*
* Copyright (c) Fred Heusschen
* www.frebsite.nl
*
* Plugin website:
* dotdotdot.frebsite.nl
*
* Dual licensed under the MIT and GPL licenses.
* http://en.wikipedia.org/wiki/MIT_License
* http://en.wikipedia.org/wiki/GNU_General_Public_License
*/
!function (t, e) { function n(t, e, n) { var r = t.children(), o = !1; t.empty(); for (var i = 0, d = r.length; d > i; i++) { var l = r.eq(i); if (t.append(l), n && t.append(n), a(t, e)) { l.remove(), o = !0; break } n && n.detach() } return o } function r(e, n, i, d, l) { var s = !1, c = "table, thead, tbody, tfoot, tr, col, colgroup, object, embed, param, ol, ul, dl, blockquote, select, optgroup, option, textarea, script, style", u = "script, .dotdotdot-keep"; return e.contents().detach().each(function () { var f = this, h = t(f); if ("undefined" == typeof f || 3 == f.nodeType && 0 == t.trim(f.data).length) return !0; if (h.is(u)) e.append(h); else { if (s) return !0; e.append(h), l && e[e.is(c) ? "after" : "append"](l), a(i, d) && (s = 3 == f.nodeType ? o(h, n, i, d, l) : r(h, n, i, d, l), s || (h.detach(), s = !0)), s || l && l.detach() } }), s } function o(e, n, r, o, d) { var c = e[0]; if (!c) return !1; var f = s(c), h = -1 !== f.indexOf(" ") ? " " : " ", p = "letter" == o.wrap ? "" : h, g = f.split(p), v = -1, w = -1, b = 0, y = g.length - 1; for (o.fallbackToLetter && 0 == b && 0 == y && (p = "", g = f.split(p), y = g.length - 1) ; y >= b && (0 != b || 0 != y) ;) { var m = Math.floor((b + y) / 2); if (m == w) break; w = m, l(c, g.slice(0, w + 1).join(p) + o.ellipsis), a(r, o) ? (y = w, o.fallbackToLetter && 0 == b && 0 == y && (p = "", g = g[0].split(p), v = -1, w = -1, b = 0, y = g.length - 1)) : (v = w, b = w) } if (-1 == v || 1 == g.length && 0 == g[0].length) { var x = e.parent(); e.detach(); var T = d && d.closest(x).length ? d.length : 0; x.contents().length > T ? c = u(x.contents().eq(-1 - T), n) : (c = u(x, n, !0), T || x.detach()), c && (f = i(s(c), o), l(c, f), T && d && t(c).parent().append(d)) } else f = i(g.slice(0, v + 1).join(p), o), l(c, f); return !0 } function a(t, e) { return t.innerHeight() > e.maxHeight } function i(e, n) { for (; t.inArray(e.slice(-1), n.lastCharacter.remove) > -1;) e = e.slice(0, -1); return t.inArray(e.slice(-1), n.lastCharacter.noEllipsis) < 0 && (e += n.ellipsis), e } function d(t) { return { width: t.innerWidth(), height: t.innerHeight() } } function l(t, e) { t.innerText ? t.innerText = e : t.nodeValue ? t.nodeValue = e : t.textContent && (t.textContent = e) } function s(t) { return t.innerText ? t.innerText : t.nodeValue ? t.nodeValue : t.textContent ? t.textContent : "" } function c(t) { do t = t.previousSibling; while (t && 1 !== t.nodeType && 3 !== t.nodeType); return t } function u(e, n, r) { var o, a = e && e[0]; if (a) { if (!r) { if (3 === a.nodeType) return a; if (t.trim(e.text())) return u(e.contents().last(), n) } for (o = c(a) ; !o;) { if (e = e.parent(), e.is(n) || !e.length) return !1; o = c(e[0]) } if (o) return u(t(o), n) } return !1 } function f(e, n) { return e ? "string" == typeof e ? (e = t(e, n), e.length ? e : !1) : e.jquery ? e : !1 : !1 } function h(t) { for (var e = t.innerHeight(), n = ["paddingTop", "paddingBottom"], r = 0, o = n.length; o > r; r++) { var a = parseInt(t.css(n[r]), 10); isNaN(a) && (a = 0), e -= a } return e } if (!t.fn.dotdotdot) { t.fn.dotdotdot = function (e) { if (0 == this.length) return t.fn.dotdotdot.debug('No element found for "' + this.selector + '".'), this; if (this.length > 1) return this.each(function () { t(this).dotdotdot(e) }); var o = this; o.data("dotdotdot") && o.trigger("destroy.dot"), o.data("dotdotdot-style", o.attr("style") || ""), o.css("word-wrap", "break-word"), "nowrap" === o.css("white-space") && o.css("white-space", "normal"), o.bind_events = function () { return o.bind("update.dot", function (e, d) { e.preventDefault(), e.stopPropagation(), l.maxHeight = "number" == typeof l.height ? l.height : h(o), l.maxHeight += l.tolerance, "undefined" != typeof d && (("string" == typeof d || d instanceof HTMLElement) && (d = t("").append(d).contents()), d instanceof t && (i = d)), g = o.wrapInner('').children(), g.contents().detach().end().append(i.clone(!0)).find("br").replaceWith("
").end().css({ height: "auto", width: "auto", border: "none", padding: 0, margin: 0 }); var c = !1, u = !1; return s.afterElement && (c = s.afterElement.clone(!0), c.show(), s.afterElement.detach()), a(g, l) && (u = "children" == l.wrap ? n(g, l, c) : r(g, o, g, l, c)), g.replaceWith(g.contents()), g = null, t.isFunction(l.callback) && l.callback.call(o[0], u, i), s.isTruncated = u, u }).bind("isTruncated.dot", function (t, e) { return t.preventDefault(), t.stopPropagation(), "function" == typeof e && e.call(o[0], s.isTruncated), s.isTruncated }).bind("originalContent.dot", function (t, e) { return t.preventDefault(), t.stopPropagation(), "function" == typeof e && e.call(o[0], i), i }).bind("destroy.dot", function (t) { t.preventDefault(), t.stopPropagation(), o.unwatch().unbind_events().contents().detach().end().append(i).attr("style", o.data("dotdotdot-style") || "").data("dotdotdot", !1) }), o }, o.unbind_events = function () { return o.unbind(".dot"), o }, o.watch = function () { if (o.unwatch(), "window" == l.watch) { var e = t(window), n = e.width(), r = e.height(); e.bind("resize.dot" + s.dotId, function () { n == e.width() && r == e.height() && l.windowResizeFix || (n = e.width(), r = e.height(), u && clearInterval(u), u = setTimeout(function () { o.trigger("update.dot") }, 100)) }) } else c = d(o), u = setInterval(function () { if (o.is(":visible")) { var t = d(o); (c.width != t.width || c.height != t.height) && (o.trigger("update.dot"), c = t) } }, 500); return o }, o.unwatch = function () { return t(window).unbind("resize.dot" + s.dotId), u && clearInterval(u), o }; var i = o.contents(), l = t.extend(!0, {}, t.fn.dotdotdot.defaults, e), s = {}, c = {}, u = null, g = null; return l.lastCharacter.remove instanceof Array || (l.lastCharacter.remove = t.fn.dotdotdot.defaultArrays.lastCharacter.remove), l.lastCharacter.noEllipsis instanceof Array || (l.lastCharacter.noEllipsis = t.fn.dotdotdot.defaultArrays.lastCharacter.noEllipsis), s.afterElement = f(l.after, o), s.isTruncated = !1, s.dotId = p++, o.data("dotdotdot", !0).bind_events().trigger("update.dot"), l.watch && o.watch(), o }, t.fn.dotdotdot.defaults = { ellipsis: "... ", wrap: "word", fallbackToLetter: !0, lastCharacter: {}, tolerance: 0, callback: null, after: null, height: null, watch: !1, windowResizeFix: !0 }, t.fn.dotdotdot.defaultArrays = { lastCharacter: { remove: [" ", " ", ",", ";", ".", "!", "?"], noEllipsis: [] } }, t.fn.dotdotdot.debug = function () { }; var p = 1, g = t.fn.html; t.fn.html = function (n) { return n != e && !t.isFunction(n) && this.data("dotdotdot") ? this.trigger("update", [n]) : g.apply(this, arguments) }; var v = t.fn.text; t.fn.text = function (n) { return n != e && !t.isFunction(n) && this.data("dotdotdot") ? (n = t("").text(n).html(), this.trigger("update", [n])) : v.apply(this, arguments) } } }(jQuery);
/**
* jquery.matchHeight-min.js v0.5.2
* http://brm.io/jquery-match-height/
* License: MIT
*/
(function(c){var n=-1,f=-1,r=function(a){var b=null,d=[];c(a).each(function(){var a=c(this),k=a.offset().top-h(a.css("margin-top")),l=0=Math.floor(Math.abs(b-k))?d[d.length-1]=l.add(a):d.push(a);b=k});return d},h=function(a){return parseFloat(a)||0},p=function(a){var b={byRow:!0,remove:!1,property:"height"};if("object"===typeof a)return c.extend(b,a);"boolean"===typeof a?b.byRow=a:"remove"===a&&(b.remove=!0);return b},b=c.fn.matchHeight=function(a){a=
p(a);if(a.remove){var e=this;this.css(a.property,"");c.each(b._groups,function(a,b){b.elements=b.elements.not(e)});return this}if(1>=this.length)return this;b._groups.push({elements:this,options:a});b._apply(this,a);return this};b._groups=[];b._throttle=80;b._maintainScroll=!1;b._beforeUpdate=null;b._afterUpdate=null;b._apply=function(a,e){var d=p(e),g=c(a),k=[g],l=c(window).scrollTop(),f=c("html").outerHeight(!0),m=g.parents().filter(":hidden");m.each(function(){var a=c(this);a.data("style-cache",
a.attr("style"))});m.css("display","block");d.byRow&&(g.each(function(){var a=c(this),b="inline-block"===a.css("display")?"inline-block":"block";a.data("style-cache",a.attr("style"));a.css({display:b,"padding-top":"0","padding-bottom":"0","margin-top":"0","margin-bottom":"0","border-top-width":"0","border-bottom-width":"0",height:"100px"})}),k=r(g),g.each(function(){var a=c(this);a.attr("style",a.data("style-cache")||"")}));c.each(k,function(a,b){var e=c(b),f=0;d.byRow&&1>=e.length?e.css(d.property,
""):(e.each(function(){var a=c(this),b={display:"inline-block"===a.css("display")?"inline-block":"block"};b[d.property]="";a.css(b);a.outerHeight(!1)>f&&(f=a.outerHeight(!1));a.css("display","")}),e.each(function(){var a=c(this),b=0;"border-box"!==a.css("box-sizing")&&(b+=h(a.css("border-top-width"))+h(a.css("border-bottom-width")),b+=h(a.css("padding-top"))+h(a.css("padding-bottom")));a.css(d.property,f-b)}))});m.each(function(){var a=c(this);a.attr("style",a.data("style-cache")||null)});b._maintainScroll&&
c(window).scrollTop(l/f*c("html").outerHeight(!0));return this};b._applyDataApi=function(){var a={};c("[data-match-height], [data-mh]").each(function(){var b=c(this),d=b.attr("data-match-height")||b.attr("data-mh");a[d]=d in a?a[d].add(b):b});c.each(a,function(){this.matchHeight(!0)})};var q=function(a){b._beforeUpdate&&b._beforeUpdate(a,b._groups);c.each(b._groups,function(){b._apply(this.elements,this.options)});b._afterUpdate&&b._afterUpdate(a,b._groups)};b._update=function(a,e){if(e&&"resize"===
e.type){var d=c(window).width();if(d===n)return;n=d}a?-1===f&&(f=setTimeout(function(){q(e);f=-1},b._throttle)):q(e)};c(b._applyDataApi);c(window).bind("load",function(a){b._update(!1,a)});c(window).bind("resize orientationchange",function(a){b._update(!0,a)})})(jQuery);
/*!
* hoverIntent v1.8.1 // 2014.08.11 // jQuery v1.9.1+
* http://cherne.net/brian/resources/jquery.hoverIntent.html
*
* You may use hoverIntent under the terms of the MIT license. Basically that
* means you are free to use hoverIntent as long as this header is left intact.
* Copyright 2007, 2014 Brian Cherne
*/
/* hoverIntent is similar to jQuery's built-in "hover" method except that
* instead of firing the handlerIn function immediately, hoverIntent checks
* to see if the user's mouse has slowed down (beneath the sensitivity
* threshold) before firing the event. The handlerOut function is only
* called after a matching handlerIn.
*
* // basic usage ... just like .hover()
* .hoverIntent( handlerIn, handlerOut )
* .hoverIntent( handlerInOut )
*
* // basic usage ... with event delegation!
* .hoverIntent( handlerIn, handlerOut, selector )
* .hoverIntent( handlerInOut, selector )
*
* // using a basic configuration object
* .hoverIntent( config )
*
* @param handlerIn function OR configuration object
* @param handlerOut function OR selector for delegation OR undefined
* @param selector selector OR undefined
* @author Brian Cherne
*/
(function(factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
define(['jquery'], factory);
} else if (jQuery && !jQuery.fn.hoverIntent) {
factory(jQuery);
}
})(function($) {
'use strict';
// default configuration values
var _cfg = {
interval: 100,
sensitivity: 6,
timeout: 0
};
// counter used to generate an ID for each instance
var INSTANCE_COUNT = 0;
// current X and Y position of mouse, updated during mousemove tracking (shared across instances)
var cX, cY;
// saves the current pointer position coordinated based on the given mouse event
var track = function(ev) {
cX = ev.pageX;
cY = ev.pageY;
};
// compares current and previous mouse positions
var compare = function(ev,$el,s,cfg) {
// compare mouse positions to see if pointer has slowed enough to trigger `over` function
if ( Math.sqrt( (s.pX-cX)*(s.pX-cX) + (s.pY-cY)*(s.pY-cY) ) < cfg.sensitivity ) {
$el.off('mousemove.hoverIntent'+s.namespace,track);
delete s.timeoutId;
// set hoverIntent state as active for this element (so `out` handler can eventually be called)
s.isActive = true;
// clear coordinate data
delete s.pX; delete s.pY;
return cfg.over.apply($el[0],[ev]);
} else {
// set previous coordinates for next comparison
s.pX = cX; s.pY = cY;
// use self-calling timeout, guarantees intervals are spaced out properly (avoids JavaScript timer bugs)
s.timeoutId = setTimeout( function(){compare(ev, $el, s, cfg);} , cfg.interval );
}
};
// triggers given `out` function at configured `timeout` after a mouseleave and clears state
var delay = function(ev,$el,s,out) {
delete $el.data('hoverIntent')[s.id];
return out.apply($el[0],[ev]);
};
$.fn.hoverIntent = function(handlerIn,handlerOut,selector) {
// instance ID, used as a key to store and retrieve state information on an element
var instanceId = INSTANCE_COUNT++;
// extend the default configuration and parse parameters
var cfg = $.extend({}, _cfg);
if ( $.isPlainObject(handlerIn) ) {
cfg = $.extend(cfg, handlerIn );
} else if ($.isFunction(handlerOut)) {
cfg = $.extend(cfg, { over: handlerIn, out: handlerOut, selector: selector } );
} else {
cfg = $.extend(cfg, { over: handlerIn, out: handlerIn, selector: handlerOut } );
}
// A private function for handling mouse 'hovering'
var handleHover = function(e) {
// cloned event to pass to handlers (copy required for event object to be passed in IE)
var ev = $.extend({},e);
// the current target of the mouse event, wrapped in a jQuery object
var $el = $(this);
// read hoverIntent data from element (or initialize if not present)
var hoverIntentData = $el.data('hoverIntent');
if (!hoverIntentData) { $el.data('hoverIntent', (hoverIntentData = {})); }
// read per-instance state from element (or initialize if not present)
var state = hoverIntentData[instanceId];
if (!state) { hoverIntentData[instanceId] = state = { id: instanceId }; }
// state properties:
// id = instance ID, used to clean up data
// timeoutId = timeout ID, reused for tracking mouse position and delaying "out" handler
// isActive = plugin state, true after `over` is called just until `out` is called
// pX, pY = previously-measured pointer coordinates, updated at each polling interval
// namespace = string used as namespace for per-instance event management
// clear any existing timeout
if (state.timeoutId) { state.timeoutId = clearTimeout(state.timeoutId); }
// event namespace, used to register and unregister mousemove tracking
var namespace = state.namespace = '.hoverIntent'+instanceId;
// handle the event, based on its type
if (e.type === 'mouseenter') {
// do nothing if already active
if (state.isActive) { return; }
// set "previous" X and Y position based on initial entry point
state.pX = ev.pageX; state.pY = ev.pageY;
// update "current" X and Y position based on mousemove
$el.on('mousemove.hoverIntent'+namespace,track);
// start polling interval (self-calling timeout) to compare mouse coordinates over time
state.timeoutId = setTimeout( function(){compare(ev,$el,state,cfg);} , cfg.interval );
} else { // "mouseleave"
// do nothing if not already active
if (!state.isActive) { return; }
// unbind expensive mousemove event
$el.off('mousemove.hoverIntent'+namespace,track);
// if hoverIntent state is true, then call the mouseOut function after the specified delay
state.timeoutId = setTimeout( function(){delay(ev,$el,state,cfg.out);} , cfg.timeout );
}
};
// listen for mouseenter and mouseleave
return this.on({'mouseenter.hoverIntent':handleHover,'mouseleave.hoverIntent':handleHover}, cfg.selector);
};
});
/*!
* jQuery Mousewheel 3.1.13
*
* Copyright 2015 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*/
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a:a(jQuery)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||f>n)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})});
/**
* Copyright (c) 2007-2015 Ariel Flesler - aflesler ? gmail • com | http://flesler.blogspot.com
* Licensed under MIT
* @author Ariel Flesler
* @version 2.1.3
*/
;(function(f){"use strict";"function"===typeof define&&define.amd?define(["jquery"],f):"undefined"!==typeof module&&module.exports?module.exports=f(require("jquery")):f(jQuery)})(function($){"use strict";function n(a){return!a.nodeName||-1!==$.inArray(a.nodeName.toLowerCase(),["iframe","#document","html","body"])}function h(a){return $.isFunction(a)||$.isPlainObject(a)?a:{top:a,left:a}}var p=$.scrollTo=function(a,d,b){return $(window).scrollTo(a,d,b)};p.defaults={axis:"xy",duration:0,limit:!0};$.fn.scrollTo=function(a,d,b){"object"=== typeof d&&(b=d,d=0);"function"===typeof b&&(b={onAfter:b});"max"===a&&(a=9E9);b=$.extend({},p.defaults,b);d=d||b.duration;var u=b.queue&&1=f[g]?0:Math.min(f[g],n));!a&&1