/*! SlideDeck-JS - v1.4.5 - 2014-03-04 */ /*! * More information on this project: * http://www.slidedeck.com/ * * Requires: jQuery v1.3+ * * Full Usage Documentation: http://www.slidedeck.com/usage-documentation * Usage: * $(el).slidedeck(opts); * * @param {HTMLObject} el The
element to extend as a SlideDeck * @param {Object} opts An object to pass custom override options to */ /*! Copyright 2012 digital-telepathy (email : support@digital-telepathy.com) This file is part of SlideDeck. SlideDeck is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. SlideDeck is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with SlideDeck. If not, see . */ var SlideDeck,SlideDeckSkin={},SlideDeckLens={};!function(a){window.SlideDeck=function(b,c){var d=this,b=a(b),e="",f="pro";"undefined"!=typeof window.slideDeck2Version&&(e="sd2-"+window.slideDeck2Version+"-"),"undefined"!=typeof window.slideDeck2Distribution&&(f=window.slideDeck2Distribution);this.options={speed:500,transition:"swing",start:1,activeCorner:!0,index:!0,scroll:!0,keys:!0,autoPlay:!1,autoPlayInterval:5e3,hideSpines:!1,cycle:!1,slideTransition:"slide",touchThreshold:{x:50,y:30},touch:!0,controlProgress:!1},this.classes={slide:"slide",spine:"spine",label:"label",index:"index",active:"active",indicator:"indicator",activeCorner:"activeCorner",disabled:"disabled",vertical:"slidesVertical",previous:"previous",next:"next"},this.current=1,this.deck=b,this.former=-1,this.spines=b.children("dt"),this.slides=b.children("dd"),this.controlTo=1,this.session=[],this.disabledSlides=[],this.pauseAutoPlay=!1,this.isLoaded=!1;var g=navigator.userAgent.toLowerCase();this.browser={chrome:g.match(/chrome/)?!0:!1,chromeFrame:g.match(/msie/)&&g.match(/chrome/)?!0:!1,chromeiOS:g.match(/crios/)?!0:!1,firefox:g.match(/firefox/)?!0:!1,firefox2:g.match(/firefox\/2\./)?!0:!1,firefox30:g.match(/firefox\/3\.0/)?!0:!1,msie:g.match(/msie/)?!0:!1,msie6:g.match(/msie 6/)&&!g.match(/msie 7|8/)?!0:!1,msie7:g.match(/msie 7/)?!0:!1,msie8:g.match(/msie 8/)?!0:!1,msie9:g.match(/msie 9/)?!0:!1,msie10:g.match(/msie 10/)?!0:!1,opera:g.match(/opera/)?!0:!1,safari:g.match(/safari/)&&!g.match(/chrome|crios/)?!0:!1};for(var h in this.browser)this.browser[h]===!0&&(this.browser._this=h);this.browser.chrome!==!0||this.browser.chromeFrame||(this.browser.version=g.match(/chrome\/([0-9\.]+)/)[1]),this.browser.firefox===!0&&(this.browser.version=g.match(/firefox\/([0-9\.]+)/)[1]),this.browser.msie===!0&&(this.browser.version=g.match(/msie ([0-9\.]+)/)[1]),this.browser.opera===!0&&(this.browser.version=g.match(/version\/([0-9\.]+)/)[1]),this.browser.safari!==!0||this.browser.chromeiOS||(this.browser.version=g.match(/version\/([0-9\.]+)/)[1]),this.browser.chromeiOS===!0&&(this.browser.version=g.match(/crios\/([0-9\.]+)/)[1]);var i,j,k,l,m,n;this.looping=!1;var o="";switch(d.browser._this){case"firefox":case"firefox3":o="-moz-";break;case"chrome":case"safari":o="-webkit-";break;case"opera":o="-o-"}var p=function(a){if(d.browser.msie&&!d.browser.msie9&&!d.browser.msie10){var b=a.css("background-color"),c=b;if("transparent"===c)b="#ffffff";else if(c.match("#")&&c.length<7){var e="#"+c.substr(1,1)+c.substr(1,1)+c.substr(2,1)+c.substr(2,1)+c.substr(3,1)+c.substr(3,1);b=e}b=b.replace("#","");var f={r:b.substr(0,2),g:b.substr(2,2),b:b.substr(4,2)},g="#",h="01234567890ABCDEF";for(var i in f)f[i]=Math.max(0,parseInt(f[i],16)-1),f[i]=h.charAt((f[i]-f[i]%16)/16)+h.charAt(f[i]%16),g+=f[i];a.find("."+d.classes.index).css({filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1) chroma(color="+g+")",backgroundColor:g})}},q=function(){"undefined"!=typeof Cufon&&Cufon.DOM.ready(function(){if("undefined"!=typeof d.options.cufonRefresh){var b=[];"string"==typeof d.options.cufonRefresh?b.push(d.options.cufonRefresh):b=d.options.cufonRefresh;for(var c=0;ccufon").css("margin-top",e)}})},r=function(){return!1},s=function(){if(d.options.controlProgress===!0)for(var b=0;b0&&(c=!0),c},u=function(){var a=!1,b=!1,c=function(){if(a=!1,d.pauseAutoPlay===!1&&d.options.autoPlay===!0){"undefined"!=typeof d.vertical()&&d.vertical().navChildren&&d.vertical().current+1!==d.vertical().slides.length&&(a=!0);var e=!0;d.options.cycle===!1&&d.current===d.slides.length&&(a===!0?d.vertical().current+1===d.vertical().slides.length&&(e=!1):e=!1),e===!1?d.pauseAutoPlay=!0:a===!0?(d.vertical().current+2===d.vertical().slides.length&&(a=!1,b=d.current),d.vertical().next()):1===d.slides.length&&d.current===d.slides.length?b!==!1&&(d.resetVertical(b,!1),b=!1):(-1!==d.former&&"undefined"!=typeof d.verticalSlides[d.former]&&"undefined"!=typeof d.verticalSlides[d.former].navChildren&&d.resetVertical(d.former+1),d.next(function(a){b!==!1&&(a.resetVertical(b),b=!1)}))}setTimeout(c,d.options.autoPlayInterval)};setTimeout(c,d.options.autoPlayInterval)},v=function(a,c){var e={display:"block"};if(e[o+"transform-origin"]="50% 50%",e[o+"transform"]="",cc)var f=a(d.spines[c]);var g={top:parseInt(e.css("padding-top"),10),right:parseInt(e.css("padding-right"),10),bottom:parseInt(e.css("padding-bottom"),10),left:parseInt(e.css("padding-left"),10)},h={top:parseInt(e.css("border-top-width"),10),right:parseInt(e.css("border-right-width"),10),bottom:parseInt(e.css("border-bottom-width"),10),left:parseInt(e.css("border-left-width"),10)};for(var i in h)h[i]=isNaN(h[i])?0:h[i];c0){switch(d.options.scroll){case"stop":b.preventDefault();break;case!0:default:(d.current=b&&(d.pauseAutoPlay=!0,d.prev())),0!==G.y&&(G.y<=c?(d.pauseAutoPlay=!0,d.vertical().next()):G.y>=e&&(d.pauseAutoPlay=!0,d.vertical().prev())),F={x:0,y:0},G={x:0,y:0}},!1)}a(d.spines[d.current-2]).addClass(d.classes.previous),a(d.spines[d.current]).addClass(d.classes.next),q(),s(),u(),d.isLoaded=!0},x=function(b){return b=Math.max(1,b-1),-1!==a.inArray(b,d.disabledSlides)&&(b=1===b?1:x(b)),b},y=function(b){return b=Math.min(d.slides.length,b+1),-1!==a.inArray(b,d.disabledSlides)&&(b=b===d.slides.length?d.current:y(b)),b},z=function(b){return b=Math.min(d.slides.length,Math.max(1,b)),-1!==a.inArray(b,d.disabledSlides)&&(b=b'),k=g.find(".slidedeck-slide-mask").css(j);var l=h.find(".slidedeck-slide-mask");l.length&&k.remove(),h.addClass(d.classes.active).append('
'),j.opacity=1,l=h.find(".slidedeck-slide-mask").css(j);var m={};m[o+"transition"]="",m[o+"transform-origin"]="50% 50%",m[o+"transform"]="scale"+i+"(0)",d.slides.not(g).css(m);var n={};n[o+"transform-origin"]="50% 50%",n[o+"transform"]="scale"+i+"(0)",g.css(o+"transition",o+"transform "+f+"s ease-out").css(n),k.animate({opacity:1},{duration:d.options.speed/2,complete:function(){k.remove()}}),l.animate({opacity:1},{duration:d.options.speed/2,complete:function(){n[o+"transform"]="scale"+i+"(1)",h.addClass(d.classes.active).css(o+"transition",o+"transform "+f+"s ease-out").css(n),l.animate({opacity:0},{dureation:d.options.speed/2,complete:function(){d.slides.css(o+"transition","");var a={};a[o+"transform-origin"]="50% 50%",a[o+"transform"]="scale"+i+"(1)",d.slides.eq(d.current-1).css(a),A(b)(),k.remove(),l.remove()}})}})},flipHorizontal:function(a,b,c){this.flip(a,b,c,!0)},stack:function(a,b,c){(d.current===d.slides.length&&1===d.former||d.former===d.slides.length&&1===d.current)&&(d.looping=!0);for(var e=0;eb;b++){var d=document.createElement("LI");d.className="nav_"+(b+1)+(0===b?" active":""),d.style.listStyleType="none";var j=document.createElement("A");j.href=f[b].id?"#"+f[b].id:"#"+(b+1),j.className="nav_"+(b+1);var k="Nav "+(b+1);"undefined"!=typeof g&&(k=g.eq(b).html()),j.innerHTML=k,d.appendChild(j),a.appendChild(d)}var m=document.createElement("LI");m.className=e.classes.arrow,m.style.top=0,m.appendChild(document.createTextNode(" ")),a.appendChild(m),i.append(a),e.navChildren=i.find("."+a.className+" li"),i.find("."+a.className+" li a").click(function(a){a.preventDefault(),c.pauseAutoPlay=!0,n(this.className.match("nav_([0-9]+)")[1]-1)})};this.goTo=function(b,d,e){b=Math.min(h-1,Math.max(0,b-1)),d=Math.min(c.slides.length-1,Math.max(0,b)),a(c.slides[d]).find("."+this.classes.navContainer+" a:eq("+b+")").addClass(c.classes.active).siblings().removeClass(c.classes.active),n(b,e)},this.next=function(a){n(Math.min(h-1,e.current+1),void 0,a)},this.prev=function(a){n(Math.max(0,e.current-1),void 0,a)},this.snapTo=function(a,b){n(Math.max(0,Math.min(h-1,a)),!0,b)};var p=function(){if(!i.find("."+e.classes.navContainer).length){var d=c.browser.msie!==!0||c.browser.msie9||c.browser.msie10?a(c.spines[0]).outerHeight():a(c.spines[0]).outerWidth();c.options.hideSpines===!0&&(d=0),b.css({position:"absolute",zIndex:l-1,top:"0px",left:d,listStyleType:"none",padding:"0px",margin:"0px",width:j.innerWidth()-d,height:k*h});var g={top:parseInt(f.css("padding-top"),10),right:parseInt(f.css("padding-right"),10),bottom:parseInt(f.css("padding-bottom"),10),left:parseInt(f.css("padding-left"),10)},m={top:parseInt(f.css("border-top-width"),10),right:parseInt(f.css("border-right-width"),10),bottom:parseInt(f.css("border-bottom-width"),10),left:parseInt(f.css("border-left-width"),10)};for(var n in m)isNaN(m[n])&&(m[n]=0);var p=k-g.top-g.bottom-m.top-m.bottom,q=b.width()-g.right-g.left-m.right-m.left;f.each(function(b,c){a(c).css({listStyleType:"none",position:"absolute",top:b*k,width:q,height:p}).addClass(e.classes.prefix+"_"+(b+1))}),a(f.get(0)).addClass(c.classes.active),j.css({overflow:"hidden"}),o(),"undefined"!=typeof a.event.special.mousewheel&&b.bind("mousewheel",function(b,d){if(e.options.scroll!==!1){var f=b.detail?b.detail:b.wheelDelta;"undefined"==typeof f&&(f=0-d);var g=!1;if(a(b.originalTarget).parents(e.deck).length&&-1!==a.inArray(b.originalTarget.nodeName.toLowerCase(),["input","select","option","textarea"])&&(g=!0),g!==!0){var h,i=!1;if(e.options.continueScrolling===!0&&(e.current+1===1?h=!0:e.current+1===e.slides.length&&(i=!0)),f>0){if(b.preventDefault(),c.pauseAutoPlay=!0,i)return c.next(),!1;e.next()}else{if(b.preventDefault(),c.pauseAutoPlay=!0,h)return c.prev(),!1;e.prev()}}}})}};if(k>0)p();else{var q;q=setInterval(function(){b=a(b),f=b.children(),h=f.length,i=b.parents("dd.slide"),j=b.parent(),k=i.innerHeight(),k>0&&(clearInterval(q),p())},20)}},H=function(){j=b.height(),i=b.width(),b.css("height",j+"px"),k=0,l=0,d.options.hideSpines!==!0&&d.spines.length>0&&(k=a(d.spines[0]).height(),l=a(d.spines[0]).outerHeight()),m=i-l*d.spines.length,d.options.hideSpines===!0&&(m=i),n=Math.ceil(k/2)},I=function(a){if(d.browser.opera&&d.browser.version<"10.5"||d.browser.msie6||d.browser.firefox2||d.browser.firefox30)return"undefined"!=typeof console&&"function"==typeof console.error&&console.error("This web browser is not supported by SlideDeck. Please view this page in a modern, CSS3 capable browser or a current version of Internet Explorer"),!1;if("undefined"!=typeof a)for(var c in a)d.options[c]=a[c];switch(d.spines.length<1&&(d.options.hideSpines=!0),d.browser._this){case"msie":case"msie7":case"msie8":case"msie9":case"msie10":switch(d.options.slideTransition){case"flip":case"flipHorizontal":d.options.slideTransition="fade"}}switch(d.options.slideTransition){case"flip":case"flipHorizontal":case"fade":case"stack":d.options.hideSpines=!0}if(d.options.hideSpines===!0&&(d.options.activeCorner=!1),d.current=Math.min(d.slides.length,Math.max(1,d.options.start)),b.height()>0)H(),w();else{var e;e=setTimeout(function(){H(),b.height()>0&&(clearInterval(e),H(),w())},20)}},J=function(a){var b;b=setInterval(function(){d.isLoaded===!0&&(clearInterval(b),a(d))},20)};this.loaded=function(a){return J(a),d},this.next=function(a){var b=Math.min(d.slides.length,d.current+1);return d.options.cycle===!0&&d.current+1>d.slides.length&&(b=1),C(b,a),d},this.prev=function(a){var b=Math.max(1,d.current-1);return d.options.cycle===!0&&d.current-1<1&&(b=d.slides.length),C(b,a),d},this.goTo=function(b,c){if(d.pauseAutoPlay=!0,"string"==typeof b){":first"===b?b=d.slides.filter(":first"):":last"===b?b=d.slides.filter(":last"):b.match(/^\#/)||(b="#"+b);var e=d.slides.index(a(b));if(-1===e)return!1;b=e+1}return C(Math.min(d.slides.length,Math.max(1,b)),c),d},this.progressTo=function(a,b){return d.pauseAutoPlay=!0,d.updateControlTo(a),d.goTo(a,b),d},this.updateControlTo=function(a){return d.controlTo=a,s(),d},this.disableSlide=function(a){return E(a),d},this.enableSlide=function(a){return F(a),d},this.setOption=function(a,b){return D(a,b),d},this.vertical=function(b){if("undefined"!=typeof this.verticalSlides)return this.verticalSlides[this.current-1];this.verticalSlides={};for(var c=0;c1?b:b[0]}}(jQuery);