1 2 3/* assets/js/kube.js */ 4 5(function($) 6{$.fn.accordion=function(options) 7{return this.each(function() 8{$.data(this,'accordion',{});$.data(this,'accordion',Accordion(this,options));});};function Accordion(el,options) 9{return new Accordion.prototype.init(el,options);} 10$.Accordion=Accordion;$.Accordion.NAME='accordion';$.Accordion.VERSION='1.0';$.Accordion.opts={scroll:false,collapse:true,toggle:true,titleClass:'.accordion-title',panelClass:'.accordion-panel'};Accordion.fn=$.Accordion.prototype={init:function(el,options) 11{this.$element=el!==false?$(el):false;this.loadOptions(options);this.build();if(this.opts.collapse) 12{this.closeAll();} 13else 14{this.openAll();} 15this.loadFromHash();},loadOptions:function(options) 16{this.opts=$.extend({},$.extend(true,{},$.Accordion.opts),this.$element.data(),options);},setCallback:function(type,e,data) 17{var events=$._data(this.$element[0],'events');if(events&&typeof events[type]!='undefined') 18{var value=[];var len=events[type].length;for(var i=0;i<len;i++) 19{var namespace=events[type][i].namespace;if(namespace=='tools.'+$.Accordion.NAME||namespace==$.Accordion.NAME+'.tools') 20{var callback=events[type][i].handler;value.push((typeof data=='undefined')?callback.call(this,e):callback.call(this,e,data));}} 21if(value.length==1)return value[0];else return value;} 22return(typeof data=='undefined')?e:data;},getTitles:function() 23{this.titles=this.$element.find(this.opts.titleClass);this.titles.append($('<span />').addClass('accordion-toggle'));this.titles.each(function() 24{var $el=$(this);$el.attr('rel',$el.attr('href'));});},getPanels:function() 25{this.panels=this.$element.find(this.opts.panelClass);},build:function() 26{this.getTitles();this.getPanels();this.titles.on('click',$.proxy(this.toggle,this));},loadFromHash:function() 27{if(top.location.hash==='')return;if(!this.opts.scroll)return;if(this.$element.find('[rel='+top.location.hash+']').size()===0)return;this.open(top.location.hash);this.scrollTo(top.location.hash);},toggle:function(e) 28{e.preventDefault();e.stopPropagation();var hash=$(e.target).attr('rel');if(this.opts.toggle) 29{var $target=$(e.target);var $title=$target.closest(this.opts.titleClass);var opened=$title.hasClass('accordion-title-opened');this.closeAll();if(!opened)this.open(hash);} 30else 31{if($('[rel='+hash+']').hasClass('accordion-title-opened')) 32{this.close(hash);} 33else 34{this.open(hash);}}},open:function(hash) 35{this.$title=$('[rel='+hash+']');this.$panel=$(hash);top.location.hash=hash;this.setStatus('open');this.$panel.show();this.setCallback('opened',this.$title,this.$panel);},close:function(hash) 36{this.$title=$('[rel='+hash+']');this.$panel=$(hash);this.setStatus('close');this.$panel.hide();this.setCallback('closed',this.$title,this.$panel);},setStatus:function(command) 37{var items={toggle:this.$title.find('span.accordion-toggle'),title:this.$title,panel:this.$panel};$.each(items,function(i,s) 38{if(command=='close') 39{s.removeClass('accordion-'+i+'-opened').addClass('accordion-'+i+'-closed');} 40else 41{s.removeClass('accordion-'+i+'-closed').addClass('accordion-'+i+'-opened');}});},openAll:function() 42{this.titles.each($.proxy(function(i,s) 43{this.open($(s).attr('rel'));},this));},closeAll:function() 44{this.titles.each($.proxy(function(i,s) 45{this.close($(s).attr('rel'));},this));},scrollTo:function(id) 46{$('html, body').animate({scrollTop:$(id).offset().top-50},500);}};$(window).on('load.tools.accordion',function() 47{$('[data-tools="accordion"]').accordion();});Accordion.prototype.init.prototype=Accordion.prototype;})(jQuery);(function($) 48{$.fn.autocomplete=function(options) 49{return this.each(function() 50{$.data(this,'autocomplete',{});$.data(this,'autocomplete',Autocomplete(this,options));});};function Autocomplete(el,options) 51{return new Autocomplete.prototype.init(el,options);} 52$.Autocomplete=Autocomplete;$.Autocomplete.NAME='autocomplete';$.Autocomplete.VERSION='1.0';$.Autocomplete.opts={url:false,min:2,set:'value'};Autocomplete.fn=$.Autocomplete.prototype={init:function(el,options) 53{this.$element=el!==false?$(el):false;this.loadOptions(options);this.build();},loadOptions:function(options) 54{this.opts=$.extend({},$.extend(true,{},$.Autocomplete.opts),this.$element.data(),options);},setCallback:function(type,e,data) 55{var events=$._data(this.$element[0],'events');if(events&&typeof events[type]!='undefined') 56{var value=[];var len=events[type].length;for(var i=0;i<len;i++) 57{var namespace=events[type][i].namespace;if(namespace=='tools.'+$.Autocomplete.NAME||namespace==$.Autocomplete.NAME+'.tools') 58{var callback=events[type][i].handler;value.push((typeof data=='undefined')?callback.call(this,e):callback.call(this,e,data));}} 59if(value.length==1)return value[0];else return value;} 60return(typeof data=='undefined')?e:data;},build:function() 61{this.result=$('<ul class="autocomplete">').hide();this.pos=this.$element.offset();
61this.elementHeight=this.$element.innerHeight();$('body').append(this.result);this.placement=(($(document).height()-(this.pos.top+this.elementHeight))<this.result.height())?'top':'bottom';$(document).on('click',$.proxy(this.hide,this));this.$element.on('keyup',$.proxy(function(e) 62{var value=this.$element.val();if(value.length>=this.opts.min) 63{this.$element.addClass('autocomplete-in');this.result.addClass('autocomplete-open');this.listen(e);} 64else 65{this.hide();}},this));},lookup:function() 66{$.ajax({url:this.opts.url,type:'post',data:this.$element.attr('name')+'='+this.$element.val(),success:$.proxy(function(json) 67{var data=$.parseJSON(json);this.result.html('');$.each(data,$.proxy(function(i,s) 68{var li=$('<li>');var a=$('<a href="#" rel="'+s.id+'">').html(s.value).on('click',$.proxy(this.set,this));li.append(a);this.result.append(li);},this));var top=(this.placement==='top')?(this.pos.top-this.result.height()-this.elementHeight):(this.pos.top+this.elementHeight);this.result.css({top:top+'px',left:this.pos.left+'px'});this.result.show();this.active=false;},this)});},listen:function(e) 69{if(!this.$element.hasClass('autocomplete-in'))return;e.stopPropagation();e.preventDefault();switch(e.keyCode) 70{case 40:this.select('next');break;case 38:this.select('prev');break;case 13:this.set();break;case 27:this.hide();break;default:this.lookup();break;}},select:function(type) 71{var $links=this.result.find('a');var size=$links.size();var $active=this.result.find('a.active');$active.removeClass('active');var $item=(type==='next')?$active.parent().next().children('a'):$active.parent().prev().children('a');if($item.size()===0) 72{$item=(type==='next')?$links.eq(0):$links.eq(size-1);} 73$item.addClass('active');this.active=$item;},set:function(e) 74{var $el=$(this.active);if(e) 75{e.preventDefault();$el=$(e.target);} 76var id=$el.attr('rel');var value=$el.html();if(this.opts.set=='value') 77{this.$element.val(value);} 78else 79{this.$element.val(id);} 80this.setCallback('set',id,value);this.hide();},hide:function(e) 81{if(e&&($(e.target).hasClass('autocomplete-in')||$(e.target).hasClass('autocomplete-open')||$(e.target).parents().hasClass('autocomplete-open'))) 82{return;} 83this.$element.removeClass('autocomplete-in');this.result.removeClass('autocomplete-open');this.result.hide();}};$(window).on('load.tools.autocomplete',function() 84{$('[data-tools="autocomplete"]').autocomplete();});Autocomplete.prototype.init.prototype=Autocomplete.prototype;})(jQuery);(function($) 85{$.fn.buttons=function(options) 86{return this.each(function() 87{$.data(this,'buttons',{});$.data(this,'buttons',Buttons(this,options));});};function Buttons(el,options) 88{return new Buttons.prototype.init(el,options);} 89$.Buttons=Buttons;$.Buttons.NAME='buttons';$.Buttons.VERSION='1.0';$.Buttons.opts={className:'btn',activeClassName:'btn-active',target:false,type:'switch'};Buttons.fn=$.Buttons.prototype={init:function(el,options) 90{this.$element=el!==false?$(el):false;this.loadOptions(options);this.buttons=this.getButtons();this.value=this.getValue();this.buttons.each($.proxy(function(i,s) 91{var $s=$(s);this.setDefault($s);$s.click($.proxy(function(e) 92{e.preventDefault();if(this.opts.type==='segmented')this.setSegmented($s);else if(this.opts.type==='toggle')this.setToggle($s);else this.setBasic($s);},this));},this));},loadOptions:function(options) 93{this.opts=$.extend({},$.extend(true,{},$.Buttons.opts),this.$element.data(),options);},getButtons:function() 94{return(this.opts.type==='toggle')?this.$element:this.$element.find('.'+this.opts.className);},getValue:function() 95{return(this.opts.type==='segmented')?$(this.opts.target).val().split(','):$(this.opts.target).val();},setDefault:function($el) 96{if(this.opts.type==='segmented'&&$.inArray($el.val(),this.value)!==-1) 97{this.setActive($el);} 98else if((this.opts.type==='toggle'&&this.value===1)||this.value===$el.val()) 99{this.setActive($el);}},setBasic:function($el) 100{this.setInActive(this.buttons);this.setActive($el);$(this.opts.target).val($el.val());},setSegmented:function($el) 101{var $target=$(this.opts.target);this.value=$target.val().split(',');if(!$el.hasClass(this.opts.activeClassName)) 102{this.setActive($el);this.value.push($el.val());} 103else 104{this.setInActive($el);this.value.splice(this.value.indexOf($el.val()),1);} 105$target.val(this.value.join(',').replace(/^,/,''));},setToggle:function($el) 106{if($el.hasClass(this.opts.activeClassName)) 107{this.setInActive($el);$(this.opts.target).val(0);} 108else 109{this.setActive($el);$(this.opts.target).val(1);}},setActive:function($el) 110{$el.addClass(this.opts.activeClassName);},setInActive:function($el) 111{$el.removeClass(this.opts.activeClassName);}};$(window).on('load.tools.buttons',function() 112{$('[data-tools="buttons"]').buttons();});Buttons.prototype.init.prototype=Buttons.prototype;})(jQuery);(function($) 113{$.fn.checkAll=function(options) 114{return this.each(function() 115{$.data(this,'checkAll',{});$.data(this,'checkAll',CheckAll(this,options));});};function CheckAll(el,options) 116{return new CheckAll.prototype.init(el,options);} 117$.CheckAll=CheckAll;$.CheckAll.opts={classname:false,parent:false,highlight:'highlight',target:false};CheckAll.fn=$.CheckAll.prototype={init:function(el,options) 118{this.$element=el!==false?$(el):false;this.loadOptions(options);this.$elements=$('.'+this.opts.classname);this.$target=$(this.opts.target);this.$element.on('click',$.proxy(this.load,this));this.setter=(this.opts.target)?this.$target.val().split(','):[];this.$elements.each($.proxy(this.setOnStart,this));},loadOptions:function(options) 119{this.opts=$.extend({},$.extend(true,{},$.CheckAll.opts),this.$element.data(),options);},load:function() 120{if(this.$element.prop('checked')) 121{this.$elements.prop('checked',true);if(this.opts.parent||this.opts.target) 122{this.$elements.each($.proxy(function(i,s) 123{var $s=$(s);this.setHighlight($s);this.setValue($s.val());},this));}} 124else
125{this.$elements.prop('checked',false);if(this.opts.parent)this.$elements.each($.proxy(this.removeHighlight,this));if(this.opts.target)this.$target.val('');}},setOnStart:function(i,el) 126{var $el=$(el);if(this.$element.prop('checked')||(this.setter&&($.inArray($el.val(),this.setter)!==-1))) 127{$el.prop('checked',true);this.setHighlight($el);} 128$el.on('click',$.proxy(function() 129{var checkedSize=this.$elements.filter(':checked').size();if($el.prop('checked')) 130{this.setValue($el.val());this.setHighlight($el);} 131else 132{this.removeValue($el.val());this.removeHighlight($el);} 133var prop=(checkedSize!==this.$elements.size())?false:true;this.$element.prop('checked',prop);},this));},setHighlight:function($el) 134{if(!this.opts.parent)return;$el.closest(this.opts.parent).addClass(this.opts.highlight);},removeHighlight:function(i,$el) 135{if(!this.opts.parent)return;$($el).closest(this.opts.parent).removeClass(this.opts.highlight);},setValue:function(value) 136{if(!this.opts.target)return;var str=this.$target.val();var arr=str.split(',');arr.push(value);if(str==='') 137{arr=[value];} 138this.$target.val(arr.join(','));},removeValue:function(value) 139{if(!this.opts.target)return;var arr=this.$target.val().split(',');var index=arr.indexOf(value);arr.splice(index,1);this.$target.val(arr.join(','));}};$(window).on('load.tools.buttons',function() 140{$('[data-tools="check-all"]').checkAll();});CheckAll.prototype.init.prototype=CheckAll.prototype;})(jQuery);(function($) 141{$.fn.dropdown=function(options) 142{return this.each(function() 143{$.data(this,'dropdown',{});$.data(this,'dropdown',Dropdown(this,options));});};function Dropdown(el,options) 144{return new Dropdown.prototype.init(el,options);} 145$.Dropdown=Dropdown;$.Dropdown.NAME='dropdown';$.Dropdown.VERSION='1.0';$.Dropdown.opts={target:false,targetClose:false,height:false,width:false};Dropdown.fn=$.Dropdown.prototype={init:function(el,options) 146{this.$element=el!==false?$(el):false;this.loadOptions(options);this.build();},loadOptions:function(options) 147{this.opts=$.extend({},$.extend(true,{},$.Dropdown.opts),this.$element.data(),options);},setCallback:function(type,e,data) 148{var events=$._data(this.$element[0],'events');if(events&&typeof events[type]!='undefined') 149{var value=[];var len=events[type].length;for(var i=0;i<len;i++) 150{var namespace=events[type][i].namespace;if(namespace=='tools.'+$.Dropdown.NAME||namespace==$.Dropdown.NAME+'.tools') 151{var callback=events[type][i].handler;value.push((typeof data=='undefined')?callback.call(this,e):callback.call(this,e,data));}} 152if(value.length==1)return value[0];else return value;} 153return(typeof data=='undefined')?e:data;},build:function() 154{this.$dropdown=$(this.opts.target);this.$dropdown.hide();this.$caret=$('<b class="caret"></b>');this.$element.append(this.$caret);this.setCaretUp();this.preventBodyScroll();this.$element.click($.proxy(this.toggle,this));},setCaretUp:function() 155{var height=this.$element.offset().top+this.$element.innerHeight()+this.$dropdown.innerHeight();if($(document).height()>height)return;this.$caret.addClass('caret-up');},toggle:function(e) 156{e.preventDefault();if(this.$element.hasClass('dropdown-in')) 157{this.hide();} 158else 159{this.show();}},getPlacement:function(height) 160{return($(document).height()<height)?'top':'bottom';},getPosition:function() 161{return(this.$element.closest('.navigation-fixed').size()!==0)?'fixed':'absolute';},setPosition:function() 162{var pos=this.$element.position();var elementHeight=this.$element.innerHeight();var elementWidth=this.$element.innerWidth();var height=this.$dropdown.innerHeight();var width=this.$dropdown.innerWidth();var position=this.getPosition();var placement=this.getPlacement(pos.top+height+elementHeight);var leftFix=0;if($(window).width()<(pos.left+width)) 163{leftFix=(width-elementWidth);} 164var top;var left=pos.left-leftFix;if(placement=='bottom') 165{this.$caret.removeClass('caret-up');top=(position=='fixed')?elementHeight:pos.top+elementHeight;} 166else 167{this.$caret.addClass('caret-up');top=(position=='fixed')?height:pos.top-height;} 168this.$dropdown.css({position:position,top:top+'px',left:left+'px'});},show:function() 169{$('.dropdown-in').removeClass('dropdown-in');$('.dropdown').removeClass('dropdown-open').hide();if(this.opts.height)this.$dropdown.css('min-height',this.opts.height+'px');if(this.opts.width)this.$dropdown.width(this.opts.width);this.setPosition();this.$dropdown.addClass('dropdown-open').show();this.$element.addClass('dropdown-in');$(document).on('scroll.tools.dropdown',$.proxy(this.setPosition,this));$(window).on('resize.tools.dropdown',$.proxy(this.setPosition,this));$(document).on('click.tools.dropdown touchstart.tools.dropdown',$.proxy(this.hide,this));if(this.opts.targetClose) 170{$(this.opts.targetClose).on('click.tools.dropdown',$.proxy(function(e) 171{e.preventDefault();this.hide(false);},this));} 172$(document).on('keydown.tools.dropdown',$.proxy(function(e) 173{if(e.which===27)this.hide();},this));this.setCallback('opened',this.$dropdown,this.$element);},preventBodyScroll:function() 174{this.$dropdown.on('mouseover',function(){$('html').css('overflow','hidden');});this.$dropdown.on('mouseout',function(){$('html').css('overflow','');});},hide:function(e) 175{if(e) 176{e=e.originalEvent||e;var $target=$(e.target);if($target.hasClass('caret')||$target.hasClass('dropdown-in')||$target.closest('.dropdown-open').size()!==0) 177{return;}} 178this.$dropdown.removeClass('dropdown-open').hide();this.$element.removeClass('dropdown-in');$(document).off('.tools.dropdown');$(window).off('.tools.dropdown');this.setCallback('closed',this.$dropdown,this.$element);}};$(window).on('load.tools.dropdown',function() 179{$('[data-tools="dropdown"]').dropdown();});Dropdown.prototype.init.prototype=Dropdown.prototype;})(jQuery);(function($) 180{$.fn.filterbox=function(options) 181{return this.each(function() 182{$.data(this,'filterbox',{});$.data(this,'filterbox',Filterbox(this,options));});};function Filterbox(el,options) 183{return new Filterbox.prototype.init(el,options);} 184$.Filterbox=Filterbox;$.Filterbox.NAME='filterbox';$.Filterbox.VERSION='1.0';$.Filterbox.opts={placeholder:false};Filterbox.fn=$.Filterbox.prototype={init:function(el,options) 185{this.$element=el!==false?$(el):false;this.loadOptions(options);this.build();},loadOptions:function(options) 186{this.opts=$.extend({},$.extend(true,{},$.Filterbox.opts),this.$element.data(),options);},setCallback:function(type,e,data) 187{var events=$._data(this.$element[0],'events');if(events&&typeof events[type]!='undefined') 188{var value=[];var len=events[type].length;for(var i=0;i<len;i++) 189{var namespace=events[type][i].namespace;if(namespace=='tools.'+$.Filterbox.NAME||namespace==$.Filterbox.NAME+'.tools') 190{var callback=events[type][i].handler;value.push((typeof data=='undefined')?callback.call(this,e):callback.call(this,e,data));}} 191if(value.length==1)return value[0];else return value;} 192return(typeof data=='undefined')?e:data;},build:function() 193{this.$sourceBox=$('<div class="filterbox" />');this.$sourceSelect=$('<span class="filterbox-toggle" />');this.$sourceLayer=$('<ul class="filterbox-list hide" />');this.$source=$('<input type="text" id="'+this.$element.attr('id')+'-input" class="'+this.$element.attr('class')+'" />');this.$sourceBox.append(this.$source);this.$sourceBox.append(this.$sourceSelect);this.$sourceBox.append(this.$sourceLayer);this.setPlaceholder();this.$element.hide().after(this.$sourceBox);this.$element.find('option').each($.proxy(this.buildListItemsFromOptions,this));this.$source.on('keyup',$.proxy(this.clearSelected,this));this.$sourceSelect.on('click',$.proxy(this.load,this));this.preventBodyScroll();},load:function(e) 194{e.preventDefault();if(this.$sourceLayer.hasClass('open')) 195{this.close();return;} 196var value=this.$element.val();this.$sourceLayer.addClass('open').show();var items=this.$sourceLayer.find('li').removeClass('active');this.setSelectedItem(items,value);$(document).on('click.tools.filterbox',$.proxy(this.close,this));$(document).on('keydown.tools.filterbox',$.proxy(function(e) 197{var key=e.which;var $el;var item;if(key===38) 198{e.preventDefault();if(items.hasClass('active')) 199{item=items.filter('li.active');item.removeClass('active');var prev=item.prev();
199$el=(prev.size()!==0)?$el=prev:items.last();} 200else 201{$el=items.last();} 202$el.addClass('active');this.setScrollTop($el);} 203else if(key===40) 204{e.preventDefault();if(items.hasClass('active')) 205{item=items.filter('li.active');item.removeClass('active');var next=item.next();$el=(next.size()!==0)?next:items.first();} 206else 207{$el=items.first();} 208$el.addClass('active');this.setScrollTop($el);} 209else if(key===13) 210{if(!items.hasClass('active'))return;item=items.filter('li.active');this.onItemClick(e,item);} 211else if(key===27) 212{this.close();}},this));},clearSelected:function() 213{if(this.$source.val().length===0)this.$element.val(0);},setSelectedItem:function(items,value) 214{var selectEl=items.filter('[rel='+value+']');if(selectEl.size()===0) 215{selectEl=false;var sourceValue=this.$source.val();$.each(items,function(i,s) 216{var $s=$(s);if($s.text()==sourceValue) 217{selectEl=$s;}});if(selectEl===false)return;} 218selectEl.addClass('active');this.setScrollTop(selectEl);},setScrollTop:function($el) 219{this.$sourceLayer.scrollTop(this.$sourceLayer.scrollTop()+$el.position().top-40);},buildListItemsFromOptions:function(i,s) 220{var $el=$(s);var val=$el.val();if(val===0)return;var item=$('<li />');item.attr('rel',val).text($el.html());item.on('click',$.proxy(this.onItemClick,this));this.$sourceLayer.append(item);},onItemClick:function(e,item) 221{e.preventDefault();var $el=$(item||e.target);var rel=$el.attr('rel');var text=$el.text();this.$source.val(text);this.$element.val(rel);this.close();this.setCallback('select',{id:rel,value:text});},preventBodyScroll:function() 222{this.$sourceLayer.on('mouseover',function(){$('html').css('overflow','hidden');});this.$sourceLayer.on('mouseout',function(){$('html').css('overflow','');});},setPlaceholder:function() 223{if(!this.opts.placeholder)return;this.$source.attr('placeholder',this.opts.placeholder);},close:function(e) 224{if(e&&($(e.target).hasClass('filterbox-toggle')||$(e.target).closest('div.filterbox').size()==1)) 225{return;} 226this.$sourceLayer.removeClass('open').hide();$(document).off('.tools.filterbox');}};$(window).on('load.tools.filterbox',function() 227{$('[data-tools="filterbox"]').filterbox();});Filterbox.prototype.init.prototype=Filterbox.prototype;})(jQuery);(function($) 228{$.fn.infinityScroll=function(options) 229{return this.each(function() 230{$.data(this,'infinity-scroll',{});$.data(this,'infinity-scroll',InfinityScroll(this,options));});};function InfinityScroll(el,options) 231{return new InfinityScroll.prototype.init(el,options);} 232$.InfinityScroll=InfinityScroll;$.InfinityScroll.NAME='infinity-scroll';$.InfinityScroll.VERSION='1.0';$.InfinityScroll.opts={url:false,offset:0,limit:20,tolerance:50,pagination:false};InfinityScroll.fn=$.InfinityScroll.prototype={init:function(el,options) 233{this.$element=el!==false?$(el):false;this.loadOptions(options);this.hidePagination();this.build();},loadOptions:function(options) 234{this.opts=$.extend({},$.extend(true,{},$.InfinityScroll.opts),this.$element.data(),options);},setCallback:function(type,e,data) 235{var events=$._data(this.$element[0],'events');if(events&&typeof events[type]!='undefined') 236{var value=[];var len=events[type].length;for(var i=0;i<len;i++) 237{var namespace=events[type][i].namespace;if(namespace=='tools.'+$.InfinityScroll.NAME||namespace==$.InfinityScroll.NAME+'.tools') 238{var callback=events[type][i].handler;value.push((typeof data=='undefined')?callback.call(this,e):callback.call(this,e,data));}} 239if(value.length==1)return value[0];else return value;} 240return(typeof data=='undefined')?e:data;},build:function() 241{$(window).on('DOMContentLoaded.tools.infinite-scroll load.tools.infinite-scroll resize.tools.infinite-scroll scroll.tools.infinite-scroll',$.proxy(function() 242{var $last=this.$element.children().last();if(this.isElementInViewport($last[0])) 243{this.getData();}},this));},getData:function() 244{$.ajax({url:this.opts.url,type:'post',data:'limit='+this.opts.limit+'&offset='+this.opts.offset,success:$.proxy(function(data) 245{if(data==='') 246{$(window).off('.tools.infinite-scroll');return;} 247this.opts.offset=this.opts.offset+this.opts.limit;this.$element.append(data);this.setCallback('loaded',data);},this)});},hidePagination:function() 248{if(!this.opts.pagination)return;$(this.opts.pagination).hide();},isElementInViewport:function(el) 249{var rect=el.getBoundingClientRect();return(rect.top>=0&&rect.left>=0&&rect.bottom<=$(window).height()+this.opts.tolerance&&rect.right<=$(window).width());}};$(window).on('load.tools.infinity-scroll',function() 250{$('[data-tools="infinity-scroll"]').infinityScroll();});InfinityScroll.prototype.init.prototype=InfinityScroll.prototype;})(jQuery);(function($) 251{$.fn.livesearch=function(options) 252{return this.each(function() 253{$.data(this,'livesearch',{});$.data(this,'livesearch',Livesearch(this,options));});};function Livesearch(el,options) 254{return new Livesearch.prototype.init(el,options);} 255$.Livesearch=Livesearch;$.Livesearch.NAME='livesearch';$.Livesearch.VERSION='1.0';$.Livesearch.opts={url:false,target:false,min:2,params:false,appendForms:false};Livesearch.fn=$.Livesearch.prototype={init:function(el,options) 256{this.$element=el!==false?$(el):false;this.loadOptions(options);this.build();},loadOptions:function(options) 257{this.opts=$.extend({},$.extend(true,{},$.Livesearch.opts),this.$element.data(),options);},setCallback:function(type,e,data) 258{var events=$._data(this.$element[0],'events');if(events&&typeof events[type]!='undefined') 259{var value=[];var len=events[type].length;for(var i=0;i<len;i++) 260{var namespace=events[type][i].namespace;if(namespace=='tools.'+$.Livesearch.NAME||namespace==$.Livesearch.NAME+'.tools') 261{var callback=events[type][i].handler;value.push((typeof data=='undefined')?callback.call(this,e):callback.call(this,e,data));}} 262if(value.length==1)return value[0];else return value;} 263return(typeof data=='undefined')?e:data;},build:function() 264{this.$box=$('<span class="livesearch-box" />');this.$element.after(this.$box);this.$box.append(this.$element);this.$element.off('keyup.tools.livesearch');this.$element.on('keyup.tools.livesearch',$.proxy(this.load,this));this.$icon=$('<span class="livesearch-icon" />');this.$box.append(this.$icon);this.$close=$('<span class="close" />').hide();this.$box.append(this.$close);this.$close.off('click.tools.livesearch');this.$close.on('click.tools.livesearch',$.proxy(function() 265{this.search();this.$element.val('').focus();this.$close.hide();},this));},toggleClose:function(length) 266{if(length===0)this.$close.hide();else this.$close.show();},load:function() 267{var value=this.$element.val();var data='';if(value.length>this.opts.min) 268{var name='q';if(typeof this.$element.attr('name')!='undefined')name=this.$element.attr('name');data+='&'+name+'='+value;data=this.appendForms(data);var str='';if(this.opts.params) 269{this.opts.params=$.trim(this.opts.params.replace('{','').replace('}','')) 270var properties=this.opts.params.split(',');var obj={};$.each(properties,function(k,v) 271{var tup=v.split(':');obj[$.trim(tup[0])]=$.trim(tup[1]);});str=[];$.each(obj,$.proxy(function(k,v) 272{str.push(k+"="+v);},this));str=str.join("&");data+='&'+str;}} 273this.toggleClose(value.length);this.search(data);},appendForms:function(data) 274{if(!this.opts.appendForms)return data;$.each(this.opts.appendForms,function(i,s) 275{data+='&'+$(s).serialize();});return data;},search:function(data) 276{$.ajax({url:this.opts.url,type:'post',data:data,success:$.proxy(function(result) 277{$(this.opts.target).html(result);this.setCallback('result',result);},this)});}};$(window).on('load.tools.livesearch',function() 278{$('[data-tools="livesearch"]').livesearch();});Livesearch.prototype.init.prototype=Livesearch.prototype;})(jQuery);(function($) 279{$.fn.message=function(options) 280{var val=[];
280var args=Array.prototype.slice.call(arguments,1);if(typeof options==='string') 281{this.each(function() 282{var instance=$.data(this,'message');if(typeof instance!=='undefined'&&$.isFunction(instance[options])) 283{var methodVal=instance[options].apply(instance,args);if(methodVal!==undefined&&methodVal!==instance)val.push(methodVal);} 284else return $.error('No such method "'+options+'" for Message');});} 285else 286{this.each(function() 287{$.data(this,'message',{});$.data(this,'message',Message(this,options));});} 288if(val.length===0)return this;else if(val.length===1)return val[0];else return val;};function Message(el,options) 289{return new Message.prototype.init(el,options);} 290$.Message=Message;$.Message.NAME='message';$.Message.VERSION='1.0';$.Message.opts={target:false,delay:10};Message.fn=$.Message.prototype={init:function(el,options) 291{this.$element=el!==false?$(el):false;this.loadOptions(options);this.build();},loadOptions:function(options) 292{this.opts=$.extend({},$.extend(true,{},$.Message.opts),this.$element.data(),options);},setCallback:function(type,e,data) 293{var events=$._data(this.$message[0],'events');if(events&&typeof events[type]!='undefined') 294{var value=[];var len=events[type].length;for(var i=0;i<len;i++) 295{var namespace=events[type][i].namespace;if(namespace=='tools.'+$.Message.NAME||namespace==$.Message.NAME+'.tools') 296{var callback=events[type][i].handler;value.push((typeof data=='undefined')?callback.call(this,e):callback.call(this,e,data));}} 297if(value.length==1)return value[0];else return value;} 298return(typeof data=='undefined')?e:data;},build:function() 299{if(!this.opts.target) 300{this.$message=this.$element;this.show();} 301else 302{this.$message=$(this.opts.target);this.$message.data('message','');this.$message.data('message',this);this.$element.on('click',$.proxy(this.show,this));}},show:function() 303{if(this.$message.hasClass('open')) 304{this.hide();return;} 305$('.tools-message').hide().removeClass('open');this.$message.addClass('open').fadeIn('fast').on('click.tools.message',$.proxy(this.hide,this));$(document).on('keyup.tools.message',$.proxy(this.hideHandler,this));if(this.opts.delay) 306{setTimeout($.proxy(this.hide,this),this.opts.delay*1000);} 307this.setCallback('opened');},hideHandler:function(e) 308{if(e.which!=27)return;this.hide();},hide:function() 309{if(!this.$message.hasClass('open'))return;this.$message.off('click.tools.message');$(document).off('keyup.tools.message');this.$message.fadeOut('fast',$.proxy(function() 310{this.$message.removeClass('open');this.setCallback('closed');},this));}};Message.prototype.init.prototype=Message.prototype;$(function() 311{$('[data-tools="message"]').message();});})(jQuery);(function($) 312{$.fn.modal=function(options) 313{var val=[];var args=Array.prototype.slice.call(arguments,1);if(typeof options==='string') 314{this.each(function() 315{var instance=$.data(this,'modal');if(typeof instance!=='undefined'&&$.isFunction(instance[options])) 316{var methodVal=instance[options].apply(instance,args);if(methodVal!==undefined&&methodVal!==instance)val.push(methodVal);} 317else return $.error('No such method "'+options+'" for Modal');});} 318else 319{this.each(function() 320{$.data(this,'modal',{});$.data(this,'modal',Modal(this,options));});} 321if(val.length===0)return this;else if(val.length===1)return val[0];else return val;};function Modal(el,options) 322{return new Modal.prototype.init(el,options);} 323$.Modal=Modal;$.Modal.NAME='modal';$.Modal.VERSION='1.0';$.Modal.opts={title:'',width:500,blur:false};Modal.fn=$.Modal.prototype={init:function(el,options) 324{this.$element=el!==false?$(el):false;this.loadOptions(options);this.$element.on('click.tools.modal',$.proxy(this.load,this));},loadOptions:function(options) 325{this.opts=$.extend({},$.extend(true,{},$.Modal.opts),this.$element.data(),options);},setCallback:function(type,e,data) 326{var events=$._data(this.$element[0],'events');if(events&&typeof events[type]!='undefined') 327{var value=[];var len=events[type].length;for(var i=0;i<len;i++) 328{var namespace=events[type][i].namespace;if(namespace=='tools.'+$.Modal.NAME||namespace==$.Modal.NAME+'.tools') 329{var callback=events[type][i].handler;value.push((typeof data=='undefined')?callback.call(this,e):callback.call(this,e,data));}} 330if(value.length==1)return value[0];else return value;} 331return(typeof data=='undefined')?e:data;},load:function() 332{this.build();this.enableEvents();this.setTitle();this.setDraggable();this.setContent();},build:function() 333{this.buildOverlay();this.$modalBox=$('<div class="modal-box" />').hide();this.$modal=$('<div class="modal" />');this.$modalHeader=$('<header />');this.$modalClose=$('<span class="modal-close" />').html('×');this.$modalBody=$('<section />');this.$modalFooter=$('<footer />');this.$modal.append(this.$modalHeader);this.$modal.append(this.$modalClose);this.$modal.append(this.$modalBody);this.$modal.append(this.$modalFooter);this.$modalBox.append(this.$modal);this.$modalBox.appendTo(document.body);},buildOverlay:function() 334{this.$modalOverlay=$('<div id="modal-overlay">').hide();$('body').prepend(this.$modalOverlay);if(this.opts.blur) 335{this.blurredElements=$('body').children('div, section, header, article, pre, aside, table').not('.modal, .modal-box, #modal-overlay');this.blurredElements.addClass('modal-blur');}},show:function() 336{this.setCallback('loading',this.$modal);this.bodyOveflow=$(document.body).css('overflow');$(document.body).css('overflow','hidden');if(this.isMobile()) 337{this.showOnMobile();} 338else 339{this.showOnDesktop();} 340this.$modalOverlay.show();this.$modalBox.show();this.setButtonsWidth();if(!this.isMobile()) 341{setTimeout($.proxy(this.showOnDesktop,this),0);$(window).on('resize.tools.modal',$.proxy(this.resize,this));} 342this.setCallback('opened',this.$modal);$(document).off('focusin.modal');},showOnDesktop:function() 343{var height=this.$modal.outerHeight();var windowHeight=$(window).height();var windowWidth=$(window).width();if(this.opts.width>windowWidth) 344{this.$modal.css({width:'96%',marginTop:(windowHeight/2-height/2)+'px'});return;} 345if(height>windowHeight) 346{this.$modal.css({width:this.opts.width+'px',marginTop:'20px'});} 347else 348{this.$modal.css({width:this.opts.width+'px',marginTop:(windowHeight/2-height/2)+'px'});}},showOnMobile:function() 349{this.$modal.css({width:'96%',marginTop:'2%'});},resize:function() 350{if(this.isMobile()) 351{this.showOnMobile();} 352else 353{this.showOnDesktop();}},setTitle:function() 354{this.$modalHeader.html(this.opts.title);},setContent:function() 355{if(typeof this.opts.content=='object'||this.opts.content.search('#')===0) 356{this.type='html';this.$modalBody.html($(this.opts.content).html());this.show();} 357else 358{$.ajax({url:this.opts.content,cache:false,success:$.proxy(function(data) 359{this.$modalBody.html(data);this.show();},this)});}},setDraggable:function() 360{if(typeof $.fn.draggable==='undefined')return;this.$modal.draggable({handle:this.$modalHeader});this.$modalHeader.css('cursor','move');}
360,createCancelButton:function(label) 361{if(typeof label=='undefined')label='Cancel';var button=$('<button>').addClass('btn modal-close-btn').html(label);button.on('click',$.proxy(this.close,this));this.$modalFooter.append(button);},createDeleteButton:function(label) 362{if(typeof label=='undefined')label='Delete';return this.createButton(label,'red');},createActionButton:function(label) 363{if(typeof label=='undefined')label='Ok';return this.createButton(label,'blue');},createButton:function(label,className) 364{var button=$('<button>').addClass('btn').addClass('btn-'+className).html(label);this.$modalFooter.append(button);return button;},setButtonsWidth:function() 365{var buttons=this.$modalFooter.find('button');var buttonsSize=buttons.size();if(buttonsSize===0)return;buttons.css('width',(100/buttonsSize)+'%');},enableEvents:function() 366{this.$modalClose.on('click.tools.modal',$.proxy(this.close,this));$(document).on('keyup.tools.modal',$.proxy(this.closeHandler,this));this.$modalBox.on('click.tools.modal',$.proxy(this.close,this));},disableEvents:function() 367{this.$modalClose.off('click.tools.modal');$(document).off('keyup.tools.modal');this.$modalBox.off('click.tools.modal');$(window).off('resize.tools.modal');},closeHandler:function(e) 368{if(e.which!=27)return;this.close();},close:function(e) 369{if(e) 370{if(!$(e.target).hasClass('modal-close-btn')&&e.target!=this.$modalClose[0]&&e.target!=this.$modalBox[0]) 371{return;} 372e.preventDefault();} 373if(!this.$modalBox)return;this.disableEvents();this.$modalOverlay.remove();this.$modalBox.fadeOut('fast',$.proxy(function() 374{this.$modalBox.remove();$(document.body).css('overflow',this.bodyOveflow);if(this.opts.blur&&typeof this.blurredElements!='undefined') 375{this.blurredElements.removeClass('modal-blur');} 376this.setCallback('closed');},this));},isMobile:function() 377{var mq=window.matchMedia("(max-width: 767px)");return(mq.matches)?true:false;}};$(window).on('load.tools.modal',function() 378{$('[data-tools="modal"]').modal();});Modal.prototype.init.prototype=Modal.prototype;})(jQuery);(function($) 379{$.fn.navigationFixed=function(options) 380{return this.each(function() 381{$.data(this,'navigationFixed',{});$.data(this,'navigationFixed',NavigationFixed(this,options));});};function NavigationFixed(el,options) 382{return new NavigationFixed.prototype.init(el,options);} 383$.NavigationFixed=NavigationFixed;$.NavigationFixed.NAME='navigation-fixed';$.NavigationFixed.VERSION='1.0';$.NavigationFixed.opts={};NavigationFixed.fn=$.NavigationFixed.prototype={init:function(el,options) 384{var mq=window.matchMedia("(max-width: 767px)");if(mq.matches)return;this.$element=el!==false?$(el):false;this.loadOptions(options);this.navBoxOffsetTop=this.$element.offset().top;this.build();$(window).scroll($.proxy(this.build,this));},loadOptions:function(options) 385{this.opts=$.extend({},$.extend(true,{},$.NavigationFixed.opts),this.$element.data(),options);},setCallback:function(type,e,data) 386{var events=$._data(this.$element[0],'events');if(events&&typeof events[type]!='undefined') 387{var value=[];var len=events[type].length;for(var i=0;i<len;i++) 388{var namespace=events[type][i].namespace;if(namespace=='tools.'+$.NavigationFixed.NAME||namespace==$.NavigationFixed.NAME+'.tools') 389{var callback=events[type][i].handler;value.push((typeof data=='undefined')?callback.call(this,e):callback.call(this,e,data));}} 390if(value.length==1)return value[0];else return value;} 391return(typeof data=='undefined')?e:data;},build:function() 392{if($(window).scrollTop()>this.navBoxOffsetTop) 393{this.$element.addClass('navigation-fixed');this.setCallback('fixed');} 394else 395{this.$element.removeClass('navigation-fixed');this.setCallback('unfixed');}}};$(window).on('load.tools.navigation-fixed',function() 396{$('[data-tools="navigation-fixed"]').navigationFixed();});NavigationFixed.prototype.init.prototype=NavigationFixed.prototype;})(jQuery);(function($) 397{$.fn.navigationToggle=function(options) 398{return this.each(function() 399{$.data(this,'navigationToggle',{});$.data(this,'navigationToggle',NavigationToggle(this,options));});};function NavigationToggle(el,options) 400{return new NavigationToggle.prototype.init(el,options);} 401$.NavigationToggle=NavigationToggle;$.NavigationToggle.NAME='navigation-toggle';$.NavigationToggle.VERSION='1.0';$.NavigationToggle.opts={target:false};
401NavigationToggle.fn=$.NavigationToggle.prototype={init:function(el,options) 402{this.$element=el!==false?$(el):false;this.loadOptions(options);this.$target=$(this.opts.target);this.$toggle=this.$element.find('span');this.$toggle.on('click',$.proxy(this.onClick,this));this.build();$(window).resize($.proxy(this.build,this));},loadOptions:function(options) 403{this.opts=$.extend({},$.extend(true,{},$.NavigationToggle.opts),this.$element.data(),options);},setCallback:function(type,e,data) 404{var events=$._data(this.$element[0],'events');if(events&&typeof events[type]!='undefined') 405{var value=[];var len=events[type].length;for(var i=0;i<len;i++) 406{var namespace=events[type][i].namespace;if(namespace=='tools.'+$.NavigationToggle.NAME||namespace==$.NavigationToggle.NAME+'.tools') 407{var callback=events[type][i].handler;value.push((typeof data=='undefined')?callback.call(this,e):callback.call(this,e,data));}} 408if(value.length==1)return value[0];else return value;} 409return(typeof data=='undefined')?e:data;},build:function() 410{var mq=window.matchMedia("(max-width: 767px)");if(mq.matches) 411{if(!this.$target.hasClass('navigation-target-show')) 412{this.$element.addClass('navigation-toggle-show').show();this.$target.addClass('navigation-target-show').hide();}} 413else 414{this.$element.removeClass('navigation-toggle-show').hide();this.$target.removeClass('navigation-target-show').show();}},onClick:function(e) 415{e.stopPropagation();e.preventDefault();if(this.isTargetHide()) 416{this.$element.addClass('navigation-toggle-show');this.$target.show();this.setCallback('show',this.$target);} 417else 418{this.$element.removeClass('navigation-toggle-show');this.$target.hide();this.setCallback('hide',this.$target);}},isTargetHide:function() 419{return(this.$target[0].style.display=='none')?true:false;}};$(window).on('load.tools.navigation-toggle',function() 420{$('[data-tools="navigation-toggle"]').navigationToggle();});NavigationToggle.prototype.init.prototype=NavigationToggle.prototype;})(jQuery);(function($) 421{$.progress={show:function() 422{if($('#tools-progress').length!==0) 423{$('#tools-progress').fadeIn();} 424else 425{var $progress=$('<div id="tools-progress"><span></span></div>').hide();$(document.body).append($progress);$('#tools-progress').fadeIn();}},update:function(value) 426{this.show();$('#tools-progress').find('span').css('width',value+'%');},hide:function() 427{$('#tools-progress').fadeOut(1500);}};})(jQuery);(function($) 428{$.fn.tabs=function(options) 429{var val=[];var args=Array.prototype.slice.call(arguments,1);if(typeof options==='string') 430{this.each(function() 431{var instance=$.data(this,'tabs');if(typeof instance!=='undefined'&&$.isFunction(instance[options])) 432{var methodVal=instance[options].apply(instance,args);if(methodVal!==undefined&&methodVal!==instance)val.push(methodVal);} 433else return $.error('No such method "'+options+'" for Tabs');});} 434else 435{this.each(function() 436{$.data(this,'tabs',{});$.data(this,'tabs',Tabs(this,options));});} 437if(val.length===0)return this;else if(val.length===1)return val[0];else return val;};function Tabs(el,options) 438{return new Tabs.prototype.init(el,options);} 439$.Tabs=Tabs;$.Tabs.NAME='tabs';$.Tabs.VERSION='1.0';$.Tabs.opts={equals:false,active:false};Tabs.fn=$.Tabs.prototype={init:function(el,options) 440{this.$element=el!==false?$(el):false;this.loadOptions(options);this.links=this.$element.find('a');this.tabs=[];this.links.each($.proxy(this.load,this));this.setEquals();this.setCallback('init');},loadOptions:function(options) 441{this.opts=$.extend({},$.extend(true,{},$.Tabs.opts),this.$element.data(),options);},setCallback:function(type,e,data) 442{var events=$._data(this.$element[0],'events');if(events&&typeof events[type]!='undefined') 443{var value=[];var len=events[type].length;for(var i=0;i<len;i++) 444{var namespace=events[type][i].namespace;if(namespace=='tools.'+$.Tabs.NAME||namespace==$.Tabs.NAME+'.tools') 445{var callback=events[type][i].handler;value.push((typeof data=='undefined')?callback.call(this,e):callback.call(this,e,data));}} 446if(value.length==1)return value[0];else return value;} 447return(typeof data=='undefined')?e:data;},load:function(i,el) 448{var $el=$(el);var hash=$el.attr('href');$el.attr('rel',hash);this.tabs.push($(hash));if(!$el.parent().hasClass('active')) 449{$(hash).hide();} 450this.readLocationHash(hash);if(this.opts.active!==false&&this.opts.active===hash) 451{this.show(hash);} 452$el.on('click',$.proxy(this.onClick,this));},onClick:function(e) 453{e.preventDefault();var hash=$(e.target).attr('rel');top.location.hash=hash;this.show(hash);},readLocationHash:function(hash) 454{if(top.location.hash===''||top.location.hash!=hash)return;this.opts.active=top.location.hash;},setActive:function(hash) 455{this.activeHash=hash;this.activeTab=$('[rel='+hash+']');this.links.parent().removeClass('active');this.activeTab.parent().addClass('active');},getActiveHash:function() 456{return this.activeHash;},getActiveTab:function() 457{return this.activeTab;},show:function(hash) 458{this.hideAll();$(hash).show();this.setActive(hash);this.setCallback('show',$('[rel='+hash+']'),hash);},hideAll:function() 459{$.each(this.tabs,function() 460{$(this).hide();});},setEquals:function() 461{if(!this.opts.equals)return;this.setMaxHeight(this.getMaxHeight());},setMaxHeight:function(height) 462{$.each(this.tabs,function() 463{$(this).css('min-height',height+'px');});},getMaxHeight:function() 464{var max=0;$.each(this.tabs,function() 465{var h=$(this).height();max=h>max?h:max;});return max;}};$(window).on('load.tools.tabs',function() 466{$('[data-tools="tabs"]').tabs();});Tabs.prototype.init.prototype=Tabs.prototype;})(jQuery);(function($) 467{$.fn.textfit=function(options) 468{return this.each(function() 469{$.data(this,'textfit',{});$.data(this,'textfit',Textfit(this,options));});};function Textfit(el,options) 470{return new Textfit.prototype.init(el,options);} 471$.Textfit=Textfit;$.Textfit.NAME='textfit';$.Textfit.VERSION='1.0';$.Textfit.opts={min:'10px',max:'100px',compressor:1};Textfit.fn=$.Textfit.prototype={init:function(el,options) 472{this.$element=el!==false?$(el):false;this.loadOptions(options);this.$element.css('font-size',Math.max(Math.min(this.$element.width()/(this.opts.compressor*10),parseFloat(this.opts.max)),parseFloat(this.opts.min)));},loadOptions:function(options) 473{this.opts=$.extend({},$.extend(true,{},$.Textfit.opts),this.$element.data(),options);}};$(window).on('load.tools.textfit',function() 474{$('[data-tools="textfit"]').textfit();});Textfit.prototype.init.prototype=Textfit.prototype;})(jQuery);(function($) 475{$.fn.tooltip=function(options) 476{return this.each(function() 477{$.data(this,'tooltip',{});$.data(this,'tooltip',Tooltip(this,options));});};function Tooltip(el,options) 478{return new Tooltip.prototype.init(el,options);} 479$.Tooltip=Tooltip;$.Tooltip.NAME='tooltip';$.Tooltip.VERSION='1.0';$.Tooltip.opts={theme:false};Tooltip.fn=$.Tooltip.prototype={init:function(el,options) 480{this.$element=el!==false?$(el):false;this.loadOptions(options);this.$element.on('mouseover',$.proxy(this.show,this));this.$element.on('mouseout',$.proxy(this.hide,this));},loadOptions:function(options) 481{this.opts=$.extend({},$.extend(true,{},$.Tooltip.opts),this.$element.data(),options);},show:function() 482{$('.tooltip').hide();var text=this.$element.attr('title');this.$element.data('cached-title',text);this.$element.attr('title','');this.tooltip=$('<div class="tooltip" />').html(text).hide();if(this.opts.theme!==false) 483{this.tooltip.addClass('tooltip-theme-'+this.opts.theme);} 484this.tooltip.css({top:(this.$element.offset().top+this.$element.innerHe
484ight())+'px',left:this.$element.offset().left+'px'});$('body').append(this.tooltip);this.tooltip.show();},hide:function() 485{this.tooltip.fadeOut('fast',$.proxy(function() 486{this.tooltip.remove();},this));this.$element.attr('title',this.$element.data('cached-title'));this.$element.data('cached-title','');}};Tooltip.prototype.init.prototype=Tooltip.prototype;$(function() 487{$('[data-tools="tooltip"]').tooltip();});})(jQuery);(function($) 488{$.fn.upload=function(options) 489{return this.each(function() 490{$.data(this,'upload',{});$.data(this,'upload',Upload(this,options));});};function Upload(el,options) 491{return new Upload.prototype.init(el,options);} 492$.Upload=Upload;$.Upload.NAME='upload';$.Upload.VERSION='1.0';$.Upload.opts={url:false,placeholder:'Drop file here or ',param:'file'};Upload.fn=$.Upload.prototype={init:function(el,options) 493{this.$element=el!==false?$(el):false;this.loadOptions(options);this.load();},loadOptions:function(options) 494{this.opts=$.extend({},$.extend(true,{},$.Upload.opts),this.$element.data(),options);},setCallback:function(type,e,data) 495{var events=$._data(this.$element[0],'events');if(events&&typeof events[type]!='undefined') 496{var value=[];var len=events[type].length;for(var i=0;i<len;i++) 497{var namespace=events[type][i].namespace;if(namespace=='tools.'+$.Upload.NAME||namespace==$.Upload.NAME+'.tools') 498{var callback=events[type][i].handler;value.push((typeof data=='undefined')?callback.call(this,e):callback.call(this,e,data));}} 499if(value.length==1)return value[0];else return value;} 500return(typeof data=='undefined')?e:data;},load:function() 501{this.$droparea=$('<div class="tools-droparea" />');this.$placeholdler=$('<div class="tools-droparea-placeholder" />').text(this.opts.placeholder);this.$droparea.append(this.$placeholdler);this.$element.after(this.$droparea);this.$placeholdler.append(this.$element);this.$droparea.off('.tools.upload');this.$element.off('.tools.upload');this.$droparea.on('dragover.tools.upload',$.proxy(this.onDrag,this));this.$droparea.on('dragleave.tools.upload',$.proxy(this.onDragLeave,this));this.$element.on('change.tools.upload',$.proxy(function(e) 502{e=e.originalEvent||e;this.traverseFile(this.$element[0].files[0],e);},this));this.$droparea.on('drop.tools.upload',$.proxy(function(e) 503{e.preventDefault();this.$droparea.removeClass('drag-hover').addClass('drag-drop');this.onDrop(e);},this));},onDrop:function(e) 504{e=e.originalEvent||e;var files=e.dataTransfer.files;this.traverseFile(files[0],e);},traverseFile:function(file,e) 505{var formData=!!window.FormData?new FormData():null;if(window.FormData) 506{formData.append(this.opts.param,file);} 507if($.progress)$.progress.show();this.sendData(formData,e);},sendData:function(formData,e) 508{var xhr=new XMLHttpRequest();xhr.open('POST',this.opts.url);xhr.onreadystatechange=$.proxy(function() 509{if(xhr.readyState==4) 510{var data=xhr.responseText;data=data.replace(/^\[/,'');data=data.replace(/\]$/,'');var json=(typeof data==='string'?$.parseJSON(data):data);if($.progress)$.progress.hide();this.$droparea.removeClass('drag-drop');this.setCallback('success',json);}},this);xhr.send(formData);},onDrag:function(e) 511{e.preventDefault();this.$droparea.addClass('drag-hover');},onDragLeave:function(e) 512{e.preventDefault();this.$droparea.removeClass('drag-hover');}};Upload.prototype.init.prototype=Upload.prototype;$(function() 513{$('[data-tools="upload"]').upload();});})(jQuery); 514 515/* assets/js/magnific.js */ 516 517(function(a){typeof define=="function"&&define.amd?define(["jquery"],a):typeof exports=="object"?a(require("jquery")):a(window.jQuery||window.Zepto)})(function(a){var b="Close",c="BeforeClose",d="AfterClose",e="BeforeAppend",f="MarkupParse",g="Open",h="Change",i="mfp",j="."+i,k="mfp-ready",l="mfp-removing",m="mfp-prevent-close",n,o=function(){},p=!!window.jQuery,q,r=a(window),s,t,u,v,w=function(a,b){n.ev.on(i+a+j,b)},x=function(b,c,d,e){var f=document.createElement("div");return f.className="mfp-"+b,d&&(f.innerHTML=d),e?c&&c.appendChild(f):(f=a(f),c&&f.appendTo(c)),f},y=function(b,c){n.ev.triggerHandler(i+b,c),n.st.callbacks&&(b=b.charAt(0).toLowerCase()+b.slice(1),n.st.callbacks[b]&&n.st.callbacks[b].apply(n,a.isArray(c)?c:[c]))},z=function(b){if(b!==v||!n.currTemplate.closeBtn)n.currTemplate.closeBtn=a(n.st.closeMarkup.replace("%title%",n.st.tClose)),v=b;return n.currTemplate.closeBtn},A=function(){a.magnificPopup.instance||(n=new o,n.init(),a.magnificPopup.instance=n)},B=function(){var a=document.createElement("p").style,b=["ms","O","Moz","Webkit"];
517if(a.transition!==undefined)return!0;while(b.length)if(b.pop()+"Transition"in a)return!0;return!1};o.prototype={constructor:o,init:function(){var b=navigator.appVersion;n.isIE7=b.indexOf("MSIE 7.")!==-1,n.isIE8=b.indexOf("MSIE 8.")!==-1,n.isLowIE=n.isIE7||n.isIE8,n.isAndroid=/android/gi.test(b),n.isIOS=/iphone|ipad|ipod/gi.test(b),n.supportsTransition=B(),n.probablyMobile=n.isAndroid||n.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent),s=a(document),n.popupsCache={}},open:function(b){var c;if(b.isObj===!1){n.items=b.items.toArray(),n.index=0;var d=b.items,e;for(c=0;c<d.length;c++){e=d[c],e.parsed&&(e=e.el[0]);if(e===b.el[0]){n.index=c;break}}}else n.items=a.isArray(b.items)?b.items:[b.items],n.index=b.index||0;if(n.isOpen){n.updateItemHTML();return}n.types=[],u="",b.mainEl&&b.mainEl.length?n.ev=b.mainEl.eq(0):n.ev=s,b.key?(n.popupsCache[b.key]||(n.popupsCache[b.key]={}),n.currTemplate=n.popupsCache[b.key]):n.currTemplate={},n.st=a.extend(!0,{},a.magnificPopup.defaults,b),n.fixedContentPos=n.st.fixedContentPos==="auto"?!n.probablyMobile:n.st.fixedContentPos,n.st.modal&&(n.st.closeOnContentClick=!1,n.st.closeOnBgClick=!1,n.st.showCloseBtn=!1,n.st.enableEscapeKey=!1),n.bgOverlay||(n.bgOverlay=x("bg").on("click"+j,function(){n.close()}),n.wrap=x("wrap").attr("tabindex",-1).on("click"+j,function(a){n._checkIfClose(a.target)&&n.close()}),n.container=x("container",n.wrap)),n.contentContainer=x("content"),n.st.preloader&&(n.preloader=x("preloader",n.container,n.st.tLoading));var h=a.magnificPopup.modules;for(c=0;c<h.length;c++){var i=h[c];i=i.charAt(0).toUpperCase()+i.slice(1),n["init"+i].call(n)}y("BeforeOpen"),n.st.showCloseBtn&&(n.st.closeBtnInside?(w(f,function(a,b,c,d){c.close_replaceWith=z(d.type)}),u+=" mfp-close-btn-in"):n.wrap.append(z())),n.st.alignTop&&(u+=" mfp-align-top"),n.fixedContentPos?n.wrap.css({overflow:n.st.overflowY,overflowX:"hidden",overflowY:n.st.overflowY}):n.wrap.css({top:r.scrollTop(),position:"absolute"}),(n.st.fixedBgPos===!1||n.st.fixedBgPos==="auto"&&!n.fixedContentPos)&&n.bgOverlay.css({height:s.height(),position:"absolute"}),n.st.enableEscapeKey&&s.on("keyup"+j,function(a){a.keyCode===27&&n.close()}),r.on("resize"+j,function(){n.updateSize()}),n.st.closeOnContentClick||(u+=" mfp-auto-cursor"),u&&n.wrap.addClass(u);var l=n.wH=r.height(),m={};if(n.fixedContentPos&&n._hasScrollBar(l)){var o=n._getScrollbarSize();o&&(m.marginRight=o)}n.fixedContentPos&&(n.isIE7?a("body, html").css("overflow","hidden"):m.overflow="hidden");var p=n.st.mainClass;return n.isIE7&&(p+=" mfp-ie7"),p&&n._addClassToMFP(p),n.updateItemHTML(),y("BuildControls"),a("html").css(m),n.bgOverlay.add(n.wrap).prependTo(n.st.prependTo||a(document.body)),n._lastFocusedEl=document.activeElement,setTimeout(function(){n.content?(n._addClassToMFP(k),n._setFocus()):n.bgOverlay.addClass(k),s.on("focusin"+j,n._onFocusIn)},16),n.isOpen=!0,n.updateSize(l),y(g),b},close:function(){if(!n.isOpen)return;y(c),n.isOpen=!1,n.st.removalDelay&&!n.isLowIE&&n.supportsTransition?(n._addClassToMFP(l),setTimeout(function(){n._close()},n.st.removalDelay)):n._close()},_close:function(){y(b);var c=l+" "+k+" ";n.bgOverlay.detach(),n.wrap.detach(),n.container.empty(),n.st.mainClass&&(c+=n.st.mainClass+" "),n._removeClassFromMFP(c);if(n.fixedContentPos){var e={marginRight:""};n.isIE7?a("body, html").css("overflow",""):e.overflow="",a("html").css(e)}s.off("keyup"+j+" focusin"+j),n.ev.off(j),n.wrap.attr("class","mfp-wrap").removeAttr("style"),n.bgOverlay.attr("class","mfp-bg"),n.container.attr("class","mfp-container"),n.st.showCloseBtn&&(!n.st.closeBtnInside||n.currTemplate[n.currItem.type]===!0)&&n.currTemplate.closeBtn&&n.currTemplate.closeBtn.detach(),n._lastFocusedEl&&a(n._lastFocusedEl).focus(),n.currItem=null,n.content=null,n.currTemplate=null,n.prevHeight=0,y(d)},updateSize:function(a){if(n.isIOS){var b=document.documentElement.clientWidth/window.innerWidth,c=window.innerHeight*b;n.wrap.css("height",c),n.wH=c}else n.wH=a||r.height();n.fixedContentPos||n.wrap.css("height",n.wH),y("Resize")},updateItemHTML:function(){var b=n.items[n.index];n.contentContainer.detach(),n.content&&n.content.detach(),b.parsed||(b=n.parseEl(n.index));var c=b.type;y("BeforeChange",[n.currItem?n.currItem.type:"",c]),n.currItem=b;if(!n.currTemplate[c]){var d=n.st[c]?n.st[c].markup:!1;y("FirstMarkupParse",d),d?n.currTemplate[c]=a(d):n.currTemplate[c]=!0}t&&t!==b.type&&n.container.removeClass("mfp-"+t+"-holder");var e=n["get"+c.charAt(0).toUpperCase()+c.slice(1)](b,n.currTemplate[c]);n.appendContent(e,c),b.preloaded=!0,y(h,b),t=b.type,n.container.prepend(n.contentContainer),y("AfterChange")},appendContent:function(a,b){n.content=a,a?n.st.showCloseBtn&&n.st.closeBtnInside&&n.currTemplate[b]===!0?n.content.find(".mfp-close").length||n.c
517ontent.append(z()):n.content=a:n.content="",y(e),n.container.addClass("mfp-"+b+"-holder"),n.contentContainer.append(n.content)},parseEl:function(b){var c=n.items[b],d;c.tagName?c={el:a(c)}:(d=c.type,c={data:c,src:c.src});if(c.el){var e=n.types;for(var f=0;f<e.length;f++)if(c.el.hasClass("mfp-"+e[f])){d=e[f];break}c.src=c.el.attr("data-mfp-src"),c.src||(c.src=c.el.attr("href"))}return c.type=d||n.st.type||"inline",c.index=b,c.parsed=!0,n.items[b]=c,y("ElementParse",c),n.items[b]},addGroup:function(a,b){var c=function(c){c.mfpEl=this,n._openClick(c,a,b)};b||(b={});var d="click.magnificPopup";b.mainEl=a,b.items?(b.isObj=!0,a.off(d).on(d,c)):(b.isObj=!1,b.delegate?a.off(d).on(d,b.delegate,c):(b.items=a,a.off(d).on(d,c)))},_openClick:function(b,c,d){var e=d.midClick!==undefined?d.midClick:a.magnificPopup.defaults.midClick;if(!e&&(b.which===2||b.ctrlKey||b.metaKey))return;var f=d.disableOn!==undefined?d.disableOn:a.magnificPopup.defaults.disableOn;if(f)if(a.isFunction(f)){if(!f.call(n))return!0}else if(r.width()<f)return!0;b.type&&(b.preventDefault(),n.isOpen&&b.stopPropagation()),d.el=a(b.mfpEl),d.delegate&&(d.items=c.find(d.delegate)),n.open(d)},updateStatus:function(a,b){if(n.preloader){q!==a&&n.container.removeClass("mfp-s-"+q),!b&&a==="loading"&&(b=n.st.tLoading);var c={status:a,text:b};y("UpdateStatus",c),a=c.status,b=c.text,n.preloader.html(b),n.preloader.find("a").on("click",function(a){a.stopImmediatePropagation()}),n.container.addClass("mfp-s-"+a),q=a}},_checkIfClose:function(b){if(a(b).hasClass(m))return;var c=n.st.closeOnContentClick,d=n.st.closeOnBgClick;if(c&&d)return!0;if(!n.content||a(b).hasClass("mfp-close")||n.preloader&&b===n.preloader[0])return!0;if(b!==n.content[0]&&!a.contains(n.content[0],b)){if(d&&a.contains(document,b))return!0}else if(c)return!0;return!1},_addClassToMFP:function(a){n.bgOverlay.addClass(a),n.wrap.addClass(a)},_removeClassFromMFP:function(a){this.bgOverlay.removeClass(a),n.wrap.removeClass(a)},_hasScrollBar:function(a){return(n.isIE7?s.height():document.body.scrollHeight)>(a||r.height())},_setFocus:function(){(n.st.focus?n.content.find(n.st.focus).eq(0):n.wrap).focus()},_onFocusIn:function(b){if(b.target!==n.wrap[0]&&!a.contains(n.wrap[0],b.target))return n._setFocus(),!1},_parseMarkup:function(b,c,d){var e;d.data&&(c=a.extend(d.data,c)),y(f,[b,c,d]),a.each(c,function(a,c){if(c===undefined||c===!1)return!0;e=a.split("_");if(e.length>1){var d=b.find(j+"-"+e[0]);if(d.length>0){var f=e[1];f==="replaceWith"?d[0]!==c[0]&&d.replaceWith(c):f==="img"?d.is("img")?d.attr("src",c):d.replaceWith('<img src="'+c+'" class="'+d.attr("class")+'" />'):d.attr(e[1],c)}}else b.find(j+"-"+a).html(c)})},_getScrollbarSize:function(){if(n.scrollbarSize===undefined){var a=document.createElement("div");a.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(a),n.scrollbarSize=a.offsetWidth-a.clientWidth,document.body.removeChild(a)}return n.scrollbarSize}},a.magnificPopup={instance:null,proto:o.prototype,modules:[],open:function(b,c){return A(),b?b=a.extend(!0,{},b):b={},b.isObj=!0,b.index=c||0,this.instance.open(b)},close:function(){return a.magnificPopup.instance&&a.magnificPopup.instance.close()},registerModule:function(b,c){c.options&&(a.magnificPopup.defaults[b]=c.options),a.extend(this.proto,c.proto),this.modules.push(b)},defaults:{disableOn:0,key:null,midClick:!1,mainClass:"",preloader:!0,focus:"",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:!0,showCloseBtn:!0,enableEscapeKey:!0,modal:!1,alignTop:!1,removalDelay:0,prependTo:null,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'<button title="%title%" type="button" class="mfp-close">×</button>',tClose:"Close (Esc)",tLoading:"Loading..."}},a.fn.magnificPopup=function(b){A();var c=a(this);if(typeof b=="string")if(b==="open"){var d,e=p?c.data("magnificPopup"):c[0].magnificPopup,f=parseInt(arguments[1],10)||0;e.items?d=e.items[f]:(d=c,e.delegate&&(d=d.find(e.delegate)),d=d.eq(f)),n._openClick({mfpEl:d},c,e)}else n.isOpen&&n[b].apply(n,Array.prototype.slice.call(arguments,1
517));else b=a.extend(!0,{},b),p?c.data("magnificPopup",b):c[0].magnificPopup=b,n.addGroup(c,b);return c};var C="inline",D,E,F,G=function(){F&&(E.after(F.addClass(D)).detach(),F=null)};a.magnificPopup.registerModule(C,{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){n.types.push(C),w(b+"."+C,function(){G()})},getInline:function(b,c){G();if(b.src){var d=n.st.inline,e=a(b.src);if(e.length){var f=e[0].parentNode;f&&f.tagName&&(E||(D=d.hiddenClass,E=x(D),D="mfp-"+D),F=e.after(E).detach().removeClass(D)),n.updateStatus("ready")}else n.updateStatus("error",d.tNotFound),e=a("<div>");return b.inlineElement=e,e}return n.updateStatus("ready"),n._parseMarkup(c,{},b),c}}});var H="ajax",I,J=function(){I&&a(document.body).removeClass(I)},K=function(){J(),n.req&&n.req.abort()};a.magnificPopup.registerModule(H,{options:{settings:null,cursor:"mfp-ajax-cur",tError:'<a href="%url%">The content</a> could not be loaded.'},proto:{initAjax:function(){n.types.push(H),I=n.st.ajax.cursor,w(b+"."+H,K),w("BeforeChange."+H,K)},getAjax:function(b){I&&a(document.body).addClass(I),n.updateStatus("loading");var c=a.extend({url:b.src,success:function(c,d,e){var f={data:c,xhr:e};y("ParseAjax",f),n.appendContent(a(f.data),H),b.finished=!0,J(),n._setFocus(),setTimeout(function(){n.wrap.addClass(k)},16),n.updateStatus("ready"),y("AjaxContentAdded")},error:function(){J(),b.finished=b.loadError=!0,n.updateStatus("error",n.st.ajax.tError.replace("%url%",b.src))}},n.st.ajax.settings);return n.req=a.ajax(c),""}}});var L,M=function(b){if(b.data&&b.data.title!==undefined)return b.data.title;var c=n.st.image.titleSrc;if(c){if(a.isFunction(c))return c.call(n,b);if(b.el)return b.el.attr(c)||""}return""};a.magnificPopup.registerModule("image",{options:{markup:'<div class="mfp-figure"><div class="mfp-close"></div><figure><div class="mfp-img"></div><figcaption><div class="mfp-bottom-bar"><div class="mfp-title"></div><div class="mfp-counter"></div></div></figcaption></figure></div>',cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:!0,tError:'<a href="%url%">The image</a> could not be loaded.'},proto:{initImage:function(){var c=n.st.image,d=".image";n.types.push("image"),w(g+d,function(){n.currItem.type==="image"&&c.cursor&&a(document.body).addClass(c.cursor)}),w(b+d,function(){c.cursor&&a(document.body).removeClass(c.cursor),r.off("resize"+j)}),w("Resize"+d,n.resizeImage),n.isLowIE&&w("AfterChange",n.resizeImage)},resizeImage:function(){var a=n.currItem;if(!a||!a.img)return;if(n.st.image.verticalFit){var b=0;n.isLowIE&&(b=parseInt(a.img.css("padding-top"),10)+parseInt(a.img.css("padding-bottom"),10)),a.img.css("max-height",n.wH-b)}},_onImageHasSize:function(a){a.img&&(a.hasSize=!0,L&&clearInterval(L),a.isCheckingImgSize=!1,y("ImageHasSize",a),a.imgHidden&&(n.content&&n.content.removeClass("mfp-loading"),a.imgHidden=!1))},findImageSize:function(a){var b=0,c=a.img[0],d=function(e){L&&clearInterval(L),L=setInterval(function(){if(c.naturalWidth>0){n._onImageHasSize(a);return}b>200&&clearInterval(L),b++,b===3?d(10):b===40?d(50):b===100&&d(500)},e)};d(1)},getImage:function(b,c){var d=0,e=function(){b&&(b.img[0].complete?(b.img.off(".mfploader"),b===n.currItem&&(n._onImageHasSize(b),n.updateStatus("ready")),b.hasSize=!0,b.loaded=!0,y("ImageLoadComplete")):(d++,d<200?setTimeout(e,100):f()))},f=function(){b&&(b.img.off(".mfploader"),b===n.currItem&&(n._onImageHasSize(b),n.updateStatus("error",g.tError.replace("%url%",b.src))),b.hasSize=!0,b.loaded=!0,b.loadError=!0)},g=n.st.image,h=c.find(".mfp-img");if(h.length){var i=document.createElement("img");i.className="mfp-img",b.el&&b.el.find("img").length&&(i.alt=b.el.find("img").attr("alt")),b.img=a(i).on("load.mfploader",e).on("error.mfploader",f),i.src=b.src,h.is("img")&&(b.img=b.img.clone()),i=b.img[0],i.naturalWidth>0?b.hasSize=!0:i.width||(b.hasSize=!1)}return n._parseMarkup(c,{title:M(b),img_replaceWith:b.img},b),n.resizeImage(),b.hasSize?(L&&clearInterval(L),b.loadError?(c.addClass("mfp-loading"),n.updateStatus("error",g.tError.replace("%url%",b.src))):(c.removeClass("mfp-loading"),n.updateStatus("ready")),c):(n.updateStatus("loading"),b.loading=!0,b.hasSize||(b.imgHidden=!0,c.addClass("mfp-loading"),n.findImageSize(b)),c)}}});
517var N,O=function(){return N===undefined&&(N=document.createElement("p").style.MozTransform!==undefined),N};a.magnificPopup.registerModule("zoom",{options:{enabled:!1,easing:"ease-in-out",duration:300,opener:function(a){return a.is("img")?a:a.find("img")}},proto:{initZoom:function(){var a=n.st.zoom,d=".zoom",e;if(!a.enabled||!n.supportsTransition)return;var f=a.duration,g=function(b){var c=b.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),d="all "+a.duration/1e3+"s "+a.easing,e={position:"fixed",zIndex:9999,left:0,top:0,"-webkit-backface-visibility":"hidden"},f="transition";return e["-webkit-"+f]=e["-moz-"+f]=e["-o-"+f]=e[f]=d,c.css(e),c},h=function(){n.content.css("visibility","visible")},i,j;w("BuildControls"+d,function(){if(n._allowZoom()){clearTimeout(i),n.content.css("visibility","hidden"),e=n._getItemToZoom();if(!e){h();return}j=g(e),j.css(n._getOffset()),n.wrap.append(j),i=setTimeout(function(){j.css(n._getOffset(!0)),i=setTimeout(function(){h(),setTimeout(function(){j.remove(),e=j=null,y("ZoomAnimationEnded")},16)},f)},16)}}),w(c+d,function(){if(n._allowZoom()){clearTimeout(i),n.st.removalDelay=f;if(!e){e=n._getItemToZoom();if(!e)return;j=g(e)}j.css(n._getOffset(!0)),n.wrap.append(j),n.content.css("visibility","hidden"),setTimeout(function(){j.css(n._getOffset())},16)}}),w(b+d,function(){n._allowZoom()&&(h(),j&&j.remove(),e=null)})},_allowZoom:function(){return n.currItem.type==="image"},_getItemToZoom:function(){return n.currItem.hasSize?n.currItem.img:!1},_getOffset:function(b){var c;b?c=n.currItem.img:c=n.st.zoom.opener(n.currItem.el||n.currItem);var d=c.offset(),e=parseInt(c.css("padding-top"),10),f=parseInt(c.css("padding-bottom"),10);d.top-=a(window).scrollTop()-e;var g={width:c.width(),height:(p?c.innerHeight():c[0].offsetHeight)-f-e};return O()?g["-moz-transform"]=g.transform="translate("+d.left+"px,"+d.top+"px)":(g.left=d.left,g.top=d.top),g}}});var P="iframe",Q="//about:blank",R=function(a){if(n.currTemplate[P]){var b=n.currTemplate[P].find("iframe");b.length&&(a||(b[0].src=Q),n.isIE8&&b.css("display",a?"block":"none"))}};a.magnificPopup.registerModule(P,{options:{markup:'<div class="mfp-iframe-scaler"><div class="mfp-close"></div><iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe></div>',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){n.types.push(P),w("BeforeChange",function(a,b,c){b!==c&&(b===P?R():c===P&&R(!0))}),w(b+"."+P,function(){R()})},getIframe:function(b,c){var d=b.src,e=n.st.iframe;a.each(e.patterns,function(){if(d.indexOf(this.index)>-1)return this.id&&(typeof this.id=="string"?d=d.substr(d.lastIndexOf(this.id)+this.id.length,d.length):d=this.id.call(this,d)),d=this.src.replace("%id%",d),!1});var f={};return e.srcAction&&(f[e.srcAction]=d),n._parseMarkup(c,f,b),n.updateStatus("ready"),c}}});var S=function(a){var b=n.items.length;return a>b-1?a-b:a<0?b+a:a},T=function(a,b,c){return a.replace(/%curr%/gi,b+1).replace(/%total%/gi,c)};a.magnificPopup.registerModule("gallery",{options:{enabled:!1,arrowMarkup:'<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%"},proto:{initGallery:function(){var c=n.st.gallery,d=".mfp-gallery",e=Boolean(a.fn.mfpFastClick);n.direction=!0;if(!c||!c.enabled)return!1;u+=" mfp-gallery",w(g+d,function(){c.navigateByImgClick&&n.wrap.on("click"+d,".mfp-img",function(){if(n.items.length>1)return n.next(),!1}),s.on("keydown"+d,function(a){a.keyCode===37?n.prev():a.keyCode===39&&n.next()})}),w("UpdateStatus"+d,function(a,b){b.text&&(b.text=T(b.text,n.currItem.index,n.items.length))}),w(f+d,function(a,b,d,e){var f=n.items.length;d.counter=f>1?T(c.tCounter,e.index,f):""}),w("BuildControls"+d,function(){if(n.items.length>1&&c.arrows&&!n.arrowLeft){var b=c.arrowMarkup,d=n.arrowLeft=a(b.replace(/%title%/gi,c.tPrev).replace(/%dir%/gi,"left")).addClass(m),f=n.arrowRight=a(b.replace(/%title%/gi,c.tNext).replace(/%dir%/gi,"right")).addClass(m),g=e?"mfpFastClick":"click";d[g](function(){n.prev()}),f[g](function(){n.next()}),n.isIE7&&(x("b",d[0],!1,!0),x("a",d[0],!1,!0),x("b",f[0],!1,!0),x("a",f[0],!1,!0)),n.container.append(d.add(f))}}),w(h+d,function(){n._preloadTimeout&&clearTimeout(n._preloadTimeout),n._preloadTimeout=setTimeout(function(){n.preloadNearbyImages(),n._preloadTimeout=null},16)}
517),w(b+d,function(){s.off(d),n.wrap.off("click"+d),n.arrowLeft&&e&&n.arrowLeft.add(n.arrowRight).destroyMfpFastClick(),n.arrowRight=n.arrowLeft=null})},next:function(){n.direction=!0,n.index=S(n.index+1),n.updateItemHTML()},prev:function(){n.direction=!1,n.index=S(n.index-1),n.updateItemHTML()},goTo:function(a){n.direction=a>=n.index,n.index=a,n.updateItemHTML()},preloadNearbyImages:function(){var a=n.st.gallery.preload,b=Math.min(a[0],n.items.length),c=Math.min(a[1],n.items.length),d;for(d=1;d<=(n.direction?c:b);d++)n._preloadItem(n.index+d);for(d=1;d<=(n.direction?b:c);d++)n._preloadItem(n.index-d)},_preloadItem:function(b){b=S(b);if(n.items[b].preloaded)return;var c=n.items[b];c.parsed||(c=n.parseEl(b)),y("LazyLoad",c),c.type==="image"&&(c.img=a('<img class="mfp-img" />').on("load.mfploader",function(){c.hasSize=!0}).on("error.mfploader",function(){c.hasSize=!0,c.loadError=!0,y("LazyLoadError",c)}).attr("src",c.src)),c.preloaded=!0}}});var U="retina";a.magnificPopup.registerModule(U,{options:{replaceSrc:function(a){return a.src.replace(/\.\w+$/,function(a){return"@2x"+a})},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var a=n.st.retina,b=a.ratio;b=isNaN(b)?b():b,b>1&&(w("ImageHasSize."+U,function(a,c){c.img.css({"max-width":c.img[0].naturalWidth/b,width:"100%"})}),w("ElementParse."+U,function(c,d){d.src=a.replaceSrc(d,b)}))}}}}),function(){var b=1e3,c="ontouchstart"in window,d=function(){r.off("touchmove"+f+" touchend"+f)},e="mfpFastClick",f="."+e;a.fn.mfpFastClick=function(e){return a(this).each(function(){var g=a(this),h;if(c){var i,j,k,l,m,n;g.on("touchstart"+f,function(a){l=!1,n=1,m=a.originalEvent?a.originalEvent.touches[0]:a.touches[0],j=m.clientX,k=m.clientY,r.on("touchmove"+f,function(a){m=a.originalEvent?a.originalEvent.touches:a.touches,n=m.length,m=m[0];if(Math.abs(m.clientX-j)>10||Math.abs(m.clientY-k)>10)l=!0,d()}).on("touchend"+f,function(a){d();if(l||n>1)return;h=!0,a.preventDefault(),clearTimeout(i),i=setTimeout(function(){h=!1},b),e()})})}g.on("click"+f,function(){h||e()})})},a.fn.destroyMfpFastClick=function(){a(this).off("touchstart"+f+" click"+f),c&&r.off("touchmove"+f+" touchend"+f)}}(),A()}) 518 519/* assets/snippets/easyForm/js/easyForm.js */ 520 521$(document).ready(function(){$(".validation_message").css({'display':'none'});function showInfo(msg){var inf=$("<div class='easyForm_errors'>"+msg+"</div>");inf.appendTo("body").fadeIn("fast",function(){setTimeout(function(){inf.fadeOut("slow")},3300,function(){})});} 522$(document).on("submit","form.easyForm",function(event){event.preventDefault();var fd=$(this).serialize();var url=furl+$(this).attr("action");var parent_id=$(this).parent("div").attr("id");$.ajax({url:url,data:fd,type:"POST",beforeSend:function(){$("div#"+parent_id).css({'opacity':'.8'});},success:function(msg){var response=$(msg).find("div#"+parent_id).html();var error=$(msg).find("div.validation_message .errors").html();if(error){showInfo(error);$("div#"+parent_id).html(response);$("div#"+parent_id).find("div.validation_message").css({'display':'none'});$("div#"+parent_id).css({'opacity':'1'});$("div#"+parent_id+" input[type='checkbox'].required").each(function(){$(this).parent().parent().addClass("required");}) 523$("div#"+parent_id+" input[type='radio'].required").each(function(){$(this).parent().parent().addClass("required");})} 524else{$("div#"+parent_id).css({'opacity':'1'});$("div#"+parent_id).html('<h3>СпаÑибо!</h3><p>ÐаÑа инÑоÑмаÑÐ¸Ñ ÑÑпеÑно оÑпÑавлена.</p>');}}});}) 525$(document).on("keyup change","input.required,textarea.required,input.invalid,textarea.invalid",function(e){$(this).removeClass("required").removeClass("invalid");$(this).parent().parent().removeClass("required");});})
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.