");
return c.inlineElement = f, f
}
return b.updateStatus("ready"), b._parseMarkup(d, {}, c), d
}
}
});
var H, I = "ajax",
J = function() {
H && a(document.body).removeClass(H)
},
K = function() {
J(), b.req && b.req.abort()
};
a.magnificPopup.registerModule(I, {
options: {
settings: null,
cursor: "mfp-ajax-cur",
tError: '
The content could not be loaded.'
},
proto: {
initAjax: function() {
b.types.push(I), H = b.st.ajax.cursor, w(h + "." + I, K), w("BeforeChange." + I, K)
},
getAjax: function(c) {
H && a(document.body).addClass(H), b.updateStatus("loading");
var d = a.extend({
url: c.src,
success: function(d, e, f) {
var g = {
data: d,
xhr: f
};
y("ParseAjax", g), b.appendContent(a(g.data), I), c.finished = !0, J(), b._setFocus(), setTimeout(function() {
b.wrap.addClass(q)
}, 16), b.updateStatus("ready"), y("AjaxContentAdded")
},
error: function() {
J(), c.finished = c.loadError = !0, b.updateStatus("error", b.st.ajax.tError.replace("%url%", c.src))
}
}, b.st.ajax.settings);
return b.req = a.ajax(d), ""
}
}
});
var L, M = function(c) {
if (c.data && void 0 !== c.data.title) return c.data.title;
var d = b.st.image.titleSrc;
if (d) {
if (a.isFunction(d)) return d.call(b, c);
if (c.el) return c.el.attr(d) || ""
}
return ""
};
a.magnificPopup.registerModule("image", {
options: {
markup: '
',
cursor: "mfp-zoom-out-cur",
titleSrc: "title",
verticalFit: !0,
tError: '
The image could not be loaded.'
},
proto: {
initImage: function() {
var c = b.st.image,
d = ".image";
b.types.push("image"), w(m + d, function() {
"image" === b.currItem.type && c.cursor && a(document.body).addClass(c.cursor)
}), w(h + d, function() {
c.cursor && a(document.body).removeClass(c.cursor), v.off("resize" + p)
}), w("Resize" + d, b.resizeImage), b.isLowIE && w("AfterChange", b.resizeImage)
},
resizeImage: function() {
var a = b.currItem;
if (a && a.img && b.st.image.verticalFit) {
var c = 0;
b.isLowIE && (c = parseInt(a.img.css("padding-top"), 10) + parseInt(a.img.css("padding-bottom"), 10)), a.img.css("max-height", b.wH - c)
}
},
_onImageHasSize: function(a) {
a.img && (a.hasSize = !0, L && clearInterval(L), a.isCheckingImgSize = !1, y("ImageHasSize", a), a.imgHidden && (b.content && b.content.removeClass("mfp-loading"), a.imgHidden = !1))
},
findImageSize: function(a) {
var c = 0,
d = a.img[0],
e = function(f) {
L && clearInterval(L), L = setInterval(function() {
return d.naturalWidth > 0 ? void b._onImageHasSize(a) : (c > 200 && clearInterval(L), c++, void(3 === c ? e(10) : 40 === c ? e(50) : 100 === c && e(500)))
}, f)
};
e(1)
},
getImage: function(c, d) {
var e = 0,
f = function() {
c && (c.img[0].complete ? (c.img.off(".mfploader"), c === b.currItem && (b._onImageHasSize(c), b.updateStatus("ready")), c.hasSize = !0, c.loaded = !0, y("ImageLoadComplete")) : (e++, 200 > e ? setTimeout(f, 100) : g()))
},
g = function() {
c && (c.img.off(".mfploader"), c === b.currItem && (b._onImageHasSize(c), b.updateStatus("error", h.tError.replace("%url%", c.src))), c.hasSize = !0, c.loaded = !0, c.loadError = !0)
},
h = b.st.image,
i = d.find(".mfp-img");
if (i.length) {
var j = document.createElement("img");
j.className = "mfp-img", c.el && c.el.find("img").length && (j.alt = c.el.find("img").attr("alt")), c.img = a(j).on("load.mfploader", f).on("error.mfploader", g), j.src = c.src, i.is("img") && (c.img = c.img.clone()), j = c.img[0], j.naturalWidth > 0 ? c.hasSize = !0 : j.width || (c.hasSize = !1)
}
return b._parseMarkup(d, {
title: M(c),
img_replaceWith: c.img
}, c), b.resizeImage(), c.hasSize ? (L && clearInterval(L), c.loadError ? (d.addClass("mfp-loading"), b.updateStatus("error", h.tError.replace("%url%", c.src))) : (d.removeClass("mfp-loading"), b.updateStatus("ready")), d) : (b.updateStatus("loading"), c.loading = !0, c.hasSize || (c.imgHidden = !0, d.addClass("mfp-loading"), b.findImageSize(c)), d)
}
}
});
var N, O = function() {
return void 0 === N && (N = void 0 !== document.createElement("p").style.MozTransform), N
};
a.magnificPopup.registerModule("zoom", {
options: {
enabled: !1,
easing: "ease-in-out",
duration: 300,
opener: function(a) {
return a.is("img") ? a : a.find("img")
}
},
proto: {
initZoom: function() {
var a, c = b.st.zoom,
d = ".zoom";
if (c.enabled && b.supportsTransition) {
var e, f, g = c.duration,
j = function(a) {
var b = a.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),
d = "all " + c.duration / 1e3 + "s " + c.easing,
e = {
position: "fixed",
zIndex: 9999,
left: 0,
top: 0,
"-webkit-backface-visibility": "hidden"
},
f = "transition";
return e["-webkit-" + f] = e["-moz-" + f] = e["-o-" + f] = e[f] = d, b.css(e), b
},
k = function() {
b.content.css("visibility", "visible")
};
w("BuildControls" + d, function() {
if (b._allowZoom()) {
if (clearTimeout(e), b.content.css("visibility", "hidden"), a = b._getItemToZoom(), !a) return void k();
f = j(a), f.css(b._getOffset()), b.wrap.append(f), e = setTimeout(function() {
f.css(b._getOffset(!0)), e = setTimeout(function() {
k(), setTimeout(function() {
f.remove(), a = f = null, y("ZoomAnimationEnded")
}, 16)
}, g)
}, 16)
}
}), w(i + d, function() {
if (b._allowZoom()) {
if (clearTimeout(e), b.st.removalDelay = g, !a) {
if (a = b._getItemToZoom(), !a) return;
f = j(a)
}
f.css(b._getOffset(!0)), b.wrap.append(f), b.content.css("visibility", "hidden"), setTimeout(function() {
f.css(b._getOffset())
}, 16)
}
}), w(h + d, function() {
b._allowZoom() && (k(), f && f.remove(), a = null)
})
}
},
_allowZoom: function() {
return "image" === b.currItem.type
},
_getItemToZoom: function() {
return b.currItem.hasSize ? b.currItem.img : !1
},
_getOffset: function(c) {
var d;
d = c ? b.currItem.img : b.st.zoom.opener(b.currItem.el || b.currItem);
var e = d.offset(),
f = parseInt(d.css("padding-top"), 10),
g = parseInt(d.css("padding-bottom"), 10);
e.top -= a(window).scrollTop() - f;
var h = {
width: d.width(),
height: (u ? d.innerHeight() : d[0].offsetHeight) - g - f
};
return O() ? h["-moz-transform"] = h.transform = "translate(" + e.left + "px," + e.top + "px)" : (h.left = e.left, h.top = e.top), h
}
}
});
var P = "iframe",
Q = "//about:blank",
R = function(a) {
if (b.currTemplate[P]) {
var c = b.currTemplate[P].find("iframe");
c.length && (a || (c[0].src = Q), b.isIE8 && c.css("display", a ? "block" : "none"))
}
};
a.magnificPopup.registerModule(P, {
options: {
markup: '
',
srcAction: "iframe_src",
patterns: {
youtube: {
index: "youtube.com",
id: "v=",
src: "//www.youtube.com/embed/%id%?autoplay=1"
},
vimeo: {
index: "vimeo.com/",
id: "/",
src: "//player.vimeo.com/video/%id%?autoplay=1"
},
gmaps: {
index: "//maps.google.",
src: "%id%&output=embed"
}
}
},
proto: {
initIframe: function() {
b.types.push(P), w("BeforeChange", function(a, b, c) {
b !== c && (b === P ? R() : c === P && R(!0))
}), w(h + "." + P, function() {
R()
})
},
getIframe: function(c, d) {
var e = c.src,
f = b.st.iframe;
a.each(f.patterns, function() {
return e.indexOf(this.index) > -1 ? (this.id && (e = "string" == typeof this.id ? e.substr(e.lastIndexOf(this.id) + this.id.length, e.length) : this.id.call(this, e)), e = this.src.replace("%id%", e), !1) : void 0
});
var g = {};
return f.srcAction && (g[f.srcAction] = e), b._parseMarkup(d, g, c), b.updateStatus("ready"), d
}
}
});
var S = function(a) {
var c = b.items.length;
return a > c - 1 ? a - c : 0 > a ? c + a : a
},
T = function(a, b, c) {
return a.replace(/%curr%/gi, b + 1).replace(/%total%/gi, c)
};
a.magnificPopup.registerModule("gallery", {
options: {
enabled: !1,
arrowMarkup: '
',
preload: [0, 2],
navigateByImgClick: !0,
arrows: !0,
tPrev: "Previous (Left arrow key)",
tNext: "Next (Right arrow key)",
tCounter: "%curr% of %total%"
},
proto: {
initGallery: function() {
var c = b.st.gallery,
e = ".mfp-gallery";
return b.direction = !0, c && c.enabled ? (f += " mfp-gallery", w(m + e, function() {
c.navigateByImgClick && b.wrap.on("click" + e, ".mfp-img", function() {
return b.items.length > 1 ? (b.next(), !1) : void 0
}), d.on("keydown" + e, function(a) {
37 === a.keyCode ? b.prev() : 39 === a.keyCode && b.next()
})
}), w("UpdateStatus" + e, function(a, c) {
c.text && (c.text = T(c.text, b.currItem.index, b.items.length))
}), w(l + e, function(a, d, e, f) {
var g = b.items.length;
e.counter = g > 1 ? T(c.tCounter, f.index, g) : ""
}), w("BuildControls" + e, function() {
if (b.items.length > 1 && c.arrows && !b.arrowLeft) {
var d = c.arrowMarkup,
e = b.arrowLeft = a(d.replace(/%title%/gi, c.tPrev).replace(/%dir%/gi, "left")).addClass(s),
f = b.arrowRight = a(d.replace(/%title%/gi, c.tNext).replace(/%dir%/gi, "right")).addClass(s);
e.click(function() {
b.prev()
}), f.click(function() {
b.next()
}), b.container.append(e.add(f))
}
}), w(n + e, function() {
b._preloadTimeout && clearTimeout(b._preloadTimeout), b._preloadTimeout = setTimeout(function() {
b.preloadNearbyImages(), b._preloadTimeout = null
}, 16)
}), void w(h + e, function() {
d.off(e), b.wrap.off("click" + e), b.arrowRight = b.arrowLeft = null
})) : !1
},
next: function() {
b.direction = !0, b.index = S(b.index + 1), b.updateItemHTML()
},
prev: function() {
b.direction = !1, b.index = S(b.index - 1), b.updateItemHTML()
},
goTo: function(a) {
b.direction = a >= b.index, b.index = a, b.updateItemHTML()
},
preloadNearbyImages: function() {
var a, c = b.st.gallery.preload,
d = Math.min(c[0], b.items.length),
e = Math.min(c[1], b.items.length);
for (a = 1; a <= (b.direction ? e : d); a++) b._preloadItem(b.index + a);
for (a = 1; a <= (b.direction ? d : e); a++) b._preloadItem(b.index - a)
},
_preloadItem: function(c) {
if (c = S(c), !b.items[c].preloaded) {
var d = b.items[c];
d.parsed || (d = b.parseEl(c)), y("LazyLoad", d), "image" === d.type && (d.img = a('
![]()
').on("load.mfploader", function() {
d.hasSize = !0
}).on("error.mfploader", function() {
d.hasSize = !0, d.loadError = !0, y("LazyLoadError", d)
}).attr("src", d.src)), d.preloaded = !0
}
}
}
});
var U = "retina";
a.magnificPopup.registerModule(U, {
options: {
replaceSrc: function(a) {
return a.src.replace(/\.\w+$/, function(a) {
return "@2x" + a
})
},
ratio: 1
},
proto: {
initRetina: function() {
if (window.devicePixelRatio > 1) {
var a = b.st.retina,
c = a.ratio;
c = isNaN(c) ? c() : c, c > 1 && (w("ImageHasSize." + U, function(a, b) {
b.img.css({
"max-width": b.img[0].naturalWidth / c,
width: "100%"
})
}), w("ElementParse." + U, function(b, d) {
d.src = a.replaceSrc(d, c)
}))
}
}
}
}), A()
});;
/*
* Tooltips with smooth 3D animation.
* (c) Eugene Tiurin; MIT license
*
* Contributors: nomiad, Friedel Ziegelmayer, Arend van Beelen jr.,
* Peter Richmond, Bruno Wego, Kahmali Rose
*
* 2017-04-10
*/
(function (root, factory) {
// UNIVERSAL MODULE DEFINITION
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define([], factory);
} else if (typeof module === 'object' && module.exports) {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory();
} else {
// Define global constructor
root.html5tooltips = factory();
}
}(this, function () {
'use strict';
var
tooltipHTML='\
\
',
html5tooltipsPredefined = {
animateFunction: {
fadeIn: "fadein",
foldIn: "foldin",
foldOut: "foldout",
roll: "roll",
scaleIn: "scalein",
slideIn: "slidein",
spin: "spin"
},
color: {
"daffodil": {r: 255, g: 230, b: 23},
"daisy": {r: 250, g: 211, b: 28},
"mustard": {r: 253, g: 183, b: 23},
"citrus zest": {r: 250, g: 170, b: 33},
"pumpkin": {r: 241, g: 117, b: 63},
"tangerine": {r: 237, g: 87, b: 36},
"salmon": {r: 240, g: 70, b: 57},
"persimmon": {r: 234, g: 40, b: 48},
"rouge": {r: 188, g: 35, b: 38},
"scarlet": {r: 140, g: 12, b: 3},
"hot pink": {r: 229, g: 24, b: 93},
"princess": {r: 243, g: 132, b: 174},
"petal": {r: 250, g: 198, b: 210},
"lilac": {r: 178, g: 150, b: 199},
"lavender": {r: 123, g: 103, b: 174},
"violet": {r: 95, g: 53, b: 119},
"cloud": {r: 195, g: 222, b: 241},
"dream": {r: 85, g: 190, b: 237},
"gulf": {r: 49, g: 168, b: 224},
"turquoise": {r: 35, g: 138, b: 204},
"sky": {r: 13, g: 96, b: 174},
"indigo": {r: 20, g: 59, b: 134},
"navy": {r: 0, g: 27, b: 74},
"sea foam": {r: 125, g: 205, b: 194},
"teal": {r: 0, g: 168, b: 168},
"peacock": {r: 18, g: 149, b: 159},
"ceadon": {r: 193, g: 209, b: 138},
"olive": {r: 121, g: 145, b: 85},
"bamboo": {r: 128, g: 188, b: 66},
"grass": {r: 74, g: 160, b: 63},
"kelly": {r: 22, g: 136, b: 74},
"forrest": {r: 0, g: 63, b: 46},
"chocolate": {r: 56, g: 30, b: 17},
"terra cotta": {r: 192, g: 92, b: 32},
"camel": {r: 191, g: 155, b: 107},
"linen": {r: 233, g: 212, b: 167},
"stone": {r: 231, g: 230, b: 225},
"smoke": {r: 207, g: 208, b: 210},
"steel": {r: 138, g: 139, b: 143},
"slate": {r: 119, g: 133, b: 144},
"charcoal": {r: 71, g: 77, b: 77},
"black": {r: 5, g: 6, b: 8},
"white": {r: 255, g: 255, b: 255},
"metalic silver": {r: 152, g: 162, b: 171},
"metalic gold": {r: 159, g: 135, b: 89},
"metalic copper": {r: 140, g: 102, b: 65}
},
stickTo: {
bottom: "bottom",
left: "left",
right: "right",
top: "top"
}
},
defaultOptions = {
animateDuration: 300,
animateFunction: html5tooltipsPredefined.animateFunction.fadeIn,
delay: 500,
disableAnimation: false,
hideDelay: 300,
persistent: false,
stickTo: html5tooltipsPredefined.stickTo.bottom,
stickDistance: 10
};
// UI COMPONENT CONSTRUCTOR
function Component(publicInterface,HTML)
{
function toArray(obj,fromIndex)
{
return Array.prototype.slice.call(obj,fromIndex);
}
function argsToObj(args)
{
var argTypes=toArray(args).map(function(a){return typeof a});
var obj={};
if(argTypes[0]==='object')
obj=args[0];
else if(argTypes[0]==='string'){
var keys=args[0].split(' ');
for(var i in keys)
obj[keys[i]]=args[1];
}
else if(argTypes[0]==='function')
obj={'':args[0]};
return obj;
}
function gainAnchorElements(elements,anchors)
{
var attrName;
for(var i=0;i
DOM
if(HTML&&document){
var p=document.createElement('div');
p.innerHTML=HTML;
component.elements=toArray(p.children);
gainAnchorElements(component.elements,component.anchors);
}
}
// TOOLTIP UI COMPONENT
function HTML5TooltipUIComponent()
{
function animateElementClass(el, updateHandler)
{
if (!ttModel.disableAnimation) {
// getBoundingClientRect refreshes element render box
el.getBoundingClientRect();
el.classList.add("animating");
updateHandler&&updateHandler();
setTimeout(function() { el.classList.remove("animating"); }, ttModel.animateDuration);
}
else
updateHandler();
}
function applyAnimationClass(el, fromClass, toClass, updateHandler)
{
if (!ttModel.disableAnimation) {
el.classList.add(fromClass);
// getBoundingClientRect refreshes element render box
el.getBoundingClientRect();
el.classList.add("animating");
el.classList.remove(fromClass);
el.classList.add(toClass);
setTimeout(function() {
el.classList.remove("animating");
el.classList.remove(toClass);
if (updateHandler)
updateHandler();
}, ttModel.animateDuration);
}
else
if (updateHandler)
updateHandler();
}
function resetTooltipPosition()
{
if (ttElement.style.visibility !== 'collapse')
ttElement.style.visibility = 'collapse';
ttElement.style.left = '-9999px';
ttElement.style.top = '-9999px';
if (elMore.style.display !== 'none') {
elMore.style.display = 'none';
elMore.style.visibility = 'collapse';
elMore.style.height = 'auto';
}
}
function hide(cb)
{
isHiding = true;
applyAnimationClass(elBox, ttModel.animateFunction + "-to",
ttModel.animateFunction + "-from",
function(){
if(!isHiding)
return;
resetTooltipPosition();
cb&&cb();
});
return this;
}
function moveTooltip()
{
var targetRect, ttRect;
if (!component.model.target||ttElement.style.visibility !== 'visible')
return;
// update width
ttElement.style.width = "auto";
ttRect = ttElement.getBoundingClientRect();
var maxWidth = parseInt(ttModel.maxWidth);
if (maxWidth)
ttElement.style.width = ttRect.width > maxWidth ? maxWidth + "px" : "auto";
// position depend on target and tt width
targetRect = component.model.target.getBoundingClientRect();
ttRect = ttElement.getBoundingClientRect();
switch (ttModel.stickTo) {
case html5tooltipsPredefined.stickTo.bottom:
ttElement.style.left = targetRect.left + parseInt((targetRect.width - ttRect.width) / 2) + "px";
ttElement.style.top = targetRect.top + targetRect.height + parseInt(ttModel.stickDistance) + "px";
break;
case html5tooltipsPredefined.stickTo.left:
ttElement.style.left = targetRect.left - ttRect.width - parseInt(ttModel.stickDistance) + "px";
ttElement.style.top = targetRect.top + (targetRect.height - ttRect.height) / 2 + "px";
break;
case html5tooltipsPredefined.stickTo.right:
ttElement.style.left = targetRect.left + targetRect.width + parseInt(ttModel.stickDistance) + "px";
ttElement.style.top = targetRect.top + (targetRect.height - ttRect.height) / 2 + "px";
break;
case html5tooltipsPredefined.stickTo.top:
ttElement.style.left = targetRect.left + (targetRect.width - ttRect.width) / 2 + "px";
ttElement.style.top = targetRect.top - ttRect.height - parseInt(ttModel.stickDistance) + "px";
break;
}
}
function show()
{
isHiding = false;
if (ttElement.style.visibility !== 'visible') {
ttElement.style.visibility = 'visible';
setTimeout(function(){
moveTooltip();
applyAnimationClass(elBox, ttModel.animateFunction + "-from",
ttModel.animateFunction + "-to");
});
}
return this;
}
function showMore()
{
if (ttElement.style.visibility !== 'visible') {
ttElement.style.visibility = 'visible';
applyAnimationClass(elBox, ttModel.animateFunction + "-from",
ttModel.animateFunction + "-to");
if (ttModel.contentMore) {
elMore.style.display = 'block';
elMore.style.visibility = 'visible';
}
moveTooltip();
}
else if (elMore.style.display !== 'block' && ttModel.contentMore) {
elMore.style.display = 'block';
animateElementClass(ttElement);
moveTooltip();
var h = elMore.getBoundingClientRect().height;
elMore.style.visibility = 'visible';
elMore.style.height = '0px';
// animate more content
animateElementClass(elMore, function() {
elMore.style.height = h > 0 ? h + 'px' : "auto";
});
}
return this;
}
var
component=new Component(this,tooltipHTML),
elBox=component.anchors.box[0],
elText=component.anchors.text[0],
elMore=component.anchors.more[0],
elMoreText=component.anchors.moreText[0],
ttElement=component.elements[0],
isHiding = false;
resetTooltipPosition();
if(typeof window!=='undefined'){
window.addEventListener("resize", moveTooltip, false);
window.addEventListener("scroll", moveTooltip, false);
}
component.set(defaultOptions);
var ttModel=component.model;
component.onModelUpdate({
color:function(color){
if (html5tooltipsPredefined.color[color]) {
color = html5tooltipsPredefined.color[color];
color = "rgb(" + color.r + ", " + color.g + ", " + color.b + ")";
}
elBox.style.backgroundColor = color;
},
contentText:function(text){
component.anchors.text[0].innerHTML = text;
},
contentMore:function(more){
component.anchors.moreText[0].innerHTML = more;
},
stickTo:function(stickTo){
component.elements[0].className = "html5tooltip-" + stickTo;
}
});
// PUBLIC INTERFACE
this.hide=hide;
this.show=show;
this.showMore=showMore;
this.moveTooltip=moveTooltip;
component.publ.unmount = function(){
resetTooltipPosition();
component.unmount();
}
}
var userTooltips=[],DOMTooltips=[];
function createTooltip(target,options,tooltips)
{
var tooltip;
for(var i=tooltips.length;i--;)
if(tooltips[i].model.target===target){
tooltip=tooltips[i];
break;
}
if(!tooltip){
tooltip=new HTML5TooltipUIComponent;
tooltips.push(tooltip);
}
tooltip.set(options);
tooltip.set('target',target);
var hovered,focused;
function tryUnmountTooltip()
{
if (target===hovered || tooltip.element===hovered)
return;
if (tooltip.model.persistent)
tooltip.hide(function(){
tooltip.unmount();
});
else
tooltip.unmount();
}
function disposeTooltip()
{
hovered = null;
if (target===focused)
return;
if (tooltip.model.persistent)
setTimeout(tryUnmountTooltip, tooltip.model.hideDelay);
else
tryUnmountTooltip();
}
target.addEventListener("mouseenter",function(){
if (this===hovered || this===focused)
return;
hovered = this;
setTimeout(function() {
if (this===hovered){
tooltip.mount();
tooltip.show();
}
}.bind(this), tooltip.model.delay);
});
target.addEventListener("mouseleave",disposeTooltip);
target.addEventListener("focus",function(){
if (["INPUT", "TEXTAREA"].indexOf(this.tagName) === -1 &&
this.getAttribute("contenteditable") === null)
return;
focused = this;
tooltip.mount();
tooltip.showMore();
});
target.addEventListener("blur",function(){
focused = null;
if(hovered !== tooltip.element){
tooltip.unmount();
}
});
tooltip.element.addEventListener("mouseenter",function(){
hovered = this;
});
tooltip.element.addEventListener("mouseleave",disposeTooltip);
}
function getElementsByAttribute(attr, context)
{
var nodeList = (context || document).getElementsByTagName('*'),
nodes = [];
for (var i = 0, node; node = nodeList[i]; i++) {
if ( node.getAttribute(attr) )
nodes.push(node);
}
return nodes;
}
function extractOptionAttribute(target, attrName, defaultValue)
{
var
value = target.getAttribute(attrName),
nextParent = target;
while(!value && (nextParent = nextParent.parentNode) && nextParent.getAttribute)
value = nextParent.getAttribute(attrName);
return value||defaultValue;
}
function createDOMTooltips()
{
getElementsByAttribute("data-tooltip").forEach(function(target) {
var options={
animateFunction: extractOptionAttribute(target, "data-tooltip-animate-function", defaultOptions.animateFunction),
color: extractOptionAttribute(target, "data-tooltip-color", ''),
contentMore: extractOptionAttribute(target, "data-tooltip-more", ''),
contentText: extractOptionAttribute(target, "data-tooltip", ''),
delay: extractOptionAttribute(target, "data-tooltip-delay", defaultOptions.delay),
hideDelay: extractOptionAttribute(target, "data-tooltip-hide-delay", defaultOptions.delay),
maxWidth: extractOptionAttribute(target, "data-tooltip-maxwidth", 'auto'),
persistent: extractOptionAttribute(target, "data-tooltip-persistent", defaultOptions.persistent),
stickTo: extractOptionAttribute(target, "data-tooltip-stickto", defaultOptions.stickTo)
};
createTooltip(target,options,DOMTooltips);
});
}
function getElementsBySelector(selector, context)
{
var nodes = [];
try {
nodes = Array.prototype.slice.call((context || document).querySelectorAll(selector));
}
catch (exc) {}
return nodes;
}
function createUserTooltips(userTooltipsOptions)
{
userTooltipsOptions.forEach(function(options) {
var targets=[];
if (options.targetSelector)
targets = getElementsBySelector(options.targetSelector);
targets.forEach(function(target) {
createTooltip(target,options,userTooltips);
});
});
}
var html5tooltips=function(userTooltipsOptions){
if(!Array.isArray(userTooltipsOptions))
userTooltipsOptions=[userTooltipsOptions];
//TODO: remove DOMTooltips that share target with userTooltips
createUserTooltips(userTooltipsOptions);
};
//Provides html property reading for AMD and CommonJS
html5tooltips.autoinit=
html5tooltips.refresh=function(){
createDOMTooltips();
};
html5tooltips.getTooltipByTarget=function(target){
for(var i=userTooltips.length;i--;)
if(userTooltips[i].model.target===target)
return userTooltips[i];
for(var i=DOMTooltips.length;i--;)
if(DOMTooltips[i].model.target===target)
return DOMTooltips[i];
};
function documentLoaded()
{
document.removeEventListener("DOMContentLoaded",documentLoaded, false);
window.removeEventListener("load",documentLoaded, false);
html5tooltips.refresh();
}
if(typeof window!=='undefined'){
if (document.readyState === "complete") {
documentLoaded();
} else {
document.addEventListener("DOMContentLoaded",documentLoaded, false);
window.addEventListener( "load", documentLoaded, false );
}
if (!window.html5tooltipsPredefined) {
window.html5tooltipsPredefined = html5tooltipsPredefined;
window.HTML5TooltipUIComponent=HTML5TooltipUIComponent;
}
}
return html5tooltips;
}));
;
/**
* jQuery jPages v0.7
* Client side pagination with jQuery
* http://luis-almeida.github.com/jPages
*
* Licensed under the MIT license.
* Copyright 2012 Luís Almeida
* https://github.com/luis-almeida
*/
;(function($,window,document,undefined){var name="jPages",instance=null,defaults={containerID:"",first:false,previous:"‹",next:"›",last:false,links:"numeric",startPage:1,perPage:10,midRange:5,startRange:1,endRange:1,keyBrowse:false,scrollBrowse:false,pause:0,clickStop:false,delay:50,direction:"forward",animation:"",fallback:400,minHeight:true,callback:undefined};function Plugin(element,options){this.options=$.extend({},defaults,options);this._container=$("#"+this.options.containerID);if(!this._container.length)return;this.jQwindow=$(window);this.jQdocument=$(document);this._holder=$(element);this._nav={};this._first=$(this.options.first);this._previous=$(this.options.previous);this._next=$(this.options.next);this._last=$(this.options.last);this._items=this._container.children(":visible");this._itemsShowing=$([]);this._itemsHiding=$([]);this._numPages=Math.ceil(this._items.length/this.options.perPage);this._currentPageNum=this.options.startPage;this._clicked=false;this._cssAnimSupport=this.getCSSAnimationSupport();this.init();}Plugin.prototype={constructor:Plugin,getCSSAnimationSupport:function(){var animation=false,animationstring='animation',keyframeprefix='',domPrefixes='Webkit Moz O ms Khtml'.split(' '),pfx='',elm=this._container.get(0);if(elm.style.animationName)animation=true;if(animation===false){for(var i=0;i";$(requiredStyles).appendTo("head");if(this._cssAnimSupport&&this.options.animation.length)this._items.addClass("animated jp-hidden");else this._items.hide();},setNav:function(){var navhtml=this.writeNav();this._holder.each(this.bind(function(index,element){var holder=$(element);holder.html(navhtml);this.cacheNavElements(holder,index);this.bindNavHandlers(index);this.disableNavSelection(element);},this));if(this.options.keyBrowse)this.bindNavKeyBrowse();if(this.options.scrollBrowse)this.bindNavScrollBrowse();},writeNav:function(){var i=1,navhtml;navhtml=this.writeBtn("first")+this.writeBtn("previous");for(;i<=this._numPages;i++){if(i===1&&this.options.startRange===0)navhtml+="...";if(i>this.options.startRange&&i<=this._numPages-this.options.endRange)navhtml+="";else
navhtml+="";switch(this.options.links){case"numeric":navhtml+=i;break;case"blank":break;case"title":var title=this._items.eq(i-1).attr("data-title");navhtml+=title!==undefined?title:"";break;}navhtml+="";if(i===this.options.startRange||i===this._numPages-this.options.endRange)navhtml+="...";}navhtml+=this.writeBtn("next")+this.writeBtn("last")+" ";return navhtml;},writeBtn:function(which){return this.options[which]!==false&&!$(this["_"+which]).length?"