window.addComment=function(u){var p,v,f,y=u.document,I={commentReplyClass:"comment-reply-link",cancelReplyId:"cancel-comment-reply-link",commentFormId:"commentform",temporaryFormId:"wp-temp-form-div",parentIdFieldId:"comment_parent",postIdFieldId:"comment_post_ID"},e=u.MutationObserver||u.WebKitMutationObserver||u.MozMutationObserver,o="querySelector"in y&&"addEventListener"in u,n=!!y.documentElement.dataset;function t(){r(),e&&new e(d).observe(y.body,{childList:!0,subTree:!0})}function r(e){if(o&&(p=h(I.cancelReplyId),v=h(I.commentFormId),p)){p.addEventListener("touchstart",i),p.addEventListener("click",i);for(var t,n=function(e){var t=I.commentReplyClass;e&&e.childNodes||(e=y);t=y.getElementsByClassName?e.getElementsByClassName(t):e.querySelectorAll("."+t);return t}(e),r=0,d=n.length;r form').each(function(){ var $form=$(this); wpcf7.initForm($form); if(wpcf7.cached){ wpcf7.refill($form); }}); }); wpcf7.getId=function(form){ return parseInt($('input[name="_wpcf7"]', form).val(), 10); }; wpcf7.initForm=function(form){ var $form=$(form); $form.submit(function(event){ if(! wpcf7.supportHtml5.placeholder){ $('[placeholder].placeheld', $form).each(function(i, n){ $(n).val('').removeClass('placeheld'); }); } if(typeof window.FormData==='function'){ wpcf7.submit($form); event.preventDefault(); }}); $('.wpcf7-submit', $form).after(''); wpcf7.toggleSubmit($form); $form.on('click', '.wpcf7-acceptance', function(){ wpcf7.toggleSubmit($form); }); $('.wpcf7-exclusive-checkbox', $form).on('click', 'input:checkbox', function(){ var name=$(this).attr('name'); $form.find('input:checkbox[name="' + name + '"]').not(this).prop('checked', false); }); $('.wpcf7-list-item.has-free-text', $form).each(function(){ var $freetext=$(':input.wpcf7-free-text', this); var $wrap=$(this).closest('.wpcf7-form-control'); if($(':checkbox, :radio', this).is(':checked')){ $freetext.prop('disabled', false); }else{ $freetext.prop('disabled', true); } $wrap.on('change', ':checkbox, :radio', function(){ var $cb=$('.has-free-text', $wrap).find(':checkbox, :radio'); if($cb.is(':checked')){ $freetext.prop('disabled', false).focus(); }else{ $freetext.prop('disabled', true); }}); }); if(! wpcf7.supportHtml5.placeholder){ $('[placeholder]', $form).each(function(){ $(this).val($(this).attr('placeholder')); $(this).addClass('placeheld'); $(this).focus(function(){ if($(this).hasClass('placeheld')){ $(this).val('').removeClass('placeheld'); }}); $(this).blur(function(){ if(''===$(this).val()){ $(this).val($(this).attr('placeholder')); $(this).addClass('placeheld'); }}); }); } if(wpcf7.jqueryUi&&! wpcf7.supportHtml5.date){ $form.find('input.wpcf7-date[type="date"]').each(function(){ $(this).datepicker({ dateFormat: 'yy-mm-dd', minDate: new Date($(this).attr('min')), maxDate: new Date($(this).attr('max')) }); }); } if(wpcf7.jqueryUi&&! wpcf7.supportHtml5.number){ $form.find('input.wpcf7-number[type="number"]').each(function(){ $(this).spinner({ min: $(this).attr('min'), max: $(this).attr('max'), step: $(this).attr('step') }); }); } $('.wpcf7-character-count', $form).each(function(){ var $count=$(this); var name=$count.attr('data-target-name'); var down=$count.hasClass('down'); var starting=parseInt($count.attr('data-starting-value'), 10); var maximum=parseInt($count.attr('data-maximum-value'), 10); var minimum=parseInt($count.attr('data-minimum-value'), 10); var updateCount=function(target){ var $target=$(target); var length=$target.val().length; var count=down ? starting - length:length; $count.attr('data-current-value', count); $count.text(count); if(maximum&&maximum < length){ $count.addClass('too-long'); }else{ $count.removeClass('too-long'); } if(minimum&&length < minimum){ $count.addClass('too-short'); }else{ $count.removeClass('too-short'); }}; $(':input[name="' + name + '"]', $form).each(function(){ updateCount(this); $(this).keyup(function(){ updateCount(this); }); }); }); $form.on('change', '.wpcf7-validates-as-url', function(){ var val=$.trim($(this).val()); if(val && ! val.match(/^[a-z][a-z0-9.+-]*:/i) && -1!==val.indexOf('.')){ val=val.replace(/^\/+/, ''); val='http://' + val; } $(this).val(val); }); }; wpcf7.submit=function(form){ if(typeof window.FormData!=='function'){ return; } var $form=$(form); $('.ajax-loader', $form).addClass('is-active'); wpcf7.clearResponse($form); var formData=new FormData($form.get(0)); var detail={ id: $form.closest('div.wpcf7').attr('id'), status: 'init', inputs: [], formData: formData }; $.each($form.serializeArray(), function(i, field){ if('_wpcf7'==field.name){ detail.contactFormId=field.value; }else if('_wpcf7_version'==field.name){ detail.pluginVersion=field.value; }else if('_wpcf7_locale'==field.name){ detail.contactFormLocale=field.value; }else if('_wpcf7_unit_tag'==field.name){ detail.unitTag=field.value; }else if('_wpcf7_container_post'==field.name){ detail.containerPostId=field.value; }else if(field.name.match(/^_wpcf7_\w+_free_text_/)){ var owner=field.name.replace(/^_wpcf7_\w+_free_text_/, ''); detail.inputs.push({ name: owner + '-free-text', value: field.value }); }else if(field.name.match(/^_/)){ }else{ detail.inputs.push(field); }}); wpcf7.triggerEvent($form.closest('div.wpcf7'), 'beforesubmit', detail); var ajaxSuccess=function(data, status, xhr, $form){ detail.id=$(data.into).attr('id'); detail.status=data.status; detail.apiResponse=data; var $message=$('.wpcf7-response-output', $form); switch(data.status){ case 'validation_failed': $.each(data.invalidFields, function(i, n){ $(n.into, $form).each(function(){ wpcf7.notValidTip(this, n.message); $('.wpcf7-form-control', this).addClass('wpcf7-not-valid'); $('[aria-invalid]', this).attr('aria-invalid', 'true'); }); }); $message.addClass('wpcf7-validation-errors'); $form.addClass('invalid'); wpcf7.triggerEvent(data.into, 'invalid', detail); break; case 'acceptance_missing': $message.addClass('wpcf7-acceptance-missing'); $form.addClass('unaccepted'); wpcf7.triggerEvent(data.into, 'unaccepted', detail); break; case 'spam': $message.addClass('wpcf7-spam-blocked'); $form.addClass('spam'); wpcf7.triggerEvent(data.into, 'spam', detail); break; case 'aborted': $message.addClass('wpcf7-aborted'); $form.addClass('aborted'); wpcf7.triggerEvent(data.into, 'aborted', detail); break; case 'mail_sent': $message.addClass('wpcf7-mail-sent-ok'); $form.addClass('sent'); wpcf7.triggerEvent(data.into, 'mailsent', detail); break; case 'mail_failed': $message.addClass('wpcf7-mail-sent-ng'); $form.addClass('failed'); wpcf7.triggerEvent(data.into, 'mailfailed', detail); break; default: var customStatusClass='custom-' + data.status.replace(/[^0-9a-z]+/i, '-'); $message.addClass('wpcf7-' + customStatusClass); $form.addClass(customStatusClass); } wpcf7.refill($form, data); wpcf7.triggerEvent(data.into, 'submit', detail); if('mail_sent'==data.status){ $form.each(function(){ this.reset(); }); wpcf7.toggleSubmit($form); } if(! wpcf7.supportHtml5.placeholder){ $form.find('[placeholder].placeheld').each(function(i, n){ $(n).val($(n).attr('placeholder')); }); } $message.html('').append(data.message).slideDown('fast'); $message.attr('role', 'alert'); $('.screen-reader-response', $form.closest('.wpcf7')).each(function(){ var $response=$(this); $response.html('').attr('role', '').append(data.message); if(data.invalidFields){ var $invalids=$(''); $.each(data.invalidFields, function(i, n){ if(n.idref){ var $li=$('
  • ').append($('').attr('href', '#' + n.idref).append(n.message)); }else{ var $li=$('
  • ').append(n.message); } $invalids.append($li); }); $response.append($invalids); } $response.attr('role', 'alert').focus(); }); }; $.ajax({ type: 'POST', url: wpcf7.apiSettings.getRoute('/contact-forms/' + wpcf7.getId($form) + '/feedback'), data: formData, dataType: 'json', processData: false, contentType: false }).done(function(data, status, xhr){ ajaxSuccess(data, status, xhr, $form); $('.ajax-loader', $form).removeClass('is-active'); }).fail(function(xhr, status, error){ var $e=$('
    ').text(error.message); $form.after($e); }); }; wpcf7.triggerEvent=function(target, name, detail){ var $target=$(target); var event=new CustomEvent('wpcf7' + name, { bubbles: true, detail: detail }); $target.get(0).dispatchEvent(event); $target.trigger('wpcf7:' + name, detail); $target.trigger(name + '.wpcf7', detail); }; wpcf7.toggleSubmit=function(form, state){ var $form=$(form); var $submit=$('input:submit', $form); if(typeof state!=='undefined'){ $submit.prop('disabled', ! state); return; } if($form.hasClass('wpcf7-acceptance-as-validation')){ return; } $submit.prop('disabled', false); $('.wpcf7-acceptance', $form).each(function(){ var $span=$(this); var $input=$('input:checkbox', $span); if(! $span.hasClass('optional')){ if($span.hasClass('invert')&&$input.is(':checked') || ! $span.hasClass('invert')&&! $input.is(':checked')){ $submit.prop('disabled', true); return false; }} }); }; wpcf7.notValidTip=function(target, message){ var $target=$(target); $('.wpcf7-not-valid-tip', $target).remove(); $('') .text(message).appendTo($target); if($target.is('.use-floating-validation-tip *')){ var fadeOut=function(target){ $(target).not(':hidden').animate({ opacity: 0 }, 'fast', function(){ $(this).css({ 'z-index': -100 }); }); }; $target.on('mouseover', '.wpcf7-not-valid-tip', function(){ fadeOut(this); }); $target.on('focus', ':input', function(){ fadeOut($('.wpcf7-not-valid-tip', $target)); }); }}; wpcf7.refill=function(form, data){ var $form=$(form); var refillCaptcha=function($form, items){ $.each(items, function(i, n){ $form.find(':input[name="' + i + '"]').val(''); $form.find('img.wpcf7-captcha-' + i).attr('src', n); var match=/([0-9]+)\.(png|gif|jpeg)$/.exec(n); $form.find('input:hidden[name="_wpcf7_captcha_challenge_' + i + '"]').attr('value', match[ 1 ]); }); }; var refillQuiz=function($form, items){ $.each(items, function(i, n){ $form.find(':input[name="' + i + '"]').val(''); $form.find(':input[name="' + i + '"]').siblings('span.wpcf7-quiz-label').text(n[ 0 ]); $form.find('input:hidden[name="_wpcf7_quiz_answer_' + i + '"]').attr('value', n[ 1 ]); }); }; if(typeof data==='undefined'){ $.ajax({ type: 'GET', url: wpcf7.apiSettings.getRoute('/contact-forms/' + wpcf7.getId($form) + '/refill'), beforeSend: function(xhr){ var nonce=$form.find(':input[name="_wpnonce"]').val(); if(nonce){ xhr.setRequestHeader('X-WP-Nonce', nonce); }}, dataType: 'json' }).done(function(data, status, xhr){ if(data.captcha){ refillCaptcha($form, data.captcha); } if(data.quiz){ refillQuiz($form, data.quiz); }}); }else{ if(data.captcha){ refillCaptcha($form, data.captcha); } if(data.quiz){ refillQuiz($form, data.quiz); }} }; wpcf7.clearResponse=function(form){ var $form=$(form); $form.removeClass('invalid spam sent failed'); $form.siblings('.screen-reader-response').html('').attr('role', ''); $('.wpcf7-not-valid-tip', $form).remove(); $('[aria-invalid]', $form).attr('aria-invalid', 'false'); $('.wpcf7-form-control', $form).removeClass('wpcf7-not-valid'); $('.wpcf7-response-output', $form) .hide().empty().removeAttr('role') .removeClass('wpcf7-mail-sent-ok wpcf7-mail-sent-ng wpcf7-validation-errors wpcf7-spam-blocked'); }; wpcf7.apiSettings.getRoute=function(path){ var url=wpcf7.apiSettings.root; url=url.replace(wpcf7.apiSettings.namespace, wpcf7.apiSettings.namespace + path); return url; };})(jQuery); (function (){ if(typeof window.CustomEvent==="function") return false; function CustomEvent(event, params){ params=params||{ bubbles: false, cancelable: false, detail: undefined }; var evt=document.createEvent('CustomEvent'); evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); return evt; } CustomEvent.prototype=window.Event.prototype; window.CustomEvent=CustomEvent; })(); (function($){ "use strict"; $.fn.fitVids=function(options){ var settings={ customSelector: null }; var div=document.createElement('div'), ref=document.getElementsByTagName('base')[0]||document.getElementsByTagName('script')[0]; div.className='fit-vids-style'; div.innerHTML='­'; ref.parentNode.insertBefore(div,ref); if(options){ $.extend(settings, options); } return this.each(function(){ var selectors=[ "iframe[src*='player.vimeo.com']", "iframe[src*='www.youtube.com']", "iframe[src*='www.kickstarter.com']", "object", "embed" ]; if(settings.customSelector){ selectors.push(settings.customSelector); } var $allVideos=$(this).find(selectors.join(',')); $allVideos.each(function(){ var $this=$(this); if(this.tagName.toLowerCase()==='embed'&&$this.parent('object').length||$this.parent('.fluid-width-video-wrapper').length){ return; } var height=(this.tagName.toLowerCase()==='object'||($this.attr('height')&&!isNaN(parseInt($this.attr('height'), 10)))) ? parseInt($this.attr('height'), 10):$this.height(), width = !isNaN(parseInt($this.attr('width'), 10)) ? parseInt($this.attr('width'), 10):$this.width(), aspectRatio=height / width; if(!$this.attr('id')){ var videoID='fitvid' + Math.floor(Math.random()*999999); $this.attr('id', videoID); } $this.wrap('
    ').parent('.fluid-width-video-wrapper').css('padding-top', (aspectRatio * 100)+"%"); $this.removeAttr('height').removeAttr('width'); }); }); };})(jQuery); !function(t){var e={},s={mode:"horizontal",slideSelector:"",infiniteLoop:!0,hideControlOnEnd:!1,speed:500,easing:null,slideMargin:0,startSlide:0,randomStart:!1,captions:!1,ticker:!1,tickerHover:!1,adaptiveHeight:!1,adaptiveHeightSpeed:500,video:!1,useCSS:!0,preloadImages:"visible",responsive:!0,slideZIndex:50,touchEnabled:!0,swipeThreshold:50,oneToOneTouch:!0,preventDefaultSwipeX:!0,preventDefaultSwipeY:!1,pager:!0,pagerType:"full",pagerShortSeparator:" / ",pagerSelector:null,buildPager:null,pagerCustom:null,controls:!0,nextText:"Next",prevText:"Prev",nextSelector:null,prevSelector:null,autoControls:!1,startText:"Start",stopText:"Stop",autoControlsCombine:!1,autoControlsSelector:null,auto:!1,pause:4e3,autoStart:!0,autoDirection:"next",autoHover:!1,autoDelay:0,minSlides:1,maxSlides:1,moveSlides:0,slideWidth:0,onSliderLoad:function(){},onSlideBefore:function(){},onSlideAfter:function(){},onSlideNext:function(){},onSlidePrev:function(){},onSliderResize:function(){}};t.fn.bxSlider=function(n){if(0==this.length)return this;if(this.length>1)return this.each(function(){t(this).bxSlider(n)}),this;var o={},r=this;e.el=this;var a=t(window).width(),l=t(window).height(),d=function(){o.settings=t.extend({},s,n),o.settings.slideWidth=parseInt(o.settings.slideWidth),o.children=r.children(o.settings.slideSelector),o.children.length1||o.settings.maxSlides>1,o.carousel&&(o.settings.preloadImages="all"),o.minThreshold=o.settings.minSlides*o.settings.slideWidth+(o.settings.minSlides-1)*o.settings.slideMargin,o.maxThreshold=o.settings.maxSlides*o.settings.slideWidth+(o.settings.maxSlides-1)*o.settings.slideMargin,o.working=!1,o.controls={},o.interval=null,o.animProp="vertical"==o.settings.mode?"top":"left",o.usingCSS=o.settings.useCSS&&"fade"!=o.settings.mode&&function(){var t=document.createElement("div"),e=["WebkitPerspective","MozPerspective","OPerspective","msPerspective"];for(var i in e)if(void 0!==t.style[e[i]])return o.cssPrefix=e[i].replace("Perspective","").toLowerCase(),o.animProp="-"+o.cssPrefix+"-transform",!0;return!1}(),"vertical"==o.settings.mode&&(o.settings.maxSlides=o.settings.minSlides),r.data("origStyle",r.attr("style")),r.children(o.settings.slideSelector).each(function(){t(this).data("origStyle",t(this).attr("style"))}),c()},c=function(){r.wrap('
    '),o.viewport=r.parent(),o.loader=t('
    '),o.viewport.prepend(o.loader),r.css({width:"horizontal"==o.settings.mode?100*o.children.length+215+"%":"auto",position:"relative"}),o.usingCSS&&o.settings.easing?r.css("-"+o.cssPrefix+"-transition-timing-function",o.settings.easing):o.settings.easing||(o.settings.easing="swing"),f(),o.viewport.css({width:"100%",overflow:"hidden",position:"relative"}),o.viewport.parent().css({maxWidth:p()}),o.settings.pager||o.viewport.parent().css({margin:"0 auto 0px"}),o.children.css({"float":"horizontal"==o.settings.mode?"left":"none",listStyle:"none",position:"relative"}),o.children.css("width",u()),"horizontal"==o.settings.mode&&o.settings.slideMargin>0&&o.children.css("marginRight",o.settings.slideMargin),"vertical"==o.settings.mode&&o.settings.slideMargin>0&&o.children.css("marginBottom",o.settings.slideMargin),"fade"==o.settings.mode&&(o.children.css({position:"absolute",zIndex:0,display:"none"}),o.children.eq(o.settings.startSlide).css({zIndex:o.settings.slideZIndex,display:"block"})),o.controls.el=t('
    '),o.settings.captions&&P(),o.active.last=o.settings.startSlide==x()-1,o.settings.video&&r.fitVids();var e=o.children.eq(o.settings.startSlide);"all"==o.settings.preloadImages&&(e=o.children),o.settings.ticker?o.settings.pager=!1:(o.settings.pager&&T(),o.settings.controls&&C(),o.settings.auto&&o.settings.autoControls&&E(),(o.settings.controls||o.settings.autoControls||o.settings.pager)&&o.viewport.after(o.controls.el)),g(e,h)},g=function(e,i){var s=e.find("img, iframe").length;if(0==s)return i(),void 0;var n=0;e.find("img, iframe").each(function(){t(this).one("load",function(){++n==s&&i()}).each(function(){this.complete&&t(this).load()})})},h=function(){if(o.settings.infiniteLoop&&"fade"!=o.settings.mode&&!o.settings.ticker){var e="vertical"==o.settings.mode?o.settings.minSlides:o.settings.maxSlides,i=o.children.slice(0,e).clone().addClass("bx-clone"),s=o.children.slice(-e).clone().addClass("bx-clone");r.append(i).prepend(s)}o.loader.remove(),S(),"vertical"==o.settings.mode&&(o.settings.adaptiveHeight=!0),o.viewport.height(v()),r.redrawSlider(),o.settings.onSliderLoad(o.active.index),o.initialized=!0,o.settings.responsive&&t(window).bind("resize",Z),o.settings.auto&&o.settings.autoStart&&H(),o.settings.ticker&&L(),o.settings.pager&&q(o.settings.startSlide),o.settings.controls&&W(),o.settings.touchEnabled&&!o.settings.ticker&&O()},v=function(){var e=0,s=t();if("vertical"==o.settings.mode||o.settings.adaptiveHeight)if(o.carousel){var n=1==o.settings.moveSlides?o.active.index:o.active.index*m();for(s=o.children.eq(n),i=1;i<=o.settings.maxSlides-1;i++)s=n+i>=o.children.length?s.add(o.children.eq(i-1)):s.add(o.children.eq(n+i))}else s=o.children.eq(o.active.index);else s=o.children;return"vertical"==o.settings.mode?(s.each(function(){e+=t(this).outerHeight()}),o.settings.slideMargin>0&&(e+=o.settings.slideMargin*(o.settings.minSlides-1))):e=Math.max.apply(Math,s.map(function(){return t(this).outerHeight(!1)}).get()),e},p=function(){var t="100%";return o.settings.slideWidth>0&&(t="horizontal"==o.settings.mode?o.settings.maxSlides*o.settings.slideWidth+(o.settings.maxSlides-1)*o.settings.slideMargin:o.settings.slideWidth),t},u=function(){var t=o.settings.slideWidth,e=o.viewport.width();return 0==o.settings.slideWidth||o.settings.slideWidth>e&&!o.carousel||"vertical"==o.settings.mode?t=e:o.settings.maxSlides>1&&"horizontal"==o.settings.mode&&(e>o.maxThreshold||e0)if(o.viewport.width()o.maxThreshold)t=o.settings.maxSlides;else{var e=o.children.first().width();t=Math.floor(o.viewport.width()/e)}else"vertical"==o.settings.mode&&(t=o.settings.minSlides);return t},x=function(){var t=0;if(o.settings.moveSlides>0)if(o.settings.infiniteLoop)t=o.children.length/m();else for(var e=0,i=0;e0&&o.settings.moveSlides<=f()?o.settings.moveSlides:f()},S=function(){if(o.children.length>o.settings.maxSlides&&o.active.last&&!o.settings.infiniteLoop){if("horizontal"==o.settings.mode){var t=o.children.last(),e=t.position();b(-(e.left-(o.viewport.width()-t.width())),"reset",0)}else if("vertical"==o.settings.mode){var i=o.children.length-o.settings.minSlides,e=o.children.eq(i).position();b(-e.top,"reset",0)}}else{var e=o.children.eq(o.active.index*m()).position();o.active.index==x()-1&&(o.active.last=!0),void 0!=e&&("horizontal"==o.settings.mode?b(-e.left,"reset",0):"vertical"==o.settings.mode&&b(-e.top,"reset",0))}},b=function(t,e,i,s){if(o.usingCSS){var n="vertical"==o.settings.mode?"translate3d(0, "+t+"px, 0)":"translate3d("+t+"px, 0, 0)";r.css("-"+o.cssPrefix+"-transition-duration",i/1e3+"s"),"slide"==e?(r.css(o.animProp,n),r.bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",function(){r.unbind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd"),D()})):"reset"==e?r.css(o.animProp,n):"ticker"==e&&(r.css("-"+o.cssPrefix+"-transition-timing-function","linear"),r.css(o.animProp,n),r.bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",function(){r.unbind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd"),b(s.resetValue,"reset",0),N()}))}else{var a={};a[o.animProp]=t,"slide"==e?r.animate(a,i,o.settings.easing,function(){D()}):"reset"==e?r.css(o.animProp,t):"ticker"==e&&r.animate(a,speed,"linear",function(){b(s.resetValue,"reset",0),N()})}},w=function(){for(var e="",i=x(),s=0;i>s;s++){var n="";o.settings.buildPager&&t.isFunction(o.settings.buildPager)?(n=o.settings.buildPager(s),o.pagerEl.addClass("bx-custom-pager")):(n=s+1,o.pagerEl.addClass("bx-default-pager")),e+='"}o.pagerEl.html(e)},T=function(){o.settings.pagerCustom?o.pagerEl=t(o.settings.pagerCustom):(o.pagerEl=t('
    '),o.settings.pagerSelector?t(o.settings.pagerSelector).html(o.pagerEl):o.controls.el.addClass("bx-has-pager").append(o.pagerEl),w()),o.pagerEl.on("click","a",I)},C=function(){o.controls.next=t(''+o.settings.nextText+""),o.controls.prev=t(''+o.settings.prevText+""),o.controls.next.bind("click",y),o.controls.prev.bind("click",z),o.settings.nextSelector&&t(o.settings.nextSelector).append(o.controls.next),o.settings.prevSelector&&t(o.settings.prevSelector).append(o.controls.prev),o.settings.nextSelector||o.settings.prevSelector||(o.controls.directionEl=t('
    '),o.controls.directionEl.append(o.controls.prev).append(o.controls.next),o.controls.el.addClass("bx-has-controls-direction").append(o.controls.directionEl))},E=function(){o.controls.start=t('"),o.controls.stop=t('"),o.controls.autoEl=t('
    '),o.controls.autoEl.on("click",".bx-start",k),o.controls.autoEl.on("click",".bx-stop",M),o.settings.autoControlsCombine?o.controls.autoEl.append(o.controls.start):o.controls.autoEl.append(o.controls.start).append(o.controls.stop),o.settings.autoControlsSelector?t(o.settings.autoControlsSelector).html(o.controls.autoEl):o.controls.el.addClass("bx-has-controls-auto").append(o.controls.autoEl),A(o.settings.autoStart?"stop":"start")},P=function(){o.children.each(function(){var e=t(this).find("img:first").attr("title");void 0!=e&&(""+e).length&&t(this).append('
    '+e+"
    ")})},y=function(t){o.settings.auto&&r.stopAuto(),r.goToNextSlide(),t.preventDefault()},z=function(t){o.settings.auto&&r.stopAuto(),r.goToPrevSlide(),t.preventDefault()},k=function(t){r.startAuto(),t.preventDefault()},M=function(t){r.stopAuto(),t.preventDefault()},I=function(e){o.settings.auto&&r.stopAuto();var i=t(e.currentTarget),s=parseInt(i.attr("data-slide-index"));s!=o.active.index&&r.goToSlide(s),e.preventDefault()},q=function(e){var i=o.children.length;return"short"==o.settings.pagerType?(o.settings.maxSlides>1&&(i=Math.ceil(o.children.length/o.settings.maxSlides)),o.pagerEl.html(e+1+o.settings.pagerShortSeparator+i),void 0):(o.pagerEl.find("a").removeClass("active"),o.pagerEl.each(function(i,s){t(s).find("a").eq(e).addClass("active")}),void 0)},D=function(){if(o.settings.infiniteLoop){var t="";0==o.active.index?t=o.children.eq(0).position():o.active.index==x()-1&&o.carousel?t=o.children.eq((x()-1)*m()).position():o.active.index==o.children.length-1&&(t=o.children.eq(o.children.length-1).position()),t&&("horizontal"==o.settings.mode?b(-t.left,"reset",0):"vertical"==o.settings.mode&&b(-t.top,"reset",0))}o.working=!1,o.settings.onSlideAfter(o.children.eq(o.active.index),o.oldIndex,o.active.index)},A=function(t){o.settings.autoControlsCombine?o.controls.autoEl.html(o.controls[t]):(o.controls.autoEl.find("a").removeClass("active"),o.controls.autoEl.find("a:not(.bx-"+t+")").addClass("active"))},W=function(){1==x()?(o.controls.prev.addClass("disabled"),o.controls.next.addClass("disabled")):!o.settings.infiniteLoop&&o.settings.hideControlOnEnd&&(0==o.active.index?(o.controls.prev.addClass("disabled"),o.controls.next.removeClass("disabled")):o.active.index==x()-1?(o.controls.next.addClass("disabled"),o.controls.prev.removeClass("disabled")):(o.controls.prev.removeClass("disabled"),o.controls.next.removeClass("disabled")))},H=function(){o.settings.autoDelay>0?setTimeout(r.startAuto,o.settings.autoDelay):r.startAuto(),o.settings.autoHover&&r.hover(function(){o.interval&&(r.stopAuto(!0),o.autoPaused=!0)},function(){o.autoPaused&&(r.startAuto(!0),o.autoPaused=null)})},L=function(){var e=0;if("next"==o.settings.autoDirection)r.append(o.children.clone().addClass("bx-clone"));else{r.prepend(o.children.clone().addClass("bx-clone"));var i=o.children.first().position();e="horizontal"==o.settings.mode?-i.left:-i.top}b(e,"reset",0),o.settings.pager=!1,o.settings.controls=!1,o.settings.autoControls=!1,o.settings.tickerHover&&!o.usingCSS&&o.viewport.hover(function(){r.stop()},function(){var e=0;o.children.each(function(){e+="horizontal"==o.settings.mode?t(this).outerWidth(!0):t(this).outerHeight(!0)});var i=o.settings.speed/e,s="horizontal"==o.settings.mode?"left":"top",n=i*(e-Math.abs(parseInt(r.css(s))));N(n)}),N()},N=function(t){speed=t?t:o.settings.speed;var e={left:0,top:0},i={left:0,top:0};"next"==o.settings.autoDirection?e=r.find(".bx-clone").first().position():i=o.children.first().position();var s="horizontal"==o.settings.mode?-e.left:-e.top,n="horizontal"==o.settings.mode?-i.left:-i.top,a={resetValue:n};b(s,"ticker",speed,a)},O=function(){o.touch={start:{x:0,y:0},end:{x:0,y:0}},o.viewport.bind("touchstart",X)},X=function(t){if(o.working)t.preventDefault();else{o.touch.originalPos=r.position();var e=t.originalEvent;o.touch.start.x=e.changedTouches[0].pageX,o.touch.start.y=e.changedTouches[0].pageY,o.viewport.bind("touchmove",Y),o.viewport.bind("touchend",V)}},Y=function(t){var e=t.originalEvent,i=Math.abs(e.changedTouches[0].pageX-o.touch.start.x),s=Math.abs(e.changedTouches[0].pageY-o.touch.start.y);if(3*i>s&&o.settings.preventDefaultSwipeX?t.preventDefault():3*s>i&&o.settings.preventDefaultSwipeY&&t.preventDefault(),"fade"!=o.settings.mode&&o.settings.oneToOneTouch){var n=0;if("horizontal"==o.settings.mode){var r=e.changedTouches[0].pageX-o.touch.start.x;n=o.touch.originalPos.left+r}else{var r=e.changedTouches[0].pageY-o.touch.start.y;n=o.touch.originalPos.top+r}b(n,"reset",0)}},V=function(t){o.viewport.unbind("touchmove",Y);var e=t.originalEvent,i=0;if(o.touch.end.x=e.changedTouches[0].pageX,o.touch.end.y=e.changedTouches[0].pageY,"fade"==o.settings.mode){var s=Math.abs(o.touch.start.x-o.touch.end.x);s>=o.settings.swipeThreshold&&(o.touch.start.x>o.touch.end.x?r.goToNextSlide():r.goToPrevSlide(),r.stopAuto())}else{var s=0;"horizontal"==o.settings.mode?(s=o.touch.end.x-o.touch.start.x,i=o.touch.originalPos.left):(s=o.touch.end.y-o.touch.start.y,i=o.touch.originalPos.top),!o.settings.infiniteLoop&&(0==o.active.index&&s>0||o.active.last&&0>s)?b(i,"reset",200):Math.abs(s)>=o.settings.swipeThreshold?(0>s?r.goToNextSlide():r.goToPrevSlide(),r.stopAuto()):b(i,"reset",200)}o.viewport.unbind("touchend",V)},Z=function(){var e=t(window).width(),i=t(window).height();(a!=e||l!=i)&&(a=e,l=i,r.redrawSlider(),o.settings.onSliderResize.call(r,o.active.index))};return r.goToSlide=function(e,i){if(!o.working&&o.active.index!=e)if(o.working=!0,o.oldIndex=o.active.index,o.active.index=0>e?x()-1:e>=x()?0:e,o.settings.onSlideBefore(o.children.eq(o.active.index),o.oldIndex,o.active.index),"next"==i?o.settings.onSlideNext(o.children.eq(o.active.index),o.oldIndex,o.active.index):"prev"==i&&o.settings.onSlidePrev(o.children.eq(o.active.index),o.oldIndex,o.active.index),o.active.last=o.active.index>=x()-1,o.settings.pager&&q(o.active.index),o.settings.controls&&W(),"fade"==o.settings.mode)o.settings.adaptiveHeight&&o.viewport.height()!=v()&&o.viewport.animate({height:v()},o.settings.adaptiveHeightSpeed),o.children.filter(":visible").fadeOut(o.settings.speed).css({zIndex:0}),o.children.eq(o.active.index).css("zIndex",o.settings.slideZIndex+1).fadeIn(o.settings.speed,function(){t(this).css("zIndex",o.settings.slideZIndex),D()});else{o.settings.adaptiveHeight&&o.viewport.height()!=v()&&o.viewport.animate({height:v()},o.settings.adaptiveHeightSpeed);var s=0,n={left:0,top:0};if(!o.settings.infiniteLoop&&o.carousel&&o.active.last)if("horizontal"==o.settings.mode){var a=o.children.eq(o.children.length-1);n=a.position(),s=o.viewport.width()-a.outerWidth()}else{var l=o.children.length-o.settings.minSlides;n=o.children.eq(l).position()}else if(o.carousel&&o.active.last&&"prev"==i){var d=1==o.settings.moveSlides?o.settings.maxSlides-m():(x()-1)*m()-(o.children.length-o.settings.maxSlides),a=r.children(".bx-clone").eq(d);n=a.position()}else if("next"==i&&0==o.active.index)n=r.find("> .bx-clone").eq(o.settings.maxSlides).position(),o.active.last=!1;else if(e>=0){var c=e*m();n=o.children.eq(c).position()}if("undefined"!=typeof n){var g="horizontal"==o.settings.mode?-(n.left-s):-n.top;b(g,"slide",o.settings.speed)}}},r.goToNextSlide=function(){if(o.settings.infiniteLoop||!o.active.last){var t=parseInt(o.active.index)+1;r.goToSlide(t,"next")}},r.goToPrevSlide=function(){if(o.settings.infiniteLoop||0!=o.active.index){var t=parseInt(o.active.index)-1;r.goToSlide(t,"prev")}},r.startAuto=function(t){o.interval||(o.interval=setInterval(function(){"next"==o.settings.autoDirection?r.goToNextSlide():r.goToPrevSlide()},o.settings.pause),o.settings.autoControls&&1!=t&&A("stop"))},r.stopAuto=function(t){o.interval&&(clearInterval(o.interval),o.interval=null,o.settings.autoControls&&1!=t&&A("start"))},r.getCurrentSlide=function(){return o.active.index},r.getCurrentSlideElement=function(){return o.children.eq(o.active.index)},r.getSlideCount=function(){return o.children.length},r.redrawSlider=function(){o.children.add(r.find(".bx-clone")).outerWidth(u()),o.viewport.css("height",v()),o.settings.ticker||S(),o.active.last&&(o.active.index=x()-1),o.active.index>=x()&&(o.active.last=!0),o.settings.pager&&!o.settings.pagerCustom&&(w(),q(o.active.index))},r.destroySlider=function(){o.initialized&&(o.initialized=!1,t(".bx-clone",this).remove(),o.children.each(function(){void 0!=t(this).data("origStyle")?t(this).attr("style",t(this).data("origStyle")):t(this).removeAttr("style")}),void 0!=t(this).data("origStyle")?this.attr("style",t(this).data("origStyle")):t(this).removeAttr("style"),t(this).unwrap().unwrap(),o.controls.el&&o.controls.el.remove(),o.controls.next&&o.controls.next.remove(),o.controls.prev&&o.controls.prev.remove(),o.pagerEl&&o.settings.controls&&o.pagerEl.remove(),t(".bx-caption",this).remove(),o.controls.autoEl&&o.controls.autoEl.remove(),clearInterval(o.interval),o.settings.responsive&&t(window).unbind("resize",Z))},r.reloadSlider=function(t){void 0!=t&&(n=t),r.destroySlider(),d()},d(),this}}(jQuery); (function(e){function t(){var e=location.href;hashtag=e.indexOf("#prettyPhoto")!==-1?decodeURI(e.substring(e.indexOf("#prettyPhoto")+1,e.length)):false;return hashtag}function n(){if(typeof theRel=="undefined")return;location.hash=theRel+"/"+rel_index+"/"}function r(){if(location.href.indexOf("#prettyPhoto")!==-1)location.hash="prettyPhoto"}function i(e,t){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var n="[\\?&]"+e+"=([^&#]*)";var r=new RegExp(n);var i=r.exec(t);return i==null?"":i[1]}e.prettyPhoto={version:"3.1.5"};e.fn.prettyPhoto=function(s){function g(){e(".pp_loaderIcon").hide();projectedTop=scroll_pos["scrollTop"]+(d/2-a["containerHeight"]/2);if(projectedTop<0)projectedTop=0;$ppt.fadeTo(settings.animation_speed,1);$pp_pic_holder.find(".pp_content").animate({height:a["contentHeight"],width:a["contentWidth"]},settings.animation_speed);$pp_pic_holder.animate({top:projectedTop,left:v/2-a["containerWidth"]/2<0?0:v/2-a["containerWidth"]/2,width:a["containerWidth"]},settings.animation_speed,function(){$pp_pic_holder.find(".pp_hoverContainer,#fullResImage").height(a["height"]).width(a["width"]);$pp_pic_holder.find(".pp_fade").fadeIn(settings.animation_speed);if(isSet&&S(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(a["resized"]){e("a.pp_expand,a.pp_contract").show()}else{e("a.pp_expand").hide()}}if(settings.autoplay_slideshow&&!m&&!f)e.prettyPhoto.startSlideshow();settings.changepicturecallback();f=true});C();s.ajaxcallback()}function y(t){$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(){e(".pp_loaderIcon").show();t()})}function b(t){t>1?e(".pp_nav").show():e(".pp_nav").hide()}function w(e,t){resized=false;E(e,t);imageWidth=e,imageHeight=t;if((p>v||h>d)&&doresize&&settings.allow_resize&&!u){resized=true,fitting=false;while(!fitting){if(p>v){imageWidth=v-200;imageHeight=t/e*imageWidth}else if(h>d){imageHeight=d-200;imageWidth=e/t*imageHeight}else{fitting=true}h=imageHeight,p=imageWidth}if(p>v||h>d){w(p,h)}E(imageWidth,imageHeight)}return{width:Math.floor(imageWidth),height:Math.floor(imageHeight),containerHeight:Math.floor(h),containerWidth:Math.floor(p)+settings.horizontal_padding*2,contentHeight:Math.floor(l),contentWidth:Math.floor(c),resized:resized}}function E(t,n){t=parseFloat(t);n=parseFloat(n);$pp_details=$pp_pic_holder.find(".pp_details");$pp_details.width(t);detailsHeight=parseFloat($pp_details.css("marginTop"))+parseFloat($pp_details.css("marginBottom"));$pp_details=$pp_details.clone().addClass(settings.theme).width(t).appendTo(e("body")).css({position:"absolute",top:-1e4});detailsHeight+=$pp_details.height();detailsHeight=detailsHeight<=34?36:detailsHeight;$pp_details.remove();$pp_title=$pp_pic_holder.find(".ppt");$pp_title.width(t);titleHeight=parseFloat($pp_title.css("marginTop"))+parseFloat($pp_title.css("marginBottom"));$pp_title=$pp_title.clone().appendTo(e("body")).css({position:"absolute",top:-1e4});titleHeight+=$pp_title.height();$pp_title.remove();l=n+detailsHeight;c=t;h=l+titleHeight+$pp_pic_holder.find(".pp_top").height()+$pp_pic_holder.find(".pp_bottom").height();p=t}function S(e){if(e.match(/youtube\.com\/watch/i)||e.match(/youtu\.be/i)){return"youtube"}else if(e.match(/vimeo\.com/i)){return"vimeo"}else if(e.match(/\b.mov\b/i)){return"quicktime"}else if(e.match(/\b.swf\b/i)){return"flash"}else if(e.match(/\biframe=true\b/i)){return"iframe"}else if(e.match(/\bajax=true\b/i)){return"ajax"}else if(e.match(/\bcustom=true\b/i)){return"custom"}else if(e.substr(0,1)=="#"){return"inline"}else{return"image"}}function x(){if(doresize&&typeof $pp_pic_holder!="undefined"){scroll_pos=T();contentHeight=$pp_pic_holder.height(),contentwidth=$pp_pic_holder.width();projectedTop=d/2+scroll_pos["scrollTop"]-contentHeight/2;if(projectedTop<0)projectedTop=0;if(contentHeight>d)return;$pp_pic_holder.css({top:projectedTop,left:v/2+scroll_pos["scrollLeft"]-contentwidth/2})}}function T(){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 N(){d=e(window).height(),v=e(window).width();if(typeof $pp_overlay!="undefined")$pp_overlay.height(e(document).height()).width(v)}function C(){if(isSet&&settings.overlay_gallery&&S(pp_images[set_position])=="image"){itemWidth=52+5;navWidth=settings.theme=="facebook"||settings.theme=="pp_default"?50:30;itemsPerPage=Math.floor((a["containerWidth"]-100-navWidth)/itemWidth);itemsPerPage=itemsPerPage"}toInject=settings.gallery_markup.replace(/{gallery}/g,toInject);$pp_pic_holder.find("#pp_full_res").after(toInject);$pp_gallery=e(".pp_pic_holder .pp_gallery"),$pp_gallery_li=$pp_gallery.find("li");$pp_gallery.find(".pp_arrow_next").click(function(){e.prettyPhoto.changeGalleryPage("next");e.prettyPhoto.stopSlideshow();return false});$pp_gallery.find(".pp_arrow_previous").click(function(){e.prettyPhoto.changeGalleryPage("previous");e.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(t){e(this).find("a").click(function(){e.prettyPhoto.changePage(t);e.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(){e.prettyPhoto.startSlideshow();return false})}$pp_pic_holder.attr("class","pp_pic_holder "+settings.theme);$pp_overlay.css({opacity:0,height:e(document).height(),width:e(window).width()}).bind("click",function(){if(!settings.modal)e.prettyPhoto.close()});e("a.pp_close").bind("click",function(){e.prettyPhoto.close();return false});if(settings.allow_expand){e("a.pp_expand").bind("click",function(t){if(e(this).hasClass("pp_expand")){e(this).removeClass("pp_expand").addClass("pp_contract");doresize=false}else{e(this).removeClass("pp_contract").addClass("pp_expand");doresize=true}y(function(){e.prettyPhoto.open()});return false})}$pp_pic_holder.find(".pp_previous, .pp_nav .pp_arrow_previous").bind("click",function(){e.prettyPhoto.changePage("previous");e.prettyPhoto.stopSlideshow();return false});$pp_pic_holder.find(".pp_next, .pp_nav .pp_arrow_next").bind("click",function(){e.prettyPhoto.changePage("next");e.prettyPhoto.stopSlideshow();return false});x()}s=jQuery.extend({hook:"rel",animation_speed:"fast",ajaxcallback:function(){},slideshow:5e3,autoplay_slideshow:false,opacity:.8,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:'
     
    ',gallery_markup:'',image_markup:'',flash_markup:'',quicktime_markup:'',iframe_markup:'',inline_markup:'
    {content}
    ',custom_markup:"",social_tools:''},s);var o=this,u=false,a,f,l,c,h,p,d=e(window).height(),v=e(window).width(),m;doresize=true,scroll_pos=T();e(window).unbind("resize.prettyphoto").bind("resize.prettyphoto",function(){x();N()});if(s.keyboard_shortcuts){e(document).unbind("keydown.prettyphoto").bind("keydown.prettyphoto",function(t){if(typeof $pp_pic_holder!="undefined"){if($pp_pic_holder.is(":visible")){switch(t.keyCode){case 37:e.prettyPhoto.changePage("previous");t.preventDefault();break;case 39:e.prettyPhoto.changePage("next");t.preventDefault();break;case 27:if(!settings.modal)e.prettyPhoto.close();t.preventDefault();break}}}})}e.prettyPhoto.initialize=function(){settings=s;if(settings.theme=="pp_default")settings.horizontal_padding=16;theRel=e(this).attr(settings.hook);galleryRegExp=/\[(?:.*)\]/;isSet=galleryRegExp.exec(theRel)?true:false;pp_images=isSet?jQuery.map(o,function(t,n){if(e(t).attr(settings.hook).indexOf(theRel)!=-1)return e(t).attr("href")}):e.makeArray(e(this).attr("href"));pp_titles=isSet?jQuery.map(o,function(t,n){if(e(t).attr(settings.hook).indexOf(theRel)!=-1)return e(t).find("img").attr("alt")?e(t).find("img").attr("alt"):""}):e.makeArray(e(this).find("img").attr("alt"));pp_descriptions=isSet?jQuery.map(o,function(t,n){if(e(t).attr(settings.hook).indexOf(theRel)!=-1)return e(t).attr("title")?e(t).attr("title"):""}):e.makeArray(e(this).attr("title"));if(pp_images.length>settings.overlay_gallery_max)settings.overlay_gallery=false;set_position=jQuery.inArray(e(this).attr("href"),pp_images);rel_index=isSet?set_position:e("a["+settings.hook+"^='"+theRel+"']").index(e(this));k(this);if(settings.allow_resize)e(window).bind("scroll.prettyphoto",function(){x()});e.prettyPhoto.open();return false};e.prettyPhoto.open=function(t){if(typeof settings=="undefined"){settings=s;pp_images=e.makeArray(arguments[0]);pp_titles=arguments[1]?e.makeArray(arguments[1]):e.makeArray("");pp_descriptions=arguments[2]?e.makeArray(arguments[2]):e.makeArray("");isSet=pp_images.length>1?true:false;set_position=arguments[3]?arguments[3]:0;k(t.target)}if(settings.hideflash)e("object,embed,iframe[src*=youtube],iframe[src*=vimeo]").css("visibility","hidden");b(e(pp_images).size());e(".pp_loaderIcon").show();if(settings.deeplinking)n();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+e(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(i("width",pp_images[set_position]))?i("width",pp_images[set_position]):settings.default_width.toString();movie_height=parseFloat(i("height",pp_images[set_position]))?i("height",pp_images[set_position]):settings.default_height.toString();u=false;if(movie_height.indexOf("%")!=-1){movie_height=parseFloat(e(window).height()*parseFloat(movie_height)/100-150);u=true}if(movie_width.indexOf("%")!=-1){movie_width=parseFloat(e(window).width()*parseFloat(movie_width)/100-150);u=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(S(pp_images[set_position])){case"image":imgPreloader=new Image;nextImage=new Image;if(isSet&&set_position0)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;i("rel",pp_images[set_position])?movie+="?rel="+i("rel",pp_images[set_position]):movie+="?rel=1";if(settings.autoplay)movie+="&autoplay=1";toInject=settings.iframe_markup.replace(/{width}/g,a["width"]).replace(/{height}/g,a["height"]).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,movie);break;case"vimeo":a=w(movie_width,movie_height);movie_id=pp_images[set_position];var t=/http(s?):\/\/(www\.)?vimeo.com\/(\d+)/;var n=movie_id.match(t);movie="http://player.vimeo.com/video/"+n[3]+"?title=0&byline=0&portrait=0";if(settings.autoplay)movie+="&autoplay=1;";vimeo_width=a["width"]+"/embed/?moog_width="+a["width"];toInject=settings.iframe_markup.replace(/{width}/g,vimeo_width).replace(/{height}/g,a["height"]).replace(/{path}/g,movie);break;case"quicktime":a=w(movie_width,movie_height);a["height"]+=15;a["contentHeight"]+=15;a["containerHeight"]+=15;toInject=settings.quicktime_markup.replace(/{width}/g,a["width"]).replace(/{height}/g,a["height"]).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,pp_images[set_position]).replace(/{autoplay}/g,settings.autoplay);break;case"flash":a=w(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,a["width"]).replace(/{height}/g,a["height"]).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,filename+"?"+flash_vars);break;case"iframe":a=w(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,a["width"]).replace(/{height}/g,a["height"]).replace(/{path}/g,frame_url);break;case"ajax":doresize=false;a=w(movie_width,movie_height);doresize=true;skipInjection=true;e.get(pp_images[set_position],function(e){toInject=settings.inline_markup.replace(/{content}/g,e);$pp_pic_holder.find("#pp_full_res")[0].innerHTML=toInject;g()});break;case"custom":a=w(movie_width,movie_height);toInject=settings.custom_markup;break;case"inline":myClone=e(pp_images[set_position]).clone().append('
    ').css({width:settings.default_width}).wrapInner('
    ').appendTo(e("body")).show();doresize=false;a=w(e(myClone).width(),e(myClone).height());doresize=true;e(myClone).remove();toInject=settings.inline_markup.replace(/{content}/g,e(pp_images[set_position]).html());break}if(!imgPreloader&&!skipInjection){$pp_pic_holder.find("#pp_full_res")[0].innerHTML=toInject;g()}});return false};e.prettyPhoto.changePage=function(t){currentGalleryPage=0;if(t=="previous"){set_position--;if(set_position<0)set_position=e(pp_images).size()-1}else if(t=="next"){set_position++;if(set_position>e(pp_images).size()-1)set_position=0}else{set_position=t}rel_index=set_position;if(!doresize)doresize=true;if(settings.allow_expand){e(".pp_contract").removeClass("pp_contract").addClass("pp_expand")}y(function(){e.prettyPhoto.open()})};e.prettyPhoto.changeGalleryPage=function(e){if(e=="next"){currentGalleryPage++;if(currentGalleryPage>totalPage)currentGalleryPage=0}else if(e=="previous"){currentGalleryPage--;if(currentGalleryPage<0)currentGalleryPage=totalPage}else{currentGalleryPage=e}slide_speed=e=="next"||e=="previous"?settings.animation_speed:0;slide_to=currentGalleryPage*itemsPerPage*itemWidth;$pp_gallery.find("ul").animate({left:-slide_to},slide_speed)};e.prettyPhoto.startSlideshow=function(){if(typeof m=="undefined"){$pp_pic_holder.find(".pp_play").unbind("click").removeClass("pp_play").addClass("pp_pause").click(function(){e.prettyPhoto.stopSlideshow();return false});m=setInterval(e.prettyPhoto.startSlideshow,settings.slideshow)}else{e.prettyPhoto.changePage("next")}};e.prettyPhoto.stopSlideshow=function(){$pp_pic_holder.find(".pp_pause").unbind("click").removeClass("pp_pause").addClass("pp_play").click(function(){e.prettyPhoto.startSlideshow();return false});clearInterval(m);m=undefined};e.prettyPhoto.close=function(){if($pp_overlay.is(":animated"))return;e.prettyPhoto.stopSlideshow();$pp_pic_holder.stop().find("object,embed").css("visibility","hidden");e("div.pp_pic_holder,div.ppt,.pp_fade").fadeOut(settings.animation_speed,function(){e(this).remove()});$pp_overlay.fadeOut(settings.animation_speed,function(){if(settings.hideflash)e("object,embed,iframe[src*=youtube],iframe[src*=vimeo]").css("visibility","visible");e(this).remove();e(window).unbind("scroll.prettyphoto");r();settings.callback();doresize=true;f=false;delete settings})};if(!pp_alreadyInitialized&&t()){pp_alreadyInitialized=true;hashIndex=t();hashRel=hashIndex;hashIndex=hashIndex.substring(hashIndex.indexOf("/")+1,hashIndex.length-1);hashRel=hashRel.substring(0,hashRel.indexOf("/"));setTimeout(function(){e("a["+s.hook+"^='"+hashRel+"']:eq("+hashIndex+")").trigger("click")},50)}return this.unbind("click.prettyphoto").bind("click.prettyphoto",e.prettyPhoto.initialize)};})(jQuery);var pp_alreadyInitialized=false !function(a){a.flexslider=function(b,c){var d=a(b);d.vars=a.extend({},a.flexslider.defaults,c);var j,e=d.vars.namespace,f=window.navigator&&window.navigator.msPointerEnabled&&window.MSGesture,g=("ontouchstart"in window||f||window.DocumentTouch&&document instanceof DocumentTouch)&&d.vars.touch,h="click touchend MSPointerUp",i="",k="vertical"===d.vars.direction,l=d.vars.reverse,m=d.vars.itemWidth>0,n="fade"===d.vars.animation,o=""!==d.vars.asNavFor,p={},q=!0;a.data(b,"flexslider",d),p={init:function(){d.animating=!1,d.currentSlide=parseInt(d.vars.startAt?d.vars.startAt:0,10),isNaN(d.currentSlide)&&(d.currentSlide=0),d.animatingTo=d.currentSlide,d.atEnd=0===d.currentSlide||d.currentSlide===d.last,d.containerSelector=d.vars.selector.substr(0,d.vars.selector.search(" ")),d.slides=a(d.vars.selector,d),d.container=a(d.containerSelector,d),d.count=d.slides.length,d.syncExists=a(d.vars.sync).length>0,"slide"===d.vars.animation&&(d.vars.animation="swing"),d.prop=k?"top":"marginLeft",d.args={},d.manualPause=!1,d.stopped=!1,d.started=!1,d.startTimeout=null,d.transitions=!d.vars.video&&!n&&d.vars.useCSS&&function(){var a=document.createElement("div"),b=["perspectiveProperty","WebkitPerspective","MozPerspective","OPerspective","msPerspective"];for(var c in b)if(void 0!==a.style[b[c]])return d.pfx=b[c].replace("Perspective","").toLowerCase(),d.prop="-"+d.pfx+"-transform",!0;return!1}(),d.ensureAnimationEnd="",""!==d.vars.controlsContainer&&(d.controlsContainer=a(d.vars.controlsContainer).length>0&&a(d.vars.controlsContainer)),""!==d.vars.manualControls&&(d.manualControls=a(d.vars.manualControls).length>0&&a(d.vars.manualControls)),d.vars.randomize&&(d.slides.sort(function(){return Math.round(Math.random())-.5}),d.container.empty().append(d.slides)),d.doMath(),d.setup("init"),d.vars.controlNav&&p.controlNav.setup(),d.vars.directionNav&&p.directionNav.setup(),d.vars.keyboard&&(1===a(d.containerSelector).length||d.vars.multipleKeyboard)&&a(document).bind("keyup",function(a){var b=a.keyCode;if(!d.animating&&(39===b||37===b)){var c=39===b?d.getTarget("next"):37===b?d.getTarget("prev"):!1;d.flexAnimate(c,d.vars.pauseOnAction)}}),d.vars.mousewheel&&d.bind("mousewheel",function(a,b){a.preventDefault();var f=0>b?d.getTarget("next"):d.getTarget("prev");d.flexAnimate(f,d.vars.pauseOnAction)}),d.vars.pausePlay&&p.pausePlay.setup(),d.vars.slideshow&&d.vars.pauseInvisible&&p.pauseInvisible.init(),d.vars.slideshow&&(d.vars.pauseOnHover&&d.hover(function(){d.manualPlay||d.manualPause||d.pause()},function(){d.manualPause||d.manualPlay||d.stopped||d.play()}),d.vars.pauseInvisible&&p.pauseInvisible.isHidden()||(d.vars.initDelay>0?d.startTimeout=setTimeout(d.play,d.vars.initDelay):d.play())),o&&p.asNav.setup(),g&&d.vars.touch&&p.touch(),(!n||n&&d.vars.smoothHeight)&&a(window).bind("resize orientationchange focus",p.resize),d.find("img").attr("draggable","false"),setTimeout(function(){d.vars.start(d)},200)},asNav:{setup:function(){d.asNav=!0,d.animatingTo=Math.floor(d.currentSlide/d.move),d.currentItem=d.currentSlide,d.slides.removeClass(e+"active-slide").eq(d.currentItem).addClass(e+"active-slide"),f?(b._slider=d,d.slides.each(function(){var b=this;b._gesture=new MSGesture,b._gesture.target=b,b.addEventListener("MSPointerDown",function(a){a.preventDefault(),a.currentTarget._gesture&&a.currentTarget._gesture.addPointer(a.pointerId)},!1),b.addEventListener("MSGestureTap",function(b){b.preventDefault();var c=a(this),e=c.index();a(d.vars.asNavFor).data("flexslider").animating||c.hasClass("active")||(d.direction=d.currentItem=g&&c.hasClass(e+"active-slide")?d.flexAnimate(d.getTarget("prev"),!0):a(d.vars.asNavFor).data("flexslider").animating||c.hasClass(e+"active-slide")||(d.direction=d.currentItem'),d.pagingCount>1)for(var j=0;j':""+c+"","thumbnails"===d.vars.controlNav&&!0===d.vars.thumbCaptions){var k=g.attr("data-thumbcaption");""!=k&&void 0!=k&&(f+=''+k+"")}d.controlNavScaffold.append("
  • "+f+"
  • "),c++}d.controlsContainer?a(d.controlsContainer).append(d.controlNavScaffold):d.append(d.controlNavScaffold),p.controlNav.set(),p.controlNav.active(),d.controlNavScaffold.delegate("a, img",h,function(b){if(b.preventDefault(),""===i||i===b.type){var c=a(this),f=d.controlNav.index(c);c.hasClass(e+"active")||(d.direction=f>d.currentSlide?"next":"prev",d.flexAnimate(f,d.vars.pauseOnAction))}""===i&&(i=b.type),p.setToClearWatchedEvent()})},setupManual:function(){d.controlNav=d.manualControls,p.controlNav.active(),d.controlNav.bind(h,function(b){if(b.preventDefault(),""===i||i===b.type){var c=a(this),f=d.controlNav.index(c);c.hasClass(e+"active")||(d.direction=f>d.currentSlide?"next":"prev",d.flexAnimate(f,d.vars.pauseOnAction))}""===i&&(i=b.type),p.setToClearWatchedEvent()})},set:function(){var b="thumbnails"===d.vars.controlNav?"img":"a";d.controlNav=a("."+e+"control-nav li "+b,d.controlsContainer?d.controlsContainer:d)},active:function(){d.controlNav.removeClass(e+"active").eq(d.animatingTo).addClass(e+"active")},update:function(b,c){d.pagingCount>1&&"add"===b?d.controlNavScaffold.append(a("
  • "+d.count+"
  • ")):1===d.pagingCount?d.controlNavScaffold.find("li").remove():d.controlNav.eq(c).closest("li").remove(),p.controlNav.set(),d.pagingCount>1&&d.pagingCount!==d.controlNav.length?d.update(c,b):p.controlNav.active()}},directionNav:{setup:function(){var b=a('");d.controlsContainer?(a(d.controlsContainer).append(b),d.directionNav=a("."+e+"direction-nav li a",d.controlsContainer)):(d.append(b),d.directionNav=a("."+e+"direction-nav li a",d)),p.directionNav.update(),d.directionNav.bind(h,function(b){b.preventDefault();var c;(""===i||i===b.type)&&(c=a(this).hasClass(e+"next")?d.getTarget("next"):d.getTarget("prev"),d.flexAnimate(c,d.vars.pauseOnAction)),""===i&&(i=b.type),p.setToClearWatchedEvent()})},update:function(){var a=e+"disabled";1===d.pagingCount?d.directionNav.addClass(a).attr("tabindex","-1"):d.vars.animationLoop?d.directionNav.removeClass(a).removeAttr("tabindex"):0===d.animatingTo?d.directionNav.removeClass(a).filter("."+e+"prev").addClass(a).attr("tabindex","-1"):d.animatingTo===d.last?d.directionNav.removeClass(a).filter("."+e+"next").addClass(a).attr("tabindex","-1"):d.directionNav.removeClass(a).removeAttr("tabindex")}},pausePlay:{setup:function(){var b=a('
    ');d.controlsContainer?(d.controlsContainer.append(b),d.pausePlay=a("."+e+"pauseplay a",d.controlsContainer)):(d.append(b),d.pausePlay=a("."+e+"pauseplay a",d)),p.pausePlay.update(d.vars.slideshow?e+"pause":e+"play"),d.pausePlay.bind(h,function(b){b.preventDefault(),(""===i||i===b.type)&&(a(this).hasClass(e+"pause")?(d.manualPause=!0,d.manualPlay=!1,d.pause()):(d.manualPause=!1,d.manualPlay=!0,d.play())),""===i&&(i=b.type),p.setToClearWatchedEvent()})},update:function(a){"play"===a?d.pausePlay.removeClass(e+"pause").addClass(e+"play").html(d.vars.playText):d.pausePlay.removeClass(e+"play").addClass(e+"pause").html(d.vars.pauseText)}},touch:function(){function r(f){d.animating?f.preventDefault():(window.navigator.msPointerEnabled||1===f.touches.length)&&(d.pause(),g=k?d.h:d.w,i=Number(new Date),o=f.touches[0].pageX,p=f.touches[0].pageY,e=m&&l&&d.animatingTo===d.last?0:m&&l?d.limit-(d.itemW+d.vars.itemMargin)*d.move*d.animatingTo:m&&d.currentSlide===d.last?d.limit:m?(d.itemW+d.vars.itemMargin)*d.move*d.currentSlide:l?(d.last-d.currentSlide+d.cloneOffset)*g:(d.currentSlide+d.cloneOffset)*g,a=k?p:o,c=k?o:p,b.addEventListener("touchmove",s,!1),b.addEventListener("touchend",t,!1))}function s(b){o=b.touches[0].pageX,p=b.touches[0].pageY,h=k?a-p:a-o,j=k?Math.abs(h)f)&&(b.preventDefault(),!n&&d.transitions&&(d.vars.animationLoop||(h/=0===d.currentSlide&&0>h||d.currentSlide===d.last&&h>0?Math.abs(h)/g+2:1),d.setProps(e+h,"setTouch")))}function t(){if(b.removeEventListener("touchmove",s,!1),d.animatingTo===d.currentSlide&&!j&&null!==h){var k=l?-h:h,m=k>0?d.getTarget("next"):d.getTarget("prev");d.canAdvance(m)&&(Number(new Date)-i<550&&Math.abs(k)>50||Math.abs(k)>g/2)?d.flexAnimate(m,d.vars.pauseOnAction):n||d.flexAnimate(d.currentSlide,d.vars.pauseOnAction,!0)}b.removeEventListener("touchend",t,!1),a=null,c=null,h=null,e=null}function u(a){a.stopPropagation(),d.animating?a.preventDefault():(d.pause(),b._gesture.addPointer(a.pointerId),q=0,g=k?d.h:d.w,i=Number(new Date),e=m&&l&&d.animatingTo===d.last?0:m&&l?d.limit-(d.itemW+d.vars.itemMargin)*d.move*d.animatingTo:m&&d.currentSlide===d.last?d.limit:m?(d.itemW+d.vars.itemMargin)*d.move*d.currentSlide:l?(d.last-d.currentSlide+d.cloneOffset)*g:(d.currentSlide+d.cloneOffset)*g)}function v(a){a.stopPropagation();var c=a.target._slider;if(c){var d=-a.translationX,f=-a.translationY;return q+=k?f:d,h=q,j=k?Math.abs(q)500)&&(a.preventDefault(),!n&&c.transitions&&(c.vars.animationLoop||(h=q/(0===c.currentSlide&&0>q||c.currentSlide===c.last&&q>0?Math.abs(q)/g+2:1)),c.setProps(e+h,"setTouch"))),void 0)}}function w(b){b.stopPropagation();var d=b.target._slider;if(d){if(d.animatingTo===d.currentSlide&&!j&&null!==h){var f=l?-h:h,k=f>0?d.getTarget("next"):d.getTarget("prev");d.canAdvance(k)&&(Number(new Date)-i<550&&Math.abs(f)>50||Math.abs(f)>g/2)?d.flexAnimate(k,d.vars.pauseOnAction):n||d.flexAnimate(d.currentSlide,d.vars.pauseOnAction,!0)}a=null,c=null,h=null,e=null,q=0}}var a,c,e,g,h,i,j=!1,o=0,p=0,q=0;f?(b.style.msTouchAction="none",b._gesture=new MSGesture,b._gesture.target=b,b.addEventListener("MSPointerDown",u,!1),b._slider=d,b.addEventListener("MSGestureChange",v,!1),b.addEventListener("MSGestureEnd",w,!1)):b.addEventListener("touchstart",r,!1)},resize:function(){!d.animating&&d.is(":visible")&&(m||d.doMath(),n?p.smoothHeight():m?(d.slides.width(d.computedW),d.update(d.pagingCount),d.setProps()):k?(d.viewport.height(d.h),d.setProps(d.h,"setTotal")):(d.vars.smoothHeight&&p.smoothHeight(),d.newSlides.width(d.computedW),d.setProps(d.computedW,"setTotal")))},smoothHeight:function(a){if(!k||n){var b=n?d:d.viewport;a?b.animate({height:d.slides.eq(d.animatingTo).height()},a):b.height(d.slides.eq(d.animatingTo).height())}},sync:function(b){var c=a(d.vars.sync).data("flexslider"),e=d.animatingTo;switch(b){case"animate":c.flexAnimate(e,d.vars.pauseOnAction,!1,!0);break;case"play":c.playing||c.asNav||c.play();break;case"pause":c.pause()}},uniqueID:function(b){return b.find("[id]").each(function(){var b=a(this);b.attr("id",b.attr("id")+"_clone")}),b},pauseInvisible:{visProp:null,init:function(){var a=["webkit","moz","ms","o"];if("hidden"in document)return"hidden";for(var b=0;b0?setTimeout(d.play,d.vars.initDelay):d.play()})}},isHidden:function(){return document[p.pauseInvisible.visProp]||!1}},setToClearWatchedEvent:function(){clearTimeout(j),j=setTimeout(function(){i=""},3e3)}},d.flexAnimate=function(b,c,f,h,i){if(d.vars.animationLoop||b===d.currentSlide||(d.direction=b>d.currentSlide?"next":"prev"),o&&1===d.pagingCount&&(d.direction=d.currentItemd.limit&&1!==d.visible?d.limit:t):s=0===d.currentSlide&&b===d.count-1&&d.vars.animationLoop&&"next"!==d.direction?l?(d.count+d.cloneOffset)*q:0:d.currentSlide===d.last&&0===b&&d.vars.animationLoop&&"prev"!==d.direction?l?0:(d.count+1)*q:l?(d.count-1-b+d.cloneOffset)*q:(b+d.cloneOffset)*q,d.setProps(s,"",d.vars.animationSpeed),d.transitions?(d.vars.animationLoop&&d.atEnd||(d.animating=!1,d.currentSlide=d.animatingTo),d.container.unbind("webkitTransitionEnd transitionend"),d.container.bind("webkitTransitionEnd transitionend",function(){clearTimeout(d.ensureAnimationEnd),d.wrapup(q)}),clearTimeout(d.ensureAnimationEnd),d.ensureAnimationEnd=setTimeout(function(){d.wrapup(q)},d.vars.animationSpeed+100)):d.container.animate(d.args,d.vars.animationSpeed,d.vars.easing,function(){d.wrapup(q)})}d.vars.smoothHeight&&p.smoothHeight(d.vars.animationSpeed)}},d.wrapup=function(a){n||m||(0===d.currentSlide&&d.animatingTo===d.last&&d.vars.animationLoop?d.setProps(a,"jumpEnd"):d.currentSlide===d.last&&0===d.animatingTo&&d.vars.animationLoop&&d.setProps(a,"jumpStart")),d.animating=!1,d.currentSlide=d.animatingTo,d.vars.after(d)},d.animateSlides=function(){!d.animating&&q&&d.flexAnimate(d.getTarget("next"))},d.pause=function(){clearInterval(d.animatedSlides),d.animatedSlides=null,d.playing=!1,d.vars.pausePlay&&p.pausePlay.update("play"),d.syncExists&&p.sync("pause")},d.play=function(){d.playing&&clearInterval(d.animatedSlides),d.animatedSlides=d.animatedSlides||setInterval(d.animateSlides,d.vars.slideshowSpeed),d.started=d.playing=!0,d.vars.pausePlay&&p.pausePlay.update("pause"),d.syncExists&&p.sync("play")},d.stop=function(){d.pause(),d.stopped=!0},d.canAdvance=function(a,b){var c=o?d.pagingCount-1:d.last;return b?!0:o&&d.currentItem===d.count-1&&0===a&&"prev"===d.direction?!0:o&&0===d.currentItem&&a===d.pagingCount-1&&"next"!==d.direction?!1:a!==d.currentSlide||o?d.vars.animationLoop?!0:d.atEnd&&0===d.currentSlide&&a===c&&"next"!==d.direction?!1:d.atEnd&&d.currentSlide===c&&0===a&&"next"===d.direction?!1:!0:!1},d.getTarget=function(a){return d.direction=a,"next"===a?d.currentSlide===d.last?0:d.currentSlide+1:0===d.currentSlide?d.last:d.currentSlide-1},d.setProps=function(a,b,c){var e=function(){var c=a?a:(d.itemW+d.vars.itemMargin)*d.move*d.animatingTo,e=function(){if(m)return"setTouch"===b?a:l&&d.animatingTo===d.last?0:l?d.limit-(d.itemW+d.vars.itemMargin)*d.move*d.animatingTo:d.animatingTo===d.last?d.limit:c;switch(b){case"setTotal":return l?(d.count-1-d.currentSlide+d.cloneOffset)*a:(d.currentSlide+d.cloneOffset)*a;case"setTouch":return l?a:a;case"jumpEnd":return l?a:d.count*a;case"jumpStart":return l?d.count*a:a;default:return a}}();return-1*e+"px"}();d.transitions&&(e=k?"translate3d(0,"+e+",0)":"translate3d("+e+",0,0)",c=void 0!==c?c/1e3+"s":"0s",d.container.css("-"+d.pfx+"-transition-duration",c),d.container.css("transition-duration",c)),d.args[d.prop]=e,(d.transitions||void 0===c)&&d.container.css(d.args),d.container.css("transform",e)},d.setup=function(b){if(n)d.slides.css({width:"100%","float":"left",marginRight:"-100%",position:"relative"}),"init"===b&&(g?d.slides.css({opacity:0,display:"block",webkitTransition:"opacity "+d.vars.animationSpeed/1e3+"s ease",zIndex:1}).eq(d.currentSlide).css({opacity:1,zIndex:2}):d.slides.css({opacity:0,display:"block",zIndex:1}).eq(d.currentSlide).css({zIndex:2}).animate({opacity:1},d.vars.animationSpeed,d.vars.easing)),d.vars.smoothHeight&&p.smoothHeight();else{var c,f;"init"===b&&(d.viewport=a('
    ').css({overflow:"hidden",position:"relative"}).appendTo(d).append(d.container),d.cloneCount=0,d.cloneOffset=0,l&&(f=a.makeArray(d.slides).reverse(),d.slides=a(f),d.container.empty().append(d.slides))),d.vars.animationLoop&&!m&&(d.cloneCount=2,d.cloneOffset=1,"init"!==b&&d.container.find(".clone").remove(),p.uniqueID(d.slides.first().clone().addClass("clone").attr("aria-hidden","true")).appendTo(d.container),p.uniqueID(d.slides.last().clone().addClass("clone").attr("aria-hidden","true")).prependTo(d.container)),d.newSlides=a(d.vars.selector,d),c=l?d.count-1-d.currentSlide+d.cloneOffset:d.currentSlide+d.cloneOffset,k&&!m?(d.container.height(200*(d.count+d.cloneCount)+"%").css("position","absolute").width("100%"),setTimeout(function(){d.newSlides.css({display:"block"}),d.doMath(),d.viewport.height(d.h),d.setProps(c*d.h,"init")},"init"===b?100:0)):(d.container.width(200*(d.count+d.cloneCount)+"%"),d.setProps(c*d.computedW,"init"),setTimeout(function(){d.doMath(),d.newSlides.css({width:d.computedW,"float":"left",display:"block"}),d.vars.smoothHeight&&p.smoothHeight()},"init"===b?100:0))}m||d.slides.removeClass(e+"active-slide").eq(d.currentSlide).addClass(e+"active-slide"),d.vars.init(d)},d.doMath=function(){var a=d.slides.first(),b=d.vars.itemMargin,c=d.vars.minItems,e=d.vars.maxItems;d.w=void 0===d.viewport?d.width():d.viewport.width(),d.h=a.height(),d.boxPadding=a.outerWidth()-a.width(),m?(d.itemT=d.vars.itemWidth+b,d.minW=c?c*d.itemT:d.w,d.maxW=e?e*d.itemT-b:d.w,d.itemW=d.minW>d.w?(d.w-b*(c-1))/c:d.maxWd.w?d.w:d.vars.itemWidth,d.visible=Math.floor(d.w/d.itemW),d.move=d.vars.move>0&&d.vars.moved.w?d.itemW*(d.count-1)+b*(d.count-1):(d.itemW+b)*d.count-d.w-b):(d.itemW=d.w,d.pagingCount=d.count,d.last=d.count-1),d.computedW=d.itemW-d.boxPadding},d.update=function(a,b){d.doMath(),m||(ad.controlNav.length?p.controlNav.update("add"):("remove"===b&&!m||d.pagingCountd.last&&(d.currentSlide-=1,d.animatingTo-=1),p.controlNav.update("remove",d.last))),d.vars.directionNav&&p.directionNav.update()},d.addSlide=function(b,c){var e=a(b);d.count+=1,d.last=d.count-1,k&&l?void 0!==c?d.slides.eq(d.count-c).after(e):d.container.prepend(e):void 0!==c?d.slides.eq(c).before(e):d.container.append(e),d.update(c,"add"),d.slides=a(d.vars.selector+":not(.clone)",d),d.setup(),d.vars.added(d)},d.removeSlide=function(b){var c=isNaN(b)?d.slides.index(a(b)):b;d.count-=1,d.last=d.count-1,isNaN(b)?a(b,d.slides).remove():k&&l?d.slides.eq(d.last).remove():d.slides.eq(b).remove(),d.doMath(),d.update(c,"remove"),d.slides=a(d.vars.selector+":not(.clone)",d),d.setup(),d.vars.removed(d)},p.init()},a(window).blur(function(){focused=!1}).focus(function(){focused=!0}),a.flexslider.defaults={namespace:"flex-",selector:".slides > li",animation:"fade",easing:"swing",direction:"horizontal",reverse:!1,animationLoop:!0,smoothHeight:!1,startAt:0,slideshow:!0,slideshowSpeed:7e3,animationSpeed:600,initDelay:0,randomize:!1,thumbCaptions:!1,pauseOnAction:!0,pauseOnHover:!1,pauseInvisible:!0,useCSS:!0,touch:!0,video:!1,controlNav:!0,directionNav:!0,prevText:"Previous",nextText:"Next",keyboard:!0,multipleKeyboard:!1,mousewheel:!1,pausePlay:!1,pauseText:"Pause",playText:"Play",controlsContainer:"",manualControls:"",sync:"",asNavFor:"",itemWidth:0,itemMargin:0,minItems:1,maxItems:0,move:0,allowOneSlide:!0,start:function(){},before:function(){},after:function(){},end:function(){},added:function(){},removed:function(){},init:function(){}},a.fn.flexslider=function(b){if(void 0===b&&(b={}),"object"==typeof b)return this.each(function(){var c=a(this),d=b.selector?b.selector:".slides > li",e=c.find(d);1===e.length&&b.allowOneSlide===!0||0===e.length?(e.fadeIn(400),b.start&&b.start(c)):void 0===c.data("flexslider")&&new a.flexslider(this,b)});var c=a(this).data("flexslider");switch(b){case"play":c.play();break;case"pause":c.pause();break;case"stop":c.stop();break;case"next":c.flexAnimate(c.getTarget("next"),!0);break;case"prev":case"previous":c.flexAnimate(c.getTarget("prev"),!0);break;default:"number"==typeof b&&c.flexAnimate(b,!0)}}}(jQuery); !function(a,b,c,d){function e(b,c){this.settings=null,this.options=a.extend({},e.Defaults,c),this.$element=a(b),this.drag=a.extend({},m),this.state=a.extend({},n),this.e=a.extend({},o),this._plugins={},this._supress={},this._current=null,this._speed=null,this._coordinates=[],this._breakpoint=null,this._width=null,this._items=[],this._clones=[],this._mergers=[],this._invalidated={},this._pipe=[],a.each(e.Plugins,a.proxy(function(a,b){this._plugins[a[0].toLowerCase()+a.slice(1)]=new b(this)},this)),a.each(e.Pipe,a.proxy(function(b,c){this._pipe.push({filter:c.filter,run:a.proxy(c.run,this)})},this)),this.setup(),this.initialize()}function f(a){if(a.touches!==d)return{x:a.touches[0].pageX,y:a.touches[0].pageY};if(a.touches===d){if(a.pageX!==d)return{x:a.pageX,y:a.pageY};if(a.pageX===d)return{x:a.clientX,y:a.clientY}}}function g(a){var b,d,e=c.createElement("div"),f=a;for(b in f)if(d=f[b],"undefined"!=typeof e.style[d])return e=null,[d,b];return[!1]}function h(){return g(["transition","WebkitTransition","MozTransition","OTransition"])[1]}function i(){return g(["transform","WebkitTransform","MozTransform","OTransform","msTransform"])[0]}function j(){return g(["perspective","webkitPerspective","MozPerspective","OPerspective","MsPerspective"])[0]}function k(){return"ontouchstart"in b||!!navigator.msMaxTouchPoints}function l(){return b.navigator.msPointerEnabled}var m,n,o;m={start:0,startX:0,startY:0,current:0,currentX:0,currentY:0,offsetX:0,offsetY:0,distance:null,startTime:0,endTime:0,updatedX:0,targetEl:null},n={isTouch:!1,isScrolling:!1,isSwiping:!1,direction:!1,inMotion:!1},o={_onDragStart:null,_onDragMove:null,_onDragEnd:null,_transitionEnd:null,_resizer:null,_responsiveCall:null,_goToLoop:null,_checkVisibile:null},e.Defaults={items:3,loop:!1,center:!1,mouseDrag:!0,touchDrag:!0,pullDrag:!0,freeDrag:!1,margin:0,stagePadding:0,merge:!1,mergeFit:!0,autoWidth:!1,startPosition:0,rtl:!1,smartSpeed:250,fluidSpeed:!1,dragEndSpeed:!1,responsive:{},responsiveRefreshRate:200,responsiveBaseElement:b,responsiveClass:!1,fallbackEasing:"swing",info:!1,nestedItemSelector:!1,itemElement:"div",stageElement:"div",themeClass:"owl-theme",baseClass:"owl-carousel",itemClass:"owl-item",centerClass:"center",activeClass:"active"},e.Width={Default:"default",Inner:"inner",Outer:"outer"},e.Plugins={},e.Pipe=[{filter:["width","items","settings"],run:function(a){a.current=this._items&&this._items[this.relative(this._current)]}},{filter:["items","settings"],run:function(){var a=this._clones,b=this.$stage.children(".cloned");(b.length!==a.length||!this.settings.loop&&a.length>0)&&(this.$stage.children(".cloned").remove(),this._clones=[])}},{filter:["items","settings"],run:function(){var a,b,c=this._clones,d=this._items,e=this.settings.loop?c.length-Math.max(2*this.settings.items,4):0;for(a=0,b=Math.abs(e/2);b>a;a++)e>0?(this.$stage.children().eq(d.length+c.length-1).remove(),c.pop(),this.$stage.children().eq(0).remove(),c.pop()):(c.push(c.length/2),this.$stage.append(d[c[c.length-1]].clone().addClass("cloned")),c.push(d.length-1-(c.length-1)/2),this.$stage.prepend(d[c[c.length-1]].clone().addClass("cloned")))}},{filter:["width","items","settings"],run:function(){var a,b,c,d=this.settings.rtl?1:-1,e=(this.width()/this.settings.items).toFixed(3),f=0;for(this._coordinates=[],b=0,c=this._clones.length+this._items.length;c>b;b++)a=this._mergers[this.relative(b)],a=this.settings.mergeFit&&Math.min(a,this.settings.items)||a,f+=(this.settings.autoWidth?this._items[this.relative(b)].width()+this.settings.margin:e*a)*d,this._coordinates.push(f)}},{filter:["width","items","settings"],run:function(){var b,c,d=(this.width()/this.settings.items).toFixed(3),e={width:Math.abs(this._coordinates[this._coordinates.length-1])+2*this.settings.stagePadding,"padding-left":this.settings.stagePadding||"","padding-right":this.settings.stagePadding||""};if(this.$stage.css(e),e={width:this.settings.autoWidth?"auto":d-this.settings.margin},e[this.settings.rtl?"margin-left":"margin-right"]=this.settings.margin,!this.settings.autoWidth&&a.grep(this._mergers,function(a){return a>1}).length>0)for(b=0,c=this._coordinates.length;c>b;b++)e.width=Math.abs(this._coordinates[b])-Math.abs(this._coordinates[b-1]||0)-this.settings.margin,this.$stage.children().eq(b).css(e);else this.$stage.children().css(e)}},{filter:["width","items","settings"],run:function(a){a.current&&this.reset(this.$stage.children().index(a.current))}},{filter:["position"],run:function(){this.animate(this.coordinates(this._current))}},{filter:["width","position","items","settings"],run:function(){var a,b,c,d,e=this.settings.rtl?1:-1,f=2*this.settings.stagePadding,g=this.coordinates(this.current())+f,h=g+this.width()*e,i=[];for(c=0,d=this._coordinates.length;d>c;c++)a=this._coordinates[c-1]||0,b=Math.abs(this._coordinates[c])+f*e,(this.op(a,"<=",g)&&this.op(a,">",h)||this.op(b,"<",g)&&this.op(b,">",h))&&i.push(c);this.$stage.children("."+this.settings.activeClass).removeClass(this.settings.activeClass),this.$stage.children(":eq("+i.join("), :eq(")+")").addClass(this.settings.activeClass),this.settings.center&&(this.$stage.children("."+this.settings.centerClass).removeClass(this.settings.centerClass),this.$stage.children().eq(this.current()).addClass(this.settings.centerClass))}}],e.prototype.initialize=function(){if(this.trigger("initialize"),this.$element.addClass(this.settings.baseClass).addClass(this.settings.themeClass).toggleClass("owl-rtl",this.settings.rtl),this.browserSupport(),this.settings.autoWidth&&this.state.imagesLoaded!==!0){var b,c,e;if(b=this.$element.find("img"),c=this.settings.nestedItemSelector?"."+this.settings.nestedItemSelector:d,e=this.$element.children(c).width(),b.length&&0>=e)return this.preloadAutoWidthImages(b),!1}this.$element.addClass("owl-loading"),this.$stage=a("<"+this.settings.stageElement+' class="owl-stage"/>').wrap('
    '),this.$element.append(this.$stage.parent()),this.replace(this.$element.children().not(this.$stage.parent())),this._width=this.$element.width(),this.refresh(),this.$element.removeClass("owl-loading").addClass("owl-loaded"),this.eventsCall(),this.internalEvents(),this.addTriggerableEvents(),this.trigger("initialized")},e.prototype.setup=function(){var b=this.viewport(),c=this.options.responsive,d=-1,e=null;c?(a.each(c,function(a){b>=a&&a>d&&(d=Number(a))}),e=a.extend({},this.options,c[d]),delete e.responsive,e.responsiveClass&&this.$element.attr("class",function(a,b){return b.replace(/\b owl-responsive-\S+/g,"")}).addClass("owl-responsive-"+d)):e=a.extend({},this.options),(null===this.settings||this._breakpoint!==d)&&(this.trigger("change",{property:{name:"settings",value:e}}),this._breakpoint=d,this.settings=e,this.invalidate("settings"),this.trigger("changed",{property:{name:"settings",value:this.settings}}))},e.prototype.optionsLogic=function(){this.$element.toggleClass("owl-center",this.settings.center),this.settings.loop&&this._items.length").addClass(this.settings.itemClass).append(b)),this.trigger("prepared",{content:c.data}),c.data},e.prototype.update=function(){for(var b=0,c=this._pipe.length,d=a.proxy(function(a){return this[a]},this._invalidated),e={};c>b;)(this._invalidated.all||a.grep(this._pipe[b].filter,d).length>0)&&this._pipe[b].run(e),b++;this._invalidated={}},e.prototype.width=function(a){switch(a=a||e.Width.Default){case e.Width.Inner:case e.Width.Outer:return this._width;default:return this._width-2*this.settings.stagePadding+this.settings.margin}},e.prototype.refresh=function(){if(0===this._items.length)return!1;(new Date).getTime();this.trigger("refresh"),this.setup(),this.optionsLogic(),this.$stage.addClass("owl-refresh"),this.update(),this.$stage.removeClass("owl-refresh"),this.state.orientation=b.orientation,this.watchVisibility(),this.trigger("refreshed")},e.prototype.eventsCall=function(){this.e._onDragStart=a.proxy(function(a){this.onDragStart(a)},this),this.e._onDragMove=a.proxy(function(a){this.onDragMove(a)},this),this.e._onDragEnd=a.proxy(function(a){this.onDragEnd(a)},this),this.e._onResize=a.proxy(function(a){this.onResize(a)},this),this.e._transitionEnd=a.proxy(function(a){this.transitionEnd(a)},this),this.e._preventClick=a.proxy(function(a){this.preventClick(a)},this)},e.prototype.onThrottledResize=function(){b.clearTimeout(this.resizeTimer),this.resizeTimer=b.setTimeout(this.e._onResize,this.settings.responsiveRefreshRate)},e.prototype.onResize=function(){return this._items.length?this._width===this.$element.width()?!1:this.trigger("resize").isDefaultPrevented()?!1:(this._width=this.$element.width(),this.invalidate("width"),this.refresh(),void this.trigger("resized")):!1},e.prototype.eventsRouter=function(a){var b=a.type;"mousedown"===b||"touchstart"===b?this.onDragStart(a):"mousemove"===b||"touchmove"===b?this.onDragMove(a):"mouseup"===b||"touchend"===b?this.onDragEnd(a):"touchcancel"===b&&this.onDragEnd(a)},e.prototype.internalEvents=function(){var c=(k(),l());this.settings.mouseDrag?(this.$stage.on("mousedown",a.proxy(function(a){this.eventsRouter(a)},this)),this.$stage.on("dragstart",function(){return!1}),this.$stage.get(0).onselectstart=function(){return!1}):this.$element.addClass("owl-text-select-on"),this.settings.touchDrag&&!c&&this.$stage.on("touchstart touchcancel",a.proxy(function(a){this.eventsRouter(a)},this)),this.transitionEndVendor&&this.on(this.$stage.get(0),this.transitionEndVendor,this.e._transitionEnd,!1),this.settings.responsive!==!1&&this.on(b,"resize",a.proxy(this.onThrottledResize,this))},e.prototype.onDragStart=function(d){var e,g,h,i;if(e=d.originalEvent||d||b.event,3===e.which||this.state.isTouch)return!1;if("mousedown"===e.type&&this.$stage.addClass("owl-grab"),this.trigger("drag"),this.drag.startTime=(new Date).getTime(),this.speed(0),this.state.isTouch=!0,this.state.isScrolling=!1,this.state.isSwiping=!1,this.drag.distance=0,g=f(e).x,h=f(e).y,this.drag.offsetX=this.$stage.position().left,this.drag.offsetY=this.$stage.position().top,this.settings.rtl&&(this.drag.offsetX=this.$stage.position().left+this.$stage.width()-this.width()+this.settings.margin),this.state.inMotion&&this.support3d)i=this.getTransformProperty(),this.drag.offsetX=i,this.animate(i),this.state.inMotion=!0;else if(this.state.inMotion&&!this.support3d)return this.state.inMotion=!1,!1;this.drag.startX=g-this.drag.offsetX,this.drag.startY=h-this.drag.offsetY,this.drag.start=g-this.drag.startX,this.drag.targetEl=e.target||e.srcElement,this.drag.updatedX=this.drag.start,("IMG"===this.drag.targetEl.tagName||"A"===this.drag.targetEl.tagName)&&(this.drag.targetEl.draggable=!1),a(c).on("mousemove.owl.dragEvents mouseup.owl.dragEvents touchmove.owl.dragEvents touchend.owl.dragEvents",a.proxy(function(a){this.eventsRouter(a)},this))},e.prototype.onDragMove=function(a){var c,e,g,h,i,j;this.state.isTouch&&(this.state.isScrolling||(c=a.originalEvent||a||b.event,e=f(c).x,g=f(c).y,this.drag.currentX=e-this.drag.startX,this.drag.currentY=g-this.drag.startY,this.drag.distance=this.drag.currentX-this.drag.offsetX,this.drag.distance<0?this.state.direction=this.settings.rtl?"right":"left":this.drag.distance>0&&(this.state.direction=this.settings.rtl?"left":"right"),this.settings.loop?this.op(this.drag.currentX,">",this.coordinates(this.minimum()))&&"right"===this.state.direction?this.drag.currentX-=(this.settings.center&&this.coordinates(0))-this.coordinates(this._items.length):this.op(this.drag.currentX,"<",this.coordinates(this.maximum()))&&"left"===this.state.direction&&(this.drag.currentX+=(this.settings.center&&this.coordinates(0))-this.coordinates(this._items.length)):(h=this.coordinates(this.settings.rtl?this.maximum():this.minimum()),i=this.coordinates(this.settings.rtl?this.minimum():this.maximum()),j=this.settings.pullDrag?this.drag.distance/5:0,this.drag.currentX=Math.max(Math.min(this.drag.currentX,h+j),i+j)),(this.drag.distance>8||this.drag.distance<-8)&&(c.preventDefault!==d?c.preventDefault():c.returnValue=!1,this.state.isSwiping=!0),this.drag.updatedX=this.drag.currentX,(this.drag.currentY>16||this.drag.currentY<-16)&&this.state.isSwiping===!1&&(this.state.isScrolling=!0,this.drag.updatedX=this.drag.start),this.animate(this.drag.updatedX)))},e.prototype.onDragEnd=function(b){var d,e,f;if(this.state.isTouch){if("mouseup"===b.type&&this.$stage.removeClass("owl-grab"),this.trigger("dragged"),this.drag.targetEl.removeAttribute("draggable"),this.state.isTouch=!1,this.state.isScrolling=!1,this.state.isSwiping=!1,0===this.drag.distance&&this.state.inMotion!==!0)return this.state.inMotion=!1,!1;this.drag.endTime=(new Date).getTime(),d=this.drag.endTime-this.drag.startTime,e=Math.abs(this.drag.distance),(e>3||d>300)&&this.removeClick(this.drag.targetEl),f=this.closest(this.drag.updatedX),this.speed(this.settings.dragEndSpeed||this.settings.smartSpeed),this.current(f),this.invalidate("position"),this.update(),this.settings.pullDrag||this.drag.updatedX!==this.coordinates(f)||this.transitionEnd(),this.drag.distance=0,a(c).off(".owl.dragEvents")}},e.prototype.removeClick=function(c){this.drag.targetEl=c,a(c).on("click.preventClick",this.e._preventClick),b.setTimeout(function(){a(c).off("click.preventClick")},300)},e.prototype.preventClick=function(b){b.preventDefault?b.preventDefault():b.returnValue=!1,b.stopPropagation&&b.stopPropagation(),a(b.target).off("click.preventClick")},e.prototype.getTransformProperty=function(){var a,c;return a=b.getComputedStyle(this.$stage.get(0),null).getPropertyValue(this.vendorName+"transform"),a=a.replace(/matrix(3d)?\(|\)/g,"").split(","),c=16===a.length,c!==!0?a[4]:a[12]},e.prototype.closest=function(b){var c=-1,d=30,e=this.width(),f=this.coordinates();return this.settings.freeDrag||a.each(f,a.proxy(function(a,g){return b>g-d&&g+d>b?c=a:this.op(b,"<",g)&&this.op(b,">",f[a+1]||g-e)&&(c="left"===this.state.direction?a+1:a),-1===c},this)),this.settings.loop||(this.op(b,">",f[this.minimum()])?c=b=this.minimum():this.op(b,"<",f[this.maximum()])&&(c=b=this.maximum())),c},e.prototype.animate=function(b){this.trigger("translate"),this.state.inMotion=this.speed()>0,this.support3d?this.$stage.css({transform:"translate3d("+b+"px,0px, 0px)",transition:this.speed()/1e3+"s"}):this.state.isTouch?this.$stage.css({left:b+"px"}):this.$stage.animate({left:b},this.speed()/1e3,this.settings.fallbackEasing,a.proxy(function(){this.state.inMotion&&this.transitionEnd()},this))},e.prototype.current=function(a){if(a===d)return this._current;if(0===this._items.length)return d;if(a=this.normalize(a),this._current!==a){var b=this.trigger("change",{property:{name:"position",value:a}});b.data!==d&&(a=this.normalize(b.data)),this._current=a,this.invalidate("position"),this.trigger("changed",{property:{name:"position",value:this._current}})}return this._current},e.prototype.invalidate=function(a){this._invalidated[a]=!0},e.prototype.reset=function(a){a=this.normalize(a),a!==d&&(this._speed=0,this._current=a,this.suppress(["translate","translated"]),this.animate(this.coordinates(a)),this.release(["translate","translated"]))},e.prototype.normalize=function(b,c){var e=c?this._items.length:this._items.length+this._clones.length;return!a.isNumeric(b)||1>e?d:b=this._clones.length?(b%e+e)%e:Math.max(this.minimum(c),Math.min(this.maximum(c),b))},e.prototype.relative=function(a){return a=this.normalize(a),a-=this._clones.length/2,this.normalize(a,!0)},e.prototype.maximum=function(a){var b,c,d,e=0,f=this.settings;if(a)return this._items.length-1;if(!f.loop&&f.center)b=this._items.length-1;else if(f.loop||f.center)if(f.loop||f.center)b=this._items.length+f.items;else{if(!f.autoWidth&&!f.merge)throw"Can not detect maximum absolute position.";for(revert=f.rtl?1:-1,c=this.$stage.width()-this.$element.width();(d=this.coordinates(e))&&!(d*revert>=c);)b=++e}else b=this._items.length-f.items;return b},e.prototype.minimum=function(a){return a?0:this._clones.length/2},e.prototype.items=function(a){return a===d?this._items.slice():(a=this.normalize(a,!0),this._items[a])},e.prototype.mergers=function(a){return a===d?this._mergers.slice():(a=this.normalize(a,!0),this._mergers[a])},e.prototype.clones=function(b){var c=this._clones.length/2,e=c+this._items.length,f=function(a){return a%2===0?e+a/2:c-(a+1)/2};return b===d?a.map(this._clones,function(a,b){return f(b)}):a.map(this._clones,function(a,c){return a===b?f(c):null})},e.prototype.speed=function(a){return a!==d&&(this._speed=a),this._speed},e.prototype.coordinates=function(b){var c=null;return b===d?a.map(this._coordinates,a.proxy(function(a,b){return this.coordinates(b)},this)):(this.settings.center?(c=this._coordinates[b],c+=(this.width()-c+(this._coordinates[b-1]||0))/2*(this.settings.rtl?-1:1)):c=this._coordinates[b-1]||0,c)},e.prototype.duration=function(a,b,c){return Math.min(Math.max(Math.abs(b-a),1),6)*Math.abs(c||this.settings.smartSpeed)},e.prototype.to=function(c,d){if(this.settings.loop){var e=c-this.relative(this.current()),f=this.current(),g=this.current(),h=this.current()+e,i=0>g-h?!0:!1,j=this._clones.length+this._items.length;h=j-this.settings.items&&i===!0&&(f=g-this._items.length,this.reset(f)),b.clearTimeout(this.e._goToLoop),this.e._goToLoop=b.setTimeout(a.proxy(function(){this.speed(this.duration(this.current(),f+e,d)),this.current(f+e),this.update()},this),30)}else this.speed(this.duration(this.current(),c,d)),this.current(c),this.update()},e.prototype.next=function(a){a=a||!1,this.to(this.relative(this.current())+1,a)},e.prototype.prev=function(a){a=a||!1,this.to(this.relative(this.current())-1,a)},e.prototype.transitionEnd=function(a){return a!==d&&(a.stopPropagation(),(a.target||a.srcElement||a.originalTarget)!==this.$stage.get(0))?!1:(this.state.inMotion=!1,void this.trigger("translated"))},e.prototype.viewport=function(){var d;if(this.options.responsiveBaseElement!==b)d=a(this.options.responsiveBaseElement).width();else if(b.innerWidth)d=b.innerWidth;else{if(!c.documentElement||!c.documentElement.clientWidth)throw"Can not detect viewport width.";d=c.documentElement.clientWidth}return d},e.prototype.replace=function(b){this.$stage.empty(),this._items=[],b&&(b=b instanceof jQuery?b:a(b)),this.settings.nestedItemSelector&&(b=b.find("."+this.settings.nestedItemSelector)),b.filter(function(){return 1===this.nodeType}).each(a.proxy(function(a,b){b=this.prepare(b),this.$stage.append(b),this._items.push(b),this._mergers.push(1*b.find("[data-merge]").andSelf("[data-merge]").attr("data-merge")||1)},this)),this.reset(a.isNumeric(this.settings.startPosition)?this.settings.startPosition:0),this.invalidate("items")},e.prototype.add=function(a,b){b=b===d?this._items.length:this.normalize(b,!0),this.trigger("add",{content:a,position:b}),0===this._items.length||b===this._items.length?(this.$stage.append(a),this._items.push(a),this._mergers.push(1*a.find("[data-merge]").andSelf("[data-merge]").attr("data-merge")||1)):(this._items[b].before(a),this._items.splice(b,0,a),this._mergers.splice(b,0,1*a.find("[data-merge]").andSelf("[data-merge]").attr("data-merge")||1)),this.invalidate("items"),this.trigger("added",{content:a,position:b})},e.prototype.remove=function(a){a=this.normalize(a,!0),a!==d&&(this.trigger("remove",{content:this._items[a],position:a}),this._items[a].remove(),this._items.splice(a,1),this._mergers.splice(a,1),this.invalidate("items"),this.trigger("removed",{content:null,position:a}))},e.prototype.addTriggerableEvents=function(){var b=a.proxy(function(b,c){return a.proxy(function(a){a.relatedTarget!==this&&(this.suppress([c]),b.apply(this,[].slice.call(arguments,1)),this.release([c]))},this)},this);a.each({next:this.next,prev:this.prev,to:this.to,destroy:this.destroy,refresh:this.refresh,replace:this.replace,add:this.add,remove:this.remove},a.proxy(function(a,c){this.$element.on(a+".owl.carousel",b(c,a+".owl.carousel"))},this))},e.prototype.watchVisibility=function(){function c(a){return a.offsetWidth>0&&a.offsetHeight>0}function d(){c(this.$element.get(0))&&(this.$element.removeClass("owl-hidden"),this.refresh(),b.clearInterval(this.e._checkVisibile))}c(this.$element.get(0))||(this.$element.addClass("owl-hidden"),b.clearInterval(this.e._checkVisibile),this.e._checkVisibile=b.setInterval(a.proxy(d,this),500))},e.prototype.preloadAutoWidthImages=function(b){var c,d,e,f;c=0,d=this,b.each(function(g,h){e=a(h),f=new Image,f.onload=function(){c++,e.attr("src",f.src),e.css("opacity",1),c>=b.length&&(d.state.imagesLoaded=!0,d.initialize())},f.src=e.attr("src")||e.attr("data-src")||e.attr("data-src-retina")})},e.prototype.destroy=function(){this.$element.hasClass(this.settings.themeClass)&&this.$element.removeClass(this.settings.themeClass),this.settings.responsive!==!1&&a(b).off("resize.owl.carousel"),this.transitionEndVendor&&this.off(this.$stage.get(0),this.transitionEndVendor,this.e._transitionEnd);for(var d in this._plugins)this._plugins[d].destroy();(this.settings.mouseDrag||this.settings.touchDrag)&&(this.$stage.off("mousedown touchstart touchcancel"),a(c).off(".owl.dragEvents"),this.$stage.get(0).onselectstart=function(){},this.$stage.off("dragstart",function(){return!1})),this.$element.off(".owl"),this.$stage.children(".cloned").remove(),this.e=null,this.$element.removeData("owlCarousel"),this.$stage.children().contents().unwrap(),this.$stage.children().unwrap(),this.$stage.unwrap()},e.prototype.op=function(a,b,c){var d=this.settings.rtl;switch(b){case"<":return d?a>c:c>a;case">":return d?c>a:a>c;case">=":return d?c>=a:a>=c;case"<=":return d?a>=c:c>=a}},e.prototype.on=function(a,b,c,d){a.addEventListener?a.addEventListener(b,c,d):a.attachEvent&&a.attachEvent("on"+b,c)},e.prototype.off=function(a,b,c,d){a.removeEventListener?a.removeEventListener(b,c,d):a.detachEvent&&a.detachEvent("on"+b,c)},e.prototype.trigger=function(b,c,d){var e={item:{count:this._items.length,index:this.current()}},f=a.camelCase(a.grep(["on",b,d],function(a){return a}).join("-").toLowerCase()),g=a.Event([b,"owl",d||"carousel"].join(".").toLowerCase(),a.extend({relatedTarget:this},e,c));return this._supress[b]||(a.each(this._plugins,function(a,b){b.onTrigger&&b.onTrigger(g)}),this.$element.trigger(g),this.settings&&"function"==typeof this.settings[f]&&this.settings[f].apply(this,g)),g},e.prototype.suppress=function(b){a.each(b,a.proxy(function(a,b){this._supress[b]=!0},this))},e.prototype.release=function(b){a.each(b,a.proxy(function(a,b){delete this._supress[b]},this))},e.prototype.browserSupport=function(){if(this.support3d=j(),this.support3d){this.transformVendor=i();var a=["transitionend","webkitTransitionEnd","transitionend","oTransitionEnd"];this.transitionEndVendor=a[h()],this.vendorName=this.transformVendor.replace(/Transform/i,""),this.vendorName=""!==this.vendorName?"-"+this.vendorName.toLowerCase()+"-":""}this.state.orientation=b.orientation},a.fn.owlCarousel=function(b){return this.each(function(){a(this).data("owlCarousel")||a(this).data("owlCarousel",new e(this,b))})},a.fn.owlCarousel.Constructor=e}(window.Zepto||window.jQuery,window,document),function(a,b){var c=function(b){this._core=b,this._loaded=[],this._handlers={"initialized.owl.carousel change.owl.carousel":a.proxy(function(b){if(b.namespace&&this._core.settings&&this._core.settings.lazyLoad&&(b.property&&"position"==b.property.name||"initialized"==b.type))for(var c=this._core.settings,d=c.center&&Math.ceil(c.items/2)||c.items,e=c.center&&-1*d||0,f=(b.property&&b.property.value||this._core.current())+e,g=this._core.clones().length,h=a.proxy(function(a,b){this.load(b)},this);e++-1||(e.each(a.proxy(function(c,d){var e,f=a(d),g=b.devicePixelRatio>1&&f.attr("data-src-retina")||f.attr("data-src");this._core.trigger("load",{element:f,url:g},"lazy"),f.is("img")?f.one("load.owl.lazy",a.proxy(function(){f.css("opacity",1),this._core.trigger("loaded",{element:f,url:g},"lazy")},this)).attr("src",g):(e=new Image,e.onload=a.proxy(function(){f.css({"background-image":"url("+g+")",opacity:"1"}),this._core.trigger("loaded",{element:f,url:g},"lazy")},this),e.src=g)},this)),this._loaded.push(d.get(0)))},c.prototype.destroy=function(){var a,b;for(a in this.handlers)this._core.$element.off(a,this.handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Lazy=c}(window.Zepto||window.jQuery,window,document),function(a){var b=function(c){this._core=c,this._handlers={"initialized.owl.carousel":a.proxy(function(){this._core.settings.autoHeight&&this.update()},this),"changed.owl.carousel":a.proxy(function(a){this._core.settings.autoHeight&&"position"==a.property.name&&this.update()},this),"loaded.owl.lazy":a.proxy(function(a){this._core.settings.autoHeight&&a.element.closest("."+this._core.settings.itemClass)===this._core.$stage.children().eq(this._core.current())&&this.update()},this)},this._core.options=a.extend({},b.Defaults,this._core.options),this._core.$element.on(this._handlers)};b.Defaults={autoHeight:!1,autoHeightClass:"owl-height"},b.prototype.update=function(){this._core.$stage.parent().height(this._core.$stage.children().eq(this._core.current()).height()).addClass(this._core.settings.autoHeightClass)},b.prototype.destroy=function(){var a,b;for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.AutoHeight=b}(window.Zepto||window.jQuery,window,document),function(a,b,c){var d=function(b){this._core=b,this._videos={},this._playing=null,this._fullscreen=!1,this._handlers={"resize.owl.carousel":a.proxy(function(a){this._core.settings.video&&!this.isInFullScreen()&&a.preventDefault()},this),"refresh.owl.carousel changed.owl.carousel":a.proxy(function(){this._playing&&this.stop()},this),"prepared.owl.carousel":a.proxy(function(b){var c=a(b.content).find(".owl-video");c.length&&(c.css("display","none"),this.fetch(c,a(b.content)))},this)},this._core.options=a.extend({},d.Defaults,this._core.options),this._core.$element.on(this._handlers),this._core.$element.on("click.owl.video",".owl-video-play-icon",a.proxy(function(a){this.play(a)},this))};d.Defaults={video:!1,videoHeight:!1,videoWidth:!1},d.prototype.fetch=function(a,b){var c=a.attr("data-vimeo-id")?"vimeo":"youtube",d=a.attr("data-vimeo-id")||a.attr("data-youtube-id"),e=a.attr("data-width")||this._core.settings.videoWidth,f=a.attr("data-height")||this._core.settings.videoHeight,g=a.attr("href");if(!g)throw new Error("Missing video URL.");if(d=g.match(/(http:|https:|)\/\/(player.|www.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com))\/(video\/|embed\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/),d[3].indexOf("youtu")>-1)c="youtube";else{if(!(d[3].indexOf("vimeo")>-1))throw new Error("Video URL not supported.");c="vimeo"}d=d[6],this._videos[g]={type:c,id:d,width:e,height:f},b.attr("data-video",g),this.thumbnail(a,this._videos[g])},d.prototype.thumbnail=function(b,c){var d,e,f,g=c.width&&c.height?'style="width:'+c.width+"px;height:"+c.height+'px;"':"",h=b.find("img"),i="src",j="",k=this._core.settings,l=function(a){e='
    ',d=k.lazyLoad?'
    ':'
    ',b.after(d),b.after(e)};return b.wrap('
    "),this._core.settings.lazyLoad&&(i="data-src",j="owl-lazy"),h.length?(l(h.attr(i)),h.remove(),!1):void("youtube"===c.type?(f="http://img.youtube.com/vi/"+c.id+"/hqdefault.jpg",l(f)):"vimeo"===c.type&&a.ajax({type:"GET",url:"http://vimeo.com/api/v2/video/"+c.id+".json",jsonp:"callback",dataType:"jsonp",success:function(a){f=a[0].thumbnail_large,l(f)}}))},d.prototype.stop=function(){this._core.trigger("stop",null,"video"),this._playing.find(".owl-video-frame").remove(),this._playing.removeClass("owl-video-playing"),this._playing=null},d.prototype.play=function(b){this._core.trigger("play",null,"video"),this._playing&&this.stop();var c,d,e=a(b.target||b.srcElement),f=e.closest("."+this._core.settings.itemClass),g=this._videos[f.attr("data-video")],h=g.width||"100%",i=g.height||this._core.$stage.height();"youtube"===g.type?c='':"vimeo"===g.type&&(c=''),f.addClass("owl-video-playing"),this._playing=f,d=a('
    '+c+"
    "),e.after(d)},d.prototype.isInFullScreen=function(){var d=c.fullscreenElement||c.mozFullScreenElement||c.webkitFullscreenElement;return d&&a(d).parent().hasClass("owl-video-frame")&&(this._core.speed(0),this._fullscreen=!0),d&&this._fullscreen&&this._playing?!1:this._fullscreen?(this._fullscreen=!1,!1):this._playing&&this._core.state.orientation!==b.orientation?(this._core.state.orientation=b.orientation,!1):!0},d.prototype.destroy=function(){var a,b;this._core.$element.off("click.owl.video");for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Video=d}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this.core=b,this.core.options=a.extend({},e.Defaults,this.core.options),this.swapping=!0,this.previous=d,this.next=d,this.handlers={"change.owl.carousel":a.proxy(function(a){"position"==a.property.name&&(this.previous=this.core.current(),this.next=a.property.value)},this),"drag.owl.carousel dragged.owl.carousel translated.owl.carousel":a.proxy(function(a){this.swapping="translated"==a.type},this),"translate.owl.carousel":a.proxy(function(){this.swapping&&(this.core.options.animateOut||this.core.options.animateIn)&&this.swap()},this)},this.core.$element.on(this.handlers)};e.Defaults={animateOut:!1,animateIn:!1},e.prototype.swap=function(){if(1===this.core.settings.items&&this.core.support3d){this.core.speed(0);var b,c=a.proxy(this.clear,this),d=this.core.$stage.children().eq(this.previous),e=this.core.$stage.children().eq(this.next),f=this.core.settings.animateIn,g=this.core.settings.animateOut;this.core.current()!==this.previous&&(g&&(b=this.core.coordinates(this.previous)-this.core.coordinates(this.next),d.css({left:b+"px"}).addClass("animated owl-animated-out").addClass(g).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",c)),f&&e.addClass("animated owl-animated-in").addClass(f).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",c))}},e.prototype.clear=function(b){a(b.target).css({left:""}).removeClass("animated owl-animated-out owl-animated-in").removeClass(this.core.settings.animateIn).removeClass(this.core.settings.animateOut),this.core.transitionEnd()},e.prototype.destroy=function(){var a,b;for(a in this.handlers)this.core.$element.off(a,this.handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Animate=e}(window.Zepto||window.jQuery,window,document),function(a,b,c){var d=function(b){this.core=b,this.core.options=a.extend({},d.Defaults,this.core.options),this.handlers={"translated.owl.carousel refreshed.owl.carousel":a.proxy(function(){this.autoplay() },this),"play.owl.autoplay":a.proxy(function(a,b,c){this.play(b,c)},this),"stop.owl.autoplay":a.proxy(function(){this.stop()},this),"mouseover.owl.autoplay":a.proxy(function(){this.core.settings.autoplayHoverPause&&this.pause()},this),"mouseleave.owl.autoplay":a.proxy(function(){this.core.settings.autoplayHoverPause&&this.autoplay()},this)},this.core.$element.on(this.handlers)};d.Defaults={autoplay:!1,autoplayTimeout:5e3,autoplayHoverPause:!1,autoplaySpeed:!1},d.prototype.autoplay=function(){this.core.settings.autoplay&&!this.core.state.videoPlay?(b.clearInterval(this.interval),this.interval=b.setInterval(a.proxy(function(){this.play()},this),this.core.settings.autoplayTimeout)):b.clearInterval(this.interval)},d.prototype.play=function(){return c.hidden===!0||this.core.state.isTouch||this.core.state.isScrolling||this.core.state.isSwiping||this.core.state.inMotion?void 0:this.core.settings.autoplay===!1?void b.clearInterval(this.interval):void this.core.next(this.core.settings.autoplaySpeed)},d.prototype.stop=function(){b.clearInterval(this.interval)},d.prototype.pause=function(){b.clearInterval(this.interval)},d.prototype.destroy=function(){var a,c;b.clearInterval(this.interval);for(a in this.handlers)this.core.$element.off(a,this.handlers[a]);for(c in Object.getOwnPropertyNames(this))"function"!=typeof this[c]&&(this[c]=null)},a.fn.owlCarousel.Constructor.Plugins.autoplay=d}(window.Zepto||window.jQuery,window,document),function(a){"use strict";var b=function(c){this._core=c,this._initialized=!1,this._pages=[],this._controls={},this._templates=[],this.$element=this._core.$element,this._overrides={next:this._core.next,prev:this._core.prev,to:this._core.to},this._handlers={"prepared.owl.carousel":a.proxy(function(b){this._core.settings.dotsData&&this._templates.push(a(b.content).find("[data-dot]").andSelf("[data-dot]").attr("data-dot"))},this),"add.owl.carousel":a.proxy(function(b){this._core.settings.dotsData&&this._templates.splice(b.position,0,a(b.content).find("[data-dot]").andSelf("[data-dot]").attr("data-dot"))},this),"remove.owl.carousel prepared.owl.carousel":a.proxy(function(a){this._core.settings.dotsData&&this._templates.splice(a.position,1)},this),"change.owl.carousel":a.proxy(function(a){if("position"==a.property.name&&!this._core.state.revert&&!this._core.settings.loop&&this._core.settings.navRewind){var b=this._core.current(),c=this._core.maximum(),d=this._core.minimum();a.data=a.property.value>c?b>=c?d:c:a.property.value").addClass(d.dotClass).append(a("")).prop("outerHTML")]),d.navContainer&&d.dotsContainer||(this._controls.$container=a("
    ").addClass(d.controlsClass).appendTo(this.$element)),this._controls.$indicators=d.dotsContainer?a(d.dotsContainer):a("
    ").hide().addClass(d.dotsClass).appendTo(this._controls.$container),this._controls.$indicators.on("click","div",a.proxy(function(b){var c=a(b.target).parent().is(this._controls.$indicators)?a(b.target).index():a(b.target).parent().index();b.preventDefault(),this.to(c,d.dotsSpeed)},this)),b=d.navContainer?a(d.navContainer):a("
    ").addClass(d.navContainerClass).prependTo(this._controls.$container),this._controls.$next=a("<"+d.navElement+">"),this._controls.$previous=this._controls.$next.clone(),this._controls.$previous.addClass(d.navClass[0]).html(d.navText[0]).hide().prependTo(b).on("click",a.proxy(function(){this.prev(d.navSpeed)},this)),this._controls.$next.addClass(d.navClass[1]).html(d.navText[1]).hide().appendTo(b).on("click",a.proxy(function(){this.next(d.navSpeed)},this));for(c in this._overrides)this._core[c]=a.proxy(this[c],this)},b.prototype.destroy=function(){var a,b,c,d;for(a in this._handlers)this.$element.off(a,this._handlers[a]);for(b in this._controls)this._controls[b].remove();for(d in this.overides)this._core[d]=this._overrides[d];for(c in Object.getOwnPropertyNames(this))"function"!=typeof this[c]&&(this[c]=null)},b.prototype.update=function(){var a,b,c,d=this._core.settings,e=this._core.clones().length/2,f=e+this._core.items().length,g=d.center||d.autoWidth||d.dotData?1:d.dotsEach||d.items;if("page"!==d.slideBy&&(d.slideBy=Math.min(d.slideBy,d.items)),d.dots||"page"==d.slideBy)for(this._pages=[],a=e,b=0,c=0;f>a;a++)(b>=g||0===b)&&(this._pages.push({start:a-e,end:a-e+g-1}),b=0,++c),b+=this._core.mergers(this._core.relative(a))},b.prototype.draw=function(){var b,c,d="",e=this._core.settings,f=(this._core.$stage.children(),this._core.relative(this._core.current()));if(!e.nav||e.loop||e.navRewind||(this._controls.$previous.toggleClass("disabled",0>=f),this._controls.$next.toggleClass("disabled",f>=this._core.maximum())),this._controls.$previous.toggle(e.nav),this._controls.$next.toggle(e.nav),e.dots){if(b=this._pages.length-this._controls.$indicators.children().length,e.dotData&&0!==b){for(c=0;c0?(d=new Array(b+1).join(this._templates[0]),this._controls.$indicators.append(d)):0>b&&this._controls.$indicators.children().slice(b).remove();this._controls.$indicators.find(".active").removeClass("active"),this._controls.$indicators.children().eq(a.inArray(this.current(),this._pages)).addClass("active")}this._controls.$indicators.toggle(e.dots)},b.prototype.onTrigger=function(b){var c=this._core.settings;b.page={index:a.inArray(this.current(),this._pages),count:this._pages.length,size:c&&(c.center||c.autoWidth||c.dotData?1:c.dotsEach||c.items)}},b.prototype.current=function(){var b=this._core.relative(this._core.current());return a.grep(this._pages,function(a){return a.start<=b&&a.end>=b}).pop()},b.prototype.getPosition=function(b){var c,d,e=this._core.settings;return"page"==e.slideBy?(c=a.inArray(this.current(),this._pages),d=this._pages.length,b?++c:--c,c=this._pages[(c%d+d)%d].start):(c=this._core.relative(this._core.current()),d=this._core.items().length,b?c+=e.slideBy:c-=e.slideBy),c},b.prototype.next=function(b){a.proxy(this._overrides.to,this._core)(this.getPosition(!0),b)},b.prototype.prev=function(b){a.proxy(this._overrides.to,this._core)(this.getPosition(!1),b)},b.prototype.to=function(b,c,d){var e;d?a.proxy(this._overrides.to,this._core)(b,c):(e=this._pages.length,a.proxy(this._overrides.to,this._core)(this._pages[(b%e+e)%e].start,c))},a.fn.owlCarousel.Constructor.Plugins.Navigation=b}(window.Zepto||window.jQuery,window,document),function(a,b){"use strict";var c=function(d){this._core=d,this._hashes={},this.$element=this._core.$element,this._handlers={"initialized.owl.carousel":a.proxy(function(){"URLHash"==this._core.settings.startPosition&&a(b).trigger("hashchange.owl.navigation")},this),"prepared.owl.carousel":a.proxy(function(b){var c=a(b.content).find("[data-hash]").andSelf("[data-hash]").attr("data-hash");this._hashes[c]=b.content},this)},this._core.options=a.extend({},c.Defaults,this._core.options),this.$element.on(this._handlers),a(b).on("hashchange.owl.navigation",a.proxy(function(){var a=b.location.hash.substring(1),c=this._core.$stage.children(),d=this._hashes[a]&&c.index(this._hashes[a])||0;return a?void this._core.to(d,!1,!0):!1},this))};c.Defaults={URLhashListener:!1},c.prototype.destroy=function(){var c,d;a(b).off("hashchange.owl.navigation");for(c in this._handlers)this._core.$element.off(c,this._handlers[c]);for(d in Object.getOwnPropertyNames(this))"function"!=typeof this[d]&&(this[d]=null)},a.fn.owlCarousel.Constructor.Plugins.Hash=c}(window.Zepto||window.jQuery,window,document); (function($){ $.fn.jflickrfeed=function(settings, callback){ settings=$.extend(true, { flickrbase: 'http://api.flickr.com/services/feeds/', feedapi: 'photos_public.gne', limit: 20, qstrings: { lang: 'en-us', format: 'json', jsoncallback: '?' }, cleanDescription: true, useTemplate: true, itemTemplate: '', itemCallback: function(){}}, settings); var url=settings.flickrbase + settings.feedapi + '?'; var first=true; for (var key in settings.qstrings){ if(!first) url +='&'; url +=key + '=' + settings.qstrings[key]; first=false; } return $(this).each(function(){ var $container=$(this); var container=this; $.getJSON(url, function(data){ $.each(data.items, function(i, item){ if(i < settings.limit){ if(settings.cleanDescription){ var regex=/

    (.*?)<\/p>/g; var input=item.description; if(regex.test(input)){ item.description=input.match(regex)[2] if(item.description!=undefined) item.description=item.description.replace('

    ', '').replace('

    ', ''); }} item['image_s']=item.media.m.replace('_m', '_s'); item['image_t']=item.media.m.replace('_m', '_t'); item['image_m']=item.media.m.replace('_m', '_m'); item['image']=item.media.m.replace('_m', ''); item['image_b']=item.media.m.replace('_m', '_b'); delete item.media; if(settings.useTemplate){ var template=settings.itemTemplate; for (var key in item){ var rgx=new RegExp('{{' + key + '}}', 'g'); template=template.replace(rgx, item[key]); } $container.append(template) } settings.itemCallback.call(container, item); }}); if($.isFunction(callback)){ callback.call(container, data); }}); }); }})(jQuery); !function(e){function o(){var e=document.getElementsByTagName("script"),o=e[e.length-1].src.split("?")[0];return o.split("/").length>0?o.split("/").slice(0,-1).join("/")+"/":""}function t(e,o,t){for(var r=0;rt;++t)e.call(o,this[t],t,this)});var u=["ms","moz","webkit","o"],h=window.requestAnimationFrame||!1,p=window.cancelAnimationFrame||!1;u.forEach(function(e){h||(h=window[e+"RequestAnimationFrame"]),p||(p=window[e+"CancelAnimationFrame"]||window[e+"CancelRequestAnimationFrame"])});var m=window.MutationObserver||window.WebKitMutationObserver||!1,f={zindex:"auto",cursoropacitymin:1,cursoropacitymax:1,cursorcolor:"#4a5768",cursorwidth:"12px",cursorborder:"1px solid tranparent",cursorborderradius:"0px",scrollspeed:60,mousescrollstep:24,touchbehavior:!1,hwacceleration:!0,usetransition:!0,boxzoom:!1,dblclickzoom:!0,gesturezoom:!0,grabcursorenabled:!0,autohidemode:!0,background:"",iframeautoresize:!0,cursorminheight:60,preservenativescrolling:!0,railoffset:!1,bouncescroll:!0,spacebarenabled:!0,railpadding:{top:1,right:1,left:0,bottom:0},disableoutline:!0,horizrailenabled:!0,railalign:"right",railvalign:"bottom",enabletranslate3d:!0,enablemousewheel:!0,enablekeyboard:!0,smoothscroll:!0,sensitiverail:!0,enablemouselockapi:!0,cursorfixedheight:!1,directionlockdeadzone:6,hidecursordelay:400,nativeparentscrolling:!0,enablescrollonselection:!0,overflowx:!0,overflowy:!0,cursordragspeed:.3,rtlmode:!1,cursordragontouch:!1},g=!1,w=function(){function e(){var e=["-moz-grab","-webkit-grab","grab"];(t.ischrome&&!t.ischrome22||t.isie)&&(e=[]);for(var r=0;r=9,t.isie10=t.isie&&"performance"in window&&document.documentMode>=10,t.isie9mobile=/iemobile.9/i.test(navigator.userAgent),t.isie9mobile&&(t.isie9=!1),t.isie7mobile=!t.isie9mobile&&t.isie7&&/iemobile/i.test(navigator.userAgent),t.ismozilla="MozAppearance"in o.style,t.iswebkit="WebkitAppearance"in o.style,t.ischrome="chrome"in window,t.ischrome22=t.ischrome&&t.haspointerlock,t.ischrome26=t.ischrome&&"transition"in o.style,t.cantouch="ontouchstart"in document.documentElement||"ontouchstart"in window,t.hasmstouch=window.navigator.msPointerEnabled||!1,t.ismac=/^mac$/i.test(navigator.platform),t.isios=t.cantouch&&/iphone|ipad|ipod/i.test(navigator.platform),t.isios4=t.isios&&!("seal"in Object),t.isandroid=/android/i.test(navigator.userAgent),t.trstyle=!1,t.hastransform=!1,t.hastranslate3d=!1,t.transitionstyle=!1,t.hastransition=!1,t.transitionend=!1;for(var r=["transform","msTransform","webkitTransform","MozTransform","OTransform"],i=0;i0;){if(9==e[0].nodeType)return!1;var o=e.css("zIndex");if(!isNaN(o)&&0!=o)return parseInt(o);e=e.parent()}return!1}function u(e,o,t){var r=e.css(o),i=parseFloat(r);if(isNaN(i)){i=z[r]||0;var n=3==i?t?b.win.outerHeight()-b.win.innerHeight():b.win.outerWidth()-b.win.innerWidth():1;return b.isie8&&i&&(i+=1),n?i:0}return i}function g(e,o,t,r){b._bind(e,o,function(r){var r=r?r:window.event,i={original:r,target:r.target||r.srcElement,type:"wheel",deltaMode:"MozMousePixelScroll"==r.type?0:1,deltaX:0,deltaZ:0,preventDefault:function(){return r.preventDefault?r.preventDefault():r.returnValue=!1,!1},stopImmediatePropagation:function(){r.stopImmediatePropagation?r.stopImmediatePropagation():r.cancelBubble=!0}};return"mousewheel"==o?(i.deltaY=-1/40*r.wheelDelta,r.wheelDeltaX&&(i.deltaX=-1/40*r.wheelDeltaX)):i.deltaY=r.detail,t.call(e,i)},r)}function v(e,o,t){var r,i;if(0==e.deltaMode?(r=-Math.floor(e.deltaX*(b.opt.mousescrollstep/54)),i=-Math.floor(e.deltaY*(b.opt.mousescrollstep/54))):1==e.deltaMode&&(r=-Math.floor(e.deltaX*b.opt.mousescrollstep),i=-Math.floor(e.deltaY*b.opt.mousescrollstep)),o&&0==r&&i&&(r=i,i=0),r&&(b.scrollmom&&b.scrollmom.stop(),b.lastdeltax+=r,b.debounced("mousewheelx",function(){var e=b.lastdeltax;b.lastdeltax=0,b.rail.drag||b.doScrollLeftBy(e)},120)),i){if(b.opt.nativeparentscrolling&&t&&!b.ispage&&!b.zoomactive)if(0>i){if(b.getScrollTop()>=b.page.maxh)return!0}else if(b.getScrollTop()<=0)return!0;b.scrollmom&&b.scrollmom.stop(),b.lastdeltay+=i,b.debounced("mousewheely",function(){var e=b.lastdeltay;b.lastdeltay=0,b.rail.drag||b.doScrollBy(e)},120)}return e.stopImmediatePropagation(),e.preventDefault()}var b=this;if(this.version="3.4.0",this.name="nicescroll",this.me=o,this.opt={doc:c("body"),win:!1},c.extend(this.opt,f),this.opt.snapbackspeed=80,e)for(var x in b.opt)"undefined"!=typeof e[x]&&(b.opt[x]=e[x]);this.doc=b.opt.doc,this.iddoc=this.doc&&this.doc[0]?this.doc[0].id||"":"",this.ispage=/BODY|HTML/.test(b.opt.win?b.opt.win[0].nodeName:this.doc[0].nodeName),this.haswrapper=b.opt.win!==!1,this.win=b.opt.win||(this.ispage?c(window):this.doc),this.docscroll=this.ispage&&!this.haswrapper?c(window):this.win,this.body=c("body"),this.viewport=!1,this.isfixed=!1,this.iframe=!1,this.isiframe="IFRAME"==this.doc[0].nodeName&&"IFRAME"==this.win[0].nodeName,this.istextarea="TEXTAREA"==this.win[0].nodeName,this.forcescreen=!1,this.canshowonmouseevent="scroll"!=b.opt.autohidemode,this.onmousedown=!1,this.onmouseup=!1,this.onmousemove=!1,this.onmousewheel=!1,this.onkeypress=!1,this.ongesturezoom=!1,this.onclick=!1,this.onscrollstart=!1,this.onscrollend=!1,this.onscrollcancel=!1,this.onzoomin=!1,this.onzoomout=!1,this.view=!1,this.page=!1,this.scroll={x:0,y:0},this.scrollratio={x:0,y:0},this.cursorheight=20,this.scrollvaluemax=0,this.checkrtlmode=!1,this.scrollrunning=!1,this.scrollmom=!1,this.observer=!1,this.observerremover=!1;do this.id="ascrail"+s++;while(document.getElementById(this.id));this.rail=!1,this.cursor=!1,this.cursorfreezed=!1,this.selectiondrag=!1,this.zoom=!1,this.zoomactive=!1,this.hasfocus=!1,this.hasmousefocus=!1,this.visibility=!0,this.locked=!1,this.hidden=!1,this.cursoractive=!0,this.overflowx=b.opt.overflowx,this.overflowy=b.opt.overflowy,this.nativescrollingarea=!1,this.checkarea=0,this.events=[],this.saved={},this.delaylist={},this.synclist={},this.lastdeltax=0,this.lastdeltay=0,this.detected=w();var S=c.extend({},this.detected);this.canhwscroll=S.hastransform&&b.opt.hwacceleration,this.ishwscroll=this.canhwscroll&&b.haswrapper,this.istouchcapable=!1,S.cantouch&&S.ischrome&&!S.isios&&!S.isandroid&&(this.istouchcapable=!0,S.cantouch=!1),S.cantouch&&S.ismozilla&&!S.isios&&(this.istouchcapable=!0,S.cantouch=!1),b.opt.enablemouselockapi||(S.hasmousecapture=!1,S.haspointerlock=!1),this.delayed=function(e,o,t,r){var i=b.delaylist[e],n=(new Date).getTime();return!r&&i&&i.tt?!1:(i&&i.tt&&clearTimeout(i.tt),void(i&&i.last+t>n&&!i.tt?b.delaylist[e]={last:n+t,tt:setTimeout(function(){b.delaylist[e].tt=0,o.call()},t)}:i&&i.tt||(b.delaylist[e]={last:n,tt:0},setTimeout(function(){o.call()},0))))},this.debounced=function(e,o,t){{var r=b.delaylist[e];(new Date).getTime()}b.delaylist[e]=o,r||setTimeout(function(){var o=b.delaylist[e];b.delaylist[e]=!1,o.call()},t)},this.synched=function(e,o){function t(){b.onsync||(h(function(){b.onsync=!1;for(e in b.synclist){var o=b.synclist[e];o&&o.call(b),b.synclist[e]=!1}}),b.onsync=!0)}return b.synclist[e]=o,t(),e},this.unsynched=function(e){b.synclist[e]&&(b.synclist[e]=!1)},this.css=function(e,o){for(var t in o)b.saved.css.push([e,t,e.css(t)]),e.css(t,o[t])},this.scrollTop=function(e){return"undefined"==typeof e?b.getScrollTop():b.setScrollTop(e)},this.scrollLeft=function(e){return"undefined"==typeof e?b.getScrollLeft():b.setScrollLeft(e)},BezierClass=function(e,o,t,r,i,n,s){this.st=e,this.ed=o,this.spd=t,this.p1=r||0,this.p2=i||1,this.p3=n||0,this.p4=s||1,this.ts=(new Date).getTime(),this.df=this.ed-this.st},BezierClass.prototype={B2:function(e){return 3*e*e*(1-e)},B3:function(e){return 3*e*(1-e)*(1-e)},B4:function(e){return(1-e)*(1-e)*(1-e)},getNow:function(){var e=(new Date).getTime(),o=1-(e-this.ts)/this.spd,t=this.B2(o)+this.B3(o)+this.B4(o);return 0>o?this.ed:this.st+Math.round(this.df*t)},update:function(e,o){return this.st=this.getNow(),this.ed=e,this.spd=o,this.ts=(new Date).getTime(),this.df=this.ed-this.st,this}},this.ishwscroll?(this.doc.translate={x:0,y:0,tx:"0px",ty:"0px"},S.hastranslate3d&&S.isios&&this.doc.css("-webkit-backface-visibility","hidden"),this.getScrollTop=function(e){if(!e){var o=t();if(o)return 16==o.length?-o[13]:-o[5];if(b.timerscroll&&b.timerscroll.bz)return b.timerscroll.bz.getNow()}return b.doc.translate.y},this.getScrollLeft=function(e){if(!e){var o=t();if(o)return 16==o.length?-o[12]:-o[4];if(b.timerscroll&&b.timerscroll.bh)return b.timerscroll.bh.getNow()}return b.doc.translate.x},this.notifyScrollEvent=document.createEvent?function(e){var o=document.createEvent("UIEvents");o.initUIEvent("scroll",!1,!0,window,1),e.dispatchEvent(o)}:document.fireEvent?function(e){var o=document.createEventObject();e.fireEvent("onscroll"),o.cancelBubble=!0}:function(){},S.hastranslate3d&&b.opt.enabletranslate3d?(this.setScrollTop=function(e,o){b.doc.translate.y=e,b.doc.translate.ty=-1*e+"px",b.doc.css(S.trstyle,"translate3d("+b.doc.translate.tx+","+b.doc.translate.ty+",0px)"),o||b.notifyScrollEvent(b.win[0])},this.setScrollLeft=function(e,o){b.doc.translate.x=e,b.doc.translate.tx=-1*e+"px",b.doc.css(S.trstyle,"translate3d("+b.doc.translate.tx+","+b.doc.translate.ty+",0px)"),o||b.notifyScrollEvent(b.win[0])}):(this.setScrollTop=function(e,o){b.doc.translate.y=e,b.doc.translate.ty=-1*e+"px",b.doc.css(S.trstyle,"translate("+b.doc.translate.tx+","+b.doc.translate.ty+")"),o||b.notifyScrollEvent(b.win[0])},this.setScrollLeft=function(e,o){b.doc.translate.x=e,b.doc.translate.tx=-1*e+"px",b.doc.css(S.trstyle,"translate("+b.doc.translate.tx+","+b.doc.translate.ty+")"),o||b.notifyScrollEvent(b.win[0])})):(this.getScrollTop=function(){return b.docscroll.scrollTop()},this.setScrollTop=function(e){return b.docscroll.scrollTop(e)},this.getScrollLeft=function(){return b.docscroll.scrollLeft()},this.setScrollLeft=function(e){return b.docscroll.scrollLeft(e)}),this.getTarget=function(e){return e?e.target?e.target:e.srcElement?e.srcElement:!1:!1},this.hasParent=function(e,o){if(!e)return!1;for(var t=e.target||e.srcElement||e||!1;t&&t.id!=o;)t=t.parentNode||!1;return t!==!1};var z={thin:1,medium:3,thick:5};this.getOffset=function(){if(b.isfixed)return{top:parseFloat(b.win.css("top")),left:parseFloat(b.win.css("left"))};if(!b.viewport)return b.win.offset();var e=b.win.offset(),o=b.viewport.offset();return{top:e.top-o.top+b.viewport.scrollTop(),left:e.left-o.left+b.viewport.scrollLeft()}},this.updateScrollBar=function(e){if(b.ishwscroll)b.rail.css({height:b.win.innerHeight()}),b.railh&&b.railh.css({width:b.win.innerWidth()});else{var o=b.getOffset(),t={top:o.top,left:o.left};t.top+=u(b.win,"border-top-width",!0);{(b.win.outerWidth()-b.win.innerWidth())/2}t.left+=b.rail.align?b.win.outerWidth()-u(b.win,"border-right-width")-b.rail.width:u(b.win,"border-left-width");var r=b.opt.railoffset;if(r&&(r.top&&(t.top+=r.top),b.rail.align&&r.left&&(t.left+=r.left)),b.locked||b.rail.css({top:t.top,left:t.left,height:e?e.h:b.win.innerHeight()}),b.zoom&&b.zoom.css({top:t.top+1,left:1==b.rail.align?t.left-20:t.left+b.rail.width+4}),b.railh&&!b.locked){var t={top:o.top,left:o.left},i=b.railh.align?t.top+u(b.win,"border-top-width",!0)+b.win.innerHeight()-b.railh.height:t.top+u(b.win,"border-top-width",!0),n=t.left+u(b.win,"border-left-width");b.railh.css({top:i,left:n,width:b.railh.width})}}},this.doRailClick=function(e,o,t){var r,i,n,s;b.locked||(b.cancelEvent(e),o?(r=t?b.doScrollLeft:b.doScrollTop,n=t?(e.pageX-b.railh.offset().left-b.cursorwidth/2)*b.scrollratio.x:(e.pageY-b.rail.offset().top-b.cursorheight/2)*b.scrollratio.y,r(n)):(r=t?b.doScrollLeftBy:b.doScrollBy,n=t?b.scroll.x:b.scroll.y,s=t?e.pageX-b.railh.offset().left:e.pageY-b.rail.offset().top,i=t?b.view.w:b.view.h,r(n>=s?i:-i)))},b.hasanimationframe=h,b.hascancelanimationframe=p,b.hasanimationframe?b.hascancelanimationframe||(p=function(){b.cancelAnimationFrame=!0}):(h=function(e){return setTimeout(e,15-Math.floor(+new Date/1e3)%16)},p=clearInterval),this.init=function(){function e(o){if(b.selectiondrag){if(o){var t=b.win.outerHeight(),r=o.pageY-b.selectiondrag.top;r>0&&t>r&&(r=0),r>=t&&(r-=t),b.selectiondrag.df=r}if(0!=b.selectiondrag.df){var i=2*-Math.floor(b.selectiondrag.df/6);b.doScrollBy(i),b.debounced("doselectionscroll",function(){e()},50)}}}function o(){b.iframexd=!1;try{{var e="contentDocument"in this?this.contentDocument:this.contentWindow.document;e.domain}}catch(o){b.iframexd=!0,e=!1}if(b.iframexd)return"console"in window&&console.log("NiceScroll error: policy restriced iframe"),!0;if(b.forcescreen=!0,b.isiframe&&(b.iframe={doc:c(e),html:b.doc.contents().find("html")[0],body:b.doc.contents().find("body")[0]},b.getContentSize=function(){return{w:Math.max(b.iframe.html.scrollWidth,b.iframe.body.scrollWidth),h:Math.max(b.iframe.html.scrollHeight,b.iframe.body.scrollHeight)}},b.docscroll=c(b.iframe.body)),!S.isios&&b.opt.iframeautoresize&&!b.isiframe){b.win.scrollTop(0),b.doc.height("");var t=Math.max(e.getElementsByTagName("html")[0].scrollHeight,e.body.scrollHeight);b.doc.height(t)}b.lazyResize(30),S.isie7&&b.css(c(b.iframe.html),{"overflow-y":"hidden"}),b.css(c(b.iframe.body),{"overflow-y":"hidden"}),"contentWindow"in this?b.bind(this.contentWindow,"scroll",b.onscroll):b.bind(e,"scroll",b.onscroll),b.opt.enablemousewheel&&b.bind(e,"mousewheel",b.onmousewheel),b.opt.enablekeyboard&&b.bind(e,S.isopera?"keypress":"keydown",b.onkeypress),(S.cantouch||b.opt.touchbehavior)&&(b.bind(e,"mousedown",b.onmousedown),b.bind(e,"mousemove",function(e){b.onmousemove(e,!0)}),b.opt.grabcursorenabled&&S.cursorgrabvalue&&b.css(c(e.body),{cursor:S.cursorgrabvalue})),b.bind(e,"mouseup",b.onmouseup),b.zoom&&(b.opt.dblclickzoom&&b.bind(e,"dblclick",b.doZoom),b.ongesturezoom&&b.bind(e,"gestureend",b.ongesturezoom))}if(b.saved.css=[],S.isie7mobile)return!0;if(S.hasmstouch&&b.css(b.ispage?c("html"):b.win,{"-ms-touch-action":"none"}),b.zindex="auto",b.zindex=b.ispage||"auto"!=b.opt.zindex?b.opt.zindex:a()||"auto",b.ispage||"auto"==b.zindex||b.zindex>l&&(l=b.zindex),b.isie&&0==b.zindex&&"auto"==b.opt.zindex&&(b.zindex="auto"),!b.ispage||!S.cantouch&&!S.isieold&&!S.isie9mobile){var t=b.docscroll;b.ispage&&(t=b.haswrapper?b.win:b.doc),S.isie9mobile||b.css(t,{"overflow-y":"hidden"}),b.ispage&&S.isie7&&("BODY"==b.doc[0].nodeName?b.css(c("html"),{"overflow-y":"hidden"}):"HTML"==b.doc[0].nodeName&&b.css(c("body"),{"overflow-y":"hidden"})),!S.isios||b.ispage||b.haswrapper||b.css(c("body"),{"-webkit-overflow-scrolling":"touch"});var s=c(document.createElement("div"));s.css({position:"relative",top:0,"float":"right",width:b.opt.cursorwidth,height:"0px","background-color":b.opt.cursorcolor,border:b.opt.cursorborder,"background-clip":"padding-box","-webkit-border-radius":b.opt.cursorborderradius,"-moz-border-radius":b.opt.cursorborderradius,"border-radius":b.opt.cursorborderradius}),s.hborder=parseFloat(s.outerHeight()-s.innerHeight()),b.cursor=s;var u=c(document.createElement("div"));u.attr("id",b.id),u.addClass("nicescroll-rails");var h,p,f=["left","right"];for(var g in f)p=f[g],h=b.opt.railpadding[p],h?u.css("padding-"+p,h+"px"):b.opt.railpadding[p]=0;u.append(s),u.width=Math.max(parseFloat(b.opt.cursorwidth),s.outerWidth())+b.opt.railpadding.left+b.opt.railpadding.right,u.css({width:u.width+"px",zIndex:b.zindex,background:b.opt.background,cursor:"default"}),u.visibility=!0,u.scrollable=!0,u.align="left"==b.opt.railalign?0:1,b.rail=u,b.rail.drag=!1;var w=!1;if(!b.opt.boxzoom||b.ispage||S.isieold||(w=document.createElement("div"),b.bind(w,"click",b.doZoom),b.zoom=c(w),b.zoom.css({cursor:"pointer","z-index":b.zindex,backgroundImage:"url("+d+"zoomico.png)",height:18,width:18,backgroundPosition:"0px 0px"}),b.opt.dblclickzoom&&b.bind(b.win,"dblclick",b.doZoom),S.cantouch&&b.opt.gesturezoom&&(b.ongesturezoom=function(e){return e.scale>1.5&&b.doZoomIn(e),e.scale<.8&&b.doZoomOut(e),b.cancelEvent(e)},b.bind(b.win,"gestureend",b.ongesturezoom))),b.railh=!1,b.opt.horizrailenabled){b.css(t,{"overflow-x":"hidden"});var s=c(document.createElement("div"));s.css({position:"relative",top:0,height:b.opt.cursorwidth,width:"0px","background-color":b.opt.cursorcolor,border:b.opt.cursorborder,"background-clip":"padding-box","-webkit-border-radius":b.opt.cursorborderradius,"-moz-border-radius":b.opt.cursorborderradius,"border-radius":b.opt.cursorborderradius}),s.wborder=parseFloat(s.outerWidth()-s.innerWidth()),b.cursorh=s;var v=c(document.createElement("div"));v.attr("id",b.id+"-hr"),v.addClass("nicescroll-rails"),v.height=Math.max(parseFloat(b.opt.cursorwidth),s.outerHeight()),v.css({height:v.height+"px",zIndex:b.zindex,background:b.opt.background}),v.append(s),v.visibility=!0,v.scrollable=!0,v.align="top"==b.opt.railvalign?0:1,b.railh=v,b.railh.drag=!1}if(b.ispage)u.css({position:"fixed",top:"0px",height:"100%"}),u.css(u.align?{right:"0px"}:{left:"0px"}),b.body.append(u),b.railh&&(v.css({position:"fixed",left:"0px",width:"100%"}),v.css(v.align?{bottom:"0px"}:{top:"0px"}),b.body.append(v));else{if(b.ishwscroll){"static"==b.win.css("position")&&b.css(b.win,{position:"relative"});var x="HTML"==b.win[0].nodeName?b.body:b.win;b.zoom&&(b.zoom.css({position:"absolute",top:1,right:0,"margin-right":u.width+4}),x.append(b.zoom)),u.css({position:"absolute",top:0}),u.css(u.align?{right:0}:{left:0}),x.append(u),v&&(v.css({position:"absolute",left:0,bottom:0}),v.css(v.align?{bottom:0}:{top:0}),x.append(v))}else{b.isfixed="fixed"==b.win.css("position");var z=b.isfixed?"fixed":"absolute";b.isfixed||(b.viewport=b.getViewport(b.win[0])),b.viewport&&(b.body=b.viewport,0==/relative|absolute/.test(b.viewport.css("position"))&&b.css(b.viewport,{position:"relative"})),u.css({position:z}),b.zoom&&b.zoom.css({position:z}),b.updateScrollBar(),b.body.append(u),b.zoom&&b.body.append(b.zoom),b.railh&&(v.css({position:z}),b.body.append(v))}S.isios&&b.css(b.win,{"-webkit-tap-highlight-color":"rgba(0,0,0,0)","-webkit-touch-callout":"none"}),S.isie&&b.opt.disableoutline&&b.win.attr("hideFocus","true"),S.iswebkit&&b.opt.disableoutline&&b.win.css({outline:"none"})}if(b.opt.autohidemode===!1?(b.autohidedom=!1,b.rail.css({opacity:b.opt.cursoropacitymax}),b.railh&&b.railh.css({opacity:b.opt.cursoropacitymax})):b.opt.autohidemode===!0?(b.autohidedom=c().add(b.rail),S.isie8&&(b.autohidedom=b.autohidedom.add(b.cursor)),b.railh&&(b.autohidedom=b.autohidedom.add(b.railh)),b.railh&&S.isie8&&(b.autohidedom=b.autohidedom.add(b.cursorh))):"scroll"==b.opt.autohidemode?(b.autohidedom=c().add(b.rail),b.railh&&(b.autohidedom=b.autohidedom.add(b.railh))):"cursor"==b.opt.autohidemode?(b.autohidedom=c().add(b.cursor),b.railh&&(b.autohidedom=b.autohidedom.add(b.cursorh))):"hidden"==b.opt.autohidemode&&(b.autohidedom=!1,b.hide(),b.locked=!1),S.isie9mobile){b.scrollmom=new y(b),b.onmangotouch=function(){var e=b.getScrollTop(),o=b.getScrollLeft();if(e==b.scrollmom.lastscrolly&&o==b.scrollmom.lastscrollx)return!0;var t=e-b.mangotouch.sy,r=o-b.mangotouch.sx,i=Math.round(Math.sqrt(Math.pow(r,2)+Math.pow(t,2)));if(0!=i){var n=0>t?-1:1,s=0>r?-1:1,l=+new Date;if(b.mangotouch.lazy&&clearTimeout(b.mangotouch.lazy),l-b.mangotouch.tm>80||b.mangotouch.dry!=n||b.mangotouch.drx!=s)b.scrollmom.stop(),b.scrollmom.reset(o,e),b.mangotouch.sy=e,b.mangotouch.ly=e,b.mangotouch.sx=o,b.mangotouch.lx=o,b.mangotouch.dry=n,b.mangotouch.drx=s,b.mangotouch.tm=l;else{b.scrollmom.stop(),b.scrollmom.update(b.mangotouch.sx-r,b.mangotouch.sy-t);{l-b.mangotouch.tm}b.mangotouch.tm=l;var a=Math.max(Math.abs(b.mangotouch.ly-e),Math.abs(b.mangotouch.lx-o));b.mangotouch.ly=e,b.mangotouch.lx=o,a>2&&(b.mangotouch.lazy=setTimeout(function(){b.mangotouch.lazy=!1,b.mangotouch.dry=0,b.mangotouch.drx=0,b.mangotouch.tm=0,b.scrollmom.doMomentum(30)},100))}}};var T=b.getScrollTop(),k=b.getScrollLeft();b.mangotouch={sy:T,ly:T,dry:0,sx:k,lx:k,drx:0,lazy:!1,tm:0},b.bind(b.docscroll,"scroll",b.onmangotouch)}else{if(S.cantouch||b.istouchcapable||b.opt.touchbehavior||S.hasmstouch){b.scrollmom=new y(b),b.ontouchstart=function(e){if(e.pointerType&&2!=e.pointerType)return!1;if(!b.locked){if(S.hasmstouch)for(var o=e.target?e.target:!1;o;){var t=c(o).getNiceScroll();if(t.length>0&&t[0].me==b.me)break;if(t.length>0)return!1;if("DIV"==o.nodeName&&o.id==b.id)break;o=o.parentNode?o.parentNode:!1}b.cancelScroll();var o=b.getTarget(e);if(o){var r=/INPUT/i.test(o.nodeName)&&/range/i.test(o.type);if(r)return b.stopPropagation(e)}if(!("clientX"in e)&&"changedTouches"in e&&(e.clientX=e.changedTouches[0].clientX,e.clientY=e.changedTouches[0].clientY),b.forcescreen){var i=e,e={original:e.original?e.original:e};e.clientX=i.screenX,e.clientY=i.screenY}if(b.rail.drag={x:e.clientX,y:e.clientY,sx:b.scroll.x,sy:b.scroll.y,st:b.getScrollTop(),sl:b.getScrollLeft(),pt:2,dl:!1},b.ispage||!b.opt.directionlockdeadzone)b.rail.drag.dl="f";else{var n={w:c(window).width(),h:c(window).height()},s={w:Math.max(document.body.scrollWidth,document.documentElement.scrollWidth),h:Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)},l=Math.max(0,s.h-n.h),a=Math.max(0,s.w-n.w);b.rail.drag.ck=!b.rail.scrollable&&b.railh.scrollable?l>0?"v":!1:b.rail.scrollable&&!b.railh.scrollable&&a>0?"h":!1,b.rail.drag.ck||(b.rail.drag.dl="f")}if(b.opt.touchbehavior&&b.isiframe&&S.isie){var d=b.win.position();b.rail.drag.x+=d.left,b.rail.drag.y+=d.top}if(b.hasmoving=!1,b.lastmouseup=!1,b.scrollmom.reset(e.clientX,e.clientY),!S.cantouch&&!this.istouchcapable&&!S.hasmstouch){var u=o?/INPUT|SELECT|TEXTAREA/i.test(o.nodeName):!1;if(!u)return!b.ispage&&S.hasmousecapture&&o.setCapture(),b.cancelEvent(e);/SUBMIT|CANCEL|BUTTON/i.test(c(o).attr("type"))&&(pc={tg:o,click:!1},b.preventclick=pc)}}},b.ontouchend=function(e){return e.pointerType&&2!=e.pointerType?!1:b.rail.drag&&2==b.rail.drag.pt&&(b.scrollmom.doMomentum(),b.rail.drag=!1,b.hasmoving&&(b.hasmoving=!1,b.lastmouseup=!0,b.hideCursor(),S.hasmousecapture&&document.releaseCapture(),!S.cantouch))?b.cancelEvent(e):void 0};var M=b.opt.touchbehavior&&b.isiframe&&!S.hasmousecapture;b.ontouchmove=function(e,o){if(e.pointerType&&2!=e.pointerType)return!1;if(b.rail.drag&&2==b.rail.drag.pt){if(S.cantouch&&"undefined"==typeof e.original)return!0;b.hasmoving=!0,b.preventclick&&!b.preventclick.click&&(b.preventclick.click=b.preventclick.tg.onclick||!1,b.preventclick.tg.onclick=b.onpreventclick);var t=c.extend({original:e},e);if(e=t,"changedTouches"in e&&(e.clientX=e.changedTouches[0].clientX,e.clientY=e.changedTouches[0].clientY),b.forcescreen){var r=e,e={original:e.original?e.original:e};e.clientX=r.screenX,e.clientY=r.screenY}var i=ofy=0;if(M&&!o){var n=b.win.position();i=-n.left,ofy=-n.top}var s=e.clientY+ofy,l=s-b.rail.drag.y,a=e.clientX+i,d=a-b.rail.drag.x,u=b.rail.drag.st-l;if(b.ishwscroll&&b.opt.bouncescroll?0>u?u=Math.round(u/2):u>b.page.maxh&&(u=b.page.maxh+Math.round((u-b.page.maxh)/2)):(0>u&&(u=0,s=0),u>b.page.maxh&&(u=b.page.maxh,s=0)),b.railh&&b.railh.scrollable){var h=b.rail.drag.sl-d;b.ishwscroll&&b.opt.bouncescroll?0>h?h=Math.round(h/2):h>b.page.maxw&&(h=b.page.maxw+Math.round((h-b.page.maxw)/2)):(0>h&&(h=0,a=0),h>b.page.maxw&&(h=b.page.maxw,a=0))}var p=!1;if(b.rail.drag.dl)p=!0,"v"==b.rail.drag.dl?h=b.rail.drag.sl:"h"==b.rail.drag.dl&&(u=b.rail.drag.st);else{var m=Math.abs(l),f=Math.abs(d),g=b.opt.directionlockdeadzone;if("v"==b.rail.drag.ck){if(m>g&&.3*m>=f)return b.rail.drag=!1,!0;f>g&&(b.rail.drag.dl="f",c("body").scrollTop(c("body").scrollTop()))}else if("h"==b.rail.drag.ck){if(f>g&&m<=.3*az)return b.rail.drag=!1,!0;m>g&&(b.rail.drag.dl="f",c("body").scrollLeft(c("body").scrollLeft()))}}if(b.synched("touchmove",function(){b.rail.drag&&2==b.rail.drag.pt&&(b.prepareTransition&&b.prepareTransition(0),b.rail.scrollable&&b.setScrollTop(u),b.scrollmom.update(a,s),b.railh&&b.railh.scrollable?(b.setScrollLeft(h),b.showCursor(u,h)):b.showCursor(u),S.isie10&&document.selection.clear())}),S.ischrome&&b.istouchcapable&&(p=!1),p)return b.cancelEvent(e)}}}b.onmousedown=function(e,o){if(!b.rail.drag||1==b.rail.drag.pt){if(b.locked)return b.cancelEvent(e);b.cancelScroll(),b.rail.drag={x:e.clientX,y:e.clientY,sx:b.scroll.x,sy:b.scroll.y,pt:1,hr:!!o};var t=b.getTarget(e);return!b.ispage&&S.hasmousecapture&&t.setCapture(),b.isiframe&&!S.hasmousecapture&&(b.saved.csspointerevents=b.doc.css("pointer-events"),b.css(b.doc,{"pointer-events":"none"})),b.cancelEvent(e)}},b.onmouseup=function(e){if(b.rail.drag){if(S.hasmousecapture&&document.releaseCapture(),b.isiframe&&!S.hasmousecapture&&b.doc.css("pointer-events",b.saved.csspointerevents),1!=b.rail.drag.pt)return;return b.rail.drag=!1,b.cancelEvent(e)}},b.onmousemove=function(e){if(b.rail.drag){if(1!=b.rail.drag.pt)return;if(S.ischrome&&0==e.which)return b.onmouseup(e);if(b.cursorfreezed=!0,b.rail.drag.hr){b.scroll.x=b.rail.drag.sx+(e.clientX-b.rail.drag.x),b.scroll.x<0&&(b.scroll.x=0);var o=b.scrollvaluemaxw;b.scroll.x>o&&(b.scroll.x=o)}else{b.scroll.y=b.rail.drag.sy+(e.clientY-b.rail.drag.y),b.scroll.y<0&&(b.scroll.y=0);var t=b.scrollvaluemax;b.scroll.y>t&&(b.scroll.y=t)}return b.synched("mousemove",function(){b.rail.drag&&1==b.rail.drag.pt&&(b.showCursor(),b.rail.drag.hr?b.doScrollLeft(Math.round(b.scroll.x*b.scrollratio.x),b.opt.cursordragspeed):b.doScrollTop(Math.round(b.scroll.y*b.scrollratio.y),b.opt.cursordragspeed))}),b.cancelEvent(e)}},S.cantouch||b.opt.touchbehavior?(b.onpreventclick=function(e){return b.preventclick?(b.preventclick.tg.onclick=b.preventclick.click,b.preventclick=!1,b.cancelEvent(e)):void 0},b.bind(b.win,"mousedown",b.ontouchstart),b.onclick=S.isios?!1:function(e){return b.lastmouseup?(b.lastmouseup=!1,b.cancelEvent(e)):!0},b.opt.grabcursorenabled&&S.cursorgrabvalue&&(b.css(b.ispage?b.doc:b.win,{cursor:S.cursorgrabvalue}),b.css(b.rail,{cursor:S.cursorgrabvalue}))):(b.hasTextSelected="getSelection"in document?function(){return document.getSelection().rangeCount>0}:"selection"in document?function(){return"None"!=document.selection.type}:function(){return!1},b.onselectionstart=function(){b.ispage||(b.selectiondrag=b.win.offset())},b.onselectionend=function(){b.selectiondrag=!1},b.onselectiondrag=function(o){b.selectiondrag&&b.hasTextSelected()&&b.debounced("selectionscroll",function(){e(o)},250)}),S.hasmstouch&&(b.css(b.rail,{"-ms-touch-action":"none"}),b.css(b.cursor,{"-ms-touch-action":"none"}),b.bind(b.win,"MSPointerDown",b.ontouchstart),b.bind(document,"MSPointerUp",b.ontouchend),b.bind(document,"MSPointerMove",b.ontouchmove),b.bind(b.cursor,"MSGestureHold",function(e){e.preventDefault()}),b.bind(b.cursor,"contextmenu",function(e){e.preventDefault()})),this.istouchcapable&&(b.bind(b.win,"touchstart",b.ontouchstart),b.bind(document,"touchend",b.ontouchend),b.bind(document,"touchcancel",b.ontouchend),b.bind(document,"touchmove",b.ontouchmove)),b.bind(b.cursor,"mousedown",b.onmousedown),b.bind(b.cursor,"mouseup",b.onmouseup),b.railh&&(b.bind(b.cursorh,"mousedown",function(e){b.onmousedown(e,!0)}),b.bind(b.cursorh,"mouseup",function(e){return b.rail.drag&&2==b.rail.drag.pt?void 0:(b.rail.drag=!1,b.hasmoving=!1,b.hideCursor(),S.hasmousecapture&&document.releaseCapture(),b.cancelEvent(e))})),(b.opt.cursordragontouch||!S.cantouch&&!b.opt.touchbehavior)&&(b.rail.css({cursor:"default"}),b.railh&&b.railh.css({cursor:"default"}),b.jqbind(b.rail,"mouseenter",function(){b.canshowonmouseevent&&b.showCursor(),b.rail.active=!0}),b.jqbind(b.rail,"mouseleave",function(){b.rail.active=!1,b.rail.drag||b.hideCursor()}),b.opt.sensitiverail&&(b.bind(b.rail,"click",function(e){b.doRailClick(e,!1,!1)}),b.bind(b.rail,"dblclick",function(e){b.doRailClick(e,!0,!1)}),b.bind(b.cursor,"click",function(e){b.cancelEvent(e)}),b.bind(b.cursor,"dblclick",function(e){b.cancelEvent(e)})),b.railh&&(b.jqbind(b.railh,"mouseenter",function(){b.canshowonmouseevent&&b.showCursor(),b.rail.active=!0}),b.jqbind(b.railh,"mouseleave",function(){b.rail.active=!1,b.rail.drag||b.hideCursor()}),b.opt.sensitiverail&&(b.bind(b.railh,"click",function(e){b.doRailClick(e,!1,!0)}),b.bind(b.railh,"dblclick",function(e){b.doRailClick(e,!0,!0)}),b.bind(b.cursorh,"click",function(e){b.cancelEvent(e)}),b.bind(b.cursorh,"dblclick",function(e){b.cancelEvent(e)})))),S.cantouch||b.opt.touchbehavior?(b.bind(S.hasmousecapture?b.win:document,"mouseup",b.ontouchend),b.bind(document,"mousemove",b.ontouchmove),b.onclick&&b.bind(document,"click",b.onclick),b.opt.cursordragontouch&&(b.bind(b.cursor,"mousedown",b.onmousedown),b.bind(b.cursor,"mousemove",b.onmousemove),b.cursorh&&b.bind(b.cursorh,"mousedown",b.onmousedown),b.cursorh&&b.bind(b.cursorh,"mousemove",b.onmousemove))):(b.bind(S.hasmousecapture?b.win:document,"mouseup",b.onmouseup),b.bind(document,"mousemove",b.onmousemove),b.onclick&&b.bind(document,"click",b.onclick),!b.ispage&&b.opt.enablescrollonselection&&(b.bind(b.win[0],"mousedown",b.onselectionstart),b.bind(document,"mouseup",b.onselectionend),b.bind(b.cursor,"mouseup",b.onselectionend),b.cursorh&&b.bind(b.cursorh,"mouseup",b.onselectionend),b.bind(document,"mousemove",b.onselectiondrag)),b.zoom&&(b.jqbind(b.zoom,"mouseenter",function(){b.canshowonmouseevent&&b.showCursor(),b.rail.active=!0}),b.jqbind(b.zoom,"mouseleave",function(){b.rail.active=!1,b.rail.drag||b.hideCursor()}))),b.opt.enablemousewheel&&(b.isiframe||b.bind(S.isie&&b.ispage?document:b.docscroll,"mousewheel",b.onmousewheel),b.bind(b.rail,"mousewheel",b.onmousewheel),b.railh&&b.bind(b.railh,"mousewheel",b.onmousewheelhr)),b.ispage||S.cantouch||/HTML|BODY/.test(b.win[0].nodeName)||(b.win.attr("tabindex")||b.win.attr({tabindex:n++}),b.jqbind(b.win,"focus",function(e){r=b.getTarget(e).id||!0,b.hasfocus=!0,b.canshowonmouseevent&&b.noticeCursor()}),b.jqbind(b.win,"blur",function(){r=!1,b.hasfocus=!1}),b.jqbind(b.win,"mouseenter",function(e){i=b.getTarget(e).id||!0,b.hasmousefocus=!0,b.canshowonmouseevent&&b.noticeCursor()}),b.jqbind(b.win,"mouseleave",function(){i=!1,b.hasmousefocus=!1}))}if(b.onkeypress=function(e){if(b.locked&&0==b.page.maxh)return!0;e=e?e:window.e;var o=b.getTarget(e);if(o&&/INPUT|TEXTAREA|SELECT|OPTION/.test(o.nodeName)){var t=o.getAttribute("type")||o.type||!1;if(!t||!/submit|button|cancel/i.tp)return!0}if(b.hasfocus||b.hasmousefocus&&!r||b.ispage&&!r&&!i){var n=e.keyCode;if(b.locked&&27!=n)return b.cancelEvent(e);var s=e.ctrlKey||!1,l=e.shiftKey||!1,a=!1; switch(n){case 38:case 63233:b.doScrollBy(72),a=!0;break;case 40:case 63235:b.doScrollBy(-72),a=!0;break;case 37:case 63232:b.railh&&(s?b.doScrollLeft(0):b.doScrollLeftBy(72),a=!0);break;case 39:case 63234:b.railh&&(s?b.doScrollLeft(b.page.maxw):b.doScrollLeftBy(-72),a=!0);break;case 33:case 63276:b.doScrollBy(b.view.h),a=!0;break;case 34:case 63277:b.doScrollBy(-b.view.h),a=!0;break;case 36:case 63273:b.railh&&s?b.doScrollPos(0,0):b.doScrollTo(0),a=!0;break;case 35:case 63275:b.railh&&s?b.doScrollPos(b.page.maxw,b.page.maxh):b.doScrollTo(b.page.maxh),a=!0;break;case 32:b.opt.spacebarenabled&&(b.doScrollBy(l?b.view.h:-b.view.h),a=!0);break;case 27:b.zoomactive&&(b.doZoom(),a=!0)}if(a)return b.cancelEvent(e)}},b.opt.enablekeyboard&&b.bind(document,S.isopera&&!S.isopera12?"keypress":"keydown",b.onkeypress),b.bind(window,"resize",b.lazyResize),b.bind(window,"orientationchange",b.lazyResize),b.bind(window,"load",b.lazyResize),S.ischrome&&!b.ispage&&!b.haswrapper){var E=b.win.attr("style"),L=parseFloat(b.win.css("width"))+1;b.win.css("width",L),b.synched("chromefix",function(){b.win.attr("style",E)})}b.onAttributeChange=function(){b.lazyResize(250)},b.ispage||b.haswrapper||(m!==!1?(b.observer=new m(function(e){e.forEach(b.onAttributeChange)}),b.observer.observe(b.win[0],{childList:!0,characterData:!1,attributes:!0,subtree:!1}),b.observerremover=new m(function(e){e.forEach(function(e){if(e.removedNodes.length>0)for(var o in e.removedNodes)if(e.removedNodes[o]==b.win[0])return b.remove()})}),b.observerremover.observe(b.win[0].parentNode,{childList:!0,characterData:!1,attributes:!1,subtree:!1})):(b.bind(b.win,S.isie&&!S.isie9?"propertychange":"DOMAttrModified",b.onAttributeChange),S.isie9&&b.win[0].attachEvent("onpropertychange",b.onAttributeChange),b.bind(b.win,"DOMNodeRemoved",function(e){e.target==b.win[0]&&b.remove()}))),!b.ispage&&b.opt.boxzoom&&b.bind(window,"resize",b.resizeZoom),b.istextarea&&b.bind(b.win,"mouseup",b.lazyResize),b.checkrtlmode=!0,b.lazyResize(30)}"IFRAME"==this.doc[0].nodeName&&(this.doc[0].readyState&&"complete"==this.doc[0].readyState&&setTimeout(function(){o.call(b.doc[0],!1)},500),b.bind(this.doc,"load",o))},this.showCursor=function(e,o){b.cursortimeout&&(clearTimeout(b.cursortimeout),b.cursortimeout=0),b.rail&&(b.autohidedom&&(b.autohidedom.stop().css({opacity:b.opt.cursoropacitymax}),b.cursoractive=!0),b.rail.drag&&1==b.rail.drag.pt||("undefined"!=typeof e&&e!==!1&&(b.scroll.y=Math.round(1*e/b.scrollratio.y)),"undefined"!=typeof o&&(b.scroll.x=Math.round(1*o/b.scrollratio.x))),b.cursor.css({height:b.cursorheight,top:b.scroll.y}),b.cursorh&&(b.cursorh.css(!b.rail.align&&b.rail.visibility?{width:b.cursorwidth,left:b.scroll.x+b.rail.width}:{width:b.cursorwidth,left:b.scroll.x}),b.cursoractive=!0),b.zoom&&b.zoom.stop().css({opacity:b.opt.cursoropacitymax}))},this.hideCursor=function(e){b.cursortimeout||b.rail&&b.autohidedom&&(b.cursortimeout=setTimeout(function(){b.rail.active&&b.showonmouseevent||(b.autohidedom.stop().animate({opacity:b.opt.cursoropacitymin}),b.zoom&&b.zoom.stop().animate({opacity:b.opt.cursoropacitymin}),b.cursoractive=!1),b.cursortimeout=0},e||b.opt.hidecursordelay))},this.noticeCursor=function(e,o,t){b.showCursor(o,t),b.rail.active||b.hideCursor(e)},this.getContentSize=b.ispage?function(){return{w:Math.max(document.body.scrollWidth,document.documentElement.scrollWidth),h:Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)}}:b.haswrapper?function(){return{w:b.doc.outerWidth()+parseInt(b.win.css("paddingLeft"))+parseInt(b.win.css("paddingRight")),h:b.doc.outerHeight()+parseInt(b.win.css("paddingTop"))+parseInt(b.win.css("paddingBottom"))}}:function(){return{w:b.docscroll[0].scrollWidth,h:b.docscroll[0].scrollHeight}},this.onResize=function(e,o){if(!b.win)return!1;if(!b.haswrapper&&!b.ispage){if("none"==b.win.css("display"))return b.visibility&&b.hideRail().hideRailHr(),!1;b.hidden||b.visibility||b.showRail().showRailHr()}var t=b.page.maxh,r=b.page.maxw,i={h:b.view.h,w:b.view.w};if(b.view={w:b.ispage?b.win.width():parseInt(b.win[0].clientWidth),h:b.ispage?b.win.height():parseInt(b.win[0].clientHeight)},b.page=o?o:b.getContentSize(),b.page.maxh=Math.max(0,b.page.h-b.view.h),b.page.maxw=Math.max(0,b.page.w-b.view.w),b.page.maxh==t&&b.page.maxw==r&&b.view.w==i.w){if(b.ispage)return b;var n=b.win.offset();if(b.lastposition){var s=b.lastposition;if(s.top==n.top&&s.left==n.left)return b}b.lastposition=n}if(0==b.page.maxh?(b.hideRail(),b.scrollvaluemax=0,b.scroll.y=0,b.scrollratio.y=0,b.cursorheight=0,b.setScrollTop(0),b.rail.scrollable=!1):b.rail.scrollable=!0,0==b.page.maxw?(b.hideRailHr(),b.scrollvaluemaxw=0,b.scroll.x=0,b.scrollratio.x=0,b.cursorwidth=0,b.setScrollLeft(0),b.railh.scrollable=!1):b.railh.scrollable=!0,b.locked=0==b.page.maxh&&0==b.page.maxw,b.locked)return b.ispage||b.updateScrollBar(b.view),!1;b.hidden||b.visibility?b.hidden||b.railh.visibility||b.showRailHr():b.showRail().showRailHr(),b.istextarea&&b.win.css("resize")&&"none"!=b.win.css("resize")&&(b.view.h-=20),b.cursorheight=Math.min(b.view.h,Math.round(b.view.h*(b.view.h/b.page.h))),b.cursorheight=b.opt.cursorfixedheight?b.opt.cursorfixedheight:Math.max(b.opt.cursorminheight,b.cursorheight),b.cursorwidth=Math.min(b.view.w,Math.round(b.view.w*(b.view.w/b.page.w))),b.cursorwidth=b.opt.cursorfixedheight?b.opt.cursorfixedheight:Math.max(b.opt.cursorminheight,b.cursorwidth),b.scrollvaluemax=b.view.h-b.cursorheight-b.cursor.hborder,b.railh&&(b.railh.width=b.page.maxh>0?b.view.w-b.rail.width:b.view.w,b.scrollvaluemaxw=b.railh.width-b.cursorwidth-b.cursorh.wborder),b.checkrtlmode&&b.railh&&(b.checkrtlmode=!1,b.opt.rtlmode&&0==b.scroll.x&&b.setScrollLeft(b.page.maxw)),b.ispage||b.updateScrollBar(b.view),b.scrollratio={x:b.page.maxw/b.scrollvaluemaxw,y:b.page.maxh/b.scrollvaluemax};var l=b.getScrollTop();return l>b.page.maxh?b.doScrollTop(b.page.maxh):(b.scroll.y=Math.round(b.getScrollTop()*(1/b.scrollratio.y)),b.scroll.x=Math.round(b.getScrollLeft()*(1/b.scrollratio.x)),b.cursoractive&&b.noticeCursor()),b.scroll.y&&0==b.getScrollTop()&&b.doScrollTo(Math.floor(b.scroll.y*b.scrollratio.y)),b},this.resize=b.onResize,this.lazyResize=function(e){return e=isNaN(e)?30:e,b.delayed("resize",b.resize,e),b},this._bind=function(e,o,t,r){b.events.push({e:e,n:o,f:t,b:r,q:!1}),e.addEventListener?e.addEventListener(o,t,r||!1):e.attachEvent?e.attachEvent("on"+o,t):e["on"+o]=t},this.jqbind=function(e,o,t){b.events.push({e:e,n:o,f:t,q:!0}),c(e).bind(o,t)},this.bind=function(e,o,t,r){var i="jquery"in e?e[0]:e;if("mousewheel"==o)if("onwheel"in b.win)b._bind(i,"wheel",t,r||!1);else{var n="undefined"!=typeof document.onmousewheel?"mousewheel":"DOMMouseScroll";g(i,n,t,r||!1),"DOMMouseScroll"==n&&g(i,"MozMousePixelScroll",t,r||!1)}else if(i.addEventListener){if(S.cantouch&&/mouseup|mousedown|mousemove/.test(o)){var s="mousedown"==o?"touchstart":"mouseup"==o?"touchend":"touchmove";b._bind(i,s,function(e){if(e.touches){if(e.touches.length<2){var o=e.touches.length?e.touches[0]:e;o.original=e,t.call(this,o)}}else if(e.changedTouches){var o=e.changedTouches[0];o.original=e,t.call(this,o)}},r||!1)}b._bind(i,o,t,r||!1),S.cantouch&&"mouseup"==o&&b._bind(i,"touchcancel",t,r||!1)}else b._bind(i,o,function(e){return e=e||window.event||!1,e&&e.srcElement&&(e.target=e.srcElement),"pageY"in e||(e.pageX=e.clientX+document.documentElement.scrollLeft,e.pageY=e.clientY+document.documentElement.scrollTop),t.call(i,e)===!1||r===!1?b.cancelEvent(e):!0})},this._unbind=function(e,o,t,r){e.removeEventListener?e.removeEventListener(o,t,r):e.detachEvent?e.detachEvent("on"+o,t):e["on"+o]=!1},this.unbindAll=function(){for(var e=0;e0)return t;o=o.parentNode?o.parentNode:!1}return!1},this.onmousewheel=function(e){if(b.locked)return!0;if(b.rail.drag)return b.cancelEvent(e);if(!b.rail.scrollable)return b.railh&&b.railh.scrollable?b.onmousewheelhr(e):!0;var o=+new Date,t=!1;if(b.opt.preservenativescrolling&&b.checkarea+60020?t:0},b.opt.smoothscroll?b.ishwscroll&&S.hastransition&&b.opt.usetransition?(this.prepareTransition=function(e,o){var t=o?e>20?e:0:b.getTransitionSpeed(e),r=t?S.prefixstyle+"transform "+t+"ms ease-out":"";return b.lasttransitionstyle&&b.lasttransitionstyle==r||(b.lasttransitionstyle=r,b.doc.css(S.transitionstyle,r)),t},this.doScrollLeft=function(e,o){var t=b.scrollrunning?b.newscrolly:b.getScrollTop();b.doScrollPos(e,t,o)},this.doScrollTop=function(e,o){var t=b.scrollrunning?b.newscrollx:b.getScrollLeft();b.doScrollPos(t,e,o)},this.doScrollPos=function(e,o,t){var r=b.getScrollTop(),i=b.getScrollLeft();return((b.newscrolly-r)*(o-r)<0||(b.newscrollx-i)*(e-i)<0)&&b.cancelScroll(),0==b.opt.bouncescroll&&(0>o?o=0:o>b.page.maxh&&(o=b.page.maxh),0>e?e=0:e>b.page.maxw&&(e=b.page.maxw)),b.scrollrunning&&e==b.newscrollx&&o==b.newscrolly?!1:(b.newscrolly=o,b.newscrollx=e,b.newscrollspeed=t||!1,b.timer?!1:void(b.timer=setTimeout(function(){var t=b.getScrollTop(),r=b.getScrollLeft(),i={};i.x=e-r,i.y=o-t,i.px=r,i.py=t;var n=Math.round(Math.sqrt(Math.pow(i.x,2)+Math.pow(i.y,2))),s=b.newscrollspeed&&b.newscrollspeed>1?b.newscrollspeed:b.getTransitionSpeed(n);if(b.newscrollspeed&&b.newscrollspeed<=1&&(s*=b.newscrollspeed),b.prepareTransition(s,!0),b.timerscroll&&b.timerscroll.tm&&clearInterval(b.timerscroll.tm),s>0){if(!b.scrollrunning&&b.onscrollstart){var l={type:"scrollstart",current:{x:r,y:t},request:{x:e,y:o},end:{x:b.newscrollx,y:b.newscrolly},speed:s};b.onscrollstart.call(b,l)}S.transitionend?b.scrollendtrapped||(b.scrollendtrapped=!0,b.bind(b.doc,S.transitionend,b.onScrollEnd,!1)):(b.scrollendtrapped&&clearTimeout(b.scrollendtrapped),b.scrollendtrapped=setTimeout(b.onScrollEnd,s));var a=t,c=r;b.timerscroll={bz:new BezierClass(a,b.newscrolly,s,0,0,.58,1),bh:new BezierClass(c,b.newscrollx,s,0,0,.58,1)},b.cursorfreezed||(b.timerscroll.tm=setInterval(function(){b.showCursor(b.getScrollTop(),b.getScrollLeft())},60))}b.synched("doScroll-set",function(){b.timer=0,b.scrollendtrapped&&(b.scrollrunning=!0),b.setScrollTop(b.newscrolly),b.setScrollLeft(b.newscrollx),b.scrollendtrapped||b.onScrollEnd()})},50)))},this.cancelScroll=function(){if(!b.scrollendtrapped)return!0;var e=b.getScrollTop(),o=b.getScrollLeft();return b.scrollrunning=!1,S.transitionend||clearTimeout(S.transitionend),b.scrollendtrapped=!1,b._unbind(b.doc,S.transitionend,b.onScrollEnd),b.prepareTransition(0),b.setScrollTop(e),b.railh&&b.setScrollLeft(o),b.timerscroll&&b.timerscroll.tm&&clearInterval(b.timerscroll.tm),b.timerscroll=!1,b.cursorfreezed=!1,b.showCursor(e,o),b},this.onScrollEnd=function(){b.scrollendtrapped&&b._unbind(b.doc,S.transitionend,b.onScrollEnd),b.scrollendtrapped=!1,b.prepareTransition(0),b.timerscroll&&b.timerscroll.tm&&clearInterval(b.timerscroll.tm),b.timerscroll=!1;var e=b.getScrollTop(),o=b.getScrollLeft();if(b.setScrollTop(e),b.railh&&b.setScrollLeft(o),b.noticeCursor(!1,e,o),b.cursorfreezed=!1,0>e?e=0:e>b.page.maxh&&(e=b.page.maxh),0>o?o=0:o>b.page.maxw&&(o=b.page.maxw),e!=b.newscrolly||o!=b.newscrollx)return b.doScrollPos(o,e,b.opt.snapbackspeed);if(b.onscrollend&&b.scrollrunning){var t={type:"scrollend",current:{x:o,y:e},end:{x:b.newscrollx,y:b.newscrolly}};b.onscrollend.call(b,t)}b.scrollrunning=!1}):(this.doScrollLeft=function(e,o){var t=b.scrollrunning?b.newscrolly:b.getScrollTop();b.doScrollPos(e,t,o)},this.doScrollTop=function(e,o){var t=b.scrollrunning?b.newscrollx:b.getScrollLeft();b.doScrollPos(t,e,o)},this.doScrollPos=function(e,o,t){function r(){if(b.cancelAnimationFrame)return!0;if(b.scrollrunning=!0,d=1-d)return b.timer=h(r)||1;var e=0,o=sy=b.getScrollTop();if(b.dst.ay){o=b.bzscroll?b.dst.py+b.bzscroll.getNow()*b.dst.ay:b.newscrolly;var t=o-sy;(0>t&&o0&&o>b.newscrolly)&&(o=b.newscrolly),b.setScrollTop(o),o==b.newscrolly&&(e=1)}else e=1;var i=sx=b.getScrollLeft();if(b.dst.ax){i=b.bzscroll?b.dst.px+b.bzscroll.getNow()*b.dst.ax:b.newscrollx;var t=i-sx;(0>t&&i0&&i>b.newscrollx)&&(i=b.newscrollx),b.setScrollLeft(i),i==b.newscrollx&&(e+=1)}else e+=1;if(2==e){if(b.timer=0,b.cursorfreezed=!1,b.bzscroll=!1,b.scrollrunning=!1,0>o?o=0:o>b.page.maxh&&(o=b.page.maxh),0>i?i=0:i>b.page.maxw&&(i=b.page.maxw),i!=b.newscrollx||o!=b.newscrolly)b.doScrollPos(i,o);else if(b.onscrollend){var n={type:"scrollend",current:{x:sx,y:sy},end:{x:b.newscrollx,y:b.newscrolly}};b.onscrollend.call(b,n)}}else b.timer=h(r)||1}var o="undefined"==typeof o||o===!1?b.getScrollTop(!0):o;if(b.timer&&b.newscrolly==o&&b.newscrollx==e)return!0;b.timer&&p(b.timer),b.timer=0;var i=b.getScrollTop(),n=b.getScrollLeft();((b.newscrolly-i)*(o-i)<0||(b.newscrollx-n)*(e-n)<0)&&b.cancelScroll(),b.newscrolly=o,b.newscrollx=e,b.bouncescroll&&b.rail.visibility||(b.newscrolly<0?b.newscrolly=0:b.newscrolly>b.page.maxh&&(b.newscrolly=b.page.maxh)),b.bouncescroll&&b.railh.visibility||(b.newscrollx<0?b.newscrollx=0:b.newscrollx>b.page.maxw&&(b.newscrollx=b.page.maxw)),b.dst={},b.dst.x=e-n,b.dst.y=o-i,b.dst.px=n,b.dst.py=i;var s=Math.round(Math.sqrt(Math.pow(b.dst.x,2)+Math.pow(b.dst.y,2)));b.dst.ax=b.dst.x/s,b.dst.ay=b.dst.y/s;var l=0,a=s;0==b.dst.x?(l=i,a=o,b.dst.ay=1,b.dst.py=0):0==b.dst.y&&(l=n,a=e,b.dst.ax=1,b.dst.px=0);var c=b.getTransitionSpeed(s);if(t&&1>=t&&(c*=t),b.bzscroll=c>0?b.bzscroll?b.bzscroll.update(a,c):new BezierClass(l,a,c,0,1,0,1):!1,!b.timer){(i==b.page.maxh&&o>=b.page.maxh||n==b.page.maxw&&e>=b.page.maxw)&&b.checkContentSize();var d=1;if(b.cancelAnimationFrame=!1,b.timer=1,b.onscrollstart&&!b.scrollrunning){var u={type:"scrollstart",current:{x:n,y:i},request:{x:e,y:o},end:{x:b.newscrollx,y:b.newscrolly},speed:c};b.onscrollstart.call(b,u)}r(),(i==b.page.maxh&&o>=i||n==b.page.maxw&&e>=n)&&b.checkContentSize(),b.noticeCursor()}},this.cancelScroll=function(){return b.timer&&p(b.timer),b.timer=0,b.bzscroll=!1,b.scrollrunning=!1,b}):(this.doScrollLeft=function(e,o){var t=b.getScrollTop();b.doScrollPos(e,t,o)},this.doScrollTop=function(e,o){var t=b.getScrollLeft();b.doScrollPos(t,e,o)},this.doScrollPos=function(e,o){var t=e>b.page.maxw?b.page.maxw:e;0>t&&(t=0);var r=o>b.page.maxh?b.page.maxh:o;0>r&&(r=0),b.synched("scroll",function(){b.setScrollTop(r),b.setScrollLeft(t)})},this.cancelScroll=function(){}),this.doScrollBy=function(e,o){var t=0;if(o)t=Math.floor((b.scroll.y-e)*b.scrollratio.y);else{var r=b.timer?b.newscrolly:b.getScrollTop(!0);t=r-e}if(b.bouncescroll){var i=Math.round(b.view.h/2);-i>t?t=-i:t>b.page.maxh+i&&(t=b.page.maxh+i)}return b.cursorfreezed=!1,py=b.getScrollTop(!0),0>t&&py<=0?b.noticeCursor():t>b.page.maxh&&py>=b.page.maxh?(b.checkContentSize(),b.noticeCursor()):void b.doScrollTop(t)},this.doScrollLeftBy=function(e,o){var t=0;if(o)t=Math.floor((b.scroll.x-e)*b.scrollratio.x);else{var r=b.timer?b.newscrollx:b.getScrollLeft(!0);t=r-e}if(b.bouncescroll){var i=Math.round(b.view.w/2);-i>t?t=-i:t>b.page.maxw+i&&(t=b.page.maxw+i)}return b.cursorfreezed=!1,px=b.getScrollLeft(!0),0>t&&px<=0?b.noticeCursor():t>b.page.maxw&&px>=b.page.maxw?b.noticeCursor():void b.doScrollLeft(t)},this.doScrollTo=function(e,o){var t=o?Math.round(e*b.scrollratio.y):e;0>t?t=0:t>b.page.maxh&&(t=b.page.maxh),b.cursorfreezed=!1,b.doScrollTop(e)},this.checkContentSize=function(){var e=b.getContentSize();(e.h!=b.page.h||e.w!=b.page.w)&&b.resize(!1,e)},b.onscroll=function(){b.rail.drag||b.cursorfreezed||b.synched("scroll",function(){b.scroll.y=Math.round(b.getScrollTop()*(1/b.scrollratio.y)),b.railh&&(b.scroll.x=Math.round(b.getScrollLeft()*(1/b.scrollratio.x))),b.noticeCursor()})},b.bind(b.docscroll,"scroll",b.onscroll),this.doZoomIn=function(e){if(!b.zoomactive){b.zoomactive=!0,b.zoomrestore={style:{}};var o=["position","top","left","zIndex","backgroundColor","marginTop","marginBottom","marginLeft","marginRight"],t=b.win[0].style;for(var r in o){var i=o[r];b.zoomrestore.style[i]="undefined"!=typeof t[i]?t[i]:""}b.zoomrestore.style.width=b.win.css("width"),b.zoomrestore.style.height=b.win.css("height"),b.zoomrestore.padding={w:b.win.outerWidth()-b.win.width(),h:b.win.outerHeight()-b.win.height()},S.isios4&&(b.zoomrestore.scrollTop=c(window).scrollTop(),c(window).scrollTop(0)),b.win.css({position:S.isios4?"absolute":"fixed",top:0,left:0,"z-index":l+100,margin:"0px"});var n=b.win.css("backgroundColor");return(""==n||/transparent|rgba\(0, 0, 0, 0\)|rgba\(0,0,0,0\)/.test(n))&&b.win.css("backgroundColor","#fff"),b.rail.css({"z-index":l+101}),b.zoom.css({"z-index":l+102}),b.zoom.css("backgroundPosition","0px -18px"),b.resizeZoom(),b.onzoomin&&b.onzoomin.call(b),b.cancelEvent(e)}},this.doZoomOut=function(e){return b.zoomactive?(b.zoomactive=!1,b.win.css("margin",""),b.win.css(b.zoomrestore.style),S.isios4&&c(window).scrollTop(b.zoomrestore.scrollTop),b.rail.css({"z-index":b.zindex}),b.zoom.css({"z-index":b.zindex}),b.zoomrestore=!1,b.zoom.css("backgroundPosition","0px 0px"),b.onResize(),b.onzoomout&&b.onzoomout.call(b),b.cancelEvent(e)):void 0},this.doZoom=function(e){return b.zoomactive?b.doZoomOut(e):b.doZoomIn(e)},this.resizeZoom=function(){if(b.zoomactive){var e=b.getScrollTop();b.win.css({width:c(window).width()-b.zoomrestore.padding.w+"px",height:c(window).height()-b.zoomrestore.padding.h+"px"}),b.onResize(),b.setScrollTop(Math.min(b.page.maxh,e))}},this.init(),c.nicescroll.push(this)},y=function(e){var o=this;this.nc=e,this.lastx=0,this.lasty=0,this.speedx=0,this.speedy=0,this.lasttime=0,this.steptime=0,this.snapx=!1,this.snapy=!1,this.demulx=0,this.demuly=0,this.lastscrollx=-1,this.lastscrolly=-1,this.chkx=0,this.chky=0,this.timer=0,this.time=function(){return+new Date},this.reset=function(e,t){o.stop();var r=o.time();o.steptime=0,o.lasttime=r,o.speedx=0,o.speedy=0,o.lastx=e,o.lasty=t,o.lastscrollx=-1,o.lastscrolly=-1},this.update=function(e,t){var r=o.time();o.steptime=r-o.lasttime,o.lasttime=r;var i=t-o.lasty,n=e-o.lastx,s=o.nc.getScrollTop(),l=o.nc.getScrollLeft(),a=s+i,c=l+n;o.snapx=0>c||c>o.nc.page.maxw,o.snapy=0>a||a>o.nc.page.maxh,o.speedx=n,o.speedy=i,o.lastx=e,o.lasty=t},this.stop=function(){o.nc.unsynched("domomentum2d"),o.timer&&clearTimeout(o.timer),o.timer=0,o.lastscrollx=-1,o.lastscrolly=-1},this.doSnapy=function(e,t){var r=!1;0>t?(t=0,r=!0):t>o.nc.page.maxh&&(t=o.nc.page.maxh,r=!0),0>e?(e=0,r=!0):e>o.nc.page.maxw&&(e=o.nc.page.maxw,r=!0),r&&o.nc.doScrollPos(e,t,o.nc.opt.snapbackspeed)},this.doMomentum=function(e){var t=o.time(),r=e?t+e:o.lasttime,i=o.nc.getScrollLeft(),n=o.nc.getScrollTop(),s=o.nc.page.maxh,l=o.nc.page.maxw;o.speedx=l>0?Math.min(60,o.speedx):0,o.speedy=s>0?Math.min(60,o.speedy):0;var a=r&&50>=t-r;(0>n||n>s||0>i||i>l)&&(a=!1);var c=o.speedy&&a?o.speedy:!1,d=o.speedx&&a?o.speedx:!1;if(c||d){var u=Math.max(16,o.steptime);if(u>50){var h=u/50;o.speedx*=h,o.speedy*=h,u=50}o.demulxy=0,o.lastscrollx=o.nc.getScrollLeft(),o.chkx=o.lastscrollx,o.lastscrolly=o.nc.getScrollTop(),o.chky=o.lastscrolly;var p=o.lastscrollx,m=o.lastscrolly,f=function(){var e=o.time()-t>600?.04:.02;o.speedx&&(p=Math.floor(o.lastscrollx-o.speedx*(1-o.demulxy)),o.lastscrollx=p,(0>p||p>l)&&(e=.1)),o.speedy&&(m=Math.floor(o.lastscrolly-o.speedy*(1-o.demulxy)),o.lastscrolly=m,(0>m||m>s)&&(e=.1)),o.demulxy=Math.min(1,o.demulxy+e),o.nc.synched("domomentum2d",function(){if(o.speedx){var e=o.nc.getScrollLeft();e!=o.chkx&&o.stop(),o.chkx=p,o.nc.setScrollLeft(p)}if(o.speedy){var t=o.nc.getScrollTop();t!=o.chky&&o.stop(),o.chky=m,o.nc.setScrollTop(m)}o.timer||(o.nc.hideCursor(),o.doSnapy(p,m))}),o.demulxy<1?o.timer=setTimeout(f,u):(o.stop(),o.nc.hideCursor(),o.doSnapy(p,m))};f()}else o.doSnapy(o.nc.getScrollLeft(),o.nc.getScrollTop())}},b=e.fn.scrollTop;e.cssHooks.pageYOffset={get:function(e){var o=c.data(e,"__nicescroll")||!1;return o&&o.ishwscroll?o.getScrollTop():b.call(e)},set:function(e,o){var t=c.data(e,"__nicescroll")||!1;return t&&t.ishwscroll?t.setScrollTop(parseInt(o)):b.call(e,o),this}},e.fn.scrollTop=function(e){if("undefined"==typeof e){var o=this[0]?c.data(this[0],"__nicescroll")||!1:!1;return o&&o.ishwscroll?o.getScrollTop():b.call(this)}return this.each(function(){var o=c.data(this,"__nicescroll")||!1;o&&o.ishwscroll?o.setScrollTop(parseInt(e)):b.call(c(this),e)})};var x=e.fn.scrollLeft;c.cssHooks.pageXOffset={get:function(e){var o=c.data(e,"__nicescroll")||!1;return o&&o.ishwscroll?o.getScrollLeft():x.call(e)},set:function(e,o){var t=c.data(e,"__nicescroll")||!1;return t&&t.ishwscroll?t.setScrollLeft(parseInt(o)):x.call(e,o),this}},e.fn.scrollLeft=function(e){if("undefined"==typeof e){var o=this[0]?c.data(this[0],"__nicescroll")||!1:!1;return o&&o.ishwscroll?o.getScrollLeft():x.call(this)}return this.each(function(){var o=c.data(this,"__nicescroll")||!1;o&&o.ishwscroll?o.setScrollLeft(parseInt(e)):x.call(c(this),e)})};var S=function(e){var o=this;if(this.length=0,this.name="nicescrollarray",this.each=function(e){for(var t=0;t -1){ var dataName=self._helpers._camelCase(name.substring(5,name.length)); target.dataset[dataName]=val; }} } if(target.mixParent===undf){ target.mixParent=self._id; }} if((self._$targets.length&&init) || (!self._origOrder.length&&self._$targets.length) ){ self._origOrder=[]; for(var i=0; i < self._$targets.length; i++){ var target=self._$targets[i]; self._origOrder.push(target); }} self._execAction('_refresh', 1, arguments); }, _bindHandlers: function(){ var self=this, filters=$.MixItUp.prototype._bound._filter, sorts=$.MixItUp.prototype._bound._sort; self._execAction('_bindHandlers', 0); if(self.controls.live){ self._$body .on('click.mixItUp.'+self._id, self.selectors.sort, function(){ self._processClick($(this), 'sort'); }) .on('click.mixItUp.'+self._id, self.selectors.filter, function(){ self._processClick($(this), 'filter'); }); }else{ self._$sortButtons=$(self.selectors.sort); self._$filterButtons=$(self.selectors.filter); self._$sortButtons.on('click.mixItUp.'+self._id, function(){ self._processClick($(this), 'sort'); }); self._$filterButtons.on('click.mixItUp.'+self._id, function(){ self._processClick($(this), 'filter'); }); } filters[self.selectors.filter]=(filters[self.selectors.filter]===undf) ? 1:filters[self.selectors.filter] + 1; sorts[self.selectors.sort]=(sorts[self.selectors.sort]===undf) ? 1:sorts[self.selectors.sort] + 1; self._execAction('_bindHandlers', 1); }, _processClick: function($button, type){ var self=this, trackClick=function($button, type, off){ var proto=$.MixItUp.prototype; proto._handled['_'+type][self.selectors[type]]=(proto._handled['_'+type][self.selectors[type]]===undf) ? 1 : proto._handled['_'+type][self.selectors[type]] + 1; if(proto._handled['_'+type][self.selectors[type]]===proto._bound['_'+type][self.selectors[type]]){ $button[(off ? 'remove':'add')+'Class'](self.controls.activeClass); delete proto._handled['_'+type][self.selectors[type]]; }}; self._execAction('_processClick', 0, arguments); if(!self._mixing||(self.animation.queue&&self._queue.length < self.animation.queueLimit)){ self._clicking=true; if(type==='sort'){ var sort=$button.attr('data-sort'); if(!$button.hasClass(self.controls.activeClass)||sort.indexOf('random') > -1){ $(self.selectors.sort).removeClass(self.controls.activeClass); trackClick($button, type); self.sort(sort); }} if(type==='filter'){ var filter=$button.attr('data-filter'), ndx, seperator=self.controls.toggleLogic==='or' ? ',':''; if(!self.controls.toggleFilterButtons){ if(!$button.hasClass(self.controls.activeClass)){ $(self.selectors.filter).removeClass(self.controls.activeClass); trackClick($button, type); self.filter(filter); }}else{ self._buildToggleArray(); if(!$button.hasClass(self.controls.activeClass)){ trackClick($button, type); self._toggleArray.push(filter); }else{ trackClick($button, type, true); ndx=self._toggleArray.indexOf(filter); self._toggleArray.splice(ndx, 1); } self._toggleArray=$.grep(self._toggleArray,function(n){return(n);}); self._toggleString=self._toggleArray.join(seperator); self.filter(self._toggleString); }} self._execAction('_processClick', 1, arguments); }else{ if(typeof self.callbacks.onMixBusy==='function'){ self.callbacks.onMixBusy.call(self._domNode, self._state, self); } self._execAction('_processClickBusy', 1, arguments); }}, _buildToggleArray: function(){ var self=this, activeFilter=self._activeFilter.replace(/\s/g, ''); self._execAction('_buildToggleArray', 0, arguments); if(self.controls.toggleLogic==='or'){ self._toggleArray=activeFilter.split(','); }else{ self._toggleArray=activeFilter.split('.'); !self._toggleArray[0]&&self._toggleArray.shift(); for(var i=0, filter; filter=self._toggleArray[i]; i++){ self._toggleArray[i]='.'+filter; }} self._execAction('_buildToggleArray', 1, arguments); }, _updateControls: function(command, multi){ var self=this, output={ filter: command.filter, sort: command.sort }, update=function($el, filter){ (multi&&type==='filter'&&!(output.filter==='none'||output.filter==='')) ? $el.filter(filter).addClass(self.controls.activeClass) : $el.removeClass(self.controls.activeClass).filter(filter).addClass(self.controls.activeClass); }, type='filter', $el=null; self._execAction('_updateControls', 0, arguments); (command.filter===undf)&&(output.filter=self._activeFilter); (command.sort===undf)&&(output.sort=self._activeSort); (output.filter===self.selectors.target)&&(output.filter='all'); for(var i=0; i < 2; i++){ $el=self.controls.live ? $(self.selectors[type]):self['_$'+type+'Buttons']; $el&&update($el, '[data-'+type+'="'+output[type]+'"]'); type='sort'; } self._execAction('_updateControls', 1, arguments); }, _filter: function(){ var self=this; self._execAction('_filter', 0); for(var i=0; i < self._$targets.length; i++){ var $target=$(self._$targets[i]); if($target.is(self._activeFilter)){ self._$show=self._$show.add($target); }else{ self._$hide=self._$hide.add($target); }} self._execAction('_filter', 1); }, _sort: function(){ var self=this, arrayShuffle=function(oldArray){ var newArray=oldArray.slice(), len=newArray.length, i=len; while(i--){ var p=parseInt(Math.random()*len); var t=newArray[i]; newArray[i]=newArray[p]; newArray[p]=t; }; return newArray; }; self._execAction('_sort', 0); self._startOrder=[]; for(var i=0; i < self._$targets.length; i++){ var target=self._$targets[i]; self._startOrder.push(target); } switch(self._newSort[0].sortBy){ case 'default': self._newOrder=self._origOrder; break; case 'random': self._newOrder=arrayShuffle(self._startOrder); break; case 'custom': self._newOrder=self._newSort[0].order; break; default: self._newOrder=self._startOrder.concat().sort(function(a, b){ return self._compare(a, b); }); } self._execAction('_sort', 1); }, _compare: function(a, b, depth){ depth=depth ? depth:0; var self=this, order=self._newSort[depth].order, getData=function(el){ return el.dataset[self._newSort[depth].sortBy]||0; }, attrA=isNaN(getData(a) * 1) ? getData(a).toLowerCase():getData(a) * 1, attrB=isNaN(getData(b) * 1) ? getData(b).toLowerCase():getData(b) * 1; if(attrA < attrB) return order==='asc' ? -1:1; if(attrA > attrB) return order==='asc' ? 1:-1; if(attrA===attrB&&self._newSort.length > depth+1) return self._compare(a, b, depth+1); return 0; }, _printSort: function(reset){ var self=this, order=reset ? self._startOrder:self._newOrder, targets=self._$parent[0].querySelectorAll(self.selectors.target), nextSibling=targets.length ? targets[targets.length -1].nextElementSibling:null, frag=document.createDocumentFragment(); self._execAction('_printSort', 0, arguments); for(var i=0; i < targets.length; i++){ var target=targets[i], whiteSpace=target.nextSibling; if(target.style.position==='absolute') continue; if(whiteSpace&&whiteSpace.nodeName==='#text'){ self._$parent[0].removeChild(whiteSpace); } self._$parent[0].removeChild(target); } for(var i=0; i < order.length; i++){ var el=order[i]; if(self._newSort[0].sortBy==='default'&&self._newSort[0].order==='desc'&&!reset){ var firstChild=frag.firstChild; frag.insertBefore(el, firstChild); frag.insertBefore(document.createTextNode(' '), el); }else{ frag.appendChild(el); frag.appendChild(document.createTextNode(' ')); }} nextSibling ? self._$parent[0].insertBefore(frag, nextSibling) : self._$parent[0].appendChild(frag); self._execAction('_printSort', 1, arguments); }, _parseSort: function(sortString){ var self=this, rules=typeof sortString==='string' ? sortString.split(' '):[sortString], newSort=[]; for(var i=0; i < rules.length; i++){ var rule=typeof sortString==='string' ? rules[i].split(':'):['custom', rules[i]], ruleObj={ sortBy: self._helpers._camelCase(rule[0]), order: rule[1]||'asc' }; newSort.push(ruleObj); if(ruleObj.sortBy==='default'||ruleObj.sortBy==='random') break; } return self._execFilter('_parseSort', newSort, arguments); }, _parseEffects: function(){ var self=this, effects={ opacity: '', transformIn: '', transformOut: '', filter: '' }, parse=function(effect, extract, reverse){ if(self.animation.effects.indexOf(effect) > -1){ if(extract){ var propIndex=self.animation.effects.indexOf(effect+'('); if(propIndex > -1){ var str=self.animation.effects.substring(propIndex), match=/\(([^)]+)\)/.exec(str), val=match[1]; return {val: val};}} return true; }else{ return false; }}, negate=function(value, invert){ if(invert){ return value.charAt(0)==='-' ? value.substr(1, value.length):'-'+value; }else{ return value; }}, buildTransform=function(key, invert){ var transforms=[ ['scale', '.01'], ['translateX', '20px'], ['translateY', '20px'], ['translateZ', '20px'], ['rotateX', '90deg'], ['rotateY', '90deg'], ['rotateZ', '180deg'], ]; for(var i=0; i < transforms.length; i++){ var prop=transforms[i][0], def=transforms[i][1], inverted=invert&&prop!=='scale'; effects[key] +=parse(prop) ? prop+'('+negate(parse(prop, true).val||def, inverted)+') ':''; }}; effects.opacity=parse('fade') ? parse('fade',true).val||'0':'1'; buildTransform('transformIn'); self.animation.reverseOut ? buildTransform('transformOut', true):(effects.transformOut=effects.transformIn); effects.transition={}; effects.transition=self._getPrefixedCSS('transition','all '+self.animation.duration+'ms '+self.animation.easing+', opacity '+self.animation.duration+'ms linear'); self.animation.stagger=parse('stagger') ? true:false; self.animation.staggerDuration=parseInt(parse('stagger') ? (parse('stagger',true).val ? parse('stagger',true).val:100):100); return self._execFilter('_parseEffects', effects); }, _buildState: function(future){ var self=this, state={}; self._execAction('_buildState', 0); state={ activeFilter: self._activeFilter==='' ? 'none':self._activeFilter, activeSort: future&&self._newSortString ? self._newSortString:self._activeSort, fail: !self._$show.length&&self._activeFilter!=='', $targets: self._$targets, $show: self._$show, $hide: self._$hide, totalTargets: self._$targets.length, totalShow: self._$show.length, totalHide: self._$hide.length, display: future&&self._newDisplay ? self._newDisplay:self.layout.display }; if(future){ return self._execFilter('_buildState', state); }else{ self._state=state; self._execAction('_buildState', 1); }}, _goMix: function(animate){ var self=this, phase1=function(){ if(self._chrome&&(self._chrome===31)){ chromeFix(self._$parent[0]); } self._setInter(); phase2(); }, phase2=function(){ var scrollTop=window.pageYOffset, scrollLeft=window.pageXOffset, docHeight=document.documentElement.scrollHeight; self._getInterMixData(); self._setFinal(); self._getFinalMixData(); (window.pageYOffset!==scrollTop)&&window.scrollTo(scrollLeft, scrollTop); self._prepTargets(); if(window.requestAnimationFrame){ requestAnimationFrame(phase3); }else{ setTimeout(function(){ phase3(); },20); }}, phase3=function(){ self._animateTargets(); if(self._targetsBound===0){ self._cleanUp(); }}, chromeFix=function(grid){ var parent=grid.parentElement, placeholder=document.createElement('div'), frag=document.createDocumentFragment(); parent.insertBefore(placeholder, grid); frag.appendChild(grid); parent.replaceChild(grid, placeholder); }, futureState=self._buildState(true); self._execAction('_goMix', 0, arguments); !self.animation.duration&&(animate=false); self._mixing=true; self._$container.removeClass(self.layout.containerClassFail); if(typeof self.callbacks.onMixStart==='function'){ self.callbacks.onMixStart.call(self._domNode, self._state, futureState, self); } self._$container.trigger('mixStart', [self._state, futureState, self]); self._getOrigMixData(); if(animate&&!self._suckMode){ window.requestAnimationFrame ? requestAnimationFrame(phase1) : phase1(); }else{ self._cleanUp(); } self._execAction('_goMix', 1, arguments); }, _getTargetData: function(el, stage){ var self=this, elStyle; el.dataset[stage+'PosX']=el.offsetLeft; el.dataset[stage+'PosY']=el.offsetTop; if(self.animation.animateResizeTargets){ elStyle=window.getComputedStyle(el); el.dataset[stage+'MarginBottom']=parseInt(elStyle.marginBottom); el.dataset[stage+'MarginRight']=parseInt(elStyle.marginRight); el.dataset[stage+'Width']=el.offsetWidth; el.dataset[stage+'Height']=el.offsetHeight; }}, _getOrigMixData: function(){ var self=this, parentStyle = !self._suckMode ? window.getComputedStyle(self._$parent[0]):{boxSizing: ''}, parentBS=parentStyle.boxSizing||parentStyle[self._vendor+'BoxSizing']; self._incPadding=(parentBS==='border-box'); self._execAction('_getOrigMixData', 0); !self._suckMode&&(self.effects=self._parseEffects()); self._$toHide=self._$hide.filter(':visible'); self._$toShow=self._$show.filter(':hidden'); self._$pre=self._$targets.filter(':visible'); self._startHeight=self._incPadding ? self._$parent.outerHeight() : self._$parent.height(); for(var i=0; i < self._$pre.length; i++){ var el=self._$pre[i]; self._getTargetData(el, 'orig'); } self._execAction('_getOrigMixData', 1); }, _setInter: function(){ var self=this; self._execAction('_setInter', 0); if(self._changingLayout&&self.animation.animateChangeLayout){ self._$toShow.css('display',self._newDisplay); if(self._changingClass){ self._$container .removeClass(self.layout.containerClass) .addClass(self._newClass); }}else{ self._$toShow.css('display', self.layout.display); } self._execAction('_setInter', 1); }, _getInterMixData: function(){ var self=this; self._execAction('_getInterMixData', 0); for(var i=0; i < self._$toShow.length; i++){ var el=self._$toShow[i]; self._getTargetData(el, 'inter'); } for(var i=0; i < self._$pre.length; i++){ var el=self._$pre[i]; self._getTargetData(el, 'inter'); } self._execAction('_getInterMixData', 1); }, _setFinal: function(){ var self=this; self._execAction('_setFinal', 0); self._sorting&&self._printSort(); self._$toHide.removeStyle('display'); if(self._changingLayout&&self.animation.animateChangeLayout){ self._$pre.css('display',self._newDisplay); } self._execAction('_setFinal', 1); }, _getFinalMixData: function(){ var self=this; self._execAction('_getFinalMixData', 0); for(var i=0; i < self._$toShow.length; i++){ var el=self._$toShow[i]; self._getTargetData(el, 'final'); } for(var i=0; i < self._$pre.length; i++){ var el=self._$pre[i]; self._getTargetData(el, 'final'); } self._newHeight=self._incPadding ? self._$parent.outerHeight() : self._$parent.height(); self._sorting&&self._printSort(true); self._$toShow.removeStyle('display'); self._$pre.css('display',self.layout.display); if(self._changingClass&&self.animation.animateChangeLayout){ self._$container .removeClass(self._newClass) .addClass(self.layout.containerClass); } self._execAction('_getFinalMixData', 1); }, _prepTargets: function(){ var self=this, transformCSS={ _in: self._getPrefixedCSS('transform', self.effects.transformIn), _out: self._getPrefixedCSS('transform', self.effects.transformOut) }; self._execAction('_prepTargets', 0); if(self.animation.animateResizeContainer){ self._$parent.css('height',self._startHeight+'px'); } for(var i=0; i < self._$toShow.length; i++){ var el=self._$toShow[i], $el=$(el); el.style.opacity=self.effects.opacity; el.style.display=(self._changingLayout&&self.animation.animateChangeLayout) ? self._newDisplay : self.layout.display; $el.css(transformCSS._in); if(self.animation.animateResizeTargets){ el.style.width=el.dataset.finalWidth+'px'; el.style.height=el.dataset.finalHeight+'px'; el.style.marginRight=-(el.dataset.finalWidth - el.dataset.interWidth) + (el.dataset.finalMarginRight * 1)+'px'; el.style.marginBottom=-(el.dataset.finalHeight - el.dataset.interHeight) + (el.dataset.finalMarginBottom * 1)+'px'; }} for(var i=0; i < self._$pre.length; i++){ var el=self._$pre[i], $el=$(el), translate={ x: el.dataset.origPosX - el.dataset.interPosX, y: el.dataset.origPosY - el.dataset.interPosY }, transformCSS=self._getPrefixedCSS('transform','translate('+translate.x+'px,'+translate.y+'px)'); $el.css(transformCSS); if(self.animation.animateResizeTargets){ el.style.width=el.dataset.origWidth+'px'; el.style.height=el.dataset.origHeight+'px'; if(el.dataset.origWidth - el.dataset.finalWidth){ el.style.marginRight=-(el.dataset.origWidth - el.dataset.interWidth) + (el.dataset.origMarginRight * 1)+'px'; } if(el.dataset.origHeight - el.dataset.finalHeight){ el.style.marginBottom=-(el.dataset.origHeight - el.dataset.interHeight) + (el.dataset.origMarginBottom * 1) +'px'; }} } self._execAction('_prepTargets', 1); }, _animateTargets: function(){ var self=this; self._execAction('_animateTargets', 0); self._targetsDone=0; self._targetsBound=0; self._$parent .css(self._getPrefixedCSS('perspective', self.animation.perspectiveDistance+'px')) .css(self._getPrefixedCSS('perspective-origin', self.animation.perspectiveOrigin)); if(self.animation.animateResizeContainer){ self._$parent .css(self._getPrefixedCSS('transition','height '+self.animation.duration+'ms ease')) .css('height',self._newHeight+'px'); } for(var i=0; i < self._$toShow.length; i++){ var el=self._$toShow[i], $el=$(el), translate={ x: el.dataset.finalPosX - el.dataset.interPosX, y: el.dataset.finalPosY - el.dataset.interPosY }, delay=self._getDelay(i), toShowCSS={}; el.style.opacity=''; for(var j=0; j < 2; j++){ var a=j===0 ? a=self._prefix:''; if(self._ff&&self._ff <=20){ toShowCSS[a+'transition-property']='all'; toShowCSS[a+'transition-timing-function']=self.animation.easing+'ms'; toShowCSS[a+'transition-duration']=self.animation.duration+'ms'; } toShowCSS[a+'transition-delay']=delay+'ms'; toShowCSS[a+'transform']='translate('+translate.x+'px,'+translate.y+'px)'; } if(self.effects.transform||self.effects.opacity){ self._bindTargetDone($el); } (self._ff&&self._ff <=20) ? $el.css(toShowCSS) : $el.css(self.effects.transition).css(toShowCSS); } for(var i=0; i < self._$pre.length; i++){ var el=self._$pre[i], $el=$(el), translate={ x: el.dataset.finalPosX - el.dataset.interPosX, y: el.dataset.finalPosY - el.dataset.interPosY }, delay=self._getDelay(i); if(!( el.dataset.finalPosX===el.dataset.origPosX && el.dataset.finalPosY===el.dataset.origPosY )){ self._bindTargetDone($el); } $el.css(self._getPrefixedCSS('transition', 'all '+self.animation.duration+'ms '+self.animation.easing+' '+delay+'ms')); $el.css(self._getPrefixedCSS('transform', 'translate('+translate.x+'px,'+translate.y+'px)')); if(self.animation.animateResizeTargets){ if(el.dataset.origWidth - el.dataset.finalWidth&&el.dataset.finalWidth * 1){ el.style.width=el.dataset.finalWidth+'px'; el.style.marginRight=-(el.dataset.finalWidth - el.dataset.interWidth)+(el.dataset.finalMarginRight * 1)+'px'; } if(el.dataset.origHeight - el.dataset.finalHeight&&el.dataset.finalHeight * 1){ el.style.height=el.dataset.finalHeight+'px'; el.style.marginBottom=-(el.dataset.finalHeight - el.dataset.interHeight)+(el.dataset.finalMarginBottom * 1) +'px'; }} } if(self._changingClass){ self._$container .removeClass(self.layout.containerClass) .addClass(self._newClass); } for(var i=0; i < self._$toHide.length; i++){ var el=self._$toHide[i], $el=$(el), delay=self._getDelay(i), toHideCSS={}; for(var j=0; j<2; j++){ var a=j===0 ? a=self._prefix:''; toHideCSS[a+'transition-delay']=delay+'ms'; toHideCSS[a+'transform']=self.effects.transformOut; toHideCSS.opacity=self.effects.opacity; } $el.css(self.effects.transition).css(toHideCSS); if(self.effects.transform||self.effects.opacity){ self._bindTargetDone($el); };} self._execAction('_animateTargets', 1); }, _bindTargetDone: function($el){ var self=this, el=$el[0]; self._execAction('_bindTargetDone', 0, arguments); if(!el.dataset.bound){ el.dataset.bound=true; self._targetsBound++; $el.on('webkitTransitionEnd.mixItUp transitionend.mixItUp',function(e){ if((e.originalEvent.propertyName.indexOf('transform') > -1 || e.originalEvent.propertyName.indexOf('opacity') > -1) && $(e.originalEvent.target).is(self.selectors.target) ){ $el.off('.mixItUp'); delete el.dataset.bound; self._targetDone(); }}); } self._execAction('_bindTargetDone', 1, arguments); }, _targetDone: function(){ var self=this; self._execAction('_targetDone', 0); self._targetsDone++; (self._targetsDone===self._targetsBound)&&self._cleanUp(); self._execAction('_targetDone', 1); }, _cleanUp: function(){ var self=this, targetStyles=self.animation.animateResizeTargets ? 'transform opacity width height margin-bottom margin-right':'transform opacity'; unBrake=function(){ self._$targets.removeStyle('transition', self._prefix); }; self._execAction('_cleanUp', 0); !self._changingLayout ? self._$show.css('display',self.layout.display) : self._$show.css('display',self._newDisplay); self._$targets.css(self._brake); self._$targets .removeStyle(targetStyles, self._prefix) .removeAttr('data-inter-pos-x data-inter-pos-y data-final-pos-x data-final-pos-y data-orig-pos-x data-orig-pos-y data-orig-height data-orig-width data-final-height data-final-width data-inter-width data-inter-height data-orig-margin-right data-orig-margin-bottom data-inter-margin-right data-inter-margin-bottom data-final-margin-right data-final-margin-bottom'); self._$hide.removeStyle('display'); self._$parent.removeStyle('height transition perspective-distance perspective perspective-origin-x perspective-origin-y perspective-origin perspectiveOrigin', self._prefix); if(self._sorting){ self._printSort(); self._activeSort=self._newSortString; self._sorting=false; } if(self._changingLayout){ if(self._changingDisplay){ self.layout.display=self._newDisplay; self._changingDisplay=false; } if(self._changingClass){ self._$parent.removeClass(self.layout.containerClass).addClass(self._newClass); self.layout.containerClass=self._newClass; self._changingClass=false; } self._changingLayout=false; } self._refresh(); self._buildState(); if(self._state.fail){ self._$container.addClass(self.layout.containerClassFail); } self._$show=$(); self._$hide=$(); if(window.requestAnimationFrame){ requestAnimationFrame(unBrake); } self._mixing=false; if(typeof self.callbacks._user==='function'){ self.callbacks._user.call(self._domNode, self._state, self); } if(typeof self.callbacks.onMixEnd==='function'){ self.callbacks.onMixEnd.call(self._domNode, self._state, self); } self._$container.trigger('mixEnd', [self._state, self]); if(self._state.fail){ (typeof self.callbacks.onMixFail==='function')&&self.callbacks.onMixFail.call(self._domNode, self._state, self); self._$container.trigger('mixFail', [self._state, self]); } if(self._loading){ (typeof self.callbacks.onMixLoad==='function')&&self.callbacks.onMixLoad.call(self._domNode, self._state, self); self._$container.trigger('mixLoad', [self._state, self]); } if(self._queue.length){ self._execAction('_queue', 0); self.multiMix(self._queue[0][0],self._queue[0][1],self._queue[0][2]); self._queue.splice(0, 1); } self._execAction('_cleanUp', 1); self._loading=false; }, _getPrefixedCSS: function(property, value, prefixValue){ var self=this, styles={}; for(i=0; i < 2; i++){ var prefix=i===0 ? self._prefix:''; prefixValue ? styles[prefix+property]=prefix+value:styles[prefix+property]=value; } return self._execFilter('_getPrefixedCSS', styles, arguments); }, _getDelay: function(i){ var self=this, n=typeof self.animation.staggerSequence==='function' ? self.animation.staggerSequence.call(self._domNode, i, self._state):i, delay=self.animation.stagger ? n * self.animation.staggerDuration:0; return self._execFilter('_getDelay', delay, arguments); }, _parseMultiMixArgs: function(args){ var self=this, output={ command: null, animate: self.animation.enable, callback: null }; for(var i=0; i < args.length; i++){ var arg=args[i]; if(arg!==null){ if(typeof arg==='object'||typeof arg==='string'){ output.command=arg; }else if(typeof arg==='boolean'){ output.animate=arg; }else if(typeof arg==='function'){ output.callback=arg; }} } return self._execFilter('_parseMultiMixArgs', output, arguments); }, _parseInsertArgs: function(args){ var self=this, output={ index: 0, $object: $(), multiMix: {filter: self._state.activeFilter}, callback: null }; for(var i=0; i < args.length; i++){ var arg=args[i]; if(typeof arg==='number'){ output.index=arg; }else if(typeof arg==='object'&&arg instanceof $){ output.$object=arg; }else if(typeof arg==='object'&&self._helpers._isElement(arg)){ output.$object=$(arg); }else if(typeof arg==='object'&&arg!==null){ output.multiMix=arg; }else if(typeof arg==='boolean'&&!arg){ output.multiMix=false; }else if(typeof arg==='function'){ output.callback=arg; }} return self._execFilter('_parseInsertArgs', output, arguments); }, _execAction: function(methodName, isPost, args){ var self=this, context=isPost ? 'post':'pre'; if(!self._actions.isEmptyObject&&self._actions.hasOwnProperty(methodName)){ for(var key in self._actions[methodName][context]){ self._actions[methodName][context][key].call(self, args); }} }, _execFilter: function(methodName, value, args){ var self=this; if(!self._filters.isEmptyObject&&self._filters.hasOwnProperty(methodName)){ for(var key in self._filters[methodName]){ return self._filters[methodName][key].call(self, args); }}else{ return value; }}, _helpers: { _camelCase: function(string){ return string.replace(/-([a-z])/g, function(g){ return g[1].toUpperCase(); }); }, _isElement: function(el){ if(window.HTMLElement){ return el instanceof HTMLElement; }else{ return ( el!==null && el.nodeType===1 && el.nodeName==='string' ); }} }, isMixing: function(){ var self=this; return self._execFilter('isMixing', self._mixing); }, filter: function(){ var self=this, args=self._parseMultiMixArgs(arguments); self._clicking&&(self._toggleString=''); self.multiMix({filter: args.command}, args.animate, args.callback); }, sort: function(){ var self=this, args=self._parseMultiMixArgs(arguments); self.multiMix({sort: args.command}, args.animate, args.callback); }, changeLayout: function(){ var self=this, args=self._parseMultiMixArgs(arguments); self.multiMix({changeLayout: args.command}, args.animate, args.callback); }, multiMix: function(){ var self=this, args=self._parseMultiMixArgs(arguments); self._execAction('multiMix', 0, arguments); if(!self._mixing){ if(self.controls.enable&&!self._clicking){ self.controls.toggleFilterButtons&&self._buildToggleArray(); self._updateControls(args.command, self.controls.toggleFilterButtons); } (self._queue.length < 2)&&(self._clicking=false); delete self.callbacks._user; if(args.callback) self.callbacks._user=args.callback; var sort=args.command.sort, filter=args.command.filter, changeLayout=args.command.changeLayout; self._refresh(); if(sort){ self._newSort=self._parseSort(sort); self._newSortString=sort; self._sorting=true; self._sort(); } if(filter!==undf){ filter=(filter==='all') ? self.selectors.target:filter; self._activeFilter=filter; } self._filter(); if(changeLayout){ self._newDisplay=(typeof changeLayout==='string') ? changeLayout:changeLayout.display||self.layout.display; self._newClass=changeLayout.containerClass||''; if(self._newDisplay!==self.layout.display || self._newClass!==self.layout.containerClass ){ self._changingLayout=true; self._changingClass=(self._newClass!==self.layout.containerClass); self._changingDisplay=(self._newDisplay!==self.layout.display); }} self._$targets.css(self._brake); self._goMix(args.animate ^ self.animation.enable ? args.animate:self.animation.enable); self._execAction('multiMix', 1, arguments); }else{ if(self.animation.queue&&self._queue.length < self.animation.queueLimit){ self._queue.push(arguments); (self.controls.enable&&!self._clicking)&&self._updateControls(args.command); self._execAction('multiMixQueue', 1, arguments); }else{ if(typeof self.callbacks.onMixBusy==='function'){ self.callbacks.onMixBusy.call(self._domNode, self._state, self); } self._$container.trigger('mixBusy', [self._state, self]); self._execAction('multiMixBusy', 1, arguments); }} }, insert: function(){ var self=this, args=self._parseInsertArgs(arguments), callback=(typeof args.callback==='function') ? args.callback:null, frag=document.createDocumentFragment(), target=(function(){ self._refresh(); if(self._$targets.length){ return (args.index < self._$targets.length||!self._$targets.length) ? self._$targets[args.index] : self._$targets[self._$targets.length-1].nextElementSibling; }else{ return self._$parent[0].children[0]; }})(); self._execAction('insert', 0, arguments); if(args.$object){ for(var i=0; i < args.$object.length; i++){ var el=args.$object[i]; frag.appendChild(el); frag.appendChild(document.createTextNode(' ')); } self._$parent[0].insertBefore(frag, target); } self._execAction('insert', 1, arguments); if(typeof args.multiMix==='object'){ self.multiMix(args.multiMix, callback); }}, prepend: function(){ var self=this, args=self._parseInsertArgs(arguments); self.insert(0, args.$object, args.multiMix, args.callback); }, append: function(){ var self=this, args=self._parseInsertArgs(arguments); self.insert(self._state.totalTargets, args.$object, args.multiMix, args.callback); }, getOption: function(string){ var self=this, getProperty=function(obj, prop){ var parts=prop.split('.'), last=parts.pop(), l=parts.length, i=1, current=parts[0]||prop; while((obj=obj[current])&&i < l){ current=parts[i]; i++; } if(obj!==undf){ return obj[last]!==undf ? obj[last]:obj; }}; return string ? self._execFilter('getOption', getProperty(self, string), arguments):self; }, setOptions: function(config){ var self=this; self._execAction('setOptions', 0, arguments); typeof config==='object'&&$.extend(true, self, config); self._execAction('setOptions', 1, arguments); }, getState: function(){ var self=this; return self._execFilter('getState', self._state, self); }, forceRefresh: function(){ var self=this; self._refresh(false, true); }, destroy: function(hideAll){ var self=this; self._execAction('destroy', 0, arguments); self._$body .add($(self.selectors.sort)) .add($(self.selectors.filter)) .off('.mixItUp'); for(var i=0; i < self._$targets.length; i++){ var target=self._$targets[i]; hideAll&&(target.style.display=''); delete target.mixParent; } self._execAction('destroy', 1, arguments); delete $.MixItUp.prototype._instances[self._id]; }}; $.fn.mixItUp=function(){ var args=arguments, dataReturn=[], eachReturn, _instantiate=function(domNode, settings){ var instance=new $.MixItUp(), rand=function(){ return ('00000'+(Math.random()*16777216<<0).toString(16)).substr(-6).toUpperCase(); }; instance._execAction('_instantiate', 0, arguments); domNode.id = !domNode.id ? 'MixItUp'+rand ():domNode.id; if(!instance._instances[domNode.id]){ instance._instances[domNode.id]=instance; instance._init(domNode, settings); } instance._execAction('_instantiate', 1, arguments); }; eachReturn=this.each(function(){ if(args&&typeof args[0]==='string'){ var instance=$.MixItUp.prototype._instances[this.id]; if(args[0]==='isLoaded'){ dataReturn.push(instance ? true:false); }else{ var data=instance[args[0]](args[1], args[2], args[3]); if(data!==undf)dataReturn.push(data); }}else{ _instantiate(this, args[0]); }}); if(dataReturn.length){ return dataReturn.length > 1 ? dataReturn:dataReturn[0]; }else{ return eachReturn; }}; $.fn.removeStyle=function(style, prefix){ prefix=prefix ? prefix:''; return this.each(function(){ var el=this, styles=style.split(' '); for(var i=0; i < styles.length; i++){ for(var j=0; j < 4; j++){ switch (j){ case 0: var prop=styles[i]; break; case 1: var prop=$.MixItUp.prototype._helpers._camelCase(prop); break; case 2: var prop=prefix+styles[i]; break; case 3: var prop=$.MixItUp.prototype._helpers._camelCase(prefix+styles[i]); } if(el.style[prop]!==undf && typeof el.style[prop]!=='unknown' && el.style[prop].length > 0 ){ el.style[prop]=''; } if(!prefix&&j===1)break; }} if(el.attributes&&el.attributes.style&&el.attributes.style!==undf&&el.attributes.style.value===''){ el.attributes.removeNamedItem('style'); }}); };})(jQuery); (function(){var t=[].indexOf||function(t){for(var e=0,n=this.length;e=0;s={horizontal:{},vertical:{}};f=1;c={};u="waypoints-context-id";p="resize.waypoints";y="scroll.waypoints";v=1;w="waypoints-waypoint-ids";g="waypoint";m="waypoints";o=function(){function t(t){var e=this;this.$element=t;this.element=t[0];this.didResize=false;this.didScroll=false;this.id="context"+f++;this.oldScroll={x:t.scrollLeft(),y:t.scrollTop()};this.waypoints={horizontal:{},vertical:{}};this.element[u]=this.id;c[this.id]=this;t.bind(y,function(){var t;if(!(e.didScroll||a)){e.didScroll=true;t=function(){e.doScroll();return e.didScroll=false};return r.setTimeout(t,n[m].settings.scrollThrottle)}});t.bind(p,function(){var t;if(!e.didResize){e.didResize=true;t=function(){n[m]("refresh");return e.didResize=false};return r.setTimeout(t,n[m].settings.resizeThrottle)}})}t.prototype.doScroll=function(){var t,e=this;t={horizontal:{newScroll:this.$element.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.$element.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};if(a&&(!t.vertical.oldScroll||!t.vertical.newScroll)){n[m]("refresh")}n.each(t,function(t,r){var i,o,l;l=[];o=r.newScroll>r.oldScroll;i=o?r.forward:r.backward;n.each(e.waypoints[t],function(t,e){var n,i;if(r.oldScroll<(n=e.offset)&&n<=r.newScroll){return l.push(e)}else if(r.newScroll<(i=e.offset)&&i<=r.oldScroll){return l.push(e)}});l.sort(function(t,e){return t.offset-e.offset});if(!o){l.reverse()}return n.each(l,function(t,e){if(e.options.continuous||t===l.length-1){return e.trigger([i])}})});return this.oldScroll={x:t.horizontal.newScroll,y:t.vertical.newScroll}};t.prototype.refresh=function(){var t,e,r,i=this;r=n.isWindow(this.element);e=this.$element.offset();this.doScroll();t={horizontal:{contextOffset:r?0:e.left,contextScroll:r?0:this.oldScroll.x,contextDimension:this.$element.width(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:r?0:e.top,contextScroll:r?0:this.oldScroll.y,contextDimension:r?n[m]("viewportHeight"):this.$element.height(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}};return n.each(t,function(t,e){return n.each(i.waypoints[t],function(t,r){var i,o,l,s,f;i=r.options.offset;l=r.offset;o=n.isWindow(r.element)?0:r.$element.offset()[e.offsetProp];if(n.isFunction(i)){i=i.apply(r.element)}else if(typeof i==="string"){i=parseFloat(i);if(r.options.offset.indexOf("%")>-1){i=Math.ceil(e.contextDimension*i/100)}}r.offset=o-e.contextOffset+e.contextScroll-i;if(r.options.onlyOnScroll&&l!=null||!r.enabled){return}if(l!==null&&l<(s=e.oldScroll)&&s<=r.offset){return r.trigger([e.backward])}else if(l!==null&&l>(f=e.oldScroll)&&f>=r.offset){return r.trigger([e.forward])}else if(l===null&&e.oldScroll>=r.offset){return r.trigger([e.forward])}})})};t.prototype.checkEmpty=function(){if(n.isEmptyObject(this.waypoints.horizontal)&&n.isEmptyObject(this.waypoints.vertical)){this.$element.unbind([p,y].join(" "));return delete c[this.id]}};return t}();l=function(){function t(t,e,r){var i,o;r=n.extend({},n.fn[g].defaults,r);if(r.offset==="bottom-in-view"){r.offset=function(){var t;t=n[m]("viewportHeight");if(!n.isWindow(e.element)){t=e.$element.height()}return t-n(this).outerHeight()}}this.$element=t;this.element=t[0];this.axis=r.horizontal?"horizontal":"vertical";this.callback=r.handler;this.context=e;this.enabled=r.enabled;this.id="waypoints"+v++;this.offset=null;this.options=r;e.waypoints[this.axis][this.id]=this;s[this.axis][this.id]=this;i=(o=this.element[w])!=null?o:[];i.push(this.id);this.element[w]=i}t.prototype.trigger=function(t){if(!this.enabled){return}if(this.callback!=null){this.callback.apply(this.element,t)}if(this.options.triggerOnce){return this.destroy()}};t.prototype.disable=function(){return this.enabled=false};t.prototype.enable=function(){this.context.refresh();return this.enabled=true};t.prototype.destroy=function(){delete s[this.axis][this.id];delete this.context.waypoints[this.axis][this.id];return this.context.checkEmpty()};t.getWaypointsByElement=function(t){var e,r;r=t[w];if(!r){return[]}e=n.extend({},s.horizontal,s.vertical);return n.map(r,function(t){return e[t]})};return t}();d={init:function(t,e){var r;if(e==null){e={}}if((r=e.handler)==null){e.handler=t}this.each(function(){var t,r,i,s;t=n(this);i=(s=e.context)!=null?s:n.fn[g].defaults.context;if(!n.isWindow(i)){i=t.closest(i)}i=n(i);r=c[i[0][u]];if(!r){r=new o(i)}return new l(t,r,e)});n[m]("refresh");return this},disable:function(){return d._invoke.call(this,"disable")},enable:function(){return d._invoke.call(this,"enable")},destroy:function(){return d._invoke.call(this,"destroy")},prev:function(t,e){return d._traverse.call(this,t,e,function(t,e,n){if(e>0){return t.push(n[e-1])}})},next:function(t,e){return d._traverse.call(this,t,e,function(t,e,n){if(et.oldScroll.y})},left:function(t){if(t==null){t=r}return h._filter(t,"horizontal",function(t,e){return e.offset<=t.oldScroll.x})},right:function(t){if(t==null){t=r}return h._filter(t,"horizontal",function(t,e){return e.offset>t.oldScroll.x})},enable:function(){return h._invoke("enable")},disable:function(){return h._invoke("disable")},destroy:function(){return h._invoke("destroy")},extendFn:function(t,e){return d[t]=e},_invoke:function(t){var e;e=n.extend({},s.vertical,s.horizontal);return n.each(e,function(e,n){n[t]();return true})},_filter:function(t,e,r){var i,o;i=c[n(t)[0][u]];if(!i){return[]}o=[];n.each(i.waypoints[e],function(t,e){if(r(i,e)){return o.push(e)}});o.sort(function(t,e){return t.offset-e.offset});return n.map(o,function(t){return t.element})}};n[m]=function(){var t,n;n=arguments[0],t=2<=arguments.length?e.call(arguments,1):[];if(h[n]){return h[n].apply(null,t)}else{return h.aggregate.call(null,n)}};n[m].settings={resizeThrottle:100,scrollThrottle:30};return i.load(function(){return n[m]("refresh")})})}).call(this); (function(e,t,n,r){function d(t,n){this.element=t,this.options=e.extend({},s,n),this._defaults=s,this._name=i,this.init()}var i="stellar",s={scrollProperty:"scroll",positionProperty:"position",horizontalScrolling:!0,verticalScrolling:!0,horizontalOffset:0,verticalOffset:0,responsive:!1,parallaxBackgrounds:!0,parallaxElements:!0,hideDistantElements:!0,hideElement:function(e){e.hide()},showElement:function(e){e.show()}},o={scroll:{getLeft:function(e){return e.scrollLeft()},setLeft:function(e,t){e.scrollLeft(t)},getTop:function(e){return e.scrollTop()},setTop:function(e,t){e.scrollTop(t)}},position:{getLeft:function(e){return parseInt(e.css("left"),10)*-1},getTop:function(e){return parseInt(e.css("top"),10)*-1}},margin:{getLeft:function(e){return parseInt(e.css("margin-left"),10)*-1},getTop:function(e){return parseInt(e.css("margin-top"),10)*-1}},transform:{getLeft:function(e){var t=getComputedStyle(e[0])[f];return t!=="none"?parseInt(t.match(/(-?[0-9]+)/g)[4],10)*-1:0},getTop:function(e){var t=getComputedStyle(e[0])[f];return t!=="none"?parseInt(t.match(/(-?[0-9]+)/g)[5],10)*-1:0}}},u={position:{setLeft:function(e,t){e.css("left",t)},setTop:function(e,t){e.css("top",t)}},transform:{setPosition:function(e,t,n,r,i){e[0].style[f]="translate3d("+(t-n)+"px, "+(r-i)+"px, 0)"}}},a=function(){var t=/^(Moz|Webkit|Khtml|O|ms|Icab)(?=[A-Z])/,n=e("script")[0].style,r="",i;for(i in n)if(t.test(i)){r=i.match(t)[0];break}return"WebkitOpacity"in n&&(r="Webkit"),"KhtmlOpacity"in n&&(r="Khtml"),function(e){return r+(r.length>0?e.charAt(0).toUpperCase()+e.slice(1):e)}}(),f=a("transform"),l=e("
    ",{style:"background:#fff"}).css("background-position-x")!==r,c=l?function(e,t,n){e.css({"background-position-x":t,"background-position-y":n})}:function(e,t,n){e.css("background-position",t+" "+n)},h=l?function(e){return[e.css("background-position-x"),e.css("background-position-y")]}:function(e){return e.css("background-position").split(" ")},p=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,1e3/60)};d.prototype={init:function(){this.options.name=i+"_"+Math.floor(Math.random()*1e9),this._defineElements(),this._defineGetters(),this._defineSetters(),this._handleWindowLoadAndResize(),this._detectViewport(),this.refresh({firstLoad:!0}),this.options.scrollProperty==="scroll"?this._handleScrollEvent():this._startAnimationLoop()},_defineElements:function(){this.element===n.body&&(this.element=t),this.$scrollElement=e(this.element),this.$element=this.element===t?e("body"):this.$scrollElement,this.$viewportElement=this.options.viewportElement!==r?e(this.options.viewportElement):this.$scrollElement[0]===t||this.options.scrollProperty==="scroll"?this.$scrollElement:this.$scrollElement.parent()},_defineGetters:function(){var e=this,t=o[e.options.scrollProperty];this._getScrollLeft=function(){return t.getLeft(e.$scrollElement)},this._getScrollTop=function(){return t.getTop(e.$scrollElement)}},_defineSetters:function(){var t=this,n=o[t.options.scrollProperty],r=u[t.options.positionProperty],i=n.setLeft,s=n.setTop;this._setScrollLeft=typeof i=="function"?function(e){i(t.$scrollElement,e)}:e.noop,this._setScrollTop=typeof s=="function"?function(e){s(t.$scrollElement,e)}:e.noop,this._setPosition=r.setPosition||function(e,n,i,s,o){t.options.horizontalScrolling&&r.setLeft(e,n,i),t.options.verticalScrolling&&r.setTop(e,s,o)}},_handleWindowLoadAndResize:function(){var n=this,r=e(t);n.options.responsive&&r.bind("load."+this.name,function(){n.refresh()}),r.bind("resize."+this.name,function(){n._detectViewport(),n.options.responsive&&n.refresh()})},refresh:function(n){var r=this,i=r._getScrollLeft(),s=r._getScrollTop();(!n||!n.firstLoad)&&this._reset(),this._setScrollLeft(0),this._setScrollTop(0),this._setOffsets(),this._findParticles(),this._findBackgrounds(),n&&n.firstLoad&&/WebKit/.test(navigator.userAgent)&&e(t).load(function(){var e=r._getScrollLeft(),t=r._getScrollTop();r._setScrollLeft(e+1),r._setScrollTop(t+1),r._setScrollLeft(e),r._setScrollTop(t)}),this._setScrollLeft(i),this._setScrollTop(s)},_detectViewport:function(){var e=this.$viewportElement.offset(),t=e!==null&&e!==r;this.viewportWidth=this.$viewportElement.width(),this.viewportHeight=this.$viewportElement.height(),this.viewportOffsetTop=t?e.top:0,this.viewportOffsetLeft=t?e.left:0},_findParticles:function(){var t=this,n=this._getScrollLeft(),i=this._getScrollTop();if(this.particles!==r)for(var s=this.particles.length-1;s>=0;s--)this.particles[s].$element.data("stellar-elementIsActive",r);this.particles=[];if(!this.options.parallaxElements)return;this.$element.find("[data-stellar-ratio]").each(function(n){var i=e(this),s,o,u,a,f,l,c,h,p,d=0,v=0,m=0,g=0;if(!i.data("stellar-elementIsActive"))i.data("stellar-elementIsActive",this);else if(i.data("stellar-elementIsActive")!==this)return;t.options.showElement(i),i.data("stellar-startingLeft")?(i.css("left",i.data("stellar-startingLeft")),i.css("top",i.data("stellar-startingTop"))):(i.data("stellar-startingLeft",i.css("left")),i.data("stellar-startingTop",i.css("top"))),u=i.position().left,a=i.position().top,f=i.css("margin-left")==="auto"?0:parseInt(i.css("margin-left"),10),l=i.css("margin-top")==="auto"?0:parseInt(i.css("margin-top"),10),h=i.offset().left-f,p=i.offset().top-l,i.parents().each(function(){var t=e(this);if(t.data("stellar-offset-parent")===!0)return d=m,v=g,c=t,!1;m+=t.position().left,g+=t.position().top}),s=i.data("stellar-horizontal-offset")!==r?i.data("stellar-horizontal-offset"):c!==r&&c.data("stellar-horizontal-offset")!==r?c.data("stellar-horizontal-offset"):t.horizontalOffset,o=i.data("stellar-vertical-offset")!==r?i.data("stellar-vertical-offset"):c!==r&&c.data("stellar-vertical-offset")!==r?c.data("stellar-vertical-offset"):t.verticalOffset,t.particles.push({$element:i,$offsetParent:c,isFixed:i.css("position")==="fixed",horizontalOffset:s,verticalOffset:o,startingPositionLeft:u,startingPositionTop:a,startingOffsetLeft:h,startingOffsetTop:p,parentOffsetLeft:d,parentOffsetTop:v,stellarRatio:i.data("stellar-ratio")!==r?i.data("stellar-ratio"):1,width:i.outerWidth(!0),height:i.outerHeight(!0),isHidden:!1})})},_findBackgrounds:function(){var t=this,n=this._getScrollLeft(),i=this._getScrollTop(),s;this.backgrounds=[];if(!this.options.parallaxBackgrounds)return;s=this.$element.find("[data-stellar-background-ratio]"),this.$element.data("stellar-background-ratio")&&(s=s.add(this.$element)),s.each(function(){var s=e(this),o=h(s),u,a,f,l,p,d,v,m,g,y=0,b=0,w=0,E=0;if(!s.data("stellar-backgroundIsActive"))s.data("stellar-backgroundIsActive",this);else if(s.data("stellar-backgroundIsActive")!==this)return;s.data("stellar-backgroundStartingLeft")?c(s,s.data("stellar-backgroundStartingLeft"),s.data("stellar-backgroundStartingTop")):(s.data("stellar-backgroundStartingLeft",o[0]),s.data("stellar-backgroundStartingTop",o[1])),p=s.css("margin-left")==="auto"?0:parseInt(s.css("margin-left"),10),d=s.css("margin-top")==="auto"?0:parseInt(s.css("margin-top"),10),v=s.offset().left-p-n,m=s.offset().top-d-i,s.parents().each(function(){var t=e(this);if(t.data("stellar-offset-parent")===!0)return y=w,b=E,g=t,!1;w+=t.position().left,E+=t.position().top}),u=s.data("stellar-horizontal-offset")!==r?s.data("stellar-horizontal-offset"):g!==r&&g.data("stellar-horizontal-offset")!==r?g.data("stellar-horizontal-offset"):t.horizontalOffset,a=s.data("stellar-vertical-offset")!==r?s.data("stellar-vertical-offset"):g!==r&&g.data("stellar-vertical-offset")!==r?g.data("stellar-vertical-offset"):t.verticalOffset,t.backgrounds.push({$element:s,$offsetParent:g,isFixed:s.css("background-attachment")==="fixed",horizontalOffset:u,verticalOffset:a,startingValueLeft:o[0],startingValueTop:o[1],startingBackgroundPositionLeft:isNaN(parseInt(o[0],10))?0:parseInt(o[0],10),startingBackgroundPositionTop:isNaN(parseInt(o[1],10))?0:parseInt(o[1],10),startingPositionLeft:s.position().left,startingPositionTop:s.position().top,startingOffsetLeft:v,startingOffsetTop:m,parentOffsetLeft:y,parentOffsetTop:b,stellarRatio:s.data("stellar-background-ratio")===r?1:s.data("stellar-background-ratio")})})},_reset:function(){var e,t,n,r,i;for(i=this.particles.length-1;i>=0;i--)e=this.particles[i],t=e.$element.data("stellar-startingLeft"),n=e.$element.data("stellar-startingTop"),this._setPosition(e.$element,t,t,n,n),this.options.showElement(e.$element),e.$element.data("stellar-startingLeft",null).data("stellar-elementIsActive",null).data("stellar-backgroundIsActive",null);for(i=this.backgrounds.length-1;i>=0;i--)r=this.backgrounds[i],r.$element.data("stellar-backgroundStartingLeft",null).data("stellar-backgroundStartingTop",null),c(r.$element,r.startingValueLeft,r.startingValueTop)},destroy:function(){this._reset(),this.$scrollElement.unbind("resize."+this.name).unbind("scroll."+this.name),this._animationLoop=e.noop,e(t).unbind("load."+this.name).unbind("resize."+this.name)},_setOffsets:function(){var n=this,r=e(t);r.unbind("resize.horizontal-"+this.name).unbind("resize.vertical-"+this.name),typeof this.options.horizontalOffset=="function"?(this.horizontalOffset=this.options.horizontalOffset(),r.bind("resize.horizontal-"+this.name,function(){n.horizontalOffset=n.options.horizontalOffset()})):this.horizontalOffset=this.options.horizontalOffset,typeof this.options.verticalOffset=="function"?(this.verticalOffset=this.options.verticalOffset(),r.bind("resize.vertical-"+this.name,function(){n.verticalOffset=n.options.verticalOffset()})):this.verticalOffset=this.options.verticalOffset},_repositionElements:function(){var e=this._getScrollLeft(),t=this._getScrollTop(),n,r,i,s,o,u,a,f=!0,l=!0,h,p,d,v,m;if(this.currentScrollLeft===e&&this.currentScrollTop===t&&this.currentWidth===this.viewportWidth&&this.currentHeight===this.viewportHeight)return;this.currentScrollLeft=e,this.currentScrollTop=t,this.currentWidth=this.viewportWidth,this.currentHeight=this.viewportHeight;for(m=this.particles.length-1;m>=0;m--)i=this.particles[m],s=i.isFixed?1:0,this.options.horizontalScrolling?(h=(e+i.horizontalOffset+this.viewportOffsetLeft+i.startingPositionLeft-i.startingOffsetLeft+i.parentOffsetLeft)*-(i.stellarRatio+s-1)+i.startingPositionLeft,d=h-i.startingPositionLeft+i.startingOffsetLeft):(h=i.startingPositionLeft,d=i.startingOffsetLeft),this.options.verticalScrolling?(p=(t+i.verticalOffset+this.viewportOffsetTop+i.startingPositionTop-i.startingOffsetTop+i.parentOffsetTop)*-(i.stellarRatio+s-1)+i.startingPositionTop,v=p-i.startingPositionTop+i.startingOffsetTop):(p=i.startingPositionTop,v=i.startingOffsetTop),this.options.hideDistantElements&&(l=!this.options.horizontalScrolling||d+i.width>(i.isFixed?0:e)&&d<(i.isFixed?0:e)+this.viewportWidth+this.viewportOffsetLeft,f=!this.options.verticalScrolling||v+i.height>(i.isFixed?0:t)&&v<(i.isFixed?0:t)+this.viewportHeight+this.viewportOffsetTop),l&&f?(i.isHidden&&(this.options.showElement(i.$element),i.isHidden=!1),this._setPosition(i.$element,h,i.startingPositionLeft,p,i.startingPositionTop)):i.isHidden||(this.options.hideElement(i.$element),i.isHidden=!0);for(m=this.backgrounds.length-1;m>=0;m--)o=this.backgrounds[m],s=o.isFixed?0:1,u=this.options.horizontalScrolling?(e+o.horizontalOffset-this.viewportOffsetLeft-o.startingOffsetLeft+o.parentOffsetLeft-o.startingBackgroundPositionLeft)*(s-o.stellarRatio)+"px":o.startingValueLeft,a=this.options.verticalScrolling?(t+o.verticalOffset-this.viewportOffsetTop-o.startingOffsetTop+o.parentOffsetTop-o.startingBackgroundPositionTop)*(s-o.stellarRatio)+"px":o.startingValueTop,c(o.$element,u,a)},_handleScrollEvent:function(){var e=this,t=!1,n=function(){e._repositionElements(),t=!1},r=function(){t||(p(n),t=!0)};this.$scrollElement.bind("scroll."+this.name,r),r()},_startAnimationLoop:function(){var e=this;this._animationLoop=function(){p(e._animationLoop),e._repositionElements()},this._animationLoop()}},e.fn[i]=function(t){var n=arguments;if(t===r||typeof t=="object")return this.each(function(){e.data(this,"plugin_"+i)||e.data(this,"plugin_"+i,new d(this,t))});if(typeof t=="string"&&t[0]!=="_"&&t!=="init")return this.each(function(){var r=e.data(this,"plugin_"+i);r instanceof d&&typeof r[t]=="function"&&r[t].apply(r,Array.prototype.slice.call(n,1)),t==="destroy"&&e.data(this,"plugin_"+i,null)})},e[i]=function(n){var r=e(t);return r.stellar.apply(r,Array.prototype.slice.call(arguments,0))},e[i].scrollProperty=o,e[i].positionProperty=u,t.Stellar=d})(jQuery,this,document); var ytp=ytp||{}; function onYouTubePlayerAPIReady(){ if(ytp.YTAPIReady) return; ytp.YTAPIReady=true; jQuery(document).trigger("YTAPIReady"); } (function (jQuery, ytp){ var nAgt=navigator.userAgent; if(!jQuery.browser){ jQuery.browser={}; jQuery.browser.mozilla = !1; jQuery.browser.webkit = !1; jQuery.browser.opera = !1; jQuery.browser.safari = !1; jQuery.browser.chrome = !1; jQuery.browser.msie = !1; jQuery.browser.ua=nAgt; jQuery.browser.name=navigator.appName; jQuery.browser.fullVersion="" + parseFloat(navigator.appVersion); jQuery.browser.majorVersion=parseInt(navigator.appVersion, 10); var nameOffset, verOffset, ix; if(-1!=(verOffset=nAgt.indexOf("Opera")))jQuery.browser.opera = !0, jQuery.browser.name="Opera", jQuery.browser.fullVersion=nAgt.substring(verOffset + 6), -1!=(verOffset=nAgt.indexOf("Version"))&&(jQuery.browser.fullVersion=nAgt.substring(verOffset + 8)); else if(-1!=(verOffset=nAgt.indexOf("MSIE")))jQuery.browser.msie = !0, jQuery.browser.name="Microsoft Internet Explorer", jQuery.browser.fullVersion=nAgt.substring(verOffset + 5); else if(-1!=nAgt.indexOf("Trident")){ jQuery.browser.msie = !0; jQuery.browser.name="Microsoft Internet Explorer"; var start=nAgt.indexOf("rv:") + 3, end=start + 4; jQuery.browser.fullVersion=nAgt.substring(start, end) } else-1!=(verOffset=nAgt.indexOf("Chrome")) ? (jQuery.browser.webkit = !0, jQuery.browser.chrome = !0, jQuery.browser.name="Chrome", jQuery.browser.fullVersion=nAgt.substring(verOffset + 7)):-1!=(verOffset=nAgt.indexOf("Safari")) ? (jQuery.browser.webkit = !0, jQuery.browser.safari = !0, jQuery.browser.name="Safari", jQuery.browser.fullVersion=nAgt.substring(verOffset + 7), -1!=(verOffset=nAgt.indexOf("Version"))&&(jQuery.browser.fullVersion=nAgt.substring(verOffset + 8))):-1!=(verOffset=nAgt.indexOf("AppleWebkit")) ? (jQuery.browser.webkit = !0, jQuery.browser.name="Safari", jQuery.browser.fullVersion=nAgt.substring(verOffset + 7), -1!=(verOffset=nAgt.indexOf("Version"))&&(jQuery.browser.fullVersion=nAgt.substring(verOffset + 8))):-1!=(verOffset=nAgt.indexOf("Firefox")) ? (jQuery.browser.mozilla = !0, jQuery.browser.name="Firefox", jQuery.browser.fullVersion=nAgt.substring(verOffset + 8)):(nameOffset=nAgt.lastIndexOf(" ") + 1) < (verOffset=nAgt.lastIndexOf("/"))&&(jQuery.browser.name=nAgt.substring(nameOffset, verOffset), jQuery.browser.fullVersion=nAgt.substring(verOffset + 1), jQuery.browser.name.toLowerCase()==jQuery.browser.name.toUpperCase()&&(jQuery.browser.name=navigator.appName)); -1!=(ix=jQuery.browser.fullVersion.indexOf(";"))&&(jQuery.browser.fullVersion=jQuery.browser.fullVersion.substring(0, ix)); -1!=(ix=jQuery.browser.fullVersion.indexOf(" "))&&(jQuery.browser.fullVersion=jQuery.browser.fullVersion.substring(0, ix)); jQuery.browser.majorVersion=parseInt("" + jQuery.browser.fullVersion, 10); isNaN(jQuery.browser.majorVersion)&&(jQuery.browser.fullVersion="" + parseFloat(navigator.appVersion), jQuery.browser.majorVersion=parseInt(navigator.appVersion, 10)); jQuery.browser.version=jQuery.browser.majorVersion } jQuery.browser.android=/Android/i.test(nAgt); jQuery.browser.blackberry=/BlackBerry/i.test(nAgt); jQuery.browser.ios=/iPhone|iPad|iPod/i.test(nAgt); jQuery.browser.operaMobile=/Opera Mini/i.test(nAgt); jQuery.browser.windowsMobile=/IEMobile/i.test(nAgt); jQuery.browser.mobile=jQuery.browser.android||jQuery.browser.blackberry||jQuery.browser.ios||jQuery.browser.windowsMobile||jQuery.browser.operaMobile; ytp.isDevice=jQuery.browser.mobile; jQuery.fn.CSSAnimate=function(a,g,p,m,h){function r(a){return a.replace(/([A-Z])/g,function(a){return"-"+a.toLowerCase()})}function f(a,f){return"string"!==typeof a||a.match(/^[\-0-9\.]+$/)?""+a+f:a}jQuery.support.CSStransition=function(){var a=(document.body||document.documentElement).style;return void 0!==a.transition||void 0!==a.WebkitTransition||void 0!==a.MozTransition||void 0!==a.MsTransition||void 0!==a.OTransition}();return this.each(function(){var e=this,k=jQuery(this);e.id=e.id||"CSSA_"+ (new Date).getTime();var l=l||{type:"noEvent"};if(e.CSSAIsRunning&&e.eventType==l.type)e.CSSqueue=function(){k.CSSAnimate(a,g,p,m,h)};else if(e.CSSqueue=null,e.eventType=l.type,0!==k.length&&a){e.CSSAIsRunning=!0;"function"==typeof g&&(h=g,g=jQuery.fx.speeds._default);"function"==typeof p&&(h=p,p=0);"function"==typeof m&&(h=m,m="cubic-bezier(0.65,0.03,0.36,0.72)");if("string"==typeof g)for(var b in jQuery.fx.speeds)if(g==b){g=jQuery.fx.speeds[b];break}else g=jQuery.fx.speeds._default;g||(g=jQuery.fx.speeds._default); if(jQuery.support.CSStransition){l={"default":"ease","in":"ease-in",out:"ease-out","in-out":"ease-in-out",snap:"cubic-bezier(0,1,.5,1)",easeOutCubic:"cubic-bezier(.215,.61,.355,1)",easeInOutCubic:"cubic-bezier(.645,.045,.355,1)",easeInCirc:"cubic-bezier(.6,.04,.98,.335)",easeOutCirc:"cubic-bezier(.075,.82,.165,1)",easeInOutCirc:"cubic-bezier(.785,.135,.15,.86)",easeInExpo:"cubic-bezier(.95,.05,.795,.035)",easeOutExpo:"cubic-bezier(.19,1,.22,1)",easeInOutExpo:"cubic-bezier(1,0,0,1)",easeInQuad:"cubic-bezier(.55,.085,.68,.53)", easeOutQuad:"cubic-bezier(.25,.46,.45,.94)",easeInOutQuad:"cubic-bezier(.455,.03,.515,.955)",easeInQuart:"cubic-bezier(.895,.03,.685,.22)",easeOutQuart:"cubic-bezier(.165,.84,.44,1)",easeInOutQuart:"cubic-bezier(.77,0,.175,1)",easeInQuint:"cubic-bezier(.755,.05,.855,.06)",easeOutQuint:"cubic-bezier(.23,1,.32,1)",easeInOutQuint:"cubic-bezier(.86,0,.07,1)",easeInSine:"cubic-bezier(.47,0,.745,.715)",easeOutSine:"cubic-bezier(.39,.575,.565,1)",easeInOutSine:"cubic-bezier(.445,.05,.55,.95)",easeInBack:"cubic-bezier(.6,-.28,.735,.045)", easeOutBack:"cubic-bezier(.175, .885,.32,1.275)",easeInOutBack:"cubic-bezier(.68,-.55,.265,1.55)"};l[m]&&(m=l[m]);var d="",q="transitionEnd";jQuery.browser.webkit?(d="-webkit-",q="webkitTransitionEnd"):jQuery.browser.mozilla?(d="-moz-",q="transitionend"):jQuery.browser.opera?(d="-o-",q="otransitionend"):jQuery.browser.msie&&(d="-ms-",q="msTransitionEnd");l=[];for(c in a){b=c;"transform"===b&&(b=d+"transform",a[b]=a[c],delete a[c]);"filter"===b&&(b=d+"filter",a[b]=a[c],delete a[c]);if("transform-origin"===b||"origin"===b)b=d+"transform-origin",a[b]=a[c],delete a[c];"x"===b&&(b=d+"transform",a[b]=a[b]||"",a[b]+=" translateX("+f(a[c],"px")+")",delete a[c]);"y"===b&&(b=d+"transform",a[b]=a[b]||"",a[b]+=" translateY("+f(a[c],"px")+")",delete a[c]);"z"===b&&(b=d+"transform",a[b]=a[b]||"",a[b]+=" translateZ("+f(a[c],"px")+")",delete a[c]);"rotate"===b&&(b=d+"transform",a[b]=a[b]||"",a[b]+=" rotate("+f(a[c],"deg")+")",delete a[c]);"rotateX"===b&&(b=d+"transform",a[b]=a[b]||"",a[b]+=" rotateX("+f(a[c],"deg")+ ")",delete a[c]);"rotateY"===b&&(b=d+"transform",a[b]=a[b]||"",a[b]+=" rotateY("+f(a[c],"deg")+")",delete a[c]);"rotateZ"===b&&(b=d+"transform",a[b]=a[b]||"",a[b]+=" rotateZ("+f(a[c],"deg")+")",delete a[c]);"scale"===b&&(b=d+"transform",a[b]=a[b]||"",a[b]+=" scale("+f(a[c],"")+")",delete a[c]);"scaleX"===b&&(b=d+"transform",a[b]=a[b]||"",a[b]+=" scaleX("+f(a[c],"")+")",delete a[c]);"scaleY"===b&&(b=d+"transform",a[b]=a[b]||"",a[b]+=" scaleY("+f(a[c],"")+")",delete a[c]);"scaleZ"===b&&(b=d+"transform", a[b]=a[b]||"",a[b]+=" scaleZ("+f(a[c],"")+")",delete a[c]);"skew"===b&&(b=d+"transform",a[b]=a[b]||"",a[b]+=" skew("+f(a[c],"deg")+")",delete a[c]);"skewX"===b&&(b=d+"transform",a[b]=a[b]||"",a[b]+=" skewX("+f(a[c],"deg")+")",delete a[c]);"skewY"===b&&(b=d+"transform",a[b]=a[b]||"",a[b]+=" skewY("+f(a[c],"deg")+")",delete a[c]);"perspective"===b&&(b=d+"transform",a[b]=a[b]||"",a[b]+=" perspective("+f(a[c],"px")+")",delete a[c]);0>l.indexOf(b)&&l.push(r(b))}var c=l.join(","),s=function(){k.off(q+"."+ e.id);clearTimeout(e.timeout);k.css(d+"transition","");"function"==typeof h&&h(k);e.called=!0;e.CSSAIsRunning=!1;"function"==typeof e.CSSqueue&&(e.CSSqueue(),e.CSSqueue=null)},n={};jQuery.extend(n,a);n[d+"transition-property"]=c;n[d+"transition-duration"]=g+"ms";n[d+"transition-delay"]=p+"ms";n[d+"transition-style"]="preserve-3d";n[d+"transition-timing-function"]=m;setTimeout(function(){k.one(q+"."+e.id,s);k.css(n)},1);e.timeout=setTimeout(function(){k.called||!h?(k.called=!1,e.CSSAIsRunning=!1):(k.css(d+ "transition",""),h(k),e.CSSAIsRunning=!1,"function"==typeof e.CSSqueue&&(e.CSSqueue(),e.CSSqueue=null))},g+p+100)}else{for(var c in a)"transform"===c&&delete a[c],"filter"===c&&delete a[c],"transform-origin"===c&&delete a[c],"auto"===a[c]&&delete a[c];h&&"string"!==typeof h||(h="linear");k.animate(a,g,h)}}})}; var getYTPVideoID=function(url){ var movieURL; if(url.substr(0,16)=="http://youtu.be/"){ movieURL=url.replace("http://youtu.be/",""); }else if(url.indexOf("http")>-1){ movieURL=url.match(/[\\?&]v=([^&#]*)/)[1]; }else{ movieURL=url } return movieURL; }; jQuery.mbYTPlayer={ name:"jquery.mb.YTPlayer", version:"2.7.2", author:"Matteo Bicocchi", defaults:{ containment:"body", ratio:"16/9", videoURL:null, startAt:0, stopAt:0, autoPlay:true, vol:100, addRaster:false, opacity:1, quality:"default", mute:false, loop:true, showControls:true, showAnnotations:false, showYTLogo:true, stopMovieOnClick:false, realfullscreen:true, gaTrack:true, onReady:function (player){}, onStateChange:function (player){}, onPlaybackQualityChange: function (player){}, onError:function (player){}}, controls:{ play:"P", pause:"p", mute:"M", unmute:"A", onlyYT:"O", showSite: "R", ytLogo:"Y" }, rasterImg:"images/raster.png", rasterImgRetina:"images/raster@2x.png", locationProtocol: "https:", buildPlayer: function (options){ return this.each(function (){ var YTPlayer=this; var $YTPlayer=jQuery(YTPlayer); YTPlayer.loop=0; YTPlayer.opt={}; $YTPlayer.addClass("mb_YTVPlayer"); var property=$YTPlayer.data("property")&&typeof $YTPlayer.data("property")=="string" ? eval('(' + $YTPlayer.data("property") + ')'):$YTPlayer.data("property"); if(typeof property.vol!="undefined") property.vol=property.vol==0 ? property.vol=1: property.vol; jQuery.extend(YTPlayer.opt, jQuery.mbYTPlayer.defaults, options, property); var canGoFullscreen = !(jQuery.browser.msie||jQuery.browser.opera||self.location.href!=top.location.href); if(!canGoFullscreen) YTPlayer.opt.realfullscreen=false; if(!$YTPlayer.attr("id")) $YTPlayer.attr("id", "YTP_" + new Date().getTime()); YTPlayer.opt.id=YTPlayer.id; YTPlayer.isAlone=false; var playerID="mbYTP_" + YTPlayer.id; var videoID=this.opt.videoURL ? getYTPVideoID(this.opt.videoURL):$YTPlayer.attr("href") ? getYTPVideoID($YTPlayer.attr("href")):false; YTPlayer.videoID=videoID; YTPlayer.opt.showAnnotations=(YTPlayer.opt.showAnnotations) ? '0':'3'; var playerVars={ 'autoplay': 0, 'modestbranding': 1, 'controls': 0, 'showinfo': 0, 'rel': 0, 'enablejsapi': 1, 'version': 3, 'playerapiid': playerID, 'origin': '*', 'allowfullscreen': true, 'wmode': 'transparent', 'iv_load_policy': YTPlayer.opt.showAnnotations}; var canPlayHTML5=false; var v=document.createElement('video'); if(v.canPlayType){ canPlayHTML5=true; } if(canPlayHTML5) jQuery.extend(playerVars, {'html5': 1}); if(jQuery.browser.msie&&jQuery.browser.version < 9){ this.opt.opacity=1; } var playerBox=jQuery("
    ").attr("id", playerID).addClass("playerBox"); var overlay=jQuery("
    ").css({position: "absolute", top: 0, left: 0, width: "100%", height: "100%"}).addClass("YTPOverlay"); //YTPlayer.isBackground ? "fixed" : YTPlayer.isSelf=YTPlayer.opt.containment=="self"; YTPlayer.opt.containment=YTPlayer.opt.containment=="self" ? jQuery(this):jQuery(YTPlayer.opt.containment); YTPlayer.isBackground=YTPlayer.opt.containment.get(0).tagName.toLowerCase()=="body"; if(YTPlayer.isBackground&&ytp.backgroundIsInited) return; if(!YTPlayer.opt.containment.is(jQuery(this))){ $YTPlayer.hide(); }else{ YTPlayer.isPlayer=true; } if(ytp.isDevice&&YTPlayer.isBackground){ $YTPlayer.remove(); return; } if(YTPlayer.opt.addRaster){ var retina=(window.retina||window.devicePixelRatio > 1); overlay.addClass(retina ? "raster retina":"raster"); }else{ overlay.removeClass("raster retina"); } var wrapper=jQuery("
    ").addClass("mbYTP_wrapper").attr("id", "wrapper_" + playerID); wrapper.css({position: "absolute", zIndex: 0, minWidth: "100%", minHeight: "100%", left: 0, top: 0, overflow: "hidden", opacity: 0}); playerBox.css({position: "absolute", zIndex: 0, width: "100%", height: "100%", top: 0, left: 0, overflow: "hidden", opacity: this.opt.opacity}); wrapper.append(playerBox); YTPlayer.opt.containment.children().not("script, style").each(function (){ if(jQuery(this).css("position")=="static") jQuery(this).css("position", "relative"); }); if(YTPlayer.isBackground){ jQuery("body").css({position: "relative", minWidth: "100%", minHeight: "100%", zIndex: 1, boxSizing: "border-box"}); wrapper.css({position: "fixed", top: 0, left: 0, zIndex: 0, webkitTransform: "translateZ(0)"}); $YTPlayer.hide(); }else if(YTPlayer.opt.containment.css("position")=="static") YTPlayer.opt.containment.css({position: "relative"}); YTPlayer.opt.containment.prepend(wrapper); YTPlayer.wrapper=wrapper; playerBox.css({opacity: 1}); if(!ytp.isDevice){ playerBox.after(overlay); YTPlayer.overlay=overlay; } if(!YTPlayer.isBackground){ overlay.on("mouseenter", function (){ $YTPlayer.find(".mb_YTVPBar").addClass("visible"); }).on("mouseleave", function (){ $YTPlayer.find(".mb_YTVPBar").removeClass("visible"); }) } if(!ytp.YTAPIReady){ jQuery("#YTAPI").remove(); var tag=jQuery("").attr({"src": jQuery.mbYTPlayer.locationProtocol + "//www.youtube.com/player_api?v=" + jQuery.mbYTPlayer.version, "id": "YTAPI"}); jQuery("head title").after(tag); }else{ setTimeout(function (){ jQuery(document).trigger("YTAPIReady"); }, 100) } jQuery(document).on("YTAPIReady", function (){ if((YTPlayer.isBackground&&ytp.backgroundIsInited)||YTPlayer.isInit) return; if(YTPlayer.isBackground&&YTPlayer.opt.stopMovieOnClick) jQuery(document).off("mousedown.ytplayer").on("mousedown,.ytplayer", function (e){ var target=jQuery(e.target); if(target.is("a")||target.parents().is("a")){ $YTPlayer.pauseYTP(); }}); if(YTPlayer.isBackground){ ytp.backgroundIsInited=true; } YTPlayer.opt.autoPlay=typeof YTPlayer.opt.autoPlay=="undefined" ? (YTPlayer.isBackground ? true:false):YTPlayer.opt.autoPlay; YTPlayer.opt.vol=YTPlayer.opt.vol ? YTPlayer.opt.vol:100; jQuery.mbYTPlayer.getDataFromFeed(YTPlayer.videoID, YTPlayer); jQuery(YTPlayer).on("YTPChanged", function (){ if(YTPlayer.isInit) return; YTPlayer.isInit=true; if(ytp.isDevice&&!YTPlayer.isBackground){ new YT.Player(playerID, { videoId: YTPlayer.videoID.toString(), height:'100%', width:'100%', videoId: YTPlayer.videoID, events:{ 'onReady':function (event){ YTPlayer.player=event.target; playerBox.css({opacity: 1}); YTPlayer.wrapper.css({opacity: 1}); $YTPlayer.optimizeDisplay(); }, 'onStateChange': function (){}} }); return; } new YT.Player(playerID, { videoId:YTPlayer.videoID.toString(), playerVars: playerVars, events:{ 'onReady': function (event){ YTPlayer.player=event.target; if(YTPlayer.isReady) return; YTPlayer.isReady=true; YTPlayer.playerEl=YTPlayer.player.getIframe(); $YTPlayer.optimizeDisplay(); YTPlayer.videoID=videoID; jQuery(window).on("resize.YTP", function (){ $YTPlayer.optimizeDisplay(); }); if(YTPlayer.opt.showControls) jQuery(YTPlayer).buildYTPControls(); var startAt=YTPlayer.opt.startAt ? YTPlayer.opt.startAt:1; YTPlayer.player.setVolume(0); jQuery(YTPlayer).muteYTPVolume(); jQuery.mbYTPlayer.checkForState(YTPlayer); YTPlayer.checkForStartAt=setInterval(function (){ var canPlayVideo=(YTPlayer.player.getVideoLoadedFraction() > startAt/YTPlayer.player.getDuration()); if(YTPlayer.player.getDuration() > 0&&YTPlayer.player.getCurrentTime() >=startAt&&canPlayVideo){ clearInterval(YTPlayer.checkForStartAt); YTPlayer.player.setVolume(0); jQuery(YTPlayer).muteYTPVolume(); if(typeof YTPlayer.opt.onReady=="function") YTPlayer.opt.onReady($YTPlayer); if(!YTPlayer.opt.mute) jQuery(YTPlayer).unmuteYTPVolume(); jQuery.mbYTPlayer.checkForState(YTPlayer); YTPlayer.player.pauseVideo(); setTimeout(function(){ if(YTPlayer.opt.autoPlay){ $YTPlayer.playYTP(); $YTPlayer.css("background-image", "none"); }else{ YTPlayer.player.pauseVideo(); } YTPlayer.wrapper.CSSAnimate({opacity: YTPlayer.isAlone ? 1:YTPlayer.opt.opacity}, 2000); },100) }else{ YTPlayer.player.playVideo(); YTPlayer.player.seekTo(startAt, true); }}, jQuery.browser.chrome ? 1000:1); }, 'onStateChange':function (event){ if(typeof event.target.getPlayerState!="function") return; var state=event.target.getPlayerState(); if(typeof YTPlayer.opt.onStateChange=="function") YTPlayer.opt.onStateChange($YTPlayer, state); var controls=jQuery("#controlBar_" + YTPlayer.id); var data=YTPlayer.opt; if(state==0){ if(YTPlayer.state==state) return; YTPlayer.state=state; YTPlayer.player.pauseVideo(); var startAt=YTPlayer.opt.startAt ? YTPlayer.opt.startAt:1; if(data.loop){ YTPlayer.wrapper.css({opacity: 0}); $YTPlayer.playYTP(); YTPlayer.player.seekTo(startAt, true); }else if(!YTPlayer.isBackground){ YTPlayer.player.seekTo(startAt, true); $YTPlayer.playYTP(); setTimeout(function (){ $YTPlayer.pauseYTP(); }, 10); } if(!data.loop&&YTPlayer.isBackground) YTPlayer.wrapper.CSSAnimate({opacity: 0}, 2000); else if(data.loop){ YTPlayer.wrapper.css({opacity: 0}); YTPlayer.loop++; } controls.find(".mb_YTVPPlaypause").html(jQuery.mbYTPlayer.controls.play); jQuery(YTPlayer).trigger("YTPEnd"); } if(state==3){ if(YTPlayer.state==state) return; YTPlayer.state=state; YTPlayer.player.setPlaybackQuality(YTPlayer.opt.quality); controls.find(".mb_YTVPPlaypause").html(jQuery.mbYTPlayer.controls.play); jQuery(YTPlayer).trigger("YTPBuffering"); } if(state==-1){ if(YTPlayer.state==state) return; YTPlayer.state=state; jQuery(YTPlayer).trigger("YTPUnstarted"); } if(state==1){ if(YTPlayer.state==state) return; YTPlayer.state=state; YTPlayer.player.setPlaybackQuality(YTPlayer.opt.quality); controls.find(".mb_YTVPPlaypause").html(jQuery.mbYTPlayer.controls.pause); jQuery(YTPlayer).trigger("YTPStart"); if(typeof _gaq!="undefined"&&eval(YTPlayer.opt.gaTrack)) _gaq.push(['_trackEvent', 'YTPlayer', 'Play', (YTPlayer.title||YTPlayer.videoID.toString())]); if(typeof ga!="undefined"&&eval(YTPlayer.opt.gaTrack)) ga('send', 'event', 'YTPlayer', 'play', (YTPlayer.title||YTPlayer.videoID.toString())); } if(state==2){ if(YTPlayer.state==state) return; YTPlayer.state=state; controls.find(".mb_YTVPPlaypause").html(jQuery.mbYTPlayer.controls.play); jQuery(YTPlayer).trigger("YTPPause"); }}, 'onPlaybackQualityChange': function (e){ if(typeof YTPlayer.opt.onPlaybackQualityChange=="function") YTPlayer.opt.onPlaybackQualityChange($YTPlayer); }, 'onError':function (err){ if(err.data==150){ console.log("Embedding this video is restricted by Youtube."); if(YTPlayer.isPlayList) jQuery(YTPlayer).playNext(); } if(err.data==2&&YTPlayer.isPlayList) jQuery(YTPlayer).playNext(); if(typeof YTPlayer.opt.onError=="function") YTPlayer.opt.onError($YTPlayer, err); }} }); }); }) }); }, getDataFromFeed: function (videoID, YTPlayer){ YTPlayer.videoID=videoID; if(!jQuery.browser.msie){ jQuery.getJSON(jQuery.mbYTPlayer.locationProtocol + '//gdata.youtube.com/feeds/api/videos/' + videoID + '?v=2&alt=jsonc', function (data, status, xhr){ YTPlayer.dataReceived=true; var videoData=data.data; YTPlayer.title=videoData.title; YTPlayer.videoData=videoData; if(YTPlayer.opt.ratio=="auto") if(videoData.aspectRatio&&videoData.aspectRatio==="widescreen") YTPlayer.opt.ratio="16/9"; else YTPlayer.opt.ratio="4/3"; if(!YTPlayer.hasData){ YTPlayer.hasData=true; if(YTPlayer.isPlayer){ var bgndURL=YTPlayer.videoData.thumbnail.hqDefault; YTPlayer.opt.containment.css({background: "rgba(0,0,0,0.5) url(" + bgndURL + ") center center", backgroundSize: "cover"}); }} jQuery(YTPlayer).trigger("YTPChanged"); }); setTimeout(function (){ if(!YTPlayer.dataReceived&&!YTPlayer.hasData){ YTPlayer.hasData=true; jQuery(YTPlayer).trigger("YTPChanged"); }}, 1500) }else{ YTPlayer.opt.ratio=="auto" ? YTPlayer.opt.ratio="16/9":YTPlayer.opt.ratio; if(!YTPlayer.hasData){ YTPlayer.hasData=true; setTimeout(function (){ jQuery(YTPlayer).trigger("YTPChanged"); }, 100) }} }, getVideoID: function (){ var YTPlayer=this.get(0); return YTPlayer.videoID||false; }, setVideoQuality: function (quality){ var YTPlayer=this.get(0); YTPlayer.player.setPlaybackQuality(quality); }, YTPlaylist: function (videos, shuffle, callback){ var YTPlayer=this.get(0); YTPlayer.isPlayList=true; if(shuffle) videos=jQuery.shuffle(videos); if(!YTPlayer.videoID){ YTPlayer.videos=videos; YTPlayer.videoCounter=0; YTPlayer.videoLength=videos.length; jQuery(YTPlayer).data("property", videos[0]); jQuery(YTPlayer).mb_YTPlayer(); } if(typeof callback=="function") jQuery(YTPlayer).on("YTPChanged", function (){ callback(YTPlayer); }); jQuery(YTPlayer).on("YTPEnd", function (){ jQuery(YTPlayer).playNext(); }); }, playNext: function (){ var YTPlayer=this.get(0); YTPlayer.videoCounter++; if(YTPlayer.videoCounter >=YTPlayer.videoLength) YTPlayer.videoCounter=0; jQuery(YTPlayer.playerEl).css({opacity: 0}); jQuery(YTPlayer).changeMovie(YTPlayer.videos[YTPlayer.videoCounter]); }, playPrev: function (){ var YTPlayer=this.get(0); YTPlayer.videoCounter--; if(YTPlayer.videoCounter < 0) YTPlayer.videoCounter=YTPlayer.videoLength - 1; jQuery(YTPlayer.playerEl).css({opacity: 0}); jQuery(YTPlayer).changeMovie(YTPlayer.videos[YTPlayer.videoCounter]); }, changeMovie: function (opt){ var YTPlayer=this.get(0); YTPlayer.opt.startAt=0; YTPlayer.opt.stopAt=0; YTPlayer.opt.mute=true; if(opt){ jQuery.extend(YTPlayer.opt, opt); } YTPlayer.videoID=getYTPVideoID(YTPlayer.opt.videoURL); jQuery(YTPlayer).pauseYTP(); var timer=jQuery.browser.msie ? 1000:0; jQuery(YTPlayer.playerEl).CSSAnimate({opacity: 0}, timer); setTimeout(function (){ jQuery(YTPlayer).getPlayer().cueVideoByUrl(encodeURI(jQuery.mbYTPlayer.locationProtocol + "//www.youtube.com/v/" + YTPlayer.videoID), 1, YTPlayer.opt.quality); jQuery(YTPlayer).playYTP(); jQuery(YTPlayer).one("YTPStart", function (){ YTPlayer.wrapper.CSSAnimate({opacity: YTPlayer.isAlone ? 1:YTPlayer.opt.opacity}, 1000); jQuery(YTPlayer.playerEl).CSSAnimate({opacity: 1}, timer); if(YTPlayer.opt.startAt){ YTPlayer.player.seekTo(YTPlayer.opt.startAt); } jQuery.mbYTPlayer.checkForState(YTPlayer); if(!YTPlayer.opt.autoPlay) jQuery(YTPlayer).pauseYTP(); }); if(YTPlayer.opt.mute){ jQuery(YTPlayer).muteYTPVolume(); }else{ jQuery(YTPlayer).unmuteYTPVolume(); }}, timer); if(YTPlayer.opt.addRaster){ var retina=(window.retina||window.devicePixelRatio > 1); YTPlayer.overlay.addClass(retina ? "raster retina":"raster"); }else{ YTPlayer.overlay.removeClass("raster"); YTPlayer.overlay.removeClass("retina"); } jQuery("#controlBar_" + YTPlayer.id).remove(); if(YTPlayer.opt.showControls) jQuery(YTPlayer).buildYTPControls(); jQuery.mbYTPlayer.getDataFromFeed(YTPlayer.videoID, YTPlayer); jQuery(YTPlayer).optimizeDisplay(); }, getPlayer: function (){ return jQuery(this).get(0).player; }, playerDestroy: function (){ var YTPlayer=this.get(0); ytp.YTAPIReady=false; ytp.backgroundIsInited=false; YTPlayer.isInit=false; YTPlayer.videoID=null; var playerBox=YTPlayer.wrapper; playerBox.remove(); jQuery("#controlBar_" + YTPlayer.id).remove(); }, fullscreen: function (real){ var YTPlayer=this.get(0); if(typeof real=="undefined") real=YTPlayer.opt.realfullscreen; real=eval(real); var controls=jQuery("#controlBar_" + YTPlayer.id); var fullScreenBtn=controls.find(".mb_OnlyYT"); var videoWrapper=YTPlayer.isSelf ? YTPlayer.opt.containment:YTPlayer.wrapper; if(real){ var fullscreenchange=jQuery.browser.mozilla ? "mozfullscreenchange":jQuery.browser.webkit ? "webkitfullscreenchange":"fullscreenchange"; jQuery(document).off(fullscreenchange).on(fullscreenchange, function (){ var isFullScreen=RunPrefixMethod(document, "IsFullScreen")||RunPrefixMethod(document, "FullScreen"); if(!isFullScreen){ YTPlayer.isAlone=false; fullScreenBtn.html(jQuery.mbYTPlayer.controls.onlyYT); jQuery(YTPlayer).setVideoQuality(YTPlayer.opt.quality); videoWrapper.removeClass("fullscreen"); videoWrapper.CSSAnimate({opacity: YTPlayer.opt.opacity}, 500); videoWrapper.css({zIndex: 0}); if(YTPlayer.isBackground){ jQuery("body").after(controls); }else{ YTPlayer.wrapper.before(controls); } jQuery(window).resize(); jQuery(YTPlayer).trigger("YTPFullScreenEnd"); }else{ jQuery(YTPlayer).setVideoQuality("default"); jQuery(YTPlayer).trigger("YTPFullScreenStart"); }}); } if(!YTPlayer.isAlone){ if(real){ var playerState=YTPlayer.player.getPlayerState(); videoWrapper.css({opacity: 0}); videoWrapper.addClass("fullscreen"); launchFullscreen(videoWrapper.get(0)); setTimeout(function (){ videoWrapper.CSSAnimate({opacity: 1}, 1000); YTPlayer.wrapper.append(controls); jQuery(YTPlayer).optimizeDisplay(); YTPlayer.player.seekTo(YTPlayer.player.getCurrentTime() + .1, true); }, 500) } else videoWrapper.css({zIndex: 10000}).CSSAnimate({opacity: 1}, 1000); fullScreenBtn.html(jQuery.mbYTPlayer.controls.showSite); YTPlayer.isAlone=true; }else{ if(real){ cancelFullscreen(); }else{ videoWrapper.CSSAnimate({opacity: YTPlayer.opt.opacity}, 500); videoWrapper.css({zIndex: 0}); } fullScreenBtn.html(jQuery.mbYTPlayer.controls.onlyYT) YTPlayer.isAlone=false; } function RunPrefixMethod(obj, method){ var pfx=["webkit", "moz", "ms", "o", ""]; var p=0, m, t; while (p < pfx.length&&!obj[m]){ m=method; if(pfx[p]==""){ m=m.substr(0, 1).toLowerCase() + m.substr(1); } m=pfx[p] + m; t=typeof obj[m]; if(t!="undefined"){ pfx=[pfx[p]]; return (t=="function" ? obj[m]():obj[m]); } p++; }} function launchFullscreen(element){ RunPrefixMethod(element, "RequestFullScreen"); } function cancelFullscreen(){ if(RunPrefixMethod(document, "FullScreen")||RunPrefixMethod(document, "IsFullScreen")){ RunPrefixMethod(document, "CancelFullScreen"); }} }, playYTP: function (){ var YTPlayer=this.get(0); if(typeof YTPlayer.player==="undefined") return; var controls=jQuery("#controlBar_" + YTPlayer.id); var playBtn=controls.find(".mb_YTVPPlaypause"); playBtn.html(jQuery.mbYTPlayer.controls.pause); YTPlayer.player.playVideo(); YTPlayer.wrapper.CSSAnimate({opacity: YTPlayer.isAlone ? 1:YTPlayer.opt.opacity}, 2000); jQuery(YTPlayer).on("YTPStart", function (){ jQuery(YTPlayer).css("background-image", "none"); }) }, toggleLoops: function (){ var YTPlayer=this.get(0); var data=YTPlayer.opt; if(data.loop==1){ data.loop=0; }else{ if(data.startAt){ YTPlayer.player.seekTo(data.startAt); }else{ YTPlayer.player.playVideo(); } data.loop=1; }}, stopYTP: function (){ var YTPlayer=this.get(0); var controls=jQuery("#controlBar_" + YTPlayer.id); var playBtn=controls.find(".mb_YTVPPlaypause"); playBtn.html(jQuery.mbYTPlayer.controls.play); YTPlayer.player.stopVideo(); }, pauseYTP: function (){ var YTPlayer=this.get(0); var data=YTPlayer.opt; var controls=jQuery("#controlBar_" + YTPlayer.id); var playBtn=controls.find(".mb_YTVPPlaypause"); playBtn.html(jQuery.mbYTPlayer.controls.play); YTPlayer.player.pauseVideo(); }, seekToYTP: function (val){ var YTPlayer=this.get(0); YTPlayer.player.seekTo(val, true); }, setYTPVolume: function (val){ var YTPlayer=this.get(0); if(!val&&!YTPlayer.opt.vol&&YTPlayer.player.getVolume()==0) jQuery(YTPlayer).unmuteYTPVolume(); else if((!val&&YTPlayer.player.getVolume() > 0)||(val&&YTPlayer.player.getVolume()==val)) jQuery(YTPlayer).muteYTPVolume(); else YTPlayer.opt.vol=val; YTPlayer.player.setVolume(YTPlayer.opt.vol); }, muteYTPVolume: function (){ var YTPlayer=this.get(0); YTPlayer.player.mute(); YTPlayer.player.setVolume(0); var controls=jQuery("#controlBar_" + YTPlayer.id); var muteBtn=controls.find(".mb_YTVPMuteUnmute"); muteBtn.html(jQuery.mbYTPlayer.controls.unmute); jQuery(YTPlayer).addClass("isMuted"); jQuery(YTPlayer).trigger("YTPMuted"); }, unmuteYTPVolume: function (){ var YTPlayer=this.get(0); YTPlayer.player.unMute(); YTPlayer.player.setVolume(YTPlayer.opt.vol); var controls=jQuery("#controlBar_" + YTPlayer.id); var muteBtn=controls.find(".mb_YTVPMuteUnmute"); muteBtn.html(jQuery.mbYTPlayer.controls.mute); jQuery(YTPlayer).removeClass("isMuted"); jQuery(YTPlayer).trigger("YTPUnmuted"); }, manageYTPProgress: function (){ var YTPlayer=this.get(0); var controls=jQuery("#controlBar_" + YTPlayer.id); var progressBar=controls.find(".mb_YTVPProgress"); var loadedBar=controls.find(".mb_YTVPLoaded"); var timeBar=controls.find(".mb_YTVTime"); var totW=progressBar.outerWidth(); var currentTime=Math.floor(YTPlayer.player.getCurrentTime()); var totalTime=Math.floor(YTPlayer.player.getDuration()); var timeW=(currentTime * totW) / totalTime; var startLeft=0; var loadedW=YTPlayer.player.getVideoLoadedFraction() * 100; loadedBar.css({left: startLeft, width: loadedW + "%"}); timeBar.css({left: 0, width: timeW}); return {totalTime: totalTime, currentTime: currentTime};}, buildYTPControls: function (){ var YTPlayer=this.get(0); var data=YTPlayer.opt; data.showYTLogo=data.showYTLogo||data.printUrl; if(jQuery("#controlBar_" + YTPlayer.id).length) return; var controlBar=jQuery("").attr("id", "controlBar_" + YTPlayer.id).addClass("mb_YTVPBar").css({whiteSpace: "noWrap", position: YTPlayer.isBackground ? "fixed":"absolute", zIndex: YTPlayer.isBackground ? 10000:1000}).hide(); var buttonBar=jQuery("
    ").addClass("buttonBar"); var playpause=jQuery("" + jQuery.mbYTPlayer.controls.play + "").addClass("mb_YTVPPlaypause ytpicon").click(function (){ if(YTPlayer.player.getPlayerState()==1) jQuery(YTPlayer).pauseYTP(); else jQuery(YTPlayer).playYTP(); }); var MuteUnmute=jQuery("" + jQuery.mbYTPlayer.controls.mute + "").addClass("mb_YTVPMuteUnmute ytpicon").click(function (){ if(YTPlayer.player.getVolume()==0){ jQuery(YTPlayer).unmuteYTPVolume(); }else{ jQuery(YTPlayer).muteYTPVolume(); }}); var idx=jQuery("").addClass("mb_YTVPTime"); var vURL=data.videoURL; if(vURL.indexOf("http") < 0) vURL=jQuery.mbYTPlayer.locationProtocol + "//www.youtube.com/watch?v=" + data.videoURL; var movieUrl=jQuery("").html(jQuery.mbYTPlayer.controls.ytLogo).addClass("mb_YTVPUrl ytpicon").attr("title", "view on YouTube").on("click", function (){window.open(vURL, "viewOnYT")}); var onlyVideo=jQuery("").html(jQuery.mbYTPlayer.controls.onlyYT).addClass("mb_OnlyYT ytpicon").on("click", function (){jQuery(YTPlayer).fullscreen(data.realfullscreen);}); var progressBar=jQuery("
    ").addClass("mb_YTVPProgress").css("position", "absolute").click(function (e){ timeBar.css({width: (e.clientX - timeBar.offset().left)}); YTPlayer.timeW=e.clientX - timeBar.offset().left; controlBar.find(".mb_YTVPLoaded").css({width: 0}); var totalTime=Math.floor(YTPlayer.player.getDuration()); YTPlayer.goto=(timeBar.outerWidth() * totalTime) / progressBar.outerWidth(); YTPlayer.player.seekTo(parseFloat(YTPlayer.goto), true); controlBar.find(".mb_YTVPLoaded").css({width: 0}); }); var loadedBar=jQuery("
    ").addClass("mb_YTVPLoaded").css("position", "absolute"); var timeBar=jQuery("
    ").addClass("mb_YTVTime").css("position", "absolute"); progressBar.append(loadedBar).append(timeBar); buttonBar.append(playpause).append(MuteUnmute).append(idx); if(data.showYTLogo){ buttonBar.append(movieUrl); } if(YTPlayer.isBackground||(eval(YTPlayer.opt.realfullscreen)&&!YTPlayer.isBackground)) buttonBar.append(onlyVideo); controlBar.append(buttonBar).append(progressBar); if(!YTPlayer.isBackground){ controlBar.addClass("inlinePlayer"); YTPlayer.wrapper.before(controlBar); }else{ jQuery("body").after(controlBar); } controlBar.fadeIn(); }, checkForState: function (YTPlayer){ clearInterval(YTPlayer.getState); YTPlayer.getState=setInterval(function (){ var prog=jQuery(YTPlayer).manageYTPProgress(); var $YTPlayer=jQuery(YTPlayer); var controlBar=jQuery("#controlBar_" + YTPlayer.id); var data=YTPlayer.opt; var startAt=YTPlayer.opt.startAt ? YTPlayer.opt.startAt:1; var stopAt=YTPlayer.opt.stopAt > YTPlayer.opt.startAt ? YTPlayer.opt.stopAt:0; stopAt=stopAt < YTPlayer.player.getDuration() ? stopAt:0; if(YTPlayer.player.getVolume()==0) $YTPlayer.addClass("isMuted"); else $YTPlayer.removeClass("isMuted"); if(prog.totalTime){ controlBar.find(".mb_YTVPTime").html(jQuery.mbYTPlayer.formatTime(prog.currentTime) + " / " + jQuery.mbYTPlayer.formatTime(prog.totalTime)); }else{ controlBar.find(".mb_YTVPTime").html("--:-- / --:--"); } if(YTPlayer.player.getPlayerState()==1&&(parseFloat(YTPlayer.player.getDuration() - 3) < YTPlayer.player.getCurrentTime()||(stopAt > 0&&parseFloat(YTPlayer.player.getCurrentTime()) > stopAt))){ if(YTPlayer.isEnded) return; YTPlayer.isEnded=true; setTimeout(function(){YTPlayer.isEnded=false},2000); if(YTPlayer.isPlayList){ clearInterval(YTPlayer.getState); jQuery(YTPlayer).trigger("YTPEnd"); return; }else if(!data.loop){ YTPlayer.player.pauseVideo(); YTPlayer.wrapper.CSSAnimate({opacity: 0}, 1000, function (){ jQuery(YTPlayer).trigger("YTPEnd"); YTPlayer.player.seekTo(startAt, true); if(!YTPlayer.isBackground){ var bgndURL=YTPlayer.videoData.thumbnail.hqDefault; jQuery(YTPlayer).css({background: "rgba(0,0,0,0.5) url(" + bgndURL + ") center center", backgroundSize: "cover"}); }}); } else YTPlayer.player.seekTo(startAt, true); }}, 1); }, formatTime: function (s){ var min=Math.floor(s / 60); var sec=Math.floor(s - (60 * min)); return (min <=9 ? "0" + min:min) + ":" + (sec <=9 ? "0" + sec:sec); }}; jQuery.fn.toggleVolume=function (){ var YTPlayer=this.get(0); if(!YTPlayer) return; if(YTPlayer.player.isMuted()){ jQuery(YTPlayer).unmuteYTPVolume(); return true; }else{ jQuery(YTPlayer).muteYTPVolume(); return false; }}; jQuery.fn.optimizeDisplay=function (){ var YTPlayer=this.get(0); var data=YTPlayer.opt; var playerBox=jQuery(YTPlayer.playerEl); var win={}; var el=YTPlayer.wrapper; win.width=el.outerWidth(); win.height=el.outerHeight(); var margin=24; var overprint=100; var vid={}; vid.width=win.width + ((win.width * margin) / 100); vid.height=data.ratio=="16/9" ? Math.ceil((9 * win.width) / 16):Math.ceil((3 * win.width) / 4); vid.marginTop=-((vid.height - win.height) / 2); vid.marginLeft=-((win.width * (margin / 2)) / 100); if(vid.height < win.height){ vid.height=win.height + ((win.height * margin) / 100); vid.width=data.ratio=="16/9" ? Math.floor((16 * win.height) / 9):Math.floor((4 * win.height) / 3); vid.marginTop=-((win.height * (margin / 2)) / 100); vid.marginLeft=-((vid.width - win.width) / 2); } vid.width +=overprint; vid.height +=overprint; vid.marginTop -=overprint / 2; vid.marginLeft -=overprint / 2; playerBox.css({width: vid.width, height: vid.height, marginTop: vid.marginTop, marginLeft: vid.marginLeft}); }; jQuery.shuffle=function (arr){ var newArray=arr.slice(); var len=newArray.length; var i=len; while (i--){ var p=parseInt(Math.random() * len); var t=newArray[i]; newArray[i]=newArray[p]; newArray[p]=t; } return newArray; }; jQuery.fn.mb_YTPlayer=jQuery.mbYTPlayer.buildPlayer; jQuery.fn.YTPlaylist=jQuery.mbYTPlayer.YTPlaylist; jQuery.fn.playNext=jQuery.mbYTPlayer.playNext; jQuery.fn.playPrev=jQuery.mbYTPlayer.playPrev; jQuery.fn.changeMovie=jQuery.mbYTPlayer.changeMovie; jQuery.fn.getVideoID=jQuery.mbYTPlayer.getVideoID; jQuery.fn.getPlayer=jQuery.mbYTPlayer.getPlayer; jQuery.fn.playerDestroy=jQuery.mbYTPlayer.playerDestroy; jQuery.fn.fullscreen=jQuery.mbYTPlayer.fullscreen; jQuery.fn.buildYTPControls=jQuery.mbYTPlayer.buildYTPControls; jQuery.fn.playYTP=jQuery.mbYTPlayer.playYTP; jQuery.fn.toggleLoops=jQuery.mbYTPlayer.toggleLoops; jQuery.fn.stopYTP=jQuery.mbYTPlayer.stopYTP; jQuery.fn.pauseYTP=jQuery.mbYTPlayer.pauseYTP; jQuery.fn.seekToYTP=jQuery.mbYTPlayer.seekToYTP; jQuery.fn.muteYTPVolume=jQuery.mbYTPlayer.muteYTPVolume; jQuery.fn.unmuteYTPVolume=jQuery.mbYTPlayer.unmuteYTPVolume; jQuery.fn.setYTPVolume=jQuery.mbYTPlayer.setYTPVolume; jQuery.fn.setVideoQuality=jQuery.mbYTPlayer.setVideoQuality; jQuery.fn.manageYTPProgress=jQuery.mbYTPlayer.manageYTPProgress; })(jQuery, ytp); var $=jQuery.noConflict(); $(document).ready(function(){ $('.flexpost').flexslider({ animation: "slide", slideshow: true, directionNav: true, slideshowSpeed: 3000, animationSpeed: 700, controlNav: false }); $('.animation').waypoint(function(direction){ $(this).addClass('animation-active'); }, { offset: '100%', triggerOnce: true }); $(document).scroll(function (){ var y=$(document).scrollTop(), header=$(".fixed-top"); if(y >=120){ header.addClass('fixed'); }else{ header.removeClass('fixed'); }}); "use strict"; $("a[data-rel^='prettyPhoto']").prettyPhoto({ theme: 'pp_default' }); $('.wp-tag-cloud li a').prepend(''); (function($){ "use strict"; $(".loader-item").delay(700).fadeOut(); $("#pageloader").delay(800).fadeOut("slow"); $("html").niceScroll({ cursorcolor: "#293133", cursorborderradius: "0", cursorborder: "0 solid #fff", cursorwidth: "10px", zindex: "999999", scrollspeed: 60 }); $('a[href="#top"]').click(function (){ $('html, body').animate({ scrollTop: 0 }, 800); return false }); $(".projects").mixItUp({ animation: { effects: 'fade scale(0)' }, layout: {}, selectors: { target: ".project" }, load: { filter: 'all', }}); })(jQuery) }); function checkemail(emailaddress){ "use strict"; var pattern=new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i); return pattern.test(emailaddress); } jQuery(document).ready(function(){ jQuery('.empty-widget-title').parent().parent('h4').css('display', 'none'); jQuery('.empty-widget-title').parent('.footer-widget-title').css('display', 'none'); jQuery('.sidebar-widget ul.drop-menu').removeClass('drop-menu').css('display', 'block'); "use strict"; jQuery('#registerErrors, .widgetinfo').hide(); var $messageshort=false; var $emailerror=false; var $nameshort=false; var $namelong=false; jQuery('#contactFormWidget input#wformsend').click(function(){ var $name=jQuery('#wname').val(); var $email=jQuery('#wemail').val(); var $message=jQuery('#wmessage').val(); var $contactemail=jQuery('#wcontactemail').val(); var $contacturl=jQuery('#wcontacturl').val(); var $subject=jQuery('#wsubject').val(); if($name!==''&&$name.length < 3){ $nameshort=true; }else{ $nameshort=false; } if($name!==''&&$name.length > 30){ $namelong=true; }else{ $namelong=false; } if($email!==''&&checkemail($email)){ $emailerror=true; }else{ $emailerror=false; } if($message!==''&&$message!=='Message'&&$message.length < 3){ $messageshort=true; }else{ $messageshort=false; } jQuery('#contactFormWidget .loading').animate({opacity: 1}, 250); if($name!==''&&$nameshort!==true&&$namelong!==true&&$email!==''&&$emailerror!==false&&$message!==''&&$messageshort!==true&&$contactemail!==''){ jQuery.post($contacturl, {type: 'widget', contactemail: $contactemail, subject: $subject, name: $name, email: $email, message: $message}, function(){ jQuery('#contactFormWidget .loading').animate({opacity: 0}, 250); jQuery('.form').fadeOut(); jQuery('#bottom #wname, #bottom #wemail, #bottom #wmessage').css({'border':'0'}); jQuery('.widgeterror').hide(); jQuery('.widgetinfo').fadeIn('slow'); jQuery('.widgetinfo').delay(2000).fadeOut(1000, function(){ jQuery('#wname, #wemail, #wmessage').val(''); jQuery('.form').fadeIn('slow'); }); } ); return false; }else{ jQuery('#contactFormWidget .loading').animate({opacity: 0}, 250); jQuery('.widgeterror').hide(); jQuery('.widgeterror').fadeIn('fast'); jQuery('.widgeterror').delay(3000).fadeOut(1000); if($name===''||$name==='Name'||$nameshort===true||$namelong===true){ jQuery('#wname').css({'border-left':'4px solid #red'}); }else{ jQuery('#wname').css({'border-left':'4px solid #929DAC'}); } if($email===''||$email==='Email'||$emailerror===false){ jQuery('#wemail').css({'border-left':'4px solid red'}); }else{ jQuery('#wemail').css({'border-left':'4px solid #929DAC'}); } if($message===''||$message==='Message'||$messageshort===true){ jQuery('#wmessage').css({'border-left':'4px solid red'}); }else{ jQuery('#wmessage').css({'border-left':'4px solid #929DAC'}); } return false; }}); }); !function(c,d){"use strict";var e=!1,n=!1;if(d.querySelector)if(c.addEventListener)e=!0;if(c.wp=c.wp||{},!c.wp.receiveEmbedMessage)if(c.wp.receiveEmbedMessage=function(e){var t=e.data;if(t)if(t.secret||t.message||t.value)if(!/[^a-zA-Z0-9]/.test(t.secret)){for(var r,a,i,s=d.querySelectorAll('iframe[data-secret="'+t.secret+'"]'),n=d.querySelectorAll('blockquote[data-secret="'+t.secret+'"]'),o=0;o