;(function($){ $.fn.supersubs=function(options){ var opts=$.extend({}, $.fn.supersubs.defaults, options); return this.each(function(){ var $$=$(this); var o=$.meta ? $.extend({}, opts, $$.data()):opts; $ULs=$$.find('ul').show(); var fontsize=$('').css({ 'padding':0, 'position':'absolute', 'top':'-999em', 'width':'auto' }).appendTo($$)[0].clientWidth; $('#menu-fontsize').remove(); $ULs.each(function(i){ var $ul=$(this); var $LIs=$ul.children(); var $As=$LIs.children('a'); var liFloat=$LIs.css('white-space','nowrap').css('float'); $ul.add($LIs).add($As).css({ 'float':'none', 'width':'auto' }); var emWidth=$ul[0].clientWidth / fontsize; emWidth +=o.extraWidth; if(emWidth > o.maxWidth){ emWidth=o.maxWidth; } else if(emWidth < o.minWidth){ emWidth=o.minWidth; } emWidth +='em'; $ul.css('width',emWidth); $LIs.css({ 'float':liFloat, 'width':'100%', 'white-space':'normal' }) .each(function(){ var $childUl=$(this).children('ul'); var offsetDirection=$childUl.css('left')!==undefined ? 'left':'right'; $childUl.css(offsetDirection,'100%'); }); }).hide(); }); }; $.fn.supersubs.defaults={ minWidth:9, maxWidth:25, extraWidth:0 };})(jQuery); (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=/iPhone|iPad|iPod/i.test(navigator.userAgent); if(ios){ $(w).load(function (){ $('body').children().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){ var classes=c.menuClass; if(o.cssArrows){ classes +=' ' + c.menuArrowClass; } $menu.toggleClass(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){ $li.children('a').toggleClass(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 }); }, 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); }, touchHandler=function (e){ var $this=$(this), $ul=$this.siblings(e.data.popUpSelector); 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'))(); }} }, over=function (){ var $this=$(this), o=getOptions($this); clearTimeout(o.sfTimer); $this.siblings().superfish('hide').end().superfish('show'); }, 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); }}, 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)(); }} }, getMenu=function ($el){ return $el.closest('.' + c.menuClass); }, getOptions=function ($el){ return getMenu($el).data('sf-options'); }; 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; o.onBeforeHide.call($ul); $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); o.onBeforeShow.call($ul); $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('sf-options'), $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('sf-options'); }); }, init: function (op){ return this.each(function (){ var $this=$(this); if($this.data('sf-options')){ return false; } var o=$.extend({}, $.fn.superfish.defaults, op), $hasPopUp=$this.find(o.popUpSelector).parent('li'); o.$path=setPathToCurrent($this, o); $this.data('sf-options', o); toggleMenuClasses($this, o); toggleAnchorClass($hasPopUp); 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 };})(jQuery, window); jQuery.easing['jswing']=jQuery.easing['swing']; jQuery.extend(jQuery.easing, { def: 'easeOutQuad', swing: function (x, t, b, c, d){ return jQuery.easing[jQuery.easing.def](x, t, b, c, d); }, easeInQuad: function (x, t, b, c, d){ return c*(t/=d)*t + b; }, easeOutQuad: function (x, t, b, c, d){ return -c *(t/=d)*(t-2) + b; }, easeInOutQuad: function (x, t, b, c, d){ if((t/=d/2) < 1) return c/2*t*t + b; return -c/2 * ((--t)*(t-2) - 1) + b; }, easeInCubic: function (x, t, b, c, d){ return c*(t/=d)*t*t + b; }, easeOutCubic: function (x, t, b, c, d){ return c*((t=t/d-1)*t*t + 1) + b; }, easeInOutCubic: function (x, t, b, c, d){ if((t/=d/2) < 1) return c/2*t*t*t + b; return c/2*((t-=2)*t*t + 2) + b; }, easeInQuart: function (x, t, b, c, d){ return c*(t/=d)*t*t*t + b; }, easeOutQuart: function (x, t, b, c, d){ return -c * ((t=t/d-1)*t*t*t - 1) + b; }, easeInOutQuart: function (x, t, b, c, d){ if((t/=d/2) < 1) return c/2*t*t*t*t + b; return -c/2 * ((t-=2)*t*t*t - 2) + b; }, easeInQuint: function (x, t, b, c, d){ return c*(t/=d)*t*t*t*t + b; }, easeOutQuint: function (x, t, b, c, d){ return c*((t=t/d-1)*t*t*t*t + 1) + b; }, easeInOutQuint: function (x, t, b, c, d){ if((t/=d/2) < 1) return c/2*t*t*t*t*t + b; return c/2*((t-=2)*t*t*t*t + 2) + b; }, easeInSine: function (x, t, b, c, d){ return -c * Math.cos(t/d * (Math.PI/2)) + c + b; }, easeOutSine: function (x, t, b, c, d){ return c * Math.sin(t/d * (Math.PI/2)) + b; }, easeInOutSine: function (x, t, b, c, d){ return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b; }, easeInExpo: function (x, t, b, c, d){ return (t==0) ? b:c * Math.pow(2, 10 * (t/d - 1)) + b; }, easeOutExpo: function (x, t, b, c, d){ return (t==d) ? b+c:c * (-Math.pow(2, -10 * t/d) + 1) + b; }, easeInOutExpo: function (x, t, b, c, d){ if(t==0) return b; if(t==d) return b+c; if((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b; return c/2 * (-Math.pow(2, -10 * --t) + 2) + b; }, easeInCirc: function (x, t, b, c, d){ return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b; }, easeOutCirc: function (x, t, b, c, d){ return c * Math.sqrt(1 - (t=t/d-1)*t) + b; }, easeInOutCirc: function (x, t, b, c, d){ if((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b; return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b; }, easeInElastic: function (x, t, b, c, d){ var s=1.70158;var p=0;var a=c; if(t==0) return b; if((t/=d)==1) return b+c; if(!p) p=d*.3; if(a < Math.abs(c)){ a=c; var s=p/4; } else var s=p/(2*Math.PI) * Math.asin (c/a); return -(a*Math.pow(2,10*(t-=1)) * Math.sin((t*d-s)*(2*Math.PI)/p)) + b; }, easeOutElastic: function (x, t, b, c, d){ var s=1.70158;var p=0;var a=c; if(t==0) return b; if((t/=d)==1) return b+c; if(!p) p=d*.3; if(a < Math.abs(c)){ a=c; var s=p/4; } else var s=p/(2*Math.PI) * Math.asin (c/a); return a*Math.pow(2,-10*t) * Math.sin((t*d-s)*(2*Math.PI)/p) + c + b; }, easeInOutElastic: function (x, t, b, c, d){ var s=1.70158;var p=0;var a=c; if(t==0) return b; if((t/=d/2)==2) return b+c; if(!p) p=d*(.3*1.5); if(a < Math.abs(c)){ a=c; var s=p/4; } else var s=p/(2*Math.PI) * Math.asin (c/a); if(t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin((t*d-s)*(2*Math.PI)/p)) + b; return a*Math.pow(2,-10*(t-=1)) * Math.sin((t*d-s)*(2*Math.PI)/p)*.5 + c + b; }, easeInBack: function (x, t, b, c, d, s){ if(s==undefined) s=1.70158; return c*(t/=d)*t*((s+1)*t - s) + b; }, easeOutBack: function (x, t, b, c, d, s){ if(s==undefined) s=1.70158; return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; }, easeInOutBack: function (x, t, b, c, d, s){ if(s==undefined) s=1.70158; if((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; }, easeInBounce: function (x, t, b, c, d){ return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b; }, easeOutBounce: function (x, t, b, c, d){ if((t/=d) < (1/2.75)){ return c*(7.5625*t*t) + b; }else if(t < (2/2.75)){ return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b; }else if(t < (2.5/2.75)){ return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b; }else{ return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b; }}, easeInOutBounce: function (x, t, b, c, d){ if(t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b; return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b; }}); (function($){ function fixTitle($ele){ if($ele.attr('title')||typeof($ele.attr('original-title'))!='string'){ $ele.attr('original-title', $ele.attr('title')||'').removeAttr('title'); }} function Tipsy(element, options){ this.$element=$(element); this.options=options; this.enabled=true; fixTitle(this.$element); } Tipsy.prototype={ show: function(){ var title=this.getTitle(); if(title&&this.enabled){ var $tip=this.tip(); $tip.find('.tipsy-inner')[this.options.html ? 'html':'text'](title); $tip[0].className='tipsy'; $tip.remove().css({top: 0, left: 0, visibility: 'hidden', display: 'block'}).appendTo(document.body); var pos=$.extend({}, this.$element.offset(), { width: this.$element[0].offsetWidth, height: this.$element[0].offsetHeight }); var actualWidth=$tip[0].offsetWidth, actualHeight=$tip[0].offsetHeight; var gravity=(typeof this.options.gravity=='function') ? this.options.gravity.call(this.$element[0]) : this.options.gravity; var tp; switch (gravity.charAt(0)){ case 'n': tp={top: pos.top + pos.height + this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2}; break; case 's': tp={top: pos.top - actualHeight - this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2}; break; case 'e': tp={top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth - this.options.offset}; break; case 'w': tp={top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width + this.options.offset}; break; } if(gravity.length==2){ if(gravity.charAt(1)=='w'){ tp.left=pos.left + pos.width / 2 - 15; }else{ tp.left=pos.left + pos.width / 2 - actualWidth + 15; }} $tip.css(tp).addClass('tipsy-' + gravity); if(this.options.fade){ $tip.stop().css({opacity: 0, display: 'block', visibility: 'visible'}).animate({opacity: this.options.opacity}); }else{ $tip.css({visibility: 'visible', opacity: this.options.opacity}); }} }, hide: function(){ if(this.options.fade){ this.tip().stop().fadeOut(function(){ $(this).remove(); }); }else{ this.tip().remove(); }}, getTitle: function(){ var title, $e=this.$element, o=this.options; fixTitle($e); var title, o=this.options; if(typeof o.title=='string'){ title=$e.attr(o.title=='title' ? 'original-title':o.title); }else if(typeof o.title=='function'){ title=o.title.call($e[0]); } title=('' + title).replace(/(^\s*|\s*$)/, ""); return title||o.fallback; }, tip: function(){ if(!this.$tip){ this.$tip=$('
').html('
'); } return this.$tip; }, validate: function(){ if(!this.$element[0].parentNode){ this.hide(); this.$element=null; this.options=null; }}, enable: function(){ this.enabled=true; }, disable: function(){ this.enabled=false; }, toggleEnabled: function(){ this.enabled = !this.enabled; }}; $.fn.tipsy=function(options){ if(options===true){ return this.data('tipsy'); }else if(typeof options=='string'){ return this.data('tipsy')[options](); } options=$.extend({}, $.fn.tipsy.defaults, options); function get(ele){ var tipsy=$.data(ele, 'tipsy'); if(!tipsy){ tipsy=new Tipsy(ele, $.fn.tipsy.elementOptions(ele, options)); $.data(ele, 'tipsy', tipsy); } return tipsy; } function enter(){ var tipsy=get(this); tipsy.hoverState='in'; if(options.delayIn==0){ tipsy.show(); }else{ setTimeout(function(){ if(tipsy.hoverState=='in') tipsy.show(); }, options.delayIn); }}; function leave(){ var tipsy=get(this); tipsy.hoverState='out'; if(options.delayOut==0){ tipsy.hide(); }else{ setTimeout(function(){ if(tipsy.hoverState=='out') tipsy.hide(); }, options.delayOut); }}; if(!options.live) this.each(function(){ get(this); }); if(options.trigger!='manual'){ var binder=options.live ? 'live':'bind', eventIn=options.trigger=='hover' ? 'mouseenter':'focus', eventOut=options.trigger=='hover' ? 'mouseleave':'blur'; this[binder](eventIn, enter)[binder](eventOut, leave); } return this; }; $.fn.tipsy.defaults={ delayIn: 0, delayOut: 0, fade: false, fallback: '', gravity: 'n', html: false, live: false, offset: 0, opacity: 0.8, title: 'title', trigger: 'hover' }; $.fn.tipsy.elementOptions=function(ele, options){ return $.metadata ? $.extend({}, options, $(ele).metadata()):options; }; $.fn.tipsy.autoNS=function(){ return $(this).offset().top > ($(document).scrollTop() + $(window).height() / 2) ? 's':'n'; }; $.fn.tipsy.autoWE=function(){ return $(this).offset().left > ($(document).scrollLeft() + $(window).width() / 2) ? 'e':'w'; };})(jQuery); (function($){ $.prettyPhoto={version: '3.1.6'}; $.fn.prettyPhoto=function(pp_settings){ pp_settings=jQuery.extend({ hook: 'rel', animation_speed: 'fast', ajaxcallback: function(){}, slideshow: 5000, autoplay_slideshow: false, opacity: 0.80, show_title: true, allow_resize: true, allow_expand: true, default_width: 500, default_height: 344, counter_separator_label: '/', theme: 'pp_default', horizontal_padding: 20, hideflash: false, wmode: 'opaque', autoplay: true, modal: false, deeplinking: true, overlay_gallery: true, overlay_gallery_max: 30, keyboard_shortcuts: true, changepicturecallback: function(){}, callback: function(){}, ie6_fallback: true, markup: '
\
 
\
\
\
\
\
\
\
\
\
\
\
\ Expand \
\ next \ previous \
\
\
\
\ Previous \

0/0

\ Next \
\

\
{pp_social}
\ Close \
\
\
\
\
\
\
\
\
\
\
\
\
', gallery_markup: '', image_markup: '', flash_markup: '', quicktime_markup: '', iframe_markup: '', inline_markup: '
{content}
', custom_markup: '', social_tools: '
Tweet
' }, pp_settings); var matchedObjects=this, percentBased=false, pp_dimensions, pp_open, pp_contentHeight, pp_contentWidth, pp_containerHeight, pp_containerWidth, windowHeight=$(window).height(), windowWidth=$(window).width(), pp_slideshow; doresize=true, scroll_pos=_get_scroll(); $(window).unbind('resize.prettyphoto').bind('resize.prettyphoto',function(){ _center_overlay(); _resize_overlay(); }); if(pp_settings.keyboard_shortcuts){ $(document).unbind('keydown.prettyphoto').bind('keydown.prettyphoto',function(e){ if(typeof $pp_pic_holder!='undefined'){ if($pp_pic_holder.is(':visible')){ switch(e.keyCode){ case 37: $.prettyPhoto.changePage('previous'); e.preventDefault(); break; case 39: $.prettyPhoto.changePage('next'); e.preventDefault(); break; case 27: if(!settings.modal) $.prettyPhoto.close(); e.preventDefault(); break; };}; };}); }; $.prettyPhoto.initialize=function(){ settings=pp_settings; if(settings.theme=='pp_default') settings.horizontal_padding=16; theRel=$(this).attr(settings.hook); galleryRegExp=/\[(?:.*)\]/; isSet=(galleryRegExp.exec(theRel)) ? true:false; pp_images=(isSet) ? jQuery.map(matchedObjects, function(n, i){ if($(n).attr(settings.hook).indexOf(theRel)!=-1) return $(n).attr('href'); }):$.makeArray($(this).attr('href')); pp_titles=(isSet) ? jQuery.map(matchedObjects, function(n, i){ if($(n).attr(settings.hook).indexOf(theRel)!=-1) return ($(n).find('img').attr('alt')) ? $(n).find('img').attr('alt'):""; }):$.makeArray($(this).find('img').attr('alt')); pp_descriptions=(isSet) ? jQuery.map(matchedObjects, function(n, i){ if($(n).attr(settings.hook).indexOf(theRel)!=-1) return ($(n).attr('title')) ? $(n).attr('title'):""; }):$.makeArray($(this).attr('title')); if(pp_images.length > settings.overlay_gallery_max) settings.overlay_gallery=false; set_position=jQuery.inArray($(this).attr('href'), pp_images); rel_index=(isSet) ? set_position:$("a["+settings.hook+"^='"+theRel+"']").index($(this)); _build_overlay(this); if(settings.allow_resize) $(window).bind('scroll.prettyphoto',function(){ _center_overlay(); }); $.prettyPhoto.open(); return false; } $.prettyPhoto.open=function(event){ if(typeof settings=="undefined"){ settings=pp_settings; pp_images=$.makeArray(arguments[0]); pp_titles=(arguments[1]) ? $.makeArray(arguments[1]):$.makeArray(""); pp_descriptions=(arguments[2]) ? $.makeArray(arguments[2]):$.makeArray(""); isSet=(pp_images.length > 1) ? true:false; set_position=(arguments[3])? arguments[3]: 0; _build_overlay(event.target); } if(settings.hideflash) $('object,embed,iframe[src*=youtube],iframe[src*=vimeo]').css('visibility','hidden'); _checkPosition($(pp_images).size()); $('.pp_loaderIcon').show(); if(settings.deeplinking) setHashtag(); if(settings.social_tools){ facebook_like_link=settings.social_tools.replace('{location_href}', encodeURIComponent(location.href)); $pp_pic_holder.find('.pp_social').html(facebook_like_link); } if($ppt.is(':hidden')) $ppt.css('opacity',0).show(); $pp_overlay.show().fadeTo(settings.animation_speed,settings.opacity); $pp_pic_holder.find('.currentTextHolder').text((set_position+1) + settings.counter_separator_label + $(pp_images).size()); if(typeof pp_descriptions[set_position]!='undefined'&&pp_descriptions[set_position]!=""){ $pp_pic_holder.find('.pp_description').show().html(unescape(pp_descriptions[set_position])); }else{ $pp_pic_holder.find('.pp_description').hide(); } movie_width=(parseFloat(getParam('width',pp_images[set_position]))) ? getParam('width',pp_images[set_position]):settings.default_width.toString(); movie_height=(parseFloat(getParam('height',pp_images[set_position]))) ? getParam('height',pp_images[set_position]):settings.default_height.toString(); percentBased=false; if(movie_height.indexOf('%')!=-1){ movie_height=parseFloat(($(window).height() * parseFloat(movie_height) / 100) - 150); percentBased=true; } if(movie_width.indexOf('%')!=-1){ movie_width=parseFloat(($(window).width() * parseFloat(movie_width) / 100) - 150); percentBased=true; } $pp_pic_holder.fadeIn(function(){ (settings.show_title&&pp_titles[set_position]!=""&&typeof pp_titles[set_position]!="undefined") ? $ppt.html(unescape(pp_titles[set_position])):$ppt.html(' '); imgPreloader=""; skipInjection=false; switch(_getFileType(pp_images[set_position])){ case 'image': imgPreloader=new Image(); nextImage=new Image(); if(isSet&&set_position < $(pp_images).size() -1) nextImage.src=pp_images[set_position + 1]; prevImage=new Image(); if(isSet&&pp_images[set_position - 1]) prevImage.src=pp_images[set_position - 1]; $pp_pic_holder.find('#pp_full_res')[0].innerHTML=settings.image_markup.replace(/{path}/g,pp_images[set_position]); imgPreloader.onload=function(){ pp_dimensions=_fitToViewport(imgPreloader.width,imgPreloader.height); _showContent(); }; imgPreloader.onerror=function(){ alert('Image cannot be loaded. Make sure the path is correct and image exist.'); $.prettyPhoto.close(); }; imgPreloader.src=pp_images[set_position]; break; case 'youtube': pp_dimensions=_fitToViewport(movie_width,movie_height); movie_id=getParam('v',pp_images[set_position]); if(movie_id==""){ movie_id=pp_images[set_position].split('youtu.be/'); movie_id=movie_id[1]; if(movie_id.indexOf('?') > 0) movie_id=movie_id.substr(0,movie_id.indexOf('?')); if(movie_id.indexOf('&') > 0) movie_id=movie_id.substr(0,movie_id.indexOf('&')); } movie='http://www.youtube.com/embed/'+movie_id; (getParam('rel',pp_images[set_position])) ? movie+="?rel="+getParam('rel',pp_images[set_position]):movie+="?rel=1"; if(settings.autoplay) movie +="&autoplay=1"; toInject=settings.iframe_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,movie); break; case 'vimeo': pp_dimensions=_fitToViewport(movie_width,movie_height); movie_id=pp_images[set_position]; var regExp=/http(s?):\/\/(www\.)?vimeo.com\/(\d+)/; var match=movie_id.match(regExp); movie='http://player.vimeo.com/video/'+ match[3] +'?title=0&byline=0&portrait=0'; if(settings.autoplay) movie +="&autoplay=1;"; vimeo_width=pp_dimensions['width'] + '/embed/?moog_width='+ pp_dimensions['width']; toInject=settings.iframe_markup.replace(/{width}/g,vimeo_width).replace(/{height}/g,pp_dimensions['height']).replace(/{path}/g,movie); break; case 'quicktime': pp_dimensions=_fitToViewport(movie_width,movie_height); pp_dimensions['height']+=15; pp_dimensions['contentHeight']+=15; pp_dimensions['containerHeight']+=15; toInject=settings.quicktime_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,pp_images[set_position]).replace(/{autoplay}/g,settings.autoplay); break; case 'flash': pp_dimensions=_fitToViewport(movie_width,movie_height); flash_vars=pp_images[set_position]; flash_vars=flash_vars.substring(pp_images[set_position].indexOf('flashvars') + 10,pp_images[set_position].length); filename=pp_images[set_position]; filename=filename.substring(0,filename.indexOf('?')); toInject=settings.flash_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,filename+'?'+flash_vars); break; case 'iframe': pp_dimensions=_fitToViewport(movie_width,movie_height); frame_url=pp_images[set_position]; frame_url=frame_url.substr(0,frame_url.indexOf('iframe')-1); toInject=settings.iframe_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{path}/g,frame_url); break; case 'ajax': doresize=false; pp_dimensions=_fitToViewport(movie_width,movie_height); doresize=true; skipInjection=true; $.get(pp_images[set_position],function(responseHTML){ toInject=settings.inline_markup.replace(/{content}/g,responseHTML); $pp_pic_holder.find('#pp_full_res')[0].innerHTML=toInject; _showContent(); }); break; case 'custom': pp_dimensions=_fitToViewport(movie_width,movie_height); toInject=settings.custom_markup; break; case 'inline': myClone=$(pp_images[set_position]).clone().append('
').css({'width':settings.default_width}).wrapInner('
').appendTo($('body')).show(); doresize=false; pp_dimensions=_fitToViewport($(myClone).width(),$(myClone).height()); doresize=true; $(myClone).remove(); toInject=settings.inline_markup.replace(/{content}/g,$(pp_images[set_position]).html()); break; }; if(!imgPreloader&&!skipInjection){ $pp_pic_holder.find('#pp_full_res')[0].innerHTML=toInject; _showContent(); };}); return false; }; $.prettyPhoto.changePage=function(direction){ currentGalleryPage=0; if(direction=='previous'){ set_position--; if(set_position < 0) set_position=$(pp_images).size()-1; }else if(direction=='next'){ set_position++; if(set_position > $(pp_images).size()-1) set_position=0; }else{ set_position=direction; }; rel_index=set_position; if(!doresize) doresize=true; if(settings.allow_expand){ $('.pp_contract').removeClass('pp_contract').addClass('pp_expand'); } _hideContent(function(){ $.prettyPhoto.open(); }); }; $.prettyPhoto.changeGalleryPage=function(direction){ if(direction=='next'){ currentGalleryPage ++; if(currentGalleryPage > totalPage) currentGalleryPage=0; }else if(direction=='previous'){ currentGalleryPage --; if(currentGalleryPage < 0) currentGalleryPage=totalPage; }else{ currentGalleryPage=direction; }; slide_speed=(direction=='next'||direction=='previous') ? settings.animation_speed:0; slide_to=currentGalleryPage * (itemsPerPage * itemWidth); $pp_gallery.find('ul').animate({left:-slide_to},slide_speed); }; $.prettyPhoto.startSlideshow=function(){ if(typeof pp_slideshow=='undefined'){ $pp_pic_holder.find('.pp_play').unbind('click').removeClass('pp_play').addClass('pp_pause').click(function(){ $.prettyPhoto.stopSlideshow(); return false; }); pp_slideshow=setInterval($.prettyPhoto.startSlideshow,settings.slideshow); }else{ $.prettyPhoto.changePage('next'); };} $.prettyPhoto.stopSlideshow=function(){ $pp_pic_holder.find('.pp_pause').unbind('click').removeClass('pp_pause').addClass('pp_play').click(function(){ $.prettyPhoto.startSlideshow(); return false; }); clearInterval(pp_slideshow); pp_slideshow=undefined; } $.prettyPhoto.close=function(){ if($pp_overlay.is(":animated")) return; $.prettyPhoto.stopSlideshow(); $pp_pic_holder.stop().find('object,embed').css('visibility','hidden'); $('div.pp_pic_holder,div.ppt,.pp_fade').fadeOut(settings.animation_speed,function(){ $(this).remove(); }); $pp_overlay.fadeOut(settings.animation_speed, function(){ if(settings.hideflash) $('object,embed,iframe[src*=youtube],iframe[src*=vimeo]').css('visibility','visible'); $(this).remove(); $(window).unbind('scroll.prettyphoto'); clearHashtag(); settings.callback(); doresize=true; pp_open=false; delete settings; }); }; function _showContent(){ $('.pp_loaderIcon').hide(); projectedTop=scroll_pos['scrollTop'] + ((windowHeight/2) - (pp_dimensions['containerHeight']/2)); if(projectedTop < 0) projectedTop=0; $ppt.fadeTo(settings.animation_speed,1); $pp_pic_holder.find('.pp_content') .animate({ height:pp_dimensions['contentHeight'], width:pp_dimensions['contentWidth'] },settings.animation_speed); $pp_pic_holder.animate({ 'top': projectedTop, 'left': ((windowWidth/2) - (pp_dimensions['containerWidth']/2) < 0) ? 0:(windowWidth/2) - (pp_dimensions['containerWidth']/2), width:pp_dimensions['containerWidth'] },settings.animation_speed,function(){ $pp_pic_holder.find('.pp_hoverContainer,#fullResImage').height(pp_dimensions['height']).width(pp_dimensions['width']); $pp_pic_holder.find('.pp_fade').fadeIn(settings.animation_speed); if(isSet&&_getFileType(pp_images[set_position])=="image"){ $pp_pic_holder.find('.pp_hoverContainer').show(); }else{ $pp_pic_holder.find('.pp_hoverContainer').hide(); } if(settings.allow_expand){ if(pp_dimensions['resized']){ $('a.pp_expand,a.pp_contract').show(); }else{ $('a.pp_expand').hide(); }} if(settings.autoplay_slideshow&&!pp_slideshow&&!pp_open) $.prettyPhoto.startSlideshow(); settings.changepicturecallback(); pp_open=true; }); _insert_gallery(); pp_settings.ajaxcallback(); }; function _hideContent(callback){ $pp_pic_holder.find('#pp_full_res object,#pp_full_res embed').css('visibility','hidden'); $pp_pic_holder.find('.pp_fade').fadeOut(settings.animation_speed,function(){ $('.pp_loaderIcon').show(); callback(); }); }; function _checkPosition(setCount){ (setCount > 1) ? $('.pp_nav').show():$('.pp_nav').hide(); }; function _fitToViewport(width,height){ resized=false; _getDimensions(width,height); imageWidth=width, imageHeight=height; if(((pp_containerWidth > windowWidth)||(pp_containerHeight > windowHeight))&&doresize&&settings.allow_resize&&!percentBased){ resized=true, fitting=false; while (!fitting){ if((pp_containerWidth > windowWidth)){ imageWidth=(windowWidth - 200); imageHeight=(height/width) * imageWidth; }else if((pp_containerHeight > windowHeight)){ imageHeight=(windowHeight - 200); imageWidth=(width/height) * imageHeight; }else{ fitting=true; }; pp_containerHeight=imageHeight, pp_containerWidth=imageWidth; }; if((pp_containerWidth > windowWidth)||(pp_containerHeight > windowHeight)){ _fitToViewport(pp_containerWidth,pp_containerHeight) }; _getDimensions(imageWidth,imageHeight); }; return { width:Math.floor(imageWidth), height:Math.floor(imageHeight), containerHeight:Math.floor(pp_containerHeight), containerWidth:Math.floor(pp_containerWidth) + (settings.horizontal_padding * 2), contentHeight:Math.floor(pp_contentHeight), contentWidth:Math.floor(pp_contentWidth), resized:resized };}; function _getDimensions(width,height){ width=parseFloat(width); height=parseFloat(height); $pp_details=$pp_pic_holder.find('.pp_details'); $pp_details.width(width); detailsHeight=parseFloat($pp_details.css('marginTop')) + parseFloat($pp_details.css('marginBottom')); $pp_details=$pp_details.clone().addClass(settings.theme).width(width).appendTo($('body')).css({ 'position':'absolute', 'top':-10000 }); detailsHeight +=$pp_details.height(); detailsHeight=(detailsHeight <=34) ? 36:detailsHeight; $pp_details.remove(); $pp_title=$pp_pic_holder.find('.ppt'); $pp_title.width(width); titleHeight=parseFloat($pp_title.css('marginTop')) + parseFloat($pp_title.css('marginBottom')); $pp_title=$pp_title.clone().appendTo($('body')).css({ 'position':'absolute', 'top':-10000 }); titleHeight +=$pp_title.height(); $pp_title.remove(); pp_contentHeight=height + detailsHeight; pp_contentWidth=width; pp_containerHeight=pp_contentHeight + titleHeight + $pp_pic_holder.find('.pp_top').height() + $pp_pic_holder.find('.pp_bottom').height(); pp_containerWidth=width; } function _getFileType(itemSrc){ if(itemSrc.match(/youtube\.com\/watch/i)||itemSrc.match(/youtu\.be/i)){ return 'youtube'; }else if(itemSrc.match(/vimeo\.com/i)){ return 'vimeo'; }else if(itemSrc.match(/\b.mov\b/i)){ return 'quicktime'; }else if(itemSrc.match(/\b.swf\b/i)){ return 'flash'; }else if(itemSrc.match(/\biframe=true\b/i)){ return 'iframe'; }else if(itemSrc.match(/\bajax=true\b/i)){ return 'ajax'; }else if(itemSrc.match(/\bcustom=true\b/i)){ return 'custom'; }else if(itemSrc.substr(0,1)=='#'){ return 'inline'; }else{ return 'image'; };}; function _center_overlay(){ if(doresize&&typeof $pp_pic_holder!='undefined'){ scroll_pos=_get_scroll(); contentHeight=$pp_pic_holder.height(), contentwidth=$pp_pic_holder.width(); projectedTop=(windowHeight/2) + scroll_pos['scrollTop'] - (contentHeight/2); if(projectedTop < 0) projectedTop=0; if(contentHeight > windowHeight) return; $pp_pic_holder.css({ 'top': projectedTop, 'left': (windowWidth/2) + scroll_pos['scrollLeft'] - (contentwidth/2) }); };}; function _get_scroll(){ if(self.pageYOffset){ return {scrollTop:self.pageYOffset,scrollLeft:self.pageXOffset};}else if(document.documentElement&&document.documentElement.scrollTop){ return {scrollTop:document.documentElement.scrollTop,scrollLeft:document.documentElement.scrollLeft};}else if(document.body){ return {scrollTop:document.body.scrollTop,scrollLeft:document.body.scrollLeft};}; }; function _resize_overlay(){ windowHeight=$(window).height(), windowWidth=$(window).width(); if(typeof $pp_overlay!="undefined") $pp_overlay.height($(document).height()).width(windowWidth); }; function _insert_gallery(){ if(isSet&&settings.overlay_gallery&&_getFileType(pp_images[set_position])=="image"){ itemWidth=52+5; navWidth=(settings.theme=="facebook"||settings.theme=="pp_default") ? 50:30; itemsPerPage=Math.floor((pp_dimensions['containerWidth'] - 100 - navWidth) / itemWidth); itemsPerPage=(itemsPerPage < pp_images.length) ? itemsPerPage:pp_images.length; totalPage=Math.ceil(pp_images.length / itemsPerPage) - 1; if(totalPage==0){ navWidth=0; $pp_gallery.find('.pp_arrow_next,.pp_arrow_previous').hide(); }else{ $pp_gallery.find('.pp_arrow_next,.pp_arrow_previous').show(); }; galleryWidth=itemsPerPage * itemWidth; fullGalleryWidth=pp_images.length * itemWidth; $pp_gallery .css('margin-left',-((galleryWidth/2) + (navWidth/2))) .find('div:first').width(galleryWidth+5) .find('ul').width(fullGalleryWidth) .find('li.selected').removeClass('selected'); goToPage=(Math.floor(set_position/itemsPerPage) < totalPage) ? Math.floor(set_position/itemsPerPage):totalPage; $.prettyPhoto.changeGalleryPage(goToPage); $pp_gallery_li.filter(':eq('+set_position+')').addClass('selected'); }else{ $pp_pic_holder.find('.pp_content').unbind('mouseenter mouseleave'); }} function _build_overlay(caller){ if(settings.social_tools) facebook_like_link=settings.social_tools.replace('{location_href}', encodeURIComponent(location.href)); settings.markup=settings.markup.replace('{pp_social}',''); $('body').append(settings.markup); $pp_pic_holder=$('.pp_pic_holder') , $ppt=$('.ppt'), $pp_overlay=$('div.pp_overlay'); if(isSet&&settings.overlay_gallery){ currentGalleryPage=0; toInject=""; for (var i=0; i < pp_images.length; i++){ if(!pp_images[i].match(/\b(jpg|jpeg|png|gif)\b/gi)){ classname='default'; img_src=''; }else{ classname=''; img_src=pp_images[i]; } toInject +="
  • "; }; toInject=settings.gallery_markup.replace(/{gallery}/g,toInject); $pp_pic_holder.find('#pp_full_res').after(toInject); $pp_gallery=$('.pp_pic_holder .pp_gallery'), $pp_gallery_li=$pp_gallery.find('li'); $pp_gallery.find('.pp_arrow_next').click(function(){ $.prettyPhoto.changeGalleryPage('next'); $.prettyPhoto.stopSlideshow(); return false; }); $pp_gallery.find('.pp_arrow_previous').click(function(){ $.prettyPhoto.changeGalleryPage('previous'); $.prettyPhoto.stopSlideshow(); return false; }); $pp_pic_holder.find('.pp_content').hover(function(){ $pp_pic_holder.find('.pp_gallery:not(.disabled)').fadeIn(); }, function(){ $pp_pic_holder.find('.pp_gallery:not(.disabled)').fadeOut(); }); itemWidth=52+5; $pp_gallery_li.each(function(i){ $(this) .find('a') .click(function(){ $.prettyPhoto.changePage(i); $.prettyPhoto.stopSlideshow(); return false; }); }); }; if(settings.slideshow){ $pp_pic_holder.find('.pp_nav').prepend('Play') $pp_pic_holder.find('.pp_nav .pp_play').click(function(){ $.prettyPhoto.startSlideshow(); return false; }); } $pp_pic_holder.attr('class','pp_pic_holder ' + settings.theme); $pp_overlay .css({ 'opacity':0, 'height':$(document).height(), 'width':$(window).width() }) .bind('click',function(){ if(!settings.modal) $.prettyPhoto.close(); }); $('a.pp_close').bind('click',function(){ $.prettyPhoto.close(); return false; }); if(settings.allow_expand){ $('a.pp_expand').bind('click',function(e){ if($(this).hasClass('pp_expand')){ $(this).removeClass('pp_expand').addClass('pp_contract'); doresize=false; }else{ $(this).removeClass('pp_contract').addClass('pp_expand'); doresize=true; }; _hideContent(function(){ $.prettyPhoto.open(); }); return false; }); } $pp_pic_holder.find('.pp_previous, .pp_nav .pp_arrow_previous').bind('click',function(){ $.prettyPhoto.changePage('previous'); $.prettyPhoto.stopSlideshow(); return false; }); $pp_pic_holder.find('.pp_next, .pp_nav .pp_arrow_next').bind('click',function(){ $.prettyPhoto.changePage('next'); $.prettyPhoto.stopSlideshow(); return false; }); _center_overlay(); }; if(!pp_alreadyInitialized&&getHashtag()){ pp_alreadyInitialized=true; hashIndex=getHashtag(); hashRel=hashIndex; hashIndex=hashIndex.substring(hashIndex.indexOf('/')+1,hashIndex.length-1); hashRel=hashRel.substring(0,hashRel.indexOf('/')); setTimeout(function(){ $("a["+pp_settings.hook+"^='"+hashRel+"']:eq("+hashIndex+")").trigger('click'); },50); } return this.unbind('click.prettyphoto').bind('click.prettyphoto',$.prettyPhoto.initialize); }; function getHashtag(){ var url=location.href; hashtag=(url.indexOf('#prettyPhoto')!==-1) ? decodeURI(url.substring(url.indexOf('#prettyPhoto')+1,url.length)):false; if(hashtag){ hashtag=hashtag.replace(/<|>/g,''); } return hashtag; }; function setHashtag(){ if(typeof theRel=='undefined') return; location.hash=theRel + '/'+rel_index+'/'; }; function clearHashtag(){ if(location.href.indexOf('#prettyPhoto')!==-1) location.hash="prettyPhoto"; } function getParam(name,url){ name=name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); var regexS="[\\?&]"+name+"=([^&#]*)"; var regex=new RegExp(regexS); var results=regex.exec(url); return(results==null) ? "":results[1]; }})(jQuery); var pp_alreadyInitialized=false; (function(e){"use strict";function t(e){return new RegExp("(^|\\s+)"+e+"(\\s+|$)")}function s(e,t){var s=n(e,t)?i:r;s(e,t)}var n,r,i;if("classList"in document.documentElement){n=function(e,t){return e.classList.contains(t)};r=function(e,t){e.classList.add(t)};i=function(e,t){e.classList.remove(t)}}else{n=function(e,n){return t(n).test(e.className)};r=function(e,t){if(!n(e,t)){e.className=e.className+" "+t}};i=function(e,n){e.className=e.className.replace(t(n)," ")}}var o={hasClass:n,addClass:r,removeClass:i,toggleClass:s,has:n,add:r,remove:i,toggle:s};if(typeof define==="function"&&define.amd){define(o)}else{e.classie=o}})(window) if(!jQuery().smartresize){(function(e,t){var n=function(e,t,n){var r;return function(){function u(){if(!n)e.apply(s,o);r=null}var s=this,o=arguments;if(r)clearTimeout(r);else if(n)e.apply(s,o);r=setTimeout(u,t||100)}};jQuery.fn[t]=function(e){return e?this.bind("resize",n(e)):this.trigger(t)}})(jQuery,"smartresize")} (function(e){function c(){n.setAttribute("content",s);o=true}function h(){n.setAttribute("content",i);o=false}function p(t){l=t.accelerationIncludingGravity;u=Math.abs(l.x);a=Math.abs(l.y);f=Math.abs(l.z);if(!e.orientation&&(u>7||(f>6&&a<8||f<8&&a>6)&&u>5)){if(o){h()}}else if(!o){c()}}if(!(/iPhone|iPad|iPod/.test(navigator.platform)&&navigator.userAgent.indexOf("AppleWebKit")>-1)){return}var t=e.document;if(!t.querySelector){return}var n=t.querySelector("meta[name=viewport]"),r=n&&n.getAttribute("content"),i=r+",maximum-scale=1",s=r+",maximum-scale=10",o=true,u,a,f,l;if(!n){return}e.addEventListener("orientationchange",c,false);e.addEventListener("devicemotion",p,false)})(this) if(!jQuery().imagesLoaded){(function(e,t){e.fn.imagesLoaded=function(t){function u(){var t="Good browser";var n=["ie9","ie10"];if(e.browser.msie){t="ie"+parseInt(e.browser.version,10)}return e.inArray(t,n)==-1}function a(){t.call(n,r)}function f(e){if(--i<=0&&e.target.src!==s){setTimeout(a);r.unbind("load error",f)}}var n=this,r=n.find("img").add(n.filter("img")),i=r.length,s="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==";var o=u();if(!i){a()}r.bind("load error",f).each(function(){if(o==false){this.src=this.src.split("?")[0]}if(this.complete||typeof this.complete==="undefined"){var e=this.src;this.src=s;this.src=e}});return n}})(jQuery)} eval(function(p,a,c,k,e,r){e=function(c){return(c<62?'':e(parseInt(c/62)))+((c=c%62)>35?String.fromCharCode(c+29):c.toString(36))};if('0'.replace(0,e)==0){while(c--)r[e(c)]=k[c];k=[function(e){return r[e]||e}];e=function(){return'([237-9n-zA-Z]|1\\w)'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(s(m){3.fn.pngFix=s(c){c=3.extend({P:\'blank.gif\'},c);8 e=(o.Q=="t R S"&&T(o.u)==4&&o.u.A("U 5.5")!=-1);8 f=(o.Q=="t R S"&&T(o.u)==4&&o.u.A("U 6.0")!=-1);p(3.browser.msie&&(e||f)){3(2).B("img[n$=.C]").D(s(){3(2).7(\'q\',3(2).q());3(2).7(\'r\',3(2).r());8 a=\'\';8 b=\'\';8 g=(3(2).7(\'E\'))?\'E="\'+3(2).7(\'E\')+\'" \':\'\';8 h=(3(2).7(\'F\'))?\'F="\'+3(2).7(\'F\')+\'" \':\'\';8 i=(3(2).7(\'G\'))?\'G="\'+3(2).7(\'G\')+\'" \':\'\';8 j=(3(2).7(\'H\'))?\'H="\'+3(2).7(\'H\')+\'" \':\'\';8 k=(3(2).7(\'V\'))?\'float:\'+3(2).7(\'V\')+\';\':\'\';8 d=(3(2).parent().7(\'href\'))?\'cursor:hand;\':\'\';p(2.9.v){a+=\'v:\'+2.9.v+\';\';2.9.v=\'\'}p(2.9.w){a+=\'w:\'+2.9.w+\';\';2.9.w=\'\'}p(2.9.x){a+=\'x:\'+2.9.x+\';\';2.9.x=\'\'}8 l=(2.9.cssText);b+=\'\';p(a!=\'\'){b=\'\'+b+\'\'}3(2).hide();3(2).after(b)});3(2).B("*").D(s(){8 a=3(2).11(\'I-12\');p(a.A(".C")!=-1){8 b=a.13(\'url("\')[1].13(\'")\')[0];3(2).11(\'I-12\',\'none\');3(2).14(0).15.J="K:L.t.M(n=\'"+b+"\',N=\'O\')"}});3(2).B("input[n$=.C]").D(s(){8 a=3(2).7(\'n\');3(2).14(0).15.J=\'K:L.t.M(n=\\\'\'+a+\'\\\', N=\\\'O\\\');\';3(2).7(\'n\',c.P)})}return 3}})(3);',[],68,'||this|jQuery||||attr|var|style||||||||||||||src|navigator|if|width|height|function|Microsoft|appVersion|border|padding|margin|span|px|indexOf|find|png|each|id|class|title|alt|background|filter|progid|DXImageTransform|AlphaImageLoader|sizingMethod|scale|blankgif|appName|Internet|Explorer|parseInt|MSIE|align|position|relative|display|inline|block|css|image|split|get|runtimeStyle'.split('|'),0,{})); var grayscale=function(){var e={colorProps:["color","backgroundColor","borderBottomColor","borderTopColor","borderLeftColor","borderRightColor","backgroundImage"],externalImageHandler:{init:function(e,t){if(e.nodeName.toLowerCase()==="img"){}else{r(e).backgroundImageSRC=t;e.style.backgroundImage=""}},reset:function(e){if(e.nodeName.toLowerCase()==="img"){}else{e.style.backgroundImage="url("+(r(e).backgroundImageSRC||"")+")"}}}},t=function(){try{window.console.log.apply(console,arguments)}catch(e){}},n=function(e){return(new RegExp("https?://(?!"+window.location.hostname+")")).test(e)},r=function(){var e=[0],t="data"+ +(new Date);return function(n){var r=n[t],i=e.length;if(!r){r=n[t]=i;e[r]={}}return e[r]}}(),i=function(e,t,n){var s=document.createElement("canvas"),u=s.getContext("2d"),a=e.naturalHeight||e.offsetHeight||e.height,f=e.naturalWidth||e.offsetWidth||e.width,l;s.height=a;s.width=f;u.drawImage(e,0,0);try{l=u.getImageData(0,0,f,a)}catch(c){}if(t){i.preparing=true;var h=0;(function(){if(!i.preparing){return}if(h===a){u.putImageData(l,0,0,0,0,f,a);n?r(n).BGdataURL=s.toDataURL():r(e).dataURL=s.toDataURL()}for(var t=0;t-1){var x=/\(['"]?(.+?)['"]?\)/,T=E.match(x)[1];if(n(T)){e.externalImageHandler.init(v,T);r(v).externalBG=true;continue}try{var N=r(v).BGdataURL||function(){var e=document.createElement("img");e.src=T;return i(e).toDataURL()}();v.style[w]=E.replace(x,function(e,t){return"("+N+")"})}catch(g){e.externalImageHandler.init(v,T)}}}}}};a.reset=function(t){if(t&&t[0]&&t.length&&t[0].nodeName){var i=Array.prototype.slice.call(t),s=-1,o=i.length;while(++s-1){var v=/\(['"]?(.+?)['"]?\)/,m=d.match(v)[1];if(!n(m)){var g=document.createElement("img");g.src=m;i(g,true,p)}}}}};return a}() jQuery(document).ready(function($){ var isTouch=false, $brand=jQuery('#branding'), $thumbs=jQuery('#thumbnails'), $colophon=jQuery('#colophon'), $togthumbs=jQuery('#toggleThumbs'), $expander=jQuery('#expander'), $main=jQuery('#main'), $primary=jQuery('#primary'), $content=jQuery('#content'), $scans=jQuery('#scanlines'), $sidebar=jQuery('#sidebar'), $nav=jQuery('nav#navigation'), $superbg=jQuery('#superbgimage'), clickevent='click', $mobilem=jQuery('#max-mobile-menu'), $mobile_btn=jQuery('#mobileMenuButton'), $showtitle=jQuery('#showtitle'), $welcome=jQuery('#welcomeTeaser'), $modernizr = !Modernizr.csstransitions||!Modernizr.csstransforms||!Modernizr.csstransforms3d ? false:true, addAdminBar=jQuery('#wpadminbar').height()||0, force_footer=typeof max_custom_vars!='undefined'&&max_custom_vars.force_footer=='true' ? true:false; if($('.nav-full-width').size() > 0){ addAdminBar=addAdminBar + 20; } if(jQuery('html').hasClass('touch')){ isTouch=true; clickevent='touchend'; } var responsive_viewport={ "width": jQuery(window).width(), "height": jQuery(window).height() }; if(jQuery('#sidebar').size() <=0){ jQuery('body').addClass('no-sidebar'); }; jQuery('a[rel*=prettyPhoto]').each(function(i,e){ jQuery(e).attr('data-rel', jQuery(e).attr('rel')).removeAttr('rel'); }); $.fn.isAfter=function(sel){ return this.prevAll(sel).length!==0; }; $.fn.isBefore=function(sel){ return this.nextAll(sel).length!==0; }; $.fn.repositionShowTitle=function(){ var $this=$(this); if($this.size() > 0){ var title_offset=$this.offset(); title_offset_top=title_offset.top, checker_height=$brand.outerHeight(true) + $sidebar.outerHeight(true) + $welcome.outerHeight(true); if(checker_height > title_offset_top){ $this.css({ left: $brand.width() + 40 }); }else{ $this.css({ left: 20 }); }} }; $.fn.hideTips=function(){ return this.each(function(){ var $elem=jQuery(this) var savealt=$elem.attr('alt'); var savetitle=$elem.attr('title'); $elem.hover(function(){ $elem.not('[rel*="prettyPhoto"], [rel*="prettyPhoto"] img, [data-rel*="prettyPhoto"], [data-rel*="prettyPhoto"] img, .gallery-icon a, #sociallinks a, .tooltip').removeAttr('title').removeAttr('alt'); },function(){ $elem.attr({title:savetitle,alt:savealt}); }); }); }; $.fn.slideFadeToggle=function(speed, easing, callback){ return this.animate({opacity: 'toggle', height: 'toggle'}, speed, easing, callback); } jQuery('a, img').hideTips(); if(jQuery('#skinChanger').length){ var skinchanger=jQuery('#skinChanger'); if(jQuery('body').hasClass('home')){ if(skinchanger.not('.closed')){ setTimeout(function(){ skinchanger.addClass('closed'); }, 3000); }} jQuery('.hide-changer', skinchanger).on('click', function(){ skinchanger.toggleClass('closed'); }); } if(jQuery().superfish){ jQuery('#navigation ul:first').superfish({ delay: 250, animation: { }, animationOut: { }, speed: 'fast', autoArrows: false, dropShadows: false, disableHI: false }); var navFullWidth=jQuery('.nav-full-width #navigation'); if(navFullWidth.length){ navFullWidth.find('.menu-item-has-children > a').not('ul ul li.menu-item-has-children > a').append(''); navFullWidth.find('ul ul li.menu-item-has-children > a').append(''); } if($main.is('.nav-full-height #main')){ $('li.menu-item-has-children').on('mouseover', function(){ var $menuItem=$(this), $submenuWrapper=$('> .sub-menu:not(.sub-menu .sub-menu)', $menuItem); var menuItemPos=$menuItem.position(); $submenuWrapper.css({ top: menuItemPos.top, left: '100%', marginLeft: 1 }); }); }} var $portfolioGrid=jQuery('.portfolio-list'), $portfolioItems=$portfolioGrid.children('li.item'), stickytime; if(jQuery('.tooltip').size() > 0&&!isTouch){ jQuery('.tooltip').tipsy({gravity: 's', offset: 200 }); } if(jQuery().tabs&&jQuery(".tabs").size() > 0){ jQuery(".tabs").tabs({ fx: { opacity: 'toggle', duration: 200}}); } if(jQuery().accordion&&jQuery(".toggle-box").size() > 0){ jQuery(".toggle-box").each(function (){ if(jQuery(this).attr('data-id')=='closed'){ jQuery(this).accordion({ header: '.box-title', collapsible: true, active: false, heightStyle: "content" }); }else{ jQuery(this).accordion({ header: '.box-title', collapsible: true, heightStyle: "content" }); }}); } if(jQuery("#contactForm").size()){ jQuery("#contactForm").validate(); } window.allElementsVisible=true; window.invictus_elements_hidden=false; jQuery.fn.hideAllElements=function(hide, thumbs, footer){ var $brand=jQuery('#branding'), $mainheader=jQuery('.nav-full-width .main-header, .nav-full-height .main-header'), $thumbs=jQuery('#thumbnails'), $colophon=jQuery('#colophon'), $togthumbs=jQuery('#toggleThumbs'), $expander=jQuery('#expander'), $main=jQuery('#main'), $page=jQuery('#page'), $primary=jQuery('#primary'), $scans=jQuery('#scanlines'), $sidebar=jQuery('#sidebar'), $_superbg=jQuery('#superbgimage, #superbgplayer'), $nav=jQuery('nav#navigation'), $showlink=jQuery('#showlink'), $controls=jQuery('#thumbnails .controls'), $flickcntr=jQuery('#controls-wrapper'), $fsg_arrows=jQuery('.fsg-arrows'), viewport={ "width": jQuery(window).width(), "height": jQuery(window).height() }; if(!hide){ if($expander.hasClass('slide-up')){ hide='hide'; }else if($expander.hasClass('slide-down')){ hide='show'; }} if(hide==='hide'){ window.invictus_elements_hidden=true; if($flickcntr.size()){ if(!$modernizr){ $flickcntr.addClass('flickr-controls-hide').stop(false,true).animate({ bottom: 0 }, 250); }else{ $flickcntr.addClass('flickr-controls-transition-hide'); }} if(jQuery('body:not(.home)')||thumbs==1){ if(!$modernizr){ $scans.stop(false,true).fadeOut(250); }else{ $scans.addClass('opacity-hide'); }} $_top=$brand.offset().top + $brand.outerHeight(true); if(!$modernizr){ jQuery('.nav-full-height .fsg-arrows-prev').css({'left': 20}); $primary.stop(false,true).fadeOut(250); $expander.stop(false,true).animate({ top: -20 + addAdminBar }); if($nav.size() > 0){ $nav.stop(false,true).animate({ top: "-=" + $nav.outerHeight(true) }) } if(!$welcome.is('.nav-full-height #welcomeTeaser')){ $welcome.stop(false,true).animate({ top: - $welcome.outerHeight(true) - $brand.outerHeight() }) }else{ $welcome.stop(false,true).animate({ top: "-=" + $welcome.outerHeight(true) }) } if(!$mainheader.is('.nav-full-height .main-header')){ $mainheader.stop(false,true).animate({ top: "-=" + $mainheader.outerHeight(true) }) }else{ $mainheader.stop(false,true).animate({ left: "-=" + $mainheader.outerWidth(true) }) } $brand.stop(false,true).animate({ top: "-=" + $_top }, function(){ $expander.removeClass('slide-up').addClass('slide-down'); }); $sidebar.stop(false,true).fadeOut(150); }else{ jQuery.each([ $brand, $nav, $mainheader ], function(){ jQuery(this).addClass('branding-hide'); }) $welcome.addClass('welcome-hide'); jQuery('.nav-full-height .fsg-arrows-prev').addClass('fsg-arrows-prev-left'); jQuery.each([ $sidebar, $primary ], function(){ jQuery(this).addClass('opacity-hide'); }) $expander.removeClass('slide-up').addClass('slide-down'); } if($thumbs.hasClass('thumbs-hide-false')||$thumbs.hasClass('thumbs-hide-')){ $togthumbs.toggleThumbnails('hide', force_footer, true); if(!$modernizr){ $thumbs.animate({'opacity': 0}, 250, function(){ jQuery(this).hide() }); $colophon.stop(false,true).animate({ opacity: 0 }, 250).hide(); }else{ $thumbs.addClass('opacity-hide') $colophon.addClass('opacity-hide'); }} window.allElementsVisible=false; } if(hide==='show'){ window.invictus_elements_hidden=false; if($flickcntr.size()){ if(!$modernizr){ $flickcntr.removeClass('flickr-controls-hide').stop(false,true).animate({ bottom: $colophon.outerHeight() },250); }else{ $flickcntr.removeClass('flickr-controls-transition-hide'); }} if(!jQuery('#superbgimageplayer').hasClass('ytplayer_init') && !jQuery('#superbgimageplayer').hasClass('vimeoplayer_init') && !jQuery('#superbgimageplayer').hasClass('jwplayer_init')){ if(jQuery('body:not(.home)')||thumbs==0){ if(!$modernizr){ $scans.stop(false, true).fadeIn(250); }else{ $scans.removeClass('opacity-hide'); }} }; if(!$modernizr){ jQuery('.nav-full-height .fsg-arrows-prev').css({'left': 266}); $primary.stop(false,true).fadeIn(250); if($nav.size() > 0){ $nav.stop(false,true).animate({ top: 0 + addAdminBar }); } if(!$welcome.is('.nav-full-height #welcomeTeaser')){ $welcome.stop(false,true).animate({ top: $brand.outerHeight() + 20 }) }else{ $welcome.stop(false,true).animate({ top: 0 }) } if(!$mainheader.is('.nav-full-height .main-header')){ $mainheader.stop(false,true).animate({ top: 0 + addAdminBar }) }else{ $mainheader.stop(false,true).animate({ left: 0 }) } $brand.stop(false,true).animate({ top: 0 }, function(){ $expander.removeClass('slide-down').addClass('slide-up'); }); $sidebar.stop(false,true).fadeIn(150); }else{ jQuery.each([ $brand, $nav, $mainheader ], function(){ jQuery(this).removeClass('branding-hide'); }) $welcome.removeClass('welcome-hide'); jQuery('.nav-full-height .fsg-arrows-prev').removeClass('fsg-arrows-prev-left'); jQuery.each([ $sidebar, $primary ], function(){ jQuery(this).removeClass('opacity-hide'); }) $expander.removeClass('slide-down').addClass('slide-up'); } if($thumbs.css('opacity') < 1){ if(!$modernizr){ $thumbs.animate({ opacity: 1 }, 250); $colophon.show().stop(false,true).animate({ opacity: 1 }, 250); }else{ $thumbs.removeClass('opacity-hide'); $colophon.removeClass('opacity-hide'); }} if($thumbs.hasClass('thumbs-hide-false')||$thumbs.hasClass('thumbs-hide-')){ if(viewport.width <=481){ $togthumbs.toggleThumbnails('hide', force_footer, false); }else{ if(!thumbs){ $togthumbs.toggleThumbnails('hide', true, true); }else{ if($togthumbs.hasClass('slide-up')) $togthumbs.toggleThumbnails('show', true, true); }} } window.allElementsVisible=true; }}; $expander.on(clickevent, function(){ jQuery(this).hideAllElements(false, 1); return false; }); jQuery.fn.toggleThumbnails=function(hide, footer, showtitle){ var $_superbg=jQuery('#superbgimage, #superbgplayer'); if($thumbs.height()==0){ jQuery.each([$thumbs, jQuery('.rel', $thumbs)], function(){ jQuery(this).css({ height: jQuery('#fullsize a:first img').outerHeight() + parseInt(jQuery('#fullsize').css('margin-top')) * 2 }) }) } footer=typeof footer!=='undefined' ? footer:true; if(jQuery('#fullsize a.item').size() <=1){ hide='hide'; footer==true; } if(!hide){ if(jQuery(this).hasClass('slide-up')){ hide='show'; }else if(jQuery(this).hasClass('slide-down')){ hide='hide'; }} $togthumbs.livequery(function(){ if(jQuery(window).width() <=481&&!force_footer){ footer=false; } var add_h=$colophon.outerHeight(); if(hide=='hide'){ if(footer===false){ add_h=0; if(!$modernizr){ $colophon.stop(false,true).animate({ bottom: - $colophon.outerHeight(), opacity: 0 }, 250, function(){ jQuery(this).hide(); }); }else{ $colophon.addClass('footer-hide opacity-hide'); } window.thumsVisible=false; }; if(!$modernizr){ $thumbs .stop(false,true) .animate({ bottom: -$thumbs.outerHeight(true) + parseInt($thumbs.css('padding-top'), 10) + add_h }, 250, function(){ $togthumbs.removeClass('slide-down').addClass('slide-up'); }).show(); }else{ var translateY=$thumbs.outerHeight(true) - parseInt($thumbs.css('padding-top'), 10) - add_h; $thumbs.addClass('thumbs-collapsed').css({ bottom: 0, 'transform': 'translate3d(0, '+ (translateY) +'px, 0)' }); $togthumbs.removeClass('slide-down').addClass('slide-up'); } if(footer===true){ if(!$modernizr){ $colophon.show().stop(false,true).animate({ bottom: 0, opacity: 1 }, 250, function(){ window.thumsVisible=true; }); }else{ $colophon.removeClass('footer-hide opacity-hide'); } window.thumsVisible=true; }; if(showtitle===true){ $showtitle.addClass('showtitle-visible'); $showtitle.repositionShowTitle(); }else{ $showtitle.removeClass('showtitle-visible'); }} if(hide=='show'){ if(footer===false){ add_h=0; } if(!$modernizr){ if($thumbs.css('opacity') < 1){ if(jQuery('#showtitle span.imagetitle').text()!='description'){ $thumbs.show().stop(false, true).animate({ opacity: 1 }, 250); }} $thumbs .css({ bottom: -$thumbs.outerHeight(true) }) .stop(false,true) .animate({ bottom: 0 + add_h }, 250,function(){ $togthumbs.removeClass('slide-up').addClass('slide-down'); }) }else{ if($thumbs.css('opacity') < 1){ if(jQuery('#showtitle span.imagetitle').text()!='description'){ $thumbs.removeClass('opacity-hide'); }} $togthumbs.removeClass('slide-up').addClass('slide-down'); $thumbs.removeClass('thumbs-collapsed').css({ bottom: 0, 'transform': 'translate3d(0, ' + add_h * - 1 + 'px, 0)' }); } if(footer===true){ if(!$modernizr){ $colophon.show().stop(false,true).animate({ bottom: 0, opacity: 1 }, 250, function(){ window.thumsVisible=true; $superbg.css({ bottom: $colophon.outerHeight(), height: "auto" }); }); }else{ $colophon.removeClass('footer-hide opacity-hide'); } window.thumsVisible=true; }; if(showtitle===true){ $showtitle.addClass('showtitle-visible'); $showtitle.repositionShowTitle(); }else{ $showtitle.removeClass('showtitle-visible'); }} }) return true; } var anchorTop=jQuery('#anchorTop'); function max_backToTop(topLink){ if(jQuery(window).scrollTop() > 0){ if(!$modernizr){ anchorTop.fadeIn(200); }else{ anchorTop.removeClass('opacity-hide'); }}else{ if(!$modernizr){ anchorTop.fadeOut(200); }else{ anchorTop.addClass('opacity-hide'); }} } jQuery(window).scroll(function(){ max_backToTop(anchorTop); }); if($colophon.size()&&$colophon.is(':visible')&&responsive_viewport.width > 481){ anchorTop.css({ 'bottom': $colophon.outerHeight() + 20 }); } anchorTop.on(clickevent, function(e){ e.preventDefault(); jQuery('html, body') .stop() .animate({ scrollTop: 0 }, 350); return false; }); if($thumbs){ var thumbsObj_Attr=$thumbs.attr('data-object'); if(typeof thumbsObj_Attr!="undefined"){ var thumbsObj=jQuery.parseJSON(thumbsObj_Attr); } window.videoplay=false; } function responsiveChanges(viewport){ var admin_add=0; if($('.page-template-template-fullheight-no-sidebar-php').size() > 0){ $content.css({ paddingBottom: $colophon.outerHeight() }); } if($nav.size() > 0){ if(jQuery(window).outerWidth() - $nav.position().left===$nav.outerWidth()){ $('.max-megamenu-wrapper').width($nav.outerWidth()); }else{ $('.max-megamenu-wrapper').css({ width: '' }); }} if(jQuery('#controls-wrapper').size() > 0) jQuery('#controls-wrapper').css({ bottom: $colophon.outerHeight() }); if($showtitle.size() > 0){ $showtitle.repositionShowTitle(); } if(viewport.width <=768){ $togthumbs.toggleThumbnails('hide', force_footer, false); if($primary.is('.not-fixed #primary')&&$primary.not('.nav-full-height #primary')){ $primary.css({ top: 0, marginTop: 0, marginBottom: 0 }); } jQuery('#portfolioList').css({ marginTop: 0 }); } if(viewport.width < 980){ if($main.is('.nav-full-height #main')){ $main.css({ paddingTop: $brand.outerHeight() + 10 }) } if($nav.size() > 0){ if($nav.is('.nav-full-height #navigation')){ $nav[0].style.paddingBottom=""; $('.nav-full-height .main-header')[0].style.bottom=""; }} if($welcome.length&&$welcome.is('.nav-full-height #welcomeTeaser')){ $welcome.css({ top: $brand.outerHeight(true) + addAdminBar }); }} if(viewport.width > 768){ if($thumbs.size() > 0&&window.videoplay===false){ if(thumbsObj.homepage_show_thumbnails=='true'&&$togthumbs.hasClass('slide-up')===true){ $togthumbs.toggleThumbnails('show', true, true); } if(!thumbsObj.homepage_show_thumbnails){ $togthumbs.toggleThumbnails('hide', true, true); }} if(!$sidebar.is('.not-fixed #sidebar, .nav-full-height #sidebar')){ $sidebar.css({ top: $brand.outerHeight(true) + addAdminBar }); } if($sidebar.is('.nav-full-width #sidebar')){ $sidebar.css({ top: $brand.outerHeight(true) + addAdminBar }); } if($primary.is('.not-fixed #primary')&&!$primary.is('.nav-full-height #primary')&&$sidebar.size() > 0){ $primary.css({ top: - $brand.height() }); } if($primary.is('#primary.portfolio-fullsize-grid')){ if($primary.is('.not-fixed #primary')&&!$primary.is('.nav-full-height #primary')){ var margTop=jQuery('header.entry-header').outerHeight() - $brand.height(); if(margTop > 0){ jQuery('#portfolioList').not('.nav-full-width #portfolioList, .nav-full-height #portfolioList').css({ marginTop: margTop }); }}else{ jQuery('#portfolioList').css({ marginTop: 0 }); }} jQuery('body.max-mobile-menu-push-toright').removeClass('max-mobile-menu-push-toright'); jQuery('#max-mobile-menu.max-mobile-menu-open').removeClass('max-mobile-menu-open'); jQuery('#mobileMenuButton.active').removeClass('active'); } if(viewport.width >=980){ if($primary.is('.not-fixed #primary')&&!$primary.is('.nav-full-height #primary')&&$sidebar.length){ var nav_height=0; if($nav.size() > 0){ nav_height=$nav.height(); } $primary.css({ top: -$brand.height() + nav_height, marginBottom: -$brand.height() + nav_height }); } if($nav.size() > 0){ if($nav.is('.nav-full-height #navigation')){ $nav.css({ paddingBottom: $colophon.outerHeight() }); $('.nav-full-height .main-header').css({ bottom: $colophon.outerHeight() }); }} if($primary.is('#primary.portfolio-fullsize-grid')){ var nav_height=0; if($nav.size() > 0){ nav_height=$nav.height(); } if($primary.is('.not-fixed #primary')&&!$primary.is('.nav-full-height #primary')){ jQuery('#portfolioList').not('.nav-full-width #portfolioList, .nav-full-height #portfolioList').css({ marginTop: jQuery('header.entry-header').outerHeight() - $brand.height() + nav_height }); }else{ jQuery('#portfolioList').not('.nav-full-width #portfolioList, .nav-full-height #portfolioList').css({ marginTop: 0}); }} if($main.is('.nav-full-height #main')){ $main.css({ paddingTop: 0 }) } if($welcome.length&&$welcome.is('.nav-full-height #welcomeTeaser')){ $welcome.css({ top: 0 + addAdminBar }); }} if($welcome.length&&!$welcome.is('.nav-full-height #welcomeTeaser')){ $welcome.css({ top: $brand.outerHeight(true) + addAdminBar }); } var fullWidthNavMain=jQuery('.nav-full-width #main'); if(fullWidthNavMain.length){ fullWidthNavMain.css({ paddingTop: $brand.outerHeight(true) + 20 }); } var fullHeightNav=jQuery('.nav-full-height #navigation '); if(fullHeightNav.size()){ $('.scroll-wrapper > ul', fullHeightNav).css({ maxHeight:$(window).height() - $brand.outerHeight() - $colophon.outerHeight() }); }} jQuery(window).smartresize(function(){ responsive_viewport={ width: jQuery(window).width(), height: jQuery(window).height() }; responsiveChanges(responsive_viewport); if(jQuery('#splashscreen').length){ }}); if(jQuery().fitVids){ if(jQuery('.post-video, .entry-video, .entry-content').size() > 0){ jQuery(".post-video, .entry-video, .entry-content").fitVids() }} if(typeof max_prettyphoto_vars!=='undefined'&&max_prettyphoto_vars.disable_lightbox==='false'){ jQuery('.gallery-icon a').filter(function(){ if(jQuery(this).attr('href').match(/\.(jpg|png|gif)/i)){ jQuery(this).attr('data-rel', "prettyPhoto[wp_gal]"); }}); if(jQuery().prettyPhoto){ var pretty_selector="[data-rel^='prettyPhoto'], .gallery-icon a[href$='.jpg'], .gallery-icon a[href$='.png'], .gallery-icon a[href$='.gif']"; var pretty_settings={ hook: 'data-rel', allow_resize: true, allow_expand: max_prettyphoto_vars.allow_expand==='true', animationSpeed: max_prettyphoto_vars.animationSpeed, slideshow: max_prettyphoto_vars.slideshow, theme: max_prettyphoto_vars.theme, deeplinking: false, changepicturecallback: function(){ jQuery("body").css("overflow", ""); }, callback: function(){ if(jQuery('.scroll-pane').size() > 0){ jQuery('#scroll_left').not('#scroll_left.disabled').show(); jQuery('#scroll_right').not('#scroll_right.disabled').show(); } jQuery("body").css("overflow", ""); }, show_title: max_prettyphoto_vars.show_title==='true', overlay_gallery: max_prettyphoto_vars.overlay_gallery==='true', overlay_gallery_max: max_prettyphoto_vars.overlay_gallery_max } if(max_prettyphoto_vars.social_tools==='false'){ pretty_settings.social_tools=false; } jQuery(pretty_selector).livequery(function(){ jQuery(pretty_selector).prettyPhoto(pretty_settings) }); }} jQuery(window).on('load', function(){ jQuery('body').removeClass('max-is-loading'); if(jQuery('#max-preloader').size() > 0){ jQuery('#max-preloader').fadeOut(350, function(){ jQuery(this).remove(); }); } if(jQuery("#thumbnails a.greyscaled img").length){ jQuery("#thumbnails a.greyscaled img").fadeIn(500); } if($togthumbs.length){ $togthumbs.on(clickevent, function(event){ jQuery(this).toggleThumbnails(); return false; }) } if(!$modernizr){ jQuery(window).smartresize(function(){ if($portfolioItems.length){ $portfolioItems.each(function(){ jQuery(this).not('li.show-title').find('.item-caption').css({ bottom: -jQuery(this).find('.item-caption').outerHeight() }); }) }}).smartresize(); } responsiveChanges(responsive_viewport); if(jQuery("body").hasClass('preload')){ jQuery("body").removeClass("preload"); }}); if(jQuery('#splashscreen').length){ var splashscreen=jQuery('#splashscreen'), splashinner=jQuery('.inner', splashscreen), splashlogo=jQuery('.logo', splashscreen), splashbtn=jQuery('.enter .button', splashscreen), splashskip=true, responsive_viewport={ width: jQuery(window).width(), height: jQuery(window).height() }; if(splashvar.cookieset&&typeof jQuery.cookie(splashvar.theme + '_splashscreen')=='undefined'){ if(splashvar.cookieexpires >=1){ $.cookie(splashvar.theme + '_splashscreen', true, { expires: splashvar.cookieexpires, path: '/' }); }else{ $.cookie(splashvar.theme + '_splashscreen', true, { path: '/' }); } splashskip=false; } if(!splashvar.cookieset){ splashskip=false; } if(!splashskip){ splashscreen.imagesLoaded(function(){ }); splashinner.fadeIn(splashvar.fade); function splashide(timer){ if(typeof fadeouttimer!="undefined") clearTimeout(fadouttimer); var fadeouttimer=setTimeout(function(){ splashscreen.fadeOut(splashvar.fade); }, timer) } if(splashvar.fadeout&&splashvar.timeout){ jQuery(window).load(function(){ splashide(splashvar.timeout); }) } if(splashbtn.length){ splashbtn.on('click', function(){ splashide(250); }) }}else{ splashscreen.hide(); }} var menuLeft=document.getElementById('max-mobile-menu'), showLeftPush=document.getElementById('mobileMenuButton'), menuHolder=jQuery('#max-mobile-menu ul.menu'), body=document.body, myMenuScroll; if($mobile_btn.length){ if(jQuery('html').hasClass('touch')){ isTouch=true; } if($modernizr&&$(menuLeft).size()){ classie.addClass(menuLeft, 'max-mobile-menu-transition'); } showLeftPush.onclick=function(){ classie.toggle(this, 'active'); classie.toggle(body, 'max-mobile-menu-push-toright'); classie.toggle(body, 'no-scroll'); classie.toggle(menuLeft, 'max-mobile-menu-open'); classie.toggle(menuLeft, 'max-mobile-menu-shadow'); if(jQuery('.fullsize-gallery').length){ classie.toggle(this, 'max-mobile-button-push-toright'); }}; jQuery('ul.menu li', jQuery(menuLeft)).each(function(){ $li=jQuery(this); if(jQuery(' > ul.sub-menu', $li).length){ var submenu; jQuery('> a', $li).addClass('has-submenu').append('Open Menu'); $li.on('click', '> a.has-submenu:not(.active)', function(e){ e.preventDefault(); var currentLink=jQuery(this), menu_height=menuHolder.height(), submenu=jQuery(this).next('ul.sub-menu'), hasSubmenu=submenu.length ? true:false; sub_height=submenu.height(); currentLink.addClass('active'); if(hasSubmenu){ submenu.addClass('open'); if(submenu.height() < menu_height){ submenu.css({ 'height': menu_height }); } menuHolder.height(sub_height); submenu.on('click', 'a.back', function(e){ submenu.removeClass('open'); menuHolder.height('auto'); jQuery(this).addClass('active'); currentLink.removeClass('active'); e.preventDefault(); if(isTouch){ myMenuScrollRefresh(); }}) if(isTouch){ myMenuScrollRefresh(); }} }); }}) $link_back=jQuery('Close'); jQuery('a.has-submenu').livequery(function(){ $li=jQuery('').append(jQuery(this).clone()); $li.prependTo(jQuery(this).next('ul.sub-menu')); }) if(typeof iScroll=='function'&&typeof isTouch!='undefined'&&isTouch){ if($mobile_btn.length){ function myMenuScrollLoaded(){ setTimeout(function (){ myMenuScroll=new iScroll('max-mobile-menu', { hScrollbar: false, vScrollbar: false, hScroll: false }); }, 100); } document.addEventListener('touchmove', function (e){ }, false); window.addEventListener('load', myMenuScrollLoaded, false); function myMenuScrollRefresh(){ setTimeout(function(){ myMenuScroll.refresh(); }, 0); };}} } if(getInternetExplorerVersion() >=10){ var $images=jQuery("a.greyscaled img") $images.each(function(){ var el=jQuery(this); el.css({"position":"absolute"}).wrap("
    ").clone().addClass('img_grayscale').css({"position":"absolute","z-index":"5","opacity":"0"}).insertBefore(el).queue(function(){ var el=jQuery(this); el.parent().css({"width":this.width,"height":this.height}); el.dequeue(); }); this.src=grayscaleIE10(this.src); }); jQuery("a.greyscaled img").on({ mouseenter: function (){ jQuery(this).parent().find('img:first').stop().animate({opacity:1}, 200); }, mouseleave: function (){ jQuery('.img_grayscale').stop().animate({opacity:0}, 200); }}); function grayscaleIE10(src){ var canvas=document.createElement('canvas'); var ctx=canvas.getContext('2d'); var imgObj=new Image(); imgObj.src=src; canvas.width=imgObj.width; canvas.height=imgObj.height; ctx.drawImage(imgObj, 0, 0); var imgPixels=ctx.getImageData(0, 0, canvas.width, canvas.height); for(var y=0; y < imgPixels.height; y++){ for(var x=0; x < imgPixels.width; x++){ var i=(y * 4) * imgPixels.width + x * 4; var avg=(imgPixels.data[i] + imgPixels.data[i + 1] + imgPixels.data[i + 2]) / 3; imgPixels.data[i]=avg; imgPixels.data[i + 1]=avg; imgPixels.data[i + 2]=avg; }} ctx.putImageData(imgPixels, 0, 0, 0, 0, imgPixels.width, imgPixels.height); return canvas.toDataURL(); };}; function getInternetExplorerVersion(){ var rv=-1; if(navigator.appName=='Microsoft Internet Explorer'){ var ua=navigator.userAgent; var re=new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})"); if(re.exec(ua)!=null) rv=parseFloat(RegExp.$1); } else if(navigator.appName=='Netscape'){ var ua=navigator.userAgent; var re=new RegExp("Trident/.*rv:([0-9]{1,}[\.0-9]{0,})"); if(re.exec(ua)!=null) rv=parseFloat(RegExp.$1); } return rv; };}); (function(a){function d(b){var c=b||window.event,d=[].slice.call(arguments,1),e=0,f=!0,g=0,h=0;return b=a.event.fix(c),b.type="mousewheel",c.wheelDelta&&(e=c.wheelDelta/120),c.detail&&(e=-c.detail/3),h=e,c.axis!==undefined&&c.axis===c.HORIZONTAL_AXIS&&(h=0,g=-1*e),c.wheelDeltaY!==undefined&&(h=c.wheelDeltaY/120),c.wheelDeltaX!==undefined&&(g=-1*c.wheelDeltaX/120),d.unshift(b,e,g,h),(a.event.dispatch||a.event.handle).apply(this,d)}var b=["DOMMouseScroll","mousewheel"];if(a.event.fixHooks)for(var c=b.length;c;)a.event.fixHooks[b[--c]]=a.event.mouseHooks;a.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=b.length;a;)this.addEventListener(b[--a],d,!1);else this.onmousewheel=d},teardown:function(){if(this.removeEventListener)for(var a=b.length;a;)this.removeEventListener(b[--a],d,!1);else this.onmousewheel=null}},a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery); (function($){ 'use strict'; var TUBEPLAYER=".tubeplayer", TUBEPLAYER_CLASS="jquery-youtube-tubeplayer", OPTS="opts" + TUBEPLAYER; var TP={ inited: false, ytplayers: {}, inits: [], iframeScriptInited: false, State: { 'UNSTARTED': -1, 'ENDED': 0, 'PLAYING': 1, 'PAUSED': 2, 'BUFFERING': 3, 'CUED': 5 }, Error: { 'BAD_INIT': 0, 'INVALID_PARAM': 2, 'NOT_FOUND': 100, 'NOT_EMBEDDABLE': 101, 'CANT_PLAY': 150 }}; $.tubeplayer={ events: {}, TubePlayer: TP }; $.tubeplayer.defaults={ afterReady: function(){}, stateChange: function(player){ var _ret=this.onPlayer; return function(state){ var _player=$('#'+player).parent(); if(typeof(state)==="object"){ state=state.data; } switch (state){ case TP.State.UNSTARTED: return _ret.unstarted[player].call(_player); case TP.State.ENDED: return _ret.ended[player].call(_player); case TP.State.PLAYING: return _ret.playing[player].call(_player); case TP.State.PAUSED: return _ret.paused[player].call(_player); case TP.State.BUFFERING: return _ret.buffering[player].call(_player); case TP.State.CUED: return _ret.cued[player].call(_player); default: return null; }};}, onError: function(player){ var _ret=this.onErr; return function(errorCode){ var _player=$('#'+player).parent(); if(typeof(errorCode)==="object"){ errorCode=errorCode.data; } switch (errorCode){ case TP.Error.BAD_INIT: case TP.Error.INVALID_PARAM: return _ret.invalidParameter[player].call(_player); case TP.Error.NOT_FOUND: return _ret.notFound[player].call(_player); case TP.Error.NOT_EMBEDDABLE: case TP.Error.CANT_PLAY: return _ret.notEmbeddable[player].call(_player); default: return _ret.defaultError[player].call(_player); }};}, qualityChange: function(player){ var _this=this; return function(suggested){ var _player=$('#'+player).parent(); if(typeof(suggested)==="object"){ suggested=suggested.data; } return _this.onQualityChange[player].call(_player, suggested); };}, onQualityChange: {}, onPlayer: { unstarted: {}, ended: {}, playing: {}, paused: {}, buffering: {}, cued: {}}, onErr: { defaultError: {}, notFound: {}, notEmbeddable: {}, invalidParameter: {}} }; var defaults={ width: 425, height: 355, allowFullScreen: "true", initialVideo: "DkoeNLuMbcI", start: 0, preferredQuality: "auto", showControls: false, showRelated: false, playsinline: false, annotations: true, autoPlay: false, autoHide: true, loop: 0, theme: 'dark', color: 'red', showinfo: false, modestbranding: true, protocol: 'http', wmode: 'transparent', swfobjectURL: "ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js", loadSWFObject: false, allowScriptAccess: "always", playerID: "tubeplayer-player-container", iframed: true, onPlay: function(){}, onPause: function(){}, onStop: function(){}, onSeek: function(){}, onMute: function(){}, onUnMute: function(){}, onPlayerUnstarted: function(){}, onPlayerEnded: function(){}, onPlayerPlaying: function(){}, onPlayerPaused: function(){}, onPlayerBuffering: function(){}, onPlayerCued: function(){}, onQualityChange: function(){}, onError: function(){}, onErrorNotFound: function(){}, onErrorNotEmbeddable: function(){}, onErrorInvalidParameter: function(){}}; $.fn.tubeplayer=function(input, xtra){ var $this=$(this); var type=typeof input; if(arguments.length===0||type==="object"){ return $this.each(function(){ TP.init($(this), input); }); }else if(type==="string"){ return $this.triggerHandler(input + TUBEPLAYER, (typeof xtra!=='undefined' ? xtra:null)); }}; var wrap_fn=function(fn){ return function(evt, param){ var p=TP.getPkg(evt); if(p.ytplayer){ var ret=fn(evt, param, p); if(typeof(ret)==="undefined"){ ret=p.$player; } return ret; } return p.$player; };}; $.tubeplayer.getPlayers=function(){ return TP.ytplayers; }; TP.init=function($player, opts){ if($player.hasClass(TUBEPLAYER_CLASS)) return $player; var o=$.extend({}, defaults, opts); o.playerID +="-" + guid(); $player.addClass(TUBEPLAYER_CLASS).data(OPTS, o); for (var event in PLAYER) $player.bind(event + TUBEPLAYER, $player, PLAYER[event]); TP.initDefaults($.tubeplayer.defaults, o); $("
    ").attr("id", o.playerID).appendTo($player); TP.initPlayer($player, o); return $player; }; TP.getPkg=function(evt){ var $player=evt.data; var opts=$player.data(OPTS); var ytplayer=TP.ytplayers[opts.playerID]; return { $player: $player, opts: opts, ytplayer: ytplayer };}; TP.iframeReady=function(o){ TP.inits.push(function(){ new YT.Player(o.playerID, { videoId: o.initialVideo, width: o.width, height: o.height, playerVars: { 'autoplay': (o.autoPlay ? 1:0), 'autohide': (o.autoHide ? 1:0), 'controls': (o.showControls ? 1:0), 'loop': (o.loop ? 1:0), 'playlist': (o.loop ? o.initialVideo:""), 'rel': (o.showRelated ? 1:0), 'fs': (o.allowFullScreen ? 1:0), 'wmode': o.wmode, 'showinfo': (o.showinfo ? 1:0), 'modestbranding': (o.modestbranding ? 1:0), 'iv_load_policy': (o.annotations ? 1:3), 'start': o.start, 'theme': o.theme, 'color': o.color, 'playsinline': o.playsinline }, events: { 'onReady': function(evt){ TP.ytplayers[o.playerID]=evt.target; var $player=$(evt.target.getIframe()).parents("." + TUBEPLAYER_CLASS); $.tubeplayer.defaults.afterReady($player); }, 'onPlaybackQualityChange': $.tubeplayer.defaults.qualityChange(o.playerID), 'onStateChange': $.tubeplayer.defaults.stateChange(o.playerID), 'onError': $.tubeplayer.defaults.onError(o.playerID) }}); }); if(TP.inits.length >=1&&!TP.inited){ return function(){ for (var i=0; i < TP.inits.length; i++){ TP.inits[i](); } TP.inited=true; };} if(TP.inited){ (TP.inits.pop())(); } return window.onYouTubePlayerAPIReady; }; TP.initDefaults=function(d, o){ var ID=o.playerID; var dp=d.onPlayer; dp.unstarted[ID]=o.onPlayerUnstarted; dp.ended[ID]=o.onPlayerEnded; dp.playing[ID]=o.onPlayerPlaying; dp.paused[ID]=o.onPlayerPaused; dp.buffering[ID]=o.onPlayerBuffering; dp.cued[ID]=o.onPlayerCued; d.onQualityChange[ID]=o.onQualityChange; var de=d.onErr; de.defaultError[ID]=o.onError; de.notFound[ID]=o.onErrorNotFound; de.notEmbeddable[ID]=o.onErrorNotEmbeddable; de.invalidParameter[ID]=o.onErrorInvalidParameter; }; TP.initPlayer=function($player, o){ if(o.iframed) TP.initIframePlayer($player, o); else TP.initFlashPlayer($player, o); }; TP.initIframePlayer=function($player, o){ if(!TP.iframeScriptInited){ var tag=document.createElement('script'); tag.src=o.protocol + "://www.youtube.com/iframe_api"; var firstScriptTag=document.getElementsByTagName('script')[0]; firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); TP.iframeScriptInited=true; } window.onYouTubePlayerAPIReady=TP.iframeReady(o); }; TP.initFlashPlayer=function($player, o){ if(o.loadSWFObject){ o.swfobjectURL=o.swfobjectURL.replace('http://', ''); o.swfobjectURL=o.swfobjectURL.replace('https://', ''); o.swfobjectURL=o.protocol + '://' + o.swfobjectURL; $.getScript(o.swfobjectURL, TP.init_flash_player(o)); }else{ TP.init_flash_player(o)(); }}; TP.init_flash_player=function(o){ return function(){ if(!window.swfobject){ alert("YouTube Player couldn't be initialized. Please include swfobject."); return; } function onYouTubeIframeAPIReady(){ player=new YT.Player(o.playerID, { height: o.height, width: o.width, videoId: o.initialVideo, playerVars: { 'autoplay': (o.autoPlay ? 1:0), 'controls': (o.showControls ? 1:0), 'autohide': (o.autoHide ? 1:0), 'showinfo': (o.showinfo ? 1:0), 'modestbranding': (o.modestbranding ? 1:0), 'loop': (o.loop ? 1:0), 'rel': (o.showRelated ? 1:0), 'hd': 1, 'wmode': 'opaque' }, events: { 'onReady': onPlayerReady, 'onStateChange': onPlayerStateChange }}); } var url=["//www.youtube.com/embed/"]; url.push(o.initialVideo); url.push("?&enablejsapi=1&version=3"); url.push("&playerapiid=" + o.playerID); url.push("&rel=" + (o.showRelated ? 1:0)); url.push("&autoplay=" + (o.autoPlay ? 1:0)); url.push("&autohide=" + (o.autoHide ? 1:0)); url.push("&loop=" + (o.loop ? 1:0)); url.push("&playlist=" + (o.loop ? o.initialVideo:"")); url.push("&controls=" + (o.showControls ? 1:0)); url.push("&showinfo=" + (o.showinfo ? 1:0)); url.push("&modestbranding=" + (o.modestbranding ? 1:0)); url.push("&iv_load_policy=" + (o.annotations ? 1:3)); url.push("&start=" + o.start); url.push("&theme=" + o.theme); url.push("&color=" + o.color); url.push("&playsinline=" + o.playsinline); url.push("&fs=" + (o.allowFullScreen ? 1:0)); window.onYouTubePlayerReady=function(playerId){ var player=document.getElementById(playerId); var pid=playerId.replace(/-/g, ''); var d=$.tubeplayer.defaults; $.tubeplayer.events[pid]={ "stateChange": d.stateChange(playerId), "error": d.onError(playerId), "qualityChange": d.qualityChange(playerId) }; player.addEventListener("onStateChange", "$.tubeplayer.events." + pid + ".stateChange"); player.addEventListener("onError", "$.tubeplayer.events." + pid + ".error"); player.addEventListener("onPlaybackQualityChange", "$.tubeplayer.events." + pid + ".qualityChange"); TP.ytplayers[playerId]=player; var $player=$(player).parents("." + TUBEPLAYER_CLASS); $.tubeplayer.defaults.afterReady($player); };}; }; TP.getVideoIDFromURL=function(sURL){ sURL=sURL||""; var qryParamsStart=sURL.indexOf("?"); var qryParams=sURL.substring(qryParamsStart, sURL.length); var videoStart=qryParams.indexOf("v="); if(videoStart > -1){ var videoEnd=qryParams.indexOf("&", videoStart); if(videoEnd===-1){ videoEnd=qryParams.length; } return qryParams.substring(videoStart + "v=".length, videoEnd); } return ""; }; var PLAYER={ opts: wrap_fn(function(evt,param,p){ return p.opts; }), cue: wrap_fn(function(evt, param, p){ p.ytplayer.cueVideoById(param, 0, p.opts.preferredQuality); }), play: wrap_fn(function(evt, param, p){ if(typeof(param)==='object') p.ytplayer.loadVideoById({videoId: param.id, startSeconds: param.time, suggestedQuality: p.opts.preferredQuality }); else if(typeof param!=='undefined') p.ytplayer.loadVideoById({videoId: param, startSeconds: 0, suggestedQuality: p.opts.preferredQuality }); else p.ytplayer.playVideo(); p.opts.onPlay(param); }), pause: wrap_fn(function(evt, param, p){ p.ytplayer.pauseVideo(); p.opts.onPause(p); }), stop: wrap_fn(function(evt, param, p){ p.ytplayer.stopVideo(); p.opts.onStop(p); }), seek: wrap_fn(function(evt, param, p){ if(/:/.test(param)){ var parts=param.split(":").reverse(); param=0; for (var i=0; i < parts.length; i++){ param +=Math.pow(60, i) * (parts[i] | 0); }} p.ytplayer.seekTo(param, true); p.opts.onSeek(param); }), mute: wrap_fn(function(evt, param, p){ p.$player.attr("data-prev-mute-volume", p.ytplayer.getVolume()); p.ytplayer.mute(); p.opts.onMute(p); }), unmute: wrap_fn(function(evt, param, p){ p.ytplayer.unMute(); p.ytplayer.setVolume((p.$player.attr("data-prev-mute-volume")||50)); p.opts.onUnMute(); }), isMuted: wrap_fn(function(evt, param, p){ return p.ytplayer.isMuted(); }), volume: wrap_fn(function(evt, param, p){ if(typeof param!=='undefined'){ p.ytplayer.setVolume(param); p.$player.attr("data-prev-mute-volume", p.ytplayer.getVolume()); }else{ return p.ytplayer.getVolume()||0; }}), quality: wrap_fn(function(evt, param, p){ if(typeof param!=='undefined') p.ytplayer.setPlaybackQuality(param); else return p.ytplayer.getPlaybackQuality(); }), playbackRate: wrap_fn(function(evt, param, p){ if(typeof param!=="undefined") p.ytplayer.setPlaybackRate(param); else return p.ytplayer.getPlaybackRate(); }), data: wrap_fn(function(evt, param, p){ var ret={}; var P=p.ytplayer; ret.videoLoadedFraction=P.getVideoLoadedFraction(); ret.bytesLoaded=P.getVideoBytesLoaded(); ret.bytesTotal=P.getVideoBytesTotal(); ret.startBytes=P.getVideoStartBytes(); ret.state=P.getPlayerState(); ret.currentTime=P.getCurrentTime(); ret.duration=P.getDuration(); ret.videoURL=P.getVideoUrl(); ret.videoEmbedCode=P.getVideoEmbedCode(); ret.videoID=TP.getVideoIDFromURL(ret.videoURL); ret.availableQualityLevels=P.getAvailableQualityLevels(); ret.availablePlaybackRates=P.getAvailablePlaybackRates(); return ret; }), videoId: wrap_fn(function(evt, param, p){ return TP.getVideoIDFromURL(p.ytplayer.getVideoUrl()); }), size: wrap_fn(function(evt, param, p){ if(typeof param!=='undefined'&¶m.width&¶m.height){ p.ytplayer.setSize(param.width, param.height); $(p.ytplayer).css(param); }}), destroy: wrap_fn(function(evt, param, p){ p.$player.removeClass(TUBEPLAYER_CLASS).data(OPTS, null).unbind(TUBEPLAYER).html(""); delete TP.ytplayers[p.opts.playerID]; var d=$.tubeplayer.defaults; var events=['unstarted', 'ended', 'playing', 'paused', 'buffering', 'cued']; $.each(events, function(i, event){ delete d.onPlayer[event][p.opts.playerID]; }); events=['defaultError', 'notFound', 'notEmbeddable', 'invalidParameter']; $.each(events, function(i, event){ delete d.onErr[event][p.opts.playerID]; }); delete d.onQualityChange[p.opts.playerID]; delete $.tubeplayer.events[p.opts.playerID]; if('destroy' in p.ytplayer){ p.ytplayer.destroy(); } $(p.ytplayer).remove(); return null; }), player: wrap_fn(function(evt, param, p){ return p.ytplayer; }) }; function guid(){ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c){ var r=Math.random() * 16 | 0, v=c=='x' ? r:(r & 0x3 | 0x8); return v.toString(16); }); }})(jQuery); (function(window, doc){ var m=Math, dummyStyle=doc.createElement('div').style, vendor=(function (){ var vendors='t,webkitT,MozT,msT,OT'.split(','), t, i=0, l=vendors.length; for(; i < l; i++){ t=vendors[i] + 'ransform'; if(t in dummyStyle){ return vendors[i].substr(0, vendors[i].length - 1); }} return false; })(), cssVendor=vendor ? '-' + vendor.toLowerCase() + '-':'', transform=prefixStyle('transform'), transitionProperty=prefixStyle('transitionProperty'), transitionDuration=prefixStyle('transitionDuration'), transformOrigin=prefixStyle('transformOrigin'), transitionTimingFunction=prefixStyle('transitionTimingFunction'), transitionDelay=prefixStyle('transitionDelay'), isAndroid=(/android/gi).test(navigator.appVersion), isIDevice=(/iphone|ipad/gi).test(navigator.appVersion), isTouchPad=(/hp-tablet/gi).test(navigator.appVersion), has3d=prefixStyle('perspective') in dummyStyle, hasTouch='ontouchstart' in window&&!isTouchPad, hasTransform=vendor!==false, hasTransitionEnd=prefixStyle('transition') in dummyStyle, RESIZE_EV='onorientationchange' in window ? 'orientationchange':'resize', START_EV=hasTouch ? 'touchstart':'mousedown', MOVE_EV=hasTouch ? 'touchmove':'mousemove', END_EV=hasTouch ? 'touchend':'mouseup', CANCEL_EV=hasTouch ? 'touchcancel':'mouseup', TRNEND_EV=(function (){ if(vendor===false) return false; var transitionEnd={ '':'transitionend', 'webkit':'webkitTransitionEnd', 'Moz':'transitionend', 'O':'otransitionend', 'ms':'MSTransitionEnd' }; return transitionEnd[vendor]; })(), nextFrame=(function(){ return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(callback){ return setTimeout(callback, 1); };})(), cancelFrame=(function (){ return window.cancelRequestAnimationFrame || window.webkitCancelAnimationFrame || window.webkitCancelRequestAnimationFrame || window.mozCancelRequestAnimationFrame || window.oCancelRequestAnimationFrame || window.msCancelRequestAnimationFrame || clearTimeout; })(), translateZ=has3d ? ' translateZ(0)':'', iScroll=function (el, options){ var that=this, i; that.wrapper=typeof el=='object' ? el:doc.getElementById(el); that.wrapper.style.overflow='hidden'; that.scroller=that.wrapper.children[0]; that.options={ hScroll: true, vScroll: true, x: 0, y: 0, bounce: true, bounceLock: false, momentum: true, lockDirection: true, useTransform: true, useTransition: false, topOffset: 0, checkDOMChanges: false, handleClick: true, hScrollbar: true, vScrollbar: true, fixedScrollbar: isAndroid, hideScrollbar: isIDevice, fadeScrollbar: isIDevice&&has3d, scrollbarClass: '', zoom: false, zoomMin: 1, zoomMax: 4, doubleTapZoom: 2, wheelAction: 'scroll', snap: false, snapThreshold: 1, onRefresh: null, onBeforeScrollStart: function (e){ e.preventDefault(); }, onScrollStart: null, onBeforeScrollMove: null, onScrollMove: null, onBeforeScrollEnd: null, onScrollEnd: null, onTouchEnd: null, onDestroy: null, onZoomStart: null, onZoom: null, onZoomEnd: null }; for (i in options) that.options[i]=options[i]; that.x=that.options.x; that.y=that.options.y; that.options.useTransform=hasTransform&&that.options.useTransform; that.options.hScrollbar=that.options.hScroll&&that.options.hScrollbar; that.options.vScrollbar=that.options.vScroll&&that.options.vScrollbar; that.options.zoom=that.options.useTransform&&that.options.zoom; that.options.useTransition=hasTransitionEnd&&that.options.useTransition; if(that.options.zoom&&isAndroid){ translateZ=''; } that.scroller.style[transitionProperty]=that.options.useTransform ? cssVendor + 'transform':'top left'; that.scroller.style[transitionDuration]='0'; that.scroller.style[transformOrigin]='0 0'; if(that.options.useTransition) that.scroller.style[transitionTimingFunction]='cubic-bezier(0.33,0.66,0.66,1)'; if(that.options.useTransform) that.scroller.style[transform]='translate(' + that.x + 'px,' + that.y + 'px)' + translateZ; else that.scroller.style.cssText +=';position:absolute;top:' + that.y + 'px;left:' + that.x + 'px'; if(that.options.useTransition) that.options.fixedScrollbar=true; that.refresh(); that._bind(RESIZE_EV, window); that._bind(START_EV); if(!hasTouch){ if(that.options.wheelAction!='none'){ that._bind('DOMMouseScroll'); that._bind('mousewheel'); }} if(that.options.checkDOMChanges) that.checkDOMTime=setInterval(function (){ that._checkDOMChanges(); }, 500); }; iScroll.prototype={ enabled: true, x: 0, y: 0, steps: [], scale: 1, currPageX: 0, currPageY: 0, pagesX: [], pagesY: [], aniTime: null, wheelZoomCount: 0, handleEvent: function (e){ var that=this; switch(e.type){ case START_EV: if(!hasTouch&&e.button!==0) return; that._start(e); break; case MOVE_EV: that._move(e); break; case END_EV: case CANCEL_EV: that._end(e); break; case RESIZE_EV: that._resize(); break; case 'DOMMouseScroll': case 'mousewheel': that._wheel(e); break; case TRNEND_EV: that._transitionEnd(e); break; }}, _checkDOMChanges: function (){ if(this.moved||this.zoomed||this.animating || (this.scrollerW==this.scroller.offsetWidth * this.scale&&this.scrollerH==this.scroller.offsetHeight * this.scale)) return; this.refresh(); }, _scrollbar: function (dir){ var that=this, bar; if(!that[dir + 'Scrollbar']){ if(that[dir + 'ScrollbarWrapper']){ if(hasTransform) that[dir + 'ScrollbarIndicator'].style[transform]=''; that[dir + 'ScrollbarWrapper'].parentNode.removeChild(that[dir + 'ScrollbarWrapper']); that[dir + 'ScrollbarWrapper']=null; that[dir + 'ScrollbarIndicator']=null; } return; } if(!that[dir + 'ScrollbarWrapper']){ bar=doc.createElement('div'); if(that.options.scrollbarClass) bar.className=that.options.scrollbarClass + dir.toUpperCase(); else bar.style.cssText='position:absolute;z-index:100;' + (dir=='h' ? 'height:7px;bottom:1px;left:2px;right:' + (that.vScrollbar ? '7':'2') + 'px':'width:7px;bottom:' + (that.hScrollbar ? '7':'2') + 'px;top:2px;right:1px'); bar.style.cssText +=';pointer-events:none;' + cssVendor + 'transition-property:opacity;' + cssVendor + 'transition-duration:' + (that.options.fadeScrollbar ? '350ms':'0') + ';overflow:hidden;opacity:' + (that.options.hideScrollbar ? '0':'1'); that.wrapper.appendChild(bar); that[dir + 'ScrollbarWrapper']=bar; bar=doc.createElement('div'); if(!that.options.scrollbarClass){ bar.style.cssText='position:absolute;z-index:100;background:rgba(0,0,0,0.5);border:1px solid rgba(255,255,255,0.9);' + cssVendor + 'background-clip:padding-box;' + cssVendor + 'box-sizing:border-box;' + (dir=='h' ? 'height:100%':'width:100%') + ';' + cssVendor + 'border-radius:3px;border-radius:3px'; } bar.style.cssText +=';pointer-events:none;' + cssVendor + 'transition-property:' + cssVendor + 'transform;' + cssVendor + 'transition-timing-function:cubic-bezier(0.33,0.66,0.66,1);' + cssVendor + 'transition-duration:0;' + cssVendor + 'transform: translate(0,0)' + translateZ; if(that.options.useTransition) bar.style.cssText +=';' + cssVendor + 'transition-timing-function:cubic-bezier(0.33,0.66,0.66,1)'; that[dir + 'ScrollbarWrapper'].appendChild(bar); that[dir + 'ScrollbarIndicator']=bar; } if(dir=='h'){ that.hScrollbarSize=that.hScrollbarWrapper.clientWidth; that.hScrollbarIndicatorSize=m.max(m.round(that.hScrollbarSize * that.hScrollbarSize / that.scrollerW), 8); that.hScrollbarIndicator.style.width=that.hScrollbarIndicatorSize + 'px'; that.hScrollbarMaxScroll=that.hScrollbarSize - that.hScrollbarIndicatorSize; that.hScrollbarProp=that.hScrollbarMaxScroll / that.maxScrollX; }else{ that.vScrollbarSize=that.vScrollbarWrapper.clientHeight; that.vScrollbarIndicatorSize=m.max(m.round(that.vScrollbarSize * that.vScrollbarSize / that.scrollerH), 8); that.vScrollbarIndicator.style.height=that.vScrollbarIndicatorSize + 'px'; that.vScrollbarMaxScroll=that.vScrollbarSize - that.vScrollbarIndicatorSize; that.vScrollbarProp=that.vScrollbarMaxScroll / that.maxScrollY; } that._scrollbarPos(dir, true); }, _resize: function (){ var that=this; setTimeout(function (){ that.refresh(); }, isAndroid ? 200:0); }, _pos: function (x, y){ if(this.zoomed) return; x=this.hScroll ? x:0; y=this.vScroll ? y:0; if(this.options.useTransform){ this.scroller.style[transform]='translate(' + x + 'px,' + y + 'px) scale(' + this.scale + ')' + translateZ; }else{ x=m.round(x); y=m.round(y); this.scroller.style.left=x + 'px'; this.scroller.style.top=y + 'px'; } this.x=x; this.y=y; this._scrollbarPos('h'); this._scrollbarPos('v'); }, _scrollbarPos: function (dir, hidden){ var that=this, pos=dir=='h' ? that.x:that.y, size; if(!that[dir + 'Scrollbar']) return; pos=that[dir + 'ScrollbarProp'] * pos; if(pos < 0){ if(!that.options.fixedScrollbar){ size=that[dir + 'ScrollbarIndicatorSize'] + m.round(pos * 3); if(size < 8) size=8; that[dir + 'ScrollbarIndicator'].style[dir=='h' ? 'width':'height']=size + 'px'; } pos=0; }else if(pos > that[dir + 'ScrollbarMaxScroll']){ if(!that.options.fixedScrollbar){ size=that[dir + 'ScrollbarIndicatorSize'] - m.round((pos - that[dir + 'ScrollbarMaxScroll']) * 3); if(size < 8) size=8; that[dir + 'ScrollbarIndicator'].style[dir=='h' ? 'width':'height']=size + 'px'; pos=that[dir + 'ScrollbarMaxScroll'] + (that[dir + 'ScrollbarIndicatorSize'] - size); }else{ pos=that[dir + 'ScrollbarMaxScroll']; }} that[dir + 'ScrollbarWrapper'].style[transitionDelay]='0'; that[dir + 'ScrollbarWrapper'].style.opacity=hidden&&that.options.hideScrollbar ? '0':'1'; that[dir + 'ScrollbarIndicator'].style[transform]='translate(' + (dir=='h' ? pos + 'px,0)':'0,' + pos + 'px)') + translateZ; }, _start: function (e){ var that=this, point=hasTouch ? e.touches[0]:e, matrix, x, y, c1, c2; if(!that.enabled) return; if(that.options.onBeforeScrollStart) that.options.onBeforeScrollStart.call(that, e); if(that.options.useTransition||that.options.zoom) that._transitionTime(0); that.moved=false; that.animating=false; that.zoomed=false; that.distX=0; that.distY=0; that.absDistX=0; that.absDistY=0; that.dirX=0; that.dirY=0; if(that.options.zoom&&hasTouch&&e.touches.length > 1){ c1=m.abs(e.touches[0].pageX-e.touches[1].pageX); c2=m.abs(e.touches[0].pageY-e.touches[1].pageY); that.touchesDistStart=m.sqrt(c1 * c1 + c2 * c2); that.originX=m.abs(e.touches[0].pageX + e.touches[1].pageX - that.wrapperOffsetLeft * 2) / 2 - that.x; that.originY=m.abs(e.touches[0].pageY + e.touches[1].pageY - that.wrapperOffsetTop * 2) / 2 - that.y; if(that.options.onZoomStart) that.options.onZoomStart.call(that, e); } if(that.options.momentum){ if(that.options.useTransform){ matrix=getComputedStyle(that.scroller, null)[transform].replace(/[^0-9\-.,]/g, '').split(','); x=+(matrix[12]||matrix[4]); y=+(matrix[13]||matrix[5]); }else{ x=+getComputedStyle(that.scroller, null).left.replace(/[^0-9-]/g, ''); y=+getComputedStyle(that.scroller, null).top.replace(/[^0-9-]/g, ''); } if(x!=that.x||y!=that.y){ if(that.options.useTransition) that._unbind(TRNEND_EV); else cancelFrame(that.aniTime); that.steps=[]; that._pos(x, y); if(that.options.onScrollEnd) that.options.onScrollEnd.call(that); }} that.absStartX=that.x; that.absStartY=that.y; that.startX=that.x; that.startY=that.y; that.pointX=point.pageX; that.pointY=point.pageY; that.startTime=e.timeStamp||Date.now(); if(that.options.onScrollStart) that.options.onScrollStart.call(that, e); that._bind(MOVE_EV, window); that._bind(END_EV, window); that._bind(CANCEL_EV, window); }, _move: function (e){ var that=this, point=hasTouch ? e.touches[0]:e, deltaX=point.pageX - that.pointX, deltaY=point.pageY - that.pointY, newX=that.x + deltaX, newY=that.y + deltaY, c1, c2, scale, timestamp=e.timeStamp||Date.now(); if(that.options.onBeforeScrollMove) that.options.onBeforeScrollMove.call(that, e); if(that.options.zoom&&hasTouch&&e.touches.length > 1){ c1=m.abs(e.touches[0].pageX - e.touches[1].pageX); c2=m.abs(e.touches[0].pageY - e.touches[1].pageY); that.touchesDist=m.sqrt(c1*c1+c2*c2); that.zoomed=true; scale=1 / that.touchesDistStart * that.touchesDist * this.scale; if(scale < that.options.zoomMin) scale=0.5 * that.options.zoomMin * Math.pow(2.0, scale / that.options.zoomMin); else if(scale > that.options.zoomMax) scale=2.0 * that.options.zoomMax * Math.pow(0.5, that.options.zoomMax / scale); that.lastScale=scale / this.scale; newX=this.originX - this.originX * that.lastScale + this.x, newY=this.originY - this.originY * that.lastScale + this.y; this.scroller.style[transform]='translate(' + newX + 'px,' + newY + 'px) scale(' + scale + ')' + translateZ; if(that.options.onZoom) that.options.onZoom.call(that, e); return; } that.pointX=point.pageX; that.pointY=point.pageY; if(newX > 0||newX < that.maxScrollX){ newX=that.options.bounce ? that.x + (deltaX / 2):newX >=0||that.maxScrollX >=0 ? 0:that.maxScrollX; } if(newY > that.minScrollY||newY < that.maxScrollY){ newY=that.options.bounce ? that.y + (deltaY / 2):newY >=that.minScrollY||that.maxScrollY >=0 ? that.minScrollY:that.maxScrollY; } that.distX +=deltaX; that.distY +=deltaY; that.absDistX=m.abs(that.distX); that.absDistY=m.abs(that.distY); if(that.absDistX < 6&&that.absDistY < 6){ return; } if(that.options.lockDirection){ if(that.absDistX > that.absDistY + 5){ newY=that.y; deltaY=0; }else if(that.absDistY > that.absDistX + 5){ newX=that.x; deltaX=0; }} that.moved=true; that._pos(newX, newY); that.dirX=deltaX > 0 ? -1:deltaX < 0 ? 1:0; that.dirY=deltaY > 0 ? -1:deltaY < 0 ? 1:0; if(timestamp - that.startTime > 300){ that.startTime=timestamp; that.startX=that.x; that.startY=that.y; } if(that.options.onScrollMove) that.options.onScrollMove.call(that, e); }, _end: function (e){ if(hasTouch&&e.touches.length!==0) return; var that=this, point=hasTouch ? e.changedTouches[0]:e, target, ev, momentumX={ dist:0, time:0 }, momentumY={ dist:0, time:0 }, duration=(e.timeStamp||Date.now()) - that.startTime, newPosX=that.x, newPosY=that.y, distX, distY, newDuration, snap, scale; that._unbind(MOVE_EV, window); that._unbind(END_EV, window); that._unbind(CANCEL_EV, window); if(that.options.onBeforeScrollEnd) that.options.onBeforeScrollEnd.call(that, e); if(that.zoomed){ scale=that.scale * that.lastScale; scale=Math.max(that.options.zoomMin, scale); scale=Math.min(that.options.zoomMax, scale); that.lastScale=scale / that.scale; that.scale=scale; that.x=that.originX - that.originX * that.lastScale + that.x; that.y=that.originY - that.originY * that.lastScale + that.y; that.scroller.style[transitionDuration]='200ms'; that.scroller.style[transform]='translate(' + that.x + 'px,' + that.y + 'px) scale(' + that.scale + ')' + translateZ; that.zoomed=false; that.refresh(); if(that.options.onZoomEnd) that.options.onZoomEnd.call(that, e); return; } if(!that.moved){ if(hasTouch){ if(that.doubleTapTimer&&that.options.zoom){ clearTimeout(that.doubleTapTimer); that.doubleTapTimer=null; if(that.options.onZoomStart) that.options.onZoomStart.call(that, e); that.zoom(that.pointX, that.pointY, that.scale==1 ? that.options.doubleTapZoom:1); if(that.options.onZoomEnd){ setTimeout(function(){ that.options.onZoomEnd.call(that, e); }, 200); }}else if(this.options.handleClick){ that.doubleTapTimer=setTimeout(function (){ that.doubleTapTimer=null; target=point.target; while (target.nodeType!=1) target=target.parentNode; if(target.tagName!='SELECT'&&target.tagName!='INPUT'&&target.tagName!='TEXTAREA'){ ev=doc.createEvent('MouseEvents'); ev.initMouseEvent('click', true, true, e.view, 1, point.screenX, point.screenY, point.clientX, point.clientY, e.ctrlKey, e.altKey, e.shiftKey, e.metaKey, 0, null); ev._fake=true; target.dispatchEvent(ev); }}, that.options.zoom ? 250:0); }} that._resetPos(400); if(that.options.onTouchEnd) that.options.onTouchEnd.call(that, e); return; } if(duration < 300&&that.options.momentum){ momentumX=newPosX ? that._momentum(newPosX - that.startX, duration, -that.x, that.scrollerW - that.wrapperW + that.x, that.options.bounce ? that.wrapperW:0):momentumX; momentumY=newPosY ? that._momentum(newPosY - that.startY, duration, -that.y, (that.maxScrollY < 0 ? that.scrollerH - that.wrapperH + that.y - that.minScrollY:0), that.options.bounce ? that.wrapperH:0):momentumY; newPosX=that.x + momentumX.dist; newPosY=that.y + momentumY.dist; if((that.x > 0&&newPosX > 0)||(that.x < that.maxScrollX&&newPosX < that.maxScrollX)) momentumX={ dist:0, time:0 }; if((that.y > that.minScrollY&&newPosY > that.minScrollY)||(that.y < that.maxScrollY&&newPosY < that.maxScrollY)) momentumY={ dist:0, time:0 };} if(momentumX.dist||momentumY.dist){ newDuration=m.max(m.max(momentumX.time, momentumY.time), 10); if(that.options.snap){ distX=newPosX - that.absStartX; distY=newPosY - that.absStartY; if(m.abs(distX) < that.options.snapThreshold&&m.abs(distY) < that.options.snapThreshold){ that.scrollTo(that.absStartX, that.absStartY, 200); }else{ snap=that._snap(newPosX, newPosY); newPosX=snap.x; newPosY=snap.y; newDuration=m.max(snap.time, newDuration); }} that.scrollTo(m.round(newPosX), m.round(newPosY), newDuration); if(that.options.onTouchEnd) that.options.onTouchEnd.call(that, e); return; } if(that.options.snap){ distX=newPosX - that.absStartX; distY=newPosY - that.absStartY; if(m.abs(distX) < that.options.snapThreshold&&m.abs(distY) < that.options.snapThreshold) that.scrollTo(that.absStartX, that.absStartY, 200); else { snap=that._snap(that.x, that.y); if(snap.x!=that.x||snap.y!=that.y) that.scrollTo(snap.x, snap.y, snap.time); } if(that.options.onTouchEnd) that.options.onTouchEnd.call(that, e); return; } that._resetPos(200); if(that.options.onTouchEnd) that.options.onTouchEnd.call(that, e); }, _resetPos: function (time){ var that=this, resetX=that.x >=0 ? 0:that.x < that.maxScrollX ? that.maxScrollX:that.x, resetY=that.y >=that.minScrollY||that.maxScrollY > 0 ? that.minScrollY:that.y < that.maxScrollY ? that.maxScrollY:that.y; if(resetX==that.x&&resetY==that.y){ if(that.moved){ that.moved=false; if(that.options.onScrollEnd) that.options.onScrollEnd.call(that); } if(that.hScrollbar&&that.options.hideScrollbar){ if(vendor=='webkit') that.hScrollbarWrapper.style[transitionDelay]='300ms'; that.hScrollbarWrapper.style.opacity='0'; } if(that.vScrollbar&&that.options.hideScrollbar){ if(vendor=='webkit') that.vScrollbarWrapper.style[transitionDelay]='300ms'; that.vScrollbarWrapper.style.opacity='0'; } return; } that.scrollTo(resetX, resetY, time||0); }, _wheel: function (e){ var that=this, wheelDeltaX, wheelDeltaY, deltaX, deltaY, deltaScale; if('wheelDeltaX' in e){ wheelDeltaX=e.wheelDeltaX / 12; wheelDeltaY=e.wheelDeltaY / 12; }else if('wheelDelta' in e){ wheelDeltaX=wheelDeltaY=e.wheelDelta / 12; }else if('detail' in e){ wheelDeltaX=wheelDeltaY=-e.detail * 3; }else{ return; } if(that.options.wheelAction=='zoom'){ deltaScale=that.scale * Math.pow(2, 1/3 * (wheelDeltaY ? wheelDeltaY / Math.abs(wheelDeltaY):0)); if(deltaScale < that.options.zoomMin) deltaScale=that.options.zoomMin; if(deltaScale > that.options.zoomMax) deltaScale=that.options.zoomMax; if(deltaScale!=that.scale){ if(!that.wheelZoomCount&&that.options.onZoomStart) that.options.onZoomStart.call(that, e); that.wheelZoomCount++; that.zoom(e.pageX, e.pageY, deltaScale, 400); setTimeout(function(){ that.wheelZoomCount--; if(!that.wheelZoomCount&&that.options.onZoomEnd) that.options.onZoomEnd.call(that, e); }, 400); } return; } deltaX=that.x + wheelDeltaX; deltaY=that.y + wheelDeltaY; if(deltaX > 0) deltaX=0; else if(deltaX < that.maxScrollX) deltaX=that.maxScrollX; if(deltaY > that.minScrollY) deltaY=that.minScrollY; else if(deltaY < that.maxScrollY) deltaY=that.maxScrollY; if(that.maxScrollY < 0){ that.scrollTo(deltaX, deltaY, 0); }}, _transitionEnd: function (e){ var that=this; if(e.target!=that.scroller) return; that._unbind(TRNEND_EV); that._startAni(); }, _startAni: function (){ var that=this, startX=that.x, startY=that.y, startTime=Date.now(), step, easeOut, animate; if(that.animating) return; if(!that.steps.length){ that._resetPos(400); return; } step=that.steps.shift(); if(step.x==startX&&step.y==startY) step.time=0; that.animating=true; that.moved=true; if(that.options.useTransition){ that._transitionTime(step.time); that._pos(step.x, step.y); that.animating=false; if(step.time) that._bind(TRNEND_EV); else that._resetPos(0); return; } animate=function (){ var now=Date.now(), newX, newY; if(now >=startTime + step.time){ that._pos(step.x, step.y); that.animating=false; if(that.options.onAnimationEnd) that.options.onAnimationEnd.call(that); that._startAni(); return; } now=(now - startTime) / step.time - 1; easeOut=m.sqrt(1 - now * now); newX=(step.x - startX) * easeOut + startX; newY=(step.y - startY) * easeOut + startY; that._pos(newX, newY); if(that.animating) that.aniTime=nextFrame(animate); }; animate(); }, _transitionTime: function (time){ time +='ms'; this.scroller.style[transitionDuration]=time; if(this.hScrollbar) this.hScrollbarIndicator.style[transitionDuration]=time; if(this.vScrollbar) this.vScrollbarIndicator.style[transitionDuration]=time; }, _momentum: function (dist, time, maxDistUpper, maxDistLower, size){ var deceleration=0.0006, speed=m.abs(dist) / time, newDist=(speed * speed) / (2 * deceleration), newTime=0, outsideDist=0; if(dist > 0&&newDist > maxDistUpper){ outsideDist=size / (6 / (newDist / speed * deceleration)); maxDistUpper=maxDistUpper + outsideDist; speed=speed * maxDistUpper / newDist; newDist=maxDistUpper; }else if(dist < 0&&newDist > maxDistLower){ outsideDist=size / (6 / (newDist / speed * deceleration)); maxDistLower=maxDistLower + outsideDist; speed=speed * maxDistLower / newDist; newDist=maxDistLower; } newDist=newDist * (dist < 0 ? -1:1); newTime=speed / deceleration; return { dist: newDist, time: m.round(newTime) };}, _offset: function (el){ var left=-el.offsetLeft, top=-el.offsetTop; while (el=el.offsetParent){ left -=el.offsetLeft; top -=el.offsetTop; } if(el!=this.wrapper){ left *=this.scale; top *=this.scale; } return { left: left, top: top };}, _snap: function (x, y){ var that=this, i, l, page, time, sizeX, sizeY; page=that.pagesX.length - 1; for (i=0, l=that.pagesX.length; i=that.pagesX[i]){ page=i; break; }} if(page==that.currPageX&&page > 0&&that.dirX < 0) page--; x=that.pagesX[page]; sizeX=m.abs(x - that.pagesX[that.currPageX]); sizeX=sizeX ? m.abs(that.x - x) / sizeX * 500:0; that.currPageX=page; page=that.pagesY.length-1; for (i=0; i=that.pagesY[i]){ page=i; break; }} if(page==that.currPageY&&page > 0&&that.dirY < 0) page--; y=that.pagesY[page]; sizeY=m.abs(y - that.pagesY[that.currPageY]); sizeY=sizeY ? m.abs(that.y - y) / sizeY * 500:0; that.currPageY=page; time=m.round(m.max(sizeX, sizeY))||200; return { x: x, y: y, time: time };}, _bind: function (type, el, bubble){ (el||this.scroller).addEventListener(type, this, !!bubble); }, _unbind: function (type, el, bubble){ (el||this.scroller).removeEventListener(type, this, !!bubble); }, destroy: function (){ var that=this; that.scroller.style[transform]=''; that.hScrollbar=false; that.vScrollbar=false; that._scrollbar('h'); that._scrollbar('v'); that._unbind(RESIZE_EV, window); that._unbind(START_EV); that._unbind(MOVE_EV, window); that._unbind(END_EV, window); that._unbind(CANCEL_EV, window); if(!that.options.hasTouch){ that._unbind('DOMMouseScroll'); that._unbind('mousewheel'); } if(that.options.useTransition) that._unbind(TRNEND_EV); if(that.options.checkDOMChanges) clearInterval(that.checkDOMTime); if(that.options.onDestroy) that.options.onDestroy.call(that); }, refresh: function (){ var that=this, offset, i, l, els, pos=0, page=0; if(that.scale < that.options.zoomMin) that.scale=that.options.zoomMin; that.wrapperW=that.wrapper.clientWidth||1; that.wrapperH=that.wrapper.clientHeight||1; that.minScrollY=-that.options.topOffset||0; that.scrollerW=m.round(that.scroller.offsetWidth * that.scale); that.scrollerH=m.round((that.scroller.offsetHeight + that.minScrollY) * that.scale); that.maxScrollX=that.wrapperW - that.scrollerW; that.maxScrollY=that.wrapperH - that.scrollerH + that.minScrollY; that.dirX=0; that.dirY=0; if(that.options.onRefresh) that.options.onRefresh.call(that); that.hScroll=that.options.hScroll&&that.maxScrollX < 0; that.vScroll=that.options.vScroll&&(!that.options.bounceLock&&!that.hScroll||that.scrollerH > that.wrapperH); that.hScrollbar=that.hScroll&&that.options.hScrollbar; that.vScrollbar=that.vScroll&&that.options.vScrollbar&&that.scrollerH > that.wrapperH; offset=that._offset(that.wrapper); that.wrapperOffsetLeft=-offset.left; that.wrapperOffsetTop=-offset.top; if(typeof that.options.snap=='string'){ that.pagesX=[]; that.pagesY=[]; els=that.scroller.querySelectorAll(that.options.snap); for (i=0, l=els.length; i=that.maxScrollX){ that.pagesX[page]=pos; pos=pos - that.wrapperW; page++; } if(that.maxScrollX%that.wrapperW) that.pagesX[that.pagesX.length]=that.maxScrollX - that.pagesX[that.pagesX.length-1] + that.pagesX[that.pagesX.length-1]; pos=0; page=0; that.pagesY=[]; while (pos >=that.maxScrollY){ that.pagesY[page]=pos; pos=pos - that.wrapperH; page++; } if(that.maxScrollY%that.wrapperH) that.pagesY[that.pagesY.length]=that.maxScrollY - that.pagesY[that.pagesY.length-1] + that.pagesY[that.pagesY.length-1]; } that._scrollbar('h'); that._scrollbar('v'); if(!that.zoomed){ that.scroller.style[transitionDuration]='0'; that._resetPos(400); }}, scrollTo: function (x, y, time, relative){ var that=this, step=x, i, l; that.stop(); if(!step.length) step=[{ x: x, y: y, time: time, relative: relative }]; for (i=0, l=step.length; i 0 ? 0:pos.left < that.maxScrollX ? that.maxScrollX:pos.left; pos.top=pos.top > that.minScrollY ? that.minScrollY:pos.top < that.maxScrollY ? that.maxScrollY:pos.top; time=time===undefined ? m.max(m.abs(pos.left)*2, m.abs(pos.top)*2):time; that.scrollTo(pos.left, pos.top, time); }, scrollToPage: function (pageX, pageY, time){ var that=this, x, y; time=time===undefined ? 400:time; if(that.options.onScrollStart) that.options.onScrollStart.call(that); if(that.options.snap){ pageX=pageX=='next' ? that.currPageX+1:pageX=='prev' ? that.currPageX-1:pageX; pageY=pageY=='next' ? that.currPageY+1:pageY=='prev' ? that.currPageY-1:pageY; pageX=pageX < 0 ? 0:pageX > that.pagesX.length-1 ? that.pagesX.length-1:pageX; pageY=pageY < 0 ? 0:pageY > that.pagesY.length-1 ? that.pagesY.length-1:pageY; that.currPageX=pageX; that.currPageY=pageY; x=that.pagesX[pageX]; y=that.pagesY[pageY]; }else{ x=-that.wrapperW * pageX; y=-that.wrapperH * pageY; if(x < that.maxScrollX) x=that.maxScrollX; if(y < that.maxScrollY) y=that.maxScrollY; } that.scrollTo(x, y, time); }, disable: function (){ this.stop(); this._resetPos(0); this.enabled=false; this._unbind(MOVE_EV, window); this._unbind(END_EV, window); this._unbind(CANCEL_EV, window); }, enable: function (){ this.enabled=true; }, stop: function (){ if(this.options.useTransition) this._unbind(TRNEND_EV); else cancelFrame(this.aniTime); this.steps=[]; this.moved=false; this.animating=false; }, zoom: function (x, y, scale, time){ var that=this, relScale=scale / that.scale; if(!that.options.useTransform) return; that.zoomed=true; time=time===undefined ? 200:time; x=x - that.wrapperOffsetLeft - that.x; y=y - that.wrapperOffsetTop - that.y; that.x=x - x * relScale + that.x; that.y=y - y * relScale + that.y; that.scale=scale; that.refresh(); that.x=that.x > 0 ? 0:that.x < that.maxScrollX ? that.maxScrollX:that.x; that.y=that.y > that.minScrollY ? that.minScrollY:that.y < that.maxScrollY ? that.maxScrollY:that.y; that.scroller.style[transitionDuration]=time + 'ms'; that.scroller.style[transform]='translate(' + that.x + 'px,' + that.y + 'px) scale(' + scale + ')' + translateZ; that.zoomed=false; }, isReady: function (){ return !this.moved&&!this.zoomed&&!this.animating; }}; function prefixStyle (style){ if(vendor==='') return style; style=style.charAt(0).toUpperCase() + style.substr(1); return vendor + style; } dummyStyle=null; if(typeof exports!=='undefined') exports.iScroll=iScroll; else window.iScroll=iScroll; })(window, document); jQuery(document).ready(function($){ var isTouch=false, click_event='click'; if(jQuery('html').hasClass('touch')){ isTouch=true, click_event='click'; } var $fullsize=jQuery('#fullsize'), $scrollerItems=jQuery('#fullsize .item'), $cntItems=$scrollerItems.length, $fullsizeTimer=jQuery('#fullsizeTimer'), $fullsizeStart=jQuery('#fullsizeStart'), $fullsizeStop=jQuery('#fullsizeStop'), $togthumbs=jQuery('#toggleThumbnails'), $thumbContainer=jQuery('#thumbnailContainer'), $colophon=jQuery('#colophon'), thumbs_array=jQuery('#thumbnailContainer').find('a'); window.thumbnailsLoaded=false; jQuery.fn.stopTimer=function(){ if(!Modernizr.csstransitions){ jQuery(this).stop().width(0); }else{ jQuery(this).attr('style', ''); }} jQuery.fn.startTimer=function(timer, resume){ var elem=jQuery(this); if(resume){ var left_duration=timer *(jQuery(window).width() - elem.width()) / jQuery(window).width(); jQuery.fn.superbgimage.options.slide_interval=left_duration; elem.stop(true).animate({ width: jQuery(window).width() }, { duration: left_duration, specialEasing: { width: "linear" }}); }else{ if(jQuery.fn.superbgimage.options.slideshow==1||(jQuery('#superbgimageplayer').hasClass('jwplayer_init')&&jwplayer('superbgimageplayer').getState()=="PLAYING")){ $actItem=jQuery('#fullsize .item.activeslide'); $ind=jQuery('a.activeslide').index("#fullsize .item") + 1; if($ind==1){ $fullsize.animate({ marginLeft: 0 }); } if(!Modernizr.csstransitions){ elem.css({ width: 0 }).stop(true).animate({ width: "100%" }, { duration: timer, specialEasing: { width: "linear" }}); }else{ elem.css({ 'transition-duration': timer + "ms", width: "100%" }); }} }}; jQuery.fn.pauseTimer=function(timer){ jQuery(this).stop(true); $fullsizeStart.show(); $fullsizeStop.hide(); } if(jQuery('#thumbnails').hasClass('centered')){ jQuery('#thumbnails .controls').css({ right: 50 + "%", marginRight: -jQuery('#thumbnails .controls').outerWidth() / 2 }); } jQuery('#fullsize .overlay').on('touchstart touchend', function(e){ e.preventDefault(); jQuery(this).toggleClass('overlay-visible'); }); jQuery('#fullsize a').on('mouseover mouseout', '.overlay', function(e){ jQuery(this).toggleClass('overlay-visible'); }) jQuery(window).on('load', function(){ setScrollerWidth(thumbs_array, 0); var images_to_load=jQuery('a.item img:not(img.loaded)', $fullsize); if(images_to_load.length){ images_to_load.each(function(){ var a=jQuery(this).parent(); if(a.position().left - a.width() <=$thumbContainer.width()){ var img=jQuery(this); img.attr('src', img.data('src')).addClass('loaded') }}); } var anim_height=jQuery('#thumbnails').outerHeight(true) + $colophon.outerHeight(true); var scrollPane=jQuery("#thumbnailContainer"), scrollContent=$fullsize; var slide_handler=function(e, ui){ if(scrollContent.width() > scrollPane.width()){ var scroll_margin=ui.value / 100 *(scrollPane.width() - scrollContent.width()); scrollContent.css("margin-left", Math.round(scroll_margin) + "px"); jQuery('a.item img:not(img.loaded)', $fullsize).each(function(){ var img=jQuery(this); img.not('img.loaded').attr('src', img.data('src')).addClass('loaded') }); setScrollerWidth(thumbs_array, 0); }else{ scrollContent.css("margin-left", 0); }}; var scrollbar=jQuery(".scroll-bar").slider({ slide: slide_handler, change: slide_handler }); jQuery('.scroll-content-item:last').css({marginRight: 0}); if(!isTouch){ if(!jQuery('#thumbnails').hasClass('mouse-scrub')){ scrollPane.mousewheel(function(event, delta){ var value=scrollbar.slider('option', 'value'); if(delta > 0){ value -=1.25; } else if(delta < 0){ value +=1.25; } value=Math.max(0, Math.min(100, value)); scrollbar.slider('option', 'value', value); event.preventDefault(); }); } jQuery("#scroll_right").on('mouseover', function(){ timer=setInterval(function(){ jQuery("#scroll_left").removeClass('disabled'); var speed=parseInt(2); var slider=jQuery('.scroll-bar'); var curSlider=slider.slider("option", "value"); curSlider +=speed; if(curSlider > slider.slider("option", "max")){ jQuery("#scroll_right").addClass('disabled'); curSlider=slider.slider("option", "max"); }else if(curSlider < slider.slider("option", "min")){ curSlider=slider.slider("option", "min"); }else{ } slider.slider("value", curSlider); }, 25); }); jQuery("#scroll_right").on('mouseout', function(){ clearInterval(timer); }); jQuery("#scroll_left").on('mouseover', function(){ timer=setInterval(function(){ jQuery("#scroll_right").removeClass('disabled'); var speed=parseInt(2); var slider=jQuery('.scroll-bar');; var curSlider=slider.slider("option", "value"); curSlider -=speed; if(curSlider > slider.slider("option", "max")){ curSlider=slider.slider("option", "max"); }else if(curSlider < slider.slider("option", "min")){ jQuery("#scroll_left").addClass('disabled'); curSlider=slider.slider("option", "min"); } slider.slider("value", curSlider); }, 25); }); jQuery("#scroll_left").on('mouseout', function(){ clearInterval(timer); }); }}); function setScrollerWidth(elements, original, return_only){ var contWidth=original; elements.each(function(){ contWidth=contWidth + jQuery(this).outerWidth(true); }) if(return_only){ return contWidth; } if(contWidth > jQuery('#thumbnails').width()){ jQuery('#thumbnails .pulldown-items').width(contWidth); if(!isTouch) jQuery('#thumbnails .scroll-link').addClass('scroll-visible'); }else{ if(!isTouch) jQuery('#thumbnails .scroll-link').removeClass('scroll-visible') jQuery('#thumbnails .pulldown-items').css("margin-left", 0); } var origWidth=jQuery(".scroll-bar").width(); var sliderWidth=origWidth - 200; var sliderMargin=(origWidth - sliderWidth)*0.5; jQuery(".scroll-bar-wrap").css({ width:sliderWidth, marginRight: sliderMargin }); } jQuery(window).smartresize(function(){ var contWidth=setScrollerWidth(thumbs_array, 0, true); if(contWidth > jQuery('#thumbnails').width()){ jQuery('#thumbnails .pulldown-items').width(contWidth); if(!isTouch) jQuery('#thumbnails .scroll-link').addClass('scroll-visible'); }else{ if(!isTouch) jQuery('#thumbnails .scroll-link').removeClass('scroll-visible') jQuery('#thumbnails .pulldown-items').css("margin-left", 0); } var images_to_load=jQuery('a.item img:not(img.loaded)', $fullsize); if(images_to_load.length){ images_to_load.each(function(){ var img=jQuery(this); img.not('img.loaded').attr('src', img.data('src')).addClass('loaded') }); setScrollerWidth(thumbs_array, 0); } if(isTouch){ myScrollRefresh(); }}); $fullsize.superbgimage(); var fullsizePrev=jQuery('#thumbnails a.fullsize-prev, .fsg-arrows a.fsg-arrows-prev').livequery(click_event,function(e){ perform_prevAnimation($fullsize, $fullsizeTimer); e.preventDefault(); return false; }); if(jQuery().swipe){ jQuery.fn.addFullsizeTouchswipe=function(){ jQuery(this).swipe({ threshold: 50, swipe: function(event, direction, distance, duration, fingerCount){ if(fingerCount==1){ if('left'===direction){ perform_nextAnimation(); } if('right'===direction){ perform_prevAnimation($fullsize, $fullsizeTimer); } if('down'===direction){ $togthumbs.toggleThumbnails('hide', true); } if('up'===direction){ $togthumbs.toggleThumbnails('show', true); }} if(fingerCount==2){ if('up'===direction&&true===window.allElementsVisible){ $expander.hideAllElements('hide', 1); } if('down'===direction&&false===window.allElementsVisible){ $expander.hideAllElements('show', 1); }} }, fingers: 'all', allowPageScroll: 'none' }); }; if(isTouch){ jQuery("#superbgimage, #scanlines, #page").swipe("destroy"); jQuery("#superbgimage, #scanlines, #page").addFullsizeTouchswipe(); }} function perform_prevAnimation($fullsize, $fullsizeTimer){ jQuery('#superbgimageplayer').html(); jQuery('#startInterval').val("start"); $fullsizeTimer.stopTimer(); $fullsize.prevSlide(); if(jQuery.fn.superbgimage.options.slideshow==1){ $fullsize.startSlideShow(); }else{ $fullsize.stopSlideShow(); }} var fullsizeNext=jQuery('#thumbnails a.fullsize-next, .fsg-arrows a.fsg-arrows-next').livequery(click_event,function(){ perform_nextAnimation(); return false; }); function perform_nextAnimation(){ jQuery('#superbgimageplayer').html(); jQuery('#startInterval').val("start"); $fullsizeTimer.stopTimer(); $fullsize.nextSlide(); if(jQuery.fn.superbgimage.options.slideshow==1){ $fullsize.startSlideShow(); }else{ $fullsize.stopSlideShow(); }} if(jQuery('#thumbnails').hasClass('mouse-scrub')){ var div=jQuery('#thumbnailContainer'), ul=jQuery('#fullsize'), ulPadding=15; div.css({overflow: 'hidden'}); var lastLi=jQuery('a',ul).filter(":last"); div.mousemove(function(e){ var divWidth=div.width(); var ulWidth=lastLi[0].offsetLeft + lastLi.outerWidth() + ulPadding; var left=(e.pageX - div.offset().left) * (ulWidth-divWidth) / divWidth; div.scrollLeft(left); var images_to_load=jQuery('a.item img:not(img.loaded)', $fullsize); if(images_to_load.length){ images_to_load.each(function(){ var img=jQuery(this); img.not('img.loaded').attr('src', img.data('src')).addClass('loaded') }); setScrollerWidth(thumbs_array, 0); }}); } if(jQuery('#thumbnails').hasClass('key-nav')&&jQuery('a.item', $fullsize).size() > 1){ jQuery(document).keydown(function (e){ var keyCode=e.keyCode||e.which, arrow={left: 37, up: 38, space: 32, right: 39, down: 40 }; switch (keyCode){ case arrow.left: perform_prevAnimation($fullsize, $fullsizeTimer); break; case arrow.up: $togthumbs.toggleThumbnails('show', true); break; case arrow.right: perform_nextAnimation(); break; case arrow.down: $togthumbs.toggleThumbnails('hide', true); break; case arrow.space: jQuery('#thumbnails .controls').livequery(function(){ if(jQuery(this).hasClass('fullsize-playing')){ jQuery.fn.superbgimage.options.slideshow=0; $fullsizetimer.stopTimer(); jQuery('#fullsize').stopSlideShow(); jQuery(this).toggleClass('fullsize-playing'); }else{ jQuery.fn.superbgimage.options.slideshow=1; jQuery(this).toggleClass('fullsize-playing'); jQuery.fn.superbgimage.options.slide_interval=jQuery('#thumbnails').data('object').fullsize_interval; $fullsizetimer.startTimer(jQuery('#thumbnails').data('object').fullsize_interval); $fullsize.startSlideShow(); }}) break; }}); }else{ jQuery('#fullsizeKeynav').hide(); } if(jQuery('#thumbnails').hasClass('mouse-leave')){ jQuery('#colophon, #thumbnails').on('mouseenter', function(e){ var thumbnails=jQuery('#thumbnails'), fotBot=parseInt($colophon.css('bottom')), botAni=$colophon.outerHeight(); if(fotBot < 0||$colophon.hasClass('footer-hide')){ botAni=0; } if(!Modernizr.csstransitions){ thumbnails.stop().animate({ bottom: botAni }); }else{ thumbnails.removeClass('thumbs-collapsed').css({ bottom: 0, 'transform': 'translate3d(0, ' + botAni * - 1 + 'px, 0)' }); }}); jQuery('#thumbnails').on('mouseleave', function(e){ var thumbnails=jQuery('#thumbnails'), fotBot=parseInt($colophon.css('bottom')), botAni=$colophon.outerHeight(); if(fotBot < 0||$colophon.hasClass('footer-hide')){ botAni=0; } if(!Modernizr.csstransitions){ thumbnails.stop().animate({ bottom: -thumbnails.outerHeight() + botAni + thumbnails.find('.controls').outerHeight() }); }else{ var translateY=thumbnails.outerHeight(true) - parseInt(thumbnails.css('padding-top'), 10) - botAni; thumbnails.addClass('thumbs-collapsed').css({ bottom: 0, 'transform': 'translate3d(0, '+ (translateY) +'px, 0)' }); }}); } if(isTouch){ if(jQuery('#thumbnailContainer').length){ var myScroll; function myScrollLoaded(){ setTimeout(function (){ myScroll=new iScroll('thumbnailContainer', { hScrollbar: false, vScrollbar: false, vScroll: false, onBeforeScrollMove: function(){ jQuery('#fullsize .overlay').show(); }, onTouchEnd:function(){ jQuery('#fullsize .overlay').hide(); var images_to_load=jQuery('a.item img:not(img.loaded)', $fullsize); if(images_to_load.length){ images_to_load.each(function(){ var img=jQuery(this); img.not('img.loaded').attr('src', img.data('src')).addClass('loaded') }); } setScrollerWidth(thumbs_array, 0); }}); }, 100); } document.addEventListener('touchmove', function (e){ e.preventDefault(); }, false); window.addEventListener('load', myScrollLoaded, false); function myScrollRefresh(){ setTimeout(function(){ myScroll.refresh(); }, 0); };}} }); !function(a,b){"use strict";function c(){if(!e){e=!0;var a,c,d,f,g=-1!==navigator.appVersion.indexOf("MSIE 10"),h=!!navigator.userAgent.match(/Trident.*rv:11\./),i=b.querySelectorAll("iframe.wp-embedded-content");for(c=0;c1e3)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);