').appendTo(base.slides);
}
if (base.options.pagination === true) {
base.buildPagination();
}
},
buildPagination: function () {
var base = this;
base.paginationWrapper = $('
');
base.Controls.append(base.paginationWrapper);
base.paginationWrapper.on("touchend.Controls mouseup.Controls", ".page", function (e) {
e.preventDefault();
if (Number($(this).data("page")) !== base.currentItem) {
base.goTo(Number($(this).data('page')), true);
}
});
},
updateControls: function () {
var base = this;
base.updatePagination();
},
updatePagination: function () {
var base = this,
counter = 0,
lastPage,
lastItem,
i,
paginationButton,
paginationButtonInner;
if (base.options.pagination === false) { return false; }
base.paginationWrapper.html("");
lastPage = base.itemsAmount - base.itemsAmount % 1;
for (i = 0; i < base.itemsAmount; i += 1) {
counter += 1;
if (lastPage === i) {
lastItem = base.itemsAmount - 1;
}
paginationButton = $("
", { "class" : "page" });
paginationButtonInner = $("
", { "text": counter });
paginationButton.append(paginationButtonInner);
paginationButton.data('page', lastPage === i ? lastItem : i);
paginationButton.data('roundPages', counter);
base.paginationWrapper.append(paginationButton);
}
base.checkPagination();
},
checkPagination: function () {
var base = this;
if (base.options.pagination === false) {
return false;
}
base.paginationWrapper.find('.page').each(function () {
var $this = $(this);
if ($this.data('roundPages') === $(base.slideItems[base.currentItem]).data('roundPages')) {
$this.siblings().removeClass('active').end().addClass('active');
}
});
},
goTo: function (position) {
var base = this;
if (base.isTransition) { return false; }
base.currentItem = position;
if (base.browser.supportCSS3 === true) {
base.transition3d(base.positionsInArray[position]);
base.afterGo();
base.singleItemTransition();
} else {
base.css2slide(base.positionsInArray[position], 1000);
base.afterGo();
}
return false;
},
afterGo: function () {
var base = this;
base.prevArr.push(base.currentItem);
base.prevItem = base.prevArr[base.prevArr.length - 2];
var $prevItem = base.slideItems.eq(base.prevItem);
base.slideItems.eq(base.prevItem);
if (base.browser.supportCSS3 === true) {
base.to($prevItem);
}
if (base.prevItem !== base.currentItem) {
base.checkPagination();
if (base.options.autoHeight === true) {
base.autoHeight();
}
if (base.options.autoPlay !== false) {
base.checkAp();
}
}
},
checkAp: function () {
var base = this;
if (base.apStatus !== "stop") {
base.play();
}
},
play: function () {
var base = this;
base.apStatus = "play";
if (base.options.autoPlay === false) {
return false;
}
window.clearInterval(base.autoPlayInterval);
base.autoPlayInterval = window.setInterval(function () {
base.next();
}, base.options.autoPlay);
},
stop: function () {
var base = this;
base.apStatus = "stop";
window.clearInterval(base.autoPlayInterval);
},
stopOnHover: function () {
var base = this;
if (base.options.autoPlay !== false) {
base.el.on("mouseover", function () {
base.stop();
}).on("mouseout", function () {
base.play();
});
}
},
autoHeight: function () {
var base = this;
function addHeight() {
var $currentItem = $(base.slideItems[base.currentItem]).height();
base.outer.css('height', $currentItem + 'px');
if (!base.outer.hasClass('autoHeight')) {
window.setTimeout(function () {
base.outer.addClass('autoHeight');
}, 0);
}
}
addHeight();
},
next: function () {
var base = this;
if (base.isTransition) { return false; }
base.currentItem += 1;
if (base.currentItem > base.maximumItem) {
base.currentItem = 0;
}
base.goTo(base.currentItem);
},
singleItemTransition: function () {
var base = this,
outClass = 'text-fade-out',
inClass = 'text-fade-in',
$currentItem = base.slideItems.eq(base.currentItem),
$prevItem = base.slideItems.eq(base.prevItem),
prevPos = Math.abs(base.positionsInArray[base.currentItem]) + base.positionsInArray[base.prevItem],
animEnd = base.animEndName();
base.isTransition = true;
base.from($currentItem);
function transStyles(prevPos) {
return {
"position" : "relative",
"left" : prevPos + "px"
};
}
$prevItem.css(transStyles(prevPos)).addClass(outClass)
.on(animEnd, function () {
base.endPrev = true;
$prevItem.off(animEnd);
base.clearTransStyle($prevItem, outClass);
});
$currentItem.addClass(inClass)
.on(animEnd, function () {
base.endCurrent = true;
$currentItem.off(animEnd);
base.clearTransStyle($currentItem, inClass);
});
},
animEndName: function () {
var animEndEventNames = {
'WebkitAnimation' : 'webkitAnimationEnd',
'OAnimation' : 'oAnimationEnd',
'msAnimation' : 'MSAnimationEnd',
'animation' : 'animationend'
};
return animEndEventNames[Modernizr.prefixed('animation')];
},
clearTransStyle: function (item, classToRemove) {
var base = this;
item.css({
"position" : "",
"left" : ""
}).removeClass(classToRemove);
if (base.endPrev && base.endCurrent) {
base.endPrev = false;
base.endCurrent = false;
base.isTransition = false;
}
},
loops: function () {
var base = this,
prev = 0,
elWidth = 0,
i,
item,
roundPageNum;
base.positionsInArray = [0];
base.pagesInArray = [];
for (i = 0; i < base.itemsAmount; i += 1) {
elWidth += base.itemWidth;
base.positionsInArray.push(-elWidth);
item = $(base.slideItems[i]);
roundPageNum = item.data("roundPages");
if (roundPageNum !== prev) {
base.pagesInArray[prev] = base.positionsInArray[i];
prev = roundPageNum;
}
}
},
doTranslate: function (pixels) {
return {
"-webkit-transform": "translateX(" + pixels + "px)",
"-moz-transform": "translateX(" + pixels + "px)",
"-o-transform": "translateX(" + pixels + "px)",
"-ms-transform": "translateX(" + pixels + "px)",
"transform": "translateX(" + pixels + "px)"
};
},
transition3d: function (value) {
var base = this;
base.wrapper.css(base.doTranslate(value));
},
css2slide: function (value, speed) {
var base = this;
base.wrapper.stop(true, true).animate({
"left" : value
}, {
duration : speed
});
},
checkBrowser: function () {
var base = this;
base.browser = {
"supportCSS3" : Modernizr.cssanimations && Modernizr.csstransitions,
"touch" : Modernizr.touch
};
},
from: function (element, cb) {
var base = this;
element.each(function () {
var $item = $(this),
$elements = $item.find(':header');
$elements.each(function (idx, value) {
var $element = $(value),
elementData = $element.data('data'),
textData = $element.data('text') || {},
$current = textData.current,
$elem = textData.text, $chars;
$current.text($elem.html()).lettering('words');
$chars = $current.find('[class^="word"]');
if (base.isInEffect(elementData.from.effect)) {
$chars.css('visibility', 'hidden');
} else if (base.isOutEffect(elementData.from.effect)) {
$chars.css('visibility', 'visible');
}
base.animateChars($chars, elementData.from, function () {
if (cb) {
cb(base);
}
});
});
});
},
to: function (element, cb) {
var base = this;
element.each(function () {
var $item = $(this),
$elements = $item.find(':header');
$elements.each(function (idx, value) {
var $element = $(value),
elementData = $element.data('data'),
textData = $element.data('text') || {},
$current = textData.current,
$elem = textData.text, $chars;
$current.text($elem.html()).lettering('words');
$chars = $current.find('[class^="word"]');
base.animateChars($chars, elementData.to, function () {
if (cb) {
cb(base);
}
});
});
});
},
animateChars: function ($chars, options, cb) {
var base = this,
count = $chars.length;
if (!count) {
cb && cb();
return;
}
$.each($chars, function (i, c) {
var $char = $(c);
function complete() {
if (base.isInEffect(options.effect)) {
$char.css('visibility', 'visible');
} else if (base.isOutEffect(options.effect)) {
$char.css('visibility', 'hidden');
}
count -= 1;
if (!count && cb) {
cb();
}
}
var delay = options.sync ? options.delay : options.delay * i;
$char.text() ? setTimeout(function() { base.animate($char, options.effect, complete) }, delay) : complete();
});
},
isInEffect: function (effect) {
return /In/.test(effect);
},
isOutEffect: function (effect) {
return /Out/.test(effect);
},
getData: function (node) {
var attrs = node.attributes || [], data = {};
if (!attrs.length) { return data; }
$.each(attrs, function (i, attr) {
if (/^data-from-*/.test(attr.nodeName)) {
data.from = {};
data.from[attr.nodeName.replace(/data-from-/, '')] = attr.nodeValue;
} else if (/^data-to-*/.test(attr.nodeName)) {
data.to = {};
data.to[attr.nodeName.replace(/data-to-/, '')] = attr.nodeValue;
} else if (/^data-*/.test(attr.nodeName)) {
data[attr.nodeName] = attr.nodeValue;
}
});
return data;
},
animate: function ($c, effect, cb) {
$c.addClass('animate ' + effect).css('visibility', 'visible').show();
$c.one('animationend webkitAnimationEnd oAnimationEnd', function () {
$c.removeClass('animate ' + effect);
cb && cb();
});
}
}
$.fn.textislide = function (option) {
return this.each(function () {
var $this = $(this),
data = $this.data('textislide'),
options = typeof option == 'object' && option;
if (!data) {
$this.data('textislide', new Textislide(this, options));
}
});
};
$.fn.textislide.defaults = {
pagination: true,
autoStart: false,
autoPlay: false,
autoHeight: false
};
}(jQuery, window));
/**********************************************************************************/
/*
* fitVids
* MIT licensed
*
*/
(function ($) {
$.fn.fitVids = function(options) {
var settings = {
customSelector: null
};
if (!document.getElementById('fit-vids-style')) {
var div = document.createElement('div'),
ref = document.getElementsByTagName('base')[0] || document.getElementsByTagName('script')[0],
cssStyles = '';
div.className = 'fit-vids-style';
div.id = 'fit-vids-style';
div.style.display = 'none';
div.innerHTML = cssStyles;
ref.parentNode.insertBefore(div,ref);
}
if (options) {
$.extend(settings, options);
}
return this.each(function () {
var selectors = [
"iframe[src*='player.vimeo.com']",
"iframe[src*='youtube.com']",
"iframe[src*='youtube-nocookie.com']",
"iframe[src*='kickstarter.com'][src*='video.html']",
"object",
"embed"
];
if (settings.customSelector) {
selectors.push(settings.customSelector);
}
var $allVideos = $(this).find(selectors.join(',')).not("iframe[src^='http:/\/\']");
$allVideos = $allVideos.not("object object"); // SwfObj conflict patch
$allVideos.each(function(){
var $this = $(this);
if (this.tagName.toLowerCase() === 'embed' && $this.parent('object').length || $this.parent('.fluid-width-video-wrapper').length) {
return;
}
var height = ( this.tagName.toLowerCase() === 'object' || ($this.attr('height') && !isNaN(parseInt($this.attr('height'), 10))) ) ? parseInt($this.attr('height'), 10) : $this.height(),
width = !isNaN(parseInt($this.attr('width'), 10)) ? parseInt($this.attr('width'), 10) : $this.width(),
aspectRatio = height / width;
if(!$this.attr('id')) {
var videoID = 'fitvid' + Math.floor(Math.random()*999999);
$this.attr('id', videoID);
}
$this.wrap('').parent('.fluid-width-video-wrapper').css('padding-top', (aspectRatio * 100)+"%");
$this.removeAttr('height').removeAttr('width');
});
});
};
})(jQuery);
/**********************************************************************************/
/*
* SlideFade
* MIT licensed
*
*/
(function ($) {
$.fn.slideFade = function (options) {
if (!this.length) { return this; }
var opts = $.extend(true, {}, $.fn.slideFade.defaults, options),
round = Math.round, atan2 = Math.atan2,
aniProp = [{ top: 0 }, { left: 0 }, { top: 0 }, { left: 0 }];
var getDirection = function(ev, obj) {
var o = obj.offset(),
w = obj.outerWidth(),
h = obj.outerHeight(),
x = (ev.pageX - o.left - (w / 2) * (w > h ? (h / w) : 1)),
y = (ev.pageY - o.top - (h / 2) * (h > w ? (w / h) : 1)),
d = round(atan2(y, x) / 1.57079633 + 5) % 4;
return d;
};
this.each(function (id, value) {
if ($.data(this, 'css')) { return; }
var $this = $(value),
w = $this.width(),
h = $this.height();
$.data(this, 'css', {
w: w,
h: h,
wm: w > h + 1 ? (h / w) : 1,
hm: h > w + 1 ? (w / h) : 1,
reset: [{
left: 0,
top: '-100%',
display: 'block'
}, {
left: '100%',
top: 0,
display: 'block'
}, {
left: 0,
top: '100%',
display: 'block'
}, {
left: '-100%',
top: 0,
display: 'block'
}]
});
});
this.on('mouseenter.slidefade mouseleave.slidefade', function (event) {
var $this = $(this), css = $.data(this, 'css'),
$inner = ('find' in opts) ? $this.find(opts.find) : $this.children(opts.selector);
if (event.type === 'mouseenter') {
$inner
.stop(true, true)
.css(css.reset[getDirection(event, $this)])
.stop(true, true)
.animate({ top: 0, left: 0 }, opts.slide.duration);
} else {
$inner.fadeOut(opts.fade.duration, function () {
$(this).stop(true, true).css(css.reset[0]);
});
}
});
return this;
};
$.fn.slideFade.defaults = {
selector: 'a',
slide: {
duration: 200,
easing: 'swing'
},
fade: {
duration: 650,
easing: 'swing'
}
};
})(jQuery);
/**********************************************************************************/
/*
* countTo
* MIT licensed
*
*/
(function ($) {
$.fn.countTo = function (options) {
options = options || {};
return $(this).each(function () {
// set options for current element
var settings = $.extend({}, $.fn.countTo.defaults, {
from: $(this).data('from'),
to: $(this).data('to'),
speed: $(this).data('speed'),
refreshInterval: $(this).data('refresh-interval'),
decimals: $(this).data('decimals')
}, options);
// how many times to update the value, and how much to increment the value on each update
var loops = Math.ceil(settings.speed / settings.refreshInterval),
increment = (settings.to - settings.from) / loops;
// references & variables that will change with each update
var self = this,
$self = $(this),
loopCount = 0,
value = settings.from,
data = $self.data('countTo') || {};
$self.data('countTo', data);
// if an existing interval can be found, clear it first
if (data.interval) {
clearInterval(data.interval);
}
data.interval = setInterval(updateTimer, settings.refreshInterval);
// initialize the element with the starting value
render(value);
function updateTimer() {
value += increment;
loopCount++;
render(value);
if (loopCount >= loops) {
// remove the interval
$self.removeData('countTo');
clearInterval(data.interval);
value = settings.to;
}
}
function render(value) {
var formattedValue = value.toFixed(settings.decimals);
$self.children('.count').html(formattedValue);
}
});
};
$.fn.countTo.defaults = {
from: 0, // the number the element should start at
to: 0, // the number the element should end at
speed: 1000, // how long it should take to count between the target numbers
refreshInterval: 10, // how often the element should be updated
decimals: 0
};
})(jQuery);
/**********************************************************************************/
/*
* progressBar
* MIT licensed
*
*/
(function ($) {
$.fn.progressBar = function(options, callback) {
var defaults = {
speed: 600,
easing: 'swing'
}, o = $.extend({}, defaults, options);
return this.each(function() {
var elem = $(this), methods = {};
methods = {
init: function () {
this.touch = Modernizr.touch ? true : false;
this.refreshElements();
this.processing();
},
elements: {
'.bar': 'bar',
'.percent': 'per'
},
$: function(selector) { return $(selector, elem); },
refreshElements: function () {
for (var key in this.elements) {
this[this.elements[key]] = this.$(key);
}
},
getProgress: function() { return this.bar.data('progress'); },
setProgress: function(self) {
self.bar.animate({'width': self.getProgress() + '%'}, {
duration: o.speed,
easing: o.easing,
step: function(progress) {
self.per.text(Math.ceil(progress) + '%');
},
complete: function(scope, i, elem) {
if (callback) {
callback.call(this, i, elem);
}
}
});
},
processing: function() {
var self = this;
if (self.touch) {
self.setProgress(self);
} else {
elem.waypoint(function(direction) {
if (direction == 'down') {
self.setProgress(self);
}
}, { offset: '64%'});
}
}
};
methods.init();
});
};
})(jQuery);
/**********************************************************************************/
/*
* parallax
* MIT licensed
*
*/
(function ($) {
$.fn.parallax = function(xpos, speed) {
var firstTop, pos;
return this.each(function (idx, value) {
var $this = $(value);
if (arguments.length < 1 || xpos === null) { xpos = "50%"; }
if (arguments.length < 2 || speed === null) { speed = 0.4; }
return ({
update: function() {
firstTop = $this.offset().top;
pos = $(window).scrollTop();
$this.css('backgroundPosition', xpos + " " + Math.round((firstTop - pos) * speed) + "px");
},
init: function() {
var self = this;
self.update();
$(window).on('scroll', self.update);
}
}.init());
});
};
})(jQuery);
/**********************************************************************************/
/*
* Notifications
* MIT licensed
*
*/
(function ($) {
$.fn.notifications = function (options) {
var defaults = { speed: 200 },
o = $.extend({}, defaults, options);
return this.each(function () {
var closeBtn = $(''),
closeButton = $(this).append(closeBtn).find('> .alert-close');
function fadeItSlideIt(object) {
object.fadeTo(o.speed, 0, function () {
object.slideUp(o.speed);
});
}
closeButton.click(function () {
fadeItSlideIt($(this).parent());
return false;
});
});
};
})(jQuery);
/**********************************************************************************/
/*
Tooltipster 3.1.2 | 2014-03-17
A rockin' custom tooltip jQuery plugin
Developed by Caleb Jacob under the MIT license http://opensource.org/licenses/MIT
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/* Tooltipster v3.1.2 */;(function(e,t,n){function o(t,n){this.callbacks={hide:[],show:[]};this.checkInterval=null;this.content;this.$el=e(t);this.$elProxy;this.elProxyPosition;this.enabled=true;this.options=e.extend({},s,n);this.mouseIsOverProxy=false;this.namespace="tooltipster-"+Math.round(Math.random()*1e5);this.status="hidden";this.timerHide=null;this.timerShow=null;this.$tooltip;this.options.iconTheme=this.options.iconTheme.replace(".","");this.options.theme=this.options.theme.replace(".","");this.init()}function u(t,n){var r=true;e.each(t,function(e,i){if(typeof n[e]==="undefined"||t[e]!==n[e]){r=false;return false}});return r}function l(){return!f&&a}function c(){var e=n.body||n.documentElement,t=e.style,r="transition";if(typeof t[r]=="string"){return true}v=["Moz","Webkit","Khtml","O","ms"],r=r.charAt(0).toUpperCase()+r.substr(1);for(var i=0;i');t.$elProxy.text(t.options.icon)}else{if(t.options.iconCloning)t.$elProxy=t.options.icon.clone(true);else t.$elProxy=t.options.icon}t.$elProxy.insertAfter(t.$el)}else{t.$elProxy=t.$el}if(t.options.trigger=="hover"){t.$elProxy.on("mouseenter."+t.namespace,function(){if(!l()||t.options.touchDevices){t.mouseIsOverProxy=true;t.showTooltip()}}).on("mouseleave."+t.namespace,function(){if(!l()||t.options.touchDevices){t.mouseIsOverProxy=false}});if(a&&t.options.touchDevices){t.$elProxy.on("touchstart."+t.namespace,function(){t.showTooltipNow()})}}else if(t.options.trigger=="click"){t.$elProxy.on("click."+t.namespace,function(){if(!l()||t.options.touchDevices){t.showTooltip()}})}}},showTooltip:function(){var e=this;if(e.status!="shown"&&e.status!="appearing"){if(e.options.delay){e.timerShow=setTimeout(function(){if(e.options.trigger=="click"||e.options.trigger=="hover"&&e.mouseIsOverProxy){e.showTooltipNow()}},e.options.delay)}else e.showTooltipNow()}},showTooltipNow:function(n){var i=this;i.options.functionBefore.call(i.$el,i.$el,function(){if(i.enabled&&i.content!==null){if(n)i.callbacks.show.push(n);i.callbacks.hide=[];clearTimeout(i.timerShow);i.timerShow=null;clearTimeout(i.timerHide);i.timerHide=null;if(i.options.onlyOne){e(".tooltipstered").not(i.$el).each(function(t,n){var i=e(n),s=i[r]("status"),o=i[r]("option","autoClose");if(s!=="hidden"&&s!=="disappearing"&&o){i[r]("hide")}})}var s=function(){i.status="shown";e.each(i.callbacks.show,function(e,t){t.call(i.$el)});i.callbacks.show=[]};if(i.status!=="hidden"){var o=0;if(i.status==="disappearing"){i.status="appearing";if(c()){i.$tooltip.clearQueue().removeClass("tooltipster-dying").addClass("tooltipster-"+i.options.animation+"-show");if(i.options.speed>0)i.$tooltip.delay(i.options.speed);i.$tooltip.queue(s)}else{i.$tooltip.stop().fadeIn(s)}}else if(i.status==="shown"){s()}}else{i.status="appearing";var o=i.options.speed;var u="tooltipster-"+i.options.animation,f="-webkit-transition-duration: "+i.options.speed+"ms; -webkit-animation-duration: "+i.options.speed+"ms; -moz-transition-duration: "+i.options.speed+"ms; -moz-animation-duration: "+i.options.speed+"ms; -o-transition-duration: "+i.options.speed+"ms; -o-animation-duration: "+i.options.speed+"ms; -ms-transition-duration: "+i.options.speed+"ms; -ms-animation-duration: "+i.options.speed+"ms; transition-duration: "+i.options.speed+"ms; animation-duration: "+i.options.speed+"ms;",l=i.options.fixedWidth>0?"width:"+Math.round(i.options.fixedWidth)+"px;":"",h=i.options.maxWidth>0?"max-width:"+Math.round(i.options.maxWidth)+"px;":"",p=i.options.interactive?"pointer-events: auto;":"";i.$tooltip=e('
');if(c())i.$tooltip.addClass(u);i.insertContent();i.$tooltip.appendTo("body");i.positionTooltip();i.options.functionReady.call(i.$el,i.$el,i.$tooltip);if(c()){i.$tooltip.addClass(u+"-show");if(i.options.speed>0)i.$tooltip.delay(i.options.speed);i.$tooltip.queue(s)}else{i.$tooltip.css("display","none").fadeIn(i.options.speed,s)}i.setCheckInterval();e(t).on("scroll."+i.namespace+" resize."+i.namespace,function(){i.positionTooltip()});if(i.options.autoClose){e("body").off("."+i.namespace);if(i.options.trigger=="hover"){if(a){setTimeout(function(){e("body").on("touchstart."+i.namespace,function(){i.hideTooltip()})},0)}if(i.options.interactive){if(a){i.$tooltip.on("touchstart."+i.namespace,function(e){e.stopPropagation()})}var d=null;i.$elProxy.add(i.$tooltip).on("mouseleave."+i.namespace+"-autoClose",function(){clearTimeout(d);d=setTimeout(function(){i.hideTooltip()},i.options.interactiveTolerance)}).on("mouseenter."+i.namespace+"-autoClose",function(){clearTimeout(d)})}else{i.$elProxy.on("mouseleave."+i.namespace+"-autoClose",function(){i.hideTooltip()})}}else if(i.options.trigger=="click"){setTimeout(function(){e("body").on("click."+i.namespace+" touchstart."+i.namespace,function(){i.hideTooltip()})},0);if(i.options.interactive){i.$tooltip.on("click."+i.namespace+" touchstart."+i.namespace,function(e){e.stopPropagation()})}}}}if(i.options.timer>0){i.timerHide=setTimeout(function(){i.timerHide=null;i.hideTooltip()},i.options.timer+o)}}})},setCheckInterval:function(){var t=this;t.checkInterval=setInterval(function(){if(e("body").find(t.$el).length===0||e("body").find(t.$elProxy).length===0||t.status=="hidden"||e("body").find(t.$tooltip).length===0){if(t.status=="shown"||t.status=="appearing")t.hideTooltip();t.cancelCheckInterval()}else{if(t.options.positionTracker){var n=t.positionInfo(t.$elProxy),r=false;if(u(n.dimension,t.elProxyPosition.dimension)){if(t.$elProxy.css("position")==="fixed"){if(u(n.position,t.elProxyPosition.position))r=true}else{if(u(n.offset,t.elProxyPosition.offset))r=true}}if(!r){t.positionTooltip()}}}},200)},cancelCheckInterval:function(){clearInterval(this.checkInterval);this.checkInterval=null},hideTooltip:function(n){var r=this;if(n)r.callbacks.hide.push(n);r.callbacks.show=[];clearTimeout(r.timerShow);r.timerShow=null;clearTimeout(r.timerHide);r.timerHide=null;var i=function(){e.each(r.callbacks.hide,function(e,t){t.call(r.$el)});r.callbacks.hide=[]};if(r.status=="shown"||r.status=="appearing"){r.status="disappearing";var s=function(){r.status="hidden";if(typeof r.content=="object"&&r.content!==null){r.content.detach()}r.$tooltip.remove();r.$tooltip=null;e(t).off("."+r.namespace);e("body").off("."+r.namespace);r.$elProxy.off("."+r.namespace+"-autoClose");r.options.functionAfter.call(r.$el,r.$el);i()};if(c()){r.$tooltip.clearQueue().removeClass("tooltipster-"+r.options.animation+"-show").addClass("tooltipster-dying");if(r.options.speed>0)r.$tooltip.delay(r.options.speed);r.$tooltip.queue(s)}else{r.$tooltip.stop().fadeOut(r.options.speed,s)}}else if(r.status=="hidden"){i()}},setContent:function(e){if(typeof e==="object"&&e!==null&&this.options.contentCloning){e=e.clone(true)}this.content=e},insertContent:function(){var e=this,t=this.$tooltip.find(".tooltipster-content");if(typeof e.content==="string"&&!e.options.contentAsHTML){t.text(e.content)}else{t.empty().append(e.content)}},updateTooltip:function(e){var t=this;t.setContent(e);if(t.content!==null){if(t.status!=="hidden"){t.insertContent();t.positionTooltip();if(t.options.updateAnimation){if(c()){t.$tooltip.css({width:"","-webkit-transition":"all "+t.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms","-moz-transition":"all "+t.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms","-o-transition":"all "+t.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms","-ms-transition":"all "+t.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms",transition:"all "+t.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms"}).addClass("tooltipster-content-changing");setTimeout(function(){if(t.status!="hidden"){t.$tooltip.removeClass("tooltipster-content-changing");setTimeout(function(){if(t.status!=="hidden"){t.$tooltip.css({"-webkit-transition":t.options.speed+"ms","-moz-transition":t.options.speed+"ms","-o-transition":t.options.speed+"ms","-ms-transition":t.options.speed+"ms",transition:t.options.speed+"ms"})}},t.options.speed)}},t.options.speed)}else{t.$tooltip.fadeTo(t.options.speed,.5,function(){if(t.status!="hidden"){t.$tooltip.fadeTo(t.options.speed,1)}})}}}}else{t.hideTooltip()}},positionInfo:function(e){return{dimension:{height:e.outerHeight(false),width:e.outerWidth(false)},offset:e.offset(),position:{left:parseInt(e.css("left")),top:parseInt(e.css("top"))}}},positionTooltip:function(){var n=this;if(e("body").find(n.$tooltip).length!==0){n.$tooltip.css("width","");n.elProxyPosition=n.positionInfo(n.$elProxy);var r=null,s=e(t).width(),o=n.elProxyPosition,u=n.$tooltip.outerWidth(false),a=n.$tooltip.innerWidth()+1,f=n.$tooltip.outerHeight(false);if(n.$elProxy.is("area")){var l=n.$elProxy.attr("shape"),c=n.$elProxy.parent().attr("name"),h=e('img[usemap="#'+c+'"]'),p=h.offset().left,d=h.offset().top,v=n.$elProxy.attr("coords")!==undefined?n.$elProxy.attr("coords").split(","):undefined;if(l=="circle"){var m=parseInt(v[0]),g=parseInt(v[1]),y=parseInt(v[2]);o.dimension.height=y*2;o.dimension.width=y*2;o.offset.top=d+g-y;o.offset.left=p+m-y}else if(l=="rect"){var m=parseInt(v[0]),g=parseInt(v[1]),b=parseInt(v[2]),w=parseInt(v[3]);o.dimension.height=w-g;o.dimension.width=b-m;o.offset.top=d+g;o.offset.left=p+m}else if(l=="poly"){var E=[],S=[],x=0,T=0,N=0,C=0,k="even";for(i=0;i
N){N=L;if(i===0){x=N}}if(LC){C=L;if(i==1){T=C}}if(Ls){r=A-(s+n-u);A=s+n-u}}function B(n,r){if(o.offset.top-e(t).scrollTop()-f-_-12<0&&r.indexOf("top")>-1){P=n}if(o.offset.top+o.dimension.height+f+12+_>e(t).scrollTop()+e(t).height()&&r.indexOf("bottom")>-1){P=n;M=o.offset.top-f-_-12}}if(P=="top"){var j=o.offset.left+u-(o.offset.left+o.dimension.width);A=o.offset.left+D-j/2;M=o.offset.top-f-_-12;H();B("bottom","top")}if(P=="top-left"){A=o.offset.left+D;M=o.offset.top-f-_-12;H();B("bottom-left","top-left")}if(P=="top-right"){A=o.offset.left+o.dimension.width+D-u;M=o.offset.top-f-_-12;H();B("bottom-right","top-right")}if(P=="bottom"){var j=o.offset.left+u-(o.offset.left+o.dimension.width);A=o.offset.left-j/2+D;M=o.offset.top+o.dimension.height+_+12;H();B("top","bottom")}if(P=="bottom-left"){A=o.offset.left+D;M=o.offset.top+o.dimension.height+_+12;H();B("top-left","bottom-left")}if(P=="bottom-right"){A=o.offset.left+o.dimension.width+D-u;M=o.offset.top+o.dimension.height+_+12;H();B("top-right","bottom-right")}if(P=="left"){A=o.offset.left-D-u-12;O=o.offset.left+D+o.dimension.width+12;var F=o.offset.top+f-(o.offset.top+n.$elProxy.outerHeight(false));M=o.offset.top-F/2-_;if(A<0&&O+u>s){var I=parseFloat(n.$tooltip.css("border-width"))*2,q=u+A-I;n.$tooltip.css("width",q+"px");f=n.$tooltip.outerHeight(false);A=o.offset.left-D-q-12-I;F=o.offset.top+f-(o.offset.top+n.$elProxy.outerHeight(false));M=o.offset.top-F/2-_}else if(A<0){A=o.offset.left+D+o.dimension.width+12;r="left"}}if(P=="right"){A=o.offset.left+D+o.dimension.width+12;O=o.offset.left-D-u-12;var F=o.offset.top+f-(o.offset.top+n.$elProxy.outerHeight(false));M=o.offset.top-F/2-_;if(A+u>s&&O<0){var I=parseFloat(n.$tooltip.css("border-width"))*2,q=s-A-I;n.$tooltip.css("width",q+"px");f=n.$tooltip.outerHeight(false);F=o.offset.top+f-(o.offset.top+n.$elProxy.outerHeight(false));M=o.offset.top-F/2-_}else if(A+u>s){A=o.offset.left-D-u-12;r="right"}}if(n.options.arrow){var R="tooltipster-arrow-"+P;if(n.options.arrowColor.length<1){var U=n.$tooltip.css("background-color")}else{var U=n.options.arrowColor}if(!r){r=""}else if(r=="left"){R="tooltipster-arrow-right";r=""}else if(r=="right"){R="tooltipster-arrow-left";r=""}else{r="left:"+Math.round(r)+"px;"}if(P=="top"||P=="top-left"||P=="top-right"){var z=parseFloat(n.$tooltip.css("border-bottom-width")),W=n.$tooltip.css("border-bottom-color")}else if(P=="bottom"||P=="bottom-left"||P=="bottom-right"){var z=parseFloat(n.$tooltip.css("border-top-width")),W=n.$tooltip.css("border-top-color")}else if(P=="left"){var z=parseFloat(n.$tooltip.css("border-right-width")),W=n.$tooltip.css("border-right-color")}else if(P=="right"){var z=parseFloat(n.$tooltip.css("border-left-width")),W=n.$tooltip.css("border-left-color")}else{var z=parseFloat(n.$tooltip.css("border-bottom-width")),W=n.$tooltip.css("border-bottom-color")}if(z>1){z++}var X="";if(z!==0){var V="",J="border-color: "+W+";";if(R.indexOf("bottom")!==-1){V="margin-top: -"+Math.round(z)+"px;"}else if(R.indexOf("top")!==-1){V="margin-bottom: -"+Math.round(z)+"px;"}else if(R.indexOf("left")!==-1){V="margin-right: -"+Math.round(z)+"px;"}else if(R.indexOf("right")!==-1){V="margin-left: -"+Math.round(z)+"px;"}X=''}n.$tooltip.find(".tooltipster-arrow").remove();var K=''+X+'
';n.$tooltip.append(K)}n.$tooltip.css({top:Math.round(M)+"px",left:Math.round(A)+"px"})}}};e.fn[r]=function(){var t=arguments;if(this.length===0){if(typeof t[0]==="string"){var n=true;switch(t[0]){case"setDefaults":e.extend(s,t[1]);break;default:n=false;break}if(n)return true;else return this}else{return this}}else{if(typeof t[0]==="string"){var r="#*$~&";this.each(function(){var n=e(this).data("tooltipster");if(n){switch(t[0]){case"content":case"update":if(typeof t[1]==="undefined"){r=n.content;return false}else{n.updateTooltip(t[1]);break};case"destroy":n.hideTooltip();if(n.$el[0]!==n.$elProxy[0])n.$elProxy.remove();var i=typeof n.content==="string"?n.content:e("").append(n.content).html();n.$el.removeClass("tooltipstered").attr("title",i).removeData("tooltipster").off("."+n.namespace);break;case"disable":n.hideTooltip();n.enabled=false;break;case"elementIcon":r=n.$el[0]!==n.$elProxy[0]?n.$elProxy[0]:undefined;return false;case"elementTooltip":r=n.$tooltip?n.$tooltip[0]:undefined;return false;case"enable":n.enabled=true;break;case"hide":n.hideTooltip(t[1]);break;case"option":r=n.options[t[1]];return false;case"reposition":n.positionTooltip();break;case"show":n.showTooltipNow(t[1]);break;case"status":r=n.status;return false;default:throw new Error('Unknown method .tooltipster("'+t[0]+'")');break}}else{throw new Error("You called Tooltipster's \""+t[0]+'" method on an uninitialized element')}});return r!=="#*$~&"?r:this}else{return this.each(function(){if(!e(this).data("tooltipster")){e(this).data("tooltipster",new o(this,t[0]))}})}}};var a=!!("ontouchstart"in t);var f=false;e("body").one("mousemove",function(){f=true})})(jQuery,window,document);
/**********************************************************************************/
(function(a){a.fn.swipe=function(c){if(!this){return false}var k={fingers:1,threshold:75,timeThreshold:500,swipe:null,swipeLeft:null,swipeRight:null,swipeUp:null,swipeDown:null,swipeStatus:null,click:null,triggerOnTouchEnd:true,allowPageScroll:"auto"};var m="left";var l="right";var d="up";var s="down";var j="none";var v="horizontal";var q="vertical";var o="auto";var f="start";var i="move";var h="end";var n="cancel";var t="ontouchstart" in window,b=t?"touchstart":"mousedown",p=t?"touchmove":"mousemove",g=t?"touchend":"mouseup",r="touchcancel";var e="start";var u;if(c.allowPageScroll==undefined&&(c.swipe!=undefined||c.swipeStatus!=undefined)){c.allowPageScroll=j}if(c){a.extend(k,c)}return this.each(function(){var E=this;var I=a(this);var F=null;var J=0;var y={x:0,y:0};var B={x:0,y:0};var L={x:0,y:0};function A(P){var O=t?P.touches[0]:P;e=f;if(t){J=P.touches.length}distance=0;direction=null;if(J==k.fingers||!t){y.x=B.x=O.pageX;y.y=B.y=O.pageY;if(k.swipeStatus){z(P,e)}var N=new Date();u=N.getTime()}else{D(P)}E.addEventListener(p,K,false);E.addEventListener(g,M,false)}function K(Q){if(e==h||e==n){return}var P=t?Q.touches[0]:Q;B.x=P.pageX;B.y=P.pageY;direction=w();if(t){J=Q.touches.length}e=i;H(Q,direction);if(J==k.fingers||!t){distance=C();if(k.swipeStatus){z(Q,e,direction,distance)}if(!k.triggerOnTouchEnd){var O=new Date();var R=O.getTime();var N=R-u;if(distance>=k.threshold&&N<=k.timeThreshold){e=h;z(Q,e);D(Q)}}}else{e=n;z(Q,e);D(Q)}}function M(P){P.preventDefault();distance=C();direction=w();if(k.triggerOnTouchEnd){e=h;if((J==k.fingers||!t)&&B.x!=0){var O=new Date();var Q=O.getTime();var N=Q-u;if(distance>=k.threshold&&N<=k.timeThreshold){z(P,e);D(P)}else{e=n;z(P,e);D(P)}}else{e=n;z(P,e);D(P)}}else{if(e==i){e=n;z(P,e);D(P)}}E.removeEventListener(p,K,false);E.removeEventListener(g,M,false)}function D(N){J=0;y.x=0;y.y=0;B.x=0;B.y=0;L.x=0;L.y=0}function z(O,N){if(k.swipeStatus){k.swipeStatus.call(I,O,N,direction||null,distance||0)}if(N==n){if(k.click&&(J==1||!t)&&(isNaN(distance)||distance==0)){k.click.call(I,O,O.target)}}if(N==h){if(k.swipe){k.swipe.call(I,O,direction,distance)}switch(direction){case m:if(k.swipeLeft){k.swipeLeft.call(I,O,direction,distance)}break;case l:if(k.swipeRight){k.swipeRight.call(I,O,direction,distance)}break;case d:if(k.swipeUp){k.swipeUp.call(I,O,direction,distance)}break;case s:if(k.swipeDown){k.swipeDown.call(I,O,direction,distance)}break}}}function H(N,O){if(k.allowPageScroll==j){N.preventDefault()}else{var P=k.allowPageScroll==o;switch(O){case m:if((k.swipeLeft&&P)||(!P&&k.allowPageScroll!=v)){N.preventDefault()}break;case l:if((k.swipeRight&&P)||(!P&&k.allowPageScroll!=v)){N.preventDefault()}break;case d:if((k.swipeUp&&P)||(!P&&k.allowPageScroll!=q)){N.preventDefault()}break;case s:if((k.swipeDown&&P)||(!P&&k.allowPageScroll!=q)){N.preventDefault()}break}}}function C(){return Math.round(Math.sqrt(Math.pow(B.x-y.x,2)+Math.pow(B.y-y.y,2)))}function x(){var Q=y.x-B.x;var P=B.y-y.y;var N=Math.atan2(P,Q);var O=Math.round(N*180/Math.PI);if(O<0){O=360-Math.abs(O)}return O}function w(){var N=x();if((N<=45)&&(N>=0)){return m}else{if((N<=360)&&(N>=315)){return m}else{if((N>=135)&&(N<=225)){return l}else{if((N>45)&&(N<135)){return s}else{return d}}}}}try{this.addEventListener(b,A,false);this.addEventListener(r,D)}catch(G){}})}})(jQuery);
/**********************************************************************************/
/*
* SearchBox
* MIT licensed
*
*/
(function ($) {
$.searchBox = function (el, options) {
this.el = $(el);
this.init(options);
}
$.searchBox.DEFAULTS = {
timerDelay: 50,
event: 'click',
selector: '.search-icon',
parent: '.search-box'
}
$.searchBox.prototype = {
init: function (options) {
var self = this;
this.o = $.extend({}, $.searchBox.DEFAULTS, options);
this.body = $('body');
this.tooltip = $('.inner-tooltip', this.el);
this.active = false;
this.timer = false;
this.bind();
},
bind: function () {
this.body.on(this.o.event + ' mouseleave', this.o.selector, $.proxy(this.start_countdown, this));
},
start_countdown: function (e) {
var $target = $(e.target),
type = e.type;
clearTimeout(this.timer);
if (type == this.o.event) {
if ($target.is('.search-icon')) {
e.preventDefault();
if (this.tooltip.is(':hidden')) {
this.timer = setTimeout($.proxy( this.display_tooltip, this, e), this.o.timerDelay);
} else {
this.timer = setTimeout($.proxy( this.hide_tooltip, this, e), this.o.timerDelay);
}
}
e.preventDefault();
} else if (type == 'mouseleave') {
this.timer = this.body.on('mousedown', $.proxy( this.hide_tooltip, this) );
}
},
display_tooltip: function (e) {
if (this.tooltip.is(':animated:visible')) return this;
if (!this.active && this.tooltip.is(':hidden')) {
this.tooltip.css({ opacity: 0, display: 'block' }).stop().addClass('active').animate({
opacity: 1
}, 300);
this.active = true;
}
},
hide_tooltip: function (e) {
var el = $(e.target).not(this.o.selector);
if (this.active && this.tooltip.is(':visible') && el.parents(this.o.parent).length == 0) {
this.tooltip.stop(true, false).fadeOut(500, function () {
$(this).removeClass('active');
});
this.active = false;
}
}
}
$.fn.extend({
searchBox: function (option) {
if (!this.length) return this;
return this.each(function () {
var $this = $(this), data = $this.data('searchBox'),
options = typeof option == 'object' && option;
if (!data) {
$this.data('searchBox', new $.searchBox(this, options));
}
});
}
});
})(jQuery);
/**********************************************************************************/