$=jQuery;$(document).ready(function(){var data_id=$('#video').attr('data-id');var server_id=$('#video').attr('data-sv');if(data_id){server(data_id,server_id);}
$('.icon-zoom').click(function(){if($('.icon-zoom').text()=='Zoom+'){$(".icon-zoom").text("Zoom-");$("#main-content").animate({"width":"92%"});$('#sidebar').css("width","92%");$('#sidebar').css("float","left");$('html,body').animate({scrollTop:$('.header-play').offset().top},'slow');}else{$(".icon-zoom").text("Zoom+");$('#main-content').css("width","67%");$('#sidebar').css("width","31%");$('#sidebar').css("float","right");$('html,body').animate({scrollTop:$('#page').offset().top},'slow');}});$('#header-icon').click(function(){$('body').toggleClass('with-sidebar');});$('#search-icon').click(function(){$('body').toggleClass('search-sidebar');});jQuery("#movie-carousel-mid").carouFredSel({prev:'#prevMid',next:'#nextMid',auto:false,responsive:true,width:'100%',scroll:2,items:{width:250,height:'75%',visible:{min:2,max:4}}});});function server(id,server){var id=parseInt(id);var url=tvideo.ajax_url;$('#video').addClass('loading');$.post(url,{'action':'get_video',idPlay:id,serverPlay:server},function(data){$('#video').removeClass('loading').html(data);$('.server').removeClass('active');$('#server'+server).addClass('active');});return false;}
function dlvideo(IdDownload){$('#show-dl').html('<p><img src=\"'+tvideo.theme_uri+'/includes/images/loadingdl.svg\" /></p>');var url=tvideo.ajax_url;var data={'action':'download_video','IdDownload':IdDownload};$.post(url,data,function(e){$("#show-dl").html(e);});return false;}
function showLoadingImage(){$('#page').append('<div id="effect"><div id="loading-wait">Loading please wait...</div></div>');}
function hideLoadingImage(){$('#effect').remove();$('#loading-wait').remove();}
function topview(object,viewID,selected){showLoadingImage();var url=tvideo.ajax_url;var data={'action':'topview','viewID':viewID};$.post(url,data,function(e){$(object).find(".list-top-movie").html(e);hideLoadingImage();});$(object).find(".tabs-movie-block a").removeClass("active");$(selected).addClass("active");return false;}
var isToutchDevice=null;var FX_DEVICE_TOUTCH=false;var FX_DEVICE_SMALL=false;jQuery(document).ready(function(){isToutchDevice=function(){try{document.createEvent("TouchEvent");return true;}catch(e){}
try{return('ontouchstart'in document.documentElement);}catch(e){}
return false;}
if(isToutchDevice()){jQuery('body').addClass("fx-device-toutch");FX_DEVICE_TOUTCH=true;}else{FX_DEVICE_TOUTCH=false;}
try{if(jQuery(window).width()<=480||jQuery(window).height()<=480){jQuery('body').addClass("fx-device-small");FX_DEVICE_SMALL=true;}else{FX_DEVICE_SMALL=false;}}catch(e){FX_DEVICE_SMALL=false;}});jQuery(document).ready(function(){try{if(typeof topSliderInit=="undefined"&&(typeof FX_DEVICE_SMALL=="undefined"||!FX_DEVICE_SMALL||typeof FX_DEVICE_TOUTCH=="undefined"||!FX_DEVICE_TOUTCH)){jQuery('#movie-carousel-top').carouFredSel({auto:false,prev:'#prevTop',next:'#nextTop',});window.topSliderInit=true;eval('console.log("topSliderInit")');}}catch(err){console.error(err.message);}});var lastScrollTop=0;$(window).scroll(function(event){var st=$(this).scrollTop();if(st<0)st=0;if(st>lastScrollTop&&st>46){$('#header').css('top','-46px');}else{$('#header').css('top','0');}
lastScrollTop=st;});
(function ($, w){
"use strict";
var methods=(function (){
var c={
bcClass: 'sf-breadcrumb',
menuClass: 'sf-js-enabled',
anchorClass: 'sf-with-ul',
menuArrowClass: 'sf-arrows'
},
ios=(function (){
var ios=/^(?![\w\W]*Windows Phone)[\w\W]*(iPhone|iPad|iPod)/i.test(navigator.userAgent);
if(ios){
$('html').css('cursor', 'pointer').on('click', $.noop);
}
return ios;
})(),
wp7=(function (){
var style=document.documentElement.style;
return ('behavior' in style&&'fill' in style&&/iemobile/i.test(navigator.userAgent));
})(),
unprefixedPointerEvents=(function (){
return (!!w.PointerEvent);
})(),
toggleMenuClasses=function ($menu, o, add){
var classes=c.menuClass,
method;
if(o.cssArrows){
classes +=' ' + c.menuArrowClass;
}
method=(add) ? 'addClass':'removeClass';
$menu[method](classes);
},
setPathToCurrent=function ($menu, o){
return $menu.find('li.' + o.pathClass).slice(0, o.pathLevels)
.addClass(o.hoverClass + ' ' + c.bcClass)
.filter(function (){
return ($(this).children(o.popUpSelector).hide().show().length);
}).removeClass(o.pathClass);
},
toggleAnchorClass=function ($li, add){
var method=(add) ? 'addClass':'removeClass';
$li.children('a')[method](c.anchorClass);
},
toggleTouchAction=function ($menu){
var msTouchAction=$menu.css('ms-touch-action');
var touchAction=$menu.css('touch-action');
touchAction=touchAction||msTouchAction;
touchAction=(touchAction==='pan-y') ? 'auto':'pan-y';
$menu.css({
'ms-touch-action': touchAction,
'touch-action': touchAction
});
},
getMenu=function ($el){
return $el.closest('.' + c.menuClass);
},
getOptions=function ($el){
return getMenu($el).data('sfOptions');
},
over=function (){
var $this=$(this),
o=getOptions($this);
clearTimeout(o.sfTimer);
$this.siblings().superfish('hide').end().superfish('show');
},
close=function (o){
o.retainPath=($.inArray(this[0], o.$path) > -1);
this.superfish('hide');
if(!this.parents('.' + o.hoverClass).length){
o.onIdle.call(getMenu(this));
if(o.$path.length){
$.proxy(over, o.$path)();
}}
},
out=function (){
var $this=$(this),
o=getOptions($this);
if(ios){
$.proxy(close, $this, o)();
}else{
clearTimeout(o.sfTimer);
o.sfTimer=setTimeout($.proxy(close, $this, o), o.delay);
}},
touchHandler=function (e){
var $this=$(this),
o=getOptions($this),
$ul=$this.siblings(e.data.popUpSelector);
if(o.onHandleTouch.call($ul)===false){
return this;
}
if($ul.length > 0&&$ul.is(':hidden')){
$this.one('click.superfish', false);
if(e.type==='MSPointerDown'||e.type==='pointerdown'){
$this.trigger('focus');
}else{
$.proxy(over, $this.parent('li'))();
}}
},
applyHandlers=function ($menu, o){
var targets='li:has(' + o.popUpSelector + ')';
if($.fn.hoverIntent&&!o.disableHI){
$menu.hoverIntent(over, out, targets);
}else{
$menu
.on('mouseenter.superfish', targets, over)
.on('mouseleave.superfish', targets, out);
}
var touchevent='MSPointerDown.superfish';
if(unprefixedPointerEvents){
touchevent='pointerdown.superfish';
}
if(!ios){
touchevent +=' touchend.superfish';
}
if(wp7){
touchevent +=' mousedown.superfish';
}
$menu
.on('focusin.superfish', 'li', over)
.on('focusout.superfish', 'li', out)
.on(touchevent, 'a', o, touchHandler);
};
return {
hide: function (instant){
if(this.length){
var $this=this,
o=getOptions($this);
if(!o){
return this;
}
var not=(o.retainPath===true) ? o.$path:'',
$ul=$this.find('li.' + o.hoverClass).add(this).not(not).removeClass(o.hoverClass).children(o.popUpSelector),
speed=o.speedOut;
if(instant){
$ul.show();
speed=0;
}
o.retainPath=false;
if(o.onBeforeHide.call($ul)===false){
return this;
}
$ul.stop(true, true).animate(o.animationOut, speed, function (){
var $this=$(this);
o.onHide.call($this);
});
}
return this;
},
show: function (){
var o=getOptions(this);
if(!o){
return this;
}
var $this=this.addClass(o.hoverClass),
$ul=$this.children(o.popUpSelector);
if(o.onBeforeShow.call($ul)===false){
return this;
}
$ul.stop(true, true).animate(o.animation, o.speed, function (){
o.onShow.call($ul);
});
return this;
},
destroy: function (){
return this.each(function (){
var $this=$(this),
o=$this.data('sfOptions'),
$hasPopUp;
if(!o){
return false;
}
$hasPopUp=$this.find(o.popUpSelector).parent('li');
clearTimeout(o.sfTimer);
toggleMenuClasses($this, o);
toggleAnchorClass($hasPopUp);
toggleTouchAction($this);
$this.off('.superfish').off('.hoverIntent');
$hasPopUp.children(o.popUpSelector).attr('style', function (i, style){
return style.replace(/display[^;]+;?/g, '');
});
o.$path.removeClass(o.hoverClass + ' ' + c.bcClass).addClass(o.pathClass);
$this.find('.' + o.hoverClass).removeClass(o.hoverClass);
o.onDestroy.call($this);
$this.removeData('sfOptions');
});
},
init: function (op){
return this.each(function (){
var $this=$(this);
if($this.data('sfOptions')){
return false;
}
var o=$.extend({}, $.fn.superfish.defaults, op),
$hasPopUp=$this.find(o.popUpSelector).parent('li');
o.$path=setPathToCurrent($this, o);
$this.data('sfOptions', o);
toggleMenuClasses($this, o, true);
toggleAnchorClass($hasPopUp, true);
toggleTouchAction($this);
applyHandlers($this, o);
$hasPopUp.not('.' + c.bcClass).superfish('hide', true);
o.onInit.call(this);
});
}};})();
$.fn.superfish=function (method, args){
if(methods[method]){
return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
}
else if(typeof method==='object'||! method){
return methods.init.apply(this, arguments);
}else{
return $.error('Method ' +  method + ' does not exist on jQuery.fn.superfish');
}};
$.fn.superfish.defaults={
popUpSelector: 'ul,.sf-mega',
hoverClass: 'sfHover',
pathClass: 'overrideThisToUse',
pathLevels: 1,
delay: 800,
animation: {opacity: 'show'},
animationOut: {opacity: 'hide'},
speed: 'normal',
speedOut: 'fast',
cssArrows: true,
disableHI: false,
onInit: $.noop,
onBeforeShow: $.noop,
onShow: $.noop,
onBeforeHide: $.noop,
onHide: $.noop,
onIdle: $.noop,
onDestroy: $.noop,
onHandleTouch: $.noop
};})(jQuery, window);
var enjoyvideo=enjoyvideo||{};
enjoyvideo.scrolled=0;
if(! Element.prototype.closest){
Element.prototype.closest=function(s){
var el=this;
do {
if(el.matches(s)){
return el;
}
el=el.parentElement||el.parentNode;
} while(el!==null&&el.nodeType===1);
return null;
};}
if(window.NodeList&&! NodeList.prototype.forEach){
NodeList.prototype.forEach=function(callback, thisArg){
var i;
var len=this.length;
thisArg=thisArg||window;
for(i=0; i < len; i++){
callback.call(thisArg, this[ i ], i, this);
}};}
enjoyvideo.createEvent=function(eventName){
var event;
if(typeof window.Event==='function'){
event=new Event(eventName);
}else{
event=document.createEvent('Event');
event.initEvent(eventName, true, false);
}
return event;
};
if(! Element.prototype.matches){
Element.prototype.matches =
Element.prototype.matchesSelector ||
Element.prototype.mozMatchesSelector ||
Element.prototype.msMatchesSelector ||
Element.prototype.oMatchesSelector ||
Element.prototype.webkitMatchesSelector ||
function(s){
var matches=(this.document||this.ownerDocument).querySelectorAll(s),
i=matches.length;
while(--i >=0&&matches.item(i)!==this){}
return i > -1;
};}
enjoyvideo.touchEnabled={
init: function(){
var matchMedia=function(){
var prefixes=[ '-webkit-', '-moz-', '-o-', '-ms-' ];
var query=[ '(', prefixes.join('touch-enabled),('), 'heartz', ')' ].join('');
return window.matchMedia&&window.matchMedia(query).matches;
};
if(( 'ontouchstart' in window)||(window.DocumentTouch&&document instanceof window.DocumentTouch)||matchMedia()){
document.body.classList.add('touch-enabled');
}}
};
enjoyvideo.coverModals={
init: function(){
if(document.querySelector('.cover-modal')){
this.onToggle();
this.outsideUntoggle();
this.closeOnEscape();
this.hideAndShowModals();
}},
onToggle: function(){
document.querySelectorAll('.cover-modal').forEach(function(element){
element.addEventListener('toggled', function(event){
var modal=event.target,
body=document.body;
if(modal.classList.contains('active')){
body.classList.add('showing-modal');
}else{
body.classList.remove('showing-modal');
body.classList.add('hiding-modal');
setTimeout(function(){
body.classList.remove('hiding-modal');
}, 500);
}});
});
},
outsideUntoggle: function(){
document.addEventListener('click', function(event){
var target=event.target;
var modal=document.querySelector('.cover-modal.active');
if(event.target.tagName.toLowerCase()==='a'&&event.target.hash.includes('#')&&modal!==null){
this.untoggleModal(modal);
setTimeout(function(){
var anchor=document.getElementById(event.target.hash.slice(1));
anchor.scrollIntoView();
}, 550);
}
if(target===modal){
this.untoggleModal(target);
}}.bind(this));
},
closeOnEscape: function(){
document.addEventListener('keydown', function(event){
if(event.keyCode===27){
event.preventDefault();
document.querySelectorAll('.cover-modal.active').forEach(function(element){
this.untoggleModal(element);
}.bind(this));
}}.bind(this));
},
hideAndShowModals: function(){
var _doc=document,
_win=window,
modals=_doc.querySelectorAll('.cover-modal'),
htmlStyle=_doc.documentElement.style,
adminBar=_doc.querySelector('#wpadminbar');
function getAdminBarHeight(negativeValue){
var height,
currentScroll=_win.pageYOffset;
if(adminBar){
height=currentScroll + adminBar.getBoundingClientRect().height;
return negativeValue ? -height:height;
}
return currentScroll===0 ? 0:-currentScroll;
}
function htmlStyles(){
var overflow=_win.innerHeight > _doc.documentElement.getBoundingClientRect().height;
return {
'overflow-y': overflow ? 'hidden':'scroll',
position: 'fixed',
width: '100%',
top: getAdminBarHeight(true) + 'px',
left: 0
};}
modals.forEach(function(modal){
modal.addEventListener('toggle-target-before-inactive', function(event){
var styles=htmlStyles(),
offsetY=_win.pageYOffset,
paddingTop=(Math.abs(getAdminBarHeight()) - offsetY) + 'px',
mQuery=_win.matchMedia('(max-width: 600px)');
if(event.target!==modal){
return;
}
Object.keys(styles).forEach(function(styleKey){
htmlStyle.setProperty(styleKey, styles[ styleKey ]);
});
_win.enjoyvideo.scrolled=parseInt(styles.top, 10);
if(adminBar){
_doc.body.style.setProperty('padding-top', paddingTop);
if(mQuery.matches){
if(offsetY >=getAdminBarHeight()){
modal.style.setProperty('top', 0);
}else{
modal.style.setProperty('top',(getAdminBarHeight() - offsetY) + 'px');
}}
}
modal.classList.add('show-modal');
});
modal.addEventListener('toggle-target-after-inactive', function(event){
if(event.target!==modal){
return;
}
setTimeout(function(){
var clickedEl=enjoyvideo.toggles.clickedEl;
modal.classList.remove('show-modal');
Object.keys(htmlStyles()).forEach(function(styleKey){
htmlStyle.removeProperty(styleKey);
});
if(adminBar){
_doc.body.style.removeProperty('padding-top');
modal.style.removeProperty('top');
}
if(clickedEl!==false){
clickedEl.focus();
clickedEl=false;
}
_win.scrollTo(0, Math.abs(_win.enjoyvideo.scrolled + getAdminBarHeight()));
_win.enjoyvideo.scrolled=0;
}, 500);
});
});
},
untoggleModal: function(modal){
var modalTargetClass,
modalToggle=false;
if(modal.dataset.modalTargetString){
modalTargetClass=modal.dataset.modalTargetString;
modalToggle=document.querySelector('*[data-toggle-target="' + modalTargetClass + '"]');
}
if(modalToggle){
modalToggle.click();
}else{
modal.classList.remove('active');
}}
};
enjoyvideo.intrinsicRatioVideos={
init: function(){
this.makeFit();
window.addEventListener('resize', function(){
this.makeFit();
}.bind(this));
},
makeFit: function(){
document.querySelectorAll('iframe, object, video').forEach(function(video){
var ratio, iTargetWidth,
container=video.parentNode;
if(video.classList.contains('intrinsic-ignore')||video.parentNode.classList.contains('intrinsic-ignore')){
return true;
}
if(! video.dataset.origwidth){
video.setAttribute('data-origwidth', video.width);
video.setAttribute('data-origheight', video.height);
}
iTargetWidth=container.offsetWidth;
ratio=iTargetWidth / video.dataset.origwidth;
video.style.width=iTargetWidth + 'px';
video.style.height=(video.dataset.origheight * ratio) + 'px';
});
}};
enjoyvideo.modalMenu={
init: function(){
this.expandLevel();
this.keepFocusInModal();
},
expandLevel: function(){
var modalMenus=document.querySelectorAll('.modal-menu');
modalMenus.forEach(function(modalMenu){
var activeMenuItem=modalMenu.querySelector('.current-menu-item');
if(activeMenuItem){
enjoyvideoFindParents(activeMenuItem, 'li').forEach(function(element){
var subMenuToggle=element.querySelector('.sub-menu-toggle');
if(subMenuToggle){
enjoyvideo.toggles.performToggle(subMenuToggle, true);
}});
}});
},
keepFocusInModal: function(){
var _doc=document;
_doc.addEventListener('keydown', function(event){
var toggleTarget, modal, selectors, elements, menuType, bottomMenu, activeEl, lastEl, firstEl, tabKey, shiftKey,
clickedEl=enjoyvideo.toggles.clickedEl;
if(clickedEl&&_doc.body.classList.contains('showing-modal')){
toggleTarget=clickedEl.dataset.toggleTarget;
selectors='input, a, button';
modal=_doc.querySelector(toggleTarget);
elements=modal.querySelectorAll(selectors);
elements=Array.prototype.slice.call(elements);
if('.menu-modal'===toggleTarget){
menuType=window.matchMedia('(min-width: 1000px)').matches;
menuType=menuType ? '.expanded-menu':'.mobile-menu';
elements=elements.filter(function(element){
return null!==element.closest(menuType)&&null!==element.offsetParent;
});
elements.unshift(_doc.querySelector('.close-nav-toggle'));
bottomMenu=_doc.querySelector('.menu-bottom > nav');
if(bottomMenu){
bottomMenu.querySelectorAll(selectors).forEach(function(element){
elements.push(element);
});
}}
lastEl=elements[ elements.length - 1 ];
firstEl=elements[0];
activeEl=_doc.activeElement;
tabKey=event.keyCode===9;
shiftKey=event.shiftKey;
if(! shiftKey&&tabKey&&lastEl===activeEl){
event.preventDefault();
firstEl.focus();
}
if(shiftKey&&tabKey&&firstEl===activeEl){
event.preventDefault();
lastEl.focus();
}}
});
}};
enjoyvideo.primaryMenu={
init: function(){
this.focusMenuWithChildren();
},
focusMenuWithChildren: function(){
var links, i, len,
menu=document.querySelector('.primary-menu-wrapper');
if(! menu){
return false;
}
links=menu.getElementsByTagName('a');
for(i=0, len=links.length; i < len; i++){
links[i].addEventListener('focus', toggleFocus, true);
links[i].addEventListener('blur', toggleFocus, true);
}
function toggleFocus(){
var self=this;
while(-1===self.className.indexOf('primary-menu')){
if('li'===self.tagName.toLowerCase()){
if(-1!==self.className.indexOf('focus')){
self.className=self.className.replace(' focus', '');
}else{
self.className +=' focus';
}}
self=self.parentElement;
}}
}};
enjoyvideo.toggles={
clickedEl: false,
init: function(){
this.toggle();
this.resizeCheck();
this.untoggleOnEscapeKeyPress();
},
performToggle: function(element, instantly){
var target, timeOutTime, classToToggle,
self=this,
_doc=document,
toggle=element,
targetString=toggle.dataset.toggleTarget,
activeClass='active';
if(! _doc.querySelectorAll('.show-modal').length){
self.clickedEl=_doc.activeElement;
}
if(targetString==='next'){
target=toggle.nextSibling;
}else{
target=_doc.querySelector(targetString);
}
if(target.classList.contains(activeClass)){
target.dispatchEvent(enjoyvideo.createEvent('toggle-target-before-active'));
}else{
target.dispatchEvent(enjoyvideo.createEvent('toggle-target-before-inactive'));
}
classToToggle=toggle.dataset.classToToggle ? toggle.dataset.classToToggle:activeClass;
timeOutTime=0;
if(target.classList.contains('cover-modal')){
timeOutTime=10;
}
setTimeout(function(){
var focusElement,
subMenued=target.classList.contains('sub-menu'),
newTarget=subMenued ? toggle.closest('.menu-item').querySelector('.sub-menu'):target,
duration=toggle.dataset.toggleDuration;
if(toggle.dataset.toggleType==='slidetoggle'&&! instantly&&duration!=='0'){
enjoyvideoMenuToggle(newTarget, duration);
}else{
newTarget.classList.toggle(classToToggle);
}
if(targetString==='next'){
toggle.classList.toggle(activeClass);
}else if(target.classList.contains('sub-menu')){
toggle.classList.toggle(activeClass);
}else{
_doc.querySelector('*[data-toggle-target="' + targetString + '"]').classList.toggle(activeClass);
}
enjoyvideoToggleAttribute(toggle, 'aria-expanded', 'true', 'false');
if(self.clickedEl&&-1!==toggle.getAttribute('class').indexOf('close-')){
enjoyvideoToggleAttribute(self.clickedEl, 'aria-expanded', 'true', 'false');
}
if(toggle.dataset.toggleBodyClass){
_doc.body.classList.toggle(toggle.dataset.toggleBodyClass);
}
if(toggle.dataset.setFocus){
focusElement=_doc.querySelector(toggle.dataset.setFocus);
if(focusElement){
if(target.classList.contains(activeClass)){
focusElement.focus();
}else{
focusElement.blur();
}}
}
target.dispatchEvent(enjoyvideo.createEvent('toggled'));
if(target.classList.contains(activeClass)){
target.dispatchEvent(enjoyvideo.createEvent('toggle-target-after-active'));
}else{
target.dispatchEvent(enjoyvideo.createEvent('toggle-target-after-inactive'));
}}, timeOutTime);
},
toggle: function(){
var self=this;
document.querySelectorAll('*[data-toggle-target]').forEach(function(element){
element.addEventListener('click', function(event){
event.preventDefault();
self.performToggle(element);
});
});
},
resizeCheck: function(){
if(document.querySelectorAll('*[data-untoggle-above], *[data-untoggle-below], *[data-toggle-above], *[data-toggle-below]').length){
window.addEventListener('resize', function(){
var winWidth=window.innerWidth,
toggles=document.querySelectorAll('.toggle');
toggles.forEach(function(toggle){
var unToggleAbove=toggle.dataset.untoggleAbove,
unToggleBelow=toggle.dataset.untoggleBelow,
toggleAbove=toggle.dataset.toggleAbove,
toggleBelow=toggle.dataset.toggleBelow;
if(! unToggleAbove&&! unToggleBelow&&! toggleAbove&&! toggleBelow){
return;
}
if((((unToggleAbove&&winWidth > unToggleAbove) ||
(unToggleBelow&&winWidth < unToggleBelow)) &&
toggle.classList.contains('active')) ||
(((toggleAbove&&winWidth > toggleAbove) ||
(toggleBelow&&winWidth < toggleBelow)) &&
! toggle.classList.contains('active'))
){
toggle.click();
}});
});
}},
untoggleOnEscapeKeyPress: function(){
document.addEventListener('keyup', function(event){
if(event.key==='Escape'){
document.querySelectorAll('*[data-untoggle-on-escape].active').forEach(function(element){
if(element.classList.contains('active')){
element.click();
}});
}});
}};
function enjoyvideoDomReady(fn){
if(typeof fn!=='function'){
return;
}
if(document.readyState==='interactive'||document.readyState==='complete'){
return fn();
}
document.addEventListener('DOMContentLoaded', fn, false);
}
enjoyvideoDomReady(function(){
enjoyvideo.toggles.init();
enjoyvideo.coverModals.init();
enjoyvideo.intrinsicRatioVideos.init();
enjoyvideo.modalMenu.init();
enjoyvideo.primaryMenu.init();
enjoyvideo.touchEnabled.init();
});
function enjoyvideoToggleAttribute(element, attribute, trueVal, falseVal){
if(trueVal===undefined){
trueVal=true;
}
if(falseVal===undefined){
falseVal=false;
}
if(element.getAttribute(attribute)!==trueVal){
element.setAttribute(attribute, trueVal);
}else{
element.setAttribute(attribute, falseVal);
}}
function enjoyvideoMenuToggle(target, duration){
var initialParentHeight, finalParentHeight, menu, menuItems, transitionListener,
initialPositions=[],
finalPositions=[];
if(! target){
return;
}
menu=target.closest('.menu-wrapper');
menuItems=menu.querySelectorAll('.menu-item');
menuItems.forEach(function(menuItem, index){
initialPositions[ index ]={ x: menuItem.offsetLeft, y: menuItem.offsetTop };});
initialParentHeight=target.parentElement.offsetHeight;
target.classList.add('toggling-target');
target.classList.toggle('active');
menuItems.forEach(function(menuItem, index){
finalPositions[ index ]={ x: menuItem.offsetLeft, y: menuItem.offsetTop };});
finalParentHeight=target.parentElement.offsetHeight;
target.classList.toggle('active');
menu.classList.add('is-toggling');
target.classList.toggle('active');
menuItems.forEach(function(menuItem, index){
var initialPosition=initialPositions[ index ];
if(initialPosition.y===0&&menuItem.parentElement===target){
initialPosition.y=initialParentHeight;
}
menuItem.style.transform='translate(' + initialPosition.x + 'px, ' + initialPosition.y + 'px)';
});
requestAnimationFrame(function(){
requestAnimationFrame(function(){
menu.classList.add('is-animating');
menuItems.forEach(function(menuItem, index){
var finalPosition=finalPositions[ index ];
if(finalPosition.y===0&&menuItem.parentElement===target){
finalPosition.y=finalParentHeight;
}
if(duration!==undefined){
menuItem.style.transitionDuration=duration + 'ms';
}
menuItem.style.transform='translate(' + finalPosition.x + 'px, ' + finalPosition.y + 'px)';
});
if(duration!==undefined){
target.style.transitionDuration=duration + 'ms';
}});
transitionListener=function(){
menu.classList.remove('is-animating');
menu.classList.remove('is-toggling');
target.classList.remove('toggling-target');
menuItems.forEach(function(menuItem){
menuItem.style.transform='';
menuItem.style.transitionDuration='';
});
target.style.transitionDuration='';
target.removeEventListener('transitionend', transitionListener);
};
target.addEventListener('transitionend', transitionListener);
});
}
function enjoyvideoFindParents(target, query){
var parents=[];
function traverse(item){
var parent=item.parentNode;
if(parent instanceof HTMLElement){
if(parent.matches(query)){
parents.push(parent);
}
traverse(parent);
}}
traverse(target);
return parents;
};
(function($){
$(document).ready(function(){
"use strict";
var example=$('.sf-menu').superfish({
delay:       100,
speed:       'fast',
autoArrows:  false
});
$('#featured-content .gradient').fadeIn("slow");
$('#featured-content .hentry .entry-header').fadeIn("slow");
$('.entry-content .wp-block-embed').eq(0).addClass('first-video').end();
$('.entry-content .wp-video').eq(0).addClass('first-video').end();
$('.entry-content iframe').eq(0).addClass('first-video').end();
$('.entry-content .wp-block-embed iframe').eq(0).removeClass('first-video').end();
$('.entry-content .first-video').eq(1).removeClass('first-video').end();
var video_height=$('.first-video').height();
$('article.has-embed').css('padding-top',video_height+25);
var video_height=$('.wp-video').height();
$('article.has-embed').css('padding-top',video_height+25);
$(window).on('resize', function(){
var video_height_r=$('.first-video').height();
$('article.has-embed').css('padding-top',video_height_r+25);
var video_height_r=$('.wp-video').height();
$('article.has-embed').css('padding-top',video_height_r+25);
});
$("#back-top").hide();
$(function (){
$(window).scroll(function (){
if($(this).scrollTop() > 100){
$('#back-top').fadeIn('200');
}else{
$('#back-top').fadeOut('200');
}});
$('#back-top a').click(function (){
$('body,html').animate({
scrollTop: 0
}, 400);
return false;
});
});
});
})(jQuery);
jQuery('.sidebar').theiaStickySidebar({
additionalMarginTop: 25,
additionalMarginBottom: 0
});
window.addComment=function(v){var I,C,h,E=v.document,b={commentReplyClass:"comment-reply-link",commentReplyTitleId:"reply-title",cancelReplyId:"cancel-comment-reply-link",commentFormId:"commentform",temporaryFormId:"wp-temp-form-div",parentIdFieldId:"comment_parent",postIdFieldId:"comment_post_ID"},e=v.MutationObserver||v.WebKitMutationObserver||v.MozMutationObserver,r="querySelector"in E&&"addEventListener"in v,n=!!E.documentElement.dataset;function t(){d(),e&&new e(o).observe(E.body,{childList:!0,subtree:!0})}function d(e){if(r&&(I=g(b.cancelReplyId),C=g(b.commentFormId),I)){I.addEventListener("touchstart",l),I.addEventListener("click",l);function t(e){if((e.metaKey||e.ctrlKey)&&13===e.keyCode)return C.removeEventListener("keydown",t),e.preventDefault(),C.submit.click(),!1}C&&C.addEventListener("keydown",t);for(var n,d=function(e){var t=b.commentReplyClass;e&&e.childNodes||(e=E);e=E.getElementsByClassName?e.getElementsByClassName(t):e.querySelectorAll("."+t);return e}(e),o=0,i=d.length;o<i;o++)(n=d[o]).addEventListener("touchstart",a),n.addEventListener("click",a)}}function l(e){var t,n,d=g(b.temporaryFormId);d&&h&&(g(b.parentIdFieldId).value="0",t=d.textContent,d.parentNode.replaceChild(h,d),this.style.display="none",n=(d=(d=g(b.commentReplyTitleId))&&d.firstChild)&&d.nextSibling,d&&d.nodeType===Node.TEXT_NODE&&t&&(n&&"A"===n.nodeName&&n.id!==b.cancelReplyId&&(n.style.display=""),d.textContent=t),e.preventDefault())}function a(e){var t=g(b.commentReplyTitleId),t=t&&t.firstChild.textContent,n=this,d=m(n,"belowelement"),o=m(n,"commentid"),i=m(n,"respondelement"),r=m(n,"postid"),n=m(n,"replyto")||t;d&&o&&i&&r&&!1===v.addComment.moveForm(d,o,i,r,n)&&e.preventDefault()}function o(e){for(var t=e.length;t--;)if(e[t].addedNodes.length)return void d()}function m(e,t){return n?e.dataset[t]:e.getAttribute("data-"+t)}function g(e){return E.getElementById(e)}return r&&"loading"!==E.readyState?t():r&&v.addEventListener("DOMContentLoaded",t,!1),{init:d,moveForm:function(e,t,n,d,o){var i,r,l,a,m,c,s,e=g(e),n=(h=g(n),g(b.parentIdFieldId)),y=g(b.postIdFieldId),p=g(b.commentReplyTitleId),u=(p=p&&p.firstChild)&&p.nextSibling;if(e&&h&&n){void 0===o&&(o=p&&p.textContent),a=h,m=b.temporaryFormId,c=g(m),s=(s=g(b.commentReplyTitleId))?s.firstChild.textContent:"",c||((c=E.createElement("div")).id=m,c.style.display="none",c.textContent=s,a.parentNode.insertBefore(c,a)),d&&y&&(y.value=d),n.value=t,I.style.display="",e.parentNode.insertBefore(h,e.nextSibling),p&&p.nodeType===Node.TEXT_NODE&&(u&&"A"===u.nodeName&&u.id!==b.cancelReplyId&&(u.style.display="none"),p.textContent=o),I.onclick=function(){return!1};try{for(var f=0;f<C.elements.length;f++)if(i=C.elements[f],r=!1,"getComputedStyle"in v?l=v.getComputedStyle(i):E.documentElement.currentStyle&&(l=i.currentStyle),(i.offsetWidth<=0&&i.offsetHeight<=0||"hidden"===l.visibility)&&(r=!0),"hidden"!==i.type&&!i.disabled&&!r){i.focus();break}}catch(e){}return!1}}}}(window);