(function(){function e(){}function t(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function n(e){return function(){return this[e].apply(this,arguments)}}var i=e.prototype,r=this,o=r.EventEmitter;i.getListeners=function(e){var t,n,i=this._getEvents();if("object"==typeof e){t={};for(n in i)i.hasOwnProperty(n)&&e.test(n)&&(t[n]=i[n])}else t=i[e]||(i[e]=[]);return t},i.flattenListeners=function(e){var t,n=[];for(t=0;e.length>t;t+=1)n.push(e[t].listener);return n},i.getListenersAsObject=function(e){var t,n=this.getListeners(e);return n instanceof Array&&(t={},t[e]=n),t||n},i.addListener=function(e,n){var i,r=this.getListenersAsObject(e),o="object"==typeof n;for(i in r)r.hasOwnProperty(i)&&-1===t(r[i],n)&&r[i].push(o?n:{listener:n,once:!1});return this},i.on=n("addListener"),i.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},i.once=n("addOnceListener"),i.defineEvent=function(e){return this.getListeners(e),this},i.defineEvents=function(e){for(var t=0;e.length>t;t+=1)this.defineEvent(e[t]);return this},i.removeListener=function(e,n){var i,r,o=this.getListenersAsObject(e);for(r in o)o.hasOwnProperty(r)&&(i=t(o[r],n),-1!==i&&o[r].splice(i,1));return this},i.off=n("removeListener"),i.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},i.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},i.manipulateListeners=function(e,t,n){var i,r,o=e?this.removeListener:this.addListener,s=e?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(i=n.length;i--;)o.call(this,t,n[i]);else for(i in t)t.hasOwnProperty(i)&&(r=t[i])&&("function"==typeof r?o.call(this,i,r):s.call(this,i,r));return this},i.removeEvent=function(e){var t,n=typeof e,i=this._getEvents();if("string"===n)delete i[e];else if("object"===n)for(t in i)i.hasOwnProperty(t)&&e.test(t)&&delete i[t];else delete this._events;return this},i.removeAllListeners=n("removeEvent"),i.emitEvent=function(e,t){var n,i,r,o,s=this.getListenersAsObject(e);for(r in s)if(s.hasOwnProperty(r))for(i=s[r].length;i--;)n=s[r][i],n.once===!0&&this.removeListener(e,n.listener),o=n.listener.apply(this,t||[]),o===this._getOnceReturnValue()&&this.removeListener(e,n.listener);return this},i.trigger=n("emitEvent"),i.emit=function(e){var t=Array.prototype.slice.call(arguments,1);return this.emitEvent(e,t)},i.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},i._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:!0},i._getEvents=function(){return this._events||(this._events={})},e.noConflict=function(){return r.EventEmitter=o,e},"function"==typeof define&&define.amd?define("eventEmitter/EventEmitter",[],function(){return e}):"object"==typeof module&&module.exports?module.exports=e:this.EventEmitter=e}).call(this),function(e){function t(t){var n=e.event;return n.target=n.target||n.srcElement||t,n}var n=document.documentElement,i=function(){};n.addEventListener?i=function(e,t,n){e.addEventListener(t,n,!1)}:n.attachEvent&&(i=function(e,n,i){e[n+i]=i.handleEvent?function(){var n=t(e);i.handleEvent.call(i,n)}:function(){var n=t(e);i.call(e,n)},e.attachEvent("on"+n,e[n+i])});var r=function(){};n.removeEventListener?r=function(e,t,n){e.removeEventListener(t,n,!1)}:n.detachEvent&&(r=function(e,t,n){e.detachEvent("on"+t,e[t+n]);try{delete e[t+n]}catch(i){e[t+n]=void 0}});var o={bind:i,unbind:r};"function"==typeof define&&define.amd?define("eventie/eventie",o):e.eventie=o}(this),function(e,t){"function"==typeof define&&define.amd?define(["eventEmitter/EventEmitter","eventie/eventie"],function(n,i){return t(e,n,i)}):"object"==typeof exports&&typeof module!='undefined'&&module.exports?module.exports=t(e,require("eventEmitter"),require("eventie")):e.imagesLoaded=t(e,e.EventEmitter,e.eventie)}(this,function(e,t,n){function i(e,t){for(var n in t)e[n]=t[n];return e}function r(e){return"[object Array]"===d.call(e)}function o(e){var t=[];if(r(e))t=e;else if("number"==typeof e.length)for(var n=0,i=e.length;i>n;n++)t.push(e[n]);else t.push(e);return t}function s(e,t,n){if(!(this instanceof s))return new s(e,t);"string"==typeof e&&(e=document.querySelectorAll(e)),this.elements=o(e),this.options=i({},this.options),"function"==typeof t?n=t:i(this.options,t),n&&this.on("always",n),this.getImages(),a&&(this.jqDeferred=new a.Deferred);var r=this;setTimeout(function(){r.check()})}function c(e){this.img=e}function f(e){this.src=e,v[e]=this}var a=e.jQuery,u=e.console,h=u!==void 0,d=Object.prototype.toString;s.prototype=new t,s.prototype.options={},s.prototype.getImages=function(){this.images=[];for(var e=0,t=this.elements.length;t>e;e++){var n=this.elements[e];"IMG"===n.nodeName&&this.addImage(n);var i=n.nodeType;if(i&&(1===i||9===i||11===i))for(var r=n.querySelectorAll("img"),o=0,s=r.length;s>o;o++){var c=r[o];this.addImage(c)}}},s.prototype.addImage=function(e){var t=new c(e);this.images.push(t)},s.prototype.check=function(){function e(e,r){return t.options.debug&&h&&u.log("confirm",e,r),t.progress(e),n++,n===i&&t.complete(),!0}var t=this,n=0,i=this.images.length;if(this.hasAnyBroken=!1,!i)return this.complete(),void 0;for(var r=0;i>r;r++){var o=this.images[r];o.on("confirm",e),o.check()}},s.prototype.progress=function(e){this.hasAnyBroken=this.hasAnyBroken||!e.isLoaded;var t=this;setTimeout(function(){t.emit("progress",t,e),t.jqDeferred&&t.jqDeferred.notify&&t.jqDeferred.notify(t,e)})},s.prototype.complete=function(){var e=this.hasAnyBroken?"fail":"done";this.isComplete=!0;var t=this;setTimeout(function(){if(t.emit(e,t),t.emit("always",t),t.jqDeferred){var n=t.hasAnyBroken?"reject":"resolve";t.jqDeferred[n](t)}})},a&&(a.fn.imagesLoaded=function(e,t){var n=new s(this,e,t);return n.jqDeferred.promise(a(this))}),c.prototype=new t,c.prototype.check=function(){var e=v[this.img.src]||new f(this.img.src);if(e.isConfirmed)return this.confirm(e.isLoaded,"cached was confirmed"),void 0;if(this.img.complete&&void 0!==this.img.naturalWidth)return this.confirm(0!==this.img.naturalWidth,"naturalWidth"),void 0;var t=this;e.on("confirm",function(e,n){return t.confirm(e.isLoaded,n),!0}),e.check()},c.prototype.confirm=function(e,t){this.isLoaded=e,this.emit("confirm",this,t)};var v={};return f.prototype=new t,f.prototype.check=function(){if(!this.isChecked){var e=new Image;n.bind(e,"load",this),n.bind(e,"error",this),e.src=this.src,this.isChecked=!0}},f.prototype.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},f.prototype.onload=function(e){this.confirm(!0,"onload"),this.unbindProxyEvents(e)},f.prototype.onerror=function(e){this.confirm(!1,"onerror"),this.unbindProxyEvents(e)},f.prototype.confirm=function(e,t){this.isConfirmed=!0,this.isLoaded=e,this.emit("confirm",this,t)},f.prototype.unbindProxyEvents=function(e){n.unbind(e.target,"load",this),n.unbind(e.target,"error",this)},s}); jQuery.easing["jswing"]=jQuery.easing["swing"];jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(e,t,n,r,i){return jQuery.easing[jQuery.easing.def](e,t,n,r,i)},easeInQuad:function(e,t,n,r,i){return r*(t/=i)*t+n},easeOutQuad:function(e,t,n,r,i){return-r*(t/=i)*(t-2)+n},easeInOutQuad:function(e,t,n,r,i){if((t/=i/2)<1)return r/2*t*t+n;return-r/2*(--t*(t-2)-1)+n},easeInCubic:function(e,t,n,r,i){return r*(t/=i)*t*t+n},easeOutCubic:function(e,t,n,r,i){return r*((t=t/i-1)*t*t+1)+n},easeInOutCubic:function(e,t,n,r,i){if((t/=i/2)<1)return r/2*t*t*t+n;return r/2*((t-=2)*t*t+2)+n},easeInQuart:function(e,t,n,r,i){return r*(t/=i)*t*t*t+n},easeOutQuart:function(e,t,n,r,i){return-r*((t=t/i-1)*t*t*t-1)+n},easeInOutQuart:function(e,t,n,r,i){if((t/=i/2)<1)return r/2*t*t*t*t+n;return-r/2*((t-=2)*t*t*t-2)+n},easeInQuint:function(e,t,n,r,i){return r*(t/=i)*t*t*t*t+n},easeOutQuint:function(e,t,n,r,i){return r*((t=t/i-1)*t*t*t*t+1)+n},easeInOutQuint:function(e,t,n,r,i){if((t/=i/2)<1)return r/2*t*t*t*t*t+n;return r/2*((t-=2)*t*t*t*t+2)+n},easeInSine:function(e,t,n,r,i){return-r*Math.cos(t/i*(Math.PI/2))+r+n},easeOutSine:function(e,t,n,r,i){return r*Math.sin(t/i*(Math.PI/2))+n},easeInOutSine:function(e,t,n,r,i){return-r/2*(Math.cos(Math.PI*t/i)-1)+n},easeInExpo:function(e,t,n,r,i){return t==0?n:r*Math.pow(2,10*(t/i-1))+n},easeOutExpo:function(e,t,n,r,i){return t==i?n+r:r*(-Math.pow(2,-10*t/i)+1)+n},easeInOutExpo:function(e,t,n,r,i){if(t==0)return n;if(t==i)return n+r;if((t/=i/2)<1)return r/2*Math.pow(2,10*(t-1))+n;return r/2*(-Math.pow(2,-10*--t)+2)+n},easeInCirc:function(e,t,n,r,i){return-r*(Math.sqrt(1-(t/=i)*t)-1)+n},easeOutCirc:function(e,t,n,r,i){return r*Math.sqrt(1-(t=t/i-1)*t)+n},easeInOutCirc:function(e,t,n,r,i){if((t/=i/2)<1)return-r/2*(Math.sqrt(1-t*t)-1)+n;return r/2*(Math.sqrt(1-(t-=2)*t)+1)+n},easeInElastic:function(e,t,n,r,i){var s=1.70158;var o=0;var u=r;if(t==0)return n;if((t/=i)==1)return n+r;if(!o)o=i*.3;if(u
'; if(pp_settings.isShowButtonLink){ attributesHtml +='
'; } attributesHtml +=''; } markupHtml = '
' + '
 
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '' + ppTranslationVar['cExpand'] + '' + ''; if(pp_settings.isShowAttributes){ if(pp_settings.attributesPosition=='left'){ markupHtml +=attributesHtml + '
'; }else{ markupHtml +='
' + attributesHtml; }}else{ markupHtml +='
'; } markupHtml +='
' + '' + '

'; if(pp_settings.isShowHovThumbnail==1){ markupHtml +='
'; } markupHtml +='
{pp_social}
' + '
'; if(pp_settings.isShowLinkBtn==1){ markupHtml +='' + '' + '' + ppTranslationVar['cDetails'] + '' + '' + '' + ''; } if(pp_settings.isShowRotateBtn==1){ markupHtml +='' + '' + '' + ppTranslationVar['cRotate'] + '' + '' + '' + ''; } markupHtml +='' + '' + '' + ppTranslationVar['close'] + '' + '' + '' + '' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
' + '
'; pp_settings=jQuery.extend({ hook: 'rel', animation_speed: 'fast', ajaxcallback: function(){}, slideshow: 5000, autoplay_slideshow: false, opacity: 0.80, show_title: true, allow_resize: true, allow_expand: true, default_width: 500, default_height: 344, default_movie_width: 500, default_movie_height: 344, counter_separator_label: '/', theme: 'pp_default', horizontal_padding: 20, hideflash: false, wmode: 'opaque', autoplay: true, modal: false, deeplinking: true, overlay_gallery: true, overlay_gallery_max: 9999, keyboard_shortcuts: true, changepicturecallback: function(){}, 'setImageTitleForPrepare': function($element){}, callback: function(){}, getTitle: function(){return 'test'}, getImageDimensions: function(){}, ie6_fallback: true, 'is_lazy_load': 0, markup: markupHtml, gallery_markup: '
', image_markup: '', flash_markup: '', quicktime_markup: '', html5_markup: '', iframe_markup: '', inline_markup: '
{content}
', custom_markup: '', social_tools: '
' }, pp_settings); var matchedObjects=this , percentBased=false , pp_dimensions , pp_open , pp_contentHeight , pp_contentWidth , pp_attributesWidth=(pp_settings.isShowAttributes ? parseFloat(pp_settings.attributesWidth):0) , pp_containerHeight , pp_containerWidth , windowHeight=$(window).height() , windowWidth=$(window).width() , pp_slideshow , doresize=true , scroll_pos=_get_scroll() , $selfPp=this; $selfPp.pp_settings=pp_settings; $(window).unbind('resize.prettyphoto').bind('resize.prettyphoto',function(){ _center_overlay(); _resize_overlay(); }); if(pp_settings.keyboard_shortcuts){ $(document).unbind('keydown.prettyphoto').bind('keydown.prettyphoto',function(e){ if(typeof $pp_pic_holder!='undefined'){ if($pp_pic_holder.is(':visible')){ switch(e.keyCode){ case 37: $selfPp.changePage('previous'); e.preventDefault(); break; case 39: $selfPp.changePage('next'); e.preventDefault(); break; case 27: if(!settings.modal) $selfPp.close(); e.preventDefault(); break; };}; };}); }; $selfPp.refresh=function($imgList){ matchedObjects=$imgList; matchedObjects.off('click.prettyphoto').on('click.prettyphoto', this.initialize); } $selfPp.initialize=function(){ settings=pp_settings; if(settings.theme=='pp_default') settings.horizontal_padding=16; theRel=$(this).attr(settings.hook); galleryRegExp=/\[(?:.*)\]/; isSet=(galleryRegExp.exec(theRel)) ? true:false; pp_images=(isSet) ? jQuery.map(matchedObjects, function(n, i){ if($(n).attr(settings.hook).indexOf(theRel)!=-1) return $(n).attr('href'); }):$.makeArray($(this).attr('href')) ; pp_titles=(isSet) ? jQuery.map(matchedObjects, function(n, i){ if($(n).attr(settings.hook).indexOf(theRel)!=-1) return ($(n).find('img').attr('alt')) ? $(n).find('img').attr('alt'):""; }):$.makeArray($(this).find('img').attr('alt')); pp_descriptions=(isSet) ? jQuery.map(matchedObjects, function(n, i){ if($(n).attr(settings.hook).indexOf(theRel)!=-1) return ($(n).attr('title')) ? $(n).attr('title'):""; }):$.makeArray($(this).attr('title')); if(pp_images.length > settings.overlay_gallery_max) settings.overlay_gallery=false; set_position=jQuery.inArray($(this).attr('href'), pp_images); rel_index=(isSet) ? set_position:$("a["+settings.hook+"^='"+theRel+"']").index($(this)); _build_overlay(this); if(settings.allow_resize) $(window).bind('scroll.prettyphoto',function(){ _center_overlay(); }); $selfPp.open(); return false; } $selfPp.open=function(event){ if(typeof settings=="undefined"){ settings=pp_settings; pp_images=$.makeArray(arguments[0]); pp_titles=(arguments[1]) ? $.makeArray(arguments[1]):$.makeArray(""); pp_descriptions=(arguments[2]) ? $.makeArray(arguments[2]):$.makeArray(""); isSet=(pp_images.length > 1) ? true:false; set_position=(arguments[3])? arguments[3]: 0; _build_overlay(event.target); } if(settings.hideflash) $('object,embed,iframe[src*=youtube],iframe[src*=vimeo]').css('visibility','hidden'); _checkPosition($(pp_images).size()); $('.pp_loaderIcon').show(); if(settings.deeplinking) setHashtag(); if(settings.social_tools){ facebook_like_link=settings.social_tools.replace('{location_href}', encodeURIComponent(location.href)); $pp_pic_holder.find('.pp_social').html(facebook_like_link); } if($ppt.is(':hidden')) $ppt.css('opacity',0).show(); $pp_overlay.show().fadeTo(settings.animation_speed,settings.opacity); $pp_pic_holder.find('.currentTextHolder').text((set_position+1) + settings.counter_separator_label + $(pp_images).size()); if(typeof pp_descriptions[set_position]!='undefined'&&pp_descriptions[set_position]!=""){ settings.getTitle(); $pp_pic_holder.find('.pp_description').show().html($("
").html(pp_descriptions[set_position]).text() ) }else{ $pp_pic_holder.find('.pp_description').hide(); } movie_width=(parseFloat(getParam('width',pp_images[set_position]))) ? getParam('width',pp_images[set_position]):settings.default_movie_width.toString(); movie_height=(parseFloat(getParam('height',pp_images[set_position]))) ? getParam('height',pp_images[set_position]):settings.default_movie_height.toString(); percentBased=false; if(movie_height.indexOf('%')!=-1){ movie_height=parseFloat(($(window).height() * parseFloat(movie_height) / 100) - 150); percentBased=true; } if(movie_width.indexOf('%')!=-1){ movie_width=parseFloat(($(window).width() * parseFloat(movie_width) / 100) - 150); percentBased=true; } if(pp_settings.popup_border_enable&&pp_settings.popup_border_color && pp_settings.popup_border_type&&pp_settings.popup_border_width){ $pp_pic_holder.css({ "border-color": pp_settings.popup_border_color, "border-width": pp_settings.popup_border_width +"px", "border-style": pp_settings.popup_border_type, }); } $pp_pic_holder.fadeIn(function(){ (settings.show_title&&pp_titles[set_position]!=""&&typeof pp_titles[set_position]!="undefined") ? $ppt.html(unescape(pp_titles[set_position])):$ppt.html(' '); imgPreloader=""; skipInjection=false; switch(_getFileType(pp_images[set_position])){ case 'image': imgPreloader=new Image(); nextImage=new Image(); if(isSet&&set_position < $(pp_images).size() -1) nextImage.src=pp_images[set_position + 1]; prevImage=new Image(); if(isSet&&pp_images[set_position - 1]) prevImage.src=pp_images[set_position - 1]; $pp_pic_holder.find('#pp_full_res')[0].innerHTML=settings.image_markup.replace(/{path}/g,pp_images[set_position]); imgPreloader.onload=function(){ pp_dimensions=_fitToViewportImage(imgPreloader.width,imgPreloader.height); _showContent(); }; imgPreloader.onerror=function(){ alert('Image cannot be loaded. Make sure the path is correct and image exist.'); $selfPp.close(); }; imgPreloader.src=pp_images[set_position]; break; case 'youtube': pp_dimensions=_fitToViewport(movie_width,movie_height); if(pp_images[set_position].indexOf("embed")==-1){ movie_id=getParam('v',pp_images[set_position]); if(movie_id==""){ movie_id=pp_images[set_position].split('youtu.be/'); movie_id=movie_id[1]; if(movie_id.indexOf('?') > 0) movie_id=movie_id.substr(0,movie_id.indexOf('?')); if(movie_id.indexOf('&') > 0) movie_id=movie_id.substr(0,movie_id.indexOf('&')); } movie='//www.youtube.com/embed/'+movie_id; }else{ movie=pp_images[set_position]; } (getParam('rel',pp_images[set_position])) ? movie+="?rel="+getParam('rel',pp_images[set_position]):movie+="?rel=1"; toInject=settings.iframe_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,movie); break; case 'vimeo': pp_dimensions=_fitToViewport(movie_width,movie_height); movie_id=pp_images[set_position]; var regExp=/(?:https?:)?\/\/(?:www\.|player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|album\/(\d+)\/video\/|video\/|)(\d+)(?:$|\/|\?)/; var match=movie_id.match(regExp); movie='https://player.vimeo.com/video/'+ match[3] +'?title=0&byline=0&portrait=0'; vimeo_width=pp_dimensions['width'] + '/embed/?moog_width='+ pp_dimensions['width']; toInject=settings.iframe_markup.replace(/{width}/g,vimeo_width).replace(/{height}/g,pp_dimensions['height']).replace(/{path}/g,movie); break; case 'quicktime': pp_dimensions=_fitToViewport(movie_width,movie_height); pp_dimensions['height']+=15; pp_dimensions['contentHeight']+=15; pp_dimensions['containerHeight']+=15; toInject=settings.quicktime_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,pp_images[set_position]).replace(/{autoplay}/g,settings.autoplay); break; case 'html5': pp_dimensions=_fitToViewport(movie_width,movie_height); pp_dimensions['height']+=15; pp_dimensions['contentHeight']+=15; pp_dimensions['containerHeight']+=15; if(settings.autoplay){ settings.autoplay='autoplay'; }else{ settings.autoplay=''; } toInject=settings.html5_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,pp_images[set_position]).replace(/{autoplay}/g,settings.autoplay); break; case 'flash': pp_dimensions=_fitToViewport(movie_width,movie_height); flash_vars=pp_images[set_position]; flash_vars=flash_vars.substring(pp_images[set_position].indexOf('flashvars') + 10,pp_images[set_position].length); filename=pp_images[set_position]; filename=filename.substring(0,filename.indexOf('?')); toInject=settings.flash_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,filename+'?'+flash_vars); break; case 'iframe': pp_dimensions=_fitToViewport(movie_width,movie_height); frame_url=pp_images[set_position]; frame_url=frame_url.substr(0,frame_url.indexOf('iframe')-1); toInject=pp_images[set_position].replace('watch?v=', 'embed/'); var container=$("
" + toInject + "
"); container.find("iframe").attr("width", pp_dimensions['width'] + 'px'); container.find("iframe").attr("height", pp_dimensions['height'] + 'px'); toInject=container.html(); break; case 'ajax': doresize=false; pp_dimensions=_fitToViewport(movie_width,movie_height); doresize=true; skipInjection=true; $.get(pp_images[set_position],function(responseHTML){ toInject=settings.inline_markup.replace(/{content}/g,responseHTML); $pp_pic_holder.find('#pp_full_res')[0].innerHTML=toInject; _showContent(); }); break; case 'custom': pp_dimensions=_fitToViewport(movie_width,movie_height); toInject=settings.custom_markup; break; case 'inline': myClone=$(pp_images[set_position]).clone().append('
').css({'width':settings.default_width}).wrapInner('
').appendTo($('body')).show(); doresize=false; pp_dimensions=_fitToViewport($(myClone).width(),$(myClone).height()); doresize=true; $(myClone).remove(); toInject=settings.inline_markup.replace(/{content}/g,$(pp_images[set_position]).html()); break; }; if(!imgPreloader&&!skipInjection){ $pp_pic_holder.find('#pp_full_res')[0].innerHTML=toInject; _showContent(); };}); return false; }; $selfPp.getImagesList=function(){ return pp_images; }; $selfPp.changePage=function(direction){ currentGalleryPage=0; if(direction=='previous'){ set_position--; if(set_position < 0) set_position=$(pp_images).size()-1; }else if(direction=='next'){ set_position++; if(set_position > $(pp_images).size()-1) set_position=0; }else{ set_position=direction; }; rel_index=set_position; if(!doresize) doresize=true; if(settings.allow_expand){ $('.pp_contract').removeClass('pp_contract').addClass('pp_expand'); } _hideContent(function(){ $selfPp.open(); }); }; $selfPp.changeGalleryPage=function(direction){ if(direction=='next'){ currentGalleryPage ++; if(currentGalleryPage > totalPage) currentGalleryPage=0; }else if(direction=='previous'){ currentGalleryPage --; if(currentGalleryPage < 0) currentGalleryPage=totalPage; }else{ currentGalleryPage=direction; }; slide_speed=(direction=='next'||direction=='previous') ? settings.animation_speed:0; slide_to=currentGalleryPage * (itemsPerPage * itemWidth); $pp_gallery.find('ul').animate({left:-slide_to},slide_speed); }; $selfPp.startSlideshow=function(){ if(typeof pp_slideshow=='undefined'){ if(!$pp_pic_holder.find('.pp_play').hasClass('stop') && !$pp_pic_holder.find('.pp_pause').hasClass('stop')){ $pp_pic_holder.find('.pp_play').unbind('click').removeClass('pp_play').addClass('pp_pause').click(function(){ $selfPp.stopSlideshow(); return false; }); pp_slideshow=setInterval($selfPp.startSlideshow,settings.slideshow); }}else{ $selfPp.changePage('next'); };} $selfPp.stopSlideshow=function(){ $pp_pic_holder.find('.pp_pause').unbind('click').removeClass('pp_pause').addClass('pp_play').click(function(){ $selfPp.startSlideshow(); return false; }); clearInterval(pp_slideshow); pp_slideshow=undefined; } $selfPp.close=function(){ if($pp_overlay.is(":animated")) return; $selfPp.stopSlideshow(); $pp_pic_holder.stop().find('object,embed').css('visibility','hidden'); $('div.pp_pic_holder,div.ppt,.pp_fade').fadeOut(settings.animation_speed,function(){ $(this).remove(); }); $pp_overlay.fadeOut(settings.animation_speed, function(){ if(settings.hideflash) $('object,embed,iframe[src*=youtube],iframe[src*=vimeo]').css('visibility','visible'); $(this).remove(); $(window).unbind('scroll.prettyphoto'); clearHashtag(); settings.callback(); doresize=true; pp_open=false; settings=undefined; }); }; $selfPp.resize=function(width, height){ _fitToViewport(width, height); _resize_overlay(); _center_overlay(); }; function _showContent(changeWidthAndHeight, currImgRotateVal, notRunOnHoverInit){ $('.pp_loaderIcon').hide(); projectedTop=scroll_pos['scrollTop'] + ((windowHeight/2) - (pp_dimensions['containerHeight']/2)); if(projectedTop < 0) projectedTop=0; $ppt.fadeTo(settings.animation_speed,1); $pp_pic_holder.find('.pp_content') .animate({ 'height': pp_dimensions['contentHeight'] , 'width': pp_dimensions['contentWidth'] } , settings.animation_speed , function(){ $pp_pic_holder.animate({ 'top': projectedTop, 'left': ((windowWidth/2) - (pp_dimensions['containerWidth']/2) < 0) ? 0:(windowWidth/2) - (pp_dimensions['containerWidth']/2), width:pp_dimensions['containerWidth'] },settings.animation_speed,function(){ var $ppHoverContainer=$pp_pic_holder.find('.pp_hoverContainer') , $ppImageWrapper=$pp_pic_holder.find('#pp_full_res') , $ppPopupImage=$pp_pic_holder.find('#fullResImage'); $ppHoverContainer.height(pp_dimensions['height']).width(pp_dimensions['width']); $ppPopupImage.height(pp_dimensions['height']).width(pp_dimensions['width']); if(settings.isShowRotateBtn&&window.prettyPhotoShowContent){ window.prettyPhotoShowContent(changeWidthAndHeight , currImgRotateVal , $ppPopupImage , $ppImageWrapper , pp_dimensions ); } $pp_pic_holder.find('.pp_fade').fadeIn(settings.animation_speed); if(isSet&&_getFileType(pp_images[set_position])=="image"){ $pp_pic_holder.find('.pp_hoverContainer').show(); }else{ $pp_pic_holder.find('.pp_hoverContainer').hide(); } if(settings.isShowAttributes){ if(settings.attributesPosition=='left'){ $ppHoverContainer.css('left', pp_attributesWidth); }else{ $('a.pp_expand').css('right', pp_attributesWidth + 10 + 'px'); } $pp_pic_holder.find('#ppCustomAttributes').height(pp_dimensions['height'] - (settings.isShowButtonLink ? $pp_pic_holder.find('#ppAttributeButton').height() + 5:0)); } if(settings.allow_expand){ if(pp_dimensions['resized']){ $('a.pp_expand,a.pp_contract').show(); }else{ $('a.pp_expand').hide(); }} if(settings.autoplay_slideshow&&!pp_slideshow&&!pp_open) $selfPp.startSlideshow(); settings.changepicturecallback($('[href="' + pp_images[set_position] + '"]')); if(!notRunOnHoverInit){ if(window.prettyPhotoInitOnHoverThumb){ window.prettyPhotoInitOnHoverThumb($('[href="' + pp_images[set_position] + '"]'), pp_settings.galleryId, $selfPp.setDimensionsAndShowCont); }} pp_open=true; }); }); _insert_gallery(); pp_settings.ajaxcallback(); setTimeout(function (){ $pp_pic_holder.animate({ 'left': ((windowWidth/2) - (pp_dimensions['containerWidth']/2) < 0) ? 0:(windowWidth/2) - ($pp_pic_holder.outerWidth()/2), width:pp_dimensions['containerWidth'] }); }, 600); }; $selfPp.initRotate=(function(){ if(pp_settings.isShowRotateBtn&&window.prettyPhotoInitRotate){ window.prettyPhotoInitRotate(function(toFitWidth, toFitHeigth, currImgRotateVal){ pp_dimensions=_fitToViewportImage(toFitWidth, toFitHeigth); _showContent(true, currImgRotateVal); }); }}); $selfPp.setDimensionsAndShowCont=(function(toFitWidth, toFitHeigth, currImgRotateVal){ pp_dimensions=_fitToViewportImage(toFitWidth, toFitHeigth); _showContent(true, currImgRotateVal, 1); }); $selfPp.initOnHoverPreview=(function($aLink, galleryId){ if(pp_settings.isShowHovThumbnail&&window.prettyPhotoInitOnHoverThumb){ window.prettyPhotoInitOnHoverThumb($aLink, galleryId, $selfPp.setDimensionsAndShowCont); }}); function _hideContent(callback){ $pp_pic_holder.find('#pp_full_res object,#pp_full_res embed').css('visibility','hidden'); $pp_pic_holder.find('.pp_fade').fadeOut(settings.animation_speed,function(){ $('.pp_loaderIcon').show(); callback(); }); }; function _checkPosition(setCount){ (setCount > 1) ? $('.pp_nav').show():$('.pp_nav').hide(); }; function _fitToViewportImage(width,height){ var dimensions=settings.getImageDimensions(); if(dimensions==undefined){ return _fitToViewport(width,height); }else{ windowWidth=dimensions.width; windowHeight=dimensions.height; var response=_fitToViewport(width,height); winWidth=$(window).width(); winHeight=$(window).height(); if(response.containerWidth > winWidth||response.containerHeight > winHeight){ if(response.containerWidth > winWidth){ windowWidth -=(response.containerWidth - winWidth); }else if(response.containerHeight > winHeight){ windowHeight -=(response.containerHeight - winHeight); } response=_fitToViewport(response.width, response.height); } windowWidth=winWidth; windowHeight=winHeight; return response; }} function _fitToViewport(width,height){ resized=false; _getDimensions(width,height); imageWidth=width, imageHeight=height; if(((pp_containerWidth > windowWidth)||(pp_containerHeight > windowHeight))&&doresize&&settings.allow_resize&&!percentBased){ resized=true, fitting=false; while (!fitting){ if((pp_containerWidth > windowWidth)){ imageWidth=(windowWidth - 60 - pp_attributesWidth); imageHeight=(height/width) * imageWidth; }else if((pp_containerHeight > windowHeight)){ imageHeight=(windowHeight - 80); imageWidth=(width/height) * imageHeight; } if(!(pp_containerWidth > windowWidth)&&!(pp_containerHeight > windowHeight)){ fitting=true; }; pp_containerHeight=imageHeight, pp_containerWidth=imageWidth; }; if((pp_containerWidth > windowWidth)||(pp_containerHeight > windowHeight)){ _fitToViewport(pp_containerWidth,pp_containerHeight) }; _getDimensions(imageWidth,imageHeight); }; return { width:Math.floor(imageWidth), height:Math.floor(imageHeight), containerHeight:Math.floor(pp_containerHeight), containerWidth:Math.floor(pp_containerWidth) + (settings.horizontal_padding * 2), contentHeight:Math.floor(pp_contentHeight), contentWidth:Math.floor(pp_contentWidth), resized:resized };}; function _getDimensions(width,height){ width=parseFloat(width) + pp_attributesWidth; height=parseFloat(height); $pp_details=$pp_pic_holder.find('.pp_details'); $pp_details.width(width); detailsHeight=parseFloat($pp_details.css('marginTop')) + parseFloat($pp_details.css('marginBottom')); $pp_details=$pp_details.clone().addClass(settings.theme).width(width).appendTo($('body')).css({ 'position':'absolute', 'top':-10000 }); $pp_details.find('.pp_description') .html(settings.setImageTitleForPrepare($('[href="' + pp_images[set_position] + '"]'))); detailsHeight +=$pp_details.height(); detailsHeight=(detailsHeight <=34) ? 36:detailsHeight; $pp_details.remove(); $pp_title=$pp_pic_holder.find('.ppt'); $pp_title.width(width); titleHeight=parseFloat($pp_title.css('marginTop')) + parseFloat($pp_title.css('marginBottom')); $pp_title=$pp_title.clone().appendTo($('body')).css({ 'position':'absolute', 'top':-10000 }); titleHeight +=$pp_title.height(); $pp_title.remove(); pp_contentHeight=height + detailsHeight; pp_contentWidth=width; pp_containerHeight=pp_contentHeight + titleHeight + $pp_pic_holder.find('.pp_top').height() + $pp_pic_holder.find('.pp_bottom').height(); pp_containerWidth=width; } function _getFileType(itemSrc){ if(itemSrc.match(//i)){ return 'iframe'; } else if(itemSrc.match(/youtube\.com\/watch/i)||itemSrc.match(/youtu\.be/i)||itemSrc.match(/youtube\.com\/embed/i)){ return 'youtube'; }else if(itemSrc.match(/vimeo\.com/i)){ return 'vimeo'; }else if(itemSrc.match(/\b.mov\b/i)){ return 'quicktime'; }else if(itemSrc.match(/\b.avi\b/i)){ return 'html5'; }else if(itemSrc.match(/\b.mp4\b/i)){ return 'html5'; }else if(itemSrc.match(/\b.swf\b/i)){ return 'flash'; }else if(itemSrc.match(/\bajax=true\b/i)){ return 'ajax'; }else if(itemSrc.match(/\bcustom=true\b/i)){ return 'custom'; }else if(itemSrc.substr(0,1)=='#'){ return 'inline'; }else{ return 'image'; };}; function _center_overlay(){ if(doresize&&typeof $pp_pic_holder!='undefined'){ scroll_pos=_get_scroll(); contentHeight=$pp_pic_holder.height(), contentwidth=$pp_pic_holder.width(); projectedTop=(windowHeight/2) + scroll_pos['scrollTop'] - (contentHeight/2); if(projectedTop < 0) projectedTop=0; if(contentHeight > windowHeight) return; $pp_pic_holder.css({ 'top': projectedTop, 'left': (windowWidth/2) + scroll_pos['scrollLeft'] - (contentwidth/2) }); };}; function _get_scroll(){ if(self.pageYOffset){ return {scrollTop:self.pageYOffset,scrollLeft:self.pageXOffset};}else if(document.documentElement&&document.documentElement.scrollTop){ return {scrollTop:document.documentElement.scrollTop,scrollLeft:document.documentElement.scrollLeft};}else if(document.body){ return {scrollTop:document.body.scrollTop,scrollLeft:document.body.scrollLeft};}; }; function _resize_overlay(){ windowHeight=$(window).height(), windowWidth=$(window).width(); if(typeof $pp_overlay!="undefined") $pp_overlay.height($(document).height()).width(windowWidth); }; function _insert_gallery(){ if(isSet&&settings.overlay_gallery&&(_getFileType(pp_images[set_position])=="image"||_getFileType(pp_images[set_position])=="iframe")){ itemWidth=52+5; navWidth=(settings.theme=="facebook"||settings.theme=="pp_default") ? 50:30; itemsPerPage=Math.floor((pp_dimensions['containerWidth'] - 100 - pp_attributesWidth - navWidth) / itemWidth); itemsPerPage=(itemsPerPage < pp_images.length) ? itemsPerPage:pp_images.length; totalPage=Math.ceil(pp_images.length / itemsPerPage) - 1; if(totalPage==0){ navWidth=0; $pp_gallery.find('.pp_arrow_next,.pp_arrow_previous').hide(); }else{ $pp_gallery.find('.pp_arrow_next,.pp_arrow_previous').show(); }; galleryWidth=itemsPerPage * itemWidth; fullGalleryWidth=pp_images.length * itemWidth; $pp_gallery .css('margin-left',-((galleryWidth/2) + (navWidth/2) + (settings.isShowAttributes ? pp_attributesWidth/2 * (settings.attributesPosition=='left' ? -1:1):0))) .find('div:first').width(galleryWidth+5) .find('ul').width(fullGalleryWidth) .find('li.selected').removeClass('selected'); goToPage=(Math.floor(set_position/itemsPerPage) < totalPage) ? Math.floor(set_position/itemsPerPage):totalPage; $selfPp.changeGalleryPage(goToPage); $pp_gallery_li.filter(':eq('+set_position+')').addClass('selected'); }else{ $pp_pic_holder.find('.pp_content').unbind('mouseenter mouseleave'); }} function _build_overlay(caller){ if(settings.social_tools) facebook_like_link=settings.social_tools.replace('{location_href}', encodeURIComponent(location.href)); settings.markup=settings.markup.replace('{pp_social}',''); $('body').append(settings.markup); $selfPp.initRotate(); $selfPp.initOnHoverPreview($(caller), pp_settings.galleryId); $pp_pic_holder=$('.pp_pic_holder') , $ppt=$('.ppt'), $pp_overlay=$('div.pp_overlay'); if(settings.isDisableRightClick){ $pp_pic_holder.off('contextmenu').on('contextmenu', function(e){return false;}); } if(isSet&&settings.overlay_gallery){ currentGalleryPage=0; toInject=""; for (var i=0; i < pp_images.length; i++){ if(!pp_images[i].match(/\b(jpg|jpeg|png|gif)\b/gi)){ classname='default'; img_src=''; }else{ classname=''; img_src=pp_images[i]; thumbnail=$('[href="' +img_src + '"]').find('.crop > img'); if(thumbnail.length){ if(pp_settings.is_lazy_load){ img_src=thumbnail.attr('data-gg-real-image-href'); }else{ img_src=thumbnail.attr('src'); }} } toInject +="
  • "; }; toInject=settings.gallery_markup.replace(/{gallery}/g,toInject); $pp_pic_holder.find(settings.isShowAttributes&&settings.attributesPosition=='right' ? '.pp_attributes_container':'#pp_full_res').after(toInject); $pp_gallery=$('.pp_pic_holder .pp_gallery'), $pp_gallery_li=$pp_gallery.find('li'); $pp_gallery.find('.pp_arrow_next').click(function(){ $selfPp.changeGalleryPage('next'); $selfPp.stopSlideshow(); return false; }); $pp_gallery.find('.pp_arrow_previous').click(function(){ $selfPp.changeGalleryPage('previous'); $selfPp.stopSlideshow(); return false; }); $pp_pic_holder.find('.pp_content').hover(function(){ $pp_pic_holder.find('.pp_gallery:not(.disabled)').fadeIn(); }, function(){ $pp_pic_holder.find('.pp_gallery:not(.disabled)').fadeOut(); }); itemWidth=52+5; $pp_gallery_li.each(function(i){ $(this) .find('a') .click(function(){ $selfPp.changePage(i); $selfPp.stopSlideshow(); return false; }); }); }; if(settings.slideshow){ $pp_pic_holder.find('.pp_nav').prepend('Play') $pp_pic_holder.find('.pp_nav .pp_play').click(function(){ $selfPp.startSlideshow(); return false; }); } $pp_pic_holder.attr('class','pp_pic_holder ' + settings.theme); $pp_overlay .css({ 'opacity':0, 'height':$(document).height(), 'width':$(window).width() }) .bind('click',function(){ if(!settings.modal) $selfPp.close(); }); $('a.pp_close').bind('click',function(){ $selfPp.close(); return false; }); if(settings.allow_expand){ $('a.pp_expand').bind('click',function(e){ if($(this).hasClass('pp_expand')){ $(this).removeClass('pp_expand').addClass('pp_contract'); doresize=false; }else{ $(this).removeClass('pp_contract').addClass('pp_expand'); doresize=true; }; _hideContent(function(){ $selfPp.open(); }); return false; }); } $pp_pic_holder.find('.pp_previous, .pp_nav .pp_arrow_previous').bind('click',function(){ $('.pp_nav a.pp_pause').removeClass('stop'); $('.pp_nav a.pp_play').removeClass('stop'); $selfPp.changePage('previous'); $selfPp.stopSlideshow(); return false; }); $pp_pic_holder.find('.pp_next, .pp_nav .pp_arrow_next').bind('click',function(){ $('.pp_nav a.pp_pause').removeClass('stop'); $('.pp_nav a.pp_play').removeClass('stop'); $selfPp.changePage('next'); $selfPp.stopSlideshow(); return false; }); _center_overlay(); }; if(!ggpp_alreadyInitialized&&getHashtag()){ ggpp_alreadyInitialized=true; hashIndex=getHashtag(); hashRel=hashIndex; hashIndex=hashIndex.substring(hashIndex.indexOf('/')+1,hashIndex.length-1); hashRel=hashRel.substring(0,hashRel.indexOf('/')); setTimeout(function(){ $("a["+pp_settings.hook+"^='"+hashRel+"']:eq("+hashIndex+")").trigger('click'); },50); } return $selfPp.off('click.prettyphoto').on('click.prettyphoto',$selfPp.initialize); }; function getHashtag(){ var url=location.href, hashtag=(url.indexOf('#prettyPhoto')!==-1) ? decodeURI(url.substring(url.indexOf('#prettyPhoto')+1,url.length)):false; if(hashtag){ hashtag=hashtag.replace(/<|>/g,''); } return hashtag; }; function setHashtag(){ if(typeof theRel=='undefined') return; location.hash=theRel + '/'+rel_index+'/'; }; function clearHashtag(){ if(location.href.indexOf('#prettyPhoto')!==-1) location.hash="prettyPhoto"; } function getParam(name,url){ name=name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); var regexS="[\\?&]"+name+"=([^&#]*)"; var regex=new RegExp(regexS); var results=regex.exec(url); return(results==null) ? "":results[1]; }})(jQuery); var ggpp_alreadyInitialized=false; (function(e){var t=function(e){var t=e.clone();var n=e.find("canvas");if(n.length){var r=t.find("canvas");r.each(function(e){var t=this.getContext("2d");t.drawImage(n.get(e),0,0)})}return t};e.fn.quicksand=function(n,r){var i={duration:750,easing:"swing",attribute:"data-id",adjustHeight:"auto",adjustWidth:"auto",useScaling:false,enhancement:function(e){},selector:"> *",atomic:false,dx:0,dy:0,maxWidth:0,retainExisting:true},s=function(){var e="transform WebkitTransform MozTransform OTransform msTransform".split(" "),t=document.createElement("div");for(var n=0;n0){n=n.add(s);if(r===0){f.prepend(s)}else{s.insertAfter(f.find(i.selector).get(r-1))}}});t.not(n).remove()}if(d){f.css("height",h)}if(v){f.css("width",c)}}i.enhancement(f);if(typeof o=="function"){o.call(this)}}if(false===i.adjustHeight){f.css("height","auto")}if(false===i.adjustWidth){f.css("width","auto")}};var S=f.offsetParent();var x=S.offset();if(S.css("position")=="relative"){if(S.get(0).nodeName.toLowerCase()!="body"){x.top+=parseFloat(S.css("border-top-width"))||0;x.left+=parseFloat(S.css("border-left-width"))||0}}else{x.top-=parseFloat(S.css("border-top-width"))||0;x.left-=parseFloat(S.css("border-left-width"))||0;x.top-=parseFloat(S.css("margin-top"))||0;x.left-=parseFloat(S.css("margin-left"))||0}if(isNaN(x.left)){x.left=0}if(isNaN(x.top)){x.top=0}x.left-=i.dx;x.top-=i.dy;f.css("height",e(this).height());f.css("width",e(this).width());y.each(function(t){g[t]=e(this).offset()});e(this).stop();var T=0;var N=0;y.each(function(t){e(this).stop();var n=e(this).get(0);if(n.style.position=="absolute"){T=-i.dx;N=-i.dy}else{T=i.dx;N=i.dy}n.style.position="absolute";n.style.margin="0";if(!i.adjustWidth){n.style.width=b+"px"}n.style.top=g[t].top-parseFloat(n.style.marginTop)-x.top+N+"px";n.style.left=g[t].left-parseFloat(n.style.marginLeft)-x.left+T+"px";if(i.maxWidth>0&&g[t].left>i.maxWidth){n.style.display="none"}});var C=t(e(f));var k=C.get(0);k.innerHTML="";k.setAttribute("id","");k.style.height="auto";k.style.width=f.width()+"px";C.append(a);C.insertBefore(f);C.css("opacity",0);k.style.zIndex=-1;k.style.margin="0";k.style.position="absolute";k.style.top=m.top-x.top+"px";k.style.left=m.left-x.left+"px";if(i.adjustHeight==="dynamic"){f.animate({height:C.height()},i.duration,i.easing)}else if(i.adjustHeight==="auto"){h=C.height();if(parseFloat(l)0){if(!i.useScaling){l={opacity:"1.0"}}else{l={opacity:"1.0",scale:"1.0"}}var c=t(o);var h=c.get(0);h.style.position="absolute";h.style.margin="0";if(!i.adjustWidth){h.style.width=b+"px"}h.style.top=o.offset().top-x.top+"px";h.style.left=o.offset().left-x.left+"px";c.css("opacity",0);if(i.useScaling){c.scale(0)}c.appendTo(f);if(i.maxWidth===0||o.offset().lefti;i++)e=t[i],e.obj.css(e.css)})}function e(i){return t.trim(i).toLowerCase()}var s,h,o;o=function(t,i){return function(){return t.apply(i,arguments)}},h={align:"center",autoResize:!1,comparator:null,container:t("body"),direction:void 0,ignoreInactiveItems:!0,itemWidth:0,fillEmptySpace:!1,flexibleWidth:0,offset:2,outerOffset:0,onLayoutChanged:void 0,possibleFilters:[],resizeDelay:50,verticalOffset:void 0};var n=window.requestAnimationFrame||function(t){t()},r=t(window);s=function(){function s(i,e){this.handler=i,this.columns=this.containerWidth=this.resizeTimer=null,this.activeItemCount=0,this.itemHeightsDirty=!0,this.placeholders=[],t.extend(!0,this,h,e),this.verticalOffset=this.verticalOffset||this.offset,this.update=o(this.update,this),this.onResize=o(this.onResize,this),this.onRefresh=o(this.onRefresh,this),this.getItemWidth=o(this.getItemWidth,this),this.layout=o(this.layout,this),this.layoutFull=o(this.layoutFull,this),this.layoutColumns=o(this.layoutColumns,this),this.filter=o(this.filter,this),this.clear=o(this.clear,this),this.getActiveItems=o(this.getActiveItems,this),this.refreshPlaceholders=o(this.refreshPlaceholders,this),this.sortElements=o(this.sortElements,this),this.updateFilterClasses=o(this.updateFilterClasses,this),this.updateFilterClasses(),this.autoResize&&r.bind("resize.wookmark",this.onResize),this.container.bind("refreshWookmark",this.onRefresh)}return s.prototype.updateFilterClasses=function(){for(var t,i,s,h,o=0,n=0,r=0,a={},l=this.possibleFilters;this.handler.length>o;o++)if(i=this.handler.eq(o),t=i.data("filterClass"),"object"==typeof t&&t.length>0)for(n=0;t.length>n;n++)s=e(t[n]),a[s]===void 0&&(a[s]=[]),a[s].push(i[0]);for(;l.length>r;r++)h=e(l[r]),h in a||(a[h]=[]);this.filterClasses=a},s.prototype.update=function(i){this.itemHeightsDirty=!0,t.extend(!0,this,i)},s.prototype.onResize=function(){clearTimeout(this.resizeTimer),this.itemHeightsDirty=0!==this.flexibleWidth,this.resizeTimer=setTimeout(this.layout,this.resizeDelay)},s.prototype.onRefresh=function(){this.itemHeightsDirty=!0,this.layout()},s.prototype.filter=function(i,s,h){var o,n,r,a,l,f=[],u=t();if(i=i||[],s=s||"or",h=h||!1,i.length){for(n=0;i.length>n;n++)l=e(i[n]),l in this.filterClasses&&f.push(this.filterClasses[l]);if(o=f.length,"or"==s||1==o)for(n=0;o>n;n++)u=u.add(f[n]);else if("and"==s){var c,d,m,p=f[0],g=!0;for(n=1;o>n;n++)f[n].lengthn;n++){for(d=p[n],g=!0,r=0;f.length>r&&g;r++)if(m=f[r],p!=m){for(a=0,c=!1;m.length>a&&!c;a++)c=m[a]==d;g&=c}g&&u.push(p[n])}}h||this.handler.not(u).addClass("inactive")}else u=this.handler;return h||(u.removeClass("inactive"),this.columns=null,this.layout()),u},s.prototype.refreshPlaceholders=function(i,e){for(var s,h,o,n,r,a,l=this.placeholders.length,f=this.columns.length,u=this.container.innerHeight();f>l;l++)s=t('
    ').appendTo(this.container),this.placeholders.push(s);for(a=this.offset+2*parseInt(this.placeholders[0].css("borderLeftWidth"),10),l=0;this.placeholders.length>l;l++)if(s=this.placeholders[l],o=this.columns[l],l>=f||!o[o.length-1])s.css("display","none");else{if(h=o[o.length-1],!h)continue;r=h.data("wookmark-top")+h.data("wookmark-height")+this.verticalOffset,n=u-r-a,s.css({position:"absolute",display:n>0?"block":"none",left:l*i+e,top:r,width:i-a,height:n})}},s.prototype.getActiveItems=function(){return this.ignoreInactiveItems?this.handler.not(".inactive"):this.handler},s.prototype.getItemWidth=function(){var t=this.itemWidth,i=this.container.width()-2*this.outerOffset,e=this.handler.eq(0),s=this.flexibleWidth;if(void 0===this.itemWidth||0===this.itemWidth&&!this.flexibleWidth?t=e.outerWidth():"string"==typeof this.itemWidth&&this.itemWidth.indexOf("%")>=0&&(t=parseFloat(this.itemWidth)/100*i),s){"string"==typeof s&&s.indexOf("%")>=0&&(s=parseFloat(s)/100*i);var h=i+this.offset,o=~~(.5+h/(s+this.offset)),n=~~(h/(t+this.offset)),r=Math.max(o,n),a=Math.min(s,~~((i-(r-1)*this.offset)/r));t=Math.max(t,a),this.handler.css("width",t)}return t},s.prototype.layout=function(t){if(this.container.is(":visible")){var i,e=this.getItemWidth()+this.offset,s=this.container.width(),h=s-2*this.outerOffset,o=~~((h+this.offset)/e),n=0,r=0,a=0,l=this.getActiveItems(),f=l.length;if(this.itemHeightsDirty||!this.container.data("itemHeightsInitialized")){for(;f>a;a++)i=l.eq(a),i.data("wookmark-height",i.outerHeight());this.itemHeightsDirty=!1,this.container.data("itemHeightsInitialized",!0)}o=Math.max(1,Math.min(o,f)),n=this.outerOffset,"center"==this.align&&(n+=~~(.5+(h-(o*e-this.offset))>>1)),this.direction=this.direction||("right"==this.align?"right":"left"),r=t||null===this.columns||this.columns.length!=o||this.activeItemCount!=f?this.layoutFull(e,o,n):this.layoutColumns(e,n),this.activeItemCount=f,this.container.css("height",r),this.fillEmptySpace&&this.refreshPlaceholders(e,n),void 0!==this.onLayoutChanged&&"function"==typeof this.onLayoutChanged&&this.onLayoutChanged()}},s.prototype.sortElements=function(t){return"function"==typeof this.comparator?t.sort(this.comparator):t},s.prototype.layoutFull=function(e,s,h){var o,n,r=0,a=0,l=t.makeArray(this.getActiveItems()),f=l.length,u=null,c=null,d=[],m=[],p="left"==this.align?!0:!1;for(this.columns=[],l=this.sortElements(l);s>d.length;)d.push(this.outerOffset),this.columns.push([]);for(;f>r;r++){for(o=t(l[r]),u=d[0],c=0,a=0;s>a;a++)u>d[a]&&(u=d[a],c=a);o.data("wookmark-top",u),n=h,(c>0||!p)&&(n+=c*e),(m[r]={obj:o,css:{position:"absolute",top:u}}).css[this.direction]=n,d[c]+=o.data("wookmark-height")+this.verticalOffset,this.columns[c].push(o)}return i(m),Math.max.apply(Math,d)},s.prototype.layoutColumns=function(t,e){for(var s,h,o,n,r=[],a=[],l=0,f=0,u=0;this.columns.length>l;l++){for(r.push(this.outerOffset),h=this.columns[l],n=l*t+e,s=r[l],f=0;h.length>f;f++,u++)o=h[f].data("wookmark-top",s),(a[u]={obj:o,css:{top:s}}).css[this.direction]=n,s+=o.data("wookmark-height")+this.verticalOffset;r[l]=s}return i(a),Math.max.apply(Math,r)},s.prototype.clear=function(){clearTimeout(this.resizeTimer),r.unbind("resize.wookmark",this.onResize),this.container.unbind("refreshWookmark",this.onRefresh),this.handler.wookmarkInstance=null},s}(),t.fn.wookmark=function(t){return this.wookmarkInstance?this.wookmarkInstance.update(t||{}):this.wookmarkInstance=new s(this,t||{}),this.wookmarkInstance.layout(!0),this.show()}}); !function(a,b,c,d){"use strict";function e(a,b,c){return setTimeout(j(a,c),b)}function f(a,b,c){return Array.isArray(a)?(g(a,c[b],c),!0):!1}function g(a,b,c){var e;if(a)if(a.forEach)a.forEach(b,c);else if(a.length!==d)for(e=0;e\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",f=a.console&&(a.console.warn||a.console.log);return f&&f.call(a.console,e,d),b.apply(this,arguments)}}function i(a,b,c){var d,e=b.prototype;d=a.prototype=Object.create(e),d.constructor=a,d._super=e,c&&la(d,c)}function j(a,b){return function(){return a.apply(b,arguments)}}function k(a,b){return typeof a==oa?a.apply(b?b[0]||d:d,b):a}function l(a,b){return a===d?b:a}function m(a,b,c){g(q(b),function(b){a.addEventListener(b,c,!1)})}function n(a,b,c){g(q(b),function(b){a.removeEventListener(b,c,!1)})}function o(a,b){for(;a;){if(a==b)return!0;a=a.parentNode}return!1}function p(a,b){return a.indexOf(b)>-1}function q(a){return a.trim().split(/\s+/g)}function r(a,b,c){if(a.indexOf&&!c)return a.indexOf(b);for(var d=0;dc[b]}):d.sort()),d}function u(a,b){for(var c,e,f=b[0].toUpperCase()+b.slice(1),g=0;g1&&!c.firstMultiple?c.firstMultiple=D(b):1===e&&(c.firstMultiple=!1);var f=c.firstInput,g=c.firstMultiple,h=g?g.center:f.center,i=b.center=E(d);b.timeStamp=ra(),b.deltaTime=b.timeStamp-f.timeStamp,b.angle=I(h,i),b.distance=H(h,i),B(c,b),b.offsetDirection=G(b.deltaX,b.deltaY);var j=F(b.deltaTime,b.deltaX,b.deltaY);b.overallVelocityX=j.x,b.overallVelocityY=j.y,b.overallVelocity=qa(j.x)>qa(j.y)?j.x:j.y,b.scale=g?K(g.pointers,d):1,b.rotation=g?J(g.pointers,d):0,b.maxPointers=c.prevInput?b.pointers.length>c.prevInput.maxPointers?b.pointers.length:c.prevInput.maxPointers:b.pointers.length,C(c,b);var k=a.element;o(b.srcEvent.target,k)&&(k=b.srcEvent.target),b.target=k}function B(a,b){var c=b.center,d=a.offsetDelta||{},e=a.prevDelta||{},f=a.prevInput||{};b.eventType!==Ea&&f.eventType!==Ga||(e=a.prevDelta={x:f.deltaX||0,y:f.deltaY||0},d=a.offsetDelta={x:c.x,y:c.y}),b.deltaX=e.x+(c.x-d.x),b.deltaY=e.y+(c.y-d.y)}function C(a,b){var c,e,f,g,h=a.lastInterval||b,i=b.timeStamp-h.timeStamp;if(b.eventType!=Ha&&(i>Da||h.velocity===d)){var j=b.deltaX-h.deltaX,k=b.deltaY-h.deltaY,l=F(i,j,k);e=l.x,f=l.y,c=qa(l.x)>qa(l.y)?l.x:l.y,g=G(j,k),a.lastInterval=b}else c=h.velocity,e=h.velocityX,f=h.velocityY,g=h.direction;b.velocity=c,b.velocityX=e,b.velocityY=f,b.direction=g}function D(a){for(var b=[],c=0;ce;)c+=a[e].clientX,d+=a[e].clientY,e++;return{x:pa(c/b),y:pa(d/b)}}function F(a,b,c){return{x:b/a||0,y:c/a||0}}function G(a,b){return a===b?Ia:qa(a)>=qa(b)?0>a?Ja:Ka:0>b?La:Ma}function H(a,b,c){c||(c=Qa);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return Math.sqrt(d*d+e*e)}function I(a,b,c){c||(c=Qa);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return 180*Math.atan2(e,d)/Math.PI}function J(a,b){return I(b[1],b[0],Ra)+I(a[1],a[0],Ra)}function K(a,b){return H(b[0],b[1],Ra)/H(a[0],a[1],Ra)}function L(){this.evEl=Ta,this.evWin=Ua,this.pressed=!1,x.apply(this,arguments)}function M(){this.evEl=Xa,this.evWin=Ya,x.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function N(){this.evTarget=$a,this.evWin=_a,this.started=!1,x.apply(this,arguments)}function O(a,b){var c=s(a.touches),d=s(a.changedTouches);return b&(Ga|Ha)&&(c=t(c.concat(d),"identifier",!0)),[c,d]}function P(){this.evTarget=bb,this.targetIds={},x.apply(this,arguments)}function Q(a,b){var c=s(a.touches),d=this.targetIds;if(b&(Ea|Fa)&&1===c.length)return d[c[0].identifier]=!0,[c,c];var e,f,g=s(a.changedTouches),h=[],i=this.target;if(f=c.filter(function(a){return o(a.target,i)}),b===Ea)for(e=0;e-1&&d.splice(a,1)};setTimeout(e,cb)}}function U(a){for(var b=a.srcEvent.clientX,c=a.srcEvent.clientY,d=0;d=f&&db>=g)return!0}return!1}function V(a,b){this.manager=a,this.set(b)}function W(a){if(p(a,jb))return jb;var b=p(a,kb),c=p(a,lb);return b&&c?jb:b||c?b?kb:lb:p(a,ib)?ib:hb}function X(){if(!fb)return!1;var b={},c=a.CSS&&a.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(d){b[d]=c?a.CSS.supports("touch-action",d):!0}),b}function Y(a){this.options=la({},this.defaults,a||{}),this.id=v(),this.manager=null,this.options.enable=l(this.options.enable,!0),this.state=nb,this.simultaneous={},this.requireFail=[]}function Z(a){return a&sb?"cancel":a&qb?"end":a&pb?"move":a&ob?"start":""}function $(a){return a==Ma?"down":a==La?"up":a==Ja?"left":a==Ka?"right":""}function _(a,b){var c=b.manager;return c?c.get(a):a}function aa(){Y.apply(this,arguments)}function ba(){aa.apply(this,arguments),this.pX=null,this.pY=null}function ca(){aa.apply(this,arguments)}function da(){Y.apply(this,arguments),this._timer=null,this._input=null}function ea(){aa.apply(this,arguments)}function fa(){aa.apply(this,arguments)}function ga(){Y.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function ha(a,b){return b=b||{},b.recognizers=l(b.recognizers,ha.defaults.preset),new ia(a,b)}function ia(a,b){this.options=la({},ha.defaults,b||{}),this.options.inputTarget=this.options.inputTarget||a,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=a,this.input=y(this),this.touchAction=new V(this,this.options.touchAction),ja(this,!0),g(this.options.recognizers,function(a){var b=this.add(new a[0](a[1]));a[2]&&b.recognizeWith(a[2]),a[3]&&b.requireFailure(a[3])},this)}function ja(a,b){var c=a.element;if(c.style){var d;g(a.options.cssProps,function(e,f){d=u(c.style,f),b?(a.oldCssProps[d]=c.style[d],c.style[d]=e):c.style[d]=a.oldCssProps[d]||""}),b||(a.oldCssProps={})}}function ka(a,c){var d=b.createEvent("Event");d.initEvent(a,!0,!0),d.gesture=c,c.target.dispatchEvent(d)}var la,ma=["","webkit","Moz","MS","ms","o"],na=b.createElement("div"),oa="function",pa=Math.round,qa=Math.abs,ra=Date.now;la="function"!=typeof Object.assign?function(a){if(a===d||null===a)throw new TypeError("Cannot convert undefined or null to object");for(var b=Object(a),c=1;ch&&(b.push(a),h=b.length-1):e&(Ga|Ha)&&(c=!0),0>h||(b[h]=a,this.callback(this.manager,e,{pointers:b,changedPointers:[a],pointerType:f,srcEvent:a}),c&&b.splice(h,1))}});var Za={touchstart:Ea,touchmove:Fa,touchend:Ga,touchcancel:Ha},$a="touchstart",_a="touchstart touchmove touchend touchcancel";i(N,x,{handler:function(a){var b=Za[a.type];if(b===Ea&&(this.started=!0),this.started){var c=O.call(this,a,b);b&(Ga|Ha)&&c[0].length-c[1].length===0&&(this.started=!1),this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:za,srcEvent:a})}}});var ab={touchstart:Ea,touchmove:Fa,touchend:Ga,touchcancel:Ha},bb="touchstart touchmove touchend touchcancel";i(P,x,{handler:function(a){var b=ab[a.type],c=Q.call(this,a,b);c&&this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:za,srcEvent:a})}});var cb=2500,db=25;i(R,x,{handler:function(a,b,c){var d=c.pointerType==za,e=c.pointerType==Ba;if(!(e&&c.sourceCapabilities&&c.sourceCapabilities.firesTouchEvents)){if(d)S.call(this,b,c);else if(e&&U.call(this,c))return;this.callback(a,b,c)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var eb=u(na.style,"touchAction"),fb=eb!==d,gb="compute",hb="auto",ib="manipulation",jb="none",kb="pan-x",lb="pan-y",mb=X();V.prototype={set:function(a){a==gb&&(a=this.compute()),fb&&this.manager.element.style&&mb[a]&&(this.manager.element.style[eb]=a),this.actions=a.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var a=[];return g(this.manager.recognizers,function(b){k(b.options.enable,[b])&&(a=a.concat(b.getTouchAction()))}),W(a.join(" "))},preventDefaults:function(a){var b=a.srcEvent,c=a.offsetDirection;if(this.manager.session.prevented)return void b.preventDefault();var d=this.actions,e=p(d,jb)&&!mb[jb],f=p(d,lb)&&!mb[lb],g=p(d,kb)&&!mb[kb];if(e){var h=1===a.pointers.length,i=a.distance<2,j=a.deltaTime<250;if(h&&i&&j)return}return g&&f?void 0:e||f&&c&Na||g&&c&Oa?this.preventSrc(b):void 0},preventSrc:function(a){this.manager.session.prevented=!0,a.preventDefault()}};var nb=1,ob=2,pb=4,qb=8,rb=qb,sb=16,tb=32;Y.prototype={defaults:{},set:function(a){return la(this.options,a),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(a){if(f(a,"recognizeWith",this))return this;var b=this.simultaneous;return a=_(a,this),b[a.id]||(b[a.id]=a,a.recognizeWith(this)),this},dropRecognizeWith:function(a){return f(a,"dropRecognizeWith",this)?this:(a=_(a,this),delete this.simultaneous[a.id],this)},requireFailure:function(a){if(f(a,"requireFailure",this))return this;var b=this.requireFail;return a=_(a,this),-1===r(b,a)&&(b.push(a),a.requireFailure(this)),this},dropRequireFailure:function(a){if(f(a,"dropRequireFailure",this))return this;a=_(a,this);var b=r(this.requireFail,a);return b>-1&&this.requireFail.splice(b,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(a){return!!this.simultaneous[a.id]},emit:function(a){function b(b){c.manager.emit(b,a)}var c=this,d=this.state;qb>d&&b(c.options.event+Z(d)),b(c.options.event),a.additionalEvent&&b(a.additionalEvent),d>=qb&&b(c.options.event+Z(d))},tryEmit:function(a){return this.canEmit()?this.emit(a):void(this.state=tb)},canEmit:function(){for(var a=0;af?Ja:Ka,c=f!=this.pX,d=Math.abs(a.deltaX)):(e=0===g?Ia:0>g?La:Ma,c=g!=this.pY,d=Math.abs(a.deltaY))),a.direction=e,c&&d>b.threshold&&e&b.direction},attrTest:function(a){return aa.prototype.attrTest.call(this,a)&&(this.state&ob||!(this.state&ob)&&this.directionTest(a))},emit:function(a){this.pX=a.deltaX,this.pY=a.deltaY;var b=$(a.direction);b&&(a.additionalEvent=this.options.event+b),this._super.emit.call(this,a)}}),i(ca,aa,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[jb]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.scale-1)>this.options.threshold||this.state&ob)},emit:function(a){if(1!==a.scale){var b=a.scale<1?"in":"out";a.additionalEvent=this.options.event+b}this._super.emit.call(this,a)}}),i(da,Y,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[hb]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distanceb.time;if(this._input=a,!d||!c||a.eventType&(Ga|Ha)&&!f)this.reset();else if(a.eventType&Ea)this.reset(),this._timer=e(function(){this.state=rb,this.tryEmit()},b.time,this);else if(a.eventType&Ga)return rb;return tb},reset:function(){clearTimeout(this._timer)},emit:function(a){this.state===rb&&(a&&a.eventType&Ga?this.manager.emit(this.options.event+"up",a):(this._input.timeStamp=ra(),this.manager.emit(this.options.event,this._input)))}}),i(ea,aa,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[jb]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.rotation)>this.options.threshold||this.state&ob)}}),i(fa,aa,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Na|Oa,pointers:1},getTouchAction:function(){return ba.prototype.getTouchAction.call(this)},attrTest:function(a){var b,c=this.options.direction;return c&(Na|Oa)?b=a.overallVelocity:c&Na?b=a.overallVelocityX:c&Oa&&(b=a.overallVelocityY),this._super.attrTest.call(this,a)&&c&a.offsetDirection&&a.distance>this.options.threshold&&a.maxPointers==this.options.pointers&&qa(b)>this.options.velocity&&a.eventType&Ga},emit:function(a){var b=$(a.offsetDirection);b&&this.manager.emit(this.options.event+b,a),this.manager.emit(this.options.event,a)}}),i(ga,Y,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ib]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distance")&&n[0]);return e>4?e:!1}();return e},h.isInternetExplorer=function(){var e=h.isInternetExplorer.cached=typeof h.isInternetExplorer.cached!="undefined"?h.isInternetExplorer.cached:Boolean(h.getInternetExplorerMajorVersion());return e},h.options.html4Mode?h.emulated={pushState:!0,hashChange:!0}:h.emulated={pushState:!Boolean(e.history&&e.history.pushState&&e.history.replaceState&&!/ Mobile\/([1-7][a-z]|(8([abcde]|f(1[0-8]))))/i.test(i.userAgent)&&!/AppleWebKit\/5([0-2]|3[0-2])/i.test(i.userAgent)),hashChange:Boolean(!("onhashchange"in e||"onhashchange"in r)||h.isInternetExplorer()&&h.getInternetExplorerMajorVersion()<8)},h.enabled=!h.emulated.pushState,h.bugs={setHash:Boolean(!h.emulated.pushState&&i.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2]|3[0-3])/.test(i.userAgent)),safariPoll:Boolean(!h.emulated.pushState&&i.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2]|3[0-3])/.test(i.userAgent)),ieDoubleCheck:Boolean(h.isInternetExplorer()&&h.getInternetExplorerMajorVersion()<8),hashEscape:Boolean(h.isInternetExplorer()&&h.getInternetExplorerMajorVersion()<7)},h.isEmptyObject=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},h.cloneObject=function(e){var t,n;return e?(t=l.stringify(e),n=l.parse(t)):n={},n},h.getRootUrl=function(){var e=r.location.protocol+"//"+(r.location.hostname||r.location.host);if(r.location.port||!1)e+=":"+r.location.port;return e+="/",e},h.getBaseHref=function(){var e=r.getElementsByTagName("base"),t=null,n="";return e.length===1&&(t=e[0],n=t.href.replace(/[^\/]+$/,"")),n=n.replace(/\/+$/,""),n&&(n+="/"),n},h.getBaseUrl=function(){var e=h.getBaseHref()||h.getBasePageUrl()||h.getRootUrl();return e},h.getPageUrl=function(){var e=h.getState(!1,!1),t=(e||{}).url||h.getLocationHref(),n;return n=t.replace(/\/+$/,"").replace(/[^\/]+$/,function(e,t,n){return/\./.test(e)?e:e+"/"}),n},h.getBasePageUrl=function(){var e=h.getLocationHref().replace(/[#\?].*/,"").replace(/[^\/]+$/,function(e,t,n){return/[^\/]$/.test(e)?"":e}).replace(/\/+$/,"")+"/";return e},h.getFullUrl=function(e,t){var n=e,r=e.substring(0,1);return t=typeof t=="undefined"?!0:t,/[a-z]+\:\/\//.test(e)||(r==="/"?n=h.getRootUrl()+e.replace(/^\/+/,""):r==="#"?n=h.getPageUrl().replace(/#.*/,"")+e:r==="?"?n=h.getPageUrl().replace(/[\?#].*/,"")+e:t?n=h.getBaseUrl()+e.replace(/^(\.\/)+/,""):n=h.getBasePageUrl()+e.replace(/^(\.\/)+/,"")),n.replace(/\#$/,"")},h.getShortUrl=function(e){var t=e,n=h.getBaseUrl(),r=h.getRootUrl();return h.emulated.pushState&&(t=t.replace(n,"")),t=t.replace(r,"/"),h.isTraditionalAnchor(t)&&(t="./"+t),t=t.replace(/^(\.\/)+/g,"./").replace(/\#$/,""),t},h.getLocationHref=function(e){return e=e||r,e.URL===e.location.href?e.location.href:e.location.href===decodeURIComponent(e.URL)?e.URL:e.location.hash&&decodeURIComponent(e.location.href.replace(/^[^#]+/,""))===e.location.hash?e.location.href:e.URL.indexOf("#")==-1&&e.location.href.indexOf("#")!=-1?e.location.href:e.URL||e.location.href},h.store={},h.idToState=h.idToState||{},h.stateToId=h.stateToId||{},h.urlToId=h.urlToId||{},h.storedStates=h.storedStates||[],h.savedStates=h.savedStates||[],h.normalizeStore=function(){h.store.idToState=h.store.idToState||{},h.store.urlToId=h.store.urlToId||{},h.store.stateToId=h.store.stateToId||{}},h.getState=function(e,t){typeof e=="undefined"&&(e=!0),typeof t=="undefined"&&(t=!0);var n=h.getLastSavedState();return!n&&t&&(n=h.createStateObject()),e&&(n=h.cloneObject(n),n.url=n.cleanUrl||n.url),n},h.getIdByState=function(e){var t=h.extractId(e.url),n;if(!t){n=h.getStateString(e);if(typeof h.stateToId[n]!="undefined")t=h.stateToId[n];else if(typeof h.store.stateToId[n]!="undefined")t=h.store.stateToId[n];else{for(;;){t=(new Date).getTime()+String(Math.random()).replace(/\D/g,"");if(typeof h.idToState[t]=="undefined"&&typeof h.store.idToState[t]=="undefined")break}h.stateToId[n]=t,h.idToState[t]=e}}return t},h.normalizeState=function(e){var t,n;if(!e||typeof e!="object")e={};if(typeof e.normalized!="undefined")return e;if(!e.data||typeof e.data!="object")e.data={};return t={},t.normalized=!0,t.title=e.title||"",t.url=h.getFullUrl(e.url?e.url:h.getLocationHref()),t.hash=h.getShortUrl(t.url),t.data=h.cloneObject(e.data),t.id=h.getIdByState(t),t.cleanUrl=t.url.replace(/\??\&_suid.*/,""),t.url=t.cleanUrl,n=!h.isEmptyObject(t.data),(t.title||n)&&h.options.disableSuid!==!0&&(t.hash=h.getShortUrl(t.url).replace(/\??\&_suid.*/,""),/\?/.test(t.hash)||(t.hash+="?"),t.hash+="&_suid="+t.id),t.hashedUrl=h.getFullUrl(t.hash),(h.emulated.pushState||h.bugs.safariPoll)&&h.hasUrlDuplicate(t)&&(t.url=t.hashedUrl),t},h.createStateObject=function(e,t,n){var r={data:e,title:t,url:n};return r=h.normalizeState(r),r},h.getStateById=function(e){e=String(e);var n=h.idToState[e]||h.store.idToState[e]||t;return n},h.getStateString=function(e){var t,n,r;return t=h.normalizeState(e),n={data:t.data,title:e.title,url:e.url},r=l.stringify(n),r},h.getStateId=function(e){var t,n;return t=h.normalizeState(e),n=t.id,n},h.getHashByState=function(e){var t,n;return t=h.normalizeState(e),n=t.hash,n},h.extractId=function(e){var t,n,r,i;return e.indexOf("#")!=-1?i=e.split("#")[0]:i=e,n=/(.*)\&_suid=([0-9]+)$/.exec(i),r=n?n[1]||e:e,t=n?String(n[2]||""):"",t||!1},h.isTraditionalAnchor=function(e){var t=!/[\/\?\.]/.test(e);return t},h.extractState=function(e,t){var n=null,r,i;return t=t||!1,r=h.extractId(e),r&&(n=h.getStateById(r)),n||(i=h.getFullUrl(e),r=h.getIdByUrl(i)||!1,r&&(n=h.getStateById(r)),!n&&t&&!h.isTraditionalAnchor(e)&&(n=h.createStateObject(null,null,i))),n},h.getIdByUrl=function(e){var n=h.urlToId[e]||h.store.urlToId[e]||t;return n},h.getLastSavedState=function(){return h.savedStates[h.savedStates.length-1]||t},h.getLastStoredState=function(){return h.storedStates[h.storedStates.length-1]||t},h.hasUrlDuplicate=function(e){var t=!1,n;return n=h.extractState(e.url),t=n&&n.id!==e.id,t},h.storeState=function(e){return h.urlToId[e.url]=e.id,h.storedStates.push(h.cloneObject(e)),e},h.isLastSavedState=function(e){var t=!1,n,r,i;return h.savedStates.length&&(n=e.id,r=h.getLastSavedState(),i=r.id,t=n===i),t},h.saveState=function(e){return h.isLastSavedState(e)?!1:(h.savedStates.push(h.cloneObject(e)),!0)},h.getStateByIndex=function(e){var t=null;return typeof e=="undefined"?t=h.savedStates[h.savedStates.length-1]:e<0?t=h.savedStates[h.savedStates.length+e]:t=h.savedStates[e],t},h.getCurrentIndex=function(){var e=null;return h.savedStates.length<1?e=0:e=h.savedStates.length-1,e},h.getHash=function(e){var t=h.getLocationHref(e),n;return n=h.getHashByUrl(t),n},h.unescapeHash=function(e){var t=h.normalizeHash(e);return t=decodeURIComponent(t),t},h.normalizeHash=function(e){var t=e.replace(/[^#]*#/,"").replace(/#.*/,"");return t},h.setHash=function(e,t){var n,i;return t!==!1&&h.busy()?(h.pushQueue({scope:h,callback:h.setHash,args:arguments,queue:t}),!1):(h.busy(!0),n=h.extractState(e,!0),n&&!h.emulated.pushState?h.pushState(n.data,n.title,n.url,!1):h.getHash()!==e&&(h.bugs.setHash?(i=h.getPageUrl(),h.pushState(null,null,i+"#"+e,!1)):r.location.hash=e),h)},h.escapeHash=function(t){var n=h.normalizeHash(t);return n=e.encodeURIComponent(n),h.bugs.hashEscape||(n=n.replace(/\%21/g,"!").replace(/\%26/g,"&").replace(/\%3D/g,"=").replace(/\%3F/g,"?")),n},h.getHashByUrl=function(e){var t=String(e).replace(/([^#]*)#?([^#]*)#?(.*)/,"$2");return t=h.unescapeHash(t),t},h.setTitle=function(e){var t=e.title,n;t||(n=h.getStateByIndex(0),n&&n.url===e.url&&(t=n.title||h.options.initialTitle));try{r.getElementsByTagName("title")[0].innerHTML=t.replace("<","<").replace(">",">").replace(" & "," & ")}catch(i){}return r.title=t,h},h.queues=[],h.busy=function(e){typeof e!="undefined"?h.busy.flag=e:typeof h.busy.flag=="undefined"&&(h.busy.flag=!1);if(!h.busy.flag){u(h.busy.timeout);var t=function(){var e,n,r;if(h.busy.flag)return;for(e=h.queues.length-1;e>=0;--e){n=h.queues[e];if(n.length===0)continue;r=n.shift(),h.fireQueueItem(r),h.busy.timeout=o(t,h.options.busyDelay)}};h.busy.timeout=o(t,h.options.busyDelay)}return h.busy.flag},h.busy.flag=!1,h.fireQueueItem=function(e){return e.callback.apply(e.scope||h,e.args||[])},h.pushQueue=function(e){return h.queues[e.queue||0]=h.queues[e.queue||0]||[],h.queues[e.queue||0].push(e),h},h.queue=function(e,t){return typeof e=="function"&&(e={callback:e}),typeof t!="undefined"&&(e.queue=t),h.busy()?h.pushQueue(e):h.fireQueueItem(e),h},h.clearQueue=function(){return h.busy.flag=!1,h.queues=[],h},h.stateChanged=!1,h.doubleChecker=!1,h.doubleCheckComplete=function(){return h.stateChanged=!0,h.doubleCheckClear(),h},h.doubleCheckClear=function(){return h.doubleChecker&&(u(h.doubleChecker),h.doubleChecker=!1),h},h.doubleCheck=function(e){return h.stateChanged=!1,h.doubleCheckClear(),h.bugs.ieDoubleCheck&&(h.doubleChecker=o(function(){return h.doubleCheckClear(),h.stateChanged||e(),!0},h.options.doubleCheckInterval)),h},h.safariStatePoll=function(){var t=h.extractState(h.getLocationHref()),n;if(!h.isLastSavedState(t))return n=t,n||(n=h.createStateObject()),h.Adapter.trigger(e,"popstate"),h;return},h.back=function(e){return e!==!1&&h.busy()?(h.pushQueue({scope:h,callback:h.back,args:arguments,queue:e}),!1):(h.busy(!0),h.doubleCheck(function(){h.back(!1)}),p.go(-1),!0)},h.forward=function(e){return e!==!1&&h.busy()?(h.pushQueue({scope:h,callback:h.forward,args:arguments,queue:e}),!1):(h.busy(!0),h.doubleCheck(function(){h.forward(!1)}),p.go(1),!0)},h.go=function(e,t){var n;if(e>0)for(n=1;n<=e;++n)h.forward(t);else{if(!(e<0))throw new Error("History.go: History.go requires a positive or negative integer passed.");for(n=-1;n>=e;--n)h.back(t)}return h};if(h.emulated.pushState){var v=function(){};h.pushState=h.pushState||v,h.replaceState=h.replaceState||v}else h.onPopState=function(t,n){var r=!1,i=!1,s,o;return h.doubleCheckComplete(),s=h.getHash(),s?(o=h.extractState(s||h.getLocationHref(),!0),o?h.replaceState(o.data,o.title,o.url,!1):(h.Adapter.trigger(e,"anchorchange"),h.busy(!1)),h.expectedStateId=!1,!1):(r=h.Adapter.extractEventData("state",t,n)||!1,r?i=h.getStateById(r):h.expectedStateId?i=h.getStateById(h.expectedStateId):i=h.extractState(h.getLocationHref()),i||(i=h.createStateObject(null,null,h.getLocationHref())),h.expectedStateId=!1,h.isLastSavedState(i)?(h.busy(!1),!1):(h.storeState(i),h.saveState(i),h.setTitle(i),h.Adapter.trigger(e,"statechange"),h.busy(!1),!0))},h.Adapter.bind(e,"popstate",h.onPopState),h.pushState=function(t,n,r,i){if(h.getHashByUrl(r)&&h.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(i!==!1&&h.busy())return h.pushQueue({scope:h,callback:h.pushState,args:arguments,queue:i}),!1;h.busy(!0);var s=h.createStateObject(t,n,r);return h.isLastSavedState(s)?h.busy(!1):(h.storeState(s),h.expectedStateId=s.id,p.pushState(s.id,s.title,s.url),h.Adapter.trigger(e,"popstate")),!0},h.replaceState=function(t,n,r,i){if(h.getHashByUrl(r)&&h.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(i!==!1&&h.busy())return h.pushQueue({scope:h,callback:h.replaceState,args:arguments,queue:i}),!1;h.busy(!0);var s=h.createStateObject(t,n,r);return h.isLastSavedState(s)?h.busy(!1):(h.storeState(s),h.expectedStateId=s.id,p.replaceState(s.id,s.title,s.url),h.Adapter.trigger(e,"popstate")),!0};if(s){try{h.store=l.parse(s.getItem("History.store"))||{}}catch(m){h.store={}}h.normalizeStore()}else h.store={},h.normalizeStore();h.Adapter.bind(e,"unload",h.clearAllIntervals),h.saveState(h.storeState(h.extractState(h.getLocationHref(),!0))),s&&(h.onUnload=function(){var e,t,n;try{e=l.parse(s.getItem("History.store"))||{}}catch(r){e={}}e.idToState=e.idToState||{},e.urlToId=e.urlToId||{},e.stateToId=e.stateToId||{};for(t in h.idToState){if(!h.idToState.hasOwnProperty(t))continue;e.idToState[t]=h.idToState[t]}for(t in h.urlToId){if(!h.urlToId.hasOwnProperty(t))continue;e.urlToId[t]=h.urlToId[t]}for(t in h.stateToId){if(!h.stateToId.hasOwnProperty(t))continue;e.stateToId[t]=h.stateToId[t]}h.store=e,h.normalizeStore(),n=l.stringify(e);try{s.setItem("History.store",n)}catch(i){if(i.code!==DOMException.QUOTA_EXCEEDED_ERR)throw i;s.length&&(s.removeItem("History.store"),s.setItem("History.store",n))}},h.intervalList.push(a(h.onUnload,h.options.storeInterval)),h.Adapter.bind(e,"beforeunload",h.onUnload),h.Adapter.bind(e,"unload",h.onUnload));if(!h.emulated.pushState){h.bugs.safariPoll&&h.intervalList.push(a(h.safariStatePoll,h.options.safariPollInterval));if(i.vendor==="Apple Computer, Inc."||(i.appCodeName||"")==="Mozilla")h.Adapter.bind(e,"hashchange",function(){h.Adapter.trigger(e,"popstate")}),h.getHash()&&h.Adapter.onDomLoad(function(){h.Adapter.trigger(e,"hashchange")})}},(!h.options||!h.options.delayInit)&&h.init()}(window); }; !function(e,t,i,o){var n=e(t);e.fn.ggLazyLoad=function(r){var f,l=this,a={threshold:0,failure_limit:0,event:"scroll",effect:"show",container:t,data_attribute:"original",skip_invisible:!1,appear:null,load:null,placeholder:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC"};function h(){var t=0;l.each(function(){var i=e(this);if(!a.skip_invisible||i.is(":visible"))if(e.abovethetop(this,a)||e.leftofbegin(this,a));else if(e.belowthefold(this,a)||e.rightoffold(this,a)){if(++t>a.failure_limit)return!1}else i.trigger("appear"),t=0})}return r&&(o!==r.failurelimit&&(r.failure_limit=r.failurelimit,delete r.failurelimit),o!==r.effectspeed&&(r.effect_speed=r.effectspeed,delete r.effectspeed),e.extend(a,r)),f=a.container===o||a.container===t?n:e(a.container),0===a.event.indexOf("scroll")&&f.bind(a.event,function(){return h()}),this.each(function(){var t=this,i=e(t);t.loaded=!1,i.attr("src")!==o&&!1!==i.attr("src")||i.is("img")&&i.attr("src",a.placeholder),i.one("appear",function(){if(!this.loaded){if(a.appear){var o=l.length;a.appear.call(t,o,a)}e("").bind("load",function(){var o=i.attr("data-"+a.data_attribute);i.hide(),i.is("img")?i.attr("src",o):i.css("background-image","url('"+o+"')"),i[a.effect](a.effect_speed),t.loaded=!0,i.removeClass("ggLazyImg");var n=e.grep(l,function(e){return!e.loaded});if(l=e(n),a.load){var r=l.length;a.load.call(t,r,a)}}).attr("src",i.attr("data-"+a.data_attribute))}}),0!==a.event.indexOf("scroll")&&i.bind(a.event,function(){t.loaded||i.trigger("appear")})}),n.bind("resize",function(){h()}),/(?:iphone|ipod|ipad).*os 5/gi.test(navigator.appVersion)&&n.bind("pageshow",function(t){t.originalEvent&&t.originalEvent.persisted&&l.each(function(){e(this).trigger("appear")})}),e(i).ready(function(){h()}),this},e.belowthefold=function(i,r){return(r.container===o||r.container===t?(t.innerHeight?t.innerHeight:n.height())+n.scrollTop():e(r.container).offset().top+e(r.container).height())<=e(i).offset().top-r.threshold},e.rightoffold=function(i,r){return(r.container===o||r.container===t?n.width()+n.scrollLeft():e(r.container).offset().left+e(r.container).width())<=e(i).offset().left-r.threshold},e.abovethetop=function(i,r){return(r.container===o||r.container===t?n.scrollTop():e(r.container).offset().top)>=e(i).offset().top+r.threshold+e(i).height()},e.leftofbegin=function(i,r){return(r.container===o||r.container===t?n.scrollLeft():e(r.container).offset().left)>=e(i).offset().left+r.threshold+e(i).width()},e.inviewport=function(t,i){return!(e.rightoffold(t,i)||e.leftofbegin(t,i)||e.belowthefold(t,i)||e.abovethetop(t,i))},e.extend(e.expr[":"],{"below-the-fold":function(t){return e.belowthefold(t,{threshold:0})},"above-the-top":function(t){return!e.belowthefold(t,{threshold:0})},"right-of-screen":function(t){return e.rightoffold(t,{threshold:0})},"left-of-screen":function(t){return!e.rightoffold(t,{threshold:0})},"in-viewport":function(t){return e.inviewport(t,{threshold:0})},"above-the-fold":function(t){return!e.belowthefold(t,{threshold:0})},"right-of-fold":function(t){return e.rightoffold(t,{threshold:0})},"left-of-fold":function(t){return!e.rightoffold(t,{threshold:0})}})}(jQuery,window,document); (function($){ $.fn.extend({ slimScroll: function(options){ var defaults={ axis: 'y', width:'auto', height:'250px', size:'7px', color: '#000', positionX:'bottom', positionY:'right', distance:'1px', startX:'left', startY:'top', opacity:0.4, alwaysVisible:false, disableFadeOut:false, railVisible:false, railColor:'#333', railOpacity:0.2, railDraggable:true, railClassX:'slimScrollRailX', barClassX:'slimScrollBarX', railClassY:'slimScrollRailY', barClassY:'slimScrollBarY', wrapperClass:'slimScrollDiv', animate: false, allowPageScroll:false, wheelStep:20, touchScrollStep:200, borderRadius: '7px', railBorderRadius:'7px', 'ggSlimscrollHandler': false, }; var o=$.extend(defaults, options); o.axis=o.axis.toLowerCase(); this.each(function(){ var hasHorizontalScrollbar; var hasVerticalScrollbar; var t, pageX, pageY; var isOverPanel, isOverBarX, isOverBarY, isDragg, queueHideX, queueHideY, touchDifX, touchDifY, barHeight, barWidth, percentScrollX, lastScrollX, percentScrollY, lastScrollY, divS='
    ', minBarHeight=30, minBarWidth=30, releaseScroll=false; var me=$(this); var $doc=$(document); if(me.parent().hasClass(o.wrapperClass)){ $.extend(o, (me.data('slimScrollConfig')||{})); var offset_horizontal=me.scrollLeft(); var offset_vertical=me.scrollTop(); barX=me.siblings('.' + o.barClassX); railX=me.siblings('.' + o.railClassX); barY=me.siblings('.' + o.barClassY); railY=me.siblings('.' + o.railClassY); hasHorizontalScrollbar=(o.axis=='both'||o.axis=='x'); hasVerticalScrollbar=(o.axis=='both'||o.axis=='y'); getBarXWidth(); getBarYHeight(); if($.isPlainObject(options)){ if('width' in options&&hasHorizontalScrollbar){ if(options.width=='auto'){ me.parent().css('width', 'auto'); me.css('width', 'auto'); o.width=me.parent().parent().width(); }else{ o.width=options.width; me.css({'white-space': 'nowrap'}); }} if('height' in options&&hasVerticalScrollbar){ if(options.height=='auto'){ me.parent().css('height', 'auto'); me.css('height', 'auto'); o.height=me.parent().parent().height(); }else{ o.height=options.height; }} me.parent().css({ position: 'relative', overflow: 'hidden', width: o.width, height: o.height }); me.css({ overflow: 'hidden', width: o.width, height: o.height }); if('scrollToX' in options){ offset_horizontal=parseInt(o.scrollToX); } else if('scrollByX' in options){ offset_horizontal +=parseInt(o.scrollByX); } if('scrollToY' in options){ offset_vertical=parseInt(o.scrollToY); } else if('scrollByY' in options){ offset_vertical +=parseInt(o.scrollByY); } if('destroy' in options){ barX.remove(); railX.remove(); barY.remove(); railY.remove(); me.unwrap(); return; }} scrollContent(offset_horizontal, offset_vertical, false, true); return; } else if($.isPlainObject(options)){ if('destroy' in options){ return; }} hasHorizontalScrollbar=(o.axis=='both'||o.axis=='x'); hasVerticalScrollbar=(o.axis=='both'||o.axis=='y'); o.height=(o.height=='auto') ? me.parent().height():o.height; o.width=(o.width=='auto') ? me.parent().width():o.width; me.data('slimScrollConfig', o); var wrapper=$(divS) .addClass(o.wrapperClass) .css({ position: 'relative', overflow: 'hidden', width: o.width, height: o.height }); me.css({ overflow: 'hidden', width: o.width, height: o.height }); me.wrap(wrapper); if(hasHorizontalScrollbar){ if(o.width!='auto'&&hasHorizontalScrollbar){ me.css({'white-space': 'nowrap'}); } var railX=$(divS) .addClass(o.railClassX) .css({ width: '100%', height: o.size, position: 'absolute', left: 0, display: (o.alwaysVisible&&o.railVisible) ? 'block':'none', 'border-radius': o.railBorderRadius, background: o.railColor, opacity: o.railOpacity, zIndex: 90 }); var barX=$(divS) .addClass(o.barClassX) .css({ background: o.color, height: o.size, position: 'absolute', left: 0, opacity: o.opacity, display: o.alwaysVisible ? 'block':'none', 'border-radius':o.borderRadius, BorderRadius: o.borderRadius, MozBorderRadius: o.borderRadius, WebkitBorderRadius: o.borderRadius, zIndex: 99 }); var xPosCss=(o.positionX=='top') ? { top: o.distance }:{ bottom: o.distance }; railX.css(xPosCss); barX.css(xPosCss); me.parent().append(barX); me.parent().append(railX); if(o.railDraggable){ barX.on("mousedown", function(e){ isDragg=true; t=parseFloat(barX.css('left')); pageX=e.pageX; $doc.on("mousemove.slimscrollX", function(e){ currLeft=t + e.pageX - pageX; barX.css('left', currLeft); scrollContent(0, 0, barX.position().left); }); $doc.on("mouseup.slimscrollX", function(e){ isDragg=false; hideBarX(); $doc.unbind('.slimscrollX'); }); return false; }).on("selectstart.slimscrollX", function(e){ e.stopPropagation(); e.preventDefault(); return false; }); railX.on("mousedown", function(e){ var deltaX=(e.offsetX - (barWidth/2))* me[0].scrollWidth / me.outerWidth(); scrollContent(deltaX, 0, false, true); t=parseFloat(barX.css('left')); pageX=e.pageX; $doc.on("mousemove.slimscrollX", function(e){ currLeft=t + e.pageX - pageX; barX.css('left', currLeft); scrollContent(0, 0, barX.position().left); }); $doc.on("mouseup.slimscrollX", function(e){ isDragg=false; hideBarX(); $doc.unbind('.slimscrollX'); }); return false; }); } railX.hover(function(){ showBarX(); }, function(){ hideBarX(); }); barX.hover(function(){ isOverBarX=true; }, function(){ isOverBarX=false; }); getBarXWidth(); if(o.startX==='right'){ barX.css({ left: me.outerWidth() - barX.outerWidth() }); scrollContent(0, 0, true); } else if(o.startX!=='left'){ scrollContent($(o.startX).position().left, null, null, true); if(!o.alwaysVisible){ barX.hide(); }} } if(hasVerticalScrollbar){ var railY=$(divS) .addClass(o.railClassY) .css({ width: o.size, height: '100%', position: 'absolute', top: 0, display: (o.alwaysVisible&&o.railVisible) ? 'block':'none', 'border-radius': o.railBorderRadius, background: o.railColor, opacity: o.railOpacity, zIndex: 90 }); var barY=$(divS) .addClass(o.barClassY) .css({ background: o.color, width: o.size, position: 'absolute', top: 0, opacity: o.opacity, display: o.alwaysVisible ? 'block':'none', 'border-radius':o.borderRadius, BorderRadius: o.borderRadius, MozBorderRadius: o.borderRadius, WebkitBorderRadius: o.borderRadius, zIndex: 99 }); var yPosCss=(o.positionY=='right') ? { right: o.distance }:{ left: o.distance }; railY.css(yPosCss); barY.css(yPosCss); me.parent().append(barY); me.parent().append(railY); if(o.railDraggable){ barY.on("mousedown", function(e){ isDragg=true; t=parseFloat(barY.css('top')); pageY=e.pageY; $doc.on("mousemove.slimscrollY", function(e){ currTop=t + e.pageY - pageY; barY.css('top', currTop); scrollContent(0, 0, barY.position().top); }); $doc.on("mouseup.slimscrollY", function(e){ isDragg=false; hideBarY(); $doc.unbind('.slimscrollY'); }); return false; }).on("selectstart.slimscrollY", function(e){ e.stopPropagation(); e.preventDefault(); return false; }); railY.on("mousedown", function(e){ var deltaY=(e.offsetY - (barHeight/2))* me[0].scrollHeight / me.outerHeight(); scrollContent(0, deltaY, false, true); t=parseFloat(barY.css('top')); pageY=e.pageY; $doc.on("mousemove.slimscrollY", function(e){ currTop=t + e.pageY - pageY; barY.css('top', currTop); scrollContent(0, 0, barY.position().top); }); $doc.on("mouseup.slimscrollY", function(e){ isDragg=false; hideBarY(); $doc.unbind('.slimscrollY'); }); return false; }); } railY.hover(function(){ showBarY(); }, function(){ hideBarY(); }); barY.hover(function(){ isOverBarY=true; }, function(){ isOverBarY=false; }); getBarYHeight(); if(o.startY==='bottom'){ barY.css({ top: me.outerHeight() - barY.outerHeight() }); scrollContent(0, 0, true); } else if(o.startY!=='top'){ scrollContent(null, $(o.startY).position().top, null, true); if(!o.alwaysVisible){ barY.hide(); }} } me.hover(function(){ isOverPanel=true; showBarX(); showBarY(); hideBarX(); hideBarY(); }, function(){ isOverPanel=false; hideBarX(); hideBarY(); }); var _triggerInit=function(){ if(typeof(Hammer_gg)=='undefined'){ setTimeout(_triggerInit, 100); return; } if(o.isMobile){ var hammer=new Hammer_gg(me.context), scrollWidth=50; hammer.get('pan').set({ threshold:scrollWidth }); hammer.on('panleft',function(e){ scrollContent(0, scrollWidth, false, false, true); panDistance=e.distance; }); hammer.on('panend',function(e){ var offset=scrollWidth * (e.velocityX * -1) * 30; scrollContent(0, offset, false, false, true); }); hammer.on('panright',function(e){ scrollContent(0, -scrollWidth, false, false, true); panDistance=e.distance; }); }}; _triggerInit(); attachWheel(this); function _getDeltaFromEvent(e){ var deltaX=0; var deltaY=0; deltaX=((e.deltaX||-e.wheelDelta||e.detail) >> 10)||1; deltaY=((e.deltaY||-e.wheelDelta||e.detail) >> 10)||1; if('axis' in e&&e.axis===e.HORIZONTAL_AXIS){ deltaX=deltaY * -1; deltaY=0; } if(deltaX!==deltaX&&deltaY!==deltaY){ deltaX=0; } return [deltaX, deltaY]; } function _onWheel(e){ if(!isOverPanel){ return; } e=e||window.event; var delta=_getDeltaFromEvent(e); var deltaX=delta[0]; var deltaY=delta[1]; var target=e.target||e.srcTarget||e.srcElement; if($(target).closest('.' + o.wrapperClass).is(me.parent())){ scrollContent(deltaX, deltaY, true); } if(e.preventDefault&&!releaseScroll){ e.preventDefault(); e.stopPropagation(); } if(!releaseScroll){ e.returnValue=false; }} function scrollContent(x, y, isWheel, isJump, isPan){ releaseScroll=false; var needToRunWindowScroll=false, prevBarXOffset=0; if(hasHorizontalScrollbar){ var deltaX=x; var maxLeft=me.outerWidth() - barX.outerWidth(), totalWidth=me[0].scrollWidth, scrollOffset=me.scrollLeft(), barXOffset=parseFloat(barX.css('left')); if(isWheel){ if(!hasVerticalScrollbar){ x=y; } deltaX=parseInt(barX.css('left')) + (x * parseInt(o.wheelStep)); deltaX=Math.min(Math.max(deltaX, 0), maxLeft); deltaX=(x > 0) ? Math.ceil(deltaX):Math.floor(deltaX); barX.css({ left: deltaX + 'px' }); prevBarXOffset=barXOffset; barXOffset=parseFloat(barX.css('left')); needToRunWindowScroll=(prevBarXOffset==barXOffset); } percentScrollX=barXOffset / maxLeft; deltaX=percentScrollX * (totalWidth - me.outerWidth()); if(isPan){ deltaX=totalWidth - (totalWidth - scrollOffset - y); var panOffsetPercent=deltaX / (totalWidth - me.outerWidth()); var scrollBarOffset=maxLeft * panOffsetPercent; scrollBarOffset=Math.min(Math.max(scrollBarOffset, 0), maxLeft); scrollBarOffset=(x > 0) ? Math.ceil(scrollBarOffset):Math.floor(scrollBarOffset); barX.stop(true, true).animate({ left: scrollBarOffset + 'px' }, 300, 'linear'); } if(isJump){ if(!hasVerticalScrollbar){ x=y; } deltaX=x; var offsetLeft=deltaX / me[0].scrollWidth * me.outerWidth(); offsetLeft=Math.min(Math.max(offsetLeft, 0), maxLeft); barX.css({ left: offsetLeft + 'px' }); } if(o.animate){ me.scrollTop(deltaX); me.stop(true, true).animate({ scrollLeft: deltaX }, 500, 'linear'); }else{ me.scrollLeft(deltaX); } me.trigger('slimscrollingX', ~~deltaX); showBarX(needToRunWindowScroll); hideBarX(); } if(hasVerticalScrollbar){ var deltaY=y; var maxTop=me.outerHeight() - barY.outerHeight(); if(isWheel){ deltaY=parseInt(barY.css('top')) + (y * parseInt(o.wheelStep) /100); deltaY=Math.min(Math.max(deltaY, 0), maxTop); deltaY=(y > 0) ? Math.ceil(deltaY):Math.floor(deltaY); barY.css({ top: deltaY + 'px' }); } percentScrollY=parseInt(barY.css('top')) / (me.outerHeight() - barY.outerHeight()); deltaY=percentScrollY * (me[0].scrollHeight - me.outerHeight()); if(isJump){ deltaY=y; var offsetTop=deltaY / me[0].scrollHeight * me.outerHeight(); offsetTop=Math.min(Math.max(offsetTop, 0), maxTop); barY.css({ top: offsetTop + 'px' }); } me.scrollTop(deltaY); me.trigger('slimscrollingY', ~~deltaY); showBarY(); hideBarY(); } if(o.ggSlimscrollHandler){ o.ggSlimscrollHandler(); }} function attachWheel(target){ if(window.addEventListener){ if(typeof window.onwheel!=="undefined"){ target.addEventListener('wheel', _onWheel, false); }else if(typeof window.onmousewheel!=="undefined"){ target.addEventListener('mousewheel', _onWheel, false); } target.addEventListener('DOMMouseScroll', _onWheel, false); }else{ document.attachEvent("onmousewheel", _onWheel); }} function getBarXWidth(){ if(!barX){return;} barWidth=Math.max((me.outerWidth() / me[0].scrollWidth) * me.outerWidth(), minBarWidth); barX.css({ width: barWidth + 'px' }); var display=(hasHorizontalScrollbar&&(me[0].scrollWidth>me[0].clientWidth)) ? 'block':'none'; barX.css({ display: display }); } function getBarYHeight(){ if(!barY){return;} barHeight=Math.max((me.outerHeight() / me[0].scrollHeight) * me.outerHeight(), minBarHeight); barY.css({ height: barHeight + 'px' }); var display=(hasVerticalScrollbar&&(me[0].scrollHeight>me[0].clientHeight)) ? 'block':'none'; barY.css({ display: display }); } function showBarX(needToRunWindowScroll){ if(!barX){return;} getBarXWidth(); clearTimeout(queueHideX); if(percentScrollX==~~percentScrollX&&needToRunWindowScroll){ releaseScroll=o.allowPageScroll; if(lastScrollX!=percentScrollX){ var msg=(~~percentScrollX===0) ? 'left':'right'; me.trigger('slimscrollX', msg); }}else{ releaseScroll=false; } lastScrollX=percentScrollX; if(barWidth >=me.outerWidth()){ releaseScroll=true; return; } barX.fadeIn('fast'); if(o.railVisible){ railX.stop(true,true).fadeIn('fast'); }} function hideBarX(){ if(!barX){return;} if(!o.alwaysVisible){ queueHideX=setTimeout(function(){ if(!(o.disableFadeOut&&isOverPanel)&&!isOverBarX&&!isDragg){ barX.fadeOut('slow'); railX.fadeOut('slow'); }}, 1000); }} function showBarY(){ if(!barY){return;} getBarYHeight(); clearTimeout(queueHideY); if(percentScrollY==~~percentScrollY){ releaseScroll=o.allowPageScroll; if(lastScrollY!=percentScrollY){ var msg=(~~percentScrollY===0) ? 'top':'bottom'; me.trigger('slimscrollY', msg); }}else{ releaseScroll=false; } lastScrollY=percentScrollY; if(barHeight >=me.outerHeight()){ releaseScroll=true; return; } barY.stop(true,true).fadeIn('fast'); if(o.railVisible){ railY.stop(true,true).fadeIn('fast'); }} function hideBarY(){ if(!barY){return;} if(!o.alwaysVisible){ queueHideY=setTimeout(function(){ if(!(o.disableFadeOut&&isOverPanel)&&!isOverBarY&&!isDragg){ barY.fadeOut('slow'); railY.fadeOut('slow'); }}, 1000); }} }); return this; }}); $.fn.extend({ slimscroll: $.fn.slimScroll }); })(jQuery); ;(function($, doc, win){ "use strict"; var Photobox, photobox, options, images=[], imageLinks, activeImage=-1, activeURL, lastActive, activeType, prevImage, nextImage, thumbsStripe, docElm, APControl, changeImage, transitionend="transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd", isOldIE = !('placeholder' in doc.createElement('input')), noPointerEvents=(function(){ var el=$('

    ')[0]; el.style.cssText='pointer-events:auto'; return !el.style.pointerEvents})(), isTouchDevice=false, thumbsContainerWidth, thumbsTotalWidth, activeThumb=$(), blankImg="data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==", transformOrigin=getPrefixed('transformOrigin'), transition=getPrefixed('transition'), raf=window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.msRequestAnimationFrame || function(cb){ return window.setTimeout(cb, 1000 / 60); }, preload={}, preloadPrev=new Image(), preloadNext=new Image(), closeBtn, image, video, prevBtn, nextBtn, thumbsToggler, caption, captionText, pbLoader, autoplayBtn, thumbs, wrapper, defaults={ single:false, beforeShow:null, afterClose:null, getTitle:null, loop:true, thumb:null, thumbs:true, thumbAttr:'data-src', counter:"(A/B)", title:true, autoplay:false, time:3000, history:false, hideFlash:true, zoomable:true, wheelNextPrev:true, keys:{ close:[27, 88, 67], prev:[37, 80], next:[39, 78] }}, overlay=$('

    ').append(thumbsToggler=$(''), pbLoader=$('
    '), prevBtn=$('
    ').on('click', next_prev), nextBtn=$('
    ').on('click', next_prev), wrapper=$('
    ').append(image=$(''), video=$('
    ') ), closeBtn=$('
    ').on('click', close)[0], autoplayBtn=$('
    ').append($('
    ') ), caption=$('
    ').append('', captionText=$('
    ').append('
    '), thumbs=$('
    ').addClass('pbThumbs') ) ); function throttle(callback, duration){ var wait=false; return function(){ if(!wait){ callback.call(); wait=true; setTimeout(function(){wait=false; }, duration); }} } function prepareDOM(){ noPointerEvents&&overlay.hide(); $(doc).on('touchstart.testMouse', function(){ $(doc).off('touchstart.testMouse'); isTouchDevice=true; overlay.addClass('mobile'); }); autoplayBtn.off().on('click', APControl.toggle); thumbs.off().on('click', 'a', thumbsStripe.click); isOldIE&&overlay.addClass('msie'); overlay.off().on('click', 'img', function(e){ e.stopPropagation(); }); $(doc.body).append(overlay); docElm=doc.documentElement; } $.fn.photobox=function(target, settings, callback){ return this.each(function(){ var o, PB_data=$(this).data('_photobox'); if(PB_data){ if(target==='destroy') PB_data.destroy(); return this; } if(typeof target!='string') target='a'; if(target==='prepareDOM'){ prepareDOM(); return this; } if(settings.isDisableRightClick){ overlay.off('contextmenu').on('contextmenu', function(e){return false;}); } o=$.extend({}, defaults, settings||{}); photobox=new Photobox(o, this, target); $(this).data('_photobox', photobox); photobox.callback=callback; }); } Photobox=function(_options, object, target){ this.options=$.extend({}, _options); this.target=target; this.selector=$(object||doc); this.thumbsList=null; var filtered=this.imageLinksFilter(this.selector.find(target)); this.imageLinks=filtered[0]; this.images=filtered[1]; this.init(); }; Photobox.prototype={ init:function(){ var that=this; if(!that.thumbsList){ that.thumbsList=thumbsStripe.generate.apply(that); } this.selector.on('click.photobox', this.target, function(e){ e.preventDefault(); that.open(this); }); this.observerTimeout=null; if(this.selector[0].nodeType==1) this.observeDOM(this.selector[0], this.onDOMchanges.bind(this)); }, onDOMchanges:function(){ var that=this; clearTimeout(this.observerTimeout); that.observerTimeout=setTimeout(function(){ var filtered=that.imageLinksFilter(that.selector.find(that.target)), activeIndex=0, isActiveUrl=false, i; if(that.imageLinks.length==filtered[0].length) return; that.imageLinks=filtered[0]; that.images=filtered[1]; if(photobox){ if(that.selector==photobox.selector){ images=that.images; imageLinks=that.imageLinks; for(i=images.length; i--;){ if(images[i][0]==activeURL) isActiveUrl=true; }} } that.thumbsList=thumbsStripe.generate.apply(that); thumbs.html(that.thumbsList); if(that.images.length&&activeURL&&that.options.thumbs){ activeIndex=that.thumbsList.find('a[href="'+activeURL+'"]').eq(0).parent().index(); if(activeIndex==-1) activeIndex=0; thumbsStripe.changeActive(activeIndex, 0); }}, 50); }, open:function(link){ var startImage=$.inArray(link, this.imageLinks); if(startImage==-1) return false; options=this.options; images=this.images; imageLinks=this.imageLinks; photobox=this; this.setup(1); overlay.on(transitionend, function(){ overlay.off(transitionend).addClass('on'); changeImage(startImage, true); }).addClass('show'); if(isOldIE) overlay.trigger('MSTransitionEnd'); return false; }, imageLinksFilter:function(obj){ var that=this, images=[], caption={}, captionlink; return [obj.filter(function(i){ var link=$(this), thumbImg, thumbSrc=''; caption.content=link[0].getAttribute('title')||''; if(that.options.thumb&&typeof that.options.thumb==='string') thumbImg=link.find(that.options.thumb)[0]; if(typeof that.options.thumb==='function'&&link&&link.length&&link.closest){ var funcRetThumbs=that.options.thumb(link); if(funcRetThumbs){ thumbImg=funcRetThumbs; }} if(!that.options.thumb||!thumbImg) thumbImg=link.find('img')[0]; if(thumbImg){ captionlink=thumbImg.getAttribute('data-pb-captionlink'); thumbSrc=thumbImg.getAttribute(that.options.thumbAttr)||thumbImg.getAttribute('src'); caption.content=(thumbImg.getAttribute('title')||thumbImg.getAttribute('alt')||''); } if(captionlink){ captionlink=captionlink.split('['); if(captionlink.length==2){ caption.linkText=captionlink[0]; caption.linkHref=captionlink[1].slice(0,-1); }else{ caption.linkText=captionlink; caption.linkHref=captionlink; } caption.content +=' ' + caption.linkText + ''; } images.push([link[0].href, caption.content, thumbSrc]); return true; }), images]; }, observeDOM:(function(){ var MutationObserver=win.MutationObserver||win.WebKitMutationObserver, eventListenerSupported=win.addEventListener; return function(obj, callback){ if(MutationObserver){ var that=this; var obs=new MutationObserver(function(mutations, observer){ if(mutations[0].addedNodes.length||mutations[0].removedNodes.length) callback(that); }); obs.observe(obj, { childList:true, subtree:true }); } else if(eventListenerSupported){ obj.addEventListener('DOMNodeInserted', callback.bind(that), false); obj.addEventListener('DOMNodeRemoved', callback.bind(that), false); }} })(), setup:function (open){ var fn=open ? "on":"off"; image[0].src=blankImg; if(options.thumbs){ if(!isTouchDevice){ thumbs[fn]('mouseenter.photobox', thumbsStripe.calc) [fn]('mousemove.photobox', thumbsStripe.move); }} if(open){ image.css({'transition':'0s'}).removeAttr('style'); overlay.show(); thumbs .html(this.thumbsList) .trigger('mouseenter.photobox'); if(options.thumbs){ overlay.addClass('thumbs'); }else{ thumbsToggler.prop('checked', false); overlay.removeClass('thumbs'); } if(this.images.length < 2||options.single) overlay.removeClass('thumbs hasArrows hasCounter hasAutoplay'); else{ overlay.addClass('hasArrows hasCounter') if(options.time > 1000){ overlay.addClass('hasAutoplay'); if(options.autoplay) APControl.progress.start(); else APControl.pause(); } else overlay.removeClass('hasAutoplay'); } options.hideFlash&&$('iframe, object, embed').css('visibility', 'hidden'); }else{ $(win).off('resize.photobox'); } $(doc).off("keydown.photobox")[fn]({ "keydown.photobox": keyDown }); if(isTouchDevice){ wrapper[fn]('swipe', onSwipe); } if(options.zoomable){ overlay[fn]({"mousewheel.photobox": scrollZoom }); if(!isOldIE) thumbs[fn]({"mousewheel.photobox": thumbsResize }); } if(!options.single&&options.wheelNextPrev){ overlay[fn]({"mousewheel.photobox": throttle(wheelNextPrev,1000) }); }}, destroy:function(){ options=this.options; this.selector .off('click.photobox', this.target) .removeData('_photobox'); close(); }} function onSwipe(e, Dx, Dy){ if(Dx==1){ image.css({transform:'translateX(25%)', transition:'.2s', opacity:0}); setTimeout(function(){ changeImage(prevImage) }, 200); } else if(Dx==-1){ image.css({transform:'translateX(-25%)', transition:'.2s', opacity:0}); setTimeout(function(){ changeImage(nextImage) }, 200); } if(Dy==1) thumbsToggler.prop('checked', true); else if(Dy==-1) thumbsToggler.prop('checked', false); } thumbsStripe=(function(){ var containerWidth=0, scrollWidth=0, posFromLeft=0, stripePos=0, animated=null, padding, el, $el, ratio, scrollPos, pos; return{ generate:function(){ var thumbsList=$('