if(typeof JSON!=="object"){JSON={}}(function(){"use strict";function f(e){return e<10?"0"+e:e}function quote(e){escapable.lastIndex=0;return escapable.test(e)?'"'+e.replace(escapable,function(e){var t=meta[e];return typeof t==="string"?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function str(e,t){var n,r,i,s,o=gap,u,a=t[e];if(a&&typeof a==="object"&&typeof a.toJSON==="function"){a=a.toJSON(e)}if(typeof rep==="function"){a=rep.call(t,e,a)}switch(typeof a){case"string":return quote(a);case"number":return isFinite(a)?String(a):"null";case"boolean":case"null":return String(a);case"object":if(!a){return"null"}gap+=indent;u=[];if(Object.prototype.toString.apply(a)==="[object Array]"){s=a.length;for(n=0;nd&&(c=b(a[d],d),c!==!1);d++);}function c(a){return"[object Array]"===Object.prototype.toString.apply(a)}function d(a){return"function"==typeof a}function e(a){this.options=a,!a.deferSetup&&this.setup()}function f(b,c){this.query=b,this.isUnconditional=c,this.handlers=[],this.mql=a(b);var d=this;this.listener=function(a){d.mql=a,d.assess()},this.mql.addListener(this.listener)}function g(){if(!a)throw new Error("matchMedia not present, legacy browsers require a polyfill");this.queries={},this.browserIsIncapable=!a("only all").matches}return e.prototype={setup:function(){this.options.setup&&this.options.setup(),this.initialised=!0},on:function(){!this.initialised&&this.setup(),this.options.match&&this.options.match()},off:function(){this.options.unmatch&&this.options.unmatch()},destroy:function(){this.options.destroy?this.options.destroy():this.off()},equals:function(a){return this.options===a||this.options.match===a}},f.prototype={addHandler:function(a){var b=new e(a);this.handlers.push(b),this.matches()&&b.on()},removeHandler:function(a){var c=this.handlers;b(c,function(b,d){return b.equals(a)?(b.destroy(),!c.splice(d,1)):void 0})},matches:function(){return this.mql.matches||this.isUnconditional},clear:function(){b(this.handlers,function(a){a.destroy()}),this.mql.removeListener(this.listener),this.handlers.length=0},assess:function(){var a=this.matches()?"on":"off";b(this.handlers,function(b){b[a]()})}},g.prototype={register:function(a,e,g){var h=this.queries,i=g&&this.browserIsIncapable;return h[a]||(h[a]=new f(a,i)),d(e)&&(e={match:e}),c(e)||(e=[e]),b(e,function(b){d(b)&&(b={match:b}),h[a].addHandler(b)}),this},unregister:function(a,b){var c=this.queries[a];return c&&(b?c.removeHandler(b):(c.clear(),delete this.queries[a])),this}},new g}); ; ; if(typeof jQuery==='undefined'){throw new Error('Bootstrap\'s JavaScript requires jQuery')} +function($){'use strict';var version=$.fn.jquery.split(' ')[0].split('.') if((version[0]<2&&version[1]<9)||(version[0]==1&&version[1]==9&&version[2]<1)){throw new Error('Bootstrap\'s JavaScript requires jQuery version 1.9.1 or higher')}}(jQuery);+function($){'use strict';var dismiss='[data-dismiss="alert"]' var Alert=function(el){$(el).on('click',dismiss,this.close)} Alert.VERSION='3.3.2' Alert.TRANSITION_DURATION=150 Alert.prototype.close=function(e){var $this=$(this) var selector=$this.attr('data-target') if(!selector){selector=$this.attr('href') selector=selector&&selector.replace(/.*(?=#[^\s]*$)/,'')} var $parent=$(selector) if(e)e.preventDefault() if(!$parent.length){$parent=$this.closest('.alert')} $parent.trigger(e=$.Event('close.bs.alert')) if(e.isDefaultPrevented())return $parent.removeClass('in') function removeElement(){$parent.detach().trigger('closed.bs.alert').remove()} $.support.transition&&$parent.hasClass('fade')?$parent.one('bsTransitionEnd',removeElement).emulateTransitionEnd(Alert.TRANSITION_DURATION):removeElement()} function Plugin(option){return this.each(function(){var $this=$(this) var data=$this.data('bs.alert') if(!data)$this.data('bs.alert',(data=new Alert(this))) if(typeof option=='string')data[option].call($this)})} var old=$.fn.alert $.fn.alert=Plugin $.fn.alert.Constructor=Alert $.fn.alert.noConflict=function(){$.fn.alert=old return this} $(document).on('click.bs.alert.data-api',dismiss,Alert.prototype.close)}(jQuery);+function($){'use strict';var Button=function(element,options){this.$element=$(element) this.options=$.extend({},Button.DEFAULTS,options) this.isLoading=false} Button.VERSION='3.3.2' Button.DEFAULTS={loadingText:'loading...'} Button.prototype.setState=function(state){var d='disabled' var $el=this.$element var val=$el.is('input')?'val':'html' var data=$el.data() state=state+'Text' if(data.resetText==null)$el.data('resetText',$el[val]()) setTimeout($.proxy(function(){$el[val](data[state]==null?this.options[state]:data[state]) if(state=='loadingText'){this.isLoading=true $el.addClass(d).attr(d,d)}else if(this.isLoading){this.isLoading=false $el.removeClass(d).removeAttr(d)}},this),0)} Button.prototype.toggle=function(){var changed=true var $parent=this.$element.closest('[data-toggle="buttons"]') if($parent.length){var $input=this.$element.find('input') if($input.prop('type')=='radio'){if($input.prop('checked')&&this.$element.hasClass('active'))changed=false else $parent.find('.active').removeClass('active')} if(changed)$input.prop('checked',!this.$element.hasClass('active')).trigger('change')}else{this.$element.attr('aria-pressed',!this.$element.hasClass('active'))} if(changed)this.$element.toggleClass('active')} function Plugin(option){return this.each(function(){var $this=$(this) var data=$this.data('bs.button') var options=typeof option=='object'&&option if(!data)$this.data('bs.button',(data=new Button(this,options))) if(option=='toggle')data.toggle() else if(option)data.setState(option)})} var old=$.fn.button $.fn.button=Plugin $.fn.button.Constructor=Button $.fn.button.noConflict=function(){$.fn.button=old return this} $(document).on('click.bs.button.data-api','[data-toggle^="button"]',function(e){var $btn=$(e.target) if(!$btn.hasClass('btn'))$btn=$btn.closest('.btn') Plugin.call($btn,'toggle') e.preventDefault()}).on('focus.bs.button.data-api blur.bs.button.data-api','[data-toggle^="button"]',function(e){$(e.target).closest('.btn').toggleClass('focus',/^focus(in)?$/.test(e.type))})}(jQuery);+function($){'use strict';var Carousel=function(element,options){this.$element=$(element) this.$indicators=this.$element.find('.carousel-indicators') this.options=options this.paused=null this.sliding=null this.interval=null this.$active=null this.$items=null this.options.keyboard&&this.$element.on('keydown.bs.carousel',$.proxy(this.keydown,this)) this.options.pause=='hover'&&!('ontouchstart'in document.documentElement)&&this.$element.on('mouseenter.bs.carousel',$.proxy(this.pause,this)).on('mouseleave.bs.carousel',$.proxy(this.cycle,this))} Carousel.VERSION='3.3.2' Carousel.TRANSITION_DURATION=600 Carousel.DEFAULTS={interval:5000,pause:'hover',wrap:true,keyboard:true} Carousel.prototype.keydown=function(e){if(/input|textarea/i.test(e.target.tagName))return switch(e.which){case 37:this.prev();break case 39:this.next();break default:return} e.preventDefault()} Carousel.prototype.cycle=function(e){e||(this.paused=false) this.interval&&clearInterval(this.interval) this.options.interval&&!this.paused&&(this.interval=setInterval($.proxy(this.next,this),this.options.interval)) return this} Carousel.prototype.getItemIndex=function(item){this.$items=item.parent().children('.item') return this.$items.index(item||this.$active)} Carousel.prototype.getItemForDirection=function(direction,active){var activeIndex=this.getItemIndex(active) var willWrap=(direction=='prev'&&activeIndex===0)||(direction=='next'&&activeIndex==(this.$items.length-1)) if(willWrap&&!this.options.wrap)return active var delta=direction=='prev'?-1:1 var itemIndex=(activeIndex+delta)%this.$items.length return this.$items.eq(itemIndex)} Carousel.prototype.to=function(pos){var that=this var activeIndex=this.getItemIndex(this.$active=this.$element.find('.item.active')) if(pos>(this.$items.length-1)||pos<0)return if(this.sliding)return this.$element.one('slid.bs.carousel',function(){that.to(pos)}) if(activeIndex==pos)return this.pause().cycle() return this.slide(pos>activeIndex?'next':'prev',this.$items.eq(pos))} Carousel.prototype.pause=function(e){e||(this.paused=true) if(this.$element.find('.next, .prev').length&&$.support.transition){this.$element.trigger($.support.transition.end) this.cycle(true)} this.interval=clearInterval(this.interval) return this} Carousel.prototype.next=function(){if(this.sliding)return return this.slide('next')} Carousel.prototype.prev=function(){if(this.sliding)return return this.slide('prev')} Carousel.prototype.slide=function(type,next){var $active=this.$element.find('.item.active') var $next=next||this.getItemForDirection(type,$active) var isCycling=this.interval var direction=type=='next'?'left':'right' var that=this if($next.hasClass('active'))return(this.sliding=false) var relatedTarget=$next[0] var slideEvent=$.Event('slide.bs.carousel',{relatedTarget:relatedTarget,direction:direction}) this.$element.trigger(slideEvent) if(slideEvent.isDefaultPrevented())return this.sliding=true isCycling&&this.pause() if(this.$indicators.length){this.$indicators.find('.active').removeClass('active') var $nextIndicator=$(this.$indicators.children()[this.getItemIndex($next)]) $nextIndicator&&$nextIndicator.addClass('active')} var slidEvent=$.Event('slid.bs.carousel',{relatedTarget:relatedTarget,direction:direction}) if($.support.transition&&this.$element.hasClass('slide')){$next.addClass(type) $next[0].offsetWidth $active.addClass(direction) $next.addClass(direction) $active.one('bsTransitionEnd',function(){$next.removeClass([type,direction].join(' ')).addClass('active') $active.removeClass(['active',direction].join(' ')) that.sliding=false setTimeout(function(){that.$element.trigger(slidEvent)},0)}).emulateTransitionEnd(Carousel.TRANSITION_DURATION)}else{$active.removeClass('active') $next.addClass('active') this.sliding=false this.$element.trigger(slidEvent)} isCycling&&this.cycle() return this} function Plugin(option){return this.each(function(){var $this=$(this) var data=$this.data('bs.carousel') var options=$.extend({},Carousel.DEFAULTS,$this.data(),typeof option=='object'&&option) var action=typeof option=='string'?option:options.slide if(!data)$this.data('bs.carousel',(data=new Carousel(this,options))) if(typeof option=='number')data.to(option) else if(action)data[action]() else if(options.interval)data.pause().cycle()})} var old=$.fn.carousel $.fn.carousel=Plugin $.fn.carousel.Constructor=Carousel $.fn.carousel.noConflict=function(){$.fn.carousel=old return this} var clickHandler=function(e){var href var $this=$(this) var $target=$($this.attr('data-target')||(href=$this.attr('href'))&&href.replace(/.*(?=#[^\s]+$)/,'')) if(!$target.hasClass('carousel'))return var options=$.extend({},$target.data(),$this.data()) var slideIndex=$this.attr('data-slide-to') if(slideIndex)options.interval=false Plugin.call($target,options) if(slideIndex){$target.data('bs.carousel').to(slideIndex)} e.preventDefault()} $(document).on('click.bs.carousel.data-api','[data-slide]',clickHandler).on('click.bs.carousel.data-api','[data-slide-to]',clickHandler) $(window).on('load',function(){$('[data-ride="carousel"]').each(function(){var $carousel=$(this) Plugin.call($carousel,$carousel.data())})})}(jQuery);+function($){'use strict';var backdrop='.dropdown-backdrop' var toggle='[data-toggle="dropdown"]' var Dropdown=function(element){$(element).on('click.bs.dropdown',this.toggle)} Dropdown.VERSION='3.3.2' Dropdown.prototype.toggle=function(e){var $this=$(this) if($this.is('.disabled, :disabled'))return var $parent=getParent($this) var isActive=$parent.hasClass('open') clearMenus() if(!isActive){if('ontouchstart'in document.documentElement&&!$parent.closest('.navbar-nav').length){$('');return this;},showYoutubeVideo:function(id){var height,width;width=this.checkDimensions(this.$element.data('width')||560);height=width/(560/315);return this.showVideoIframe('//www.youtube.com/embed/'+id+'?badge=0&autoplay=1&html5=1',width,height);},showVimeoVideo:function(id){var height,width;width=this.checkDimensions(this.$element.data('width')||560);height=width/(500/281);return this.showVideoIframe(id+'?autoplay=1',width,height);},showInstagramVideo:function(id){var height,width;width=this.checkDimensions(this.$element.data('width')||612);this.resize(width);height=width+80;this.lightbox_body.html('');this.options.onContentLoaded.call(this);if(this.modal_arrows){return this.modal_arrows.css('display','none');}},showVideoIframe:function(url,width,height){height=height||width;this.resize(width);this.lightbox_body.html('
');this.options.onContentLoaded.call(this);if(this.modal_arrows){this.modal_arrows.css('display','none');} return this;},loadRemoteContent:function(url){var disableExternalCheck,width,_this=this;width=this.$element.data('width')||560;this.resize(width);disableExternalCheck=this.$element.data('disableExternalCheck')||false;if(!disableExternalCheck&&!this.isExternal(url)){this.lightbox_body.load(url,$.proxy(function(){return _this.$element.trigger('loaded.bs.modal');}));}else{this.lightbox_body.html('');this.options.onContentLoaded.call(this);} if(this.modal_arrows){this.modal_arrows.css('display','none');} return this;},isExternal:function(url){var match;match=url.match(/^([^:\/?#]+:)?(?:\/\/([^\/?#]*))?([^?#]+)?(\?[^#]*)?(#.*)?/);if(typeof match[1]==="string"&&match[1].length>0&&match[1].toLowerCase()!==location.protocol){return true;} if(typeof match[2]==="string"&&match[2].length>0&&match[2].replace(new RegExp(":("+{"http:":80,"https:":443}[location.protocol]+")?$"),"")!==location.host){return true;} return false;},error:function(message){this.lightbox_body.html(message);return this;},preloadImage:function(src,onLoadShowImage){var img,_this=this;img=new Image();if((onLoadShowImage==null)||onLoadShowImage===true){img.onload=function(){var image;image=$('');image.attr('src',img.src);image.addClass('img-responsive');_this.lightbox_body.html(image);if(_this.modal_arrows){_this.modal_arrows.css('display','block');} _this.resize(img.width);return _this.options.onContentLoaded.call(_this);};img.onerror=function(){return _this.error('Failed to load image: '+src);};} img.src=src;return img;},resize:function(width){var width_total;width_total=width+this.border.left+this.padding.left+this.padding.right+this.border.right;this.modal_dialog.css('width','auto').css('max-width',width_total);this.lightbox_container.find('a').css('line-height',function(){return $(this).parent().height()+'px';});return this;},checkDimensions:function(width){var body_width,width_total;width_total=width+this.border.left+this.padding.left+this.padding.right+this.border.right;body_width=document.body.clientWidth;if(width_total>body_width){width=this.modal_body.width();} return width;},close:function(){return this.modal.modal('hide');},addTrailingSlash:function(url){if(url.substr(-1)!=='/'){url+='/';} return url;}};$.fn.ekkoLightbox=function(options){return this.each(function(){var $this;$this=$(this);options=$.extend({remote:$this.attr('data-remote')||$this.attr('href'),gallery_parent_selector:$this.attr('data-parent'),type:$this.attr('data-type')},options,$this.data());new EkkoLightbox(this,options);return this;});};$.fn.ekkoLightbox.defaults={gallery_parent_selector:'document.body',left_arrow_class:'.glyphicon .glyphicon-chevron-left',right_arrow_class:'.glyphicon .glyphicon-chevron-right',directional_arrows:true,type:null,always_show_close:true,loadingMessage:'Loading...',onShow:function(){},onShown:function(){},onHide:function(){},onHidden:function(){},onNavigate:function(){},onContentLoaded:function(){}};}).call(this); ; (function(factory){'use strict';if(typeof define==='function'&&define.amd){define(['jquery'],factory);}else if(typeof exports==='object'&&typeof require==='function'){factory(require('jquery'));}else{factory(jQuery);}}(function($){'use strict';var utils=(function(){return{escapeRegExChars:function(value){return value.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");},createNode:function(containerClass){var div=document.createElement('div');div.className=containerClass;div.style.position='absolute';div.style.display='none';return div;}};}()),keys={ESC:27,TAB:9,RETURN:13,LEFT:37,UP:38,RIGHT:39,DOWN:40};function Autocomplete(el,options){var noop=function(){},that=this,defaults={ajaxSettings:{},autoSelectFirst:false,appendTo:document.body,serviceUrl:null,lookup:null,onSelect:null,width:'auto',minChars:1,maxHeight:300,deferRequestBy:0,params:{},formatResult:Autocomplete.formatResult,delimiter:null,zIndex:9999,type:'GET',noCache:false,onSearchStart:noop,onSearchComplete:noop,onSearchError:noop,preserveInput:false,containerClass:'autocomplete-suggestions',tabDisabled:false,dataType:'text',currentRequest:null,triggerSelectOnValidInput:true,preventBadQueries:true,lookupFilter:function(suggestion,originalQuery,queryLowerCase){return suggestion.value.toLowerCase().indexOf(queryLowerCase)!==-1;},paramName:'query',transformResult:function(response){return typeof response==='string'?$.parseJSON(response):response;},showNoSuggestionNotice:false,noSuggestionNotice:'No results',orientation:'bottom',forceFixPosition:false};that.element=el;that.el=$(el);that.suggestions=[];that.badQueries=[];that.selectedIndex=-1;that.currentValue=that.element.value;that.intervalId=0;that.cachedResponse={};that.onChangeInterval=null;that.onChange=null;that.isLocal=false;that.suggestionsContainer=null;that.noSuggestionsContainer=null;that.options=$.extend({},defaults,options);that.classes={selected:'autocomplete-selected',suggestion:'autocomplete-suggestion'};that.hint=null;that.hintValue='';that.selection=null;that.initialize();that.setOptions(options);} Autocomplete.utils=utils;$.Autocomplete=Autocomplete;Autocomplete.formatResult=function(suggestion,currentValue){var htmlSafeString=suggestion.value.replace(/&/g,'&').replace(//g,'>').replace(/"/g,'"');var pattern='('+utils.escapeRegExChars(currentValue)+')';return htmlSafeString.replace(new RegExp(pattern,'gi'),'$1<\/strong>');};Autocomplete.prototype={killerFn:null,initialize:function(){var that=this,suggestionSelector='.'+that.classes.suggestion,selected=that.classes.selected,options=that.options,container;that.element.setAttribute('autocomplete','off');that.killerFn=function(e){if($(e.target).closest('.'+that.options.containerClass).length===0){that.killSuggestions();that.disableKillerFn();}};that.noSuggestionsContainer=$('
').html(this.options.noSuggestionNotice).get(0);that.suggestionsContainer=Autocomplete.utils.createNode(options.containerClass);container=$(that.suggestionsContainer);container.appendTo(options.appendTo);if(options.width!=='auto'){container.width(options.width);} container.on('mouseover.autocomplete',suggestionSelector,function(){that.activate($(this).data('index'));});container.on('mouseout.autocomplete',function(){that.selectedIndex=-1;container.children('.'+selected).removeClass(selected);});container.on('click.autocomplete',suggestionSelector,function(){that.select($(this).data('index'));});that.fixPositionCapture=function(){if(that.visible){that.fixPosition();}};$(window).on('resize.autocomplete',that.fixPositionCapture);that.el.on('keydown.autocomplete',function(e){that.onKeyPress(e);});that.el.on('keyup.autocomplete',function(e){that.onKeyUp(e);});that.el.on('blur.autocomplete',function(){that.onBlur();});that.el.on('focus.autocomplete',function(){that.onFocus();});that.el.on('change.autocomplete',function(e){that.onKeyUp(e);});that.el.on('input.autocomplete',function(e){that.onKeyUp(e);});},onFocus:function(){var that=this;that.fixPosition();if(that.options.minChars<=that.el.val().length){that.onValueChange();}},onBlur:function(){this.enableKillerFn();},setOptions:function(suppliedOptions){var that=this,options=that.options;$.extend(options,suppliedOptions);that.isLocal=$.isArray(options.lookup);if(that.isLocal){options.lookup=that.verifySuggestionsFormat(options.lookup);} options.orientation=that.validateOrientation(options.orientation,'bottom');$(that.suggestionsContainer).css({'max-height':options.maxHeight+'px','width':options.width+'px','z-index':options.zIndex});},clearCache:function(){this.cachedResponse={};this.badQueries=[];},clear:function(){this.clearCache();this.currentValue='';this.suggestions=[];},disable:function(){var that=this;that.disabled=true;clearInterval(that.onChangeInterval);if(that.currentRequest){that.currentRequest.abort();}},enable:function(){this.disabled=false;},fixPosition:function(){var that=this,$container=$(that.suggestionsContainer),containerParent=$container.parent().get(0);if(containerParent!==document.body&&!that.options.forceFixPosition){return;} var orientation=that.options.orientation,containerHeight=$container.outerHeight(),height=that.el.outerHeight(),offset=that.el.offset(),styles={'top':offset.top,'left':offset.left};if(orientation==='auto'){var viewPortHeight=$(window).height(),scrollTop=$(window).scrollTop(),topOverflow=-scrollTop+offset.top-containerHeight,bottomOverflow=scrollTop+viewPortHeight-(offset.top+height+containerHeight);orientation=(Math.max(topOverflow,bottomOverflow)===topOverflow)?'top':'bottom';} if(orientation==='top'){styles.top+=-containerHeight;}else{styles.top+=height;} if(containerParent!==document.body){var opacity=$container.css('opacity'),parentOffsetDiff;if(!that.visible){$container.css('opacity',0).show();} parentOffsetDiff=$container.offsetParent().offset();styles.top-=parentOffsetDiff.top;styles.left-=parentOffsetDiff.left;if(!that.visible){$container.css('opacity',opacity).hide();}} if(that.options.width==='auto'){styles.width=(that.el.outerWidth()-2)+'px';} $container.css(styles);},enableKillerFn:function(){var that=this;$(document).on('click.autocomplete',that.killerFn);},disableKillerFn:function(){var that=this;$(document).off('click.autocomplete',that.killerFn);},killSuggestions:function(){var that=this;that.stopKillSuggestions();that.intervalId=window.setInterval(function(){that.hide();that.stopKillSuggestions();},50);},stopKillSuggestions:function(){window.clearInterval(this.intervalId);},isCursorAtEnd:function(){var that=this,valLength=that.el.val().length,selectionStart=that.element.selectionStart,range;if(typeof selectionStart==='number'){return selectionStart===valLength;} if(document.selection){range=document.selection.createRange();range.moveStart('character',-valLength);return valLength===range.text.length;} return true;},onKeyPress:function(e){var that=this;if(!that.disabled&&!that.visible&&e.which===keys.DOWN&&that.currentValue){that.suggest();return;} if(that.disabled||!that.visible){return;} switch(e.which){case keys.ESC:that.el.val(that.currentValue);that.hide();break;case keys.RIGHT:if(that.hint&&that.options.onHint&&that.isCursorAtEnd()){that.selectHint();break;} return;case keys.TAB:if(that.hint&&that.options.onHint){that.selectHint();return;} if(that.selectedIndex===-1){that.hide();return;} that.select(that.selectedIndex);if(that.options.tabDisabled===false){return;} break;case keys.RETURN:if(that.selectedIndex===-1){that.hide();return;} that.select(that.selectedIndex);break;case keys.UP:that.moveUp();break;case keys.DOWN:that.moveDown();break;default:return;} e.stopImmediatePropagation();e.preventDefault();},onKeyUp:function(e){var that=this;if(that.disabled){return;} switch(e.which){case keys.UP:case keys.DOWN:return;} clearInterval(that.onChangeInterval);if(that.currentValue!==that.el.val()){that.findBestHint();if(that.options.deferRequestBy>0){that.onChangeInterval=setInterval(function(){that.onValueChange();},that.options.deferRequestBy);}else{that.onValueChange();}}},onValueChange:function(){var that=this,options=that.options,value=that.el.val(),query=that.getQuery(value),index;if(that.selection&&that.currentValue!==query){that.selection=null;(options.onInvalidateSelection||$.noop).call(that.element);} clearInterval(that.onChangeInterval);that.currentValue=value;that.selectedIndex=-1;if(options.triggerSelectOnValidInput){index=that.findSuggestionIndex(query);if(index!==-1){that.select(index);return;}} if(query.lengthlimit){data.suggestions=data.suggestions.slice(0,limit);} return data;},getSuggestions:function(q){var response,that=this,options=that.options,serviceUrl=options.serviceUrl,params,cacheKey,ajaxSettings;options.params[options.paramName]=q;params=options.ignoreParams?null:options.params;if(options.onSearchStart.call(that.element,options.params)===false){return;} if($.isFunction(options.lookup)){options.lookup(q,function(data){that.suggestions=data.suggestions;that.suggest();options.onSearchComplete.call(that.element,q,data.suggestions);});return;} if(that.isLocal){response=that.getSuggestionsLocal(q);}else{if($.isFunction(serviceUrl)){serviceUrl=serviceUrl.call(that.element,q);} cacheKey=serviceUrl+'?'+$.param(params||{});response=that.cachedResponse[cacheKey];} if(response&&$.isArray(response.suggestions)){that.suggestions=response.suggestions;that.suggest();options.onSearchComplete.call(that.element,q,response.suggestions);}else if(!that.isBadQuery(q)){if(that.currentRequest){that.currentRequest.abort();} ajaxSettings={url:serviceUrl,data:params,type:options.type,dataType:options.dataType};$.extend(ajaxSettings,options.ajaxSettings);that.currentRequest=$.ajax(ajaxSettings).done(function(data){var result;that.currentRequest=null;result=options.transformResult(data);that.processResponse(result,q,cacheKey);options.onSearchComplete.call(that.element,q,result.suggestions);}).fail(function(jqXHR,textStatus,errorThrown){options.onSearchError.call(that.element,q,jqXHR,textStatus,errorThrown);});}else{options.onSearchComplete.call(that.element,q,[]);}},isBadQuery:function(q){if(!this.options.preventBadQueries){return false;} var badQueries=this.badQueries,i=badQueries.length;while(i--){if(q.indexOf(badQueries[i])===0){return true;}} return false;},hide:function(){var that=this,container=$(that.suggestionsContainer);if($.isFunction(that.options.onHide)&&that.visible){that.options.onHide.call(that.element,container);} that.visible=false;that.selectedIndex=-1;clearInterval(that.onChangeInterval);$(that.suggestionsContainer).hide();that.signalHint(null);},suggest:function(){if(this.suggestions.length===0){if(this.options.showNoSuggestionNotice){this.noSuggestions();}else{this.hide();} return;} var that=this,options=that.options,groupBy=options.groupBy,formatResult=options.formatResult,value=that.getQuery(that.currentValue),className=that.classes.suggestion,classSelected=that.classes.selected,container=$(that.suggestionsContainer),noSuggestionsContainer=$(that.noSuggestionsContainer),beforeRender=options.beforeRender,html='',category,formatGroup=function(suggestion,index){var currentCategory=suggestion.data[groupBy];if(category===currentCategory){return'';} category=currentCategory;return'
'+category+'
';},index;if(options.triggerSelectOnValidInput){index=that.findSuggestionIndex(value);if(index!==-1){that.select(index);return;}} $.each(that.suggestions,function(i,suggestion){if(groupBy){html+=formatGroup(suggestion,value,i);} html+='
'+formatResult(suggestion,value)+'
';});this.adjustContainerWidth();noSuggestionsContainer.detach();container.html(html);if($.isFunction(beforeRender)){beforeRender.call(that.element,container);} that.fixPosition();container.show();if(options.autoSelectFirst){that.selectedIndex=0;container.scrollTop(0);container.children('.'+className).first().addClass(classSelected);} that.visible=true;that.findBestHint();},noSuggestions:function(){var that=this,container=$(that.suggestionsContainer),noSuggestionsContainer=$(that.noSuggestionsContainer);this.adjustContainerWidth();noSuggestionsContainer.detach();container.empty();container.append(noSuggestionsContainer);that.fixPosition();container.show();that.visible=true;},adjustContainerWidth:function(){var that=this,options=that.options,width,container=$(that.suggestionsContainer);if(options.width==='auto'){width=that.el.outerWidth()-2;container.width(width>0?width:300);}},findBestHint:function(){var that=this,value=that.el.val().toLowerCase(),bestMatch=null;if(!value){return;} $.each(that.suggestions,function(i,suggestion){var foundMatch=suggestion.value.toLowerCase().indexOf(value)===0;if(foundMatch){bestMatch=suggestion;} return!foundMatch;});that.signalHint(bestMatch);},signalHint:function(suggestion){var hintValue='',that=this;if(suggestion){hintValue=that.currentValue+suggestion.value.substr(that.currentValue.length);} if(that.hintValue!==hintValue){that.hintValue=hintValue;that.hint=suggestion;(this.options.onHint||$.noop)(hintValue);}},verifySuggestionsFormat:function(suggestions){if(suggestions.length&&typeof suggestions[0]==='string'){return $.map(suggestions,function(value){return{value:value,data:null};});} return suggestions;},validateOrientation:function(orientation,fallback){orientation=$.trim(orientation||'').toLowerCase();if($.inArray(orientation,['auto','bottom','top'])===-1){orientation=fallback;} return orientation;},processResponse:function(result,originalQuery,cacheKey){var that=this,options=that.options;result.suggestions=that.verifySuggestionsFormat(result.suggestions);if(!options.noCache){that.cachedResponse[cacheKey]=result;if(options.preventBadQueries&&result.suggestions.length===0){that.badQueries.push(originalQuery);}} if(originalQuery!==that.getQuery(that.currentValue)){return;} that.suggestions=result.suggestions;that.suggest();},activate:function(index){var that=this,activeItem,selected=that.classes.selected,container=$(that.suggestionsContainer),children=container.find('.'+that.classes.suggestion);container.find('.'+selected).removeClass(selected);that.selectedIndex=index;if(that.selectedIndex!==-1&&children.length>that.selectedIndex){activeItem=children.get(that.selectedIndex);$(activeItem).addClass(selected);return activeItem;} return null;},selectHint:function(){var that=this,i=$.inArray(that.hint,that.suggestions);that.select(i);},select:function(i){var that=this;that.hide();that.onSelect(i);},moveUp:function(){var that=this;if(that.selectedIndex===-1){return;} if(that.selectedIndex===0){$(that.suggestionsContainer).children().first().removeClass(that.classes.selected);that.selectedIndex=-1;that.el.val(that.currentValue);that.findBestHint();return;} that.adjustScroll(that.selectedIndex-1);},moveDown:function(){var that=this;if(that.selectedIndex===(that.suggestions.length-1)){return;} that.adjustScroll(that.selectedIndex+1);},adjustScroll:function(index){var that=this,activeItem=that.activate(index);if(!activeItem){return;} var offsetTop,upperBound,lowerBound,heightDelta=$(activeItem).outerHeight();offsetTop=activeItem.offsetTop;upperBound=$(that.suggestionsContainer).scrollTop();lowerBound=upperBound+that.options.maxHeight-heightDelta;if(offsetToplowerBound){$(that.suggestionsContainer).scrollTop(offsetTop-that.options.maxHeight+heightDelta);} if(!that.options.preserveInput){that.el.val(that.getValue(that.suggestions[index].value));} that.signalHint(null);},onSelect:function(index){var that=this,onSelectCallback=that.options.onSelect,suggestion=that.suggestions[index];that.currentValue=that.getValue(suggestion.value);if(that.currentValue!==that.el.val()&&!that.options.preserveInput){that.el.val(that.currentValue);} that.signalHint(null);that.suggestions=[];that.selection=suggestion;if($.isFunction(onSelectCallback)){onSelectCallback.call(that.element,suggestion);}},getValue:function(value){var that=this,delimiter=that.options.delimiter,currentValue,parts;if(!delimiter){return value;} currentValue=that.currentValue;parts=currentValue.split(delimiter);if(parts.length===1){return value;} return currentValue.substr(0,currentValue.length-parts[parts.length-1].length)+value;},dispose:function(){var that=this;that.el.off('.autocomplete').removeData('autocomplete');that.disableKillerFn();$(window).off('resize.autocomplete',that.fixPositionCapture);$(that.suggestionsContainer).remove();}};$.fn.autocomplete=$.fn.devbridgeAutocomplete=function(options,args){var dataKey='autocomplete';if(arguments.length===0){return this.first().data(dataKey);} return this.each(function(){var inputElement=$(this),instance=inputElement.data(dataKey);if(typeof options==='string'){if(instance&&typeof instance[options]==='function'){instance[options](args);}}else{if(instance&&instance.dispose){instance.dispose();} instance=new Autocomplete(this,options);inputElement.data(dataKey,instance);}});};})); ; if(typeof Object.create!=="function"){Object.create=function(obj){function F(){} F.prototype=obj;return new F();};} (function($,window,document){var Carousel={init:function(options,el){var base=this;base.$elem=$(el);base.options=$.extend({},$.fn.owlCarousel.options,base.$elem.data(),options);base.userOptions=options;base.loadContent();},loadContent:function(){var base=this,url;function getData(data){var i,content="";if(typeof base.options.jsonSuccess==="function"){base.options.jsonSuccess.apply(this,[data]);}else{for(i in data.owl){if(data.owl.hasOwnProperty(i)){content+=data.owl[i].item;}} base.$elem.html(content);} base.logIn();} if(typeof base.options.beforeInit==="function"){base.options.beforeInit.apply(this,[base.$elem]);} if(typeof base.options.jsonPath==="string"){url=base.options.jsonPath;$.getJSON(url,getData);}else{base.logIn();}},logIn:function(){var base=this;base.$elem.data("owl-originalStyles",base.$elem.attr("style"));base.$elem.data("owl-originalClasses",base.$elem.attr("class"));base.$elem.css({opacity:0});base.orignalItems=base.options.items;base.checkBrowser();base.wrapperWidth=0;base.checkVisible=null;base.setVars();},setVars:function(){var base=this;if(base.$elem.children().length===0){return false;} base.baseClass();base.eventTypes();base.$userItems=base.$elem.children();base.itemsAmount=base.$userItems.length;base.wrapItems();base.$owlItems=base.$elem.find(".owl-item");base.$owlWrapper=base.$elem.find(".owl-wrapper");base.playDirection="next";base.prevItem=0;base.prevArr=[0];base.currentItem=0;base.customEvents();base.onStartup();},onStartup:function(){var base=this;base.updateItems();base.calculateAll();base.buildControls();base.updateControls();base.response();base.moveEvents();base.stopOnHover();base.owlStatus();if(base.options.transitionStyle!==false){base.transitionTypes(base.options.transitionStyle);} if(base.options.autoPlay===true){base.options.autoPlay=5000;} base.play();base.$elem.find(".owl-wrapper").css("display","block");if(!base.$elem.is(":visible")){base.watchVisibility();}else{base.$elem.css("opacity",1);} base.onstartup=false;base.eachMoveUpdate();if(typeof base.options.afterInit==="function"){base.options.afterInit.apply(this,[base.$elem]);}},eachMoveUpdate:function(){var base=this;if(base.options.lazyLoad===true){base.lazyLoad();} if(base.options.autoHeight===true){base.autoHeight();} base.onVisibleItems();if(typeof base.options.afterAction==="function"){base.options.afterAction.apply(this,[base.$elem]);}},updateVars:function(){var base=this;if(typeof base.options.beforeUpdate==="function"){base.options.beforeUpdate.apply(this,[base.$elem]);} base.watchVisibility();base.updateItems();base.calculateAll();base.updatePosition();base.updateControls();base.eachMoveUpdate();if(typeof base.options.afterUpdate==="function"){base.options.afterUpdate.apply(this,[base.$elem]);}},reload:function(){var base=this;window.setTimeout(function(){base.updateVars();},0);},watchVisibility:function(){var base=this;if(base.$elem.is(":visible")===false){base.$elem.css({opacity:0});window.clearInterval(base.autoPlayInterval);window.clearInterval(base.checkVisible);}else{return false;} base.checkVisible=window.setInterval(function(){if(base.$elem.is(":visible")){base.reload();base.$elem.animate({opacity:1},200);window.clearInterval(base.checkVisible);}},500);},wrapItems:function(){var base=this;base.$userItems.wrapAll("
").wrap("
");base.$elem.find(".owl-wrapper").wrap("
");base.wrapperOuter=base.$elem.find(".owl-wrapper-outer");base.$elem.css("display","block");},baseClass:function(){var base=this,hasBaseClass=base.$elem.hasClass(base.options.baseClass),hasThemeClass=base.$elem.hasClass(base.options.theme);if(!hasBaseClass){base.$elem.addClass(base.options.baseClass);} if(!hasThemeClass){base.$elem.addClass(base.options.theme);}},updateItems:function(){var base=this,width,i;if(base.options.responsive===false){return false;} if(base.options.singleItem===true){base.options.items=base.orignalItems=1;base.options.itemsCustom=false;base.options.itemsDesktop=false;base.options.itemsDesktopSmall=false;base.options.itemsTablet=false;base.options.itemsTabletSmall=false;base.options.itemsMobile=false;return false;} width=$(base.options.responsiveBaseWidth).width();if(width>(base.options.itemsDesktop[0]||base.orignalItems)){base.options.items=base.orignalItems;} if(base.options.itemsCustom!==false){base.options.itemsCustom.sort(function(a,b){return a[0]-b[0];});for(i=0;ibase.itemsAmount&&base.options.itemsScaleUp===true){base.options.items=base.itemsAmount;}},response:function(){var base=this,smallDelay,lastWindowWidth;if(base.options.responsive!==true){return false;} lastWindowWidth=$(window).width();base.resizer=function(){if($(window).width()!==lastWindowWidth){if(base.options.autoPlay!==false){window.clearInterval(base.autoPlayInterval);} window.clearTimeout(smallDelay);smallDelay=window.setTimeout(function(){lastWindowWidth=$(window).width();base.updateVars();},base.options.responsiveRefreshRate);}};$(window).resize(base.resizer);},updatePosition:function(){var base=this;base.jumpTo(base.currentItem);if(base.options.autoPlay!==false){base.checkAp();}},appendItemsSizes:function(){var base=this,roundPages=0,lastItem=base.itemsAmount-base.options.items;base.$owlItems.each(function(index){var $this=$(this);$this.css({"width":base.itemWidth}).data("owl-item",Number(index));if(index%base.options.items===0||index===lastItem){if(!(index>lastItem)){roundPages+=1;}} $this.data("owl-roundPages",roundPages);});},appendWrapperSizes:function(){var base=this,width=base.$owlItems.length*base.itemWidth;base.$owlWrapper.css({"width":width*2,"left":0});base.appendItemsSizes();},calculateAll:function(){var base=this;base.calculateWidth();base.appendWrapperSizes();base.loops();base.max();},calculateWidth:function(){var base=this;base.itemWidth=Math.round(base.$elem.width()/base.options.items);},max:function(){var base=this,maximum=((base.itemsAmount*base.itemWidth)-base.options.items*base.itemWidth)*-1;if(base.options.items>base.itemsAmount){base.maximumItem=0;maximum=0;base.maximumPixels=0;}else{base.maximumItem=base.itemsAmount-base.options.items;base.maximumPixels=maximum;} return maximum;},min:function(){return 0;},loops:function(){var base=this,prev=0,elWidth=0,i,item,roundPageNum;base.positionsInArray=[0];base.pagesInArray=[];for(i=0;i").toggleClass("clickable",!base.browser.isTouch).appendTo(base.$elem);} if(base.options.pagination===true){base.buildPagination();} if(base.options.navigation===true){base.buildButtons();}},buildButtons:function(){var base=this,buttonsWrapper=$("
");base.owlControls.append(buttonsWrapper);base.buttonPrev=$("
",{"class":"owl-prev","html":base.options.navigationText[0]||""});base.buttonNext=$("
",{"class":"owl-next","html":base.options.navigationText[1]||""});buttonsWrapper.append(base.buttonPrev).append(base.buttonNext);buttonsWrapper.on("touchstart.owlControls mousedown.owlControls","div[class^=\"owl\"]",function(event){event.preventDefault();});buttonsWrapper.on("touchend.owlControls mouseup.owlControls","div[class^=\"owl\"]",function(event){event.preventDefault();if($(this).hasClass("owl-next")){base.next();}else{base.prev();}});},buildPagination:function(){var base=this;base.paginationWrapper=$("
");base.owlControls.append(base.paginationWrapper);base.paginationWrapper.on("touchend.owlControls mouseup.owlControls",".owl-page",function(event){event.preventDefault();if(Number($(this).data("owl-page"))!==base.currentItem){base.goTo(Number($(this).data("owl-page")),true);}});},updatePagination:function(){var base=this,counter,lastPage,lastItem,i,paginationButton,paginationButtonInner;if(base.options.pagination===false){return false;} base.paginationWrapper.html("");counter=0;lastPage=base.itemsAmount-base.itemsAmount%base.options.items;for(i=0;i",{"class":"owl-page"});paginationButtonInner=$("",{"text":base.options.paginationNumbers===true?counter:"","class":base.options.paginationNumbers===true?"owl-numbers":""});paginationButton.append(paginationButtonInner);paginationButton.data("owl-page",lastPage===i?lastItem:i);paginationButton.data("owl-roundPages",counter);base.paginationWrapper.append(paginationButton);}} base.checkPagination();},checkPagination:function(){var base=this;if(base.options.pagination===false){return false;} base.paginationWrapper.find(".owl-page").each(function(){if($(this).data("owl-roundPages")===$(base.$owlItems[base.currentItem]).data("owl-roundPages")){base.paginationWrapper.find(".owl-page").removeClass("active");$(this).addClass("active");}});},checkNavigation:function(){var base=this;if(base.options.navigation===false){return false;} if(base.options.rewindNav===false){if(base.currentItem===0&&base.maximumItem===0){base.buttonPrev.addClass("disabled");base.buttonNext.addClass("disabled");}else if(base.currentItem===0&&base.maximumItem!==0){base.buttonPrev.addClass("disabled");base.buttonNext.removeClass("disabled");}else if(base.currentItem===base.maximumItem){base.buttonPrev.removeClass("disabled");base.buttonNext.addClass("disabled");}else if(base.currentItem!==0&&base.currentItem!==base.maximumItem){base.buttonPrev.removeClass("disabled");base.buttonNext.removeClass("disabled");}}},updateControls:function(){var base=this;base.updatePagination();base.checkNavigation();if(base.owlControls){if(base.options.items>=base.itemsAmount){base.owlControls.hide();}else{base.owlControls.show();}}},destroyControls:function(){var base=this;if(base.owlControls){base.owlControls.remove();}},next:function(speed){var base=this;if(base.isTransition){return false;} base.currentItem+=base.options.scrollPerPage===true?base.options.items:1;if(base.currentItem>base.maximumItem+(base.options.scrollPerPage===true?(base.options.items-1):0)){if(base.options.rewindNav===true){base.currentItem=0;speed="rewind";}else{base.currentItem=base.maximumItem;return false;}} base.goTo(base.currentItem,speed);},prev:function(speed){var base=this;if(base.isTransition){return false;} if(base.options.scrollPerPage===true&&base.currentItem>0&&base.currentItem=base.maximumItem){position=base.maximumItem;}else if(position<=0){position=0;} base.currentItem=base.owl.currentItem=position;if(base.options.transitionStyle!==false&&drag!=="drag"&&base.options.items===1&&base.browser.support3d===true){base.swapSpeed(0);if(base.browser.support3d===true){base.transition3d(base.positionsInArray[position]);}else{base.css2slide(base.positionsInArray[position],1);} base.afterGo();base.singleItemTransition();return false;} goToPixel=base.positionsInArray[position];if(base.browser.support3d===true){base.isCss3Finish=false;if(speed===true){base.swapSpeed("paginationSpeed");window.setTimeout(function(){base.isCss3Finish=true;},base.options.paginationSpeed);}else if(speed==="rewind"){base.swapSpeed(base.options.rewindSpeed);window.setTimeout(function(){base.isCss3Finish=true;},base.options.rewindSpeed);}else{base.swapSpeed("slideSpeed");window.setTimeout(function(){base.isCss3Finish=true;},base.options.slideSpeed);} base.transition3d(goToPixel);}else{if(speed===true){base.css2slide(goToPixel,base.options.paginationSpeed);}else if(speed==="rewind"){base.css2slide(goToPixel,base.options.rewindSpeed);}else{base.css2slide(goToPixel,base.options.slideSpeed);}} base.afterGo();},jumpTo:function(position){var base=this;if(typeof base.options.beforeMove==="function"){base.options.beforeMove.apply(this,[base.$elem]);} if(position>=base.maximumItem||position===-1){position=base.maximumItem;}else if(position<=0){position=0;} base.swapSpeed(0);if(base.browser.support3d===true){base.transition3d(base.positionsInArray[position]);}else{base.css2slide(base.positionsInArray[position],1);} base.currentItem=base.owl.currentItem=position;base.afterGo();},afterGo:function(){var base=this;base.prevArr.push(base.currentItem);base.prevItem=base.owl.prevItem=base.prevArr[base.prevArr.length-2];base.prevArr.shift(0);if(base.prevItem!==base.currentItem){base.checkPagination();base.checkNavigation();base.eachMoveUpdate();if(base.options.autoPlay!==false){base.checkAp();}} if(typeof base.options.afterMove==="function"&&base.prevItem!==base.currentItem){base.options.afterMove.apply(this,[base.$elem]);}},stop:function(){var base=this;base.apStatus="stop";window.clearInterval(base.autoPlayInterval);},checkAp:function(){var base=this;if(base.apStatus!=="stop"){base.play();}},play:function(){var base=this;base.apStatus="play";if(base.options.autoPlay===false){return false;} window.clearInterval(base.autoPlayInterval);base.autoPlayInterval=window.setInterval(function(){base.next(true);},base.options.autoPlay);},swapSpeed:function(action){var base=this;if(action==="slideSpeed"){base.$owlWrapper.css(base.addCssSpeed(base.options.slideSpeed));}else if(action==="paginationSpeed"){base.$owlWrapper.css(base.addCssSpeed(base.options.paginationSpeed));}else if(typeof action!=="string"){base.$owlWrapper.css(base.addCssSpeed(action));}},addCssSpeed:function(speed){return{"-webkit-transition":"all "+speed+"ms ease","-moz-transition":"all "+speed+"ms ease","-o-transition":"all "+speed+"ms ease","transition":"all "+speed+"ms ease"};},removeTransition:function(){return{"-webkit-transition":"","-moz-transition":"","-o-transition":"","transition":""};},doTranslate:function(pixels){return{"-webkit-transform":"translate3d("+pixels+"px, 0px, 0px)","-moz-transform":"translate3d("+pixels+"px, 0px, 0px)","-o-transform":"translate3d("+pixels+"px, 0px, 0px)","-ms-transform":"translate3d("+pixels+"px, 0px, 0px)","transform":"translate3d("+pixels+"px, 0px,0px)"};},transition3d:function(value){var base=this;base.$owlWrapper.css(base.doTranslate(value));},css2move:function(value){var base=this;base.$owlWrapper.css({"left":value});},css2slide:function(value,speed){var base=this;base.isCssFinish=false;base.$owlWrapper.stop(true,true).animate({"left":value},{duration:speed||base.options.slideSpeed,complete:function(){base.isCssFinish=true;}});},checkBrowser:function(){var base=this,translate3D="translate3d(0px, 0px, 0px)",tempElem=document.createElement("div"),regex,asSupport,support3d,isTouch;tempElem.style.cssText=" -moz-transform:"+translate3D+"; -ms-transform:"+translate3D+"; -o-transform:"+translate3D+"; -webkit-transform:"+translate3D+"; transform:"+translate3D;regex=/translate3d\(0px, 0px, 0px\)/g;asSupport=tempElem.style.cssText.match(regex);support3d=(asSupport!==null&&asSupport.length===1);isTouch="ontouchstart"in window||window.navigator.msMaxTouchPoints;base.browser={"support3d":support3d,"isTouch":isTouch};},moveEvents:function(){var base=this;if(base.options.mouseDrag!==false||base.options.touchDrag!==false){base.gestures();base.disabledEvents();}},eventTypes:function(){var base=this,types=["s","e","x"];base.ev_types={};if(base.options.mouseDrag===true&&base.options.touchDrag===true){types=["touchstart.owl mousedown.owl","touchmove.owl mousemove.owl","touchend.owl touchcancel.owl mouseup.owl"];}else if(base.options.mouseDrag===false&&base.options.touchDrag===true){types=["touchstart.owl","touchmove.owl","touchend.owl touchcancel.owl"];}else if(base.options.mouseDrag===true&&base.options.touchDrag===false){types=["mousedown.owl","mousemove.owl","mouseup.owl"];} base.ev_types.start=types[0];base.ev_types.move=types[1];base.ev_types.end=types[2];},disabledEvents:function(){var base=this;base.$elem.on("dragstart.owl",function(event){event.preventDefault();});base.$elem.on("mousedown.disableTextSelect",function(e){return $(e.target).is('input, textarea, select, option');});},gestures:function(){var base=this,locals={offsetX:0,offsetY:0,baseElWidth:0,relativePos:0,position:null,minSwipe:null,maxSwipe:null,sliding:null,dargging:null,targetElement:null};base.isCssFinish=true;function getTouches(event){if(event.touches!==undefined){return{x:event.touches[0].pageX,y:event.touches[0].pageY};} if(event.touches===undefined){if(event.pageX!==undefined){return{x:event.pageX,y:event.pageY};} if(event.pageX===undefined){return{x:event.clientX,y:event.clientY};}}} function swapEvents(type){if(type==="on"){$(document).on(base.ev_types.move,dragMove);$(document).on(base.ev_types.end,dragEnd);}else if(type==="off"){$(document).off(base.ev_types.move);$(document).off(base.ev_types.end);}} function dragStart(event){var ev=event.originalEvent||event||window.event,position;if(ev.which===3){return false;} if(base.itemsAmount<=base.options.items){return;} if(base.isCssFinish===false&&!base.options.dragBeforeAnimFinish){return false;} if(base.isCss3Finish===false&&!base.options.dragBeforeAnimFinish){return false;} if(base.options.autoPlay!==false){window.clearInterval(base.autoPlayInterval);} if(base.browser.isTouch!==true&&!base.$owlWrapper.hasClass("grabbing")){base.$owlWrapper.addClass("grabbing");} base.newPosX=0;base.newRelativeX=0;$(this).css(base.removeTransition());position=$(this).position();locals.relativePos=position.left;locals.offsetX=getTouches(ev).x-position.left;locals.offsetY=getTouches(ev).y-position.top;swapEvents("on");locals.sliding=false;locals.targetElement=ev.target||ev.srcElement;} function dragMove(event){var ev=event.originalEvent||event||window.event,minSwipe,maxSwipe;base.newPosX=getTouches(ev).x-locals.offsetX;base.newPosY=getTouches(ev).y-locals.offsetY;base.newRelativeX=base.newPosX-locals.relativePos;if(typeof base.options.startDragging==="function"&&locals.dragging!==true&&base.newRelativeX!==0){locals.dragging=true;base.options.startDragging.apply(base,[base.$elem]);} if((base.newRelativeX>8||base.newRelativeX<-8)&&(base.browser.isTouch===true)){if(ev.preventDefault!==undefined){ev.preventDefault();}else{ev.returnValue=false;} locals.sliding=true;} if((base.newPosY>10||base.newPosY<-10)&&locals.sliding===false){$(document).off("touchmove.owl");} minSwipe=function(){return base.newRelativeX/5;};maxSwipe=function(){return base.maximumPixels+base.newRelativeX/5;};base.newPosX=Math.max(Math.min(base.newPosX,minSwipe()),maxSwipe());if(base.browser.support3d===true){base.transition3d(base.newPosX);}else{base.css2move(base.newPosX);}} function dragEnd(event){var ev=event.originalEvent||event||window.event,newPosition,handlers,owlStopEvent;ev.target=ev.target||ev.srcElement;locals.dragging=false;if(base.browser.isTouch!==true){base.$owlWrapper.removeClass("grabbing");} if(base.newRelativeX<0){base.dragDirection=base.owl.dragDirection="left";}else{base.dragDirection=base.owl.dragDirection="right";} if(base.newRelativeX!==0){newPosition=base.getNewPosition();base.goTo(newPosition,false,"drag");if(locals.targetElement===ev.target&&base.browser.isTouch!==true){$(ev.target).on("click.disable",function(ev){ev.stopImmediatePropagation();ev.stopPropagation();ev.preventDefault();$(ev.target).off("click.disable");});handlers=$._data(ev.target,"events").click;owlStopEvent=handlers.pop();handlers.splice(0,0,owlStopEvent);}} swapEvents("off");} base.$elem.on(base.ev_types.start,".owl-wrapper",dragStart);},getNewPosition:function(){var base=this,newPosition=base.closestItem();if(newPosition>base.maximumItem){base.currentItem=base.maximumItem;newPosition=base.maximumItem;}else if(base.newPosX>=0){newPosition=0;base.currentItem=0;} return newPosition;},closestItem:function(){var base=this,array=base.options.scrollPerPage===true?base.pagesInArray:base.positionsInArray,goal=base.newPosX,closest=null;$.each(array,function(i,v){if(goal-(base.itemWidth/20)>array[i+1]&&goal-(base.itemWidth/20)(array[i+1]||array[i]-base.itemWidth)&&base.moveDirection()==="right"){if(base.options.scrollPerPage===true){closest=array[i+1]||array[array.length-1];base.currentItem=$.inArray(closest,base.positionsInArray);}else{closest=array[i+1];base.currentItem=i+1;}}});return base.currentItem;},moveDirection:function(){var base=this,direction;if(base.newRelativeX<0){direction="right";base.playDirection="next";}else{direction="left";base.playDirection="prev";} return direction;},customEvents:function(){var base=this;base.$elem.on("owl.next",function(){base.next();});base.$elem.on("owl.prev",function(){base.prev();});base.$elem.on("owl.play",function(event,speed){base.options.autoPlay=speed;base.play();base.hoverStatus="play";});base.$elem.on("owl.stop",function(){base.stop();base.hoverStatus="stop";});base.$elem.on("owl.goTo",function(event,item){base.goTo(item);});base.$elem.on("owl.jumpTo",function(event,item){base.jumpTo(item);});},stopOnHover:function(){var base=this;if(base.options.stopOnHover===true&&base.browser.isTouch!==true&&base.options.autoPlay!==false){base.$elem.on("mouseover",function(){base.stop();});base.$elem.on("mouseout",function(){if(base.hoverStatus!=="stop"){base.play();}});}},lazyLoad:function(){var base=this,i,$item,itemNumber,$lazyImg,follow;if(base.options.lazyLoad===false){return false;} for(i=0;i=base.currentItem;}else{follow=true;} if(follow&&itemNumber=base.$userItems.length||position===-1){base.$userItems.eq(-1).after(htmlString);}else{base.$userItems.eq(position).before(htmlString);} base.setVars();},removeItem:function(targetPosition){var base=this,position;if(base.$elem.children().length===0){return false;} if(targetPosition===undefined||targetPosition===-1){position=-1;}else{position=targetPosition;} base.unWrap();base.$userItems.eq(position).remove();base.setVars();}};$.fn.owlCarousel=function(options){return this.each(function(){if($(this).data("owl-init")===true){return false;} $(this).data("owl-init",true);var carousel=Object.create(Carousel);carousel.init(options,this);$.data(this,"owlCarousel",carousel);});};$.fn.owlCarousel.options={items:5,itemsCustom:false,itemsDesktop:[1199,4],itemsDesktopSmall:[979,3],itemsTablet:[768,2],itemsTabletSmall:false,itemsMobile:[479,1],singleItem:false,itemsScaleUp:false,slideSpeed:200,paginationSpeed:800,rewindSpeed:1000,autoPlay:false,stopOnHover:false,navigation:false,navigationText:["prev","next"],rewindNav:true,scrollPerPage:false,pagination:true,paginationNumbers:false,responsive:true,responsiveRefreshRate:200,responsiveBaseWidth:window,baseClass:"owl-carousel",theme:"owl-theme",lazyLoad:false,lazyFollow:true,lazyEffect:"fade",autoHeight:false,jsonPath:false,jsonSuccess:false,dragBeforeAnimFinish:true,mouseDrag:true,touchDrag:true,addClassActive:false,transitionStyle:false,beforeUpdate:false,afterUpdate:false,beforeInit:false,afterInit:false,beforeMove:false,afterMove:false,afterAction:false,startDragging:false,afterLazyLoad:false};}(jQuery,window,document)); ; (function($){var $body=$('body:eq(0)');var initSticky=function(){$(document).unbind('scroll');var $elements=null;var stickyQueries;var stickyTop;$('.sticky').each(function(){var $this=$(this);$this.removeClass('fixed');$body.removeClass($this.attr('id')+'-fixed');$this.data('offset-top',$this.offset().top);$this.data('outer-height',$this.outerHeight());stickyQueries=function(){var belowThreshold=$(window).scrollTop()>=$this.data('offset-top');var fixed=$this.hasClass('fixed');var isSticky=$this.is(':visible')&&$this.data('outer-height')<$(window).height();if(!$this.hasClass('fixed')&&belowThreshold&&isSticky){$this.addClass('fixed');$body.addClass($this.attr('id')+'-fixed');stickyTop=$this.outerHeight();}else if($this.hasClass('fixed')&&!belowThreshold){$this.removeClass('fixed');$body.removeClass($this.attr('id')+'-fixed');stickyTop=0;}};stickyQueries();$(document).scroll(stickyQueries);});$('.sticky-second').each(function(){var $this=$(this);$this.removeClass('fixed');$body.removeClass('widget-menu-spyscroll-fixed');$this.data('offset-top',$this.offset().top);$this.data('outer-height',$this.outerHeight());if(matchMedia('only screen and (max-width: 767px)').matches){$this.removeClass('fixed');$body.removeClass($this.attr('id')+'-fixed');}else{stickyQueries=function(){var belowThreshold=($(window).scrollTop()+stickyTop)>=$this.data('offset-top');var fixed=$this.hasClass('fixed');var isSticky=$this.is(':visible')&&$this.data('outer-height')<$(window).height();if(!$this.hasClass('fixed')&&belowThreshold&&isSticky){$this.addClass('fixed');$body.addClass('widget-menu-spyscroll-fixed');}else if($this.hasClass('fixed')&&!belowThreshold){$this.removeClass('fixed');$body.removeClass('widget-menu-spyscroll-fixed');}};stickyQueries();$(document).scroll(stickyQueries);}});$('.sticky-bottom').each(function(){var $this=$(this);$this.removeClass('fixed');$body.removeClass('bottom-fixed');$this.data('outer-height',$this.outerHeight());$this.data('offset-bottom',$this.offset().top+$this.data('outer-height'));if(matchMedia('only screen and (max-height: 812px)').matches){$this.removeClass('fixed');$body.removeClass('bottom-fixed');}else{stickyQueries=function(){var aboveThreshold=($(window).height()+$(window).scrollTop())<=$this.data('offset-bottom');var fixed=$this.hasClass('fixed');var isSticky=$this.is(':visible')&&$this.data('outer-height')<$(window).height();if(!$this.hasClass('fixed')&&aboveThreshold&&isSticky){$this.addClass('fixed');$body.addClass('bottom-fixed');}else if($this.hasClass('fixed')&&!aboveThreshold){$this.removeClass('fixed');$body.removeClass('bottom-fixed');}};stickyQueries();$(document).scroll(stickyQueries);}});};$(window).load(initSticky);$(window).resize(initSticky);})(jQuery); ; (function($){var modal_html='';$('.responsive-tabs').each(function(){if($(this).find('[data-toggle=tab]').length){$(this).tabCollapse({accordionTemplate:function(heading,groupId,parentId,active){return'
'+'
'+'
'+'
'+'
'+'
';}});}});var $body=$('body');$(document).ready(function(){$('.dropdown-menu input').click(function(e){e.stopPropagation();});$('.collapse').on('show.bs.collapse',function(e){if($(this).data('siblings')){$($(this).data('siblings')).collapse('hide');}});$('table').each(function(){if($(this).parent('.table-responsive').length==0){$(this).wrap('
');}});var $main_menu=$('#main-menu');$main_menu.find('li > a:not(.dropdown-toggle)').click(function(e){e.stopPropagation();});if($main_menu.css('position')=='absolute'){$main_menu.find('.navbar-nav > li > a').click(function(){window.location=this.getAttribute('href');return false;});} $main_menu.find('ul.dropdown-menu [data-toggle=dropdown]').on('click',function(e){e.preventDefault();e.stopPropagation();$(this).parent().siblings().removeClass('open');$(this).parent().toggleClass('open');});$main_menu.on('hidden.bs.collapse',function(){$body.removeClass('menu-open');}).on('show.bs.collapse',function(){$('#header-search').removeClass('in');}).on('shown.bs.collapse',function(){$body.addClass('menu-open');}) $(".scrollTo, *[data-scroll=smooth]").each(function(){var target;if($(this).data('target')){target=$(this).data('target');}else if(this.hash){target=this.hash;}else{return false;} var $target=$(target);if($target.length){$(this).click(function(){$('html, body').animate({scrollTop:$target.offset().top},500);});}});var hash=window.location.hash;if(hash){$('ul.nav a[href="'+hash+'"]').tab('show');} $(document).delegate('*[data-toggle="lightbox"]','click',function(e){e.preventDefault();return $(this).ekkoLightbox({always_show_close:true,left_arrow_class:'.fa .fa-chevron-left .glyphicon-chevron-left',right_arrow_class:'.fa .fa-chevron-right .glyphicon-chevron-right',});});$(document).delegate('.popme','click',function(e){e.preventDefault();var $self=$(this);var $popme=$('#modal-popme');if(!$popme.length){$(modal_html).attr('id','modal-popme').appendTo($body);$popme=$('#modal-popme');} if($self.data("size")){$popme.find('.modal-dialog').addClass('modal-'+$self.data("size"));} else if($self.data("width")&&$self.data("height")){$popme.find('.modal-dialog').css('width',$self.data("width"));$popme.find('.modal-body').css('height',$self.data("height"));} if($self.data("title")){$popme.find('.modal-title').html($self.data("title"));}else if($self.attr("title")){$popme.find('.modal-title').html($self.attr("title"));}else{$popme.find('.modal-title').html($self.text());} $popme.find('.modal-footer').html('');var href='';if($self.data("href")){href=$self.data("href");}else if($(e.target).attr('href')){href=$(e.target).attr('href');}else if($self.attr('href')){href=$self.attr('href');} if(href){if(href.indexOf('#')==0){$(href).modal('open');}else{var url=href+(href.indexOf('?')>=0?"&":'?')+'output=modal';$popme.find(".modal-body").addClass('modal-iframe').css('height','auto').html('');$popme.modal();$popme.on('hide.bs.modal',function(){$popme.find(".modal-iframe").empty();});}}});$.initDatePickers=function(predecessor){if(!predecessor)predecessor="form ";var pickers=['input.datePicker','input.datePickerYear','input.datePickerDob'];$.initDatePickers.defaults={changeMonth:true,dateFormat:"dd/mm/yy",firstDay:1,hideIfNoPrevNext:true,showOn:"both",buttonImage:HOME+TEMPLATE_HOME+"/img/plugin/jquery-ui/calendar.png",buttonImageOnly:true,showButtonPanel:true,showOtherMonths:true,selectOtherMonths:true,showStatus:true,changeYear:true,yearRange:'-50:+20',onSelect:function(dateText,inst){if(inst.id.indexOf("_from")!==-1){var until_datepicker=$(predecessor+"#"+inst.id.replace("_from","_until"));until_datepicker.datepicker("option","minDate",dateText);if(!until_datepicker.val()){until_datepicker.datepicker("setDate",dateText);}}}};for(var i=0;i';}else if(suggestion.data.media_filename){html+='';} if(suggestion.value){html+=suggestion.value.replace(new RegExp('('+currentValue.replace(new RegExp('(\\'+['/','.','*','+','?','|','(',')','[',']','{','}','\\'].join('|\\')+')','g'),'\\$1')+')',"gi"),"$1<\/strong>");} return html;},onSelect:function(suggestion){populateProductPopup(suggestion.data);}});} var populateProductPopup=function(data){var modal_body='',modal_image='',$html=$(modal_html);if(data.media_preview){modal_image=data.media_preview;}else if(data.media_filename){modal_image=data.media_filename;} if(modal_image){$html.find('.modal-image').html('');}else{$html.find('.modal-image').html('');} if(data.media_description_body){modal_body+='
'+data.media_description_body+'
';} $html.find('.modal-body').html(modal_body);if(data.media_description_label){$html.find('.modal-title').html(data.media_description_label);} var modal_footer='';modal_footer+='';modal_footer+='';if(data.linked_page_url){modal_footer+='More info';} $html.find('.modal-footer').html(modal_footer);var $modal_product=$('#modal-product');if($modal_product.length){$modal_product.find('.modal-content').html($html.find('.modal-content').html());}else{$html.attr('id','modal-product').appendTo($body);$modal_product=$('#modal-product');} $modal_product.modal({show:true});$modal_product.find('.modal-prev, .modal-next').on('click',function(e){var $self=$(this);$.ajax({type:'GET',url:HOME_URL+'/product-search'+$(this).attr('href'),dataType:'json',success:function(data){if(data){populateProductPopup(data);}else{$self.remove();}}});e.preventDefault();});} $('.json-popup').click(function(e){e.preventDefault();var data=jQuery.parseJSON($(this).attr('data-json'));populateJSONPopup(data);});var populateJSONPopup=function(data){var modal_body='',modal_image='',$html=$(modal_html);$html.find('.modal-dialog').addClass('modal-lg');if(data.media_preview){modal_image=data.media_preview;}else if(data.media_filename){modal_image=data.media_filename;} if(modal_image){$html.find('.modal-image').html('');}else{$html.find('.modal-image').html('');} if(data.media_description_body){modal_body+='
'+data.media_description_body+'
';} $html.find('.modal-body').html(modal_body);if(data.media_description_label){$html.find('.modal-title').html(data.media_description_label);} var modal_footer='';modal_footer+='More info';$html.find('.modal-footer').html(modal_footer);$html.find('.modal-footer').css('height','34px');var $modal_product=$('#modal-product');if($modal_product.length){$modal_product.find('.modal-content').html($html.find('.modal-content').html());}else{$html.attr('id','modal-product').appendTo($body);$modal_product=$('#modal-product');} $modal_product.find('.modal-content').css('padding','0 0 0 29%');$modal_product.modal({show:true});$modal_product.find('.modal-btn').on('click',function(e){e.preventDefault();var $self=$(this);$.ajax({type:'GET',url:$self.attr('href'),dataType:'html',success:function(data){$modal_product.find('.modal-content').html($(data).filter('.modal-form').html()).css('padding','30px');}});});} if($('.g-map').length){$('.g-map').each(function(index,element){var map_selector=$(this).data('id'),mapAddress=$(this).data('address'),mapType=$(this).data('maptype'),zoomLvl=$(this).data('zoomlvl');$(this).attr('id',map_selector);contactemaps(map_selector,mapAddress,mapType,zoomLvl);});} function contactemaps(selector,address,type,zoom_lvl){var map=new google.maps.Map(document.getElementById(selector),{mapTypeId:google.maps.MapTypeId.type,scrollwheel:false,draggable:false,zoom:zoom_lvl,});var map_pin=HOME+"/webapp/templates/default/img/pin.png";var geocoder=new google.maps.Geocoder();geocoder.geocode({'address':address},function(results,status){if(status===google.maps.GeocoderStatus.OK){new google.maps.Marker({position:results[0].geometry.location,map:map,icon:map_pin});map.setCenter(results[0].geometry.location);}});} $('.carousel').each(function(){var $this=$(this);$this.carousel({wrap:false});$this.children('.left.carousel-control').hide();$this.on('slid.bs.carousel',function(){var carousel=$this.data('bs.carousel');var i=carousel.getItemIndex(carousel.$element.find('.item.active'));$(this).children('.carousel-control').show();if(i==0){$(this).children('.left.carousel-control').fadeOut('fast');}else if(i+1==carousel.$items.length){$(this).children('.right.carousel-control').fadeOut('fast');}});});$('.widget-carousel').each(function(){var $this=$(this);$this.owlCarousel({autoPlay:($this.data('autoplay')?$this.data('autoplay'):false),slideSpeed:550,stopOnHover:true,itemsScaleUp:true,navigation:true,navigationText:false,paginationSpeed:1000,scrollPerPage:true,items:4,itemsDesktop:[1330,4],itemsDesktopSmall:[1200,3],itemsTablet:[979,2],itemsMobile:[767,1]});});var $content_popups=$('.content-popup');var contentPopupClick=function(index,title,body){var $popme=$('#modal-popme');if(!$popme.length){$(modal_html).attr('id','modal-popme').appendTo($body);$popme=$('#modal-popme');} $popme.find('.modal-title').html(title);$popme.find('.modal-body').removeClass('modal-iframe').html(body);var footer='';var $prev=false;if(index>=1){$prev=$content_popups.eq(index-1);if($prev){footer+='';}} var $next=false;if((index+1)<$content_popups.length){$next=$content_popups.eq(index+1);if($next){footer+='';}} $popme.find('.modal-footer').html(footer);$popme.modal({show:true});$popme.find('.content-popup-prev, .content-popup-next').on('click',function(e){e.preventDefault();var $btn=$(this);index=$btn.data('index');var $content_popup=$content_popups.eq(index);title=$content_popup.find('.content-popup-title').html();body=$content_popup.find('.content-popup-body').html();contentPopupClick(index,title,body);});} $content_popups.each(function(index){$(this).find('.content-popup-btn').data('index',index).on('click',function(e){e.preventDefault();var $btn=$(this);var $content_popup=$btn.parents('.content-popup');var title='';if($btn.data("title")){title=$btn.data("title");}else if($btn.attr("title")){title=$btn.attr("title");}else{title=$btn.text();} var body=$content_popup.find('.content-popup-body').html();index=$btn.data('index');contentPopupClick(index,title,body);});});});$(window).on('load',function(){});})(jQuery); ; (function($){$(document).ready(function(){var $body=$('body');switch($body.attr('id')){case'page-frontend-home':break;case"page-frontend-application":var $form=$("#application-form");$form.find("[name='applications.application_pa_type']").on("change",function(e){switch($(this).val()){case"normal":$("#membership").removeClass("hide");$("#student").addClass("hide");$("#form-confirm").removeClass("hide");$("#membership").find("[name='applications.application_pa_university']").prop("disabled",false);$("#membership").find("[name='applications.application_ethinicity']").prop("disabled",false);$("#student").find("[name='applications.application_pa_university']").prop("disabled",true);$("#student").find("[name='applications.application_ethinicity']").prop("disabled",true);$("#student input,#student select").each(function(){$(this).val(' ');});break;case"student":$("#membership").addClass("hide");$("#student").removeClass("hide");$("#form-confirm").removeClass("hide");$("#student").find("[name='applications.application_pa_university']").prop("disabled",false);$("#student").find("[name='applications.application_ethinicity']").prop("disabled",false);$("#membership").find("[name='applications.application_pa_university']").prop("disabled",true);$("#membership").find("[name='applications.application_ethinicity']").prop("disabled",true);$("#membership input,#membership select").each(function(){$(this).val(' ');});break;default:$("#membership").addClass("hide");$("#student").addClass("hide");$("#form-confirm").addClass("hide");}});$form.find("[name='applications.application_employed']").on("change",function(e){switch($(this).val()){case"Yes":$(".collapse-employer").removeClass("hide");break;default:$(".collapse-employer").addClass("hide");}});$form.find("[name='applications.application_pa_university']").on('change',function(){var $university_input=$(this);var $university_input_custom=$university_input.parent().next().find('input[type=text]');if($university_input.val()=='Other'){$university_input_custom.attr('name',$university_input.attr('name'));$university_input_custom.parent().removeClass('hide');$university_input.attr('name','');}else if($university_input_custom.attr('name')){$university_input.attr('name',$university_input_custom.attr('name'));$university_input_custom.parent().addClass('hide');$university_input_custom.attr('name','')}});$populate_billing_address=$form.find('#input-billing-same');$populate_billing_address.on('change',function(){var address_fields=['address1','town','postcode'];for(var i=0;i1){$(this).attr('name','')}});}) break;case'page-frontend-resources':var $form=$('#form-filter-resources');var submitResourceSearch=function(e){$('.resource-results').empty().addClass('resource-loading');$.ajax({url:location.protocol+'//'+location.host+location.pathname,type:'get',data:{'type':$form.find('#media-resource-type').val(),},dataType:'html',success:function(data){$('.resource-results').removeClass('resource-loading').html($('.resource-results',data));}});return false;} $form.find('select').bind('change keyup',submitResourceSearch);break;}});})(jQuery); ;