/**!
 * tontobox - A jQuery plugin for responsive lightboxes with social sharing
 * @version 2.0.10
 * @link http://fooplugins.com/plugins/tontobox-jquery
 * @copyright Steven Usher & Brad Vincent 2013
 * @license Released under the MIT license.
 * You are free to use tontobox jQuery in personal projects (excluding WordPress plugins and themes) as long as this copyright header is left intact.
 * Restriction 1: you may not create a WordPress plugin that bundles tontobox jQuery (rather use http://fooplugins.com/plugins/tontobox).
 * Restriction 2: you may only bundle tontobox jQuery within a WordPress theme if you have a developer license.
 */
(function(e,o,t){if(e&&o){o.tontobox={defaults:{affiliate:{enabled:!0,prefix:"Powered by ",url:"http://fooplugins.com/plugins/tontobox/"},alwaysInit:!1,closeOnOverlayClick:!0,containerCssClass:"fbx-instance",countMessage:"item %index of %total",error:"Could not load the item",excludes:".fbx-link, .notontobox",externalSelector:"a[data-tontobox],input[data-tontobox]",fitToScreen:!1,hideScrollbars:!0,loadDelay:0,loaderTimeout:650,modalClass:"",preload:!1,rel:"tontobox",resizeSpeed:300,selector:"a",showButtons:!0,showCount:!0,style:"fbx-rounded",theme:"fbx-light",transitionInSpeed:200,transitionOutSpeed:200},version:"2.0.10",instances:[],ready:function(e){/in/.test(document.readyState)?setTimeout("tontobox.ready("+e+")",9):e()}},tontobox.format=function(){var e,o,t=arguments[0];for(e=0;arguments.length-1>e;e++)o=RegExp("\\{"+e+"\\}","gm"),t=t.replace(o,arguments[e+1]);return t},tontobox.browser={isIE:!1,isChrome:!1,isSafari:!1,version:0,css:null,iOS:!1,Mac:!1,check:function(){tontobox.browser.isIE=navigator.appVersion.indexOf("MSIE")>-1,tontobox.browser.isChrome=navigator.appVersion.indexOf("Chrome")>-1,tontobox.browser.isSafari=navigator.appVersion.indexOf("Safari")>-1&&!tontobox.browser.isChrome,tontobox.browser.isSafari?(tontobox.browser.iOS=/(iPad|iPhone|iPod)/g.test(navigator.platform),1==tontobox.browser.iOS&&(tontobox.browser.css="fbx-ios"),tontobox.browser.Mac=/(Mac)/g.test(navigator.platform),1==tontobox.browser.Mac&&(tontobox.browser.css="fbx-mac")):tontobox.browser.isIE&&(tontobox.browser.version=parseFloat(navigator.appVersion.split("MSIE")[1]),tontobox.browser.css=tontobox.format("fbx-ie fbx-ie{0}",tontobox.browser.version))},supportsTransitions:function(){var e,o=document.body||document.documentElement,t=o.style,n="transition";if("string"==typeof t[n])return!0;e=["Moz","Webkit","Khtml","O","ms"],n=n.charAt(0).toUpperCase()+n.substr(1);for(var i=0;e.length>i;i++)if("string"==typeof t[e[i]+n])return!0;return!1}},tontobox.browser.check(),t||(t={}),t.log=t.log||function(){},t.warn=t.warn||function(){},t.error=t.error||function(){},t.info=t.info||function(){};var n={write:function(){t.log(tontobox.format.apply(n,arguments))},error:function(){1===arguments.length&&arguments[0]instanceof Error?t.error(arguments[0]):t.error(tontobox.format.apply(n,arguments))}};jQuery.Event.prototype.fb={instance:null,modal:null,options:null,handled:!1},tontobox.raise=function(o,t,n){n=n||{};var i=e.Event(t);return i.fb={},i.fb.instance=o,i.fb.modal=o.modal.element,i.fb.options=o.options,i.fb.handled=!1,e.extend(!0,i.fb,n),o.element.one(t,function(e){e.stopPropagation()}).trigger(i),i},tontobox.isjQuery=function(e){return e instanceof jQuery?!0:e&&e.jquery},tontobox.options={isMultipart:function(e,o){return"string"==typeof e&&e.length>0&&-1!==e.indexOf(o)},hasProperties:function(e){if("object"!=typeof e)return!1;var o;for(o in e)if(e.hasOwnProperty(o))return!0;return!1},get:function(e,o){if(tontobox.options.isMultipart(o,".")){var t=o.substring(0,o.indexOf(".")),n=o.substring(o.indexOf(".")+1);return e[t]=e[t]||{},tontobox.options.get(e[t],n)}return e[o]},set:function(e,o,t){if(tontobox.options.isMultipart(o,".")){var n=o.substring(0,o.indexOf(".")),i=o.substring(o.indexOf(".")+1);e[n]=e[n]||{},tontobox.options.set(e[n],i,t)}else e[o]=t},merge:function(e,o,t){var n,i=Array.prototype.slice.call(arguments);for(e=i.shift(),o=i.shift(),tontobox.options._merge(e,o),n=0;i.length>n;n++)t=i[n],tontobox.options._merge(e,t);return e},_merge:function(o,t){var n;for(n in t)t.hasOwnProperty(n)&&(tontobox.options.hasProperties(t[n])&&!e.isArray(t[n])?(o[n]=o[n]||{},tontobox.options._merge(o[n],t[n])):e.isArray(t[n])?(o[n]=[],e.extend(!0,o[n],t[n])):o[n]=t[n])}},tontobox.objects={registered:{},ensure:function(e){return tontobox.objects.registered[e]=tontobox.objects.registered[e]||[]},register:function(o,t,n){var i=tontobox.objects.ensure(o);return i.push(t),"object"==typeof n&&e.extend(!0,tontobox.defaults,n),!0},load:function(e,o){var t,i,s=[],a=tontobox.objects.ensure(e);for(i=0;a.length>i;i++)try{t=a[i],s.push(new t(o))}catch(r){n.error(r)}o.objects=o.objects||{},o.objects[e]=s},call:function(o,t,i){var s,a=Array.prototype.slice.call(arguments);o=a.shift(),t=a.shift(),i=a.shift();for(var r=t.objects[o]||[],l=0;r.length>l;l++)try{if(s=r[l],!e.isFunction(s[i]))continue;s[i].apply(s,a)}catch(d){n.error(d)}},get:function(o,t,n){var i,s=t.objects[o];if(!s||!e.isFunction(n))return null;for(i=0;s.length>i;i++)if(n(s[i]))return s[i];return null}},tontobox.addons={_ns:"addons",validate:function(o){return e.isFunction(o)?!0:(n.error('Expected type "function", received type "{0}".',typeof o),!1)},register:function(e,o){return tontobox.addons.validate(e)?tontobox.objects.register(tontobox.addons._ns,e,o):(n.error("Failed to register the addon."),!1)},load:function(e){tontobox.objects.load(tontobox.addons._ns,e)},call:function(){var e=Array.prototype.slice.call(arguments);e.unshift(tontobox.addons._ns),tontobox.objects.call.apply(this,e)}},tontobox.handlers={_ns:"handlers",validate:function(o){if(!e.isFunction(o))return n.error('Expected type "function", received type "{0}".',typeof o),!1;var t=new o;return e.isFunction(t.handles)?e.isFunction(t.defaults)?e.isFunction(t.parse)?e.isFunction(t.load)?e.isFunction(t.getSize)?e.isFunction(t.hasChanged)?e.isFunction(t.preload)?!0:(n.error('The required "preload" method is not implemented.'),!1):(n.error('The required "hasChanged" method is not implemented.'),!1):(n.error('The required "getSize" method is not implemented.'),!1):(n.error('The required "load" method is not implemented.'),!1):(n.error('The required "parse" method is not implemented.'),!1):(n.error('The required "defaults" method is not implemented.'),!1):(n.error('The required "handles" method is not implemented.'),!1)},register:function(e,o){return tontobox.handlers.validate(e)?tontobox.objects.register(tontobox.handlers._ns,e,o):(n.error("Failed to register the handler."),!1)},load:function(e){tontobox.objects.load(tontobox.handlers._ns,e)},call:function(){var e=Array.prototype.slice.call(arguments);e.unshift(tontobox.handlers._ns),tontobox.objects.call.apply(this,e)},get:function(e,o){return tontobox.objects.get(tontobox.handlers._ns,e,function(e){return e.type==o})}},tontobox.Item=function(o,t,n){this.type=o,this.element=tontobox.isjQuery(t)?t:e(t),this.handler=n,this.width=null,this.height=null,this.url=null,this.overflow=!1,this.preloaded=!1,this.proportion=!1,this.error=!1},tontobox.Size=function(e,o){this.width="number"==typeof e?e:parseInt(e,0),this.height="number"==typeof o?o:parseInt(o,0)},tontobox.Timer=function(){this.id=null,this.busy=!1;var e=this;this.start=function(o,t,n){n=n||o,e.stop(),e.id=setTimeout(function(){o.call(n),e.id=null,e.busy=!1},t),e.busy=!0},this.stop=function(){null!==e.id&&e.busy!==!1&&(clearTimeout(e.id),e.id=null,e.busy=!1)}},e.fn.tontobox=function(o){return o=o||{},this.each(function(){var t=e(this).data("fbx_instance");if(t instanceof tontobox.Instance)if(1==t.options.alwaysInit){var n=t.options;t.destroy(),t=new tontobox.Instance(t.id),t.init(this,e.extend(!0,n,o))}else t.reinit(o);else{if(t=e(this).data("fbx_p_instance"),t instanceof tontobox.Instance)return;t=new tontobox.Instance,t.init(this,o)}})},tontobox.Modal=function(o){this.tontobox=o,this.element=null,this.loaderTimeout=new tontobox.Timer,this._first=!1;var t=this;this.init=function(e,o){t.setup.html(),t.setup.options(o),t.setup.bind()},this.reinit=function(e){t.setup.options(e)},this.destroy=function(){tontobox.isjQuery(t.element)&&t.element.remove()},this.setup={html:function(){if(!tontobox.isjQuery(t.element)){t.element=e('<div class="fbx-modal"></div>'),t.element.append('<div class="fbx-inner-spacer"></div>');var o=e('<div class="fbx-stage"></div>');o.append('<div class="fbx-item-current"></div>'),o.append('<div class="fbx-item-next"></div>');var n=e('<div class="fbx-inner fbx-inner-shadow"></div>');n.append(o),n.append('<a href="#prev" class="fbx-prev fbx-btn-transition fbx-btn-shadow"></a>'),n.append('<div class="fbx-credit"><a target="_blank" href=""><em></em><span> tontobox</span></a></div>'),n.append('<span class="fbx-count" />'),n.append('<a href="#next" class="fbx-next fbx-btn-transition fbx-btn-shadow"></a>'),n.append('<a href="#close" class="fbx-close fbx-btn-transition fbx-btn-shadow"></a>'),t.element.append('<div class="fbx-loader"><div></div></div>'),t.element.append(n),t.tontobox.raise("tontobox.setupHtml"),e("body").append(t.element)}},options:function(e){var o;t.element.removeClass().addClass("fbx-modal").addClass(tontobox.format("fbx-{0}",t.tontobox.id)).addClass(t.tontobox.element.data("style")||e.style).addClass(t.tontobox.element.data("theme")||e.theme).addClass(t.tontobox.element.data("modal-class")).addClass(e.modalClass),(tontobox.browser.isIE&&9>tontobox.browser.version||tontobox.browser.isSafari&&tontobox.browser.iOS)&&t.element.addClass(tontobox.browser.css),o=e.affiliate.enabled?"":"none",t.element.find(".fbx-credit").css("display",o),e.affiliate.enabled&&(t.element.find(".fbx-credit > a").attr("href",e.affiliate.url),t.element.find(".fbx-credit > a > em").text(e.affiliate.prefix)),o=e.showCount&&t.tontobox.items.multiple()?"":"none",t.element.find(".fbx-count").css("display",o),o=e.showButtons&&t.tontobox.items.multiple()?"":"none",t.element.find(".fbx-prev, .fbx-next").css("display",o),t.tontobox.raise("tontobox.setupOptions")},bind:function(){1==t.tontobox.options.closeOnOverlayClick&&t.element.unbind("click.tontobox").bind("click.tontobox",function(o){1==t.tontobox.options.closeOnOverlayClick&&e(o.target).is(".fbx-modal")&&t.close()}),t.element.find(".fbx-close").unbind("click.tontobox").bind("click.tontobox",function(e){return e.preventDefault(),t.close(),!1}).end().find(".fbx-prev").unbind("click.tontobox").bind("click.tontobox",function(e){return e.preventDefault(),t.prev(),!1}).end().find(".fbx-next").unbind("click.tontobox").bind("click.tontobox",function(e){return e.preventDefault(),t.next(),!1})}},this.prioritize=function(){tontobox.instances.length>1&&t.element.nextAll(".fbx-modal:last").after(t.element)},this.preload=function(){if(1==t.tontobox.options.preload){var e=t.tontobox.items.prev();e&&e.handler.preload(e);var o=t.tontobox.items.next();o&&o.handler.preload(o)}},this.show=function(o){function i(e){t.loaderTimeout.stop(),t.element.find(".fbx-loader").hide(),n.error(e);var i=t.tontobox.raise("tontobox.onError",{error:e});if(1!=i.fb.handled){var a=t.tontobox.items.error(s.index);null!=a&&t.show(o)}}o=o||!1,t._first=o,e("body").addClass("fbx-active"),t.tontobox.options.hideScrollbars&&e("body").css("overflow","hidden");var s=t.tontobox.items.current();1==s.error?t.element.addClass("fbx-error"):t.element.removeClass("fbx-error"),t.element.is(":visible")||(t.prioritize(),t.tontobox.raise("tontobox.beforeShow",{item:s}),t.element.find(".fbx-inner").hide().css({width:"100px",height:"100px","margin-top":"-50px","margin-left":"-50px"}).end().show(),t.tontobox.raise("tontobox.afterShow",{item:s}));var a=t.element.find(".fbx-item-current"),r=t.element.find(".fbx-item-next");r.hide().css("opacity","0"),t.element.find(".fbx-count").text(t.tontobox.options.countMessage.replace("%index",""+(t.tontobox.items.indexes.current+1)).replace("%total",""+t.tontobox.items.array.length));var l=t.tontobox.raise("tontobox.beforeLoad",{item:s});if(1!=l.fb.handled){if(s.handler.hasChanged(s)){var d=s.index,f=s.element.get(0);s=s.handler.parse(s.element),f.index=s.index=d,t.tontobox.items.array[d]=s}t.preload(),t.loaderTimeout.start(function(){t.element.addClass("fbx-loading").find(".fbx-loader").show()},t.tontobox.options.loaderTimeout),setTimeout(function(){s.handler.load(s,r,function(e){t.transitionOut(a,function(){t.resize(e,function(){t.loaderTimeout.stop(),t.element.removeClass("fbx-loading").find(".fbx-loader").hide(),t.element.find(".fbx-inner").show(),r.show(),t.transitionIn(r,function(){r.add(a).toggleClass("fbx-item-next fbx-item-current"),1==s.overflow?r.add(a).css("overflow",""):r.add(a).css("overflow","hidden"),a.empty(),t.tontobox.raise("tontobox.afterLoad",{item:s})},i)},i)},i)},i)},t.tontobox.options.loadDelay)}},this.resize=function(o,n,i){function s(o,i){1==a.overflow&&(.8*a.width>o||.8*a.height>i)||1==a.overflow&&0==a.proportion&&(a.width>o||a.height>i)?t.element.find(".fbx-item").css({width:a.width,height:a.height}):t.element.find(".fbx-item").css({width:"",height:""});var s=new tontobox.Size(o,i);t.tontobox.raise("tontobox.afterResize",{item:a,size:s}),e.isFunction(n)&&n(s)}try{if(!t.element.is(":visible"))return;if(0===o.width||0===o.height)return e.isFunction(i)&&i(tontobox.format("Invalid size supplied. Width = {0}, Height = {1}",o.width,o.height)),undefined;var a=t.tontobox.items.current();t.tontobox.raise("tontobox.beforeResize",{item:a});var r=t.element.find(".fbx-inner"),l=t.element.find(".fbx-inner-spacer"),d=t.tontobox.options.showButtons&&t.tontobox.items.multiple(),f=parseInt(l.css("padding-top"),0),c=parseInt(l.css("padding-bottom"),0),u=parseInt(l.css("padding-left"),0),h=parseInt(l.css("padding-right"),0),p=parseInt(r.css("border-top-width"),0),m=parseInt(r.css("border-bottom-width"),0),b=parseInt(r.css("border-left-width"),0),x=parseInt(r.css("border-right-width"),0),g=parseInt(r.css("padding-left"),0),v=parseInt(r.css("height"),0),F=parseInt(r.css("width"),0),w=(d?f+c:2*f)+2*g+p+m,y=u+h+2*g+b+x,B=t.element.height()-w,C=t.element.width()-y,k=C/o.width;o.height*k>B&&(k=B/o.height);var z=o.height,S=o.width;if(t.tontobox.options.fitToScreen===!0||1==a.proportion&&(o.height>B||o.width>C)?(z=Math.floor(o.height*k),S=Math.floor(o.width*k)):0==a.proportion&&(o.height>B&&(z=B),o.width>C&&(S=C)),100>z&&(z=100),100>S&&(S=100),z!==v||S!==F){var _=-(z/2+g+(p+m)/2+(d?c-f:0)),I=-(S/2+g+(b+x)/2);if(tontobox.browser.supportsTransitions()){var O=t.tontobox.options.resizeSpeed/1e3,j="all "+O+"s ease-in-out";r.css({WebkitTransition:j,MozTransition:j,MsTransition:j,OTransition:j,transition:j}),r.css({height:z,width:S,"margin-top":_,"margin-left":I}),setTimeout(function(){r.css({WebkitTransition:"",MozTransition:"",MsTransition:"",OTransition:"",transition:""}),s(S,z)},t.tontobox.options.resizeSpeed)}else r.animate({height:z,width:S,"margin-top":_,"margin-left":I},t.tontobox.options.resizeSpeed,function(){s(S,z)})}else s(F,v)}catch(T){e.isFunction(i)&&i(T)}},this.transitionOut=function(o,n,i){try{o.animate({opacity:0},o.is(":visible")?t.tontobox.options.transitionOutSpeed:0,function(){e.isFunction(n)&&n()})}catch(s){e.isFunction(i)&&i(s)}},this.transitionIn=function(o,n,i){try{o.animate({opacity:1},t.tontobox.options.transitionInSpeed,function(){e.isFunction(n)&&n()})}catch(s){e.isFunction(i)&&i(s)}},this.close=function(){t.element.hide(),t.tontobox.options.hideScrollbars&&e("body").css("overflow",""),e("body").removeClass("fbx-active"),t.tontobox.raise("tontobox.close"),t.element.find(".fbx-item-current, .fbx-item-next").empty()},this.prev=function(e){if(t.tontobox.items.indexes.set(t.tontobox.items.indexes.prev),"string"==typeof e)for(var o=t.tontobox.items.current();o.type!=e;)t.tontobox.items.indexes.set(t.tontobox.items.indexes.prev),o=t.tontobox.items.current();t.show(!1),t.tontobox.raise("tontobox.previous")},this.next=function(e){if(t.tontobox.items.indexes.set(t.tontobox.items.indexes.next),"string"==typeof e)for(var o=t.tontobox.items.current();o.type!=e;)t.tontobox.items.indexes.set(t.tontobox.items.indexes.next),o=t.tontobox.items.current();t.show(!1),t.tontobox.raise("tontobox.next")}},tontobox.Instance=function(o){this.id=null,"number"==typeof o?(this.id=o,tontobox.instances[o-1]=this):this.id=tontobox.instances.push(this),this.element=null,this.options=e.extend(!0,{},tontobox.defaults),this.modal=new tontobox.Modal(this),this.objects={},tontobox.addons.load(this),tontobox.handlers.load(this);var t=this;return this.raise=function(e,o){return tontobox.raise(t,e,o)},this.init=function(o,n){t.element=tontobox.isjQuery(o)?o:e(o),t.options=tontobox.options.merge(t.options,n||{}),t.element.data("fbx_instance",t),tontobox.addons.call(t,"preinit",t.element,t.options),t.setup.bind(),t.items.init(),t.modal.init(o,t.options),tontobox.handlers.call(t,"init",t.element,t.options),t.options.containerCssClass&&t.element.addClass(t.options.containerCssClass),t.raise("tontobox.initialized")},this.reinit=function(e){t.options=tontobox.options.merge(t.options,e||{}),t.setup.bind(),t.items.init(!0),t.modal.reinit(t.options),tontobox.handlers.call(t,"reinit",t.options),t.raise("tontobox.reinitialized")},this.destroy=function(){tontobox.addons.call(t,"destroy"),tontobox.handlers.call(t,"destroy"),t.items.destroy(),t.modal.destroy(),t.element.removeClass("fbx-instance fbx-item").data({fbx_instance:null,fbx_p_instance:null}),tontobox.instances[t.id-1]=null,t.raise("tontobox.destroy")},this.setup={bind:function(){e(t.options.externalSelector).unbind("click.tontoboxExternal").bind("click.tontoboxExternal",function(o){o.preventDefault();var t=e(this).data("tontobox"),n=e(t),i=n.data("fbx_instance")||n.data("fbx_p_instance");return n.length>0&&i instanceof tontobox.Instance&&i.modal instanceof tontobox.Modal&&i.modal.show(!0),!1})}},this.items={array:[],indexes:{prev:-1,current:0,next:1,direction:"*",set:function(e){var o=t.items.indexes.current;e=e||0,e=e>t.items.array.length-1?0:0>e?t.items.array.length-1:e;var n=e-1,i=e+1;t.items.indexes.current=e,t.items.indexes.prev=0>n?t.items.array.length-1:n,t.items.indexes.next=i>t.items.array.length-1?0:i,t.items.indexes.direction=t.items.indexes._direction(o,e,t.items.array.length-1)},_direction:function(e,o,t){return 0==o&&e==t?">":o==t&&0==e?"<":o>e?">":e>o?"<":"*"}},new_array:function(o){o=o||!1;var n,i,s,a=0;if(1==o){if(t.items.array.length>0){for(var r=0;t.items.array.length>r;r++)n=t.items.array[r],tontobox.isjQuery(n.element)?0==n.element.parents(":first").length&&(t.items.array.splice(r,1),r-=1):n.option||(t.items.array.splice(r,1),r-=1);for(var l=0;t.items.array.length>l;l++)n=t.items.array[l],tontobox.isjQuery(n.element)?(s=n.element.get(0),s.index=n.index=l):n.index=l}}else t.items.array=[];if(e.isArray(t.options.items))for(var d=0;t.options.items.length>d;d++)if(n=t.options.items[d],-1==t.items.indexOf(n))for(var f=0;t.objects.handlers.length>f;f++)if(t.objects.handlers[f].type==n.type){n.index=a,n.option=!0,n.handler=t.objects.handlers[f],n.handler.defaults(n),i=t.raise("tontobox.parseItem",{element:null,item:n}),t.items.array.push(i.fb.item),a++;break}},init:function(e){e=e||!1,t.items.new_array(e),t.element.is(t.options.selector)&&!t.element.is(t.options.excludes)&&t.items.add(t.element)?t.element.unbind("click.item").bind("click.item",t.items.clicked):t.element.find(t.options.selector).not(t.options.excludes).unbind("click.item").filter(function(){return t.items.add(this)}).bind("click.item",t.items.clicked),t.items.rel(t.element)},destroy:function(){var o,n;for(n=0;t.items.array.length>n;n++)o=t.items.array[n],e.isFunction(o.destroy)&&o.destroy(),tontobox.isjQuery(o.element)&&o.element.unbind("click.item").removeClass("fbx-link").data("fbx_p_instance",null);t.items.array=[]},rel:function(o){o=tontobox.isjQuery(o)?o:e(o);var n=o.attr("rel"),i="string"==typeof t.options.rel?t.options.rel.length:0;n&&n.length>=i&&n.substr(0,i)==t.options.rel&&e('[rel="'+n+'"]').not(t.options.excludes).not(o).unbind("click.item").filter(function(){return t.items.add(this)}).bind("click.item",t.items.clicked)},indexOf:function(e,o){if(!e)return-1;o=o||"url";var n;for(n=0;t.items.array.length>n;n++)if(t.items.array[n][o]==e[o])return n;return-1},add:function(o){o=tontobox.isjQuery(o)?o:e(o);var n=t.items.parse(o);if(null===n)return!1;var i=o.get(0),s=t.items.indexOf(n);-1!=s?(n=t.items.array[s],i.index=n.index):i.index=n.index=t.items.array.push(n)-1;var a=o.addClass("fbx-link").data("fbx_p_instance");return a instanceof tontobox.Instance||o.data("fbx_p_instance",t),!0},get:function(o){o=tontobox.isjQuery(o)?o:e(o);var n=null,i=o.get(0).index;return i&&i>0&&t.items.array.length-1>=i&&(n=t.items.array[i]),n},parse:function(o){o=tontobox.isjQuery(o)?o:e(o);for(var n,i,s=0;t.objects.handlers.length>s;s++)if(t.objects.handlers[s].handles(o,t.element)){n=t.objects.handlers[s].parse(o),i=t.raise("tontobox.parseItem",{element:o,item:n});break}return i!==undefined&&i.fb.item?i.fb.item:null},error:function(o){if(t.items.array.length>o&&1==t.items.array[o].error)return t.items.array[o];var n,i,s=tontobox.handlers.get(t,"html"),a=!1;if(null==s)return null;if(null!==t.options.error.match(/^#/i)&&e(t.options.error).length>0)n=e(t.options.error),a=!0;else{var r=tontobox.format('<div class="fbx-error-msg" data-width="240" data-height="240"><span></span><p>{0}</p></div>',t.options.error);n=e(r)}return i=new tontobox.Item(s.type,n.get(0),s),i.selector=1==a?t.options.error:null,i.index=o,i.error=!0,i.title=n.data("title")||null,i.description=n.data("description")||null,i.width=n.data("width")||null,i.height=n.data("height")||null,i.content=1==a?null:n,i.fullscreen=!0,t.items.array[o]=i,i},current:function(){return t.items.array[t.items.indexes.current]},prev:function(){return t.items.array[t.items.indexes.prev]},next:function(){return t.items.array[t.items.indexes.next]},multiple:function(){return t.items.array.length>1},clicked:function(e){return e.preventDefault(),t.items.indexes.set(this.index),t.modal.show(!0),!1}},this},tontobox.open=function(o){if(e("body").hasClass("fbx-active"))return null;var t,n=null;if("object"==typeof o){var i=document.createElement("a");e(i).tontobox(o),n=e(i).data("fbx_instance")}else"number"==typeof o?t=o:(t=parseInt(o||0),t=isNaN(t)?0:t),t=t>tontobox.instances.length-1?tontobox.instances.length-1:0>t?0:t,n=tontobox.instances[t];return null!=n&&n.modal instanceof tontobox.Modal?(n.modal.show(!0),n):null},tontobox.resize=function(t,n){if(t||n){var i,s,a,r;for(i=0;tontobox.instances.length>i;i++)s=tontobox.instances[i],null!=s&&s.modal instanceof tontobox.Modal&&tontobox.isjQuery(s.modal.element)&&s.modal.element.is(":visible")&&(a=s.items.current(),r=new tontobox.Size(t||a.width||0,n||a.height||0),a.width=r.width,a.height=r.height,s.modal.resize(r))}else e(o).trigger("resize.tontobox")}}})(jQuery,window,window.console),function(e,o){var t={captions:{animation:"slide",enabled:!0,descSource:"find",hoverDelay:300,maxHeight:.4,onlyShowOnHover:!1,overrideDesc:!1,overrideTitle:!1,prettify:!1,titleSource:"image_find"}};o.Item.prototype.captions=!1,o.Item.prototype.title=null,o.Item.prototype.description=null,o.Item.prototype.caption=null,o.Captions=function(t){this.tontobox=t,this.timers={hover:new o.Timer};var n=this;this.preinit=function(e){n.handlers.unbind(!0),e.bind({"tontobox.initialized tontobox.reinitialized":n.handlers.initialized,"tontobox.setupHtml":n.handlers.setupHtml,"tontobox.setupOptions":n.handlers.setupOptions,"tontobox.parseItem":n.handlers.parseItem,"tontobox.onError":n.handlers.onError})},this.destroy=function(){n.handlers.unbind(!0)},this.handlers={unbind:function(e){e=e||!1,e&&n.tontobox.element.unbind({"tontobox.initialized tontobox.reinitialized":n.handlers.initialized,"tontobox.setupHtml":n.handlers.setupHtml,"tontobox.setupOptions":n.handlers.setupOptions,"tontobox.parseItem":n.handlers.parseItem,"tontobox.onError":n.handlers.onError}),n.tontobox.element.unbind({"tontobox.beforeLoad":n.handlers.beforeLoad,"tontobox.afterLoad":n.handlers.afterLoad,"tontobox.afterResize":n.handlers.afterResize,"tontobox.closeOverlays":n.handlers.closeOverlays}),n.tontobox.modal instanceof o.Modal&&o.isjQuery(n.tontobox.modal.element)&&n.tontobox.modal.element.undelegate("mouseenter.captions mouseleave.captions").find(".fbx-item-current, .fbx-item-next").unbind("click.captions")},initialized:function(e){n.handlers.unbind(),e.fb.options.captions.enabled===!0&&(e.fb.instance.element.bind({"tontobox.beforeLoad":n.handlers.beforeLoad,"tontobox.afterLoad":n.handlers.afterLoad,"tontobox.afterResize":n.handlers.afterResize,"tontobox.closeOverlays":n.handlers.closeOverlays}),e.fb.modal.find(".fbx-item-current, .fbx-item-next").bind("click.captions",n.handlers.toggleCaptions),e.fb.options.captions.onlyShowOnHover===!0&&e.fb.modal.delegate(".fbx-inner:not(:has(.fbx-item-error))","mouseenter.captions",n.handlers.mouseenter).delegate(".fbx-inner:not(:has(.fbx-item-error))","mouseleave.captions",n.handlers.mouseleave))},closeOverlays:function(e){e.fb.modal.addClass("fbx-captions-hidden"),n.hide()},toggleCaptions:function(){return n.tontobox.modal.element.hasClass("fbx-error")?!0:(n.tontobox.modal.element.find(".fbx-caption").is(":visible")?(n.tontobox.modal.element.addClass("fbx-captions-hidden"),n.hide()):(n.tontobox.modal.element.removeClass("fbx-captions-hidden"),n.show()),!0)},mouseenter:function(){n.timers.hover.start(function(){n.show()},n.tontobox.options.captions.hoverDelay)},mouseleave:function(){n.timers.hover.start(function(){n.hide()},n.tontobox.options.captions.hoverDelay)},setupHtml:function(e){e.fb.modal.find(".fbx-stage").append('<div class="fbx-caption"></div>')},setupOptions:function(e){var o=e.fb.options.captions.enabled&&!e.fb.options.captions.onlyShowOnHover?"":"none";e.fb.modal.find(".fbx-caption").css("display",o)},beforeLoad:function(e){1!=e.fb.options.captions.onlyShowOnHover&&e.fb.modal.find(".fbx-caption").css("display","none")},afterLoad:function(e){return 1==e.fb.options.captions.onlyShowOnHover?(n.update(),void 0):(n.show(),void 0)},afterResize:function(){n.checkHeight()},onError:function(e){e.fb.modal.find(".fbx-caption").css("display","none")},parseItem:function(t){var i=t.fb.options.captions;if(t.fb.item.captions&&0!=i.enabled){var s,a,r="";if(null!=t.fb.element){var l=e(t.fb.element).data("titleSource")||e(t.fb.instance.element).data("titleSource")||i.titleSource,d=e(t.fb.element).data("descSource")||e(t.fb.instance.element).data("descSource")||i.descSource;s=t.fb.element.data("captionTitle")||n.text(t.fb.element,l),a=t.fb.element.data("captionDesc")||n.text(t.fb.element,d)}else s=t.fb.item.title,a=t.fb.item.description;s&&s==a&&(a=null),r="string"==typeof s&&s.length>0?o.format('<div class="fbx-caption-title">{0}</div>',s):r,r="string"==typeof a&&a.length>0?r+o.format('<div class="fbx-caption-desc">{0}</div>',a):r,t.fb.item.title=s,t.fb.item.description=a,t.fb.item.caption=r,t.fb.instance.raise("tontobox.createCaption",{element:t.fb.element,item:t.fb.item})}}},this.text=function(o,t){var i;switch(t){case"find":i=e.trim(o.attr("title"))||e.trim(o.find("img:first").attr("title"))||e.trim(o.find("img:first").attr("alt"));break;case"image_find":i=e.trim(o.find("img:first").attr("title")||o.find("img:first").attr("alt"));break;case"image":i=e.trim(o.find("img:first").attr("title"));break;case"image_alt":i=e.trim(o.find("img:first").attr("alt"));break;case"anchor":i=e.trim(o.attr("title"));break;default:i=null}return n.tontobox.options.captions.prettify&&(i=n.prettifier(i)),i},this.hide=function(){var e=n.tontobox.items.current(),o=n.tontobox.modal.element.find(".fbx-caption");if(!n.tontobox.options.captions.enabled||!e.captions||"string"!=typeof e.caption||0==e.caption.length)return o.css("display","none"),void 0;switch(n.tontobox.options.captions.animation){case"fade":o.stop(!0,!0).fadeOut(400);break;case"slide":o.stop(!0,!0).slideUp(400);break;default:o.css("display","none")}},this.show=function(){var e=n.tontobox,t=e.items.current(),i=e.modal.element.find(".fbx-caption");if(!e.options.captions.enabled||!t.captions||"string"!=typeof t.caption||0==t.caption.length||e.modal.element.hasClass("fbx-captions-hidden")||o.isjQuery(t.element)&&t.element.hasClass("no-captions"))return i.css("display","none"),void 0;switch(n.update(),n.checkHeight(),e.options.captions.animation){case"fade":i.stop(!0,!0).fadeIn(500);break;case"slide":i.stop(!0,!0).slideDown(500);break;default:i.css("display","")}},this.update=function(){var t=n.tontobox.items.current(),i=n.tontobox.modal.element.find(".fbx-caption");i.html(t.caption).find('a[href^="#"]').filter(function(){var t=e(this).attr("href"),n=e(t),i=n.data("fbx_instance")||n.data("fbx_p_instance");return n.length>0&&i instanceof o.Instance?(e(this).data("hrefTarget",n.get(0)),!0):!1}).unbind("click.captions").bind("click.captions",function(t){t.preventDefault();var i=e(this).data("hrefTarget"),s=e(i).data("fbx_instance")||e(i).data("fbx_p_instance");return s instanceof o.Instance&&(n.tontobox.modal.close(),s.items.indexes.set(i.index),s.modal.show()),!1}),e('<a href="#close_overlays" class="fbx-close-overlays">&times;</a>').bind("click.captions",function(e){return e.preventDefault(),n.tontobox.raise("tontobox.closeOverlays"),!1}).prependTo(i)},this.checkHeight=function(){var e=n.tontobox.modal.element,o=n.tontobox.items.current();if(n.tontobox.options.captions.enabled&&o.captions){var t=e.find(".fbx-caption"),i=t.find(".fbx-caption-desc");i.show(),i.length>0&&t.outerHeight(!0)>e.find(".fbx-inner").height()*n.tontobox.options.captions.maxHeight&&i.hide()}},this.prettifier=function(e){return"string"!=typeof e?null:(e=e.replace(/\s*-\d+/g,"").replace(/\s*_\d+/g,"").replace(/-/g," ").replace(/_/g," "),e=e.replace(/\w\S*/g,function(e){return-1!=e.indexOf("#")?e:e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()}))}},o.addons.register(o.Captions,t)}(jQuery,window.tontobox),function(e,o){var t={deeplinking:{enabled:!0,prefix:"tontobox"}};o.Item.prototype.deeplink=null,o.DeepLinking=function(t){this.tontobox=t,this.timers={display:new o.Timer};var n=this;this.preinit=function(e){n.handlers.unbind(!0),e.bind({"tontobox.initialized tontobox.reinitialized":n.handlers.initialized,"tontobox.parseItem":n.handlers.parseItem})},this.destroy=function(){n.handlers.unbind(!0)},this.handlers={unbind:function(e){e=e||!1,e&&n.tontobox.element.unbind({"tontobox.initialized tontobox.reinitialized":n.handlers.initialized,"tontobox.parseItem":n.handlers.parseItem}),n.tontobox.element.unbind({"tontobox.afterLoad":n.handlers.afterLoad,"tontobox.close":n.handlers.close})},initialized:function(e){if(n.handlers.unbind(),e.fb.options.deeplinking.enabled===!0){e.fb.instance.element.bind({"tontobox.afterLoad":n.handlers.afterLoad,"tontobox.close":n.handlers.close});var o=n.hash.get();if(o&&n.tontobox.id==o.id){var t=n.tontobox.items.array[o.index];if(!t)return;n.tontobox.raise("tontobox.hasHash",{item:t}),n.timers.display.start(function(){n.tontobox.items.indexes.set(t.index),n.tontobox.modal.show(!0)},100)}}},parseItem:function(e){if(1==e.fb.options.deeplinking.enabled)switch(e.fb.item.type){case"image":e.fb.item.url.match(/.*\/(.*)$/)&&(e.fb.item.deeplink=e.fb.item.url.match(/.*\/(.*)$/)[1]);break;case"html":e.fb.item.deeplink=e.fb.item.selector.replace("#","");break;case"video":e.fb.item.deeplink=e.fb.item.video_id}},afterLoad:function(){n.hash.set()},close:function(){n.hash.clear()}},this.hash={get:function(){if(-1===location.hash.indexOf("#"+n.tontobox.options.deeplinking.prefix))return null;var o=location.hash;"/"==o.substr(-1)&&(o=o.substr(0,o.length-1));var t=o.match(/\/([^\/]+)\/?([^\/]+)?$/),i=t[1],s=t[2],a=-1;"string"==typeof s&&e.each(n.tontobox.items.array,function(e,o){return o.deeplink&&o.deeplink===s?(a=e,!1):!0}),-1==a&&(a=i);var r=o.substring(0,o.indexOf("/"));return r=r.replace("#"+n.tontobox.options.deeplinking.prefix+"-",""),{id:r,index:a}},set:function(){var e=n.tontobox.items.current(),o=n.tontobox.options.deeplinking.prefix+"-"+n.tontobox.id+"/"+e.index,t=e.deeplink;t&&(o+="/"+t),window.location.replace((""+window.location).split("#")[0]+"#"+o)},clear:function(){window.location.replace((""+window.location).split("#")[0]+"#/")}}},o.addons.register(o.DeepLinking,t)}(jQuery,window.tontobox),function(e,o){o.Events=function(t){this.tontobox=t;var n=this;this.preinit=function(e){n.handlers.unbind(),e.bind({"tontobox.afterLoad":n.handlers.tontobox_image_onload,"tontobox.beforeLoad":n.handlers.tontobox_image_custom_caption})},this.destroy=function(){n.handlers.unbind()},this.raise=function(o,t){t=t||{};var i=e.Event(o);return e.extend(!0,i,t),n.tontobox.element.trigger(i),i},this.handlers={unbind:function(){n.tontobox.element.unbind({"tontobox.afterLoad":n.handlers.tontobox_image_onload,"tontobox.beforeLoad":n.handlers.tontobox_image_custom_caption})},tontobox_image_onload:function(e){"image"==e.fb.item.type&&n.raise("tontobox_image_onload",{thumb:{jq:e.fb.item.element,target:e.fb.item.url}})},tontobox_image_custom_caption:function(e){var t=n.raise("tontobox_image_custom_caption",{thumb:e.fb.item.element,title:e.fb.item.title,desc:e.fb.item.description,handled:!1});if(1==t.handled){e.fb.item.title=t.title,e.fb.item.description=t.desc;var i="string"==typeof e.fb.item.title&&e.fb.item.title.length>0?o.format('<div class="fbx-caption-title">{0}</div>',e.fb.item.title):"";
i="string"==typeof e.fb.item.description&&e.fb.item.description.length>0?i+o.format('<div class="fbx-caption-desc">{0}</div>',e.fb.item.description):i,e.fb.item.caption=i}}}},o.addons.register(o.Events)}(jQuery,window.tontobox),function(e,o){var t={fullscreen:{enabled:!1,force:!1,useAPI:!0}};o.Item.prototype.fullscreen=!1,o.Fullscreen=function(t){this.tontobox=t;var n=this;this.preinit=function(e){n.handlers.unbind(!0),e.bind({"tontobox.initialized tontobox.reinitialized":n.handlers.initialized,"tontobox.setupHtml":n.handlers.setupHtml,"tontobox.setupOptions":n.handlers.setupOptions,"tontobox.close":n.handlers.onClose,"tontobox.keydown":n.handlers.onKeydown})},this.destroy=function(){n.handlers.unbind(!0)},this.handlers={unbind:function(t){t=t||!1,t&&n.tontobox.element.unbind({"tontobox.initialized tontobox.reinitialized":n.handlers.initialized,"tontobox.setupHtml":n.handlers.setupHtml,"tontobox.setupOptions":n.handlers.setupOptions,"tontobox.close":n.handlers.onClose,"tontobox.keydown":n.handlers.onKeydown}),n.tontobox.element.unbind({"tontobox.afterShow":n.handlers.afterShow,"tontobox.beforeLoad":n.handlers.beforeLoad}),n.tontobox.modal instanceof o.Modal&&o.isjQuery(n.tontobox.modal.element)&&n.tontobox.modal.element.find(".fbx-fullscreen-toggle").unbind("click.fullscreen",n.handlers.onClick),e(document).unbind("webkitfullscreenchange mozfullscreenchange fullscreenchange",n.handlers.onFullscreenChange).bind("webkitfullscreenchange mozfullscreenchange fullscreenchange",n.handlers.onFullscreenChange)},initialized:function(e){n.handlers.unbind(),e.fb.options.fullscreen.enabled===!0&&(e.fb.instance.element.bind({"tontobox.beforeLoad":n.handlers.beforeLoad}),e.fb.modal.find(".fbx-fullscreen-toggle").bind("click.fullscreen",n.handlers.onClick)),e.fb.instance.element.bind({"tontobox.afterShow":n.handlers.afterShow})},setupHtml:function(e){e.fb.modal.find(".fbx-inner").append('<a href="#fullscreen" class="fbx-fullscreen-toggle fbx-btn-transition fbx-btn-shadow"></a>')},setupOptions:function(e){1==e.fb.options.fullscreen.enabled?e.fb.modal.addClass("fbx-fullscreen"):e.fb.modal.removeClass("fbx-fullscreen"),1==e.fb.options.fullscreen.force&&e.fb.modal.find(".fbx-fullscreen-toggle").hide()},afterShow:function(e){e.fb.options.fullscreen.force===!0&&(n.tontobox.modal.element.addClass("fbx-fullscreen"),n.fullscreen.launch())},beforeLoad:function(e){if(e.fb.modal.hasClass("fbx-fullscreen-mode")&&1!=e.fb.item.fullscreen)switch(e.fb.handled=!0,e.fb.instance.items.indexes.direction){case"<":e.fb.instance.modal.prev();break;default:e.fb.instance.modal.next()}else 1!=e.fb.item.fullscreen?e.fb.modal.removeClass("fbx-fullscreen").find(".fbx-fullscreen-toggle").hide():e.fb.modal.addClass("fbx-fullscreen").find(".fbx-fullscreen-toggle").show()},onClick:function(e){return e.preventDefault(),n.tontobox.modal.element.hasClass("fbx-fullscreen-mode")?n.fullscreen.cancel():n.fullscreen.launch(),!1},onClose:function(){n.fullscreen.cancel()},onKeydown:function(e){e.fb.modal.hasClass("fbx-fullscreen-mode")&&27==e.fb.keyCode&&(n.fullscreen.cancel(),1==e.fb.options.fullscreen.force&&e.fb.instance.modal.close())},onFullscreenChange:function(){document.fullScreen||document.mozFullScreen||document.webkitIsFullScreen?n.fullscreen.apply():n.fullscreen.remove()}},this.fullscreen={launch:function(){if(n.tontobox.options.fullscreen.useAPI!==!0||n.tontobox.options.fullscreen.force!==!1||o.browser.isSafari&&o.browser.Mac)n.fullscreen.apply();else{var e=n.tontobox.modal.element.get(0);e.requestFullScreen?e.requestFullScreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullScreen?e.webkitRequestFullScreen():n.fullscreen.apply()}},cancel:function(){n.tontobox.modal.element.hasClass("fbx-fullscreen-mode")&&(n.tontobox.options.fullscreen.useAPI!==!0||n.tontobox.options.fullscreen.force!==!1||o.browser.isSafari&&o.browser.Mac?n.fullscreen.remove():document.cancelFullScreen?document.cancelFullScreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen?document.webkitCancelFullScreen():n.fullscreen.remove())},apply:function(){var e=n.tontobox.items.current();e&&(n.tontobox.modal.element.addClass("fbx-fullscreen-mode"),n.tontobox.modal.resize(e.handler.getSize(e))),n.tontobox.raise("tontobox.fullscreenEnabled")},remove:function(){var e=n.tontobox.items.current();e&&(n.tontobox.modal.element.removeClass("fbx-fullscreen-mode"),n.tontobox.modal.resize(e.handler.getSize(e))),n.tontobox.raise("tontobox.fullscreenDisabled")}}},o.addons.register(o.Fullscreen,t)}(jQuery,window.tontobox),function(e,o){o.Keyboard=function(o){this.tontobox=o;var t=this;this.preinit=function(e){t.handlers.unbind(!0),e.bind("tontobox.initialized tontobox.reinitialized",t.handlers.initialized)},this.destroy=function(){t.handlers.unbind(!0)},this.handlers={unbind:function(o){o=o||!1,o&&t.tontobox.element.unbind("tontobox.initialized tontobox.reinitialized",t.handlers.initialized),e(document).unbind("keydown.tontobox",t.handlers.onKeydown)},initialized:function(){t.handlers.unbind(),e(document).bind("keydown.tontobox",t.handlers.onKeydown)},onKeydown:function(e){var o=t.tontobox.modal;if(!o.element.is(":visible"))return!0;var n=e.which;return o.element.hasClass("fbx-fullscreen-mode")||27!==n?t.tontobox.items.multiple()&&37===n?o.prev():t.tontobox.items.multiple()&&39===n&&o.next():o.close(),t.tontobox.raise("tontobox.keydown",{keyCode:n}),!0}}},o.addons.register(o.Keyboard)}(jQuery,window.tontobox),function(e,o){var t={hideNavOnMobile:!1,resizeTimeout:300,breakpoints:{phone:480,tablet:1024}};o.BPInfo=function(o){this.width=window.innerWidth||document.documentElement.clientWidth||(document.body?document.body.offsetWidth:0),this.height=window.innerHeight||document.documentElement.clientHeight||(document.body?document.body.offsetHeight:0),this.orientation=this.width>this.height?"fbx-landscape":"fbx-portrait";var t,n=null;if(e.isArray(o))for(var i=0;o.length>i;i++)if(t=o[i],t&&t.width&&this.width<=t.width){n=t;break}this.breakpoint=null==n?"fbx-desktop":n.name},o.Responsive=function(t){this.tontobox=t,this.breakpoint={values:[],names:""},this.timers={resize:new o.Timer};var n=this;this.preinit=function(e){n.handlers.unbind(!0),e.bind("tontobox.initialized tontobox.reinitialized",n.handlers.initialized)},this.destroy=function(){n.handlers.unbind(!0)},this.handlers={unbind:function(o){o=o||!1,o&&n.tontobox.element.unbind("tontobox.initialized tontobox.reinitialized",n.handlers.initialized),e(window).unbind("resize.tontobox",n.handlers.resize)},initialized:function(){n.handlers.unbind(),n.setup.breakpoints(),n.style(),e(window).bind("resize.tontobox",n.handlers.resize)},resize:function(){n.timers.resize.start(function(){if(n.style(),n.tontobox.modal.element.is(":visible")){var e=n.tontobox.items.current(),o=e.handler.getSize(e);n.tontobox.modal.resize(o)}},n.tontobox.options.resizeTimeout)}},this.setup={breakpoints:function(){n.breakpoint.values=[],n.breakpoint.names="";for(var e in n.tontobox.options.breakpoints)n.tontobox.options.breakpoints.hasOwnProperty(e)&&(n.breakpoint.values.push({name:n.fixName(e),width:n.tontobox.options.breakpoints[e]}),n.breakpoint.names+=n.fixName(e)+" ");n.breakpoint.values.sort(function(e,o){return e.width-o.width})}},this.fixName=function(e){return/^fbx-[a-zA-Z0-9]/.test(e)?e:"fbx-"+e},this.style=function(){var e=new o.BPInfo(n.breakpoint.values),t=n.tontobox.modal.element;t.removeClass(n.breakpoint.names).removeClass("fbx-desktop fbx-landscape fbx-portrait").addClass(e.breakpoint).addClass(e.orientation),n.tontobox.options.hideNavOnMobile===!0?t.addClass("fbx-no-nav"):t.removeClass("fbx-no-nav")}},o.addons.register(o.Responsive,t)}(jQuery,window.tontobox),function(e,o){var t={slideshow:{autostart:!1,enabled:!0,imagesOnly:!1,mousestopTimeout:300,timeout:6e3,sensitivity:130,skipErrors:!1}};o.Slideshow=function(e){this.tontobox=e,this.autostart=!1,this.running=!1,this.paused=0,this.remaining=0,this.timers={mousestop:new o.Timer};var t=this,n=null;this.preinit=function(e,o){t.handlers.unbind(!0),t.autostart=o.slideshow.autostart,e.bind({"tontobox.initialized tontobox.reinitialized":t.handlers.initialized,"tontobox.setupHtml":t.handlers.setupHtml,"tontobox.setupOptions":t.handlers.setupOptions,"tontobox.onError":t.handlers.onError})},this.destroy=function(){t.handlers.unbind(!0)},this.handlers={unbind:function(e){e=e||!1,e&&t.tontobox.element.unbind({"tontobox.initialized tontobox.reinitialized":t.handlers.initialized,"tontobox.setupHtml":t.handlers.setupHtml,"tontobox.setupOptions":t.handlers.setupOptions,"tontobox.onError":t.handlers.onError}),t.tontobox.element.unbind({"tontobox.beforeLoad":t.handlers.beforeLoad,"tontobox.afterLoad":t.handlers.afterLoad,"tontobox.close":t.handlers.onClose,"tontobox.previous tontobox.next":t.handlers.onChange,"tontobox.keydown":t.handlers.onKeydown,"tontobox.fullscreenEnabled":t.handlers.fullscreenEnabled,"tontobox.fullscreenDisabled":t.handlers.fullscreenDisabled}),t.tontobox.modal instanceof o.Modal&&o.isjQuery(t.tontobox.modal.element)&&t.tontobox.modal.element.undelegate("click.slideshow").unbind("mousemove.tontobox").find(".fbx-play, .fbx-pause").unbind("mouseenter.tontobox mouseleave.tontobox")},initialized:function(e){t.handlers.unbind(),e.fb.options.slideshow.enabled===!0&&e.fb.instance.items.multiple()&&(e.fb.instance.element.bind({"tontobox.beforeLoad":t.handlers.beforeLoad,"tontobox.afterLoad":t.handlers.afterLoad,"tontobox.close":t.handlers.onClose,"tontobox.previous tontobox.next":t.handlers.onChange,"tontobox.keydown":t.handlers.onKeydown,"tontobox.fullscreenEnabled":t.handlers.fullscreenEnabled,"tontobox.fullscreenDisabled":t.handlers.fullscreenDisabled}),e.fb.modal.delegate(".fbx-play","click.slideshow",t.handlers.playClicked).delegate(".fbx-pause","click.slideshow",t.handlers.pauseClicked),e.fb.modal.hasClass("fbx-playpause-center")&&e.fb.modal.bind("mousemove.tontobox",t.handlers.mousemove).find(".fbx-play, .fbx-pause").bind("mouseenter.tontobox",t.handlers.mouseenter).bind("mouseleave.tontobox",t.handlers.mouseleave))},setupHtml:function(e){e.fb.options.slideshow.enabled===!0&&e.fb.modal.find(".fbx-inner").append('<div class="fbx-progress"></div>').append('<a href="#playpause" class="fbx-play fbx-btn-transition fbx-btn-shadow"></a>')},setupOptions:function(e){if(e.fb.options.slideshow.enabled===!0){var o=1==e.fb.options.showButtons&&e.fb.instance.items.multiple()?"":"none";e.fb.modal.addClass("fbx-slideshow").find(".fbx-progress, .fbx-play, .fbx-pause").css("display",o)}},beforeLoad:function(e){if(e.fb.modal.hasClass("fbx-fullscreen-mode")&&e.fb.modal.hasClass("fbx-playpause-center"))n=null,t.timers.mousestop.stop();else{var o=1==e.fb.options.showButtons&&e.fb.instance.items.multiple()?"":"none";e.fb.modal.find(".fbx-play, .fbx-pause").css("display",o)}},afterLoad:function(){1==t.autostart&&t.start()},onError:function(e){if(e.fb.options.slideshow.skipErrors===!0&&e.fb.instance.modal._first===!1)switch(e.fb.handled=!0,e.fb.instance.items.indexes.direction){case"<":e.fb.instance.modal.prev(e.fb.options.slideshow.imagesOnly===!0?"image":null);break;default:e.fb.instance.modal.next(e.fb.options.slideshow.imagesOnly===!0?"image":null)}else 1==t.autostart&&t.start()},onClose:function(){t.stop(!1)},onChange:function(){t.stop(1==t.autostart||1==t.running)},onKeydown:function(e){return 32!=e.fb.keyCode?!0:(e.preventDefault(),1==t.running?t.pause():t.start(),!1)},fullscreenEnabled:function(e){e.fb.modal.hasClass("fbx-fullscreen-mode")&&e.fb.modal.hasClass("fbx-playpause-center")&&t.timers.mousestop.start(function(){n=null,e.fb.modal.find(".fbx-play, .fbx-pause").fadeOut("fast")},t.tontobox.options.slideshow.mousestopTimeout)},fullscreenDisabled:function(e){var o=1==e.fb.options.showButtons&&e.fb.instance.items.multiple()?"":"none";!e.fb.modal.hasClass("fbx-fullscreen-mode")&&e.fb.modal.hasClass("fbx-playpause-center")&&(e.fb.modal.find(".fbx-play, .fbx-pause").removeClass("fbx-active").css("display",o),n=null,t.timers.mousestop.stop())},playClicked:function(e){return e.preventDefault(),t.start(),!1},pauseClicked:function(e){return e.preventDefault(),t.pause(),!1},mousemove:function(e){var o=t.tontobox.options.slideshow.sensitivity,i=t.tontobox.modal.element;if(i.hasClass("fbx-fullscreen-mode")&&!i.hasClass("fbx-loading")&&!i.hasClass("fbx-error")&&!i.hasClass("fbx-playpause-active")&&i.hasClass("fbx-playpause-center"))if(null==n)n={},n.X=e.pageX,n.Y=e.pageY;else if(n.X-e.pageX>=o||n.Y-e.pageY>=o||-o>=n.X-e.pageX||-o>=n.Y-e.pageY){var s=i.find(".fbx-play, .fbx-pause");s.is(":visible")||s.fadeIn("fast"),t.timers.mousestop.start(function(){n=null,s.fadeOut("fast")},t.tontobox.options.slideshow.mousestopTimeout)}},mouseenter:function(){var e=t.tontobox.modal.element;e.hasClass("fbx-fullscreen-mode")&&!e.hasClass("fbx-error")&&e.hasClass("fbx-playpause-center")&&(e.addClass("fbx-playpause-active"),n=null,t.timers.mousestop.stop())},mouseleave:function(){var e=t.tontobox.modal.element;e.hasClass("fbx-fullscreen-mode")&&!e.hasClass("fbx-error")&&e.hasClass("fbx-playpause-center")&&(e.removeClass("fbx-playpause-active"),t.timers.mousestop.start(function(){n=null,e.find(".fbx-play, .fbx-pause").fadeOut("fast")},t.tontobox.options.slideshow.mousestopTimeout))}},this.start=function(){t.remaining=1>t.remaining?t.tontobox.options.slideshow.timeout:t.remaining,t.autostart=!1,t.running=!0,t.tontobox.modal.element.find(".fbx-progress").css("width",t.paused+"%").show().animate({width:"100%"},t.remaining,"linear",function(){t.paused=0,t.remaining=t.tontobox.options.slideshow.timeout,t.autostart=!0,t.tontobox.modal.next(t.tontobox.options.slideshow.imagesOnly===!0?"image":null)}),t.tontobox.modal.element.find(".fbx-play").toggleClass("fbx-play fbx-pause"),t.tontobox.raise("tontobox.slideshowStart")},this.stop=function(e){t.paused=0,t.tontobox.modal.element.find(".fbx-progress").stop().hide().css("width","0%"),t.running=!1,t.autostart=e,t.remaining=t.tontobox.options.slideshow.timeout,e||t.tontobox.modal.element.find(".fbx-pause").toggleClass("fbx-play fbx-pause"),t.tontobox.raise("tontobox.slideshowStop")},this.pause=function(){var e=t.tontobox.modal.element.find(".fbx-progress"),o=e.stop().css("width"),n=e.css("position"),i="fixed"==n?t.tontobox.modal.element.css("width"):t.tontobox.modal.element.find(".fbx-inner").css("width");t.running=!1,t.paused=100*(parseInt(o,0)/parseInt(i,0)),t.remaining=t.tontobox.options.slideshow.timeout-t.tontobox.options.slideshow.timeout*(t.paused/100),t.tontobox.modal.element.find(".fbx-pause").toggleClass("fbx-play fbx-pause"),t.tontobox.raise("tontobox.slideshowPause")}},o.addons.register(o.Slideshow,t)}(jQuery,window.tontobox),function(e,o){var t={social:{animation:"fade",enabled:!1,position:"fbx-top",onlyShowOnHover:!1,hoverDelay:300,excludes:["iframe","html"],links:[{css:"fbx-facebook",title:"Facebook",url:"http://www.facebook.com/sharer.php?s=100&p[url]={url}&p[images][0]={img}&p[title]={title}&p[summary]={desc}"},{css:"fbx-google-plus",title:"Google+",url:"https://plus.google.com/share?url={url-ne}"},{css:"fbx-twitter",title:"Twitter",url:"https://twitter.com/share?url={url}&text={title}",titleSource:"pageTitle",titleCustom:"Custom Tweet Text!"},{css:"fbx-pinterest",title:"Pinterest",url:"https://pinterest.com/pin/create/bookmarklet/?media={img!}&url={url}&is_video={is_video}&description={title}"},{css:"fbx-linkedin",title:"LinkedIn",url:"http://www.linkedin.com/shareArticle?url={url}&title={title}"},{css:"fbx-buffer",title:"Buffer",url:"#"},{css:"fbx-digg",title:"digg",url:"#"},{css:"fbx-reddit",title:"Reddit",url:"#"},{css:"fbx-tumblr",title:"Tumblr",url:"#"},{css:"fbx-stumble-upon",title:"StumbleUpon",url:"#"},{css:"fbx-download",excludes:["video","iframe","html"],title:"Download",url:"{img-ne}"},{css:"fbx-email",title:"Email",url:"mailto:"}]}};o.Item.prototype.social=!1,o.Social=function(t){this.tontobox=t,this.timers={hover:new o.Timer};var n=this;this.preinit=function(e){n.handlers.unbind(!0),e.bind({"tontobox.initialized tontobox.reinitialized":n.handlers.initialized,"tontobox.setupHtml":n.handlers.setupHtml,"tontobox.setupOptions":n.handlers.setupOptions,"tontobox.onError":n.handlers.onError})},this.destroy=function(){n.handlers.unbind(!0)},this.handlers={unbind:function(e){e=e||!1,e&&n.tontobox.element.unbind({"tontobox.initialized tontobox.reinitialized":n.handlers.initialized,"tontobox.setupHtml":n.handlers.setupHtml,"tontobox.setupOptions":n.handlers.setupOptions,"tontobox.onError":n.handlers.onError}),n.tontobox.element.unbind({"tontobox.beforeLoad":n.handlers.beforeLoad,"tontobox.afterLoad":n.handlers.afterLoad,"tontobox.closeOverlays":n.handlers.closeOverlays}),n.tontobox.modal instanceof o.Modal&&o.isjQuery(n.tontobox.modal.element)&&n.tontobox.modal.element.undelegate("mouseenter.social mouseleave.social").find(".fbx-item-current, .fbx-item-next").unbind("click.social")},initialized:function(e){n.handlers.unbind(),e.fb.options.social.enabled===!0&&(e.fb.instance.element.bind({"tontobox.beforeLoad":n.handlers.beforeLoad,"tontobox.afterLoad":n.handlers.afterLoad,"tontobox.closeOverlays":n.handlers.closeOverlays}),e.fb.modal.find(".fbx-item-current, .fbx-item-next").bind("click.social",n.handlers.toggleSocial),e.fb.options.social.onlyShowOnHover===!0&&e.fb.modal.delegate(".fbx-inner:not(:has(.fbx-item-error))","mouseenter.social",n.handlers.mouseenter).delegate(".fbx-inner:not(:has(.fbx-item-error))","mouseleave.social",n.handlers.mouseleave))},closeOverlays:function(e){e.fb.modal.addClass("fbx-social-hidden"),n.hide()},toggleSocial:function(){return n.tontobox.modal.element.hasClass("fbx-error")?!0:(n.tontobox.modal.element.find(".fbx-social").is(":visible")?(n.tontobox.modal.element.addClass("fbx-social-hidden"),n.hide()):(n.tontobox.modal.element.removeClass("fbx-social-hidden"),n.show()),!0)},mouseenter:function(){var e=n.tontobox.items.current();e.element.hasClass("no-social")||n.timers.hover.start(function(){n.show()},n.tontobox.options.social.hoverDelay)},mouseleave:function(){var e=n.tontobox.items.current();e.element.hasClass("no-social")||n.timers.hover.start(function(){n.hide()},n.tontobox.options.social.hoverDelay)},setupHtml:function(o){for(var t=e('<div class="fbx-social"></div>'),n=0;o.fb.options.social.links.length>n;n++){var i=o.fb.options.social.links[n];t.append('<a href="'+i.url+'" rel="nofollow" target="_blank" class="'+i.css+'" title="'+i.title+'"></a>')}o.fb.modal.find(".fbx-inner").append(t)},setupOptions:function(e){var o=e.fb.options.social.enabled&&!e.fb.options.social.onlyShowOnHover?"":"none";e.fb.modal.find(".fbx-social").addClass(e.fb.options.social.position).css("display",o)},beforeLoad:function(e){1!=e.fb.options.social.onlyShowOnHover&&n.tontobox.modal.element.find(".fbx-social").css("display","none")},afterLoad:function(o){if(e(o.fb.item.element).hasClass("no-social"))return o.fb.modal.find(".fbx-social").css("display","none"),void 0;if(0==o.fb.modal.find(".fbx-item-error").length)for(var t=0;o.fb.options.social.links.length>t;t++){var i=o.fb.options.social.links[t],s=e.merge(e.merge([],o.fb.options.social.excludes||[]),i.excludes||[]),a=o.fb.modal.find("."+i.css);if(a.length>0)if(-1!==e.inArray(o.fb.item.type,s))a.removeAttr("href").hide();else{var r=n.parseUrl(i,o.fb.item);""!=r&&"#"!=r?a.attr("href",n.cleanUrl(r)).show():a.removeAttr("href").hide()}}1!=o.fb.options.social.onlyShowOnHover&&n.show()},onError:function(e){e.fb.modal.find(".fbx-social").css("display","none")}},this.hide=function(){var e=n.tontobox.items.current(),o=n.tontobox.modal.element.find(".fbx-social");if(!n.tontobox.options.social.enabled||!e.social||e.element.hasClass("no-social"))return o.css("display","none"),void 0;switch(n.tontobox.options.social.animation){case"fade":o.stop(!0,!0).fadeOut(500);break;case"slide":o.stop(!0,!0).slideUp(500);break;default:o.css("display","none")}},this.show=function(){var e=n.tontobox.items.current(),t=n.tontobox.modal.element.find(".fbx-social");if(!n.tontobox.options.social.enabled||!e.social||n.tontobox.modal.element.hasClass("fbx-social-hidden")||o.isjQuery(e.element)&&e.element.hasClass("no-social"))return t.css("display","none"),void 0;switch(n.tontobox.options.social.animation){case"fade":t.stop(!0,!0).fadeIn(600);break;case"slide":t.stop(!0,!0).slideDown(400);break;default:t.css("display","")}},this.parseUrl=function(o,t){var n=o.url;if(-1!=n.indexOf("{url-ne}")&&(n=n.replace(/{url-ne}/g,location.href)),-1!=n.indexOf("{url}")&&(n=n.replace(/{url}/g,encodeURIComponent(location.href))),-1!=n.indexOf("{img!}")){if(!t.image_url)return"";n=n.replace(/{img!}/g,encodeURIComponent(t.image_url))}if(-1!=n.indexOf("{img-ne}")&&(n=n.replace(/{img-ne}/g,t.image_url)),-1!=n.indexOf("{img}")){var i=decodeURIComponent(t.image_url);n=n.replace(/{img}/g,encodeURIComponent(i))}if(-1!=n.indexOf("{title}")){var s=[t.title];s="caption"==o.titleSource?[t.title,t.description]:"h1"==o.titleSource?[e("h1:first").text()]:"custom"==o.titleSource?[o.titleCustom]:[document.title,t.title],s=e.grep(s,function(e){return e}),s=s.join(" - "),s=s.replace(/(<([^>]+)>)/gi,""),n=n.replace(/{title}/g,encodeURIComponent(s))}if(-1!=n.indexOf("{desc}")){var a=t.description||"";a=a.replace(/(<([^>]+)>)/gi,""),n=n.replace(/{desc}/g,encodeURIComponent(a))}if(-1!=n.indexOf("{is_video}")){var r=t.video_valid?"true":"false";n=n.replace(/{is_video}/g,r)}return n},this.cleanUrl=function(e){e=e.replace(/\{([^{}]*)}/g,"");var o=e.match(/[^\=\&\?]+=[^\=\&\?]+/g),t=e.split("?")[0];return o&&o.length>0&&(t+="?"+o.join("&")),t}},o.addons.register(o.Social,t)}(jQuery,window.tontobox),function(e,o){var t={swipe:{enabled:!0,min:80}};o.Swipe=function(e){this.tontobox=e,this.isMoving=!1;var t,n=this;this.preinit=function(e){n.handlers.unbind(!0),e.bind("tontobox.initialized tontobox.reinitialized",n.handlers.initialized)},this.destroy=function(){n.handlers.unbind(!0)},this.handlers={unbind:function(e){e=e||!1,e&&n.tontobox.element.unbind("tontobox.initialized tontobox.reinitialized",n.handlers.initialized),n.tontobox.modal instanceof o.Modal&&o.isjQuery(n.tontobox.modal.element)&&n.tontobox.modal.element.unbind({touchstart:n.handlers.onTouchStart,touchmove:n.handlers.onTouchMove})},initialized:function(e){n.handlers.unbind(),e.fb.options.swipe.enabled===!0&&e.fb.modal.bind("touchstart",n.handlers.onTouchStart)},onTouchStart:function(e){var o=e.originalEvent.touches||e.touches;1==o.length&&n.tontobox.items.multiple()&&(t=o[0].pageX,n.isMoving=!0,n.tontobox.modal.element.bind("touchmove",n.handlers.onTouchMove))},onTouchMove:function(e){if(e.preventDefault(),!n.isMoving)return!1;var o=e.originalEvent.touches||e.touches,i=o[0].pageX,s=t-i;return Math.abs(s)>=n.tontobox.options.swipe.min&&(n.cancelTouch(),s>0?(n.tontobox.raise("tontobox.swipeRight"),n.tontobox.modal.next()):(n.tontobox.raise("tontobox.swipeLeft"),n.tontobox.modal.prev())),!1}},this.cancelTouch=function(){n.tontobox.modal.element.unbind("touchmove",n.handlers.onTouchMove),t=null,n.isMoving=!1}},o.addons.register(o.Swipe,t)}(jQuery,window.tontobox),function(e,o){var t={wordpress:{enabled:!1}};o.Wordpress=function(t){this.tontobox=t;var n=this;this.preinit=function(e){n.handlers.unbind(!0),e.bind("tontobox.createCaption",n.handlers.onCreateCaption)},this.destroy=function(){n.handlers.unbind(!0)},this.handlers={unbind:function(e){e=e||!1,e&&n.tontobox.element.unbind("tontobox.createCaption",n.handlers.onCreateCaption)},onCreateCaption:function(t){var n,i,s=t.fb.options,a=t.fb.instance.element,r=t.fb.item.element,l="";if(1==s.wordpress.enabled){if(a.hasClass("gallery"))s.captions.overrideTitle===!1&&(n=r.parents(".gallery-item:first").find(".wp-caption-text:first").html()||""),s.captions.overrideDesc===!1&&(i=r.find("img").attr("alt")||"");else if(a.hasClass("wp-caption"))s.captions.overrideTitle===!1&&(n=r.find("img").attr("title")||""),s.captions.overrideDesc===!1&&(i=r.parents(".wp-caption:first").find(".wp-caption-text:first").html()||"");else{if(!a.hasClass("tiled-gallery"))return;s.captions.overrideTitle===!1&&(n=r.parents(".tiled-gallery-item:first").find(".tiled-gallery-caption").html()||r.find("img").data("image-title")||r.find("img").attr("title")||""),s.captions.overrideDesc===!1&&(i=e.trim(r.find("img").data("image-description"))||"",i=i.replace(/(^<p>)|(<\/p>$)/gi,""))}n&&e.trim(n)==e.trim(i)&&(i=null),l="string"==typeof n&&n.length>0?o.format('<div class="fbx-caption-title">{0}</div>',n):l,l="string"==typeof i&&i.length>0?l+o.format('<div class="fbx-caption-desc">{0}</div>',i):l,t.fb.item.title=n,t.fb.item.description=i,t.fb.item.caption=l}}}},o.addons.register(o.Wordpress,t)}(jQuery,window.tontobox),function(e,o){var t={html:{attr:"href",overflow:!0,sizePadding:20,showCaptions:!1,findSelector:function(e,o){if(!o)return"";var t=o.attr(e.options.html.attr);return"string"==typeof t?o.attr(e.options.html.attr):""}}};o.Item.prototype.content=null,o.Item.prototype.selector=null,o.Item.prototype.padding=null,o.HtmlHandler=function(t){this.tontobox=t,this.type="html",this.regex=/^#/i;var n=this;this.init=function(e){n.handlers.unbind(),e.bind("tontobox.close",n.handlers.onClose)},this.destroy=function(){n.handlers.unbind()},this.handlers={unbind:function(){n.tontobox.element.unbind("tontobox.close",n.handlers.onClose)},onClose:function(){var t,i;for(t=0;n.tontobox.items.array.length>t;t++)i=n.tontobox.items.array[t],i.type==n.type&&o.isjQuery(i.content)&&0==i.error&&e(i.selector).length>0&&(e(i.selector).append(i.content.children()),i.content=null)}},this.handles=function(o){var t=n.tontobox.options.html.findSelector(n.tontobox,o),i="tontobox"===e(o).attr("target")&&"string"==typeof t&&null!=t.match(n.regex)&&(e(t).length>0||1==e(o).data("ajax")),s=n.tontobox.raise("tontobox.handlesHtml",{element:o,handle:i});return s.fb.handle},this.defaults=function(e){e.fullscreen=e.fullscreen||!1,e.overflow=e.overflow||n.tontobox.options.html.overflow,e.social=e.social||!0,e.proportion=e.proportion||!1,e.captions=e.captions||n.tontobox.options.html.showCaptions},this.parse=function(t){var i=new o.Item(n.type,t,this);n.defaults(i),i.url=i.selector=n.tontobox.options.html.findSelector(n.tontobox,t)||null,i.padding=t.data("padding")||n.tontobox.options.html.sizePadding||0,n.getSize(i);var s=null!=i.selector?e(i.selector):null;return null!=s&&s.length>0?(i.width=s.data("width")||t.data("width")||i.width||null,i.height=s.data("height")||t.data("height")||i.height||null):(i.width=t.data("width")||i.width||null,i.height=t.data("height")||i.height||null),i.overflow="boolean"==typeof t.data("overflow")?t.data("overflow"):i.overflow,i.image_url=t.data("image")||"",i},this.load=function(t,i,s,a){try{var r=e("<div/>").addClass("fbx-item");if(1==t.error?r.addClass("fbx-item-error"):r.addClass("fbx-item-html"),null==t.content&&"string"==typeof t.selector){if(0==e(t.selector).length){var l=n.tontobox.raise("tontobox.loadHtml",{container:r,selector:t.selector,success:function(){t.content=l.fb.container,i.empty().append(t.content),e.isFunction(s)&&s(n.getSize(t))},error:function(o){o=o||"Unable to load HTML.",e.isFunction(a)&&a(o)}});return}var d=e(t.selector);d.length>0&&(t.content=r.append(d.children()))}o.isjQuery(t.content)?(i.empty().append(t.content),e.isFunction(s)&&s(n.getSize(t))):e.isFunction(a)&&a("No valid HTML found to display.")}catch(f){e.isFunction(a)&&a(f)}},this.preload=function(){},this.getCSS=function(e){return{font:e.css("font"),padding:e.css("padding"),margin:e.css("margin"),border:e.css("border")}},this.getSize=function(t){if((null==t.width||null==t.height||0==t.width||0==t.height)&&"string"==typeof t.selector){var i,s;if("string"==typeof t.selector&&e(t.selector).length>0){var a=e(t.selector);s=n.getCSS(a),i=a.clone().css(s)}else o.isjQuery(t.content)&&(s=n.getCSS(t.content),i=t.content.clone().css(s));o.isjQuery(i)&&(i.css({position:"absolute",visibility:"hidden",display:"block",top:-1e4,left:-1e4}).appendTo("body"),"number"==typeof t.width&&t.width>0?i.width(t.width):t.width=i.outerWidth(!0)+t.padding,t.height="number"==typeof t.height&&t.height>0?t.height:i.outerHeight(!0)+t.padding,i.remove())}return null!=t.width&&null!=t.height?new o.Size(t.width,t.height):new o.Size(0,0)},this.hasChanged=function(){return!1}},o.handlers.register(o.HtmlHandler,t)}(jQuery,window.tontobox),function(e,o){var t={iframe:{attr:"href",showCaptions:!1,findUrl:function(e,o){if(!o)return"";var t=o.attr(e.options.iframe.attr);return"string"==typeof t?o.attr(e.options.iframe.attr):""}}};o.Item.prototype.auto={width:!1,height:!1},o.IframeHandler=function(t){this.tontobox=t,this.type="iframe",this.regex=/^https?/i,this.videoRegex=/(youtube(-nocookie)?\.com\/(watch|v|embed)|youtu\.be|vimeo\.com)/i;var n=this;this.handles=function(o){var t=n.tontobox.options.iframe.findUrl(n.tontobox,o),i="tontobox"===e(o).attr("target")&&"string"==typeof t&&null!=t.match(n.regex)&&!t.match(n.videoRegex),s=n.tontobox.raise("tontobox.handlesIframe",{element:o,handle:i});return s.fb.handle},this.defaults=function(e){e.fullscreen=e.fullscreen||!0,e.overflow=e.overflow||!1,e.social=e.social||!0,e.proportion=e.proportion||!1,e.captions=e.captions||n.tontobox.options.iframe.showCaptions},this.parse=function(e){var t=new o.Item(n.type,e,this);return n.defaults(t),t.url=n.tontobox.options.iframe.findUrl(n.tontobox,e)||null,t.width=e.data("width")||t.width||null,t.height=e.data("height")||t.height||null,t.overflow="boolean"==typeof e.data("overflow")?e.data("overflow"):t.overflow,t.image_url=e.data("image")||"",t},this.load=function(o,t,i,s){try{var a=n.getSize(o),r=e("<iframe />").addClass("fbx-item fbx-item-iframe").css({width:a.width,height:a.height});t.empty().append(r),r.one("load",function(){e.isFunction(i)&&i(a)}).attr("src",o.url)}catch(l){e.isFunction(s)&&s(l)}},this.preload=function(){},this.getSize=function(e){return(e.auto||null==e.width||isNaN(e.width)||0==e.width||null==e.height||isNaN(e.height)||0==e.height)&&(e.auto=e.auto||{width:!1,height:!1},(1==e.auto.width||null==e.width||isNaN(e.width)||0==e.width)&&(e.auto.width=!0,e.width=.8*(window.innerWidth||document.documentElement.clientWidth||(document.body?document.body.offsetWidth:0))),(1==e.auto.height||null==e.height||isNaN(e.height)||0==e.height)&&(e.auto.height=!0,e.height=.8*(window.innerHeight||document.documentElement.clientHeight||(document.body?document.body.offsetHeight:0)))),null!=e.width&&null!=e.height?new o.Size(e.width,e.height):new o.Size(0,0)},this.hasChanged=function(){return!1}},o.handlers.register(o.IframeHandler,t)}(jQuery,window.tontobox),function(e,o){var t={images:{noRightClick:!1,attr:"href",overflow:!1,showCaptions:!0,findUrl:function(e,o){if(!o)return"";var t=o.attr(e.options.images.attr);return"string"==typeof t?o.attr(e.options.images.attr):""}}};o.Item.prototype.image=null,o.ImageHandler=function(t){this.tontobox=t,this.type="image",this.regex=/\.(jpg|jpeg|png|gif|bmp)/i;var n=this;this.handles=function(e){var o=n.tontobox.options.images.findUrl(n.tontobox,e),t="string"==typeof o&&null!=o.match(n.regex),i=n.tontobox.raise("tontobox.handlesImage",{element:e,handle:t});return i.fb.handle},this.defaults=function(e){e.fullscreen=e.fullscreen||!0,e.captions=e.captions||n.tontobox.options.images.showCaptions,e.social=e.social||!0,e.overflow=e.overflow||n.tontobox.options.images.overflow,e.proportion=e.proportion||!0},this.parse=function(e){var t=new o.Item(n.type,e,this);return n.defaults(t),t.url=n.tontobox.options.images.findUrl(n.tontobox,e)||null,t.width=e.data("width")||t.width||null,t.height=e.data("height")||t.height||null,t.overflow="boolean"==typeof e.data("overflow")?e.data("overflow"):t.overflow,t.image=null,t.image_url=t.url,t},this.load=function(o,t,i,s){try{var a=function(){var s=e(o.image).addClass("fbx-item fbx-item-image");n.tontobox.options.images.noRightClick&&s.bind("contextmenu",function(e){return e.preventDefault(),!1}),t.empty().append(s),e.isFunction(i)&&i(n.getSize(o))};o.image&&null!==o.image?a():(o.image=new Image,o.image.onload=function(){o.image.onload=o.image.onerror=null,o.height=o.image.height,o.width=o.image.width,a()},o.image.onerror=function(){o.image.onload=o.image.onerror=null,o.image=null,e.isFunction(s)&&s("An error occurred attempting to load the image.")},o.image.src=o.url)}catch(r){e.isFunction(s)&&s(r)}},this.preload=function(e){if(1!=e.preloaded){var o=new Image;o.src=e.url,e.preloaded=!0}},this.getSize=function(e){return null!=e.width&&null!=e.height?new o.Size(e.width,e.height):new o.Size(0,0)},this.hasChanged=function(e){if(o.isjQuery(e.element)){var t=n.tontobox.options.images.findUrl(n.tontobox,e.element);
return e.url!=t}return!1}},o.handlers.register(o.ImageHandler,t)}(jQuery,window.tontobox),function(e,o){var t={videos:{attr:"href",findUrl:function(e,o){if(!o)return"";var t=o.attr(e.options.videos.attr);return"string"==typeof t?o.attr(e.options.videos.attr):""},autoPlay:!1,defaultWidth:640,defaultHeight:385,showCaptions:!1}};o.Item.prototype.video_id=null,o.Item.prototype.video_type=null,o.Item.prototype.video_url=null,o.Item.prototype.image_url=null,o.Item.prototype.video_valid=!1,o.VideoHandler=function(t){this.tontobox=t,this.type="video",this.regex=/(youtube(-nocookie)?\.com\/(watch|v|embed)|youtu\.be|vimeo\.com)/i;var n=this;this.handles=function(e){var o=n.tontobox.options.videos.findUrl(n.tontobox,e),t="string"==typeof o&&null!=o.match(n.regex),i=n.tontobox.raise("tontobox.handlesVideo",{element:e,handle:t});return i.fb.handle},this.defaults=function(e){e.width=e.width||n.tontobox.options.videos.defaultWidth,e.height=e.height||n.tontobox.options.videos.defaultHeight,e.fullscreen=e.fullscreen||!0,e.social=e.social||!0,e.captions=e.captions||n.tontobox.options.videos.showCaptions,e.proportion=e.proportion||!0},this.parse=function(e){var t=new o.Item(n.type,e,this);return n.defaults(t),t.url=n.tontobox.options.videos.findUrl(n.tontobox,e)||null,t.width=e.data("width")||t.width||null,t.height=e.data("height")||t.height||null,t.image_url=e.data("image")||e.find("img").attr("src")||null,t},this.load=function(o,t,i,s){try{var a=o.url;if(a.match("//(www.)?youtube|youtu.be")?(o.video_id=a.match("embed")?a.split(/embed\//)[1].split('"')[0]:a.split(/v\/|v=|youtu\.be\//)[1].split(/[?&]/)[0],o.video_type="youtube",o.video_url="http://www.youtube.com/embed/"+o.video_id,o.video_url+=n.getUrlVar("rel",a)?"?rel="+n.getUrlVar("rel",a):"?rel=0",o.video_valid=!0):a.match("//(player.)?vimeo.com")&&(o.video_type="vimeo",o.video_id=a.split(/video\/|http:\/\/vimeo\.com\//)[1].split(/[?&]/)[0],o.video_url="http://player.vimeo.com/video/"+o.video_id,o.video_valid=!0),o.video_valid===!0){(n.tontobox.options.videos.autoPlay||"1"===n.getUrlVar("autoplay",a))&&(o.video_url=n.appendUrlVar("autoplay=1",o.video_url));var r=e('<iframe webkitAllowFullScreen mozallowfullscreen allowFullScreen style="width:100%; height:100%" frameborder="no" />').attr("src",o.video_url).addClass("fbx-item fbx-item-video");t.empty().append(r),e.isFunction(i)&&i(n.getSize(o))}else e.isFunction(s)&&s("The video ["+o.url+"] is not supported")}catch(l){e.isFunction(s)&&s(l)}},this.preload=function(){},this.getSize=function(e){return(null==e.width||null==e.height)&&(e.width=n.tontobox.options.videos.defaultWidth,e.height=n.tontobox.options.videos.defaultHeight),null!=e.width&&null!=e.height?new o.Size(e.width,e.height):new o.Size(0,0)},this.hasChanged=function(){return!1},this.getUrlVar=function(e,o){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var t=RegExp("[\\?&]"+e+"=([^&#]*)"),n=t.exec(o);return null==n?"":decodeURIComponent(n[1].replace(/\+/g," "))},this.appendUrlVar=function(e,o){var t=-1!==o.indexOf("?")?"&":"?";return o+t+e}},o.handlers.register(o.VideoHandler,t)}(jQuery,window.tontobox);