' +
'
' +
'
' +
' ' +
' ' +
'
' +
'
',
bottomMarkup =
'
' +
'
' +
' ' +
' ' +
'
' +
'
' +
'/ ' +
' ' +
'
' +
'
' +
' ' +
' ' +
'
' +
'
',
resizeThrottle,
bottomContent,
hasFullscreen,
holderPadLeft,
holderPadTop,
thumbTipText,
thumbBufTall,
currentWidth,
holderHeight,
isFullscreen,
itemCallback,
thumbTipBuf,
paddingTall,
paddingWide,
totalThumbs,
description,
panelBuffer,
thumbMinus,
thumbStrip,
thumbPanel,
stripWidth,
thumbRight,
topContent,
descHolder,
descHeight,
showThumbs,
hideThumbs,
panelRight,
fullNormal,
scrollPos,
panelLeft,
titleText,
thumbLeft,
container,
preloader,
numThumbs,
descripts,
oldHeight,
unescaped,
swipeable,
className,
baseName,
oldWidth,
thumbTip,
thumbVis,
showHide,
closeBtn,
descText,
controls,
elements,
useTips,
scaleUp,
divider,
descVis,
thumbOn,
wrapper,
current,
goRight,
legged,
preBuf,
goLeft,
upsize,
fader,
touch,
boxed,
title,
total,
cover,
words,
$this,
items,
info,
docs,
doc,
url,
wid,
win,
leg,
isIE,
cats,
high,
hash,
list,
isIE8,
pushW,
pushH,
timer,
toCall,
thumbs,
bodies,
holder,
lights,
oWidth,
isLocal,
runTime,
scaling,
content,
oHeight,
isImage,
winWide,
winTall,
bufferW,
bufferH,
theType,
parents,
browser,
thmWidth,
dataDesc,
isActive,
preAdded,
scroller,
keyboard,
isYoutube,
useThumbs,
isLoading,
fromThumb,
hasThumbs,
holOrigTop,
firstCheck,
currentCat,
showScroll,
deepLinking,
lightSocial,
socialFrame,
thumbHolder,
eventsAdded,
preThumbBuf,
holOrigLeft,
instantiated,
arrowClicked,
arrowsActive,
thumbsChecked,
autoPlayVideo,
thumbnailWidth,
jackBoxIsReady,
thumbnailHeight,
flashVideoFirst,
defaultShareImage,
showInfoByDefault,
thumbsStartHidden,
defaultVideoWidth,
defaultVideoHeight,
isOn=1,
catOn=-1,
numCats=0,
firstRun=true,
initialLoad=true,
methods={
init: function($this, settings){
if(!instantiated){
if(typeof Jacked==="undefined") return;
if(settings) $.extend(defaults, settings);
className=defaults.className;
useThumbs=defaults.useThumbs;
deepLinking=defaults.deepLinking;
useTips=defaults.useThumbTooltips;
autoPlayVideo=defaults.autoPlayVideo;
keyboard=defaults.useKeyboardControls;
showScroll=defaults.showPageScrollbar;
thumbnailWidth=defaults.thumbnailWidth;
scaling=defaults.fullscreenScalesContent;
thumbnailHeight=defaults.thumbnailHeight;
flashVideoFirst=defaults.flashVideoFirst;
showInfoByDefault=defaults.showInfoByDefault;
thumbsStartHidden=defaults.thumbsStartHidden;
defaultShareImage=defaults.defaultShareImage;
defaultVideoWidth=defaults.defaultVideoWidth;
defaultVideoHeight=defaults.defaultVideoHeight;
baseName=defaults.baseName;
swfPlayer=baseName + swfPlayer;
videoPlayer=baseName + videoPlayer;
audioPlayer=baseName + audioPlayer;
preloaderUrl=baseName + preloaderUrl;
defaultThumb=baseName + defaultThumb;
socialbuttons=baseName + socialbuttons;
doc=document;
docs=$(document);
instantiated=true;
thmWidth=thumbnailWidth + thumbnailMargin;
isLocal=doc.URL.search("file:///")!==-1;
Jacked.setEngines({ios: true, safari: true, opera: true, firefox: true});
if(defaults.preloadGraphics&&!isLocal){
$.getJSON(preloaderUrl + "?jackbox_path=" + graphicsPath, jsonLoaded);
}
lights=$this;
isIE8=Jacked.getIE();
touch=Jacked.getMobile();
browser=Jacked.getBrowser();
isIE=browser==="ie";
if(touch) showScroll=false;
if(typeof $.address!=="undefined"&&deepLinking){
if(!isIE&&!defaults.dynamic){
$.address.init(init);
}else{
init();
$.address.update();
}}else{
deepLinking=false;
init();
}
if(typeof StackBlurImage!=="undefined"&&!isLocal&&!isIE8){
$(".jackbox-hover-blur").each(drawBlur);
}
$(".jackbox-tooltip").each(addTip);
defaults=null;
}},
frameReady: function(){
if(isActive) loaded();
},
newItem: function($this, settings){
$this.each(apiCall, [settings]);
},
removeItem: function($this){
$this.each(apiCall, [false, true]);
}},
loadFrame=(function(){
var obj={
type: "text/html",
frameborder: 0,
mozallowfullscreen: "mozallowfullscreen",
webkitallowfullscreen: "webkitallowfullscreen",
allowfullscreen: "allowfullscreen"
};
return function(st, special, scrolls){
obj.width=wid;
obj.height=high;
obj.scrolling = !scrolls ? "no":"auto";
content=$("
").attr(obj);
if(!isYoutube){
content.addClass("jackbox-content");
}else{
content.addClass("jackbox-youtube");
}
content.prependTo(container);
if(!special) content.one("load.jackbox", loaded);
content.attr("src", st);
};})(),
loaded=(function(){
var obj={};
return function(event){
if(event) event.stopPropagation();
if(isImage){
oWidth=this.width||content.width();
oHeight=this.height||content.height();
setSize();
}
obj.width=wid;
obj.height=high;
content.css(obj);
tweenContent(true);
if(itemCallback) itemCallback();
win.on("resize.jackbox", resized);
};})(),
tweenContent=(function(){
var tw={}, tw2={}, props={};
return function(callback){
var newW;
if(callback){
if(wid < 260) pushW +=260 - wid;
newW=Math.max(wid, 260);
if(newW===oldWidth&&high===oldHeight){
showContent();
return;
}
tw.callback=showContent;
tw.duration=oldWidth ? Math.abs(newW - oldWidth) > 50||Math.abs(high - oldHeight) > 50 ? 600:300:600;
}else{
newW=wid;
props.width=newW;
tw.duration=300;
delete tw.callback;
if(topContent) Jacked.tween(topContent[0], props, tw);
if(bottomContent) Jacked.tween(bottomContent[0], props, tw);
props.height=high;
Jacked.stopTween(content[0], true);
Jacked.tween(content[0], props, tw);
}
tw2.marginLeft=-(((pushW >> 1) + 0.5) | 0);
tw2.marginTop=-(((pushH >> 1) + 0.5) | 0);
tw2.height=high;
tw2.width=newW;
if(!oldWidth) tw2.opacity=1;
Jacked.tween(holder[0], tw2, tw);
oldWidth=newW;
oldHeight=high;
};})(),
showContent=(function(){
var dur={}, style={opacity: 1, visibility: "visible"};
return function(){
showElements();
preloader.removeClass("jackbox-spin-preloader");
var maxed=Math.max(wid, 260);
dur.duration=600;
if(isImage&&!isIE8){
Jacked.fadeIn(content[0], dur);
}else{
if(!isYoutube){
content.show();
}else{
content.css('visibility', 'visible');
}
if(theType==="audio"||theType==="local"){
content[0].contentWindow.cjInit();
}}
dur.duration=300;
if(!isIE8){
if(topContent){
topContent.css("width", maxed);
Jacked.fadeIn(topContent[0], dur);
}
if(bottomContent){
bottomContent.css("width", maxed);
Jacked.fadeIn(bottomContent[0], dur);
}}else{
if(topContent) topContent.css("width", maxed).show();
if(bottomContent) bottomContent.css("width", maxed).show();
}
if(info&&descText){
info.show();
descHolder.html(descText).show();
descHeight=-descHolder.outerHeight();
description.css("height", -descHeight < high ? -descHeight:high);
if(!showInfoByDefault){
descVis=false;
descHolder.css("margin-top", descHeight);
}else{
descVis=true;
info.addClass("jb-info-inactive");
descHolder.css({visibility: 'visible', marginTop: 0});
}}
else if(info){
info.hide();
descHolder.hide();
}
isLoading=false;
if(!eventsAdded&&legged){
panelLeft.css(style);
panelRight.css(style);
}
if(!thumbsChecked&&useThumbs&&legged) loadThumbs();
if(!eventsAdded) addEvents();
if(touch){
content[0].removeEventListener("touchstart", returnFalse, false);
content[0].removeEventListener("touchmove", returnFalse, false);
content[0].removeEventListener("touchend", returnFalse, false);
removeTouches();
}
if(legged) turnOn();
if(theType==="inline") sizer();
};})(),
showElements=(function(){
var obj={
type: "text/html",
frameborder: 0,
mozallowfullscreen: "mozallowfullscreen",
webkitallowfullscreen: "webkitallowfullscreen",
allowfullscreen: "allowfullscreen",
scrolling: "no"
};
return function(){
if(!elements) createElements();
if(!legged){
if(controls) controls.hide();
if(showHide) showHide.hide();
}
if(title){
if(titleText==="false") titleText=false;
var hasContent=words&&titleText, amper=hasContent ? " - ":"";
if(current&&legged){
current.text((isOn + 1)).show();
total.html(leg + amper).show();
if(divider) divider.show();
}else{
if(total) total.hide();
if(current) current.hide();
if(divider) divider.hide();
}
if(hasContent){
words.html(unescaped);
var a=words.find("a");
if(a.length){
a.on("click.jackbox", stopProp);
words.data("links", a);
}}
}
if(!lightSocial||isLocal) return;
var poster, ur, domain=doc.URL.split("#")[0], len=domain.length - 1;
if(domain.search("/")!==-1){
if(domain.charAt(len)!=="/"){
(deepLinking) ? ur=domain + "#/" + hash + "/" + (isOn + 1):ur=domain;
domain=domain.substring(0, domain.lastIndexOf("/"));
}else{
domain=domain.substring(0, len);
(deepLinking) ? ur=domain + "/#/" + hash + "/" + (isOn + 1):ur=domain;
}}
if(isImage){
poster=$this.attr("href")||$this.attr("data-href");
}else{
var alt=$this.children("img");
poster=alt.length ? alt.attr("src"):defaultShareImage;
}
if(poster.search("http")===-1) poster=poster.charAt(0)!=="/" ? domain + "/" + poster:domain + poster;
var titlText=titleText ? titleText.replace(/(<([^>]+)>)/ig, ""):doc.title;
titlText=titlText.split('.').join('');
obj.width=socialFrameWidth;
obj.height=socialFrameHeight;
obj.src=socialbuttons +
"?url=" + encodeURIComponent(ur) +
"&poster=" + encodeURIComponent(poster) +
"&title=" + escape(titlText);
socialFrame=$("
").attr(obj).appendTo(lightSocial);
};})(),
toggleInfo=(function(){
var obj1={}, obj2={duration: 300};
return function(event){
if(event) event.stopPropagation();
if(!descVis){
info.addClass("jb-info-inactive");
description.css("visibility", "visible");
obj1.marginTop=0;
delete obj2.callback;
}else{
obj1.marginTop=descHeight;
obj2.callback=infoIndex;
info.removeClass("jb-info-inactive");
}
Jacked.tween(descHolder[0], obj1, obj2);
descVis = !descVis;
};})(),
overThumb=(function(){
var obj={opacity: 1, visibility: "visible"};
return function(){
if(touch){
clearTimeout(fader);
fader=setTimeout(outThumb, 2000);
}
var $this=$(this), ww, xx, buffer, lft;
thumbTipText.text($this.data("theTitle"));
ww=parseInt(thumbTipText.css("width"), 10);
lft=thumbPanel.data("offLeft");
xx=$this.offset().left;
buffer=lft + thumbPanel.width() - ww - thumbTipBuf;
obj.width=ww;
obj.left=xx < lft ? lft:xx > buffer ? buffer:xx;
thumbTip.css(obj);
};})(),
toggleThumbs=(function(){
var obj1={}, obj2={duration: 300};
return function(event){
if(event) event.stopPropagation();
if(thumbVis===0){
thumbVis=holderHeight;
if(showHide){
hideThumbs.hide();
showThumbs.show();
}}else{
thumbVis=0;
if(showHide){
showThumbs.hide();
hideThumbs.show();
}}
obj1.bottom=thumbVis;
Jacked.tween(thumbHolder[0], obj1, obj2);
if(winWide < 569) return;
sizer("true");
tweenContent();
};})(),
posThumbs=(function(){
var obj={};
return function(resize){
var maxWidth=winWide - thumbPanelBuffer;
if(stripWidth < maxWidth){
numThumbs=totalThumbs;
arrowsActive=false;
}else{
numThumbs=(maxWidth / thmWidth) | 0;
arrowsActive=true;
}
currentWidth=(thmWidth * numThumbs) - thumbnailMargin;
thumbMinus=numThumbs - 1;
obj.marginLeft=-(currentWidth >> 1) - thumbnailMargin;
obj.width=currentWidth;
thumbPanel.css(obj);
thumbStrip.css("width", stripWidth);
checkThumbs(resize);
};})(),
checkThumbs=(function(){
var obj1={}, obj2={duration: 300};
return function(resize, tween){
if(resize){
thumbOn=isOn;
if(isOn!==0&&isOn + numThumbs > leg) thumbOn=leg - numThumbs;
Jacked.stopTween(thumbStrip[0]);
thumbStrip.css("left", thumbOn * -thmWidth);
}else{
if(isOn===0){
thumbOn=0;
}
else if(isOn > thumbOn + thumbMinus){
while(isOn > thumbOn + thumbMinus) thumbOn++;
}
if(tween){
obj1.left=thumbOn * -thmWidth;
Jacked.tween(thumbStrip[0], obj1, obj2);
}else{
Jacked.stopTween(thumbStrip[0]);
thumbStrip.css("left", thumbOn * -thmWidth);
}}
checkArrows(resize, false);
};})(),
checkArrows=(function(){
var obj1={}, obj2={duration: 300};
return function(resize, fromArrow){
thumbLeft.off(".jackbox");
thumbRight.off(".jackbox");
if(!arrowsActive){
thumbLeft.hide();
thumbRight.hide();
}else{
if(touch) thumbPanel.cjSwipe("unbindSwipe");
if(thumbOn < leg - numThumbs){
thumbRight.on("click.jackbox", thumbArrowNext).show();
if(touch) thumbPanel.cjSwipe("touchSwipeLeft", thumbArrowNext, true);
}else{
thumbRight.hide();
}
if(thumbOn > 0){
thumbLeft.on("click.jackbox", thumbArrowPrev).show();
if(touch) thumbPanel.cjSwipe("touchSwipeRight", thumbArrowPrev, true);
}else{
thumbLeft.hide();
}
if(fromArrow){
obj1.left=thumbOn * -thmWidth;
Jacked.tween(thumbStrip[0], obj1, obj2);
}
else if(resize||!firstCheck){
var off=thumbPanel.offset().left;
thumbLeft.css("left", off);
thumbRight.css("left", off + currentWidth);
firstCheck=true;
}}
};})(),
sizer=(function(){
var obj1={opacity: 1}, obj2={};
return function(noResize){
winWide=win.width();
winTall=Math.max(win.height(), 226);
var tBuf=winWide > 568&&thumbVis===0 ? thumbBufTall:0;
if(theType!=="audio"&&theType!=="inline"){
scaleUp = !isFullscreen ? upsize:upsize||scaling;
}else{
scaleUp=false;
}
if(bufferW < winWide&&bufferH + tBuf < winTall&&!scaleUp){
wid=oWidth;
high=oHeight;
}else{
wid=winWide / bufferW;
high=winTall / bufferH;
var perc=(wid > high) ? high:wid;
wid=oWidth * perc;
high=oHeight * perc;
if(winWide > winTall){
if(high + boxed + tBuf > winTall){
high=winTall - paddingTall - boxBuffer - tBuf;
wid=oWidth * (high / oHeight);
}}else{
if(wid > high){
if(wid + bufferW > winWide){
wid=winWide - boxBuffer;
high=oHeight * (wid / oWidth);
}}else{
if(high + boxed + tBuf > winTall){
high=winTall - paddingTall - boxBuffer - tBuf;
wid=oWidth * (high / oHeight);
}}
}
if(wid!==(wid | 0)) wid=(wid + 1) | 0;
if(high!==(high | 0)) high=(high + 1) | 0;
}
if(theType==="inline"){
var w=winWide - paddingWide - panelBuffer - boxBuffer;
var h=winTall - paddingTall - boxBuffer - tBuf;
wid=oWidth > w ? w:oWidth;
high=oHeight < h ? oHeight:high;
}
pushW=wid + paddingWide;
pushH=high + paddingTall + tBuf;
if(noResize==="true") return;
Jacked.stopTween(holder[0], false, true);
if(content) Jacked.stopTween(content[0], true, true);
if(wid < 260) pushW +=260 - wid;
var maxed=Math.max(260, wid);
obj1.width=maxed;
obj1.height=high;
obj2.marginLeft=-(((pushW * 0.5) + 0.5) | 0);
obj2.marginTop=-(((pushH * 0.5) + 0.5) | 0);
obj2.width=maxed;
obj2.height=high;
holder.css(obj2);
content.css(obj1);
if(bottomContent){
Jacked.stopTween(bottomContent[0]);
bottomContent.css("width", maxed);
}
if(topContent){
Jacked.stopTween(topContent[0]);
topContent.css("width", maxed);
}
if(info&&descText){
descHeight=-descHolder.outerHeight();
description.css("height", -descHeight < high ? -descHeight:high);
if(!descVis){
Jacked.stopTween(descHolder[0], false, true);
descHolder.css("margin-top", descHeight);
}}
if(hasThumbs) posThumbs(true);
};})(),
moveTip=(function(){
var obj={};
return function(event){
var data=$(this).data();
obj.left=event.pageX - data.tipX - data.tipWidth;
obj.top=event.pageY - data.tipY - data.tipHeight;
data.tip.css(obj);
};})();
$.fn.jackBox=function(func, params){
if(methods.hasOwnProperty(func)){
methods[func](this, params);
}
return this;
};
$.jackBox={
available: function(callback){
if(!callback) return;
if(jackBoxIsReady){
(deepLinking) ? setTimeout(callback, 250):callback();
}else{
toCall=callback;
}},
itemLoaded: function(callback){
itemCallback=callback;
}};
function init(){
win=$(window);
bodies=$("body");
scroller=$("body, html");
cover=$("
").addClass("jackbox-modal");
holder=$("
").addClass("jackbox-holder");
wrapper=$("
").addClass("jackbox-wrapper");
preloader=$("
").addClass("jackbox-preloader");
panelLeft=$("
").addClass("jackbox-panel jackbox-panel-left");
panelRight=$("
").addClass("jackbox-panel jackbox-panel-right");
var frag=doc.createDocumentFragment();
frag.appendChild(wrapper[0]);
frag.appendChild(preloader[0]);
cover[0].appendChild(frag);
frag=doc.createDocumentFragment();
frag.appendChild(panelLeft[0]);
frag.appendChild(panelRight[0]);
frag.appendChild(holder[0]);
wrapper[0].appendChild(frag);
container=$("
").addClass("jackbox-container");
if(!isIE8){
var preOutside=$("
").addClass("jackbox-pre-outside").appendTo(preloader);
$("
").addClass("jackbox-pre-inside").appendTo(preOutside);
}
boxBuffer *=2;
scrollPos=0;
frag=doc.createDocumentFragment();
if(!!topMarkup){
topContent=$(topMarkup).hide();
frag.appendChild(topContent[0]);
}
frag.appendChild(container[0]);
if(!!bottomMarkup){
bottomContent=$(bottomMarkup).hide();
frag.appendChild(bottomContent[0]);
}
holder[0].appendChild(frag);
holderHeight=-(thumbnailHeight + thumbnailMargin);
descripts=[];
items=[];
list=[];
cats=[];
lights.each(catEach);
if(deepLinking){
$.address.internalChange(insideChange);
$.address.externalChange(browserChange);
}
jackBoxIsReady=true;
if(toCall){
(deepLinking) ? setTimeout(toCall, 250):toCall();
toCall=null;
}
lights=items=topMarkup=bottomMarkup=descripts=null;
}
function apiCall(settings, remove){
var $this=$(this),
i=cats.length,
found=-1,
listed,
group,
fnd,
str,
j;
if(settings&&typeof settings==="object"){
var prop, itm, href=$this.attr("href");
for(prop in settings){
if(settings.hasOwnProperty(prop)&&prop!=="trigger"){
itm=settings[prop];
if(prop!=="href"||!href) $this.attr("data-" + prop, itm);
if(prop==="group") group=itm;
}}
}
if(!group) group=$this.attr("data-group");
if(!group) return;
str=group.split(" ").join("").toLowerCase();
while(i--){
if(cats[i]===str){
found=i;
break;
}}
if(found > -1){
listed=list[found];
i=listed.length;
while(i--){
fnd=listed[i];
if(fnd[0]===$this[0]){
if(remove){
listed.splice(i, 1);
fnd.off('click.jackbox');
j=listed.length;
if(j){
for(var k=0; k < j; k++){
listed[k].data('id', k);
}}else{
list.splice(found, 1);
cats.splice(found, 1);
numCats--;
}}
return;
}}
i=listed.length;
listed[i]=$this;
}else{
if(remove) return;
found=cats.length;
i=list.length;
cats[found]=str;
numCats++;
list[i]=[$this];
i=0;
}
itemEach($this);
$this.data({id: i, cat: found});
if(settings&&settings.trigger) $this.trigger("click");
}
function catEach(){
var str=$(this).attr("data-group").split(" ").join("").toLowerCase();
if(!isIE8){
if(cats.indexOf(str)===-1) addCat(str);
}else{
var i=cats.length, found=false;
while(i--){
if(cats[i]===str){
found=true;
break;
}}
if(!found) addCat(str);
}}
function addCat(str){
cats[cats.length]=str;
items=[];
$(className + "[data-group=" + str + "]").each(itemEach);
list[list.length]=items;
numCats++;
}
function itemEach(i){
if(!isNaN(i)){
$this=$(this).data({id: i, cat: numCats});
items[i]=$this;
}else{
$this=i;
}
url=$this.attr("href")||$this.attr("data-href");
if(!url) return;
var popped, video;
if(url.charAt(0)!=="#"){
popped=url.toLowerCase().split(".").pop();
}else{
popped="inline";
}
video=checkVideo(url, popped);
if(video){
$this.data("type", video);
if(!$this.attr("data-thumbnail")){
if(video==="vimeo"){
getVimeoThumb($this, url);
}
else if(video==="youtube"){
$this.attr("data-thumbnail", "http://img.youtube.com/vi/" + url.split("http://www.youtube.com/watch?v=")[1] + "/1.jpg");
}}
}
else if(checkImage(popped)){
$this.data("type", "image");
}else{
switch(popped){
case "mp3":
$this.data("type", "audio");
break;
case "swf":
$this.data("type", "swf");
break;
case "inline":
$this.data("type", "inline");
break;
default:
$this.data("type", "iframe");
}}
$this.on("click.jackbox", clicked);
dataDesc=$this.attr("data-description");
if(!dataDesc) return;
if(descripts){
var dIndex=descripts.indexOf(dataDesc);
if(dIndex===-1){
dataDesc=$(dataDesc);
if(!dataDesc.length) return;
descripts[descripts.length]=dataDesc;
}else{
dataDesc=descripts[dIndex];
}}else{
dataDesc=$(dataDesc);
if(!dataDesc.length) return;
}
$this.data("description", dataDesc);
}
function browserChange(event){
if(initialLoad){
initialLoad=false;
var url=doc.URL, splits=url.split("?url=");
if(splits.length===2){
window.location=splits[0] + "#/" + splits[1];
return;
}}
clearTimeout(runTime);
getHash(event.value);
if(catOn!==-1){
if(firstRun){
firstRun=false;
insideChange();
}else{
runTime=setTimeout(insideChange, 750);
}}
else if(isActive){
closing();
}}
function insideChange(event){
if(typeof event==="object"){
clearTimeout(runTime);
getHash(event.value);
}
if(catOn!==-1){
loadItem();
}
else if(isActive){
closing();
}}
function getHash(val){
if(hasThumbs&&!fromThumb&&!arrowClicked) thumbs[isOn].removeClass("jb-thumb-active");
if(val!=="/"){
var ars=val.split("/");
if(ars.length===3){
isOn=parseInt(ars[2], 10) - 1;
if(isNaN(isOn)) isOn=0;
hash=ars[1];
}else{
if(isNaN(ars[1])){
isOn=0;
hash=ars[1];
}else{
isOn=parseInt(ars[1], 10) - 1;
hash="/";
}}
}else{
hash="/";
isOn=0;
}
if(hash!=="/"){
var i=numCats;
while(i--){
if(cats[i]===hash){
catOn=i;
leg=list[catOn].length;
legged=leg!==1;
break;
}}
}else{
catOn=-1;
}
arrowClicked=false;
}
function resized(){
clearTimeout(resizeThrottle);
resizeThrottle=setTimeout(sizer, 100);
}
function clicked(event){
event.stopPropagation();
event.preventDefault();
var data=$(this).data();
runItem(data.cat, data.id, true);
}
function runItem(cat, id, first){
clearTimeout(runTime);
if(!first) turnOff();
if(deepLinking){
$.address.value(cats[cat] + "/" + (id + 1));
}else{
if(hasThumbs&&!fromThumb&&!arrowClicked) thumbs[isOn].removeClass("jb-thumb-active");
isOn=id;
catOn=cat;
leg=list[catOn].length;
legged=leg!==1;
loadItem();
}}
function nextItem(event){
if(event){
event.stopPropagation();
if(isLoading) return false;
}
if(!isActive) return;
if(hasThumbs&&!fromThumb) thumbs[isOn].removeClass("jb-thumb-active");
((isOn) < list[catOn].length - 1) ? isOn++:isOn=0;
arrowClicked=true;
runItem(catOn, isOn);
}
function previousItem(event){
if(event){
event.stopPropagation();
if(isLoading) return false;
}
if(!isActive) return;
if(hasThumbs&&!fromThumb) thumbs[isOn].removeClass("jb-thumb-active");
((isOn) > 0) ? isOn--:isOn=list[catOn].length - 1;
arrowClicked=true;
runItem(catOn, isOn);
}
function addTouches(){
var ar=[cover[0], wrapper[0], holder[0], container[0]], i=4;
while(i--){
ar[i].addEventListener("touchstart", returnFalse, false);
ar[i].addEventListener("touchmove", returnFalse, false);
ar[i].addEventListener("touchend", returnFalse, false);
}}
function removeTouches(){
var ar=[cover[0], wrapper[0], holder[0], container[0]], i=4;
while(i--){
ar[i].removeEventListener("touchstart", returnFalse, false);
ar[i].removeEventListener("touchmove", returnFalse, false);
ar[i].removeEventListener("touchend", returnFalse, false);
}}
function loadItem(){
currentCat=list[catOn];
$this=currentCat[isOn];
if(!$this) return;
if(touch) addTouches();
url=$this.attr("href")||$this.attr("data-href");
if(isActive){
isLoading=true;
killActive();
loadContent();
}else{
isActive=true;
if(!touch) scroller.stop();
scrollPos=win.scrollTop();
cover.appendTo(bodies).one("click.jackbox", closer);
if(!showScroll) parents=cover.parents().each(addOverflow);
if(keyboard) docs.on("keydown.jackbox_keyboard", checkKeyClose);
if(!preAdded){
preAdded=true;
paddingWide=parseInt(holder.css("padding-left"), 10) + parseInt(holder.css("padding-right"), 10);
paddingTall=parseInt(holder.css("padding-top"), 10) + parseInt(holder.css("padding-bottom"), 10);
panelBuffer=parseInt(panelLeft.css("width"), 10) + 14;
boxed=paddingTall + boxBuffer;
thumbBufTall=thumbnailHeight + (thumbnailMargin << 1);
preBuf=parseInt(preloader.css("margin-top"), 10);
preThumbBuf=preBuf - (thumbBufTall >> 1);
holderPadLeft=parseInt(holder.css("padding-left"), 10);
holderPadTop=parseInt(holder.css("padding-top"), 10);
fullNormal=$(".jackbox-fullscreen");
if(!fullNormal.length) fullNormal=null;
hasFullscreen = !touch&&browser!=="safari"&&("webkitRequestFullScreen" in cover[0]||"mozFullScreenEnabled" in doc);
}
thumbVis = !thumbsStartHidden&&useThumbs&&legged ? 0:holderHeight;
winWide=win.width();
winTall=win.height();
holder.css({
width: winWide,
height: winTall,
marginLeft: -(winWide >> 1) - holderPadLeft,
marginTop: -(winTall >> 1) - holderPadTop
});
Jacked.fadeIn(cover[0], {callback: addScroll});
timer=setTimeout(loadContent, 250);
wrapper.on("click.jackbox", preventDefault);
}}
function addOverflow(){
$(this).addClass("jackbox-overflow");
}
function removeOverflow(){
$(this).removeClass("jackbox-overflow");
}
function addScroll(){
if(!showScroll) win[0].scrollTo(0, 0);
}
function convert(st){
return st==="true"||st===true;
}
function loadContent(){
if(hasThumbs){
thumbs[isOn].addClass("jb-thumb-active");
(fromThumb) ? fromThumb=false:checkThumbs(false, true);
}
var autoplay=convert($this.attr("data-autoplay") ? $this.attr("data-autoplay"):autoPlayVideo),
thisDesc=$this.data("description")||null,
thisTitle=$this.attr("data-title")||"",
passedLocal;
upsize=$this.attr("data-scaleUp")==="true";
descText=thisDesc&&typeof thisDesc!=="string" ? thisDesc.html():false;
theType=$this.data("type");
autoplay=convert(autoplay);
if(thisTitle){
unescaped=thisTitle;
titleText=escape(unescaped);
}else{
titleText=false;
if(typeof words!=="undefined"){
if(words.data("links")) words.data("links").off(".jackbox");
words.empty();
}}
if(touch){
swipeable=theType==="image";
if(theType!=="inline"&&theType!=="iframe") doc.addEventListener("touchmove", returnFalse, false);
}
if(theType!=="image") writeSize();
isYoutube=false;
if(winWide > 568){
preloader.css("margin-top", thumbVis===0 ? preThumbBuf:preBuf);
}else{
preloader.css("margin-top", preBuf);
}
wrapper.show();
preloader.addClass("jackbox-spin-preloader");
switch(theType){
case "image":
isImage=true;
content=$("
").addClass("jackbox-content").one("load.jackbox", loaded).prependTo(container);
if(touch){
content[0].addEventListener("touchstart", returnFalse, false);
content[0].addEventListener("touchmove", returnFalse, false);
content[0].addEventListener("touchend", returnFalse, false);
}
content.attr("src", url);
break;
case "youtube":
if(touch) isYoutube=true;
loadFrame(youTubeMarkup.split("{url}").join(url.split("watch?v=")[1]).split("{autoplay}").join(autoplay ? 1:0));
break;
case "vimeo":
if(touch) isYoutube=true;
loadFrame(vimeoMarkup.split("{url}").join(url.substring(url.lastIndexOf("/"))).split("{autoplay}").join(autoplay));
break;
case "local":
var vPoster=fullPath(),
ffUsesFlash=$this.attr("data-firefoxUsesFlash")==="true" ? "true":"false",
flashing=($this.attr("data-flashHasPriority") ? $this.attr("data-flashHasPriority"):flashVideoFirst.toString());
passedLocal=flashing==="false"&&hasFullscreen&&browser!=="firefox";
if($this.attr("data-poster")){
vPoster +=$this.attr("data-poster");
}else{
vPoster="false";
}
loadFrame(
videoPlayer +
"?video=" + url +
"&autoplay=" + autoplay +
"&flashing=" + flashing +
"&width=" + oWidth +
"&height=" + oHeight +
"&poster=" + vPoster +
"&firefox=" + ffUsesFlash,
true);
break;
case "audio":
fullPath();
loadFrame(audioPlayer + "?audio=" + url + "&title=" + ($this.attr("data-audiotitle") ? $this.attr("data-audiotitle"):titleText) + "&autoplay=" + autoplay);
break;
case "swf":
fullPath();
loadFrame(swfPlayer + "?swf=" + url + "&width=" + (wid.toString() + "&height=" + high.toString()));
break;
case "inline":
var htm=$(url), con=htm.length ? htm.html():"";
content=$("
").addClass("jackbox-content jackbox-html").html(con).prependTo(container);
content.css("width", wid).find("a").on("click", stopProp);
$this.attr("data-height", content.outerHeight(true));
writeSize();
loaded();
break;
default:
loadFrame(url, false, true);
}
if(!hasFullscreen) return;
(!passedLocal) ? fullNormal.show():fullNormal.hide();
}
function fullPath(){
if(url.search("http")!==-1) return "";
var root=doc.URL.split("#")[0];
if(root[root.length - 1]!=="/"){
root=root.substring(0, root.lastIndexOf("/") + 1);
}
url=root + url;
return root;
}
function turnOn(){
if(hasThumbs){
var i=thumbs.length;
while(i--) thumbs[i].on("click.jackbox", thumbClick);
}
panelLeft.on("click.jackbox", previousItem);
panelRight.on("click.jackbox", nextItem);
if(keyboard) docs.on("keydown.jackbox", checkKey);
if(touch&&swipeable) content.cjSwipe("touchSwipe", catchSwipe);
}
function turnOff(){
if(hasThumbs){
var i=thumbs.length;
while(i--) thumbs[i].off("click.jackbox");
}
panelLeft.off(".jackbox");
panelRight.off(".jackbox");
if(keyboard) docs.off("keydown.jackbox");
if(touch&&swipeable) content.cjSwipe("unbindSwipe");
}
function checkKey(event){
switch(event.keyCode){
case 39:
nextItem();
break;
case 37:
previousItem();
break;
case 40:
toggleThumbs();
break;
case 38:
toggleThumbs();
break;
}}
function checkKeyClose(event){
if(event.keyCode===27) closer(event);
}
function infoIndex(){
description.css("visibility", "hidden");
}
function ripThumbs(){
var frag=doc.createDocumentFragment(), halfHeight=thumbnailHeight >> 1;
thumbHolder=$("
").addClass("jackbox-thumb-holder").css("height", thumbnailHeight).appendTo(cover);
thumbPanel=$("
").addClass("jackbox-thumb-panel").css("height", thumbnailHeight);
thumbRight=$("
").addClass("jackbox-thumb-right");
thumbLeft=$("
").addClass("jackbox-thumb-left");
frag.appendChild(thumbPanel[0]);
frag.appendChild(thumbRight[0]);
frag.appendChild(thumbLeft[0]);
thumbPanel[0].cjThumbs=true;
thumbHolder[0].appendChild(frag);
thumbStrip=$("
").addClass("jackbox-thumb-strip").appendTo(thumbPanel);
thumbLeft.css("top", halfHeight);
thumbRight.css("top", halfHeight);
}
function loadThumbs(){
var cur=list[catOn],
ar=[],
i=leg,
titles,
holds,
$this,
frag,
imgs,
img,
ww,
hh,
pc;
thumbsChecked=true;
while(i--){
$this=cur[i];
if($this.attr("data-thumbnail")){
ar[i]=false;
continue;
}
imgs=$this.children("img");
if(imgs.length){
$this.attr("data-thumbnail", imgs.attr("src"));
ar[i]=imgs;
}
else if($this.data("type")==="image"){
$this.attr("data-thumbnail", $this.attr("href")||$this.attr("data-href"));
ar[i]=false;
}else{
$this.attr("data-thumbnail", defaultThumb);
ar[i]=false;
}}
thumbs=[];
if(!thumbHolder) ripThumbs();
frag=doc.createDocumentFragment();
for(i=0; i < leg; i++){
holds=thumbs[i]=$("
").data("id", i).addClass("jackbox-thumb").css({
width: thumbnailWidth,
height: thumbnailHeight,
left: thmWidth * i
}).on("click.jackbox", thumbClick);
if(useTips){
titles=currentCat[i].attr("data-thumbTooltip")||currentCat[i].attr("data-title");
if(titles) holds.data("theTitle", titles).on("mouseenter.jackbox", overThumb).on("mouseleave.jackbox", outThumb);
}
frag.appendChild(holds[0]);
img=$("
").addClass("jb-thumb").one("load.jackbox", thumbLoaded).appendTo(holds);
holds.data("theThumb", img);
if(ar[i]){
ww=ar[i].attr("width")||ar[i].width();
hh=ar[i].attr("height")||ar[i].height();
}else{
ww=thumbnailWidth;
hh=thumbnailHeight;
}
if(ww > thumbnailWidth&&hh > thumbnailHeight){
pc=ww > hh ? thumbnailWidth / ww:thumbnailHeight / hh;
ww *=pc;
hh *=pc;
if(hh < thumbnailHeight){
var dif=(thumbnailHeight - hh) / thumbnailHeight;
ww +=ww * dif;
hh +=hh * dif;
}
if(ww < thumbnailWidth){
var difs=(thumbnailWidth - ww) / thumbnailWidth;
ww +=ww * difs;
hh +=hh * difs;
}
if(ww!==(ww | 0)) ww=(ww + 1) | 0;
if(hh!==(hh | 0)) hh=(hh + 1) | 0;
}
img.attr({width: ww, height: hh, src: cur[i].attr("data-thumbnail")});
}
thumbStrip[0].appendChild(frag);
totalThumbs=thumbs.length;
stripWidth=thmWidth * i;
hasThumbs=true;
thumbOn=0;
thumbHolder.on("click.jackbox", preventDefault).show();
posThumbs();
if(!showHide) return;
if(!thumbsStartHidden){
showThumbs.hide();
hideThumbs.show();
thumbHolder.css("bottom", 0);
}else{
hideThumbs.hide();
showThumbs.show();
thumbHolder.css("bottom", thumbVis);
}
showHide.on("click.jackbox", toggleThumbs);
}
function thumbEnter(){
thumbPanel.data("offLeft", thumbPanel.offset().left);
}
function outThumb(){
thumbTip.css({opacity: 0, visibility: "hidden"});
}
function thumbArrowNext(event){
if(typeof event==="object") event.stopPropagation();
if(thumbOn < leg - numThumbs){
thumbOn++;
checkArrows(false, true);
}}
function thumbArrowPrev(event){
if(typeof event==="object") event.stopPropagation();
if(thumbOn > 0){
thumbOn--;
checkArrows(false, true);
}}
function thumbLoaded(event){
event.stopPropagation();
var $this=$(this).parent();
$this.addClass("jb-thumb-fadein");
if(!touch) $this.addClass("jb-thumb-hover");
if($this.data("id")===isOn) $this.addClass("jb-thumb-active");
}
function thumbClick(event){
event.stopPropagation();
if(isLoading) return false;
var $this=$(this), id=$this.data("id");
if(id===isOn) return;
if(hasThumbs) thumbs[isOn].removeClass("jb-thumb-active");
isOn=id;
fromThumb=true;
runItem(catOn, isOn);
}
function addEvents(){
eventsAdded=true;
if(hasFullscreen) fullNormal.on("click.jackbox", toggleFull);
if(closeBtn) closeBtn.one("click.jackbox", closer);
if(info) info.on("click.jackbox", toggleInfo);
if(!legged) return;
if(goRight) goRight.on("click.jackbox", nextItem);
if(goLeft) goLeft.on("click.jackbox", previousItem);
if(useTips&&thumbPanel) thumbPanel.on("mouseenter.jackbox", thumbEnter);
if(touch&&description){
description[0].addEventListener("touchstart", stopProp, false);
description[0].addEventListener("touchmove", stopProp, false);
description[0].addEventListener("touchend", stopProp, false);
}}
function toggleFull(){
if(!isFullscreen){
win.off(".jackbox");
isFullscreen=true;
if(doc.mozFullScreenEnabled){
doc.addEventListener("mozfullscreenchange", fsChange, false);
cover[0].mozRequestFullScreen();
}
else if(cover[0].webkitRequestFullScreen){
doc.addEventListener("webkitfullscreenchange", fsChange, false);
cover[0].webkitRequestFullScreen();
}}else{
exitFull();
}}
function fsChange(){
if(doc.webkitIsFullScreen||doc.mozFullScreen){
sizer();
}else{
exitFull(true);
}}
function nativeExit(event){
doc.removeEventListener(event.type, nativeExit, false);
sizer();
win.on("resize.jackbox", resized);
}
function exitFull(fromNative){
isFullscreen=false;
if(doc.mozFullScreenEnabled){
doc.removeEventListener("mozfullscreenchange", fsChange, false);
if(fromNative){
sizer();
win.on("resize.jackbox", resized);
}else{
doc.addEventListener("mozfullscreenchange", nativeExit, false);
doc.mozCancelFullScreen();
}}
else if(cover[0].webkitRequestFullScreen){
doc.removeEventListener("webkitfullscreenchange", fsChange, false);
if(fromNative){
sizer();
win.on("resize.jackbox", resized);
}else{
doc.addEventListener("webkitfullscreenchange", nativeExit, false);
doc.webkitCancelFullScreen();
}}
}
function writeSize(){
isImage=false;
oWidth=$this.attr("data-width") ? parseInt($this.attr("data-width"), 10):defaultVideoWidth;
oHeight=$this.attr("data-height") ? parseInt($this.attr("data-height"), 10):defaultVideoHeight;
upsize=$this.attr("data-scaleUp")==="true";
setSize();
}
function setSize(){
bufferW=oWidth + paddingWide + panelBuffer + boxBuffer;
bufferH=oHeight + boxed;
sizer("true");
}
function killActive(){
clearTimeout(timer);
Jacked.stopTween(holder[0]);
win.off(".jackbox");
if(touch) doc.removeEventListener("touchmove", returnFalse, false);
if(content){
Jacked.stopTween(content[0]);
content.remove();
content=null;
}
if(socialFrame){
socialFrame.remove();
socialFrame=null;
}
if(topContent){
Jacked.stopTween(topContent[0], true);
topContent.hide();
}
if(bottomContent){
Jacked.stopTween(bottomContent[0], true);
bottomContent.hide();
}
if(!info) return;
info.removeClass("jb-info-inactive");
Jacked.stopTween(descHolder[0]);
descHolder.empty().hide();
}
function closer(event){
event.stopPropagation();
(deepLinking) ? $.address.value(""):closing();
}
function killThumbs(){
Jacked.stopTween(thumbHolder[0]);
thumbHolder.off(".jackbox").hide();
var thumber;
while(thumbs.length){
thumber=thumbs[0];
Jacked.stopTween(thumber[0]);
thumber.remove();
thumbs.shift();
}
thumbLeft.off(".jackbox").hide();
thumbRight.off(".jackbox").hide();
if(touch) thumbPanel.cjSwipe("unbindSwipe");
Jacked.stopTween(thumbStrip[0]);
thumbStrip.empty().css("margin-left", 0);
if(showHide){
showHide.off(".jackbox");
if(showHide){
showThumbs.hide();
hideThumbs.show();
}}
hasThumbs=thumbs=null;
}
function closing(){
clearTimeout(runTime);
killActive();
cover.unbind(".jackbox");
if(keyboard) docs.off("keydown.jackbox_keyboard");
if(legged){
if(keyboard) docs.off("keydown.jackbox");
if(goLeft) goLeft.off(".jackbox");
if(goRight) goRight.off(".jackbox");
if(useTips&&thumbPanel) thumbPanel.off(".jackbox");
Jacked.stopTween(panelRight[0], true);
Jacked.stopTween(panelLeft[0], true);
var style={opacity: 0, visibility: "hidden"};
panelRight.off(".jackbox").css(style);
panelLeft.off(".jackbox").css(style);
}else{
if(controls) controls.show();
if(showHide) showHide.show();
}
wrapper.hide().off(".jackbox");
preloader.removeClass("jackbox-spin-preloader");
if(typeof words!=="undefined"){
if(words.data("links")) words.data("links").off(".jackbox");
words.empty();
}
if(hasFullscreen) fullNormal.off(".jackbox");
if(closeBtn) closeBtn.unbind(".jackbox");
if(info) info.off(".jackbox");
if(hasThumbs) killThumbs();
if(!showScroll) parents.each(removeOverflow);
Jacked.fadeOut(cover[0], {duration: 1000, callback: onFaded});
holder.css({marginLeft: holOrigLeft, marginTop: holOrigTop});
if(touch){
removeTouches();
doc.removeEventListener("touchmove", returnFalse, false);
}
setTimeout(scrollback, 10);
if(description){
description.css("visibility", "hidden");
if(touch){
description[0].removeEventListener("touchstart", stopProp, false);
description[0].removeEventListener("touchmove", stopProp, false);
description[0].removeEventListener("touchend", stopProp, false);
}}
$this=isActive=isFullscreen=fromThumb=firstCheck=eventsAdded=arrowClicked=thumbsChecked=oldWidth=null;
}
function scrollback(){
if(scrollPos!==0){
if(!showScroll&&!touch){
scroller.animate({scrollTop: scrollPos}, {duration: 300, queue: false});
}else{
scroller.scrollTop(scrollPos);
}}
}
function onFaded(){
cover.detach();
}
function catchSwipe(left){
(!left) ? nextItem():previousItem();
}
function returnFalse(event){
event.preventDefault();
}
function createElements(){
elements=true;
total=$(".jb-total");
info=$(".jackbox-info");
divider=$(".jb-divider");
current=$(".jb-current");
closeBtn=$(".jackbox-close");
title=$(".jackbox-title-text");
words=$(".jackbox-title-txt");
controls=$(".jackbox-controls");
goLeft=$(".jackbox-arrow-left");
lightSocial=$(".jackbox-social");
goRight=$(".jackbox-arrow-right");
showHide=$(".jackbox-button-thumbs");
showThumbs=$(".jackbox-show-thumbs");
hideThumbs=$(".jackbox-hide-thumbs");
if(!words.length) words=null;
if(!title.length) title=null;
if(!goLeft.length) goLeft=null;
if(!divider.length) divider=null;
if(!goRight.length) goRight=null;
if(!controls.length) controls=null;
if(!closeBtn.length) closeBtn=null;
if(!lightSocial.length) lightSocial=null;
if(!current.length||!total.length) current=null;
if(hasFullscreen){
$(".jackbox-ns").hide();
if(!fullNormal.length) fullNormal=hasFullscreen=null;
}
else if(fullNormal){
fullNormal.hide();
}
if(useThumbs){
if(showHide.length&&showThumbs.length&&hideThumbs.length){
showThumbs.hide();
}else{
showHide=showThumbs=hideThumbs=null;
}}else{
showHide.hide();
showHide=showThumbs=hideThumbs=null;
}
if(info.length){
description=$("
").addClass("jackbox-info-text").appendTo(container).css("visibility", "hidden");
descHolder=$("
").addClass("jackbox-description-text").appendTo(description);
}else{
info=null;
}
if(!useTips) return;
thumbTip=$("
").addClass("jackbox-thumb-tip").css("bottom", thumbnailHeight);
thumbTipText=$("
").addClass("jackbox-thumb-tip-text").text("render me").appendTo(thumbTip);
thumbTip.appendTo(cover);
thumbTipBuf=(parseInt(thumbTip.css("padding-left"), 10) << 1) - (thumbnailMargin << 1);
}
function jsonLoaded(data, response){
if(isActive||response.toLowerCase()!=="success"||!data) return;
var i=data.length, base=document.URL;
base=base.substring(0, base.lastIndexOf("/"));
while(i--){
$("
").attr("src", baseName + "/" + data[i].split("../").join(""));
}}
function getVimeoThumb($video, url){
$.getJSON("http://vimeo.com/api/v2/video/" + url.split("http://vimeo.com/")[1] + ".json?callback=?", {format: "json"}, function(data){
$video.attr("data-thumbnail", data[0].thumbnail_small);
});
}
function drawBlur(){
var $this=$(this), img=$this.next("img"), newImg, href=img.attr("src");
if(!img.length) return;
newImg=$("
").attr({
width: img.attr("width"),
height: img.attr("height")
}).data("parent", $this).one("load.jackbox", blurThumbLoaded).insertAfter(img);
img.remove();
newImg.attr("src", href);
}
function blurThumbLoaded(){
var img=$(this),
$this=img.data("parent"),
width=parseInt($this.css("width"), 10)||$this.width(),
height=parseInt($this.css("height"), 10)||$this.height(),
canvas=$("
").addClass("jackbox-canvas-blur").attr({
width: width,
height: height
}).insertBefore($this),
now=Date.now(),
imgId=now + 1,
canvasId=now + 2;
img.attr("id", imgId);
canvas.attr("id", canvasId);
StackBlurImage(imgId, canvasId, 29);
}
function addTip(){
var $this=$(this);
$this.parent().data({
tip: $this,
tipWidth: $this.width() - 27,
tipHeight: $this.height() + 17
}).on("mouseenter.jackbox", overTip).on("mouseleave.jackbox", outTip);
}
function overTip(){
var $this=$(this), off=$this.offset(), data=$this.data();
data.tipX=off.left,
data.tipY=off.top,
data.tip.css({opacity: 1, visibility: "visible"});
$this.on("mousemove.jackbox", moveTip);
}
function outTip(){
var $this=$(this).off("mousemove.jackbox");
if(!isIE8){
$this.data("tip").css({opacity: 0, visibility: "hidden"});
}else{
$this.data("tip").css("opacity", 0);
}}
function checkImage(st){
return st==="jpg"||st==="png"||st==="jpeg"||st==="gif";
}
function checkVideo(st, popped){
if(st.search("youtube.com")!==-1){
return "youtube";
}
else if(st.search("vimeo.com")!==-1){
return "vimeo";
}
else if(popped==="mp4"){
return "local";
}else{
return false;
}}
function stopProp(event){
event.stopImmediatePropagation();
}
function preventDefault(event){
if(!$(event.target).is("a")){
event.stopPropagation();
event.preventDefault();
}}
})(jQuery);
function jackboxFrameReady(){
jQuery.fn.jackBox("frameReady");
};
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):window.jQuery||window.Zepto)}(function(a){var b,c,d,e,f,g,h="Close",i="BeforeClose",j="AfterClose",k="BeforeAppend",l="MarkupParse",m="Open",n="Change",o="mfp",p="."+o,q="mfp-ready",r="mfp-removing",s="mfp-prevent-close",t=function(){},u=!!window.jQuery,v=a(window),w=function(a,c){b.ev.on(o+a+p,c)},x=function(b,c,d,e){var f=document.createElement("div");return f.className="mfp-"+b,d&&(f.innerHTML=d),e?c&&c.appendChild(f):(f=a(f),c&&f.appendTo(c)),f},y=function(c,d){b.ev.triggerHandler(o+c,d),b.st.callbacks&&(c=c.charAt(0).toLowerCase()+c.slice(1),b.st.callbacks[c]&&b.st.callbacks[c].apply(b,a.isArray(d)?d:[d]))},z=function(c){return c===g&&b.currTemplate.closeBtn||(b.currTemplate.closeBtn=a(b.st.closeMarkup.replace("%title%",b.st.tClose)),g=c),b.currTemplate.closeBtn},A=function(){a.magnificPopup.instance||(b=new t,b.init(),a.magnificPopup.instance=b)},B=function(){var a=document.createElement("p").style,b=["ms","O","Moz","Webkit"];if(void 0!==a.transition)return!0;for(;b.length;)if(b.pop()+"Transition"in a)return!0;return!1};t.prototype={constructor:t,init:function(){var c=navigator.appVersion;b.isIE7=-1!==c.indexOf("MSIE 7."),b.isIE8=-1!==c.indexOf("MSIE 8."),b.isLowIE=b.isIE7||b.isIE8,b.isAndroid=/android/gi.test(c),b.isIOS=/iphone|ipad|ipod/gi.test(c),b.supportsTransition=B(),b.probablyMobile=b.isAndroid||b.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent),d=a(document),b.popupsCache={}},open:function(c){var e;if(c.isObj===!1){b.items=c.items.toArray(),b.index=0;var g,h=c.items;for(e=0;e
(a||v.height())},_setFocus:function(){(b.st.focus?b.content.find(b.st.focus).eq(0):b.wrap).focus()},_onFocusIn:function(c){return c.target===b.wrap[0]||a.contains(b.wrap[0],c.target)?void 0:(b._setFocus(),!1)},_parseMarkup:function(b,c,d){var e;d.data&&(c=a.extend(d.data,c)),y(l,[b,c,d]),a.each(c,function(a,c){if(void 0===c||c===!1)return!0;if(e=a.split("_"),e.length>1){var d=b.find(p+"-"+e[0]);if(d.length>0){var f=e[1];"replaceWith"===f?d[0]!==c[0]&&d.replaceWith(c):"img"===f?d.is("img")?d.attr("src",c):d.replaceWith(' '):d.attr(e[1],c)}}else b.find(p+"-"+a).html(c)})},_getScrollbarSize:function(){if(void 0===b.scrollbarSize){var a=document.createElement("div");a.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(a),b.scrollbarSize=a.offsetWidth-a.clientWidth,document.body.removeChild(a)}return b.scrollbarSize}},a.magnificPopup={instance:null,proto:t.prototype,modules:[],open:function(b,c){return A(),b=b?a.extend(!0,{},b):{},b.isObj=!0,b.index=c||0,this.instance.open(b)},close:function(){return a.magnificPopup.instance&&a.magnificPopup.instance.close()},registerModule:function(b,c){c.options&&(a.magnificPopup.defaults[b]=c.options),a.extend(this.proto,c.proto),this.modules.push(b)},defaults:{disableOn:0,key:null,midClick:!1,mainClass:"",preloader:!0,focus:"",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:!0,showCloseBtn:!0,enableEscapeKey:!0,modal:!1,alignTop:!1,removalDelay:0,prependTo:null,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'× ',tClose:"Close (Esc)",tLoading:"Loading..."}},a.fn.magnificPopup=function(c){A();var d=a(this);if("string"==typeof c)if("open"===c){var e,f=u?d.data("magnificPopup"):d[0].magnificPopup,g=parseInt(arguments[1],10)||0;f.items?e=f.items[g]:(e=d,f.delegate&&(e=e.find(f.delegate)),e=e.eq(g)),b._openClick({mfpEl:e},d,f)}else b.isOpen&&b[c].apply(b,Array.prototype.slice.call(arguments,1));else c=a.extend(!0,{},c),u?d.data("magnificPopup",c):d[0].magnificPopup=c,b.addGroup(d,c);return d};var C,D,E,F="inline",G=function(){E&&(D.after(E.addClass(C)).detach(),E=null)};a.magnificPopup.registerModule(F,{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){b.types.push(F),w(h+"."+F,function(){G()})},getInline:function(c,d){if(G(),c.src){var e=b.st.inline,f=a(c.src);if(f.length){var g=f[0].parentNode;g&&g.tagName&&(D||(C=e.hiddenClass,D=x(C),C="mfp-"+C),E=f.after(D).detach().removeClass(C)),b.updateStatus("ready")}else b.updateStatus("error",e.tNotFound),f=a("");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",g=Boolean(a.fn.mfpFastClick);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),h=g?"mfpFastClick":"click";e[h](function(){b.prev()}),f[h](function(){b.next()}),b.isIE7&&(x("b",e[0],!1,!0),x("a",e[0],!1,!0),x("b",f[0],!1,!0),x("a",f[0],!1,!0)),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.arrowLeft&&g&&b.arrowLeft.add(b.arrowRight).destroyMfpFastClick(),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)}))}}}}),function(){var b=1e3,c="ontouchstart"in window,d=function(){v.off("touchmove"+f+" touchend"+f)},e="mfpFastClick",f="."+e;a.fn.mfpFastClick=function(e){return a(this).each(function(){var g,h=a(this);if(c){var i,j,k,l,m,n;h.on("touchstart"+f,function(a){l=!1,n=1,m=a.originalEvent?a.originalEvent.touches[0]:a.touches[0],j=m.clientX,k=m.clientY,v.on("touchmove"+f,function(a){m=a.originalEvent?a.originalEvent.touches:a.touches,n=m.length,m=m[0],(Math.abs(m.clientX-j)>10||Math.abs(m.clientY-k)>10)&&(l=!0,d())}).on("touchend"+f,function(a){d(),l||n>1||(g=!0,a.preventDefault(),clearTimeout(i),i=setTimeout(function(){g=!1},b),e())})})}h.on("click"+f,function(){g||e()})})},a.fn.destroyMfpFastClick=function(){a(this).off("touchstart"+f+" click"+f),c&&v.off("touchmove"+f+" touchend"+f)}}(),A()});
;(function(b){var a={init:function(c){return this.each(function(){a.destroy.call(this);this.opt=b.extend(true,{},b.fn.raty.defaults,c);var e=b(this),g=["number","readOnly","score","scoreName"];a._callback.call(this,g);if(this.opt.precision){a._adjustPrecision.call(this);}this.opt.number=a._between(this.opt.number,0,this.opt.numberMax);this.opt.path=this.opt.path||"";if(this.opt.path&&this.opt.path.slice(this.opt.path.length-1,this.opt.path.length)!=="/"){this.opt.path+="/";}this.stars=a._createStars.call(this);this.score=a._createScore.call(this);a._apply.call(this,this.opt.score);var f=this.opt.space?4:0,d=this.opt.width||(this.opt.number*this.opt.size+this.opt.number*f);if(this.opt.cancel){this.cancel=a._createCancel.call(this);d+=(this.opt.size+f);}if(this.opt.readOnly){a._lock.call(this);}else{e.css("cursor","pointer");a._binds.call(this);}if(this.opt.width!==false){e.css("width",d);}a._target.call(this,this.opt.score);e.data({settings:this.opt,raty:true});});},_adjustPrecision:function(){this.opt.targetType="score";this.opt.half=true;},_apply:function(c){if(c&&c>0){c=a._between(c,0,this.opt.number);this.score.val(c);}a._fill.call(this,c);if(c){a._roundStars.call(this,c);}},_between:function(e,d,c){return Math.min(Math.max(parseFloat(e),d),c);},_binds:function(){if(this.cancel){a._bindCancel.call(this);}a._bindClick.call(this);a._bindOut.call(this);a._bindOver.call(this);},_bindCancel:function(){a._bindClickCancel.call(this);a._bindOutCancel.call(this);a._bindOverCancel.call(this);},_bindClick:function(){var c=this,d=b(c);c.stars.on("click.raty",function(e){c.score.val((c.opt.half||c.opt.precision)?d.data("score"):this.alt);if(c.opt.click){c.opt.click.call(c,parseFloat(c.score.val()),e);}});},_bindClickCancel:function(){var c=this;c.cancel.on("click.raty",function(d){c.score.removeAttr("value");if(c.opt.click){c.opt.click.call(c,null,d);}});},_bindOut:function(){var c=this;b(this).on("mouseleave.raty",function(d){var e=parseFloat(c.score.val())||undefined;a._apply.call(c,e);a._target.call(c,e,d);if(c.opt.mouseout){c.opt.mouseout.call(c,e,d);}});},_bindOutCancel:function(){var c=this;c.cancel.on("mouseleave.raty",function(d){b(this).attr("src",c.opt.path+c.opt.cancelOff);if(c.opt.mouseout){c.opt.mouseout.call(c,c.score.val()||null,d);}});},_bindOverCancel:function(){var c=this;c.cancel.on("mouseover.raty",function(d){b(this).attr("src",c.opt.path+c.opt.cancelOn);c.stars.attr("src",c.opt.path+c.opt.starOff);a._target.call(c,null,d);if(c.opt.mouseover){c.opt.mouseover.call(c,null);}});},_bindOver:function(){var c=this,d=b(c),e=c.opt.half?"mousemove.raty":"mouseover.raty";c.stars.on(e,function(g){var h=parseInt(this.alt,10);if(c.opt.half){var f=parseFloat((g.pageX-b(this).offset().left)/c.opt.size),j=(f>0.5)?1:0.5;h=h-1+j;a._fill.call(c,h);if(c.opt.precision){h=h-j+f;}a._roundStars.call(c,h);d.data("score",h);}else{a._fill.call(c,h);}a._target.call(c,h,g);if(c.opt.mouseover){c.opt.mouseover.call(c,h,g);}});},_callback:function(c){for(i in c){if(typeof this.opt[c[i]]==="function"){this.opt[c[i]]=this.opt[c[i]].call(this);}}},_createCancel:function(){var e=b(this),c=this.opt.path+this.opt.cancelOff,d=b("
",{src:c,alt:"x",title:this.opt.cancelHint,"class":"raty-cancel"});if(this.opt.cancelPlace=="left"){e.prepend(" ").prepend(d);}else{e.append(" ").append(d);}return d;},_createScore:function(){return b("
",{type:"hidden",name:this.opt.scoreName}).appendTo(this);},_createStars:function(){var e=b(this);for(var c=1;c<=this.opt.number;c++){var f=a._getHint.call(this,c),d=(this.opt.score&&this.opt.score>=c)?"starOn":"starOff";d=this.opt.path+this.opt[d];b("
",{src:d,alt:c,title:f}).appendTo(this);if(this.opt.space){e.append((c
e){var j=m.opt.iconRange[e],h=j.on||m.opt.starOn,c=j.off||m.opt.starOff,k=l?h:c;if(f<=j.range){g.attr("src",m.opt.path+k);}if(f==j.range){e++;}}else{var k=l?"starOn":"starOff";g.attr("src",this.opt.path+this.opt[k]);}}},_getHint:function(d){var c=this.opt.hints[d-1];return(c==="")?"":(c||d);},_lock:function(){var d=parseInt(this.score.val(),10),c=d?a._getHint.call(this,d):this.opt.noRatedMsg;b(this).data("readonly",true).css("cursor","").attr("title",c);this.score.attr("readonly","readonly");this.stars.attr("title",c);if(this.cancel){this.cancel.hide();}},_roundStars:function(e){var d=(e-Math.floor(e)).toFixed(2);if(d>this.opt.round.down){var c="starOn";if(this.opt.halfShow&&d1)?d:d[0];},readOnly:function(c){return this.each(function(){var d=b(this);if(d.data("readonly")!==c){if(c){d.off(".raty").children("img").off(".raty");a._lock.call(this);}else{a._binds.call(this);a._unlock.call(this);}d.data("readonly",c);}});},reload:function(){return a.set.call(this,{});},score:function(){return arguments.length?a.setScore.apply(this,arguments):a.getScore.call(this);},set:function(c){return this.each(function(){var e=b(this),f=e.data("settings"),d=b.extend({},f,c);e.raty(d);});},setScore:function(c){return b(this).each(function(){if(b(this).data("readonly")!==true){a._apply.call(this,c);a._target.call(this,c);}});}};b.fn.raty=function(c){if(a[c]){return a[c].apply(this,Array.prototype.slice.call(arguments,1));}else{if(typeof c==="object"||!c){return a.init.apply(this,arguments);}else{b.error("Method "+c+" does not exist!");}}};b.fn.raty.defaults={cancel:false,cancelHint:"Cancel this rating!",cancelOff:"cancel-off.png",cancelOn:"cancel-on.png",cancelPlace:"left",click:undefined,half:false,halfShow:true,hints:["bad","poor","regular","good","gorgeous"],iconRange:undefined,mouseout:undefined,mouseover:undefined,noRatedMsg:"Not rated yet!",number:5,numberMax:20,path:"",precision:false,readOnly:false,round:{down:0.25,full:0.6,up:0.76},score:undefined,scoreName:"score",single:false,size:16,space:true,starHalf:"star-half.png",starOff:"star-off.png",starOn:"star-on.png",target:undefined,targetFormat:"{score}",targetKeep:false,targetText:"",targetType:"hint",width:undefined};})(jQuery);
;(function($, window, document, undefined){
var pluginName="heapbox",
defaults={
effect: {
"type": "slide",
"speed": "slow"
},
insert: "before",
heapsize: undefined,
emptyMessage: 'Empty',
tabindex: 'undefined',
title: undefined,
showFirst: true,
inheritVisibility: true,
openStart: function(){},
openComplete: function(){},
closeStart: function(){},
closeComplete: function(){},
onChange: function(){}};
function Plugin(element, options){
this.element=element;
this.options=$.extend({}, defaults, options);
this._defaults=defaults;
this._name=pluginName;
this.instance;
this.callbackManager=new Array();
this.elem_isVisible='';
this.init();
}
Plugin.prototype={
init: function(){
this._hideSourceElement();
this._isSourceSelectbox();
this.instance=this.createInstance();
this._createElements();
this._setDefaultValues();
},
createInstance: function(){
return {
heapId: $(this.element).attr('id')||Math.round(Math.random() * 99999999),
state: false
};},
_setEvents: function(){
var self=this;
this._setControlsEvents();
$(document).on("click", "html", function(e){ e.stopPropagation();self._closeheap(true,function(){},function(){});});
},
_setSliderEvents: function(){
var self=this;
this.scrollingStatus=false;
heap=$("#heapbox_"+this.instance.heapId+" .heap");
heap.find(".sliderDown").click(function(e){e.preventDefault();e.stopPropagation();self._setHeapboxFocus();});
heap.find(".sliderDown").mousedown(function(e){
self.scrollingStatus=true;
self._keyArrowHandler($("#heapbox_"+self.instance.heapId),"down");
self.interval=setInterval(function(){self._keyArrowHandler($("#heapbox_"+self.instance.heapId),"down");},300);
}).mouseup(function(e){
clearInterval(self.interval);
self.scrollingStatus=false;
}).mouseout(function(e){
clearInterval(self.interval);
self.scrollingStatus=false;
});
heap.find(".sliderUp").click(function(e){e.preventDefault();e.stopPropagation();self._setHeapboxFocus();});
heap.find(".sliderUp").mousedown(function(e){
self.scrollingStatus=true;
self._keyArrowHandler($("#heapbox_"+self.instance.heapId),"up");
self.interval=setInterval(function(){self._keyArrowHandler($("#heapbox_"+self.instance.heapId),"up");},300);
}).mouseup(function(e){
clearInterval(self.interval);
self.scrollingStatus=false;
}).mouseout(function(e){
clearInterval(self.interval);
self.scrollingStatus=false;
});
},
_setViewPosition: function(heapbox){
heap=$("div#heapbox_"+this.instance.heapId+" .heap");
heap.show();
var self=this;
selected=heapbox.find(".heapOptions li a.selected");
firstTop=heapbox.find(".heapOptions li a").first().offset().top;
actTop=$(selected).offset().top;
newTop=firstTop - actTop + this.sliderUpHeight;
heapHeight=$("div#heapbox_"+this.instance.heapId+" .heapOptions").height();
maxPosition=heapHeight-parseInt(this.options.heapsize,10)+this.sliderDownHeight;
minPosition=0+this.sliderUpHeight;
if((-1*newTop) > maxPosition) newTop=-1*(maxPosition);
heapbox.find(".heapOptions").css("top",newTop);
if(!this.instance.state) heap.hide();
},
_setKeyboardEvents: function(){
var self=this;
heapbox=$("#heapbox_"+this.instance.heapId);
heapbox.keydown(function(e){
switch(e.which){
case 13: self._handlerClicked();
return false;
break;
case 27: self._closeheap();
break;
case 37: self._keyArrowHandler($("#heapbox_"+self.instance.heapId),"up");
e.preventDefault();
break;
case 39: self._keyArrowHandler($("#heapbox_"+self.instance.heapId),"down");
e.preventDefault();
break;
case 38: self._keyArrowHandler($("#heapbox_"+self.instance.heapId),"up");
e.preventDefault();
break;
case 40: self._keyArrowHandler($("#heapbox_"+self.instance.heapId),"down");
e.preventDefault();
break;
}});
},
_setMouseWheelEvents:function(){
var self=this,
heapBoxEl=$("div#heapbox_"+this.instance.heapId+" .handler"),
heap=heapBoxEl.find('div.heap');
heapBoxEl.on('mousewheel',function(event,delta){
event.preventDefault();
if(delta==-1){
heap.find(".sliderDown")
.mousedown()
.mouseup();
}else{
heap.find(".sliderUp")
.mousedown()
.mouseup();
}});
},
_keyArrowHandler:function(heapboxEl,direction){
var self=this;
var selected=false;
heapboxEl.find("div.heap ul li").each(function(){
if(($(this).find("a").hasClass("selected"))){
selected=true;
selectItem=direction=="down" ? self._findNext($(this)):self._findPrev($(this));
if(selectItem){
self._heapChanged(self,selectItem,true);
return false;
}}
});
if(selected==false){
selectItem=$("div#heapbox_"+self.instance.heapId+" .heapOptions .heapOption").first().find("a").addClass("selected");
self._heapChanged(self,selectItem,true);
}
self._setViewPosition($("#heapbox_"+self.instance.heapId));
},
_setMouseWheelEvents: function(){
var self=this,
heapBoxEl=$("div#heapbox_"+this.instance.heapId),
heap=heapBoxEl.find('div.heap');
heapBoxEl.on('mousewheel',function(event,delta){
event.preventDefault();
if(delta==-1){
heap.find(".sliderDown")
.mousedown()
.mouseup();
}else{
heap.find(".sliderUp")
.mousedown()
.mouseup();
}});
},
_findPrev:function(startItem){
if(startItem.prev().length > 0){
if(!startItem.prev().find("a").hasClass("disabled")){
return startItem.prev().find("a");
}else{
return this._findPrev(startItem.prev());
}}
},
_findNext:function(startItem){
if(startItem.next().length > 0){
if(!startItem.next().find("a").hasClass("disabled")){
return startItem.next().find("a");
}else{
return this._findNext(startItem.next());
}}
},
_createElements: function(){
var self=this;
heapBoxEl=$('
', {
id: 'heapbox_'+this.instance.heapId,
'class': 'heapBox',
data: {'sourceElement':this.element}});
heapBoxHolderEl=$(' ', {
href: '',
'class': 'holder'
});
heapBoxHandlerEl=$(' ', {
href: '',
'class': 'handler'
});
heapBoxheapEl=$('
', {
'class': 'heap'
});
heapBoxEl.append(heapBoxHolderEl);
heapBoxEl.append(heapBoxHandlerEl);
heapBoxEl.append(heapBoxheapEl);
this.heapBoxEl=heapBoxEl;
this._insertHeapbox(this.heapBoxEl);
},
_insertHeapbox: function(heapbox){
if(this.isSourceElementSelect&&this.options.insert=="inside")
this.options.insert="before";
switch(this.options.insert){
case "before":
$(this.element).before(heapbox);
break;
case "after":
$(this.element).after(heapbox);
break;
case "inside":
$(this.element).html(heapbox);
this._showSourceElement();
break;
default:
$(this.element).before(heapbox);
break;
}},
_setDefaultValues: function(){
this._initHeap();
this._initView(heapBoxEl);
this._setHolderTitle();
this._setTabindex();
this._setEvents();
this._handleFirst();
},
_setHeapboxFocus: function(){
heapbox=$("div#heapbox_"+this.instance.heapId+" .handler");
heapbox.focus();
},
_setHeapSize: function(){
if(this.options.heapsize){
heapBoxheapEl.css("height",this.options.heapsize);
}},
_initHeap: function(){
var initData;
if(this.isSourceElementSelect){
initData=this._optionsToJson();
this._setData(initData);
}},
_initView: function(heapbox){
if(this._isHeapEmpty()){
return;
}else{
this._setViewPosition(heapbox);
}},
_handleFirst: function(){
if(!this.options.showFirst){
$("div#heapbox_"+this.instance.heapId+" .heapOptions .heapOption").first().remove();
}},
_setHolderTitle: function(){
var self=this;
holderEl=$("#heapbox_"+this.instance.heapId).find(".holder");
selectedEl=$("#heapbox_"+this.instance.heapId).find(".heap ul li a.selected").last();
if(selectedEl.length!=0){
if(this.options.title){
holderEl.text(this.options.title);
}else{
holderEl.text(selectedEl.text());
}
holderEl.attr("rel",selectedEl.attr("rel"));
if(selectedEl.attr("data-icon-src")){
iconEl=this._createIconElement(selectedEl.attr("data-icon-src"));
holderEl.append(iconEl);
}}else{
holderEl.text(this.options.emptyMessage);
this._removeHeapboxHolderEvents();
this._removeHeapboxHandlerEvents();
}},
_setTabindex: function(){
var tabindex;
tabindex=this.options.tabindex!="undefined" ? this.options.tabindex:$(this.element).attr("tabindex");
if(tabindex!="undefined"){
$("#heapbox_"+this.instance.heapId).attr("tabindex",tabindex);
}},
_setData: function(data){
var self=this;
var _data=jQuery.parseJSON(data);
var selected=false;
heapBoxheapOptionsEl=$('', {
'class': 'heapOptions'
});
$.each(_data,function(){
if(this.selected){ selected=true; }
heapBoxOptionLiEl=$(' ', {
'class': 'heapOption'
});
heapBoxheapOptionAEl=$(' ', {
href: '',
rel: this.value,
title: this.text,
text: this.text,
'class': this.selected ? 'selected':'',
click: function(e){
e.preventDefault();
e.stopPropagation();
self._heapChanged(self,this);
}});
if(this.disabled){
heapBoxheapOptionAEl.unbind("click");
heapBoxheapOptionAEl.addClass("disabled");
heapBoxheapOptionAEl.click(function(e){
e.preventDefault();
e.stopPropagation();
});
}
if(this.icon){
heapBoxheapOptionAEl.attr('data-icon-src',this.icon);
heapBoxOptionIcon=self._createIconElement(this.icon);
heapBoxheapOptionAEl.append(heapBoxOptionIcon);
}
heapBoxOptionLiEl.append(heapBoxheapOptionAEl);
heapBoxheapOptionsEl.append(heapBoxOptionLiEl);
});
$("div#heapbox_"+this.instance.heapId+" .heap ul").remove();
$("div#heapbox_"+this.instance.heapId+" .heap").append(heapBoxheapOptionsEl);
this._setHeapSize();
if(this._isHeapsizeSet()){
this._createSliderUpElement();
this._createSliderDownElement();
}
if(selected!=true){
$("div#heapbox_"+this.instance.heapId+" .heap ul li a").first().addClass("selected");
}},
_createSliderUpElement: function(){
slideUp=$(' ', {
'class': 'sliderUp',
'href': ''
});
$("div#heapbox_"+this.instance.heapId+" .heap .heapOptions").before(slideUp);
sliderUp=$("#heapbox_"+this.instance.heapId+" .sliderUp");
this.sliderUpHeight=parseInt(sliderUp.css("height"),10)+parseInt(sliderUp.css("border-top-width"),10)+parseInt(sliderUp.css("border-bottom-width"),10);
$("#heapbox_"+this.instance.heapId+" .heapOptions").css("top",this.sliderUpHeight);
},
_createSliderDownElement: function(){
slideDown=$(' ', {
'class': 'sliderDown',
'href': ''
});
$("div#heapbox_"+this.instance.heapId+" .heap .heapOptions").after(slideDown);
sliderDown=$("#heapbox_"+this.instance.heapId+" .sliderDown");
this.sliderDownHeight=parseInt(sliderDown.css("height"),10)+parseInt(sliderDown.css("border-top-width"))+parseInt(sliderDown.css("border-bottom-width"));
},
_createIconElement: function(iconSrc){
heapBoxOptionIcon=$(' ', {
src: iconSrc,
alt: iconSrc
});
return heapBoxOptionIcon;
},
_optionsToJson: function(){
var options=[];
$(this.element).find("option").each(function(){
options.push({
'value':$(this).attr("value"),
'text':$(this).text(),
'icon':$(this).attr("data-icon-src"),
'disabled':$(this).attr("disabled"),
'selected':$(this).is(":selected") ? "selected":''
});
});
var jsonText=JSON.stringify(options);
return jsonText;
},
_heapboxToJson: function(){
var options=[];
$("div#heapbox_"+this.instance.heapId+" .heap ul li a").each(function(){
options.push({
'value': $(this).attr("rel"),
'text': $(this).text(),
'selected': $(this).is(":selected") ? "selected":''
});
});
var jsonText=JSON.stringify(options);
return jsonText;
},
_isHeapEmpty: function(){
var length=$("div#heapbox_"+this.instance.heapId+" .heap ul li").length;
return length==0;
},
_setControlsEvents: function(){
if(!this._isHeapEmpty()){
this._setHeapboxHolderEvents();
this._setHeapboxHandlerEvents();
this._setKeyboardEvents();
this._setSliderEvents();
if(typeof($.event.special.mousewheel)=='object'){
this._setMouseWheelEvents();
}}
},
_isSourceSelectbox: function(){
this.isSourceElementSelect=$(this.element).is("select");
},
_isHeapsizeSet: function(){
return this.options.heapsize ? true:false;
},
_refreshSourceSelectbox: function(data){
var self=this;
var selected=false;
$(this.element).find("option").remove();
$.each(data,function(){
option=$(' ',{
value: this.value,
text: this.text,
});
if(this.selected){
option.attr("selected","selected");
selected=true;
}
$(self.element).append(option);
});
if(selected!=true) $(self.element).find("option").first().attr("selected","selected");
},
_setSelectedOption: function(value){
var self=this;
this._deselectSelectedOptions();
$(this.element).val(value);
$(this.element).find("option[value='"+value+"']").attr("selected","selected");
},
_deselectSelectedOptions: function(){
select=$(this.element).find("option");
select.each(function(){
$(this).removeAttr("selected");
});
},
_setHeapboxHolderEvents: function(){
var self=this;
heapBoxEl=$("div#heapbox_"+this.instance.heapId);
heapBoxEl.find(".holder").click(function(e){
e.preventDefault();
e.stopPropagation();
self._setHeapboxFocus();
self._handlerClicked();
});
},
_setHeapboxHandlerEvents: function(){
var self=this;
heapBoxEl=$("div#heapbox_"+this.instance.heapId);
heapBoxEl.find(".handler").click(function(e){
e.preventDefault();
e.stopPropagation();
self._setHeapboxFocus();
self._handlerClicked();
});
},
_removeHeapboxHolderEvents: function(){
var self=this;
heapBoxEl=$("div#heapbox_"+this.instance.heapId);
heapBoxEl.find(".holder").unbind('click');
heapBoxEl.find(".holder").click(function(e){e.preventDefault();})
heapBoxEl.unbind("keydown");
},
_removeHeapboxHandlerEvents: function(){
var self=this;
heapBoxEl=$("div#heapbox_"+this.instance.heapId);
heapBoxEl.find(".handler").unbind('click');
heapBoxEl.find(".handler").click(function(e){e.preventDefault();})
},
_handlerClicked: function(stageReady){
if(this.instance.state){
this._closeheap();
}else{
if(!stageReady)
this._closeOthers();
else this._openheap();
}},
_heapChanged: function(self,clickedEl,keepOpened){
if(!keepOpened) this._closeheap(true,function(){},function(){});
this._setSelected($(clickedEl));
this._setHolderTitle();
this._setHeapboxFocus();
this._setSelectedOption($(clickedEl).attr("rel"));
this.options.onChange($(clickedEl).attr("rel"), $(this.element));
},
_setSelected: function(selectedEl){
this._deselectAll();
selectedEl.addClass("selected");
},
_deselectAll: function(self){
heapLinks=$("#heapbox_"+this.instance.heapId).find(".heap ul li a");
heapLinks.each(function(){
$(this).removeClass("selected");
});
},
_closeheap: function(internal,closeStartEvent,closeCompleteEvent){
heapEl=$("#heapbox_"+this.instance.heapId).removeClass('open').find(".heap");
if(heapEl.is(":animated")&&!internal) return false;
this.instance.state=false;
if(internal){
closeStartEvent=closeStartEvent;
closeCompleteEvent=closeCompleteEvent;
}else{
closeStartEvent=this.options.closeStart;
closeCompleteEvent=this.options.closeComplete;
}
closeStartEvent.call();
switch(this.options.effect.type){
case "fade":
heapEl.fadeOut(this.options.effect.speed,closeCompleteEvent);
break;
case "slide":
heapEl.slideUp(this.options.effect.speed,closeCompleteEvent);
break;
case "standard":
heapEl.css("display","none");
closeCompleteEvent.call();
break;
default:
heapEl.slideUp(this.options.effect.speed,closeCompleteEvent);
break;
}},
_openheap: function(){
if(this._isHeapsizeSet()){
this._setViewPosition($("div#heapbox_"+this.instance.heapId));
}
heapEl=$("#heapbox_"+this.instance.heapId).addClass('open').find(".heap");
if(heapEl.is(":animated")) return false;
this.instance.state=true;
this.options.openStart.call();
switch(this.options.effect.type){
case "fade":
heapEl.fadeIn(this.options.effect.speed,this.options.openComplete);
break;
case "slide":
heapEl.slideDown(this.options.effect.speed,this.options.openComplete);
break;
case "standard":
heapEl.css("display","block");
this.options.openComplete.call();
break;
default:
heapEl.slideDown(this.options.effect.speed,this.options.openComplete);
break;
}},
_closeOthers: function(){
var self=this;
$('div[id^=heapbox_]').each(function(index){
el=$("div#"+$(this).attr("id"));
if(el.data("sourceElement")){
sourceEl=$.data(this, "sourceElement");
heapBoxInst=$.data(sourceEl, "plugin_" + pluginName);
if(self.instance.heapId!=heapBoxInst.instance.heapId){
if(heapBoxInst.instance.state){
self._callbackManager('change','_closeOthers',true);
heapBoxInst._closeheap(true,function(){},function(){self._callbackManager('change','_closeOthers',false);});
}}
}});
self._callbackManager('test','_closeOthers');
},
_callbackManager: function(type,identificator,state){
if(!this.callbackManager[identificator])
this.callbackManager[identificator]=0;
if(type=="change"){
state ? this.callbackManager[identificator]++:this.callbackManager[identificator]--;
this._callbackManager('test',identificator);
}else if(type=="test"){
if(this.callbackManager[identificator]==0) this._handlerClicked(true);
}},
set: function(data){
this._setData(data);
this._setHolderTitle();
this._setEvents();
},
select: function(value){
heapBoxEl=$("div#heapbox_"+this.instance.heapId);
this._heapChanged(this, heapBoxEl.find('.heapOptions [rel="'+ value +'"]'));
},
update: function(){
this._setDefaultValues();
},
_hideSourceElement: function(){
this.elem_isVisible=$(this.element).is(':visible');
$(this.element).css("display","none");
},
_showSourceElement: function(){
$(this.element).css("display","block");
},
hide: function(){
$("div#heapbox_"+this.instance.heapId).css("visibility","hidden");
},
show: function(){
$("div#heapbox_"+this.instance.heapId).css("visibility","visible");
},
disable: function(){
heapBoxEl=$("div#heapbox_"+this.instance.heapId);
heapBoxEl.addClass("disabled");
this._removeHeapboxHandlerEvents();
this._removeHeapboxHolderEvents();
return this;
},
enable: function(){
heapBoxEl=$("div#heapbox_"+this.instance.heapId);
heapBoxEl.removeClass("disabled");
this._setEvents();
return this;
},
_remove: function(){
heapBoxEl=$("div#heapbox_"+this.instance.heapId);
heapBoxEl.remove();
this._showSourceElement();
}};
$.fn[pluginName]=function(options, optional){
return this.each(function (){
if(!$.data(this, "plugin_" + pluginName)){
$.data(this, "plugin_" + pluginName, new Plugin(this, options));
}else{
heapBoxInst=$.data(this, "plugin_" + pluginName);
switch(options){
case "select":
heapBoxInst.select(optional);
break;
case "update":
heapBoxInst.update();
break;
case "set":
heapBoxInst.set(optional);
break;
case "hide":
heapBoxInst.hide();
break;
case "show":
heapBoxInst.show();
break;
case "disable":
heapBoxInst.disable();
break;
case "enable":
heapBoxInst.enable();
break;
case "remove":
heapBoxInst._remove();
break;
}}
});
};})(jQuery, window, document);
eval(function(p,a,c,k,e,r){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('7(A 3c.3q!=="9"){3c.3q=9(e){9 t(){}t.5S=e;p 5R t}}(9(e,t,n){h r={1N:9(t,n){h r=c;r.$k=e(n);r.6=e.4M({},e.37.2B.6,r.$k.v(),t);r.2A=t;r.4L()},4L:9(){9 r(e){h n,r="";7(A t.6.33==="9"){t.6.33.R(c,[e])}l{1A(n 38 e.d){7(e.d.5M(n)){r+=e.d[n].1K}}t.$k.2y(r)}t.3t()}h t=c,n;7(A t.6.2H==="9"){t.6.2H.R(c,[t.$k])}7(A t.6.2O==="2Y"){n=t.6.2O;e.5K(n,r)}l{t.3t()}},3t:9(){h e=c;e.$k.v("d-4I",e.$k.2x("2w")).v("d-4F",e.$k.2x("H"));e.$k.z({2u:0});e.2t=e.6.q;e.4E();e.5v=0;e.1X=14;e.23()},23:9(){h e=c;7(e.$k.25().N===0){p b}e.1M();e.4C();e.$S=e.$k.25();e.E=e.$S.N;e.4B();e.$G=e.$k.17(".d-1K");e.$K=e.$k.17(".d-1p");e.3u="U";e.13=0;e.26=[0];e.m=0;e.4A();e.4z()},4z:9(){h e=c;e.2V();e.2W();e.4t();e.30();e.4r();e.4q();e.2p();e.4o();7(e.6.2o!==b){e.4n(e.6.2o)}7(e.6.O===j){e.6.O=4Q}e.19();e.$k.17(".d-1p").z("4i","4h");7(!e.$k.2m(":3n")){e.3o()}l{e.$k.z("2u",1)}e.5O=b;e.2l();7(A e.6.3s==="9"){e.6.3s.R(c,[e.$k])}},2l:9(){h e=c;7(e.6.1Z===j){e.1Z()}7(e.6.1B===j){e.1B()}e.4g();7(A e.6.3w==="9"){e.6.3w.R(c,[e.$k])}},3x:9(){h e=c;7(A e.6.3B==="9"){e.6.3B.R(c,[e.$k])}e.3o();e.2V();e.2W();e.4f();e.30();e.2l();7(A e.6.3D==="9"){e.6.3D.R(c,[e.$k])}},3F:9(){h e=c;t.1c(9(){e.3x()},0)},3o:9(){h e=c;7(e.$k.2m(":3n")===b){e.$k.z({2u:0});t.18(e.1C);t.18(e.1X)}l{p b}e.1X=t.4d(9(){7(e.$k.2m(":3n")){e.3F();e.$k.4b({2u:1},2M);t.18(e.1X)}},5x)},4B:9(){h e=c;e.$S.5n(\'\').4a(\' \');e.$k.17(".d-1p").4a(\'\');e.1H=e.$k.17(".d-1p-49");e.$k.z("4i","4h")},1M:9(){h e=c,t=e.$k.1I(e.6.1M),n=e.$k.1I(e.6.2i);7(!t){e.$k.I(e.6.1M)}7(!n){e.$k.I(e.6.2i)}},2V:9(){h t=c,n,r;7(t.6.2Z===b){p b}7(t.6.48===j){t.6.q=t.2t=1;t.6.1h=b;t.6.1s=b;t.6.1O=b;t.6.22=b;t.6.1Q=b;t.6.1R=b;p b}n=e(t.6.47).1f();7(n>(t.6.1s[0]||t.2t)){t.6.q=t.2t}7(t.6.1h!==b){t.6.1h.5g(9(e,t){p e[0]-t[0]});1A(r=0;rt.E&&t.6.46===j){t.6.q=t.E}},4r:9(){h n=c,r,i;7(n.6.2Z!==j){p b}i=e(t).1f();n.3d=9(){7(e(t).1f()!==i){7(n.6.O!==b){t.18(n.1C)}t.5d(r);r=t.1c(9(){i=e(t).1f();n.3x()},n.6.45)}};e(t).44(n.3d)},4f:9(){h e=c;e.2g(e.m);7(e.6.O!==b){e.3j()}},43:9(){h t=c,n=0,r=t.E-t.6.q;t.$G.2f(9(i){h s=e(c);s.z({1f:t.M}).v("d-1K",3p(i));7(i%t.6.q===0||i===r){7(!(i>r)){n+=1}}s.v("d-24",n)})},42:9(){h e=c,t=e.$G.N*e.M;e.$K.z({1f:t*2,T:0});e.43()},2W:9(){h e=c;e.40();e.42();e.3Z();e.3v()},40:9(){h e=c;e.M=1F.4O(e.$k.1f()/e.6.q)},3v:9(){h e=c,t=(e.E*e.M-e.6.q*e.M)*-1;7(e.6.q>e.E){e.D=0;t=0;e.3z=0}l{e.D=e.E-e.6.q;e.3z=t}p t},3Y:9(){p 0},3Z:9(){h t=c,n=0,r=0,i,s,o;t.J=[0];t.3E=[];1A(i=0;i \').5m("5l",!t.F.15).5c(t.$k)}7(t.6.1v===j){t.3T()}7(t.6.2a===j){t.3S()}},3S:9(){h t=c,n=e(\' \');t.B.1o(n);t.1u=e(" ",{"H":"d-1n",2y:t.6.2U[0]||""});t.1q=e(" ",{"H":"d-U",2y:t.6.2U[1]||""});n.1o(t.1u).1o(t.1q);n.w("2X.B 21.B",\'L[H^="d"]\',9(e){e.1l()});n.w("2n.B 28.B",\'L[H^="d"]\',9(n){n.1l();7(e(c).1I("d-U")){t.U()}l{t.1n()}})},3T:9(){h t=c;t.1k=e(\' \');t.B.1o(t.1k);t.1k.w("2n.B 28.B",".d-1j",9(n){n.1l();7(3p(e(c).v("d-1j"))!==t.m){t.1g(3p(e(c).v("d-1j")),j)}})},3P:9(){h t=c,n,r,i,s,o,u;7(t.6.1v===b){p b}t.1k.2y("");n=0;r=t.E-t.E%t.6.q;1A(s=0;s ",{"H":"d-1j"});u=e("<3N>3N>",{4R:t.6.39===j?n:"","H":t.6.39===j?"d-59":""});o.1o(u);o.v("d-1j",r===s?i:s);o.v("d-24",n);t.1k.1o(o)}}t.35()},35:9(){h t=c;7(t.6.1v===b){p b}t.1k.17(".d-1j").2f(9(){7(e(c).v("d-24")===e(t.$G[t.m]).v("d-24")){t.1k.17(".d-1j").Z("2d");e(c).I("2d")}})},3e:9(){h e=c;7(e.6.2a===b){p b}7(e.6.2e===b){7(e.m===0&&e.D===0){e.1u.I("1b");e.1q.I("1b")}l 7(e.m===0&&e.D!==0){e.1u.I("1b");e.1q.Z("1b")}l 7(e.m===e.D){e.1u.Z("1b");e.1q.I("1b")}l 7(e.m!==0&&e.m!==e.D){e.1u.Z("1b");e.1q.Z("1b")}}},30:9(){h e=c;e.3P();e.3e();7(e.B){7(e.6.q>=e.E){e.B.3K()}l{e.B.3J()}}},55:9(){h e=c;7(e.B){e.B.3k()}},U:9(e){h t=c;7(t.1E){p b}t.m+=t.6.12===j?t.6.q:1;7(t.m>t.D+(t.6.12===j?t.6.q-1:0)){7(t.6.2e===j){t.m=0;e="2k"}l{t.m=t.D;p b}}t.1g(t.m,e)},1n:9(e){h t=c;7(t.1E){p b}7(t.6.12===j&&t.m>0&&t.m=i.D){e=i.D}l 7(e<=0){e=0}i.m=i.d.m=e;7(i.6.2o!==b&&r!=="4e"&&i.6.q===1&&i.F.1x===j){i.1t(0);7(i.F.1x===j){i.1L(i.J[e])}l{i.1r(i.J[e],1)}i.2r();i.4l();p b}s=i.J[e];7(i.F.1x===j){i.1T=b;7(n===j){i.1t("1w");t.1c(9(){i.1T=j},i.6.1w)}l 7(n==="2k"){i.1t(i.6.2v);t.1c(9(){i.1T=j},i.6.2v)}l{i.1t("1m");t.1c(9(){i.1T=j},i.6.1m)}i.1L(s)}l{7(n===j){i.1r(s,i.6.1w)}l 7(n==="2k"){i.1r(s,i.6.2v)}l{i.1r(s,i.6.1m)}}i.2r()},2g:9(e){h t=c;7(A t.6.1Y==="9"){t.6.1Y.R(c,[t.$k])}7(e>=t.D||e===-1){e=t.D}l 7(e<=0){e=0}t.1t(0);7(t.F.1x===j){t.1L(t.J[e])}l{t.1r(t.J[e],1)}t.m=t.d.m=e;t.2r()},2r:9(){h e=c;e.26.2D(e.m);e.13=e.d.13=e.26[e.26.N-2];e.26.5f(0);7(e.13!==e.m){e.35();e.3e();e.2l();7(e.6.O!==b){e.3j()}}7(A e.6.3y==="9"&&e.13!==e.m){e.6.3y.R(c,[e.$k])}},X:9(){h e=c;e.3A="X";t.18(e.1C)},3j:9(){h e=c;7(e.3A!=="X"){e.19()}},19:9(){h e=c;e.3A="19";7(e.6.O===b){p b}t.18(e.1C);e.1C=t.4d(9(){e.U(j)},e.6.O)},1t:9(e){h t=c;7(e==="1m"){t.$K.z(t.2z(t.6.1m))}l 7(e==="1w"){t.$K.z(t.2z(t.6.1w))}l 7(A e!=="2Y"){t.$K.z(t.2z(e))}},2z:9(e){p{"-1G-1a":"2C "+e+"1z 2s","-1W-1a":"2C "+e+"1z 2s","-o-1a":"2C "+e+"1z 2s",1a:"2C "+e+"1z 2s"}},3H:9(){p{"-1G-1a":"","-1W-1a":"","-o-1a":"",1a:""}},3I:9(e){p{"-1G-P":"1i("+e+"V, C, C)","-1W-P":"1i("+e+"V, C, C)","-o-P":"1i("+e+"V, C, C)","-1z-P":"1i("+e+"V, C, C)",P:"1i("+e+"V, C,C)"}},1L:9(e){h t=c;t.$K.z(t.3I(e))},3L:9(e){h t=c;t.$K.z({T:e})},1r:9(e,t){h n=c;n.29=b;n.$K.X(j,j).4b({T:e},{54:t||n.6.1m,3M:9(){n.29=j}})},4E:9(){h e=c,r="1i(C, C, C)",i=n.56("L"),s,o,u,a;i.2w.3O=" -1W-P:"+r+"; -1z-P:"+r+"; -o-P:"+r+"; -1G-P:"+r+"; P:"+r;s=/1i\\(C, C, C\\)/g;o=i.2w.3O.5i(s);u=o!==14&&o.N===1;a="5z"38 t||t.5Q.4P;e.F={1x:u,15:a}},4q:9(){h e=c;7(e.6.27!==b||e.6.1U!==b){e.3Q();e.3R()}},4C:9(){h e=c,t=["s","e","x"];e.16={};7(e.6.27===j&&e.6.1U===j){t=["2X.d 21.d","2N.d 3U.d","2n.d 3V.d 28.d"]}l 7(e.6.27===b&&e.6.1U===j){t=["2X.d","2N.d","2n.d 3V.d"]}l 7(e.6.27===j&&e.6.1U===b){t=["21.d","3U.d","28.d"]}e.16.3W=t[0];e.16.2K=t[1];e.16.2J=t[2]},3R:9(){h t=c;t.$k.w("5y.d",9(e){e.1l()});t.$k.w("21.3X",9(t){p e(t.1d).2m("5C, 5E, 5F, 5N")})},3Q:9(){9 s(e){7(e.2b!==W){p{x:e.2b[0].2c,y:e.2b[0].41}}7(e.2b===W){7(e.2c!==W){p{x:e.2c,y:e.41}}7(e.2c===W){p{x:e.52,y:e.53}}}}9 o(t){7(t==="w"){e(n).w(r.16.2K,a);e(n).w(r.16.2J,f)}l 7(t==="Q"){e(n).Q(r.16.2K);e(n).Q(r.16.2J)}}9 u(n){h u=n.3h||n||t.3g,a;7(u.5a===3){p b}7(r.E<=r.6.q){p}7(r.29===b&&!r.6.3f){p b}7(r.1T===b&&!r.6.3f){p b}7(r.6.O!==b){t.18(r.1C)}7(r.F.15!==j&&!r.$K.1I("3b")){r.$K.I("3b")}r.11=0;r.Y=0;e(c).z(r.3H());a=e(c).2h();i.2S=a.T;i.2R=s(u).x-a.T;i.2P=s(u).y-a.5o;o("w");i.2j=b;i.2L=u.1d||u.4c}9 a(o){h u=o.3h||o||t.3g,a,f;r.11=s(u).x-i.2R;r.2I=s(u).y-i.2P;r.Y=r.11-i.2S;7(A r.6.2E==="9"&&i.3C!==j&&r.Y!==0){i.3C=j;r.6.2E.R(r,[r.$k])}7((r.Y>8||r.Y<-8)&&r.F.15===j){7(u.1l!==W){u.1l()}l{u.5L=b}i.2j=j}7((r.2I>10||r.2I<-10)&&i.2j===b){e(n).Q("2N.d")}a=9(){p r.Y/5};f=9(){p r.3z+r.Y/5};r.11=1F.3v(1F.3Y(r.11,a()),f());7(r.F.1x===j){r.1L(r.11)}l{r.3L(r.11)}}9 f(n){h s=n.3h||n||t.3g,u,a,f;s.1d=s.1d||s.4c;i.3C=b;7(r.F.15!==j){r.$K.Z("3b")}7(r.Y<0){r.1y=r.d.1y="T"}l{r.1y=r.d.1y="3i"}7(r.Y!==0){u=r.4j();r.1g(u,b,"4e");7(i.2L===s.1d&&r.F.15!==j){e(s.1d).w("3a.4k",9(t){t.4S();t.4T();t.1l();e(t.1d).Q("3a.4k")});a=e.4N(s.1d,"4V").3a;f=a.4W();a.4X(0,0,f)}}o("Q")}h r=c,i={2R:0,2P:0,4Y:0,2S:0,2h:14,4Z:14,50:14,2j:14,51:14,2L:14};r.29=j;r.$k.w(r.16.3W,".d-1p",u)},4j:9(){h e=c,t=e.4m();7(t>e.D){e.m=e.D;t=e.D}l 7(e.11>=0){t=0;e.m=0}p t},4m:9(){h t=c,n=t.6.12===j?t.3E:t.J,r=t.11,i=14;e.2f(n,9(s,o){7(r-t.M/20>n[s+1]&&r-t.M/20(n[s+1]||n[s]-t.M)&&t.34()==="3i"){7(t.6.12===j){i=n[s+1]||n[n.N-1];t.m=e.4p(i,t.J)}l{i=n[s+1];t.m=s+1}}});p t.m},34:9(){h e=c,t;7(e.Y<0){t="3i";e.3u="U"}l{t="T";e.3u="1n"}p t},4A:9(){h e=c;e.$k.w("d.U",9(){e.U()});e.$k.w("d.1n",9(){e.1n()});e.$k.w("d.19",9(t,n){e.6.O=n;e.19();e.32="19"});e.$k.w("d.X",9(){e.X();e.32="X"});e.$k.w("d.1g",9(t,n){e.1g(n)});e.$k.w("d.2g",9(t,n){e.2g(n)})},2p:9(){h e=c;7(e.6.2p===j&&e.F.15!==j&&e.6.O!==b){e.$k.w("57",9(){e.X()});e.$k.w("58",9(){7(e.32!=="X"){e.19()}})}},1Z:9(){h t=c,n,r,i,s,o;7(t.6.1Z===b){p b}1A(n=0;n=t.m}l{o=j}7(o&&i=n.$S.N||r===-1){n.$S.1S(-1).5X(e)}l{n.$S.1S(r).5Y(e)}n.23()},5Z:9(e){h t=c,n;7(t.$k.25().N===0){p b}7(e===W||e===-1){n=-1}l{n=e}t.1V();t.$S.1S(n).3k();t.23()}};e.37.2B=9(t){p c.2f(9(){7(e(c).v("d-1N")===j){p b}e(c).v("d-1N",j);h n=3c.3q(r);n.1N(t,c);e.v(c,"2B",n)})};e.37.2B.6={q:5,1h:b,1s:[60,4],1O:[61,3],22:[62,2],1Q:b,1R:[63,1],48:b,46:b,1m:2M,1w:64,2v:65,O:b,2p:b,2a:b,2U:["1n","U"],2e:j,12:b,1v:j,39:b,2Z:j,45:2M,47:t,1M:"d-66",2i:"d-2i",1Z:b,4v:j,4x:"4y",1B:b,2O:b,33:b,3f:j,27:j,1U:j,2F:b,2o:b,3B:b,3D:b,2H:b,3s:b,1Y:b,3y:b,3w:b,2E:b,2T:b}})(67,68,69)',62,382,'||||||options|if||function||false|this|owl||||var||true|elem|else|currentItem|||return|items|||||data|on|||css|typeof|owlControls|0px|maximumItem|itemsAmount|browser|owlItems|class|addClass|positionsInArray|owlWrapper|div|itemWidth|length|autoPlay|transform|off|apply|userItems|left|next|px|undefined|stop|newRelativeX|removeClass||newPosX|scrollPerPage|prevItem|null|isTouch|ev_types|find|clearInterval|play|transition|disabled|setTimeout|target|loaded|width|goTo|itemsCustom|translate3d|page|paginationWrapper|preventDefault|slideSpeed|prev|append|wrapper|buttonNext|css2slide|itemsDesktop|swapSpeed|buttonPrev|pagination|paginationSpeed|support3d|dragDirection|ms|for|autoHeight|autoPlayInterval|visibleItems|isTransition|Math|webkit|wrapperOuter|hasClass|src|item|transition3d|baseClass|init|itemsDesktopSmall|origin|itemsTabletSmall|itemsMobile|eq|isCss3Finish|touchDrag|unWrap|moz|checkVisible|beforeMove|lazyLoad||mousedown|itemsTablet|setVars|roundPages|children|prevArr|mouseDrag|mouseup|isCssFinish|navigation|touches|pageX|active|rewindNav|each|jumpTo|position|theme|sliding|rewind|eachMoveUpdate|is|touchend|transitionStyle|stopOnHover|100|afterGo|ease|orignalItems|opacity|rewindSpeed|style|attr|html|addCssSpeed|userOptions|owlCarousel|all|push|startDragging|addClassActive|height|beforeInit|newPosY|end|move|targetElement|200|touchmove|jsonPath|offsetY|completeImg|offsetX|relativePos|afterLazyLoad|navigationText|updateItems|calculateAll|touchstart|string|responsive|updateControls|clearTransStyle|hoverStatus|jsonSuccess|moveDirection|checkPagination|endCurrent|fn|in|paginationNumbers|click|grabbing|Object|resizer|checkNavigation|dragBeforeAnimFinish|event|originalEvent|right|checkAp|remove|get|endPrev|visible|watchVisibility|Number|create|unwrap|afterInit|logIn|playDirection|max|afterAction|updateVars|afterMove|maximumPixels|apStatus|beforeUpdate|dragging|afterUpdate|pagesInArray|reload|clearEvents|removeTransition|doTranslate|show|hide|css2move|complete|span|cssText|updatePagination|gestures|disabledEvents|buildButtons|buildPagination|mousemove|touchcancel|start|disableTextSelect|min|loops|calculateWidth|pageY|appendWrapperSizes|appendItemsSizes|resize|responsiveRefreshRate|itemsScaleUp|responsiveBaseWidth|singleItem|outer|wrap|animate|srcElement|setInterval|drag|updatePosition|onVisibleItems|block|display|getNewPosition|disable|singleItemTransition|closestItem|transitionTypes|owlStatus|inArray|moveEvents|response|continue|buildControls|loading|lazyFollow|lazyPreload|lazyEffect|fade|onStartup|customEvents|wrapItems|eventTypes|naturalWidth|checkBrowser|originalClasses|outClass|inClass|originalStyles|abs|perspective|loadContent|extend|_data|round|msMaxTouchPoints|5e3|text|stopImmediatePropagation|stopPropagation|buttons|events|pop|splice|baseElWidth|minSwipe|maxSwipe|dargging|clientX|clientY|duration|destroyControls|createElement|mouseover|mouseout|numbers|which|lazyOwl|appendTo|clearTimeout|checked|shift|sort|removeAttr|match|fadeIn|400|clickable|toggleClass|wrapAll|top|prop|tagName|DIV|background|image|url|wrapperWidth|img|500|dragstart|ontouchstart|controls|out|input|relative|textarea|select|webkitAnimationEnd|oAnimationEnd|MSAnimationEnd|animationend|getJSON|returnValue|hasOwnProperty|option|onstartup|baseElement|navigator|new|prototype|destroy|removeData|reinit|addItem|after|before|removeItem|1199|979|768|479|800|1e3|carousel|jQuery|window|document'.split('|'),0,{}));
(function ($){
$.fn.customScrollbar=function (options, args){
var defaultOptions={
skin: undefined,
hScroll: true,
vScroll: true,
updateOnWindowResize: false,
animationSpeed: 300,
onCustomScroll: undefined,
swipeSpeed: 1,
wheelSpeed: 40,
fixedThumbWidth: undefined,
fixedThumbHeight: undefined,
preventDefaultScroll: false
}
var Scrollable=function (element, options){
this.$element=$(element);
this.options=options;
this.addScrollableClass();
this.addSkinClass();
this.addScrollBarComponents();
if(this.options.vScroll)
this.vScrollbar=new Scrollbar(this, new VSizing());
if(this.options.hScroll)
this.hScrollbar=new Scrollbar(this, new HSizing());
this.$element.data("scrollable", this);
this.initKeyboardScrolling();
this.bindEvents();
}
Scrollable.prototype={
addScrollableClass: function (){
if(!this.$element.hasClass("scrollable")){
this.scrollableAdded=true;
this.$element.addClass("scrollable");
}},
removeScrollableClass: function (){
if(this.scrollableAdded)
this.$element.removeClass("scrollable");
},
addSkinClass: function (){
if(typeof(this.options.skin)=="string"&&!this.$element.hasClass(this.options.skin)){
this.skinClassAdded=true;
this.$element.addClass(this.options.skin);
}},
removeSkinClass: function (){
if(this.skinClassAdded)
this.$element.removeClass(this.options.skin);
},
addScrollBarComponents: function (){
this.assignViewPort();
if(this.$viewPort.length==0){
this.$element.wrapInner("
");
this.assignViewPort();
this.viewPortAdded=true;
}
this.assignOverview();
if(this.$overview.length==0){
this.$viewPort.wrapInner("
");
this.assignOverview();
this.overviewAdded=true;
}
this.addScrollBar("vertical", "prepend");
this.addScrollBar("horizontal", "append");
},
removeScrollbarComponents: function (){
this.removeScrollbar("vertical");
this.removeScrollbar("horizontal");
if(this.overviewAdded)
this.$element.unwrap();
if(this.viewPortAdded)
this.$element.unwrap();
},
removeScrollbar: function (orientation){
if(this[orientation + "ScrollbarAdded"])
this.$element.find(".scroll-bar." + orientation).remove();
},
assignViewPort: function (){
this.$viewPort=this.$element.find(".viewport");
},
assignOverview: function (){
this.$overview=this.$viewPort.find(".overview");
},
addScrollBar: function (orientation, fun){
if(this.$element.find(".scroll-bar." + orientation).length==0){
this.$element[fun]("")
this[orientation + "ScrollbarAdded"]=true;
}},
resize: function (keepPosition){
if(this.vScrollbar)
this.vScrollbar.resize(keepPosition);
if(this.hScrollbar)
this.hScrollbar.resize(keepPosition);
},
scrollTo: function (element){
if(this.vScrollbar)
this.vScrollbar.scrollToElement(element);
if(this.hScrollbar)
this.hScrollbar.scrollToElement(element);
},
scrollToXY: function (x, y){
this.scrollToX(x);
this.scrollToY(y);
},
scrollToX: function (x){
if(this.hScrollbar)
this.hScrollbar.scrollOverviewTo(x, true);
},
scrollToY: function (y){
if(this.vScrollbar)
this.vScrollbar.scrollOverviewTo(y, true);
},
scrollByX: function (x){
if(this.hScrollbar)
this.scrollToX(this.hScrollbar.overviewPosition() + x);
},
scrollByY: function (y){
if(this.vScrollbar)
this.scrollToY(this.vScrollbar.overviewPosition() + y);
},
remove: function (){
this.removeScrollableClass();
this.removeSkinClass();
this.removeScrollbarComponents();
this.$element.data("scrollable", null);
this.removeKeyboardScrolling();
if(this.vScrollbar)
this.vScrollbar.remove();
if(this.hScrollbar)
this.hScrollbar.remove();
},
setAnimationSpeed: function (speed){
this.options.animationSpeed=speed;
},
isInside: function (element, wrappingElement){
var $element=$(element);
var $wrappingElement=$(wrappingElement);
var elementOffset=$element.offset();
var wrappingElementOffset=$wrappingElement.offset();
return (elementOffset.top >=wrappingElementOffset.top)&&(elementOffset.left >=wrappingElementOffset.left) &&
(elementOffset.top + $element.height() <=wrappingElementOffset.top + $wrappingElement.height()) &&
(elementOffset.left + $element.width() <=wrappingElementOffset.left + $wrappingElement.width())
},
initKeyboardScrolling: function (){
var _this=this;
this.elementKeydown=function (event){
if(document.activeElement===_this.$element[0]){
if(_this.vScrollbar)
_this.vScrollbar.keyScroll(event);
if(_this.hScrollbar)
_this.hScrollbar.keyScroll(event);
}}
this.$element
.attr('tabindex', '-1')
.keydown(this.elementKeydown);
},
removeKeyboardScrolling: function (){
this.$element
.removeAttr('tabindex')
.unbind("keydown", this.elementKeydown);
},
bindEvents: function (){
if(this.options.onCustomScroll)
this.$element.on("customScroll", this.options.onCustomScroll);
}}
var Scrollbar=function (scrollable, sizing){
this.scrollable=scrollable;
this.sizing=sizing
this.$scrollBar=this.sizing.scrollBar(this.scrollable.$element);
this.$thumb=this.$scrollBar.find(".thumb");
this.setScrollPosition(0, 0);
this.resize();
this.initMouseMoveScrolling();
this.initMouseWheelScrolling();
this.initTouchScrolling();
this.initMouseClickScrolling();
this.initWindowResize();
}
Scrollbar.prototype={
resize: function (keepPosition){
this.overviewSize=this.sizing.size(this.scrollable.$overview);
this.calculateViewPortSize();
this.sizing.size(this.scrollable.$viewPort, this.viewPortSize);
this.ratio=this.viewPortSize / this.overviewSize;
this.sizing.size(this.$scrollBar, this.viewPortSize);
this.thumbSize=this.calculateThumbSize();
this.sizing.size(this.$thumb, this.thumbSize);
this.maxThumbPosition=this.calculateMaxThumbPosition();
this.maxOverviewPosition=this.calculateMaxOverviewPosition();
this.enabled=(this.overviewSize > this.viewPortSize);
if(this.scrollPercent===undefined)
this.scrollPercent=0.0;
if(this.enabled)
this.rescroll(keepPosition);
else
this.setScrollPosition(0, 0);
this.$scrollBar.toggle(this.enabled);
},
calculateViewPortSize: function (){
var elementSize=this.sizing.size(this.scrollable.$element);
if(elementSize > 0&&!this.maxSizeUsed){
this.viewPortSize=elementSize;
this.maxSizeUsed=false;
}else{
var maxSize=this.sizing.maxSize(this.scrollable.$element);
this.viewPortSize=Math.min(maxSize, this.overviewSize);
this.maxSizeUsed=true;
}},
calculateThumbSize: function (){
var fixedSize=this.sizing.fixedThumbSize(this.scrollable.options)
var size;
if(fixedSize)
size=fixedSize;
else
size=this.ratio * this.viewPortSize
return Math.max(size, this.sizing.minSize(this.$thumb));
},
initMouseMoveScrolling: function (){
var _this=this;
this.$thumb.mousedown(function (event){
if(_this.enabled)
_this.startMouseMoveScrolling(event);
});
this.documentMouseup=function (event){
_this.stopMouseMoveScrolling(event);
};
$(document).mouseup(this.documentMouseup);
this.documentMousemove=function (event){
_this.mouseMoveScroll(event);
};
$(document).mousemove(this.documentMousemove);
this.$thumb.click(function (event){
event.stopPropagation();
});
},
removeMouseMoveScrolling: function (){
this.$thumb.unbind();
$(document).unbind("mouseup", this.documentMouseup);
$(document).unbind("mousemove", this.documentMousemove);
},
initMouseWheelScrolling: function (){
var _this=this;
this.scrollable.$element.mousewheel(function (event, delta, deltaX, deltaY){
if(_this.enabled){
var scrolled=_this.mouseWheelScroll(deltaX, deltaY);
_this.stopEventConditionally(event, scrolled);
}});
},
removeMouseWheelScrolling: function (){
this.scrollable.$element.unbind("mousewheel");
},
initTouchScrolling: function (){
if(document.addEventListener){
var _this=this;
this.elementTouchstart=function (event){
if(_this.enabled)
_this.startTouchScrolling(event);
}
this.scrollable.$element[0].addEventListener("touchstart", this.elementTouchstart);
this.documentTouchmove=function (event){
_this.touchScroll(event);
}
document.addEventListener("touchmove", this.documentTouchmove);
this.elementTouchend=function (event){
_this.stopTouchScrolling(event);
}
this.scrollable.$element[0].addEventListener("touchend", this.elementTouchend);
}},
removeTouchScrolling: function (){
if(document.addEventListener){
this.scrollable.$element[0].removeEventListener("touchstart", this.elementTouchstart);
document.removeEventListener("touchmove", this.documentTouchmove);
this.scrollable.$element[0].removeEventListener("touchend", this.elementTouchend);
}},
initMouseClickScrolling: function (){
var _this=this;
this.scrollBarClick=function (event){
_this.mouseClickScroll(event);
};
this.$scrollBar.click(this.scrollBarClick);
},
removeMouseClickScrolling: function (){
this.$scrollBar.unbind("click", this.scrollBarClick);
},
initWindowResize: function (){
if(this.scrollable.options.updateOnWindowResize){
var _this=this;
this.windowResize=function (){
_this.resize();
};
$(window).resize(this.windowResize);
}},
removeWindowResize: function (){
$(window).unbind("resize", this.windowResize);
},
isKeyScrolling: function (key){
return this.keyScrollDelta(key)!=null;
},
keyScrollDelta: function (key){
for (var scrollingKey in this.sizing.scrollingKeys)
if(scrollingKey==key)
return this.sizing.scrollingKeys[key](this.viewPortSize);
return null;
},
startMouseMoveScrolling: function (event){
this.mouseMoveScrolling=true;
$("body").addClass("not-selectable");
this.setUnselectable($("body"), "on");
this.setScrollEvent(event);
event.preventDefault();
},
stopMouseMoveScrolling: function (event){
this.mouseMoveScrolling=false;
$("body").removeClass("not-selectable");
this.setUnselectable($("body"), null);
},
setUnselectable: function (element, value){
if(element.attr("unselectable")!=value){
element.attr("unselectable", value);
element.find(':not(input)').attr('unselectable', value);
}},
mouseMoveScroll: function (event){
if(this.mouseMoveScrolling){
var delta=this.sizing.mouseDelta(this.scrollEvent, event);
this.scrollThumbBy(delta);
this.setScrollEvent(event);
}},
startTouchScrolling: function (event){
if(event.touches&&event.touches.length==1){
this.setScrollEvent(event.touches[0]);
this.touchScrolling=true;
event.stopPropagation();
}},
touchScroll: function (event){
if(this.touchScrolling&&event.touches&&event.touches.length==1){
var delta=-this.sizing.mouseDelta(this.scrollEvent, event.touches[0]) * this.scrollable.options.swipeSpeed;
var scrolled=this.scrollOverviewBy(delta);
if(scrolled)
this.setScrollEvent(event.touches[0]);
this.stopEventConditionally(event, scrolled);
}},
stopTouchScrolling: function (event){
this.touchScrolling=false;
event.stopPropagation();
},
mouseWheelScroll: function (deltaX, deltaY){
var delta=-this.sizing.wheelDelta(deltaX, deltaY) * this.scrollable.options.wheelSpeed;
if(delta!=0)
return this.scrollOverviewBy(delta);
},
mouseClickScroll: function (event){
var delta=this.viewPortSize - 20;
if(event["page" + this.sizing.scrollAxis()] < this.$thumb.offset()[this.sizing.offsetComponent()])
delta=-delta;
this.scrollOverviewBy(delta);
},
keyScroll: function (event){
var keyDown=event.which;
if(this.enabled&&this.isKeyScrolling(keyDown)){
var scrolled=this.scrollOverviewBy(this.keyScrollDelta(keyDown));
this.stopEventConditionally(event, scrolled);
}},
scrollThumbBy: function (delta){
var thumbPosition=this.thumbPosition();
thumbPosition +=delta;
thumbPosition=this.positionOrMax(thumbPosition, this.maxThumbPosition);
var oldScrollPercent=this.scrollPercent;
this.scrollPercent=thumbPosition / this.maxThumbPosition;
if(oldScrollPercent!=this.scrollPercent){
var overviewPosition=(thumbPosition * this.maxOverviewPosition) / this.maxThumbPosition;
this.setScrollPosition(overviewPosition, thumbPosition);
this.triggerCustomScroll(oldScrollPercent);
return true
}
else
return false;
},
thumbPosition: function (){
return this.$thumb.position()[this.sizing.offsetComponent()];
},
scrollOverviewBy: function (delta){
var overviewPosition=this.overviewPosition() + delta;
return this.scrollOverviewTo(overviewPosition, false);
},
overviewPosition: function (){
return -this.scrollable.$overview.position()[this.sizing.offsetComponent()];
},
scrollOverviewTo: function (overviewPosition, animate){
overviewPosition=this.positionOrMax(overviewPosition, this.maxOverviewPosition);
var oldScrollPercent=this.scrollPercent;
this.scrollPercent=overviewPosition / this.maxOverviewPosition;
if(oldScrollPercent!=this.scrollPercent){
var thumbPosition=this.scrollPercent * this.maxThumbPosition;
if(animate)
this.setScrollPositionWithAnimation(overviewPosition, thumbPosition);
else
this.setScrollPosition(overviewPosition, thumbPosition);
this.triggerCustomScroll(oldScrollPercent);
return true;
}
else
return false;
},
positionOrMax: function (p, max){
if(p < 0)
return 0;
else if(p > max)
return max;
else
return p;
},
triggerCustomScroll: function (oldScrollPercent){
this.scrollable.$element.trigger("customScroll", {
scrollAxis: this.sizing.scrollAxis(),
direction: this.sizing.scrollDirection(oldScrollPercent, this.scrollPercent),
scrollPercent: this.scrollPercent * 100
}
);
},
rescroll: function (keepPosition){
if(keepPosition){
var overviewPosition=this.positionOrMax(this.overviewPosition(), this.maxOverviewPosition);
this.scrollPercent=overviewPosition / this.maxOverviewPosition;
var thumbPosition=this.scrollPercent * this.maxThumbPosition;
this.setScrollPosition(overviewPosition, thumbPosition);
}else{
var thumbPosition=this.scrollPercent * this.maxThumbPosition;
var overviewPosition=this.scrollPercent * this.maxOverviewPosition;
this.setScrollPosition(overviewPosition, thumbPosition);
}},
setScrollPosition: function (overviewPosition, thumbPosition){
this.$thumb.css(this.sizing.offsetComponent(), thumbPosition + "px");
this.scrollable.$overview.css(this.sizing.offsetComponent(), -overviewPosition + "px");
},
setScrollPositionWithAnimation: function (overviewPosition, thumbPosition){
var thumbAnimationOpts={};
var overviewAnimationOpts={};
thumbAnimationOpts[this.sizing.offsetComponent()]=thumbPosition + "px";
this.$thumb.animate(thumbAnimationOpts, this.scrollable.options.animationSpeed);
overviewAnimationOpts[this.sizing.offsetComponent()]=-overviewPosition + "px";
this.scrollable.$overview.animate(overviewAnimationOpts, this.scrollable.options.animationSpeed);
},
calculateMaxThumbPosition: function (){
return Math.max(0, this.sizing.size(this.$scrollBar) - this.thumbSize);
},
calculateMaxOverviewPosition: function (){
return Math.max(0, this.sizing.size(this.scrollable.$overview) - this.sizing.size(this.scrollable.$viewPort));
},
setScrollEvent: function (event){
var attr="page" + this.sizing.scrollAxis();
if(!this.scrollEvent||this.scrollEvent[attr]!=event[attr])
this.scrollEvent={pageX: event.pageX, pageY: event.pageY};},
scrollToElement: function (element){
var $element=$(element);
if(this.sizing.isInside($element, this.scrollable.$overview)&&!this.sizing.isInside($element, this.scrollable.$viewPort)){
var elementOffset=$element.offset();
var overviewOffset=this.scrollable.$overview.offset();
var viewPortOffset=this.scrollable.$viewPort.offset();
this.scrollOverviewTo(elementOffset[this.sizing.offsetComponent()] - overviewOffset[this.sizing.offsetComponent()], true);
}},
remove: function (){
this.removeMouseMoveScrolling();
this.removeMouseWheelScrolling();
this.removeTouchScrolling();
this.removeMouseClickScrolling();
this.removeWindowResize();
},
stopEventConditionally: function (event, condition){
if(condition||this.scrollable.options.preventDefaultScroll){
event.preventDefault();
event.stopPropagation();
}}
}
var HSizing=function (){
}
HSizing.prototype={
size: function ($el, arg){
if(arg)
return $el.width(arg);
else
return $el.width();
},
minSize: function ($el){
return parseInt($el.css("min-width"))||0;
},
maxSize: function ($el){
return parseInt($el.css("max-width"))||0;
},
fixedThumbSize: function (options){
return options.fixedThumbWidth;
},
scrollBar: function ($el){
return $el.find(".scroll-bar.horizontal");
},
mouseDelta: function (event1, event2){
return event2.pageX - event1.pageX;
},
offsetComponent: function (){
return "left";
},
wheelDelta: function (deltaX, deltaY){
return deltaX;
},
scrollAxis: function (){
return "X";
},
scrollDirection: function (oldPercent, newPercent){
return oldPercent < newPercent ? "right":"left";
},
scrollingKeys: {
37: function (viewPortSize){
return -10;
},
39: function (viewPortSize){
return 10;
}},
isInside: function (element, wrappingElement){
var $element=$(element);
var $wrappingElement=$(wrappingElement);
var elementOffset=$element.offset();
var wrappingElementOffset=$wrappingElement.offset();
return (elementOffset.left >=wrappingElementOffset.left) &&
(elementOffset.left + $element.width() <=wrappingElementOffset.left + $wrappingElement.width());
}}
var VSizing=function (){
}
VSizing.prototype={
size: function ($el, arg){
if(arg)
return $el.height(arg);
else
return $el.height();
},
minSize: function ($el){
return parseInt($el.css("min-height"))||0;
},
maxSize: function ($el){
return parseInt($el.css("max-height"))||0;
},
fixedThumbSize: function (options){
return options.fixedThumbHeight;
},
scrollBar: function ($el){
return $el.find(".scroll-bar.vertical");
},
mouseDelta: function (event1, event2){
return event2.pageY - event1.pageY;
},
offsetComponent: function (){
return "top";
},
wheelDelta: function (deltaX, deltaY){
return deltaY;
},
scrollAxis: function (){
return "Y";
},
scrollDirection: function (oldPercent, newPercent){
return oldPercent < newPercent ? "down":"up";
},
scrollingKeys: {
38: function (viewPortSize){
return -10;
},
40: function (viewPortSize){
return 10;
},
33: function (viewPortSize){
return -(viewPortSize - 20);
},
34: function (viewPortSize){
return viewPortSize - 20;
}},
isInside: function (element, wrappingElement){
var $element=$(element);
var $wrappingElement=$(wrappingElement);
var elementOffset=$element.offset();
var wrappingElementOffset=$wrappingElement.offset();
return (elementOffset.top >=wrappingElementOffset.top) &&
(elementOffset.top + $element.height() <=wrappingElementOffset.top + $wrappingElement.height());
}}
return this.each(function (){
if(options==undefined)
options=defaultOptions;
if(typeof(options)=="string"){
var scrollable=$(this).data("scrollable");
if(scrollable)
scrollable[options](args);
}
else if(typeof(options)=="object"){
options=$.extend(defaultOptions, options);
new Scrollable($(this), options);
}
else
throw "Invalid type of options";
});
}
;
})
(jQuery);
(function ($){
var types=['DOMMouseScroll', 'mousewheel'];
if($.event.fixHooks){
for (var i=types.length; i;){
$.event.fixHooks[ types[--i] ]=$.event.mouseHooks;
}}
$.event.special.mousewheel={
setup: function (){
if(this.addEventListener){
for (var i=types.length; i;){
this.addEventListener(types[--i], handler, false);
}}else{
this.onmousewheel=handler;
}},
teardown: function (){
if(this.removeEventListener){
for (var i=types.length; i;){
this.removeEventListener(types[--i], handler, false);
}}else{
this.onmousewheel=null;
}}
};
$.fn.extend({
mousewheel: function (fn){
return fn ? this.bind("mousewheel", fn):this.trigger("mousewheel");
},
unmousewheel: function (fn){
return this.unbind("mousewheel", fn);
}});
function handler(event){
var orgEvent=event||window.event, args=[].slice.call(arguments, 1), delta=0, returnValue=true, deltaX=0, deltaY=0;
event=$.event.fix(orgEvent);
event.type="mousewheel";
if(orgEvent.wheelDelta){
delta=orgEvent.wheelDelta / 120;
}
if(orgEvent.detail){
delta=-orgEvent.detail / 3;
}
deltaY=delta;
if(orgEvent.axis!==undefined&&orgEvent.axis===orgEvent.HORIZONTAL_AXIS){
deltaY=0;
deltaX=delta;
}
if(orgEvent.wheelDeltaY!==undefined){
deltaY=orgEvent.wheelDeltaY / 120;
}
if(orgEvent.wheelDeltaX!==undefined){
deltaX=orgEvent.wheelDeltaX / 120;
}
args.unshift(event, delta, deltaX, deltaY);
return ($.event.dispatch||$.event.handle).apply(this, args);
}})(jQuery);
!function(a,b,c){"use strict";a(function(){try{if(parseInt(global.smoothScroll,10)){a.browserSelector();var b=a("html");(b.hasClass("chrome")||b.hasClass("ie11")||b.hasClass("ie10"))&&a.smoothScroll()}}catch(a){}a.fn.waypointSynchronise=function(b){function d(a,b){a.eq(b).addClass("animate_finished")}var c=a(this);return c.closest(b.container).waypoint(function(a){c.each(function(e){"down"===a?void 0!=b.globalDelay?setTimeout(function(){setTimeout(function(){d(c,e)},e*b.delay)},b.globalDelay):setTimeout(function(){d(c,e)},e*b.delay):b.inv&&setTimeout(function(){c.eq(e).removeClass(b.classN)},e*b.delay)})},{offset:b.offset}),c},function(){a("body").Temp({sticky:a("#header").data("shrink")})}(),function(){a(".jackbox[data-group]").length&&a(".jackbox[data-group]").jackBox("init",{dynamic:!0,showInfoByDefault:!1,preloadGraphics:!0,fullscreenScalesContent:!0,autoPlayVideo:!0,flashVideoFirst:!1,defaultVideoWidth:960,defaultVideoHeight:540,baseName:global.template_directory+"js/jackbox",className:".jackbox",useThumbs:!0,thumbsStartHidden:!1,thumbnailWidth:75,thumbnailHeight:50,useThumbTooltips:!0,showPageScrollbar:!1,useKeyboardControls:!0})}(),function(){a("html").hasClass("ie9")&&a("input[placeholder]").each(function(){a(this).val(a(this).attr("placeholder"));var b=a(this).val();a(this).on("focus",function(){a(this).val()===b&&a(this).val("")}).on("blur",function(){""==a(this).val()&&a(this).val(b)})})}(),function(){a(".post-slider").length&&a(".post-slider").owlCarousel({singleItem:!0,theme:"owl-theme",autoPlay:!0,stopOnHover:!0,autoHeight:!0,navigation:!0,rewindNav:!0,scrollPerPage:!1,pagination:!1,paginationNumbers:!1})}(),a("#content").fitVids(),function(){a(".custom-select").length&&a(".custom-select").customSelect(),a(".portfolio_filter").length&&a(".portfolio_filter").heapbox()}(),function(){a(".rating").length&&(a(".rating.readonly-rating").raty({readOnly:!0,path:global.paththeme+"/images/img",score:function(){return a(this).attr("data-score")},noRatedMsg:post_ratings.noRatedMsg}),a(".rating.rate").raty({path:global.paththeme+"/images/img",score:function(){return a(this).attr("data-score")},noRatedMsg:post_ratings.noRatedMsg}))}()})}(jQuery);
(function (j){
if(typeof popwid=="undefined") return;
j.post(global.ajaxurl, {
postid: popwid.postid,
action: "popwid_page_view_count"
});
})(jQuery);
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return"undefined"==typeof c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c),c}:a(jQuery)}(function(a){"use strict";function b(b){var c=b.data;b.isDefaultPrevented()||(b.preventDefault(),a(b.target).closest("form").ajaxSubmit(c))}function c(b){var c=b.target,d=a(c);if(!d.is("[type=submit],[type=image]")){var e=d.closest("[type=submit]");if(0===e.length)return;c=e[0]}var f=c.form;if(f.clk=c,"image"===c.type)if("undefined"!=typeof b.offsetX)f.clk_x=b.offsetX,f.clk_y=b.offsetY;else if("function"==typeof a.fn.offset){var g=d.offset();f.clk_x=b.pageX-g.left,f.clk_y=b.pageY-g.top}else f.clk_x=b.pageX-c.offsetLeft,f.clk_y=b.pageY-c.offsetTop;setTimeout(function(){f.clk=f.clk_x=f.clk_y=null},100)}function d(){if(a.fn.ajaxSubmit.debug){var b="[jquery.form] "+Array.prototype.join.call(arguments,"");window.console&&window.console.log?window.console.log(b):window.opera&&window.opera.postError&&window.opera.postError(b)}}var e=/\r?\n/g,f={};f.fileapi=void 0!==a(' ').get(0).files,f.formdata="undefined"!=typeof window.FormData;var g=!!a.fn.prop;a.fn.attr2=function(){if(!g)return this.attr.apply(this,arguments);var a=this.prop.apply(this,arguments);return a&&a.jquery||"string"==typeof a?a:this.attr.apply(this,arguments)},a.fn.ajaxSubmit=function(b,c,e,h){function i(c){var d,e,f=a.param(c,b.traditional).split("&"),g=f.length,h=[];for(d=0;d',z).val(k.extraData[m].value).appendTo(x)[0]):j.push(a(' ',z).val(k.extraData[m]).appendTo(x)[0]));k.iframeTarget||p.appendTo(A),q.attachEvent?q.attachEvent("onload",h):q.addEventListener("load",h,!1),setTimeout(b,15);try{x.submit()}catch(r){var s=document.createElement("form").submit;s.apply(x)}}finally{x.setAttribute("action",f),x.setAttribute("enctype",i),c?x.setAttribute("target",c):o.removeAttr("target"),a(j).remove()}}function h(b){if(!r.aborted&&!H){if(G=e(q),G||(d("cannot access response document"),b=C),b===B&&r)return r.abort("timeout"),void y.reject(r,"timeout");if(b===C&&r)return r.abort("server abort"),void y.reject(r,"error","server abort");if(G&&G.location.href!==k.iframeSrc||v){q.detachEvent?q.detachEvent("onload",h):q.removeEventListener("load",h,!1);var c,f="success";try{if(v)throw"timeout";var g="xml"===k.dataType||G.XMLDocument||a.isXMLDoc(G);if(d("isXml="+g),!g&&window.opera&&(null===G.body||!G.body.innerHTML)&&--I)return d("requeing onLoad callback, DOM not available"),void setTimeout(h,250);var i=G.body?G.body:G.documentElement;r.responseText=i?i.innerHTML:null,r.responseXML=G.XMLDocument?G.XMLDocument:G,g&&(k.dataType="xml"),r.getResponseHeader=function(a){var b={"content-type":k.dataType};return b[a.toLowerCase()]},i&&(r.status=Number(i.getAttribute("status"))||r.status,r.statusText=i.getAttribute("statusText")||r.statusText);var j=(k.dataType||"").toLowerCase(),l=/(json|script|text)/.test(j);if(l||k.textarea){var n=G.getElementsByTagName("textarea")[0];if(n)r.responseText=n.value,r.status=Number(n.getAttribute("status"))||r.status,r.statusText=n.getAttribute("statusText")||r.statusText;else if(l){var o=G.getElementsByTagName("pre")[0],s=G.getElementsByTagName("body")[0];o?r.responseText=o.textContent?o.textContent:o.innerText:s&&(r.responseText=s.textContent?s.textContent:s.innerText)}}else"xml"===j&&!r.responseXML&&r.responseText&&(r.responseXML=J(r.responseText));try{F=L(r,j,k)}catch(t){f="parsererror",r.error=c=t||f}}catch(t){d("error caught: ",t),f="error",r.error=c=t||f}r.aborted&&(d("upload aborted"),f=null),r.status&&(f=r.status>=200&&r.status<300||304===r.status?"success":"error"),"success"===f?(k.success&&k.success.call(k.context,F,"success",r),y.resolve(r.responseText,"success",r),m&&a.event.trigger("ajaxSuccess",[r,k])):f&&("undefined"==typeof c&&(c=r.statusText),k.error&&k.error.call(k.context,r,f,c),y.reject(r,"error",c),m&&a.event.trigger("ajaxError",[r,k,c])),m&&a.event.trigger("ajaxComplete",[r,k]),m&&!--a.active&&a.event.trigger("ajaxStop"),k.complete&&k.complete.call(k.context,r,f),H=!0,k.timeout&&clearTimeout(w),setTimeout(function(){k.iframeTarget?p.attr("src",k.iframeSrc):p.remove(),r.responseXML=null},100)}}}var i,j,k,m,n,p,q,r,t,u,v,w,x=o[0],y=a.Deferred();if(y.abort=function(a){r.abort(a)},c)for(j=0;j ',z),p.css({position:"absolute",top:"-1000px",left:"-1000px"})),q=p[0],r={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(b){var c="timeout"===b?"timeout":"aborted";d("aborting upload... "+c),this.aborted=1;try{q.contentWindow.document.execCommand&&q.contentWindow.document.execCommand ("Stop")}catch(e){}p.attr("src",k.iframeSrc),r.error=c,k.error&&k.error.call(k.context,r,c,b),m&&a.event.trigger("ajaxError",[r,k,c]),k.complete&&k.complete.call(k.context,r,c)}},m=k.global,m&&0===a.active++&&a.event.trigger("ajaxStart"),m&&a.event.trigger("ajaxSend",[r,k]),k.beforeSend&&k.beforeSend.call(k.context,r,k)===!1)return k.global&&a.active--,y.reject(),y;if(r.aborted)return y.reject(),y;t=x.clk,t&&(u=t.name,u&&!t.disabled&&(k.extraData=k.extraData||{},k.extraData[u]=t.value,"image"===t.type&&(k.extraData[u+".x"]=x.clk_x,k.extraData[u+".y"]=x.clk_y)));var B=1,C=2,D=a("meta[name=csrf-token]").attr("content"),E=a("meta[name=csrf-param]").attr("content");E&&D&&(k.extraData=k.extraData||{},k.extraData[E]=D),k.forceSync?f():setTimeout(f,10);var F,G,H,I=50,J=a.parseXML||function(a,b){return window.ActiveXObject?(b=new ActiveXObject("Microsoft.XMLDOM"),b.async="false",b.loadXML(a)):b=(new DOMParser).parseFromString(a,"text/xml"),b&&b.documentElement&&"parsererror"!==b.documentElement.nodeName?b:null},K=a.parseJSON||function(a){return window.eval("("+a+")")},L=function(b,c,d){var e=b.getResponseHeader("content-type")||"",f=("xml"===c||!c)&&e.indexOf("xml")>=0,g=f?b.responseXML:b.responseText;return f&&"parsererror"===g.documentElement.nodeName&&a.error&&a.error("parsererror"),d&&d.dataFilter&&(g=d.dataFilter(g,c)),"string"==typeof g&&(("json"===c||!c)&&e.indexOf("json")>=0?g=K(g):("script"===c||!c)&&e.indexOf("javascript")>=0&&a.globalEval(g)),g};return y}if(!this.length)return d("ajaxSubmit: skipping submit process - no element selected"),this;var l,m,n,o=this;"function"==typeof b?b={success:b}:"string"==typeof b||b===!1&&arguments.length>0?(b={url:b,data:c,dataType:e},"function"==typeof h&&(b.success=h)):"undefined"==typeof b&&(b={}),l=b.method||b.type||this.attr2("method"),m=b.url||this.attr2("action"),n="string"==typeof m?a.trim(m):"",n=n||window.location.href||"",n&&(n=(n.match(/^([^#]+)/)||[])[1]),b=a.extend(!0,{url:n,success:a.ajaxSettings.success,type:l||a.ajaxSettings.type,iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},b);var p={};if(this.trigger("form-pre-serialize",[this,b,p]),p.veto)return d("ajaxSubmit: submit vetoed via form-pre-serialize trigger"),this;if(b.beforeSerialize&&b.beforeSerialize(this,b)===!1)return d("ajaxSubmit: submit aborted via beforeSerialize callback"),this;var q=b.traditional;"undefined"==typeof q&&(q=a.ajaxSettings.traditional);var r,s=[],t=this.formToArray(b.semantic,s,b.filtering);if(b.data){var u=a.isFunction(b.data)?b.data(t):b.data;b.extraData=u,r=a.param(u,q)}if(b.beforeSubmit&&b.beforeSubmit(t,this,b)===!1)return d("ajaxSubmit: submit aborted via beforeSubmit callback"),this;if(this.trigger("form-submit-validate",[t,this,b,p]),p.veto)return d("ajaxSubmit: submit vetoed via form-submit-validate trigger"),this;var v=a.param(t,q);r&&(v=v?v+"&"+r:r),"GET"===b.type.toUpperCase()?(b.url+=(b.url.indexOf("?")>=0?"&":"?")+v,b.data=null):b.data=v;var w=[];if(b.resetForm&&w.push(function(){o.resetForm()}),b.clearForm&&w.push(function(){o.clearForm(b.includeHidden)}),!b.dataType&&b.target){var x=b.success||function(){};w.push(function(c,d,e){var f=arguments,g=b.replaceTarget?"replaceWith":"html";a(b.target)[g](c).each(function(){x.apply(this,f)})})}else b.success&&(a.isArray(b.success)?a.merge(w,b.success):w.push(b.success));if(b.success=function(a,c,d){for(var e=b.context||this,f=0,g=w.length;f0,C="multipart/form-data",D=o.attr("enctype")===C||o.attr("encoding")===C,E=f.fileapi&&f.formdata;d("fileAPI :"+E);var F,G=(B||D)&&!E;b.iframe!==!1&&(b.iframe||G)?b.closeKeepAlive?a.get(b.closeKeepAlive,function(){F=k(t)}):F=k(t):F=(B||D)&&E?j(t):a.ajax(b),o.removeData("jqxhr").data("jqxhr",F);for(var H=0;H0)&&(e={url:e,data:f,dataType:g},"function"==typeof h&&(e.success=h)),e=e||{},e.delegation=e.delegation&&a.isFunction(a.fn.on),!e.delegation&&0===this.length){var i={s:this.selector,c:this.context};return!a.isReady&&i.s?(d("DOM not ready, queuing ajaxForm"),a(function(){a(i.s,i.c).ajaxForm(e)}),this):(d("terminating; zero elements found by selector"+(a.isReady?"":" (DOM not ready)")),this)}return e.delegation?(a(document).off("submit.form-plugin",this.selector,b).off("click.form-plugin",this.selector,c).on("submit.form-plugin",this.selector,e,b).on("click.form-plugin",this.selector,e,c),this):this.ajaxFormUnbind().on("submit.form-plugin",e,b).on("click.form-plugin",e,c)},a.fn.ajaxFormUnbind=function(){return this.off("submit.form-plugin click.form-plugin")},a.fn.formToArray=function(b,c,d){var e=[];if(0===this.length)return e;var g,h=this[0],i=this.attr("id"),j=b||"undefined"==typeof h.elements?h.getElementsByTagName("*"):h.elements;if(j&&(j=a.makeArray(j)),i&&(b||/(Edge|Trident)\//.test(navigator.userAgent))&&(g=a(':input[form="'+i+'"]').get(),g.length&&(j=(j||[]).concat(g))),!j||!j.length)return e;a.isFunction(d)&&(j=a.map(j,d));var k,l,m,n,o,p,q;for(k=0,p=j.length;k1e3)g=1e3;else if(~~g<200)g=200;f.height=g}if("link"===d.message)if(h=b.createElement("a"),i=b.createElement("a"),h.href=f.getAttribute("src"),i.href=d.value,i.host===h.host)if(b.activeElement===f)a.top.location.href=d.value}else;}},d)a.addEventListener("message",a.wp.receiveEmbedMessage,!1),b.addEventListener("DOMContentLoaded",c,!1),a.addEventListener("load",c,!1)}(window,document);
document.documentElement.className+=" js_active ",document.documentElement.className+="ontouchstart"in document.documentElement?" vc_mobile ":" vc_desktop ",function(){for(var prefix=["-webkit-","-moz-","-ms-","-o-",""],i=0;i=$tabs.tabs("length")&&(index=0),$tabs.tabs("select",index)):(index=$tabs.tabs("option","active"),length=$tabs.find(".wpb_tab").length,index=jQuery(this).parent().hasClass("wpb_next_slide")?length<=index+1?0:index+1:index-1<0?length-1:index-1,$tabs.tabs("option","active",index))})})}}),"function"!=typeof window.vc_accordionBehaviour&&(window.vc_accordionBehaviour=function(){jQuery(".wpb_accordion").each(function(index){var $tabs,active_tab,collapsible,$this=jQuery(this);$this.attr("data-interval"),collapsible=!1===(active_tab=!isNaN(jQuery(this).data("active-tab"))&&0 div > h3",autoHeight:!1,heightStyle:"content",active:active_tab,collapsible:collapsible,navigation:!0,activate:vc_accordionActivate,change:function(event,ui){void 0!==jQuery.fn.isotope&&ui.newContent.find(".isotope").isotope("layout"),vc_carouselBehaviour(ui.newPanel)}}),!0===$this.data("vcDisableKeydown")&&($tabs.data("uiAccordion")._keydown=function(){})})}),"function"!=typeof window.vc_teaserGrid&&(window.vc_teaserGrid=function(){var layout_modes={fitrows:"fitRows",masonry:"masonry"};jQuery(".wpb_grid .teaser_grid_container:not(.wpb_carousel), .wpb_filtered_grid .teaser_grid_container:not(.wpb_carousel)").each(function(){var $container=jQuery(this),$thumbs=$container.find(".wpb_thumbnails"),layout_mode=$thumbs.attr("data-layout-mode");$thumbs.isotope({itemSelector:".isotope-item",layoutMode:void 0===layout_modes[layout_mode]?"fitRows":layout_modes[layout_mode]}),$container.find(".categories_filter a").data("isotope",$thumbs).click(function(e){e&&e.preventDefault&&e.preventDefault();var $thumbs=jQuery(this).data("isotope");jQuery(this).parent().parent().find(".active").removeClass("active"),jQuery(this).parent().addClass("active"),$thumbs.isotope({filter:jQuery(this).attr("data-filter")})}),jQuery(window).bind("load resize",function(){$thumbs.isotope("layout")})})}),"function"!=typeof window.vc_carouselBehaviour&&(window.vc_carouselBehaviour=function($parent){($parent?$parent.find(".wpb_carousel"):jQuery(".wpb_carousel")).each(function(){var $this=jQuery(this);if(!0!==$this.data("carousel_enabled")&&$this.is(":visible")){$this.data("carousel_enabled",!0);getColumnsCount(jQuery(this));jQuery(this).hasClass("columns_count_1")&&900;var carousel_li=jQuery(this).find(".wpb_thumbnails-fluid li");carousel_li.css({"margin-right":carousel_li.css("margin-left"),"margin-left":0});var fluid_ul=jQuery(this).find("ul.wpb_thumbnails-fluid");fluid_ul.width(fluid_ul.width()+300),jQuery(window).resize(function(){screen_size!=(screen_size=getSizeName())&&window.setTimeout(function(){location.reload()},20)})}})}),"function"!=typeof window.vc_slidersBehaviour&&(window.vc_slidersBehaviour=function(){jQuery(".wpb_gallery_slides").each(function(index){var $imagesGrid,this_element=jQuery(this);if(this_element.hasClass("wpb_slider_nivo")){var sliderTimeout=1e3*this_element.attr("data-interval");0===sliderTimeout&&(sliderTimeout=9999999999),this_element.find(".nivoSlider").nivoSlider({effect:"boxRainGrow,boxRain,boxRainReverse,boxRainGrowReverse",slices:15,boxCols:8,boxRows:4,animSpeed:800,pauseTime:sliderTimeout,startSlide:0,directionNav:!0,directionNavHide:!0,controlNav:!0,keyboardNav:!1,pauseOnHover:!0,manualAdvance:!1,prevText:"Prev",nextText:"Next"})}else this_element.hasClass("wpb_image_grid")&&(jQuery.fn.imagesLoaded?$imagesGrid=this_element.find(".wpb_image_grid_ul").imagesLoaded(function(){$imagesGrid.isotope({itemSelector:".isotope-item",layoutMode:"fitRows"})}):this_element.find(".wpb_image_grid_ul").isotope({itemSelector:".isotope-item",layoutMode:"fitRows"}))})}),"function"!=typeof window.vc_prettyPhoto&&(window.vc_prettyPhoto=function(){try{jQuery&&jQuery.fn&&jQuery.fn.prettyPhoto&&jQuery('a.prettyphoto, .gallery-icon a[href*=".jpg"]').prettyPhoto({animationSpeed:"normal",hook:"data-rel",padding:15,opacity:.7,showTitle:!0,allowresize:!0,counter_separator_label:"/",hideflash:!1,deeplinking:!1,modal:!1,callback:function(){-1
')}),vc_initVideoBackgrounds(),callSkrollInit=!1,window.vcParallaxSkroll&&window.vcParallaxSkroll.destroy(),$(".vc_parallax-inner").remove(),$("[data-5p-top-bottom]").removeAttr("data-5p-top-bottom data-30p-top-bottom"),$("[data-vc-parallax]").each(function(){var skrollrSize,skrollrStart,$parallaxElement,parallaxImage,youtubeId;callSkrollInit=!0,"on"===$(this).data("vcParallaxOFade")&&$(this).children().attr("data-5p-top-bottom","opacity:0;").attr("data-30p-top-bottom","opacity:1;"),skrollrSize=100*$(this).data("vcParallax"),($parallaxElement=$("
").addClass("vc_parallax-inner").appendTo($(this))).height(skrollrSize+"%"),parallaxImage=$(this).data("vcParallaxImage"),(youtubeId=vcExtractYoutubeId(parallaxImage))?insertYoutubeVideoAsBackground($parallaxElement,youtubeId):void 0!==parallaxImage&&$parallaxElement.css("background-image","url("+parallaxImage+")"),skrollrStart=-(skrollrSize-100),$parallaxElement.attr("data-bottom-top","top: "+skrollrStart+"%;").attr("data-top-bottom","top: 0%;")}),callSkrollInit&&window.skrollr&&(vcSkrollrOptions={forceHeight:!1,smoothScrolling:!1,mobileCheck:function(){return!1}},window.vcParallaxSkroll=skrollr.init(vcSkrollrOptions),window.vcParallaxSkroll)}),"function"!=typeof window.vc_gridBehaviour&&(window.vc_gridBehaviour=function(){jQuery.fn.vcGrid&&jQuery("[data-vc-grid]").vcGrid()}),"function"!=typeof window.getColumnsCount&&(window.getColumnsCount=function(el){for(var find=!1,i=1;!1===find;){if(el.hasClass("columns_count_"+i))return find=!0,i;i++}});var screen_size=getSizeName();function getSizeName(){var screen_w=jQuery(window).width();return 1170
').find(".inner");new YT.Player($container[0],{width:"100%",height:"100%",videoId:youtubeId,playerVars:{playlist:youtubeId,iv_load_policy:3,enablejsapi:1,disablekb:1,autoplay:1,controls:0,showinfo:0,rel:0,loop:1,wmode:"transparent"},events:{onReady:function(event){event.target.mute().setLoop(!0)}}}),vcResizeVideoBackground($element),jQuery(window).bind("resize",function(){vcResizeVideoBackground($element)})}),"function"!=typeof window.vcResizeVideoBackground&&(window.vcResizeVideoBackground=function($element){var iframeW,iframeH,marginLeft,marginTop,containerW=$element.innerWidth(),containerH=$element.innerHeight();containerW/containerH<16/9?(iframeW=containerH*(16/9),iframeH=containerH,marginLeft=-Math.round((iframeW-containerW)/2)+"px",marginTop=-Math.round((iframeH-containerH)/2)+"px"):(iframeH=(iframeW=containerW)*(9/16),marginTop=-Math.round((iframeH-containerH)/2)+"px",marginLeft=-Math.round((iframeW-containerW)/2)+"px"),iframeW+="px",iframeH+="px",$element.find(".vc_video-bg iframe").css({maxWidth:"1000%",marginLeft:marginLeft,marginTop:marginTop,width:iframeW,height:iframeH})}),"function"!=typeof window.vcExtractYoutubeId&&(window.vcExtractYoutubeId=function(url){if(void 0===url)return!1;var id=url.match(/(?:https?:\/{2})?(?:w{3}\.)?youtu(?:be)?\.(?:com|be)(?:\/watch\?v=|\/)([^\s&]+)/);return null!==id&&id[1]}),"function"!=typeof window.vc_googleMapsPointer&&(window.vc_googleMapsPointer=function(){var $=window.jQuery,$wpbGmapsWidget=$(".wpb_gmaps_widget");$wpbGmapsWidget.click(function(){$("iframe",this).css("pointer-events","auto")}),$wpbGmapsWidget.mouseleave(function(){$("iframe",this).css("pointer-events","none")}),$(".wpb_gmaps_widget iframe").css("pointer-events","none")}),"function"!=typeof window.vc_setHoverBoxPerspective&&(window.vc_setHoverBoxPerspective=function(hoverBox){hoverBox.each(function(){var $this=jQuery(this),perspective=4*$this.width()+"px";$this.css("perspective",perspective)})}),"function"!=typeof window.vc_setHoverBoxHeight&&(window.vc_setHoverBoxHeight=function(hoverBox){hoverBox.each(function(){var $this=jQuery(this),hoverBoxInner=$this.find(".vc-hoverbox-inner");hoverBoxInner.css("min-height",0);var frontHeight=$this.find(".vc-hoverbox-front-inner").outerHeight(),backHeight=$this.find(".vc-hoverbox-back-inner").outerHeight(),hoverBoxHeight=backHeight