1/*! jQuery v1.11.1 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */
vendor: 95,707 bytes, lines 2-5
2 3!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l="1.11.1",m=function(a,b){return new m.fn.init(a,b)},n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=/^-ms-/,p=/-([\da-z])/gi,q=function(a,b){return b.toUpperCase()};m.fn=m.prototype={jquery:l,constructor:m,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=m.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return m.each(this,a,b)},map:function(a){return this.pushStack(m.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},m.extend=m.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||m.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(m.isPlainObject(c)||(b=m.isArray(c)))?(b?(b=!1,f=a&&m.isArray(a)?a:[]):f=a&&m.isPlainObject(a)?a:{},g[d]=m.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},m.extend({expando:"jQuery"+(l+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===m.type(a)},isArray:Array.isArray||function(a){return"array"===m.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return!m.isArray(a)&&a-parseFloat(a)>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==m.type(a)||a.nodeType||m.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(k.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&m.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(o,"ms-").replace(p,q)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=r(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(n,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(r(Object(a))?m.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=r(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),m.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||m.guid++,e):void 0},now:function(){return+new Date},support:k}),m.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function r(a){var b=a.length,c=m.type(a);return"function"===c||m.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var s=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+-new Date,v=a.document,w=0,x=0,y=gb(),z=gb(),A=gb(),B=function(a,b){return a===b&&(l=!0),0},C="undefined",D=1<<31,E={}.hasOwnProperty,F=[],G=F.pop,H=F.push,I=F.push,J=F.slice,K=F.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},L="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",N="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=N.replace("w","w#"),P="\\["+M+"*("+N+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+O+"))|)"+M+"*\\]",Q=":("+N+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+P+")*)|.*)\\)|)",R=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),S=new RegExp("^"+M+"*,"+M+"*"),T=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),V=new RegExp(Q),W=new RegExp("^"+O+"$"),X={ID:new RegExp("^#("+N+")"),CLASS:new RegExp("^\\.("+N+")"),TAG:new RegExp("^("+N.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+Q),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+L+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ab=/[+~]/,bb=/'|\\/g,cb=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),db=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{I.apply(F=J.call(v.childNodes),v.childNodes),F[v.childNodes.length].nodeType}catch(eb){I={apply:F.length?function(a,b){H.apply(a,J.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fb(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],!a||"string"!=typeof a)return d;if(1!==(k=b.nodeType)&&9!==k)return[];if(p&&!e){if(f=_.exec(a))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return I.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return I.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=9===k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(bb,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+qb(o[l]);w=ab.test(a)&&ob(b.parentNode)||b,x=o.join(",")}if(x)try{return I.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function gb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function hb(a){return a[u]=!0,a}function ib(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function jb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function kb(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||D)-(~a.sourceIndex||D);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function lb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function mb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function nb(a){return hb(function(b){return b=+b,hb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function ob(a){return a&&typeof a.getElementsByTagName!==C&&a}c=fb.support={},f=fb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fb.setDocument=function(a){var b,e=a?a.ownerDocument||a:v,g=e.defaultView;return e!==n&&9===e.nodeType&&e.documentElement?(n=e,o=e.documentElement,p=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){m()},!1):g.attachEvent&&g.attachEvent("onunload",function(){m()})),c.attributes=ib(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ib(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(e.getElementsByClassName)&&ib(function(a){return a.innerHTML="<div class='a'></div><div class='a i'></div>",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=ib(function(a){return o.appendChild(a).id=u,!e.getElementsByName||!e.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==C&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){var c=typeof a.getAttributeNode!==C&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==C?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==C&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(e.querySelectorAll))&&(ib(function(a){a.innerHTML="<select msallowclip=''><option selected=''></option></select>",a.querySelectorAll("[msallowclip^='']").length&&q.push("[*^$]="+M+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+M+"*(?:value|"+L+")"),a.querySelectorAll(":checked").length||q.push(":checked")}),ib(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+M+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ib(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",Q)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===v&&t(v,a)?-1:b===e||b.ownerDocument===v&&t(v,b)?1:k?K.call(k,a)-K.call(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],i=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:k?K.call(k,a)-K.call(k,b):0;if(f===g)return kb(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?kb(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},e):n},fb.matches=function(a,b){return fb(a,null,null,b)},fb.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fb(b,n,null,[a]).length>0},fb.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fb.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&E.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fb.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fb.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fb.selectors={cacheLength:50,createPseudo:hb,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(cb,db),a[3]=(a[3]||a[4]||a[5]||"").replace(cb,db),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fb.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fb.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(cb,db).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+M+")"+a+"("+M+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==C&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fb.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fb.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?hb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=K.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:hb(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?hb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:hb(function(a){return function(b){return fb(a,b).length>0}}),contains:hb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:hb(function(a){return W.test(a||"")||fb.error("unsupported lang: "+a),a=a.replace(cb,db).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:nb(function(){return[0]}),last:nb(function(a,b){return[b-1]}),eq:nb(function(a,b,c){return[0>c?c+b:c]}),even:nb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:nb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:nb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:nb(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=lb(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=mb(b);function pb(){}pb.prototype=d.filters=d.pseudos,d.setFilters=new pb,g=fb.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=S.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=T.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(R," ")}),h=h.slice(c.length));for(g in d.filter)!(e=X[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?fb.error(a):z(a,i).slice(0)};function qb(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function rb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function sb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function tb(a,b,c){for(var d=0,e=b.length;e>d;d++)fb(a,b[d],c);return c}function ub(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function vb(a,b,c,d,e,f){return d&&!d[u]&&(d=vb(d)),e&&!e[u]&&(e=vb(e,f)),hb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||tb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ub(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ub(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?K.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ub(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):I.apply(g,r)})}function wb(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=rb(function(a){return a===b},h,!0),l=rb(function(a){return K.call(b,a)>-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>i;i++)if(c=d.relative[a[i].type])m=[rb(sb(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return vb(i>1&&sb(m),i>1&&qb(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&wb(a.slice(i,e)),f>e&&wb(a=a.slice(e)),f>e&&qb(a))}m.push(c)}return sb(m)}function xb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=G.call(i));s=ub(s)}I.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&fb.uniqueSort(i)}return k&&(w=v,j=t),r};return c?hb(f):f}return h=fb.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wb(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xb(e,d)),f.selector=a}return f},i=fb.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(cb,db),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(cb,db),ab.test(j[0].type)&&ob(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qb(j),!a)return I.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,ab.test(a)&&ob(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ib(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ib(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||jb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ib(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||jb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ib(function(a){return null==a.getAttribute("disabled")})||jb(L,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fb}(a);m.find=s,m.expr=s.selectors,m.expr[":"]=m.expr.pseudos,m.unique=s.uniqueSort,m.text=s.getText,m.isXMLDoc=s.isXML,m.contains=s.contains;var t=m.expr.match.needsContext,u=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,v=/^.[^:#\[\.,]*$/;function w(a,b,c){if(m.isFunction(b))return m.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return m.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(v.test(b))return m.filter(b,a,c);b=m.filter(b,a)}return m.grep(a,function(a){return m.inArray(a,b)>=0!==c})}m.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?m.find.matchesSelector(d,a)?[d]:[]:m.find.matches(a,m.grep(b,function(a){return 1===a.nodeType}))},m.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(m(a).filter(function(){for(b=0;e>b;b++)if(m.contains(d[b],this))return!0}));for(b=0;e>b;b++)m.find(a,d[b],c);return c=this.pushStack(e>1?m.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(w(this,a||[],!1))},not:function(a){return this.pushStack(w(this,a||[],!0))},is:function(a){return!!w(this,"string"==typeof a&&t.test(a)?m(a):a||[],!1).length}});var x,y=a.document,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=m.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||x).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof m?b[0]:b,m.merge(this,m.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:y,!0)),u.test(c[1])&&m.isPlainObject(b))for(c in b)m.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=y.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return x.find(a);this.length=1,this[0]=d}return this.context=y,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):m.isFunction(a)?"undefined"!=typeof x.ready?x.ready(a):a(m):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),m.makeArray(a,this))};A.prototype=m.fn,x=m(y);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};m.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!m(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),m.fn.extend({has:function(a){var b,c=m(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(m.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=t.test(a)||"string"!=typeof a?m(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&m.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?m.unique(f):f)},index:function(a){return a?"string"==typeof a?m.inArray(this[0],m(a)):m.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(m.unique(m.merge(this.get(),m(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}m.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return m.dir(a,"parentNode")},parentsUntil:function(a,b,c){return m.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return m.dir(a,"nextSibling")},prevAll:function(a){return m.dir(a,"previousSibling")},nextUntil:function(a,b,c){return m.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return m.dir(a,"previousSibling",c)},siblings:function(a){return m.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return m.sibling(a.firstChild)},contents:function(a){return m.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:m.merge([],a.childNodes)}},function(a,b){m.fn[a]=function(c,d){var e=m.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=m.filter(d,e)),this.length>1&&(C[a]||(e=m.unique(e)),B.test(a)&&(e=e.reverse())),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return m.each(a.match(E)||[],function(a,c){b[c]=!0}),b}m.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):m.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){m.each(b,function(b,c){var d=m.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&m.each(arguments,function(a,c){var d;while((d=m.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?m.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},m.extend({Deferred:function(a){var b=[["resolve","done",m.Callbacks("once memory"),"resolved"],["reject","fail",m.Callbacks("once memory"),"rejected"],["notify","progress",m.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return m.Deferred(function(c){m.each(b,function(b,f){var g=m.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&m.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?m.extend(a,d):d}},e={};return d.pipe=d.then,m.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&m.isFunction(a.promise)?e:0,g=1===f?a:m.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&m.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;m.fn.ready=function(a){return m.ready.promise().done(a),this},m.extend({isReady:!1,readyWait:1,holdReady:function(a){a?m.readyWait++:m.ready(!0)},ready:function(a){if(a===!0?!--m.readyWait:!m.isReady){if(!y.body)return setTimeout(m.ready);m.isReady=!0,a!==!0&&--m.readyWait>0||(H.resolveWith(y,[m]),m.fn.triggerHandler&&(m(y).triggerHandler("ready"),m(y).off("ready")))}}});function I(){y.addEventListener?(y.removeEventListener("DOMContentLoaded",J,!1),a.removeEventListener("load",J,!1)):(y.detachEvent("onreadystatechange",J),a.detachEvent("onload",J))}function J(){(y.addEventListener||"load"===event.type||"complete"===y.readyState)&&(I(),m.ready())}m.ready.promise=function(b){if(!H)if(H=m.Deferred(),"complete"===y.readyState)setTimeout(m.ready);else if(y.addEventListener)y.addEventListener("DOMContentLoaded",J,!1),a.addEventListener("load",J,!1);else{y.attachEvent("onreadystatechange",J),a.attachEvent("onload",J);var c=!1;try{c=null==a.frameElement&&y.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!m.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}I(),m.ready()}}()}return H.promise(b)};var K="undefined",L;for(L in m(k))break;k.ownLast="0"!==L,k.inlineBlockNeedsLayout=!1,m(function(){var a,b,c,d;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",k.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(d))}),function(){var a=y.createElement("div");if(null==k.deleteExpando){k.deleteExpando=!0;try{delete a.test}catch(b){k.deleteExpando=!1}}a=null}(),m.acceptData=function(a){var b=m.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var M=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,N=/([A-Z])/g;function O(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(N,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:M.test(c)?m.parseJSON(c):c}catch(e){}m.data(a,b,c)}else c=void 0}return c}function P(a){var b;for(b in a)if(("data"!==b||!m.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function Q(a,b,d,e){if(m.acceptData(a)){var f,g,h=m.expando,i=a.nodeType,j=i?m.cache:a,k=i?a[h]:a[h]&&h; 4if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||m.guid++:h),j[k]||(j[k]=i?{}:{toJSON:m.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=m.extend(j[k],b):j[k].data=m.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[m.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[m.camelCase(b)])):f=g,f}}function R(a,b,c){if(m.acceptData(a)){var d,e,f=a.nodeType,g=f?m.cache:a,h=f?a[m.expando]:m.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){m.isArray(b)?b=b.concat(m.map(b,m.camelCase)):b in d?b=[b]:(b=m.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!P(d):!m.isEmptyObject(d))return}(c||(delete g[h].data,P(g[h])))&&(f?m.cleanData([a],!0):k.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}m.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?m.cache[a[m.expando]]:a[m.expando],!!a&&!P(a)},data:function(a,b,c){return Q(a,b,c)},removeData:function(a,b){return R(a,b)},_data:function(a,b,c){return Q(a,b,c,!0)},_removeData:function(a,b){return R(a,b,!0)}}),m.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=m.data(f),1===f.nodeType&&!m._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=m.camelCase(d.slice(5)),O(f,d,e[d])));m._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){m.data(this,a)}):arguments.length>1?this.each(function(){m.data(this,a,b)}):f?O(f,a,m.data(f,a)):void 0},removeData:function(a){return this.each(function(){m.removeData(this,a)})}}),m.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=m._data(a,b),c&&(!d||m.isArray(c)?d=m._data(a,b,m.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=m.queue(a,b),d=c.length,e=c.shift(),f=m._queueHooks(a,b),g=function(){m.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return m._data(a,c)||m._data(a,c,{empty:m.Callbacks("once memory").add(function(){m._removeData(a,b+"queue"),m._removeData(a,c)})})}}),m.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?m.queue(this[0],a):void 0===b?this:this.each(function(){var c=m.queue(this,a,b);m._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&m.dequeue(this,a)})},dequeue:function(a){return this.each(function(){m.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=m.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=m._data(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var S=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=["Top","Right","Bottom","Left"],U=function(a,b){return a=b||a,"none"===m.css(a,"display")||!m.contains(a.ownerDocument,a)},V=m.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===m.type(c)){e=!0;for(h in c)m.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,m.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(m(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},W=/^(?:checkbox|radio)$/i;!function(){var a=y.createElement("input"),b=y.createElement("div"),c=y.createDocumentFragment();if(b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",k.leadingWhitespace=3===b.firstChild.nodeType,k.tbody=!b.getElementsByTagName("tbody").length,k.htmlSerialize=!!b.getElementsByTagName("link").length,k.html5Clone="<:nav></:nav>"!==y.createElement("nav").cloneNode(!0).outerHTML,a.type="checkbox",a.checked=!0,c.appendChild(a),k.appendChecked=a.checked,b.innerHTML="<textarea>x</textarea>",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,c.appendChild(b),b.innerHTML="<input type='radio' checked='checked' name='t'/>",k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,k.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){k.noCloneEvent=!1}),b.cloneNode(!0).click()),null==k.deleteExpando){k.deleteExpando=!0;try{delete b.test}catch(d){k.deleteExpando=!1}}}(),function(){var b,c,d=y.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(k[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),k[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var X=/^(?:input|select|textarea)$/i,Y=/^key/,Z=/^(?:mouse|pointer|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=/^([^.]*)(?:\.(.+)|)$/;function ab(){return!0}function bb(){return!1}function cb(){try{return y.activeElement}catch(a){}}m.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=m.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof m===K||a&&m.event.triggered===a.type?void 0:m.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(E)||[""],h=b.length;while(h--)f=_.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=m.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=m.event.special[o]||{},l=m.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&m.expr.match.needsContext.test(e),namespace:p.join(".")},i),(n=g[o])||(n=g[o]=[],n.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?n.splice(n.delegateCount++,0,l):n.push(l),m.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m.hasData(a)&&m._data(a);if(r&&(k=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=_.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=m.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,n=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=n.length;while(f--)g=n[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(n.splice(f,1),g.selector&&n.delegateCount--,l.remove&&l.remove.call(a,g));i&&!n.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||m.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)m.event.remove(a,o+b[j],c,d,!0);m.isEmptyObject(k)&&(delete r.handle,m._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,n,o=[d||y],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||y,3!==d.nodeType&&8!==d.nodeType&&!$.test(p+m.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[m.expando]?b:new m.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:m.makeArray(c,[b]),k=m.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!m.isWindow(d)){for(i=k.delegateType||p,$.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||y)&&o.push(l.defaultView||l.parentWindow||a)}n=0;while((h=o[n++])&&!b.isPropagationStopped())b.type=n>1?i:k.bindType||p,f=(m._data(h,"events")||{})[b.type]&&m._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&m.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&m.acceptData(d)&&g&&d[p]&&!m.isWindow(d)){l=d[g],l&&(d[g]=null),m.event.triggered=p;try{d[p]()}catch(r){}m.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=m.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(m._data(this,"events")||{})[a.type]||[],k=m.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=m.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((m.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?m(c,this).index(i)>=0:m.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},fix:function(a){if(a[m.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=Z.test(e)?this.mouseHooks:Y.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new m.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=f.srcElement||y),3===a.target.nodeType&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,g.filter?g.filter(a,f):a},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button,g=b.fromElement;return null==a.pageX&&null!=b.clientX&&(d=a.target.ownerDocument||y,e=d.documentElement,c=d.body,a.pageX=b.clientX+(e&&e.scrollLeft||c&&c.scrollLeft||0)-(e&&e.clientLeft||c&&c.clientLeft||0),a.pageY=b.clientY+(e&&e.scrollTop||c&&c.scrollTop||0)-(e&&e.clientTop||c&&c.clientTop||0)),!a.relatedTarget&&g&&(a.relatedTarget=g===a.target?b.toElement:g),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==cb()&&this.focus)try{return this.focus(),!1}catch(a){}},delegateType:"focusin"},blur:{trigger:function(){return this===cb()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return m.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(a){return m.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=m.extend(new m.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?m.event.trigger(e,null,b):m.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},m.removeEvent=y.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){var d="on"+b;a.detachEvent&&(typeof a[d]===K&&(a[d]=null),a.detachEvent(d,c))},m.Event=function(a,b){return this instanceof m.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?ab:bb):this.type=a,b&&m.extend(this,b),this.timeStamp=a&&a.timeStamp||m.now(),void(this[m.expando]=!0)):new m.Event(a,b)},m.Event.prototype={isDefaultPrevented:bb,isPropagationStopped:bb,isImmediatePropagationStopped:bb,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=ab,a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=ab,a&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=ab,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},m.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){m.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!m.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),k.submitBubbles||(m.event.special.submit={setup:function(){return m.nodeName(this,"form")?!1:void m.event.add(this,"click._submit keypress._submit",function(a){var b=a.target,c=m.nodeName(b,"input")||m.nodeName(b,"button")?b.form:void 0;c&&!m._data(c,"submitBubbles")&&(m.event.add(c,"submit._submit",function(a){a._submit_bubble=!0}),m._data(c,"submitBubbles",!0))})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&m.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){return m.nodeName(this,"form")?!1:void m.event.remove(this,"._submit")}}),k.changeBubbles||(m.event.special.change={setup:function(){return X.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(m.event.add(this,"propertychange._change",function(a){"checked"===a.originalEvent.propertyName&&(this._just_changed=!0)}),m.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1),m.event.simulate("change",this,a,!0)})),!1):void m.event.add(this,"beforeactivate._change",function(a){var b=a.target;X.test(b.nodeName)&&!m._data(b,"changeBubbles")&&(m.event.add(b,"change._change",function(a){!this.parentNode||a.isSimulated||a.isTrigger||m.event.simulate("change",this.parentNode,a,!0)}),m._data(b,"changeBubbles",!0))})},handle:function(a){var b=a.target;return this!==b||a.isSimulated||a.isTrigger||"radio"!==b.type&&"checkbox"!==b.type?a.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return m.event.remove(this,"._change"),!X.test(this.nodeName)}}),k.focusinBubbles||m.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){m.event.simulate(b,a.target,m.event.fix(a),!0)};m.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=m._data(d,b);e||d.addEventListener(a,c,!0),m._data(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=m._data(d,b)-1;e?m._data(d,b,e):(d.removeEventListener(a,c,!0),m._removeData(d,b))}}}),m.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(f in a)this.on(f,b,c,a[f],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=bb;else if(!d)return this;return 1===e&&(g=d,d=function(a){return m().off(a),g.apply(this,arguments)},d.guid=g.guid||(g.guid=m.guid++)),this.each(function(){m.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,m(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=bb),this.each(function(){m.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){m.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?m.event.trigger(a,b,c,!0):void 0}});function db(a){var b=eb.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}var eb="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",fb=/ jQuery\d+="(?:null|\d+)"/g,gb=new RegExp("<(?:"+eb+")[\\s/>]","i"),hb=/^\s+/,ib=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,jb=/<([\w:]+)/,kb=/<tbody/i,lb=/<|&#?\w+;/,mb=/<(?:script|style|link)/i,nb=/checked\s*(?:[^=]|=\s*.checked.)/i,ob=/^$|\/(?:java|ecma)script/i,pb=/^true\/(.*)/,qb=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,rb={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:k.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},sb=db(y),tb=sb.appendChild(y.createElement("div"));rb.optgroup=rb.option,rb.tbody=rb.tfoot=rb.colgroup=rb.caption=rb.thead,rb.th=rb.td;function ub(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==K?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==K?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||m.nodeName(d,b)?f.push(d):m.merge(f,ub(d,b));return void 0===b||b&&m.nodeName(a,b)?m.merge([a],f):f}function vb(a){W.test(a.type)&&(a.defaultChecked=a.checked)}function wb(a,b){return m.nodeName(a,"table")&&m.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function xb(a){return a.type=(null!==m.find.attr(a,"type"))+"/"+a.type,a}function yb(a){var b=pb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function zb(a,b){for(var c,d=0;null!=(c=a[d]);d++)m._data(c,"globalEval",!b||m._data(b[d],"globalEval"))}function Ab(a,b){if(1===b.nodeType&&m.hasData(a)){var c,d,e,f=m._data(a),g=m._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)m.event.add(b,c,h[c][d])}g.data&&(g.data=m.extend({},g.data))}}function Bb(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!k.noCloneEvent&&b[m.expando]){e=m._data(b);for(d in e.events)m.removeEvent(b,d,e.handle);b.removeAttribute(m.expando)}"script"===c&&b.text!==a.text?(xb(b).text=a.text,yb(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),k.html5Clone&&a.innerHTML&&!m.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&W.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}m.extend({clone:function(a,b,c){var d,e,f,g,h,i=m.contains(a.ownerDocument,a);if(k.html5Clone||m.isXMLDoc(a)||!gb.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(tb.innerHTML=a.outerHTML,tb.removeChild(f=tb.firstChild)),!(k.noCloneEvent&&k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||m.isXMLDoc(a)))for(d=ub(f),h=ub(a),g=0;null!=(e=h[g]);++g)d[g]&&Bb(e,d[g]);if(b)if(c)for(h=h||ub(a),d=d||ub(f),g=0;null!=(e=h[g]);g++)Ab(e,d[g]);else Ab(a,f);return d=ub(f,"script"),d.length>0&&zb(d,!i&&ub(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,l,n=a.length,o=db(b),p=[],q=0;n>q;q++)if(f=a[q],f||0===f)if("object"===m.type(f))m.merge(p,f.nodeType?[f]:f);else if(lb.test(f)){h=h||o.appendChild(b.createElement("div")),i=(jb.exec(f)||["",""])[1].toLowerCase(),l=rb[i]||rb._default,h.innerHTML=l[1]+f.replace(ib,"<$1></$2>")+l[2],e=l[0];while(e--)h=h.lastChild;if(!k.leadingWhitespace&&hb.test(f)&&p.push(b.createTextNode(hb.exec(f)[0])),!k.tbody){f="table"!==i||kb.test(f)?"<table>"!==l[1]||kb.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)m.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}m.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),k.appendChecked||m.grep(ub(p,"input"),vb),q=0;while(f=p[q++])if((!d||-1===m.inArray(f,d))&&(g=m.contains(f.ownerDocument,f),h=ub(o.appendChild(f),"script"),g&&zb(h),c)){e=0;while(f=h[e++])ob.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=m.expando,j=m.cache,l=k.deleteExpando,n=m.event.special;null!=(d=a[h]);h++)if((b||m.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)n[e]?m.event.remove(d,e):m.removeEvent(d,e,g.handle);j[f]&&(delete j[f],l?delete d[i]:typeof d.removeAttribute!==K?d.removeAttribute(i):d[i]=null,c.push(f))}}}),m.fn.extend({text:function(a){return V(this,function(a){return void 0===a?m.text(this):this.empty().append((this[0]&&this[0].ownerDocument||y).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?m.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||m.cleanData(ub(c)),c.parentNode&&(b&&m.contains(c.ownerDocument,c)&&zb(ub(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&m.cleanData(ub(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&m.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return m.clone(this,a,b)})},html:function(a){return V(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(fb,""):void 0;if(!("string"!=typeof a||mb.test(a)||!k.htmlSerialize&&gb.test(a)||!k.leadingWhitespace&&hb.test(a)||rb[(jb.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(ib,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(m.cleanData(ub(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,m.cleanData(ub(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,n=this,o=l-1,p=a[0],q=m.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&nb.test(p))return this.each(function(c){var d=n.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(i=m.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=m.map(ub(i,"script"),xb),f=g.length;l>j;j++)d=i,j!==o&&(d=m.clone(d,!0,!0),f&&m.merge(g,ub(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,m.map(g,yb),j=0;f>j;j++)d=g[j],ob.test(d.type||"")&&!m._data(d,"globalEval")&&m.contains(h,d)&&(d.src?m._evalUrl&&m._evalUrl(d.src):m.globalEval((d.text||d.textContent||d.innerHTML||"").replace(qb,"")));i=c=null}return this}}),m.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){m.fn[a]=function(a){for(var c,d=0,e=[],g=m(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),m(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Cb,Db={};function Eb(b,c){var d,e=m(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:m.css(e[0],"display");return e.detach(),f}function Fb(a){var b=y,c=Db[a];return c||(c=Eb(a,b),"none"!==c&&c||(Cb=(Cb||m("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=(Cb[0].contentWindow||Cb[0].contentDocument).document,b.write(),b.close(),c=Eb(a,b),Cb.detach()),Db[a]=c),c}!function(){var a;k.shrinkWrapBlocks=function(){if(null!=a)return a;a=!1;var b,c,d;return c=y.getElementsByTagName("body")[0],c&&c.style?(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",b.appendChild(y.createElement("div")).style.width="5px",a=3!==b.offsetWidth),c.removeChild(d),a):void 0}}();var Gb=/^margin/,Hb=new RegExp("^("+S+")(?!px)[a-z%]+$","i"),Ib,Jb,Kb=/^(top|right|bottom|left)$/;a.getComputedStyle?(Ib=function(a){return a.ownerDocument.defaultView.getComputedStyle(a,null)},Jb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ib(a),g=c?c.getPropertyValue(b)||c[b]:void 0,c&&(""!==g||m.contains(a.ownerDocument,a)||(g=m.style(a,b)),Hb.test(g)&&Gb.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0===g?g:g+""}):y.documentElement.currentStyle&&(Ib=function(a){return a.currentStyle},Jb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ib(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Hb.test(g)&&!Kb.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left="fontSize"===b?"1em":g,g=h.pixelLeft+"px",h.left=d,f&&(e.left=f)),void 0===g?g:g+""||"auto"});function Lb(a,b){return{get:function(){var c=a();if(null!=c)return c?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d,e,f,g,h;if(b=y.createElement("div"),b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",d=b.getElementsByTagName("a")[0],c=d&&d.style){c.cssText="float:left;opacity:.5",k.opacity="0.5"===c.opacity,k.cssFloat=!!c.cssFloat,b.style.backgroundClip="content-box",b.cloneNode(!0).style.backgroundClip="",k.clearCloneStyle="content-box"===b.style.backgroundClip,k.boxSizing=""===c.boxSizing||""===c.MozBoxSizing||""===c.WebkitBoxSizing,m.extend(k,{reliableHiddenOffsets:function(){return null==g&&i(),g},boxSizingReliable:function(){return null==f&&i(),f},pixelPosition:function(){return null==e&&i(),e},reliableMarginRight:function(){return null==h&&i(),h}});function i(){var b,c,d,i;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),b.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",e=f=!1,h=!0,a.getComputedStyle&&(e="1%"!==(a.getComputedStyle(b,null)||{}).top,f="4px"===(a.getComputedStyle(b,null)||{width:"4px"}).width,i=b.appendChild(y.createElement("div")),i.style.cssText=b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",i.style.marginRight=i.style.width="0",b.style.width="1px",h=!parseFloat((a.getComputedStyle(i,null)||{}).marginRight)),b.innerHTML="<table><tr><td></td><td>t</td></tr></table>",i=b.getElementsByTagName("td"),i[0].style.cssText="margin:0;border:0;padding:0;display:none",g=0===i[0].offsetHeight,g&&(i[0].style.display="",i[1].style.display="none",g=0===i[0].offsetHeight),c.removeChild(d))}}}(),m.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var Mb=/alpha\([^)]*\)/i,Nb=/opacity\s*=\s*([^)]*)/,Ob=/^(none|table(?!-c[ea]).+)/,Pb=new RegExp("^("+S+")(.*)$","i"),Qb=new RegExp("^([+-])=("+S+")","i"),Rb={position:"absolute",visibility:"hidden",display:"block"},Sb={letterSpacing:"0",fontWeight:"400"},Tb=["Webkit","O","Moz","ms"];function Ub(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=Tb.length;while(e--)if(b=Tb[e]+c,b in a)return b;return d}function Vb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=m._data(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&U(d)&&(f[g]=m._data(d,"olddisplay",Fb(d.nodeName)))):(e=U(d),(c&&"none"!==c||!e)&&m._data(d,"olddisplay",e?c:m.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function Wb(a,b,c){var d=Pb.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Xb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=m.css(a,c+T[f],!0,e)),d?("content"===c&&(g-=m.css(a,"padding"+T[f],!0,e)),"margin"!==c&&(g-=m.css(a,"border"+T[f]+"Width",!0,e))):(g+=m.css(a,"padding"+T[f],!0,e),"padding"!==c&&(g+=m.css(a,"border"+T[f]+"Width",!0,e)));return g}function Yb(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=Ib(a),g=k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=Jb(a,b,f),(0>e||null==e)&&(e=a.style[b]),Hb.test(e))return e;d=g&&(k.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Xb(a,b,c||(g?"border":"content"),d,f)+"px"}m.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Jb(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":k.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=m.camelCase(b),i=a.style;if(b=m.cssProps[h]||(m.cssProps[h]=Ub(i,h)),g=m.cssHooks[b]||m.cssHooks[h],void 0===c)return g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b];if(f=typeof c,"string"===f&&(e=Qb.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(m.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||m.cssNumber[h]||(c+="px"),k.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),!(g&&"set"in g&&void 0===(c=g.set(a,c,d)))))try{i[b]=c}catch(j){}}},css:function(a,b,c,d){var e,f,g,h=m.camelCase(b);return b=m.cssProps[h]||(m.cssProps[h]=Ub(a.style,h)),g=m.cssHooks[b]||m.cssHooks[h],g&&"get"in g&&(f=g.get(a,!0,c)),void 0===f&&(f=Jb(a,b,d)),"normal"===f&&b in Sb&&(f=Sb[b]),""===c||c?(e=parseFloat(f),c===!0||m.isNumeric(e)?e||0:f):f}}),m.each(["height","width"],function(a,b){m.cssHooks[b]={get:function(a,c,d){return c?Ob.test(m.css(a,"display"))&&0===a.offsetWidth?m.swap(a,Rb,function(){return Yb(a,b,d)}):Yb(a,b,d):void 0},set:function(a,c,d){var e=d&&Ib(a);return Wb(a,c,d?Xb(a,b,d,k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,e),e):0)}}}),k.opacity||(m.cssHooks.opacity={get:function(a,b){return Nb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=m.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,(b>=1||""===b)&&""===m.trim(f.replace(Mb,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=Mb.test(f)?f.replace(Mb,e):f+" "+e)}}),m.cssHooks.marginRight=Lb(k.reliableMarginRight,function(a,b){return b?m.swap(a,{display:"inline-block"},Jb,[a,"marginRight"]):void 0}),m.each({margin:"",padding:"",border:"Width"},function(a,b){m.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+T[d]+b]=f[d]||f[d-2]||f[0];return e}},Gb.test(a)||(m.cssHooks[a+b].set=Wb)}),m.fn.extend({css:function(a,b){return V(this,function(a,b,c){var d,e,f={},g=0;if(m.isArray(b)){for(d=Ib(a),e=b.length;e>g;g++)f[b[g]]=m.css(a,b[g],!1,d);return f}return void 0!==c?m.style(a,b,c):m.css(a,b)},a,b,arguments.length>1)},show:function(){return Vb(this,!0)},hide:function(){return Vb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){U(this)?m(this).show():m(this).hide()})}});function Zb(a,b,c,d,e){return new Zb.prototype.init(a,b,c,d,e)}m.Tween=Zb,Zb.prototype={constructor:Zb,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(m.cssNumber[c]?"":"px") 5},cur:function(){var a=Zb.propHooks[this.prop];return a&&a.get?a.get(this):Zb.propHooks._default.get(this)},run:function(a){var b,c=Zb.propHooks[this.prop];return this.pos=b=this.options.duration?m.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Zb.propHooks._default.set(this),this}},Zb.prototype.init.prototype=Zb.prototype,Zb.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=m.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){m.fx.step[a.prop]?m.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[m.cssProps[a.prop]]||m.cssHooks[a.prop])?m.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Zb.propHooks.scrollTop=Zb.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},m.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},m.fx=Zb.prototype.init,m.fx.step={};var $b,_b,ac=/^(?:toggle|show|hide)$/,bc=new RegExp("^(?:([+-])=|)("+S+")([a-z%]*)$","i"),cc=/queueHooks$/,dc=[ic],ec={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=bc.exec(b),f=e&&e[3]||(m.cssNumber[a]?"":"px"),g=(m.cssNumber[a]||"px"!==f&&+d)&&bc.exec(m.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,m.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function fc(){return setTimeout(function(){$b=void 0}),$b=m.now()}function gc(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=T[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function hc(a,b,c){for(var d,e=(ec[b]||[]).concat(ec["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function ic(a,b,c){var d,e,f,g,h,i,j,l,n=this,o={},p=a.style,q=a.nodeType&&U(a),r=m._data(a,"fxshow");c.queue||(h=m._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,n.always(function(){n.always(function(){h.unqueued--,m.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=m.css(a,"display"),l="none"===j?m._data(a,"olddisplay")||Fb(a.nodeName):j,"inline"===l&&"none"===m.css(a,"float")&&(k.inlineBlockNeedsLayout&&"inline"!==Fb(a.nodeName)?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",k.shrinkWrapBlocks()||n.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],ac.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||m.style(a,d)}else j=void 0;if(m.isEmptyObject(o))"inline"===("none"===j?Fb(a.nodeName):j)&&(p.display=j);else{r?"hidden"in r&&(q=r.hidden):r=m._data(a,"fxshow",{}),f&&(r.hidden=!q),q?m(a).show():n.done(function(){m(a).hide()}),n.done(function(){var b;m._removeData(a,"fxshow");for(b in o)m.style(a,b,o[b])});for(d in o)g=hc(q?r[d]:0,d,n),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function jc(a,b){var c,d,e,f,g;for(c in a)if(d=m.camelCase(c),e=b[d],f=a[c],m.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=m.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function kc(a,b,c){var d,e,f=0,g=dc.length,h=m.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=$b||fc(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:m.extend({},b),opts:m.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:$b||fc(),duration:c.duration,tweens:[],createTween:function(b,c){var d=m.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(jc(k,j.opts.specialEasing);g>f;f++)if(d=dc[f].call(j,a,k,j.opts))return d;return m.map(k,hc,j),m.isFunction(j.opts.start)&&j.opts.start.call(a,j),m.fx.timer(m.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}m.Animation=m.extend(kc,{tweener:function(a,b){m.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],ec[c]=ec[c]||[],ec[c].unshift(b)},prefilter:function(a,b){b?dc.unshift(a):dc.push(a)}}),m.speed=function(a,b,c){var d=a&&"object"==typeof a?m.extend({},a):{complete:c||!c&&b||m.isFunction(a)&&a,duration:a,easing:c&&b||b&&!m.isFunction(b)&&b};return d.duration=m.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in m.fx.speeds?m.fx.speeds[d.duration]:m.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){m.isFunction(d.old)&&d.old.call(this),d.queue&&m.dequeue(this,d.queue)},d},m.fn.extend({fadeTo:function(a,b,c,d){return this.filter(U).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=m.isEmptyObject(a),f=m.speed(b,c,d),g=function(){var b=kc(this,m.extend({},a),f);(e||m._data(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=m.timers,g=m._data(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&cc.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&m.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=m._data(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=m.timers,g=d?d.length:0;for(c.finish=!0,m.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),m.each(["toggle","show","hide"],function(a,b){var c=m.fn[b];m.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(gc(b,!0),a,d,e)}}),m.each({slideDown:gc("show"),slideUp:gc("hide"),slideToggle:gc("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){m.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),m.timers=[],m.fx.tick=function(){var a,b=m.timers,c=0;for($b=m.now();c<b.length;c++)a=b[c],a()||b[c]!==a||b.splice(c--,1);b.length||m.fx.stop(),$b=void 0},m.fx.timer=function(a){m.timers.push(a),a()?m.fx.start():m.timers.pop()},m.fx.interval=13,m.fx.start=function(){_b||(_b=setInterval(m.fx.tick,m.fx.interval))},m.fx.stop=function(){clearInterval(_b),_b=null},m.fx.speeds={slow:600,fast:200,_default:400},m.fn.delay=function(a,b){return a=m.fx?m.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a,b,c,d,e;b=y.createElement("div"),b.setAttribute("className","t"),b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",d=b.getElementsByTagName("a")[0],c=y.createElement("select"),e=c.appendChild(y.createElement("option")),a=b.getElementsByTagName("input")[0],d.style.cssText="top:1px",k.getSetAttribute="t"!==b.className,k.style=/top/.test(d.getAttribute("style")),k.hrefNormalized="/a"===d.getAttribute("href"),k.checkOn=!!a.value,k.optSelected=e.selected,k.enctype=!!y.createElement("form").enctype,c.disabled=!0,k.optDisabled=!e.disabled,a=y.createElement("input"),a.setAttribute("value",""),k.input=""===a.getAttribute("value"),a.value="t",a.setAttribute("type","radio"),k.radioValue="t"===a.value}();var lc=/\r/g;m.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=m.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,m(this).val()):a,null==e?e="":"number"==typeof e?e+="":m.isArray(e)&&(e=m.map(e,function(a){return null==a?"":a+""})),b=m.valHooks[this.type]||m.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=m.valHooks[e.type]||m.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(lc,""):null==c?"":c)}}}),m.extend({valHooks:{option:{get:function(a){var b=m.find.attr(a,"value");return null!=b?b:m.trim(m.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(k.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&m.nodeName(c.parentNode,"optgroup"))){if(b=m(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=m.makeArray(b),g=e.length;while(g--)if(d=e[g],m.inArray(m.valHooks.option.get(d),f)>=0)try{d.selected=c=!0}catch(h){d.scrollHeight}else d.selected=!1;return c||(a.selectedIndex=-1),e}}}}),m.each(["radio","checkbox"],function(){m.valHooks[this]={set:function(a,b){return m.isArray(b)?a.checked=m.inArray(m(a).val(),b)>=0:void 0}},k.checkOn||(m.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var mc,nc,oc=m.expr.attrHandle,pc=/^(?:checked|selected)$/i,qc=k.getSetAttribute,rc=k.input;m.fn.extend({attr:function(a,b){return V(this,m.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){m.removeAttr(this,a)})}}),m.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===K?m.prop(a,b,c):(1===f&&m.isXMLDoc(a)||(b=b.toLowerCase(),d=m.attrHooks[b]||(m.expr.match.bool.test(b)?nc:mc)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=m.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void m.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType)while(c=f[e++])d=m.propFix[c]||c,m.expr.match.bool.test(c)?rc&&qc||!pc.test(c)?a[d]=!1:a[m.camelCase("default-"+c)]=a[d]=!1:m.attr(a,c,""),a.removeAttribute(qc?c:d)},attrHooks:{type:{set:function(a,b){if(!k.radioValue&&"radio"===b&&m.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),nc={set:function(a,b,c){return b===!1?m.removeAttr(a,c):rc&&qc||!pc.test(c)?a.setAttribute(!qc&&m.propFix[c]||c,c):a[m.camelCase("default-"+c)]=a[c]=!0,c}},m.each(m.expr.match.bool.source.match(/\w+/g),function(a,b){var c=oc[b]||m.find.attr;oc[b]=rc&&qc||!pc.test(b)?function(a,b,d){var e,f;return d||(f=oc[b],oc[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,oc[b]=f),e}:function(a,b,c){return c?void 0:a[m.camelCase("default-"+b)]?b.toLowerCase():null}}),rc&&qc||(m.attrHooks.value={set:function(a,b,c){return m.nodeName(a,"input")?void(a.defaultValue=b):mc&&mc.set(a,b,c)}}),qc||(mc={set:function(a,b,c){var d=a.getAttributeNode(c);return d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+="","value"===c||b===a.getAttribute(c)?b:void 0}},oc.id=oc.name=oc.coords=function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&""!==d.value?d.value:null},m.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);return c&&c.specified?c.value:void 0},set:mc.set},m.attrHooks.contenteditable={set:function(a,b,c){mc.set(a,""===b?!1:b,c)}},m.each(["width","height"],function(a,b){m.attrHooks[b]={set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}}})),k.style||(m.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+""}});var sc=/^(?:input|select|textarea|button|object)$/i,tc=/^(?:a|area)$/i;m.fn.extend({prop:function(a,b){return V(this,m.prop,a,b,arguments.length>1)},removeProp:function(a){return a=m.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),m.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!m.isXMLDoc(a),f&&(b=m.propFix[b]||b,e=m.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=m.find.attr(a,"tabindex");return b?parseInt(b,10):sc.test(a.nodeName)||tc.test(a.nodeName)&&a.href?0:-1}}}}),k.hrefNormalized||m.each(["href","src"],function(a,b){m.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),k.optSelected||(m.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}}),m.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){m.propFix[this.toLowerCase()]=this}),k.enctype||(m.propFix.enctype="encoding");var uc=/[\t\r\n\f]/g;m.fn.extend({addClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j="string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).addClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(uc," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=m.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j=0===arguments.length||"string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).removeClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(uc," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?m.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(m.isFunction(a)?function(c){m(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=m(this),f=a.match(E)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===K||"boolean"===c)&&(this.className&&m._data(this,"__className__",this.className),this.className=this.className||a===!1?"":m._data(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(uc," ").indexOf(b)>=0)return!0;return!1}}),m.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){m.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),m.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var vc=m.now(),wc=/\?/,xc=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;m.parseJSON=function(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+"");var c,d=null,e=m.trim(b+"");return e&&!m.trim(e.replace(xc,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,"")}))?Function("return "+e)():m.error("Invalid JSON: "+b)},m.parseXML=function(b){var c,d;if(!b||"string"!=typeof b)return null;try{a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName("parsererror").length||m.error("Invalid XML: "+b),c};var yc,zc,Ac=/#.*$/,Bc=/([?&])_=[^&]*/,Cc=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Dc=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Ec=/^(?:GET|HEAD)$/,Fc=/^\/\//,Gc=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Hc={},Ic={},Jc="*/".concat("*");try{zc=location.href}catch(Kc){zc=y.createElement("a"),zc.href="",zc=zc.href}yc=Gc.exec(zc.toLowerCase())||[];function Lc(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(E)||[];if(m.isFunction(c))while(d=f[e++])"+"===d.charAt(0)?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Mc(a,b,c,d){var e={},f=a===Ic;function g(h){var i;return e[h]=!0,m.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Nc(a,b){var c,d,e=m.ajaxSettings.flatOptions||{};for(d in b)void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d]);return c&&m.extend(!0,a,c),a}function Oc(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader("Content-Type"));if(e)for(g in h)if(h[g]&&h[g].test(e)){i.unshift(g);break}if(i[0]in c)f=i[0];else{for(g in c){if(!i[0]||a.converters[g+" "+i[0]]){f=g;break}d||(d=g)}f=f||d}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Pc(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}m.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:zc,type:"GET",isLocal:Dc.test(yc[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Jc,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":m.parseJSON,"text xml":m.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Nc(Nc(a,m.ajaxSettings),b):Nc(m.ajaxSettings,a)},ajaxPrefilter:Lc(Hc),ajaxTransport:Lc(Ic),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=m.ajaxSetup({},b),l=k.context||k,n=k.context&&(l.nodeType||l.jquery)?m(l):m.event,o=m.Deferred(),p=m.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!j){j={};while(b=Cc.exec(f))j[b[1].toLowerCase()]=b[2]}b=j[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?f:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return i&&i.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||zc)+"").replace(Ac,"").replace(Fc,yc[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=m.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(c=Gc.exec(k.url.toLowerCase()),k.crossDomain=!(!c||c[1]===yc[1]&&c[2]===yc[2]&&(c[3]||("http:"===c[1]?"80":"443"))===(yc[3]||("http:"===yc[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=m.param(k.data,k.traditional)),Mc(Hc,k,b,v),2===t)return v;h=k.global,h&&0===m.active++&&m.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!Ec.test(k.type),e=k.url,k.hasContent||(k.data&&(e=k.url+=(wc.test(e)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=Bc.test(e)?e.replace(Bc,"$1_="+vc++):e+(wc.test(e)?"&":"?")+"_="+vc++)),k.ifModified&&(m.lastModified[e]&&v.setRequestHeader("If-Modified-Since",m.lastModified[e]),m.etag[e]&&v.setRequestHeader("If-None-Match",m.etag[e])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+Jc+"; q=0.01":""):k.accepts["*"]);for(d in k.headers)v.setRequestHeader(d,k.headers[d]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(d in{success:1,error:1,complete:1})v[d](k[d]);if(i=Mc(Ic,k,b,v)){v.readyState=1,h&&n.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,i.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,c,d){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),i=void 0,f=d||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,c&&(u=Oc(k,v,c)),u=Pc(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(m.lastModified[e]=w),w=v.getResponseHeader("etag"),w&&(m.etag[e]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,h&&n.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),h&&(n.trigger("ajaxComplete",[v,k]),--m.active||m.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return m.get(a,b,c,"json")},getScript:function(a,b){return m.get(a,void 0,b,"script")}}),m.each(["get","post"],function(a,b){m[b]=function(a,c,d,e){return m.isFunction(c)&&(e=e||d,d=c,c=void 0),m.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),m.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){m.fn[b]=function(a){return this.on(b,a)}}),m._evalUrl=function(a){return m.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},m.fn.extend({wrapAll:function(a){if(m.isFunction(a))return this.each(function(b){m(this).wrapAll(a.call(this,b))});if(this[0]){var b=m(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return this.each(m.isFunction(a)?function(b){m(this).wrapInner(a.call(this,b))}:function(){var b=m(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=m.isFunction(a);return this.each(function(c){m(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){m.nodeName(this,"body")||m(this).replaceWith(this.childNodes)}).end()}}),m.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0||!k.reliableHiddenOffsets()&&"none"===(a.style&&a.style.display||m.css(a,"display"))},m.expr.filters.visible=function(a){return!m.expr.filters.hidden(a)};var Qc=/%20/g,Rc=/\[\]$/,Sc=/\r?\n/g,Tc=/^(?:submit|button|image|reset|file)$/i,Uc=/^(?:input|select|textarea|keygen)/i;function Vc(a,b,c,d){var e;if(m.isArray(b))m.each(b,function(b,e){c||Rc.test(a)?d(a,e):Vc(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==m.type(b))d(a,b);else for(e in b)Vc(a+"["+e+"]",b[e],c,d)}m.param=function(a,b){var c,d=[],e=function(a,b){b=m.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=m.ajaxSettings&&m.ajaxSettings.traditional),m.isArray(a)||a.jquery&&!m.isPlainObject(a))m.each(a,function(){e(this.name,this.value)});else for(c in a)Vc(c,a[c],b,e);return d.join("&").replace(Qc,"+")},m.fn.extend({serialize:function(){return m.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=m.prop(this,"elements");return a?m.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!m(this).is(":disabled")&&Uc.test(this.nodeName)&&!Tc.test(a)&&(this.checked||!W.test(a))}).map(function(a,b){var c=m(this).val();return null==c?null:m.isArray(c)?m.map(c,function(a){return{name:b.name,value:a.replace(Sc,"\r\n")}}):{name:b.name,value:c.replace(Sc,"\r\n")}}).get()}}),m.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&Zc()||$c()}:Zc;var Wc=0,Xc={},Yc=m.ajaxSettings.xhr();a.ActiveXObject&&m(a).on("unload",function(){for(var a in Xc)Xc[a](void 0,!0)}),k.cors=!!Yc&&"withCredentials"in Yc,Yc=k.ajax=!!Yc,Yc&&m.ajaxTransport(function(a){if(!a.crossDomain||k.cors){var b;return{send:function(c,d){var e,f=a.xhr(),g=++Wc;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)void 0!==c[e]&&f.setRequestHeader(e,c[e]+"");f.send(a.hasContent&&a.data||null),b=function(c,e){var h,i,j;if(b&&(e||4===f.readyState))if(delete Xc[g],b=void 0,f.onreadystatechange=m.noop,e)4!==f.readyState&&f.abort();else{j={},h=f.status,"string"==typeof f.responseText&&(j.text=f.responseText);try{i=f.statusText}catch(k){i=""}h||!a.isLocal||a.crossDomain?1223===h&&(h=204):h=j.text?200:404}j&&d(h,i,j,f.getAllResponseHeaders())},a.async?4===f.readyState?setTimeout(b):f.onreadystatechange=Xc[g]=b:b()},abort:function(){b&&b(void 0,!0)}}}});function Zc(){try{return new a.XMLHttpRequest}catch(b){}}function $c(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}m.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return m.globalEval(a),a}}}),m.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),m.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=y.head||m("head")[0]||y.documentElement;return{send:function(d,e){b=y.createElement("script"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||e(200,"success"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var _c=[],ad=/(=)\?(?=&|$)|\?\?/;m.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=_c.pop()||m.expando+"_"+vc++;return this[a]=!0,a}}),m.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(ad.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&ad.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=m.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(ad,"$1"+e):b.jsonp!==!1&&(b.url+=(wc.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||m.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,_c.push(e)),g&&m.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),m.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||y;var d=u.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=m.buildFragment([a],b,e),e&&e.length&&m(e).remove(),m.merge([],d.childNodes))};var bd=m.fn.load;m.fn.load=function(a,b,c){if("string"!=typeof a&&bd)return bd.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=m.trim(a.slice(h,a.length)),a=a.slice(0,h)),m.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(f="POST"),g.length>0&&m.ajax({url:a,type:f,dataType:"html",data:b}).done(function(a){e=arguments,g.html(d?m("<div>").append(m.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,e||[a.responseText,b,a])}),this},m.expr.filters.animated=function(a){return m.grep(m.timers,function(b){return a===b.elem}).length};var cd=a.document.documentElement;function dd(a){return m.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}m.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=m.css(a,"position"),l=m(a),n={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=m.css(a,"top"),i=m.css(a,"left"),j=("absolute"===k||"fixed"===k)&&m.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),m.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(n.top=b.top-h.top+g),null!=b.left&&(n.left=b.left-h.left+e),"using"in b?b.using.call(a,n):l.css(n)}},m.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){m.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,m.contains(b,e)?(typeof e.getBoundingClientRect!==K&&(d=e.getBoundingClientRect()),c=dd(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===m.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),m.nodeName(a[0],"html")||(c=a.offset()),c.top+=m.css(a[0],"borderTopWidth",!0),c.left+=m.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-m.css(d,"marginTop",!0),left:b.left-c.left-m.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||cd;while(a&&!m.nodeName(a,"html")&&"static"===m.css(a,"position"))a=a.offsetParent;return a||cd})}}),m.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);m.fn[a]=function(d){return V(this,function(a,d,e){var f=dd(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?m(f).scrollLeft():e,c?e:m(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),m.each(["top","left"],function(a,b){m.cssHooks[b]=Lb(k.pixelPosition,function(a,c){return c?(c=Jb(a,b),Hb.test(c)?m(a).position()[b]+"px":c):void 0})}),m.each({Height:"height",Width:"width"},function(a,b){m.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){m.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return V(this,function(b,c,d){var e;return m.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?m.css(b,c,g):m.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),m.fn.size=function(){return this.length},m.fn.andSelf=m.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return m});var ed=a.jQuery,fd=a.$;return m.noConflict=function(b){return a.$===m&&(a.$=fd),b&&a.jQuery===m&&(a.jQuery=ed),m},typeof b===K&&(a.jQuery=a.$=m),m});
6/*! jQuery Migrate v1.2.1 | (c) 2005, 2013 jQuery Foundation, Inc. and other contributors | jquery.org/license */ 7 8jQuery.migrateMute===void 0&&(jQuery.migrateMute=!0),function(e,t,n){function r(n){var r=t.console;i[n]||(i[n]=!0,e.migrateWarnings.push(n),r&&r.warn&&!e.migrateMute&&(r.warn("JQMIGRATE: "+n),e.migrateTrace&&r.trace&&r.trace()))}function a(t,a,i,o){if(Object.defineProperty)try{return Object.defineProperty(t,a,{configurable:!0,enumerable:!0,get:function(){return r(o),i},set:function(e){r(o),i=e}}),n}catch(s){}e._definePropertyBroken=!0,t[a]=i}var i={};e.migrateWarnings=[],!e.migrateMute&&t.console&&t.console.log&&t.console.log("JQMIGRATE: Logging is active"),e.migrateTrace===n&&(e.migrateTrace=!0),e.migrateReset=function(){i={},e.migrateWarnings.length=0},"BackCompat"===document.compatMode&&r("jQuery is not compatible with Quirks Mode");var o=e("<input/>",{size:1}).attr("size")&&e.attrFn,s=e.attr,u=e.attrHooks.value&&e.attrHooks.value.get||function(){return null},c=e.attrHooks.value&&e.attrHooks.value.set||function(){return n},l=/^(?:input|button)$/i,d=/^[238]$/,p=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,f=/^(?:checked|selected)$/i;a(e,"attrFn",o||{},"jQuery.attrFn is deprecated"),e.attr=function(t,a,i,u){var c=a.toLowerCase(),g=t&&t.nodeType;return u&&(4>s.length&&r("jQuery.fn.attr( props, pass ) is deprecated"),t&&!d.test(g)&&(o?a in o:e.isFunction(e.fn[a])))?e(t)[a](i):("type"===a&&i!==n&&l.test(t.nodeName)&&t.parentNode&&r("Can't change the 'type' of an input or button in IE 6/7/8"),!e.attrHooks[c]&&p.test(c)&&(e.attrHooks[c]={get:function(t,r){var a,i=e.prop(t,r);return i===!0||"boolean"!=typeof i&&(a=t.getAttributeNode(r))&&a.nodeValue!==!1?r.toLowerCase():n},set:function(t,n,r){var a;return n===!1?e.removeAttr(t,r):(a=e.propFix[r]||r,a in t&&(t[a]=!0),t.setAttribute(r,r.toLowerCase())),r}},f.test(c)&&r("jQuery.fn.attr('"+c+"') may use property instead of attribute")),s.call(e,t,a,i))},e.attrHooks.value={get:function(e,t){var n=(e.nodeName||"").toLowerCase();return"button"===n?u.apply(this,arguments):("input"!==n&&"option"!==n&&r("jQuery.fn.attr('value') no longer gets properties"),t in e?e.value:null)},set:function(e,t){var a=(e.nodeName||"").toLowerCase();return"button"===a?c.apply(this,arguments):("input"!==a&&"option"!==a&&r("jQuery.fn.attr('value', val) no longer sets properties"),e.value=t,n)}};var g,h,v=e.fn.init,m=e.parseJSON,y=/^([^<]*)(<[\w\W]+>)([^>]*)$/;e.fn.init=function(t,n,a){var i;return t&&"string"==typeof t&&!e.isPlainObject(n)&&(i=y.exec(e.trim(t)))&&i[0]&&("<"!==t.charAt(0)&&r("$(html) HTML strings must start with '<' character"),i[3]&&r("$(html) HTML text after last tag is ignored"),"#"===i[0].charAt(0)&&(r("HTML string cannot start with a '#' character"),e.error("JQMIGRATE: Invalid selector string (XSS)")),n&&n.context&&(n=n.context),e.parseHTML)?v.call(this,e.parseHTML(i[2],n,!0),n,a):v.apply(this,arguments)},e.fn.init.prototype=e.fn,e.parseJSON=function(e){return e||null===e?m.apply(this,arguments):(r("jQuery.parseJSON requires a valid JSON string"),null)},e.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||0>e.indexOf("compatible")&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e.browser||(g=e.uaMatch(navigator.userAgent),h={},g.browser&&(h[g.browser]=!0,h.version=g.version),h.chrome?h.webkit=!0:h.webkit&&(h.safari=!0),e.browser=h),a(e,"browser",e.browser,"jQuery.browser is deprecated"),e.sub=function(){function t(e,n){return new t.fn.init(e,n)}e.extend(!0,t,this),t.superclass=this,t.fn=t.prototype=this(),t.fn.constructor=t,t.sub=this.sub,t.fn.init=function(r,a){return a&&a instanceof e&&!(a instanceof t)&&(a=t(a)),e.fn.init.call(this,r,a,n)},t.fn.init.prototype=t.fn;var n=t(document);return r("jQuery.sub() is deprecated"),t},e.ajaxSetup({converters:{"text json":e.parseJSON}});var b=e.fn.data;e.fn.data=function(t){var a,i,o=this[0];return!o||"events"!==t||1!==arguments.length||(a=e.data(o,t),i=e._data(o,t),a!==n&&a!==i||i===n)?b.apply(this,arguments):(r("Use of jQuery.fn.data('events') is deprecated"),i)};var j=/\/(java|ecma)script/i,w=e.fn.andSelf||e.fn.addBack;e.fn.andSelf=function(){return r("jQuery.fn.andSelf() replaced by jQuery.fn.addBack()"),w.apply(this,arguments)},e.clean||(e.clean=function(t,a,i,o){a=a||document,a=!a.nodeType&&a[0]||a,a=a.ownerDocument||a,r("jQuery.clean() is deprecated");var s,u,c,l,d=[];if(e.merge(d,e.buildFragment(t,a).childNodes),i)for(c=function(e){return!e.type||j.test(e.type)?o?o.push(e.parentNode?e.parentNode.removeChild(e):e):i.appendChild(e):n},s=0;null!=(u=d[s]);s++)e.nodeName(u,"script")&&c(u)||(i.appendChild(u),u.getElementsByTagName!==n&&(l=e.grep(e.merge([],u.getElementsByTagName("script")),c),d.splice.apply(d,[s+1,0].c
8oncat(l)),s+=l.length));return d});var Q=e.event.add,x=e.event.remove,k=e.event.trigger,N=e.fn.toggle,T=e.fn.live,M=e.fn.die,S="ajaxStart|ajaxStop|ajaxSend|ajaxComplete|ajaxError|ajaxSuccess",C=RegExp("\\b(?:"+S+")\\b"),H=/(?:^|\s)hover(\.\S+|)\b/,A=function(t){return"string"!=typeof t||e.event.special.hover?t:(H.test(t)&&r("'hover' pseudo-event is deprecated, use 'mouseenter mouseleave'"),t&&t.replace(H,"mouseenter$1 mouseleave$1"))};e.event.props&&"attrChange"!==e.event.props[0]&&e.event.props.unshift("attrChange","attrName","relatedNode","srcElement"),e.event.dispatch&&a(e.event,"handle",e.event.dispatch,"jQuery.event.handle is undocumented and deprecated"),e.event.add=function(e,t,n,a,i){e!==document&&C.test(t)&&r("AJAX events should be attached to document: "+t),Q.call(this,e,A(t||""),n,a,i)},e.event.remove=function(e,t,n,r,a){x.call(this,e,A(t)||"",n,r,a)},e.fn.error=function(){var e=Array.prototype.slice.call(arguments,0);return r("jQuery.fn.error() is deprecated"),e.splice(0,0,"error"),arguments.length?this.bind.apply(this,e):(this.triggerHandler.apply(this,e),this)},e.fn.toggle=function(t,n){if(!e.isFunction(t)||!e.isFunction(n))return N.apply(this,arguments);r("jQuery.fn.toggle(handler, handler...) is deprecated");var a=arguments,i=t.guid||e.guid++,o=0,s=function(n){var r=(e._data(this,"lastToggle"+t.guid)||0)%o;return e._data(this,"lastToggle"+t.guid,r+1),n.preventDefault(),a[r].apply(this,arguments)||!1};for(s.guid=i;a.length>o;)a[o++].guid=i;return this.click(s)},e.fn.live=function(t,n,a){return r("jQuery.fn.live() is deprecated"),T?T.apply(this,arguments):(e(this.context).on(t,this.selector,n,a),this)},e.fn.die=function(t,n){return r("jQuery.fn.die() is deprecated"),M?M.apply(this,arguments):(e(this.context).off(t,this.selector||"**",n),this)},e.event.trigger=function(e,t,n,a){return n||C.test(e)||r("Global events are undocumented and deprecated"),k.call(this,e,t,n||document,a)},e.each(S.split("|"),function(t,n){e.event.special[n]={setup:function(){var t=this;return t!==document&&(e.event.add(document,n+"."+e.guid,function(){e.event.trigger(n,null,t,!0)}),e._data(this,n,e.guid++)),!1},teardown:function(){return this!==document&&e.event.remove(document,n+"."+e._data(this,n)),!1}}})}(jQuery,window); 9/*! 10 * Bootstrap v3.3.6 (http://getbootstrap.com) 11 * Copyright 2011-2015 Twitter, Inc. 12 * Licensed under the MIT license 13 */
vendor: 36,744 bytes, lines 14-16
14 15if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1||b[0]>2)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 3")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.6",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a(f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.6",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")?(c.prop("checked")&&(a=!1),b.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasClass("active")&&(a=!1),this.$element.toggleClass("active")),c.prop("checked",this.$element.hasClass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target);d.hasClass("btn")||(d=d.closest(".btn")),b.call(d,"toggle"),a(c.target).is('input[type="radio"]')||a(c.target).is('input[type="checkbox"]')||c.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.6",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));return a>this.$items.length-1||0>a?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.slide("next")},c.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.6",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event("hide.bs.dropdown",f)),c.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger(a.Event("hidden.bs.dropdown",f)))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.6",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasClass("open");if(c(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",c);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger(a.Event("shown.bs.dropdown",h))}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(".disabled, :disabled")){var e=b(d),g=e.hasClass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find(".dropdown-menu"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&j<i.length-1&&j++,~j||(j=0),i.eq(j).trigger("focus")}}}};var h=a.fn.dropdown;a.fn.dropdown=d,a.fn.dropdown.Constructor=g,a.fn.dropdown.noConflict=function(){return a.fn.dropdown=h,this},a(document).on("click.bs.dropdown.data-api",c).on("click.bs.dropdown.data-api",".dropdown form",function(a){a.stopPropagation()}).on("click.bs.dropdown.data-api",f,g.prototype.toggle).on("keydown.bs.dropdown.data-api",f,g.prototype.keydown).on("keydown.bs.dropdown.data-api",".dropdown-menu",g.prototype.keydown)}(jQuery),+function(a){"use strict";function b(b,d){return this.each(function(){var e=a(this),f=e.data("bs.modal"),g=a.extend({},c.DEFAULTS,e.data(),"object"==typeof b&&b);f||e.data("bs.modal",f=new c(this,g)),"string"==typeof b?f[b](d):g.show&&f.show(d)})}var c=function(b,c){this.options=c,this.$body=a(document.body),this.$element=a(b),this.$dialog=this.$element.find(".modal-dialog"),this.$backdrop=null,this.isShown=null,this.originalBodyPad=null,this.scrollbarWidth=0,this.ignoreBackdropClick=!1,this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,a.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};c.VERSION="3.3.6",c.TRANSITION_DURATION=300,c.BACKDROP_TRANSITION_DURATION=150,c.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},c.prototype.toggle=function(a){return this.isShown?this.hide():this.show(a)},c.prototype.show=function(b){var d=this,e=a.Event("show.bs.modal",{relatedTarget:b});this.$element.trigger(e),this.isShown||e.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',a.proxy(this.hide,this)),this.$dialog.on("mousedown.dismiss.bs.modal",function(){d.$element.one("mouseup.dismiss.bs.modal",function(b){a(b.target).is(d.$element)&&(d.ignoreBackdropClick=!0)})}),this.backdrop(function(){var e=a.support.transition&&d.$element.hasClass("fade");d.$element.parent().length||d.$element.appendTo(d.$body),d.$element.show().scrollTop(0),d.adjustDialog(),e&&d.$element[0].offsetWidth,d.$element.addClass("in"),d.enforceFocus();var f=a.Event("shown.bs.modal",{relatedTarget:b});e?d.$dialog.one("bsTransitionEnd",function(){d.$element.trigger("focus").trigger(f)}).emulateTransitionEnd(c.TRANSITION_DURATION):d.$element.trigger("focus").trigger(f)}))},c.prototype.hide=function(b){b&&b.preventDefault(),b=a.Event("hide.bs.modal"),this.$element.trigger(b),this.isShown&&!b.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),a(document).off("focusin.bs.modal"),this.$element.removeClass("in").off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"),this.$dialog.off("mousedown.dismiss.bs.modal"),a.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",a.proxy(this.hideModal,this)).emulateTransitionEnd(c.TRANSITION_DURATION):this.hideModal())},c.prototype.enforceFocus=function(){a(document).off("focusin.bs.modal").on("focusin.bs.modal",a.proxy(function(a){this.$element[0]===a.target||this.$element.has(a.target).length||this.$element.trigger("focus")},this))},c.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",a.proxy(function(a){27==a.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")},c.prototype.resize=function(){this.isShown?a(window).on("resize.bs.modal",a.proxy(this.handleUpdate,this)):a(window).off("resize.bs.modal")},c.prototype.hideModal=function(){var a=this;this.$element.hide(),this.backdrop(function(){a.$body.removeClass("modal-open"),a.resetAdjustments(),a.resetScrollbar(),a.$element.trigger("hidden.bs.modal")})},c.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},c.prototype.backdrop=function(b){var d=this,e=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var f=a.support.transition&&e;if(this.$backdrop=a(document.createElement("div")).addClass("modal-backdrop "+e).appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",a.proxy(function(a){return this.ignoreBackdropClick?void(this.ignoreBackdropClick=!1):void(a.target===a.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide()))},this)),f&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!b)return;f?this.$backdrop.one("bsTransitionEnd",b).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):b()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var g=function(){d.removeBackdrop(),b&&b()};a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",g).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):g()}else b&&b()},c.prototype.handleUpdate=function(){this.adjustDialog()},c.prototype.adjustDialog=function(){var a=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth<a,this.scrollbarWidth=this.measureScrollbar()},c.prototype.setScrollbar=function(){var a=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"",this.bodyIsOverflowing&&this.$body.css("padding-right",a+this.scrollbarWidth)},c.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad)},c.prototype.measureScrollbar=function(){var a=document.createElement("div");a.className="modal-scrollbar-measure",this.$body.append(a);var b=a.offsetWidth-a.clientWidth;return this.$body[0].removeChild(a),b};var d=a.fn.modal;a.fn.modal=b,a.fn.modal.Constructor=c,a.fn.modal.noConflict=function(){return a.fn.modal=d,this},a(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(c){var d=a(this),e=d.attr("href"),f=a(d.attr("data-target")||e&&e.replace(/.*(?=#[^\s]+$)/,"")),g=f.data("bs.modal")?"toggle":a.extend({remote:!/#/.test(e)&&e},f.data(),d.data());d.is("a")&&c.preventDefault(),f.one("show.bs.modal",function(a){a.isDefaultPrevented()||f.one("hidden.bs.modal",function(){d.is(":visible")&&d.trigger("focus")})}),b.call(f,g,this)})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tooltip"),f="object"==typeof b&&b;(e||!/destroy|hide/.test(b))&&(e||d.data("bs.tooltip",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.inState=null,this.init("tooltip",a,b)};c.VERSION="3.3.6",c.TRANSITION_DURATION=150,c.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusin"==b.type?"focus":"hover"]=!0),c.tip().hasClass("in")||"in"==c.hoverState?void(c.hoverState="in"):(clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusout"==b.type?"focus":"hover"]=!1),c.isInStateTrue()?void 0:(clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide())},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h="bottom"==h&&k.bottom+m>o.bottom?"top":"top"==h&&k.top-m<o.top?"bottom":"right"==h&&k.right+l>o.width?"left":"left"==h&&k.left-l<o.left?"right":h,f.removeClass(n).addClass(h)}var p=this.getCalculatedOffset(h,k,l,m);this.applyPlacement(p,h);var q=function(){var a=e.hoverState;e.$element.trigger("shown.bs."+e.type),e.hoverState=null,"out"==a&&e.leave(e)};a.support.transition&&this.$tip.hasClass("fade")?f.one("bsTransitionEnd",q).emulateTransitionEnd(c.TRANSITION_DURATION):q()}},c.prototype.applyPlacement=function(b,c){var d=this.tip(),e=d[0].offsetWidth,f=d[0].offsetHeight,g=parseInt(d.css("margin-top"),10),h=parseInt(d.css("margin-left"),10);isNaN(g)&&(g=0),isNaN(h)&&(h=0),b.top+=g,b.left+=h,a.offset.setOffset(d[0],a.extend({using:function(a){d.css({top:Math.round(a.top),left:Math.round(a.left)})}},b),0),d.addClass("in");var i=d[0].offsetWidth,j=d[0].offsetHeight;"top"==c&&j!=f&&(b.top=b.top+f-j);var k=this.getViewportAdjustedDelta(c,b,i,j);k.left?b.left+=k.left:b.top+=k.top;var l=/top|bottom/.test(c),m=l?2*k.left-e+i:2*k.top-f+j,n=l?"offsetWidth":"offsetHeight";d.offset(b),this.replaceArrow(m,d[0][n],l)},c.prototype.replaceArrow=function(a,b,c){this.arrow().css(c?"left":"top",50*(1-a/b)+"%").css(c?"top":"left","")},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle();a.find(".tooltip-inner")[this.options.html?"html":"text"](b),a.removeClass("fade in top bottom left right")},c.prototype.hide=function(b){function d(){"in"!=e.hoverState&&f.detach(),e.$element.removeAttr("aria-describedby").trigger("hidden.bs."+e.type),b&&b()}var e=this,f=a(this.$tip),g=a.Event("hide.bs."+this.type);return this.$element.trigger(g),g.isDefaultPrevented()?void 0:(f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one("bsTransitionEnd",d).emulateTransitionEnd(c.TRANSITION_DURATION):d(),this.hoverState=null,this)},c.prototype.fixTitle=function(){var a=this.$element;(a.attr("title")||"string"!=typeof a.attr("data-original-title"))&&a.attr("data-original-title",a.attr("title")||"").attr("title","")},c.prototype.hasContent=function(){return this.getTitle()},c.prototype.getPosition=function(b){b=b||this.$element;var c=b[0],d="BODY"==c.tagName,e=c.getBoundingClientRect();null==e.width&&(e=a.extend({},e,{width:e.right-e.left,height:e.bottom-e.top}));var f=d?{top:0,left:0}:b.offset(),g={scroll:d?document.documentElement.scrollTop||document.body.scrollTop:b.scrollTop()},h=d?{width:a(window).width(),height:a(window).height()}:null;return a.extend({},e,g,h,f)},c.prototype.getCalculatedOffset=function(a,b,c,d){return"bottom"==a?{top:b.top+b.height,left:b.left+b.width/2-c/2}:"top"==a?{top:b.top-d,left:b.left+b.width/2-c/2}:"left"==a?{top:b.top+b.height/2-d/2,left:b.left-c}:{top:b.top+b.height/2-d/2,left:b.left+b.width}},c.prototype.getViewportAdjustedDelta=function(a,b,c,d){var e={top:0,left:0};if(!this.$viewport)return e;var f=this.options.viewport&&this.options.viewport.padding||0,g=this.getPosition(this.$viewport);if(/right|left/.test(a)){var h=b.top-f-g.scroll,i=b.top+f-g.scroll+d;h<g.top?e.top=g.top-h:i>g.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;j<g.left?e.left=g.left-j:k>g.right&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){if(!this.$tip&&(this.$tip=a(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),b?(c.inState.click=!c.inState.click,c.isInStateTrue()?c.enter(c):c.leave(c)):c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type),a.$tip&&a.$tip.detach(),a.$tip=null,a.$arrow=null,a.$viewport=null})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;(e||!/destroy|hide/.test(b))&&(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.6",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.6",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b<e[0])return this.activeTarget=null,this.clear();for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(void 0===e[a+1]||b<e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,this.clear();var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active"); 16d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate.bs.scrollspy")},b.prototype.clear=function(){a(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var d=a.fn.scrollspy;a.fn.scrollspy=c,a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=d,this},a(window).on("load.bs.scrollspy.data-api",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);c.call(b,b.data())})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new c(this)),"string"==typeof b&&e[b]()})}var c=function(b){this.element=a(b)};c.VERSION="3.3.6",c.TRANSITION_DURATION=150,c.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.data("target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a"),f=a.Event("hide.bs.tab",{relatedTarget:b[0]}),g=a.Event("show.bs.tab",{relatedTarget:e[0]});if(e.trigger(f),b.trigger(g),!g.isDefaultPrevented()&&!f.isDefaultPrevented()){var h=a(d);this.activate(b.closest("li"),c),this.activate(h,h.parent(),function(){e.trigger({type:"hidden.bs.tab",relatedTarget:b[0]}),b.trigger({type:"shown.bs.tab",relatedTarget:e[0]})})}}},c.prototype.activate=function(b,d,e){function f(){g.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.6",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return c>e?"top":!1;if("bottom"==this.affixed)return null!=c?e+this.unpin<=f.top?!1:"bottom":a-d>=e+g?!1:"bottom";var h=null==this.affixed,i=h?e:f.top,j=h?g:b;return null!=c&&c>=e?"top":null!=d&&i+j>=a-d?"bottom":!1},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=Math.max(a(document).height(),a(document.body).height());"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery);
16 17/*! 18 * Cube Portfolio - Responsive jQuery Grid Plugin 19 * 20 * version: 2.3.2 (26 May, 2015) 21 * require: jQuery v1.7+ 22 * 23 * Copyright 2013-2015, Mihai Buricea (http://scriptpie.com/cubeportfolio/live-preview/) 24 * Licensed under CodeCanyon License (http://codecanyon.net/licenses) 25 * 26 */ 27 28!function(a,b,c,d){"use strict";function e(b,c,d){var f,g=this,h="cbp";if(a.data(b,"cubeportfolio"))throw new Error("cubeportfolio is already initialized. Destroy it before initialize again!");a.data(b,"cubeportfolio",g),g.options=a.extend({},a.fn.cubeportfolio.options,c),g.isAnimating=!0,g.defaultFilter=g.options.defaultFilter,g.registeredEvents=[],g.skipEvents=[],g.addedWrapp=!1,a.isFunction(d)&&g._registerEvent("initFinish",d,!0),g.obj=b,g.$obj=a(b),f=g.$obj.children(),g.options.caption&&(e.Private.modernBrowser||(g.options.caption="minimal"),h+=" cbp-caption-active cbp-caption-"+g.options.caption),g.$obj.addClass(h),(0===f.length||f.first().hasClass("cbp-item"))&&(g.wrapInner(g.obj,"cbp-wrapper"),g.addedWrapp=!0),g.$ul=g.$obj.children().addClass("cbp-wrapper"),g.wrapInner(g.obj,"cbp-wrapper-outer"),g.wrapper=g.$obj.children(".cbp-wrapper-outer"),g.blocks=g.$ul.children(".cbp-item"),g.wrapInner(g.blocks,"cbp-item-wrapper"),g.width=g.$obj.outerWidth(),g._load(g.$obj,g._display)}a.extend(e.prototype,{storeData:function(b){b.each(function(b,c){var d=a(c);d.data("cbp",{wrapper:d.children(".cbp-item-wrapper"),widthInitial:d.outerWidth(),heightInitial:d.outerHeight(),width:null,height:null,left:null,leftNew:null,top:null,topNew:null})})},wrapInner:function(a,b){var e,f,g;if(b=b||"",!(a.length&&a.length<1))for(a.length===d&&(a=[a]),f=a.length-1;f>=0;f--){for(e=a[f],g=c.createElement("div"),g.setAttribute("class",b);e.childNodes.length;)g.appendChild(e.childNodes[0]);e.appendChild(g)}},_captionDestroy:function(){var a=this;a.$obj.removeClass("cbp-caption-active cbp-caption-"+a.options.caption)},resizeEvent:function(){var c,d,e=this;a(b).on("resize.cbp",function(){clearTimeout(c),c=setTimeout(function(){b.innerHeight!=screen.height&&("alignCenter"===e.options.gridAdjustment&&(e.obj.style.maxWidth=""),d=e.$obj.outerWidth(),e.width!==d&&(e.width=d,e._gridAdjust(),e._layout(),e.positionateItems(),e._resizeMainContainer(),"slider"===e.options.layoutMode&&e._updateSlider(),e._triggerEvent("resizeGrid")),e._triggerEvent("resizeWindow"))},80)})},_load:function(b,c,d){var e,f,g=this,h=0;d=d||[],e=b.find("img:uncached").map(function(){return this.src}),f=e.length,0===f&&c.apply(g,d),a.each(e,function(b,e){var i=new Image;a(i).one("load.cbp error.cbp",function(){return a(this).off("load.cbp error.cbp"),h++,h===f?(c.apply(g,d),!1):void 0}),i.src=e})},_filterFromUrl:function(){var a=this,b=/#cbpf=(.*?)([#|?&]|$)/gi.exec(location.href);null!==b&&(a.defaultFilter=b[1])},_display:function(){var b=this;b.storeData(b.blocks),"grid"===b.options.layoutMode&&b._filterFromUrl(),"*"!==b.defaultFilter?(b.blocksOn=b.blocks.filter(b.defaultFilter),b.blocks.not(b.defaultFilter).addClass("cbp-item-off")):b.blocksOn=b.blocks,b._plugins=a.map(e.Plugins,function(a){return a(b)}),b._triggerEvent("initStartRead"),b._triggerEvent("initStartWrite"),b.localColumnWidth=b.options.gapVertical,b.blocks.length&&(b.localColumnWidth+=b.blocks.first().data("cbp").widthInitial),b.getColumnsType=a.isArray(b.options.mediaQueries)?"_getColumnsBreakpoints":"_getColumnsAuto",b._gridAdjust(),b["_"+b.options.layoutMode+"Markup"](),b._layout(),b.positionateItems(),b._resizeMainContainer(),b._triggerEvent("initEndRead"),b._triggerEvent("initEndWrite"),b.$obj.addClass("cbp-ready"),b._registerEvent("delayFrame",b.delayFrame),b._triggerEvent("delayFrame")},positionateItems:function(){var b,c=this;c.blocksOn.each(function(c,d){b=a(d).data("cbp"),b.left=b.leftNew,b.top=b.topNew,d.style.left=b.left+"px",d.style.top=b.top+"px"})},delayFrame:function(){var a=this;requestAnimationFrame(function(){a.resizeEvent(),a._triggerEvent("initFinish"),a.isAnimating=!1,a.$obj.trigger("initComplete.cbp")})},_gridAdjust:function(){var b=this;"responsive"===b.options.gridAdjustment?b._responsiveLayout():b.blocks.each(function(b,c){var d=a(c).data("cbp");d.width=d.widthInitial,d.height=d.heightInitial})},_layout:function(){var a=this;a["_"+a.options.layoutMode+"LayoutReset"](),a["_"+a.options.layoutMode+"Layout"](),a.$obj.removeClass(function(a,b){return(b.match(/\bcbp-cols-\d+/gi)||[]).join(" ")}),a.$obj.addClass("cbp-cols-"+a.cols)},_sliderMarkup:function(){var b=this;b.sliderStopEvents=!1,b.sliderActive=0,b._registerEvent("updateSliderPosition",function(){b.$obj.addClass("cbp-mode-slider")},!0),b.nav=a("<div/>",{"class":"cbp-nav"}
28),b.nav.on("click.cbp","[data-slider-action]",function(c){if(c.preventDefault(),c.stopImmediatePropagation(),c.stopPropagation(),!b.sliderStopEvents){var d=a(this),e=d.attr("data-slider-action");b["_"+e+"Slider"]&&b["_"+e+"Slider"](d)}}),b.options.showNavigation&&(b.controls=a("<div/>",{"class":"cbp-nav-controls"}),b.navPrev=a("<div/>",{"class":"cbp-nav-prev","data-slider-action":"prev"}).appendTo(b.controls),b.navNext=a("<div/>",{"class":"cbp-nav-next","data-slider-action":"next"}).appendTo(b.controls),b.controls.appendTo(b.nav)),b.options.showPagination&&(b.navPagination=a("<div/>",{"class":"cbp-nav-pagination"}).appendTo(b.nav)),(b.controls||b.navPagination)&&b.nav.appendTo(b.$obj),b._updateSliderPagination(),b.options.auto&&(b.options.autoPauseOnHover&&(b.mouseIsEntered=!1,b.$obj.on("mouseenter.cbp",function(){b.mouseIsEntered=!0,b._stopSliderAuto()}).on("mouseleave.cbp",function(){b.mouseIsEntered=!1,b._startSliderAuto()})),b._startSliderAuto()),b.options.drag&&e.Private.modernBrowser&&b._dragSlider()},_updateSlider:function(){var a=this;a._updateSliderPosition(),a._updateSliderPagination()},_updateSliderPagination:function(){var b,c,d=this;if(d.options.showPagination){for(b=Math.ceil(d.blocksOn.length/d.cols),d.navPagination.empty(),c=b-1;c>=0;c--)a("<div/>",{"class":"cbp-nav-pagination-item","data-slider-action":"jumpTo"}).appendTo(d.navPagination);d.navPaginationItems=d.navPagination.children()}d._enableDisableNavSlider()},_destroySlider:function(){var a=this;"slider"===a.options.layoutMode&&(a.$obj.off("click.cbp"),a.$obj.removeClass("cbp-mode-slider"),a.options.showNavigation&&a.nav.remove(),a.navPagination&&a.navPagination.remove())},_nextSlider:function(){var a=this;if(a._isEndSlider()){if(!a.isRewindNav())return;a.sliderActive=0}else a.options.scrollByPage?a.sliderActive=Math.min(a.sliderActive+a.cols,a.blocksOn.length-a.cols):a.sliderActive+=1;a._goToSlider()},_prevSlider:function(){var a=this;if(a._isStartSlider()){if(!a.isRewindNav())return;a.sliderActive=a.blocksOn.length-a.cols}else a.options.scrollByPage?a.sliderActive=Math.max(0,a.sliderActive-a.cols):a.sliderActive-=1;a._goToSlider()},_jumpToSlider:function(a){var b=this,c=Math.min(a.index()*b.cols,b.blocksOn.length-b.cols);c!==b.sliderActive&&(b.sliderActive=c,b._goToSlider())},_jumpDragToSlider:function(a){var b,c,d,e=this,f=a>0?!0:!1;e.options.scrollByPage?(b=e.cols*e.localColumnWidth,c=e.cols):(b=e.localColumnWidth,c=1),a=Math.abs(a),d=Math.floor(a/b)*c,a%b>20&&(d+=c),e.sliderActive=f?Math.min(e.sliderActive+d,e.blocksOn.length-e.cols):Math.max(0,e.sliderActive-d),e._goToSlider()},_isStartSlider:function(){return 0===this.sliderActive},_isEndSlider:function(){var a=this;return a.sliderActive+a.cols>a.blocksOn.length-1},_goToSlider:function(){var a=this;a._enableDisableNavSlider(),a._updateSliderPosition()},_startSliderAuto:function(){var a=this;return a.isDrag?void a._stopSliderAuto():void(a.timeout=setTimeout(function(){a._nextSlider(),a._startSliderAuto()},a.options.autoTimeout))},_stopSliderAuto:function(){clearTimeout(this.timeout)},_enableDisableNavSlider:function(){var a,b,c=this;c.isRewindNav()||(b=c._isStartSlider()?"addClass":"removeClass",c.navPrev[b]("cbp-nav-stop"),b=c._isEndSlider()?"addClass":"removeClass",c.navNext[b]("cbp-nav-stop")),c.options.showPagination&&(a=c.options.scrollByPage?Math.ceil(c.sliderActive/c.cols):c._isEndSlider()?c.navPaginationItems.length-1:Math.floor(c.sliderActive/c.cols),c.navPaginationItems.removeClass("cbp-nav-pagination-active").eq(a).addClass("cbp-nav-pagination-active"))},isRewindNav:function(){var a=this;return a.options.showNavigation?a.blocksOn.length<=a.cols?!1:a.options.rewindNav?!0:!1:!0},sliderItemsLength:function(){return this.blocksOn.length<=this.cols},_sliderLayout:function(){var b=this;b.blocksOn.each(function(c,d){var e=a(d).data("cbp");e.leftNew=Math.round(b.localColumnWidth*c),e.topNew=0,b.colVert.push(e.height+b.options.gapHorizontal)}),b.sliderColVert=b.colVert.slice(b.sliderActive,b.sliderActive+b.cols),b.ulWidth=b.localColumnWidth*b.blocksOn.length-b.options.gapVertical,b.$ul.width(b.ulWidth)},_updateSliderPosition:function(){var a=this,b=-a.sliderActive*a.localColumnWidth;a._triggerEvent("updateSliderPosition"),e.Private.modernBrowser?a.$ul[0].style[e.Private.transform]="translate3d("+b+"px, 0px, 0)":a.$ul[0].style.left=b+"px",a.sliderColVert=a.colVert.slice(a.sliderActive,a.sliderActive+a.cols),a._resizeMainContainer()},_dragSlider:function(){function f(b){if(!q.sliderItemsLength()){if
28(u?p=b:b.preventDefault(),q.options.auto&&q._stopSliderAuto(),s)return void a(m).one("click.cbp",function(){return!1});m=a(b.target),k=j(b).x,l=0,n=-q.sliderActive*q.localColumnWidth,o=q.localColumnWidth*(q.blocksOn.length-q.cols),r.on(t.move,h),r.on(t.end,g),q.$obj.addClass("cbp-mode-slider-dragStart")}}function g(){q.$obj.removeClass("cbp-mode-slider-dragStart"),s=!0,0!==l?(m.one("click.cbp",function(){return!1}),q._jumpDragToSlider(l),q.$ul.one(e.Private.transitionend,i)):i.call(q),r.off(t.move),r.off(t.end)}function h(a){l=k-j(a).x,(l>8||-8>l)&&a.preventDefault(),q.isDrag=!0;var b=n-l;0>l&&n>l?b=(n-l)/5:l>0&&-o>n-l&&(b=-o+(o+n-l)/5),e.Private.modernBrowser?q.$ul[0].style[e.Private.transform]="translate3d("+b+"px, 0px, 0)":q.$ul[0].style.left=b+"px"}function i(){if(s=!1,q.isDrag=!1,q.options.auto){if(q.mouseIsEntered)return;q._startSliderAuto()}}function j(a){return a.originalEvent!==d&&a.originalEvent.touches!==d&&(a=a.originalEvent.touches[0]),{x:a.pageX,y:a.pageY}}var k,l,m,n,o,p,q=this,r=a(c),s=!1,t={},u=!1;q.isDrag=!1,"ontouchstart"in b||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0?(t={start:"touchstart.cbp",move:"touchmove.cbp",end:"touchend.cbp"},u=!0):t={start:"mousedown.cbp",move:"mousemove.cbp",end:"mouseup.cbp"},q.$ul.on(t.start,f)},_sliderLayoutReset:function(){var a=this;a.colVert=[]},_gridMarkup:function(){},_gridLayout:function(){var b=this;b.blocksOn.each(function(c,d){var e,f,g,h,i=Math.min.apply(Math,b.colVert),j=0,k=a(d).data("cbp");for(g=0,h=b.colVert.length;h>g;g++)if(b.colVert[g]===i){j=g;break}for(k.leftNew=Math.round(b.localColumnWidth*j),k.topNew=Math.round(i),e=i+k.height+b.options.gapHorizontal,f=b.cols+1-h,g=0;f>g;g++)b.colVert[j+g]=e})},_gridLayoutReset:function(){var a,b=this;for("alignCenter"===b.options.gridAdjustment?(b.cols=Math.max(Math.floor((b.width+b.options.gapVertical)/b.localColumnWidth),1),b.width=b.cols*b.localColumnWidth-b.options.gapVertical,b.$obj.css("max-width",b.width)):b.cols=Math.max(Math.floor((b.width+b.options.gapVertical)/b.localColumnWidth),1),b.colVert=[],a=b.cols;a--;)b.colVert.push(0)},_responsiveLayout:function(){var b,c,d=this;d.columnWidthCache?d.localColumnWidth=d.columnWidthCache:d.columnWidthCache=d.localColumnWidth,d.cols=d[d.getColumnsType](),b=d.width-d.options.gapVertical*(d.cols-1),d.localColumnWidth=parseInt(b/d.cols,10)+d.options.gapVertical,c=d.localColumnWidth-d.options.gapVertical,d.blocks.each(function(b,d){d.style.width=c+"px",a(d).data("cbp").width=c}),d.blocks.each(function(b,c){var d=a(c);d.data("cbp").height=d.outerHeight()})},_getColumnsAuto:function(){var a=this;return Math.max(Math.round(a.width/a.localColumnWidth),1)},_getColumnsBreakpoints:function(){var b,c=this,e=c.width-c.options.gapVertical;return a.each(c.options.mediaQueries,function(a,c){return e>=c.width?(b=c.cols,!1):void 0}),b===d&&(b=c.options.mediaQueries[c.options.mediaQueries.length-1].cols),b},_resizeMainContainer:function(){var a,b=this,c=b.sliderColVert||b.colVert;a=Math.max(Math.max.apply(Math,c)-b.options.gapHorizontal,0),a!==b.height&&(b.obj.style.height=a+"px",b.height!==d&&(e.Private.modernBrowser?b.$obj.one(e.Private.transitionend,function(){b.$obj.trigger("pluginResize.cbp")}):b.$obj.trigger("pluginResize.cbp")),b.height=a)},_filter:function(a){var b=this;b.blocksOnInitial=b.blocksOn,b.blocksOn=b.blocks.filter(a),b.blocksOff=b.blocks.not(a),b._layout(),b.filterLayout(a)},filterLayout:function(){var b=this;b.blocksOff.addClass("cbp-item-off"),b.blocksOn.removeClass("cbp-item-off").each(function(b,c){var d=a(c).data("cbp");d.left=d.leftNew,d.top=d.topNew,c.style.left=d.left+"px",c.style.top=d.top+"px"}),b._resizeMainContainer(),b.filterFinish()},filterFinish:function(){var a=this;a.isAnimating=!1,a.$obj.trigger("filterComplete.cbp"),a._triggerEvent("filterFinish")},_registerEvent:function(a,b,c){var d=this;d.registeredEvents[a]||(d.registeredEvents[a]=[]),d.registeredEvents[a].push({func:b,oneTime:c||!1})},_triggerEvent:function(a,b){var c,d,e=this;if(e.skipEvents[a])return void delete e.skipEvents[a];if(e.registeredEvents[a])for(c=0,d=e.registeredEvents[a].length;d>c;c++)e.registeredEvents[a][c].func.call(e,b),e.registeredEvents[a][c].oneTime&&(e.registeredEvents[a].splice(c,1),c--,d--)},_skipNextEvent:function(a){var b=this;b.skipEvents[a]=!0},_addItems:function(b,c){var d=this,f=a(b).filter(".cbp-item").addClass("cbp-loading-fadeIn").css("top","1000%").wrapInner('<div class="cbp-item-wrapper"></div>');return f.length?void d._load(f,function(){d.$obj.addClass("cbp-addItems"),f.appendTo(d.$ul),a.merge(d.blocks,f),d.storeData(f),"*"!==d.defaultFilter?(d.blocksOn=d.blocks.filter(d.defaultFilter),d.blocks.not(d.defaultFilter).addClass("cbp-item-off")):d.blocksOn=d.blocks,f.on(e.Private.animationend,function(){d.$obj.find(".cbp-loading-fadeIn").removeClass("cbp-loading-fadeIn"),d.$obj.removeClass("cbp-addItems")}),d._triggerEvent("addItemsToDOM",f),d._gridAdjust(),d._layout(),d.positionateItems(),d._resizeMainContainer(),"slider"===d.options.layoutMode&&d._updateSlider(),d.elems&&e.Public.showCounter.call(d.obj,d.elems),e.Private.modernBrowser?f.last().one(e.Private.animationend,function(){d.isAnimating=!1,a.isFunction(c)&&c.call(d)}):(d.isAnimating=!1,a.isFunction(c)&&c.call(d))}):(d.isAnimating=!1,void(a.isFunction(c)&&c.call(d)))}}),a.fn.cubeportfolio=function(a,b,c){return this.each(function(){if("object"==typeof a||!a)return e.Public.init.call(this,a,c);if(e.Public[a])return e.Public[a].call(this,b,c);throw new Error("Method "+a+" does not exist on jquery.cubeportfolio.js")})},a.fn.cubeportfolio.options={filters:"",loadMore:"",loadMoreAction:"click",layoutMode:"grid",drag:!0,auto:!1,autoTimeout:5e3,autoPauseOnHover:!0,showNavigation:!0,showPagination:!0,rewindNav:!0,scrollByPage:!1,defaultFilter:"*",filterDeeplinking:!1,animationType:"fadeOut",gridAdjustment:"responsive",mediaQueries:!1,gapHorizontal:10,gapVertical:10,caption:"pushTop",displayType:"lazyLoading",displayTypeSpeed:400,lightboxDelegate:".cbp-lightbox",lightboxGallery:!0,lightboxTitleSrc:"data-title",lightboxCounter:'<div class="cbp-popup-lightbox-counter">{{current}} of {{total}}</div>',singlePageDelegate:".cbp-singlePage",singlePageDeeplinking:!0,singlePageStickyNavigation:!0,singlePageCounter:'<div class="cbp-popup-singlePage-counter">{{current}} of {{total}}</div>',singlePageAnimation:"left",singlePageCallback:function(){},singlePageInlineDelegate:".cbp-singlePageInline",singlePageInlinePosition:"top",singlePageInlineInFocus:!0,singlePageInlineCallback:function(){}},e.Plugins={},a.fn.cubeportfolio.Constructor=e}(jQuery,window,document),function(a){"use strict";function b(b){var c=this;c.parent=b,c.filters=a(b.options.filters),c.wrap=a(),c.registerFilter()}var c=a.fn.cubeportfolio.Constructor;b.prototype.registerFilter=function(){var b,c=this,d=c.parent;c.filters.each(function(e,f){var g,h=a(f);h.hasClass("cbp-l-filters-dropdown")?(g=h.find(".cbp-l-filters-dropdownWrap"),g.on({"mouseover.cbp":function(){g.addClass("cbp-l-filters-dropdownWrap-open")},"mouseleave.cbp":function(){g.removeClass("cbp-l-filters-dropdownWrap-open")}}),b=function(a){g.find(".cbp-filter-item").removeClass("cbp-filter-item-active"),g.find(".cbp-l-filters-dropdownHeader").text(a.text()),a.addClass("cbp-filter-item-active"),g.trigger("mouseleave.cbp")},c.wrap.add(g)):b=function(a){a.addClass("cbp-filter-item-active").siblings().removeClass("cbp-filter-item-active")},b(h.find(".cbp-filter-item").filter('[data-filter="'+d.defaultFilter+'"]')),h.on("click.cbp",".cbp-filter-item",function(){var c=a(this);c.hasClass("cbp-filter-item-active")||(d.isAnimating||b.call(null,c),d.$obj.cubeportfolio("filter",c.data("filter")))}),d.$obj.cubeportfolio("showCounter",h.find(".cbp-filter-item"),function(){var a,c=/#cbpf=(.*?)([#|?&]|$)/gi.exec(location.href);null!==c&&(a=h.find(".cbp-filter-item").filter('[data-filter="'+c[1]+'"]'),a.length&&b.call(null,a))})})},b.prototype.destroy=function(){var a=this;a.filters.off(".cbp"),a.wrap&&a.wrap.off(".cbp")},c.Plugins.Filters=function(a){return""===a.options.filters?null:new b(a)}}(jQuery,window,document),function(a,b){"use strict";function c(b){var c=this;c.parent=b,c.loadMore=a(b.options.loadMore).find(".cbp-l-loadMore-link"),b.options.loadMoreAction.length&&c[b.options.loadMoreAction]()}var d=a.fn.cubeportfolio.Constructor;c.prototype.click=function(){var b=this,c=0;b.loadMore.on("click.cbp",function(d){var e=a(this);d.preventDefault(),e.hasClass("cbp-l-loadMore-stop")||(e.addClass("cbp-l-loadMore-loading"),c++,a.ajax({url:b.loadMore.attr("href"),type:"GET",dataType:"HTML"}).done(function(d){var f,g;f=a(d).filter(function(){return a(this).is("div.cbp-loadMore-block"+c)}),b.parent.$obj.cubeportfolio("appendItems",f.html(),function(){e.removeClass("cbp-l-loadMore-loading"),g=a(d).filter(function(){return a(this).is("div.cbp-loadMore-block"+(c+1))}),0===g.length&&e.addClass("cbp-l-loadMore-stop")})}).fail(function(){}))})},c.prototype.auto=function(){var c=this;c.parent.$obj.on("initComplete.cbp",function(){Object.create({init:function(){var d=this;
28d.isActive=!1,d.numberOfClicks=0,c.loadMore.addClass("cbp-l-loadMore-loading"),d.window=a(b),d.addEvents(),d.getNewItems()},addEvents:function(){var a,b=this;c.loadMore.on("click.cbp",function(a){a.preventDefault()}),b.window.on("scroll.loadMoreObject",function(){clearTimeout(a),a=setTimeout(function(){c.parent.isAnimating||b.getNewItems()},80)}),c.parent.$obj.on("filterComplete.cbp",function(){b.getNewItems()})},getNewItems:function(){var b,d,e=this;e.isActive||c.loadMore.hasClass("cbp-l-loadMore-stop")||(b=c.loadMore.offset().top,d=e.window.scrollTop()+e.window.height(),b>d||(e.isActive=!0,e.numberOfClicks++,a.ajax({url:c.loadMore.attr("href"),type:"GET",dataType:"HTML",cache:!0}).done(function(b){var d,f;d=a(b).filter(function(){return a(this).is("div.cbp-loadMore-block"+e.numberOfClicks)}),c.parent.$obj.cubeportfolio("appendItems",d.html(),function(){f=a(b).filter(function(){return a(this).is("div.cbp-loadMore-block"+(e.numberOfClicks+1))}),0===f.length?(c.loadMore.addClass("cbp-l-loadMore-stop"),e.window.off("scroll.loadMoreObject"),c.parent.$obj.off("filterComplete.cbp")):(e.isActive=!1,e.window.trigger("scroll.loadMoreObject"))})}).fail(function(){e.isActive=!1})))}}).init()})},c.prototype.destroy=function(){var c=this;c.loadMore.off(".cbp"),a(b).off("scroll.loadMoreObject")},d.Plugins.LoadMore=function(a){return""===a.options.loadMore?null:new c(a)}}(jQuery,window,document),function(a,b,c){"use strict";function d(a){var b=this;b.parent=a,a.options.lightboxShowCounter===!1&&(a.options.lightboxCounter=""),a.options.singlePageShowCounter===!1&&(a.options.singlePageCounter=""),b.run()}var e=a.fn.cubeportfolio.Constructor,f={init:function(b,d){var e,f=this;if(f.cubeportfolio=b,f.type=d,f.isOpen=!1,f.options=f.cubeportfolio.options,"lightbox"===d&&f.cubeportfolio._registerEvent("resizeWindow",function(){f.resizeImage()}),"singlePageInline"===d)return f.startInline=-1,f.height=0,f._createMarkupSinglePageInline(),void f.cubeportfolio._registerEvent("resizeGrid",function(){f.isOpen&&f.close()});if(f._createMarkup(),"singlePage"===d&&(f.cubeportfolio._registerEvent("resizeWindow",function(){if(f.options.singlePageStickyNavigation){var a=f.wrap[0].clientWidth;a>0&&(f.navigationWrap.width(a),f.navigation.width(a))}}),f.options.singlePageDeeplinking)){f.url=location.href,"#"===f.url.slice(-1)&&(f.url=f.url.slice(0,-1));var g=f.url.split("#cbp="),h=g.shift();if(a.each(g,function(b,c){return f.cubeportfolio.blocksOn.each(function(b,d){var g=a(d).find(f.options.singlePageDelegate+'[href="'+c+'"]');return g.length?(e=g,!1):void 0}),e?!1:void 0}),e){f.url=h;var i=e,j=i.attr("data-cbp-singlePage"),k=[];j?k=i.closest(a(".cbp-item")).find('[data-cbp-singlePage="'+j+'"]'):f.cubeportfolio.blocksOn.each(function(b,c){var d=a(c);d.not(".cbp-item-off")&&d.find(f.options.singlePageDelegate).each(function(b,c){a(c).attr("data-cbp-singlePage")||k.push(c)})}),f.openSinglePage(k,e[0])}else if(g.length){var l=c.createElement("a");l.setAttribute("href",g[0]),f.openSinglePage([l],l)}}},_createMarkup:function(){var b=this,d="";"singlePage"===b.type&&"left"!==b.options.singlePageAnimation&&(d=" cbp-popup-singlePage-"+b.options.singlePageAnimation),b.wrap=a("<div/>",{"class":"cbp-popup-wrap cbp-popup-"+b.type+d,"data-action":"lightbox"===b.type?"close":""}).on("click.cbp",function(c){if(!b.stopEvents){var d=a(c.target).attr("data-action");b[d]&&(b[d](),c.preventDefault())}}),b.content=a("<div/>",{"class":"cbp-popup-content"}).appendTo(b.wrap),a("<div/>",{"class":"cbp-popup-loadingBox"}).appendTo(b.wrap),"ie8"===e.Private.browser&&(b.bg=a("<div/>",{"class":"cbp-popup-ie8bg","data-action":"lightbox"===b.type?"close":""}).appendTo(b.wrap)),b.navigationWrap=a("<div/>",{"class":"cbp-popup-navigation-wrap"}).appendTo(b.wrap),b.navigation=a("<div/>",{"class":"cbp-popup-navigation"}).appendTo(b.navigationWrap),b.closeButton=a("<div/>",{"class":"cbp-popup-close",title:"Close (Esc arrow key)","data-action":"close"}).appendTo(b.navigation),b.nextButton=a("<div/>",{"class":"cbp-popup-next",title:"Next (Right arrow key)","data-action":"next"}).appendTo(b.navigation),b.prevButton=a("<div/>",{"class":"cbp-popup-prev",title:"Previous (Left arrow key)","data-action":"prev"}).appendTo(b.navigation),"singlePage"===b.type&&(b.options.singlePageCounter&&(b.counter=a(b.options.singlePageCounter).appendTo(b.navigation),b.counter.text("")),b.content.on("click.cbp",b.options.singlePageDelegate,function(a){a.preventDefault();var c,d=b.dataArray.length,e=this.getAttribute("href");for(c=0;d>c&&b.dataArray[c].url!==e;c++);b.singlePageJumpTo(c-b.current)}),b.wrap.on("mousewheel.cbp DOMMouseScroll.cbp",function(a){a.stopImmediatePropagation()})),a(c).on("keydown.cbp",function(a){b.isOpen&&(b.stopEvents||(37===a.keyCode?b.prev():39===a.keyCode?b.next():27===a.keyCode&&b.close()))})},_createMarkupSinglePageInline:function(){var b=this;b.wrap=a("<div/>",{"class":"cbp-popup-singlePageInline"}).on("click.cbp",function(c){if(!b.stopEvents){var d=a(c.target).attr("data-action");d&&b[d]&&(b[d](),c.preventDefault())}}),b.content=a("<div/>",{"class":"cbp-popup-content"}).appendTo(b.wrap),b.navigation=a("<div/>",{"class":"cbp-popup-navigation"}).appendTo(b.wrap),b.closeButton=a("<div/>",{"class":"cbp-popup-close",title:"Close (Esc arrow key)","data-action":"close"}).appendTo(b.navigation)},destroy:function(){var b=this,d=a("body");
28a(c).off("keydown.cbp"),d.off("click.cbp",b.options.lightboxDelegate),d.off("click.cbp",b.options.singlePageDelegate),b.content.off("click.cbp",b.options.singlePageDelegate),b.cubeportfolio.$obj.off("click.cbp",b.options.singlePageInlineDelegate),b.cubeportfolio.$obj.off("click.cbp",b.options.lightboxDelegate),b.cubeportfolio.$obj.off("click.cbp",b.options.singlePageDelegate),b.cubeportfolio.$obj.removeClass("cbp-popup-isOpening"),b.cubeportfolio.$obj.find(".cbp-item").removeClass("cbp-singlePageInline-active"),b.wrap.remove()},openLightbox:function(d,e){var f,g,h=this,i=0,j=[];if(!h.isOpen){if(h.isOpen=!0,h.stopEvents=!1,h.dataArray=[],h.current=null,f=e.getAttribute("href"),null===f)throw new Error("HEI! Your clicked element doesn't have a href attribute.");a.each(d,function(b,c){var d,e=c.getAttribute("href"),g=e,k="isImage";if(-1===a.inArray(e,j)){if(f===e)h.current=i;else if(!h.options.lightboxGallery)return;/youtube/i.test(e)?(d=e.substring(e.lastIndexOf("v=")+2),/autoplay=/i.test(d)||(d+="&autoplay=1"),d=d.replace(/\?|&/,"?"),g="//www.youtube.com/embed/"+d,k="isYoutube"):/vimeo/i.test(e)?(d=e.substring(e.lastIndexOf("/")+1),/autoplay=/i.test(d)||(d+="&autoplay=1"),d=d.replace(/\?|&/,"?"),g="//player.vimeo.com/video/"+d,k="isVimeo"):/ted\.com/i.test(e)?(g="http://embed.ted.com/talks/"+e.substring(e.lastIndexOf("/")+1)+".html",k="isTed"):/soundcloud\.com/i.test(e)?(g=e,k="isSoundCloud"):/(\.mp4)|(\.ogg)|(\.ogv)|(\.webm)/i.test(e)?(g=e.split(-1!==e.indexOf("|")?"|":"%7C"),k="isSelfHostedVideo"):/\.mp3$/i.test(e)&&(g=e,k="isSelfHostedAudio"),h.dataArray.push({src:g,title:c.getAttribute(h.options.lightboxTitleSrc),type:k}),i++}j.push(e)}),h.counterTotal=h.dataArray.length,1===h.counterTotal?(h.nextButton.hide(),h.prevButton.hide(),h.dataActionImg=""):(h.nextButton.show(),h.prevButton.show(),h.dataActionImg='data-action="next"'),h.wrap.appendTo(c.body),h.scrollTop=a(b).scrollTop(),h.originalStyle=a("html").attr("style"),a("html").css({overflow:"hidden",paddingRight:b.innerWidth-a(c).width()}),h.wrap.show(),g=h.dataArray[h.current],h[g.type](g)}},openSinglePage:function(d,f){var g,h=this,i=0,j=[];if(!h.isOpen){if(h.cubeportfolio.singlePageInline&&h.cubeportfolio.singlePageInline.isOpen&&h.cubeportfolio.singlePageInline.close(),h.isOpen=!0,h.stopEvents=!1,h.dataArray=[],h.current=null,g=f.getAttribute("href"),null===g)throw new Error("HEI! Your clicked element doesn't have a href attribute.");if(a.each(d,function(b,c){var d=c.getAttribute("href");-1===a.inArray(d,j)&&(g===d&&(h.current=i),h.dataArray.push({url:d,element:c}),i++),j.push(d)}),h.counterTotal=h.dataArray.length,1===h.counterTotal?(h.nextButton.hide(),h.prevButton.hide()):(h.nextButton.show(),h.prevButton.show()),h.wrap.appendTo(c.body),h.scrollTop=a(b).scrollTop(),a("html").css({overflow:"hidden",paddingRight:b.innerWidth-a(c).width()}),h.wrap.scrollTop(0),h.wrap.show(),h.finishOpen=2,h.navigationMobile=a(),h.wrap.one(e.Private.transitionend,function(){var b;h.options.singlePageStickyNavigation&&(h.wrap.addClass("cbp-popup-singlePage-sticky"),b=h.wrap[0].clientWidth,h.navigationWrap.width(b),("android"===e.Private.browser||"ios"===e.Private.browser)&&(h.navigationMobile=a("<div/>",{"class":"cbp-popup-singlePage cbp-popup-singlePage-sticky",id:h.wrap.attr("id")}).on("click.cbp",function(b){if(!h.stopEvents){var c=a(b.target).attr("data-action");h[c]&&(h[c](),b.preventDefault())}}),h.navigationMobile.appendTo(c.body).append(h.navigationWrap))),h.finishOpen--,h.finishOpen<=0&&h.updateSinglePageIsOpen.call(h)}),"ie8"===e.Private.browser||"ie9"===e.Private.browser){if(h.options.singlePageStickyNavigation){var k=h.wrap[0].clientWidth;h.navigationWrap.width(k),setTimeout(function(){h.wrap.addClass("cbp-popup-singlePage-sticky")},1e3)}h.finishOpen--}h.wrap.addClass("cbp-popup-loading"),h.wrap.offset(),h.wrap.addClass("cbp-popup-singlePage-open"),h.options.singlePageDeeplinking&&(h.url=h.url.split("#cbp=")[0],location.href=h.url+"#cbp="+h.dataArray[h.current].url),a.isFunction(h.options.singlePageCallback)&&h.options.singlePageCallback.call(h,h.dataArray[h.current].url,h.dataArray[h.current].element)}},openSinglePageInline:function(c,d,e){var f,g,h,i,j=this;if(e=e||!1,j.fromOpen=e,j.storeBlocks=c,j.storeCurrentBlock=d,j.isOpen)return g=a(d).closest(".cbp-item").index(),void(j.dataArray[j.current].url!==d.getAttribute("href")||j.current!==g?j.cubeportfolio.singlePageInline.close("open",{blocks:c,currentBlock:d,fromOpen:!0}
28):j.close());if(j.isOpen=!0,j.stopEvents=!1,j.dataArray=[],j.current=null,f=d.getAttribute("href"),null===f)throw new Error("HEI! Your clicked element doesn't have a href attribute.");if(h=a(d).closest(".cbp-item")[0],c.each(function(a,b){h===b&&(j.current=a)}),j.dataArray[j.current]={url:f,element:d},i=a(j.dataArray[j.current].element).parents(".cbp-item").addClass("cbp-singlePageInline-active"),j.counterTotal=c.length,j.wrap.insertBefore(j.cubeportfolio.wrapper),"top"===j.options.singlePageInlinePosition?(j.startInline=0,j.top=0,j.firstRow=!0,j.lastRow=!1):"bottom"===j.options.singlePageInlinePosition?(j.startInline=j.counterTotal,j.top=j.cubeportfolio.height,j.firstRow=!1,j.lastRow=!0):"above"===j.options.singlePageInlinePosition?(j.startInline=j.cubeportfolio.cols*Math.floor(j.current/j.cubeportfolio.cols),j.top=a(c[j.current]).data("cbp").top,0===j.startInline?j.firstRow=!0:(j.top-=j.options.gapHorizontal,j.firstRow=!1),j.lastRow=!1):(j.top=a(c[j.current]).data("cbp").top+a(c[j.current]).data("cbp").height,j.startInline=Math.min(j.cubeportfolio.cols*(Math.floor(j.current/j.cubeportfolio.cols)+1),j.counterTotal),j.firstRow=!1,j.lastRow=j.startInline===j.counterTotal?!0:!1),j.wrap[0].style.height=j.wrap.outerHeight(!0)+"px",j.deferredInline=a.Deferred(),j.options.singlePageInlineInFocus){j.scrollTop=a(b).scrollTop();var k=j.cubeportfolio.$obj.offset().top+j.top-100;j.scrollTop!==k?a("html,body").animate({scrollTop:k},350).promise().then(function(){j._resizeSinglePageInline(),j.deferredInline.resolve()}):(j._resizeSinglePageInline(),j.deferredInline.resolve())}else j._resizeSinglePageInline(),j.deferredInline.resolve();j.cubeportfolio.$obj.addClass("cbp-popup-singlePageInline-open"),j.wrap.css({top:j.top}),a.isFunction(j.options.singlePageInlineCallback)&&j.options.singlePageInlineCallback.call(j,j.dataArray[j.current].url,j.dataArray[j.current].element)},_resizeSinglePageInline:function(){var a=this;a.height=a.firstRow||a.lastRow?a.wrap.outerHeight(!0):a.wrap.outerHeight(!0)-a.options.gapHorizontal,a.storeBlocks.each(function(b,c){b<a.startInline?e.Private.modernBrowser?c.style[e.Private.transform]="":c.style.marginTop="":e.Private.modernBrowser?c.style[e.Private.transform]="translate3d(0px, "+a.height+"px, 0)":c.style.marginTop=a.height+"px"}),a.cubeportfolio.obj.style.height=a.cubeportfolio.height+a.height+"px"},_revertResizeSinglePageInline:function(){var b=this;b.deferredInline=a.Deferred(),b.storeBlocks.each(function(a,b){e.Private.modernBrowser?b.style[e.Private.transform]="":b.style.marginTop=""}),b.cubeportfolio.obj.style.height=b.cubeportfolio.height+"px"},appendScriptsToWrap:function(a){var b=this,d=0,e=function(f){var g=c.createElement("script"),h=f.src;g.type="text/javascript",g.readyState?g.onreadystatechange=function(){("loaded"==g.readyState||"complete"==g.readyState)&&(g.onreadystatechange=null,d++,a[d]&&e(a[d]))}:g.onload=function(){d++,a[d]&&e(a[d])},h?g.src=h:g.text=f.text,b.content[0].appendChild(g)};e(a[0])},updateSinglePage:function(b,c,d){var e,f=this;f.content.addClass("cbp-popup-content").removeClass("cbp-popup-content-basic"),d===!1&&f.content.removeClass("cbp-popup-content").addClass("cbp-popup-content-basic"),f.counter&&(e=a(f._getCounterMarkup(f.options.singlePageCounter,f.current+1,f.counterTotal)),f.counter.text(e.text())),f.content.html(b),c&&f.appendScriptsToWrap(c),f.cubeportfolio.$obj.trigger("updateSinglePageStart.cbp"),f.finishOpen--,f.finishOpen<=0&&f.updateSinglePageIsOpen.call(f)},updateSinglePageIsOpen:function(){var b,c=this;c.wrap.addClass("cbp-popup-ready"),c.wrap.removeClass("cbp-popup-loading"),b=c.content.find(".cbp-slider"),b?(b.find(".cbp-slider-item").addClass("cbp-item"),c.slider=b.cubeportfolio({layoutMode:"slider",mediaQueries:[{width:1,cols:1}],gapHorizontal:0,gapVertical:0,caption:"",coverRatio:""})):c.slider=null,("android"===e.Private.browser||"ios"===e.Private.browser)&&a("html").css({position:"fixed"}),c.cubeportfolio.$obj.trigger("updateSinglePageComplete.cbp")},updateSinglePageInline:function(a,b){var c=this;c.content.html(a),b&&c.appendScriptsToWrap(b),c.cubeportfolio.$obj.trigger("updateSinglePageInlineStart.cbp"),c.singlePageInlineIsOpen.call(c)},singlePageInlineIsOpen:function(){function a(){b.wrap.addClass("cbp-popup-singlePageInline-ready"), 29b.wrap[0].style.height="",b._resizeSinglePageInline(),b.cubeportfolio.$obj.trigger("updateSinglePageInlineComplete.cbp")}var b=this;
29b.cubeportfolio._load(b.wrap,function(){var c=b.content.find(".cbp-slider");c.length?(c.find(".cbp-slider-item").addClass("cbp-item"),c.one("initComplete.cbp",function(){b.deferredInline.done(a)}),c.on("pluginResize.cbp",function(){b.deferredInline.done(a)}),b.slider=c.cubeportfolio({layoutMode:"slider",displayType:"default",mediaQueries:[{width:1,cols:1}],gapHorizontal:0,gapVertical:0,caption:"",coverRatio:""})):(b.slider=null,b.deferredInline.done(a))})},isImage:function(b){var c=this,d=new Image;c.tooggleLoading(!0),a('<img src="'+b.src+'">').is("img:uncached")?(a(d).on("load.cbp error.cbp",function(){c.updateImagesMarkup(b.src,b.title,c._getCounterMarkup(c.options.lightboxCounter,c.current+1,c.counterTotal)),c.tooggleLoading(!1)}),d.src=b.src):(c.updateImagesMarkup(b.src,b.title,c._getCounterMarkup(c.options.lightboxCounter,c.current+1,c.counterTotal)),c.tooggleLoading(!1))},isVimeo:function(a){var b=this;b.updateVideoMarkup(a.src,a.title,b._getCounterMarkup(b.options.lightboxCounter,b.current+1,b.counterTotal))},isYoutube:function(a){var b=this;b.updateVideoMarkup(a.src,a.title,b._getCounterMarkup(b.options.lightboxCounter,b.current+1,b.counterTotal))},isTed:function(a){var b=this;b.updateVideoMarkup(a.src,a.title,b._getCounterMarkup(b.options.lightboxCounter,b.current+1,b.counterTotal))},isSoundCloud:function(a){var b=this;b.updateVideoMarkup(a.src,a.title,b._getCounterMarkup(b.options.lightboxCounter,b.current+1,b.counterTotal))},isSelfHostedVideo:function(a){var b=this;b.updateSelfHostedVideo(a.src,a.title,b._getCounterMarkup(b.options.lightboxCounter,b.current+1,b.counterTotal))},isSelfHostedAudio:function(a){var b=this;b.updateSelfHostedAudio(a.src,a.title,b._getCounterMarkup(b.options.lightboxCounter,b.current+1,b.counterTotal))},_getCounterMarkup:function(a,b,c){if(!a.length)return"";var d={current:b,total:c};return a.replace(/\{\{current}}|\{\{total}}/gi,function(a){return d[a.slice(2,-2)]})},updateSelfHostedVideo:function(a,b,c){var d,e=this;e.wrap.addClass("cbp-popup-lightbox-isIframe");var f='<div class="cbp-popup-lightbox-iframe"><video controls="controls" height="auto" style="width: 100%">';for(d=0;d<a.length;d++)/(\.mp4)/i.test(a[d])?f+='<source src="'+a[d]+'" type="video/mp4">':/(\.ogg)|(\.ogv)/i.test(a[d])?f+='<source src="'+a[d]+'" type="video/ogg">':/(\.webm)/i.test(a[d])&&(f+='<source src="'+a[d]+'" type="video/webm">');f+='Your browser does not support the video tag.</video><div class="cbp-popup-lightbox-bottom">'+(b?'<div class="cbp-popup-lightbox-title">'+b+"</div>":"")+c+"</div></div>",e.content.html(f),e.wrap.addClass("cbp-popup-ready"),e.preloadNearbyImages()},updateSelfHostedAudio:function(a,b,c){var d=this;d.wrap.addClass("cbp-popup-lightbox-isIframe");var e='<div class="cbp-popup-lightbox-iframe"><audio controls="controls" height="auto" style="width: 100%"><source src="'+a+'" type="audio/mpeg">Your browser does not support the audio tag.</audio><div class="cbp-popup-lightbox-bottom">'+(b?'<div class="cbp-popup-lightbox-title">'+b+"</div>":"")+c+"</div></div>";d.content.html(e),d.wrap.addClass("cbp-popup-ready"),d.preloadNearbyImages()},updateVideoMarkup:function(a,b,c){var d=this;d.wrap.addClass("cbp-popup-lightbox-isIframe");var e='<div class="cbp-popup-lightbox-iframe"><iframe src="'+a+'" frameborder="0" allowfullscreen scrolling="no"></iframe><div class="cbp-popup-lightbox-bottom">'+(b?'<div class="cbp-popup-lightbox-title">'+b+"</div>":"")+c+"</div></div>";d.content.html(e),d.wrap.addClass("cbp-popup-ready"),d.preloadNearbyImages()},updateImagesMarkup:function(a,b,c){var d=this;d.wrap.removeClass("cbp-popup-lightbox-isIframe");var e='<div class="cbp-popup-lightbox-figure"><img src="'+a+'" class="cbp-popup-lightbox-img" '+d.dataActionImg+' /><div class="cbp-popup-lightbox-bottom">'+(b?'<div class="cbp-popup-lightbox-title">'+b+"</div>":"")+c+"</div></div>";d.content.html(e),d.wrap.addClass("cbp-popup-ready"),d.resizeImage(),d.preloadNearbyImages()},next:function(){var a=this;a[a.type+"JumpTo"](1)},prev:function(){var a=this;a[a.type+"JumpTo"](-1)},lightboxJumpTo:function(a){var b,c=this;
29c.current=c.getIndex(c.current+a),b=c.dataArray[c.current],c[b.type](b)},singlePageJumpTo:function(b){var c=this;c.current=c.getIndex(c.current+b),a.isFunction(c.options.singlePageCallback)&&(c.resetWrap(),c.wrap.scrollTop(0),c.wrap.addClass("cbp-popup-loading"),c.options.singlePageCallback.call(c,c.dataArray[c.current].url,c.dataArray[c.current].element),c.options.singlePageDeeplinking&&(location.href=c.url+"#cbp="+c.dataArray[c.current].url))},resetWrap:function(){var a=this;"singlePage"===a.type&&a.options.singlePageDeeplinking&&(location.href=a.url+"#")},getIndex:function(a){var b=this;return a%=b.counterTotal,0>a&&(a=b.counterTotal+a),a},close:function(c,d){function f(){h.content.html(""),h.wrap.detach(),h.cubeportfolio.$obj.removeClass("cbp-popup-singlePageInline-open cbp-popup-singlePageInline-close"),"promise"===c&&a.isFunction(d.callback)&&d.callback.call(h.cubeportfolio)}function g(){h.options.singlePageInlineInFocus&&"promise"!==c?a("html,body").animate({scrollTop:h.scrollTop},350).promise().then(function(){f()}):f()}var h=this;h.isOpen=!1,"singlePageInline"===h.type?"open"===c?(h.wrap.removeClass("cbp-popup-singlePageInline-ready"),a(h.dataArray[h.current].element).closest(".cbp-item").removeClass("cbp-singlePageInline-active"),h.openSinglePageInline(d.blocks,d.currentBlock,d.fromOpen)):(h.height=0,h._revertResizeSinglePageInline(),h.wrap.removeClass("cbp-popup-singlePageInline-ready"),h.cubeportfolio.$obj.addClass("cbp-popup-singlePageInline-close"),h.startInline=-1,h.cubeportfolio.$obj.find(".cbp-item").removeClass("cbp-singlePageInline-active"),e.Private.modernBrowser?h.wrap.one(e.Private.transitionend,function(){g()}):g()):"singlePage"===h.type?(h.resetWrap(),h.wrap.removeClass("cbp-popup-ready"),("android"===e.Private.browser||"ios"===e.Private.browser)&&(a("html").css({position:""}),h.navigationWrap.appendTo(h.wrap),h.navigationMobile.remove()),a(b).scrollTop(h.scrollTop),setTimeout(function(){h.stopScroll=!0,h.navigationWrap.css({top:h.wrap.scrollTop()}),h.wrap.removeClass("cbp-popup-singlePage-open cbp-popup-singlePage-sticky"),("ie8"===e.Private.browser||"ie9"===e.Private.browser)&&(h.content.html(""),h.wrap.detach(),a("html").css({overflow:"",paddingRight:"",position:""}),h.navigationWrap.removeAttr("style"))},0),h.wrap.one(e.Private.transitionend,function(){h.content.html(""),h.wrap.detach(),a("html").css({overflow:"",paddingRight:"",position:""}),h.navigationWrap.removeAttr("style")})):(h.originalStyle?a("html").attr("style",h.originalStyle):a("html").css({overflow:"",paddingRight:""}),a(b).scrollTop(h.scrollTop),h.content.html(""),h.wrap.detach())},tooggleLoading:function(a){var b=this;b.stopEvents=a,b.wrap[a?"addClass":"removeClass"]("cbp-popup-loading")},resizeImage:function(){if(this.isOpen){var c=a(b).height(),d=this.content.find("img"),e=parseInt(d.css("margin-top"),10)+parseInt(d.css("margin-bottom"),10);d.css("max-height",c-e+"px")}},preloadNearbyImages:function(){var b,c,d=[],e=this;d.push(e.getIndex(e.current+1)),d.push(e.getIndex(e.current+2)),d.push(e.getIndex(e.current+3)),d.push(e.getIndex(e.current-1)),d.push(e.getIndex(e.current-2)),d.push(e.getIndex(e.current-3));for(var f=d.length-1;f>=0;f--)"isImage"===e.dataArray[d[f]].type&&(c=e.dataArray[d[f]].src,b=new Image,a('<img src="'+c+'">').is("img:uncached")&&(b.src=c))}},g=!1,h=!1;d.prototype.run=function(){var b=this,d=b.parent,e=a(c.body);d.lightbox=null,d.options.lightboxDelegate&&!g&&(g=!0,d.lightbox=Object.create(f),d.lightbox.init(d,"lightbox"),e.on("click.cbp",d.options.lightboxDelegate,function(c){c.preventDefault();var e=a(this),f=e.attr("data-cbp-lightbox"),g=b.detectScope(e),h=g.data("cubeportfolio"),i=[];h?h.blocksOn.each(function(b,c){var e=a(c);e.not(".cbp-item-off")&&e.find(d.options.lightboxDelegate).each(function(b,c){f?a(c).attr("data-cbp-lightbox")===f&&i.push(c):i.push(c)})}):i=g.find(f?d.options.lightboxDelegate+"[data-cbp-lightbox="+f+"]":d.options.lightboxDelegate),d.lightbox.openLightbox(i,e[0])})),d.singlePage=null,d.options.singlePageDelegate&&!h&&(h=!0,d.singlePage=Object.create(f),d.singlePage.init(d,"singlePage"),e.on("click.cbp",d.options.singlePageDelegate,function(c){c.preventDefault();var e=a(this),f=e.attr("data-cbp-singlePage"),g=b.detectScope(e),h=g.data("cubeportfolio"),i=[];h?h.blocksOn.each(function(b,c){var e=a(c);e.not(".cbp-item-off")&&e.find(d.options.singlePageDelegate).each(function(b,c){f?a(c).attr("data-cbp-singlePage")===f&&i.push(c):i.push(c)})}):i=g.find(f?d.options.singlePageDelegate+"[data-cbp-singlePage="+f+"]":d.options.singlePageDelegate),d.singlePage.openSinglePage(i,e[0])})),d.singlePageInline=null,d.options.singlePageDelegate&&(d.singlePageInline=Object.create(f),d.singlePageInline.init(d,"singlePageInline"),d.$obj.on("click.cbp",d.options.singlePageInlineDelegate,function(a){a.preventDefault(),d.singlePageInline.openSinglePageInline(d.blocksOn,this)}))},d.prototype.detectScope=function(b){var d,e,f;return d=b.closest(".cbp-popup-singlePageInline"),d.length?(f=b.closest(".cbp",d[0]),f.length?f:d):(e=b.closest(".cbp-popup-singlePage"),e.length?(f=b.closest(".cbp",e[0]),f.length?f:e):(f=b.closest(".cbp"),f.length?f:a(c.body)))},d.prototype.destroy=function(){var b=this.parent;a(c.body).off("click.cbp"),g=!1,h=!1,b.lightbox&&b.lightbox.destroy(),b.singlePage&&b.singlePage.destroy(),b.singlePageInline&&b.singlePageInline.destroy()},e.Plugins.PopUp=function(a){return new d(a)}}(jQuery,window,document),function(a,b,c,d){"use strict";var e=a.fn.cubeportfolio.Constructor;e.Private={checkInstance:function(b){var c=a.data(this,"cubeportfolio");if(!c)throw new Error("cubeportfolio is not initialized. Initialize it before calling "+b+" method!");return c},browserInfo:function(){var a,c,f,g=e.Private,h=navigator.appVersion;g.browser=-1!==h.indexOf("MSIE 8.")?"ie8":-1!==h.indexOf("MSIE 9.")?"ie9":-1!==h.indexOf("MSIE 10.")?"ie10":b.ActiveXObject||"ActiveXObject"in b?"ie11":/android/gi.test(h)?"android":/iphone|ipad|ipod/gi.test(h)?"ios":/c
29hrome/gi.test(h)?"chrome":"",f=g.styleSupport("perspective"),typeof f!==d&&(a=g.styleSupport("transition"),g.transitionend={WebkitTransition:"webkitTransitionEnd",transition:"transitionend"}[a],c=g.styleSupport("animation"),g.animationend={WebkitAnimation:"webkitAnimationEnd",animation:"animationend"}[c],g.animationDuration={WebkitAnimation:"webkitAnimationDuration",animation:"animationDuration"}[c],g.animationDelay={WebkitAnimation:"webkitAnimationDelay",animation:"animationDelay"}[c],g.transform=g.styleSupport("transform"),a&&c&&g.transform&&(g.modernBrowser=!0))},styleSupport:function(a){var b,d="Webkit"+a.charAt(0).toUpperCase()+a.slice(1),e=c.createElement("div");return a in e.style?b=a:d in e.style&&(b=d),e=null,b}},e.Private.browserInfo()}(jQuery,window,document),function(a,b,c){"use strict";var d=a.fn.cubeportfolio.Constructor;d.Public={init:function(a,b){new d(this,a,b)},destroy:function(e){var f=d.Private.checkInstance.call(this,"destroy");f._triggerEvent("beforeDestroy"),a.removeData(this,"cubeportfolio"),f.blocks.each(function(){a.removeData(this,"cbp-wxh")}),f.$obj.removeClass("cbp-ready cbp-addItemscbp-cols-"+f.cols).removeAttr("style"),f.$ul.removeClass("cbp-wrapper"),a(b).off("resize.cbp"),f.$obj.off(".cbp"),a(c).off(".cbp"),f.blocks.removeClass("cbp-item-off").removeAttr("style"),f.blocks.find(".cbp-item-wrapper").children().unwrap(),f.options.caption&&f._captionDestroy(),f._destroySlider(),f.$ul.unwrap(),f.addedWrapp&&f.blocks.unwrap(),a.each(f._plugins,function(a,b){"function"==typeof b.destroy&&b.destroy()}),a.isFunction(e)&&e.call(f),f._triggerEvent("afterDestroy")},filter:function(b,c){var e,f=d.Private.checkInstance.call(this,"filter");a.isFunction(c)&&f._registerEvent("filterFinish",c,!0),f.isAnimating||f.defaultFilter===b||(f.isAnimating=!0,f.defaultFilter=b,f.singlePageInline&&f.singlePageInline.isOpen?f.singlePageInline.close("promise",{callback:function(){f._filter(b)}}):f._filter(b),f.options.filterDeeplinking&&(e=location.href.replace(/#cbpf=(.*?)([#|?&]|$)/gi,""),location.href=e+"#cbpf="+b,f.singlePage&&f.singlePage.url&&(f.singlePage.url=location.href)))},showCounter:function(b,c){var e=d.Private.checkInstance.call(this,"showCounter");e.elems=b,a.each(b,function(){var b,c=a(this),d=c.data("filter");b=e.blocks.filter(d).length,c.find(".cbp-filter-counter").text(b)}),a.isFunction(c)&&c.call(e)},appendItems:function(a,b){var c=d.Private.checkInstance.call(this,"appendItems");c.isAnimating||(c.isAnimating=!0,c.singlePageInline&&c.singlePageInline.isOpen?c.singlePageInline.close("promise",{callback:function(){c._addItems(a,b)}}):c._addItems(a,b))}}}(jQuery,window,document),"function"!=typeof Object.create&&(Object.create=function(a){function b(){}return b.prototype=a,new b}),jQuery.expr[":"].uncached=function(a){if(!jQuery(a).is('img[src][src!=""]'))return!1;var b=new Image;return b.src=a.src,b.complete?void 0!==b.naturalWidth&&0===b.naturalWidth?!0:!1:!0},function(){for(var a=0,b=["moz","webkit"],c=0;c<b.length&&!window.requestAnimationFrame;++c)window.requestAnimationFrame=window[b[c]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[b[c]+"CancelAnimationFrame"]||window[b[c]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(b){var c=(new Date).getTime(),d=Math.max(0,16-(c-a)),e=window.setTimeout(function(){b(c+d)},d);return a=c+d,e}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(a){clearTimeout(a)})}(),function(a){"use strict";function b(a){var b=this;b.parent=a,a.filterLayout=b.filterLayout}var c=a.fn.cubeportfolio.Constructor;b.prototype.filterLayout=function(b){function d(){e.blocks.removeClass("cbp-item-on2off cbp-item-off2on cbp-item-on2on").each(function(b,d){var e=a(d).data("cbp");e.left=e.leftNew,e.top=e.topNew,d.style.left=e.left+"px",d.style.top=e.top+"px",d.style[c.Private.transform]=""}),e.blocksOff.addClass("cbp-item-off"),e.$obj.removeClass("cbp-animation-"+e.options.animationType),e.filterFinish()}var e=this;e.$obj.addClass("cbp-animation-"+e.options.animationType),e.blocksOnInitial.filter(b).addClass("cbp-item-on2on").each(function(b,d){var e=a(d).data("cbp");d.style[c.Private.transform]="translate3d("+(e.leftNew-e.left)+"px, "+(e.topNew-e.top)+"px, 0)"}),e.blocksOn2Off=e.blocksOnInitial.not(b).addClass("cbp-item-on2off"),e.blocksOff2On=e.blocksOn.filter(".cbp-item-off").removeClass("cbp-item-off").addClass("cbp-item-off2on").each(function(b,c){var d=a(c).data("cbp");d.left=d.leftNew,d.top=d.topNew,c.style.left=d.left+"px",c.style.top=d.top+"px"}),e.blocksOn2Off.length?e.blocksOn2Off.last().data("cbp").wrapper.one(c.Private.animationend,d):e.blocksOff2On.length?e.blocksOff2On.last().data("cbp").wrapper.one(c.Private.animationend,d):d(),e._resizeMainContainer()},b.prototype.destroy=function(){var a=this.parent;a.$obj.removeClass("cbp-animation-"+a.options.animationType)},c.Plugins.AnimationClassic=function(d){return!c.Private.modernBrowser||a.inArray(d.options.animationType,["boxShadow","fadeOut","flipBottom","flipOut","quicksand","scaleSides","skew"])<0?null:new b(d)}}(jQuery,window,document),function(a){"use strict";function b(a){var b=this;b.parent=a,a.filterLayout=b.filterLayout}var c=a.fn.cubeportfolio.Constructor;b.prototype.filterLayout=function(){function b(){d.wrapper[0].removeChild(e),"sequentially"===d.options.animationType&&d.blocksOn.each(function(b,d){a(d).data("cbp").wrapper[0].style[c.Private.animationDelay]=""}),d.$obj.removeClass("cbp-animation-"+d.options.animationType),d.filterFinish()}var d=this,e=d.$ul[0].cloneNode(!0);e.setAttribute("class","cbp-wrapper-helper"),d.wrapper[0].insertBefore(e,d.$ul[0]),requestAnimationFrame(function(){d.$obj.addClass("cbp-animation-"+d.options.animationType),d.blocksOff.addClass("cbp-item-off"),d.blocksOn.removeClass("cbp-item-off").each(function(b,e){var f=a(e).data("cbp");f.left=f.leftNew,f.top=f.topNew,e.style.left=f.left+"px",e.style.top=f.top+"px","sequentially"===d.options.animationType&&(f.wrapper[0].style[c.Private.animationDelay]=60*b+"ms")}
29),d.blocksOn.length?d.blocksOn.last().data("cbp").wrapper.one(c.Private.animationend,b):d.blocksOnInitial.length?d.blocksOnInitial.last().data("cbp").wrapper.one(c.Private.animationend,b):b(),d._resizeMainContainer()})},b.prototype.destroy=function(){var a=this.parent;a.$obj.removeClass("cbp-animation-"+a.options.animationType)},c.Plugins.AnimationClone=function(d){return!c.Private.modernBrowser||a.inArray(d.options.animationType,["fadeOutTop","slideLeft","sequentially"])<0?null:new b(d)}}(jQuery,window,document),function(a){"use strict";function b(a){var b=this;b.parent=a,a.filterLayout=b.filterLayout}var c=a.fn.cubeportfolio.Constructor;b.prototype.filterLayout=function(){function b(){e.wrapper[0].removeChild(d),e.$obj.removeClass("cbp-animation-"+e.options.animationType),e.blocks.each(function(b,d){a(d).data("cbp").wrapper[0].style[c.Private.animationDelay]=""}),e.filterFinish()}var d,e=this;d=e.$ul[0].cloneNode(!0),d.setAttribute("class","cbp-wrapper-helper"),e.wrapper[0].insertBefore(d,e.$ul[0]),a(d).find(".cbp-item").not(".cbp-item-off").children(".cbp-item-wrapper").each(function(a,b){b.style[c.Private.animationDelay]=50*a+"ms"}),requestAnimationFrame(function(){e.$obj.addClass("cbp-animation-"+e.options.animationType),e.blocksOff.addClass("cbp-item-off"),e.blocksOn.removeClass("cbp-item-off").each(function(b,d){var e=a(d).data("cbp");e.left=e.leftNew,e.top=e.topNew,d.style.left=e.left+"px",d.style.top=e.top+"px",e.wrapper[0].style[c.Private.animationDelay]=50*b+"ms"}
29),e.blocksOn.length?e.blocksOn.last().data("cbp").wrapper.one(c.Private.animationend,b):e.blocksOnInitial.length?e.blocksOnInitial.last().data("cbp").wrapper.one(c.Private.animationend,b):b(),e._resizeMainContainer()})},b.prototype.destroy=function(){var a=this.parent;a.$obj.removeClass("cbp-animation-"+a.options.animationType)},c.Plugins.AnimationCloneDelay=function(d){return!c.Private.modernBrowser||a.inArray(d.options.animationType,["3dflip","flipOutDelay","foldLeft","frontRow","rotateRoom","rotateSides","scaleDown","slideDelay","unfold"])<0?null:new b(d)}}(jQuery,window,document),function(a){"use strict";function b(a){var b=this;b.parent=a,a.filterLayout=b.filterLayout}var c=a.fn.cubeportfolio.Constructor;b.prototype.filterLayout=function(){function b(){d.wrapper[0].removeChild(e),d.$obj.removeClass("cbp-animation-"+d.options.animationType),d.filterFinish()}var d=this,e=d.$ul[0].cloneNode(!0);e.setAttribute("class","cbp-wrapper-helper"),d.wrapper[0].insertBefore(e,d.$ul[0]),requestAnimationFrame(function(){d.$obj.addClass("cbp-animation-"+d.options.animationType),d.blocksOff.addClass("cbp-item-off"),d.blocksOn.removeClass("cbp-item-off").each(function(b,c){var d=a(c).data("cbp");d.left=d.leftNew,d.top=d.topNew,c.style.left=d.left+"px",c.style.top=d.top+"px"}),d.blocksOn.length?d.$ul.one(c.Private.animationend,b):d.blocksOnInitial.length?a(e).one(c.Private.animationend,b):b(),d._resizeMainContainer()})},b.prototype.destroy=function(){var a=this.parent;a.$obj.removeClass("cbp-animation-"+a.options.animationType)},c.Plugins.AnimationWrapper=function(d){return!c.Private.modernBrowser||a.inArray(d.options.animationType,["bounceBottom","bounceLeft","bounceTop","moveLeft"])<0?null:new b(d)}}(jQuery,window,document),function(a){"use strict";function b(b){var d=this;d.parent=b,b._registerEvent("initFinish",function(){b.$obj.on("click.cbp",".cbp-caption-defaultWrap",function(d){if(d.preventDefault(),!b.isAnimating){b.isAnimating=!0;var e=a(this),f=e.next(),g=e.parent(),h={position:"relative",height:f.outerHeight(!0)},i={position:"relative",height:0};if(b.$obj.addClass("cbp-caption-expand-active"),g.hasClass("cbp-caption-expand-open")){var j=i;i=h,h=j,g.removeClass("cbp-caption-expand-open")}f.css(h),b._gridAdjust(),b._layout(),b.positionateItems(),b._resizeMainContainer(),f.css(i),requestAnimationFrame(function(){g.addClass("cbp-caption-expand-open"),f.one(c.Private.transitionend,function(){b.isAnimating=!1,b.$obj.removeClass("cbp-caption-expand-active"),0===h.height&&(g.removeClass("cbp-caption-expand-open"),f.attr("style",""))}),f.css(h),"slider"===b.options.layoutMode&&b._updateSlider(),b._triggerEvent("resizeGrid")})}})},!0)}var c=a.fn.cubeportfolio.Constructor;b.prototype.destroy=function(){this.parent.$obj.find(".cbp-caption-defaultWrap").off("click.cbp").parent().removeClass("cbp-caption-expand-active")},c.Plugins.CaptionExpand=function(a){return"expand"!==a.options.caption?null:new b(a)}}(jQuery,window,document),function(a){"use strict";function b(a){a._skipNextEvent("delayFrame"),a._registerEvent("initEndWrite",function(){a.blocksOn.each(function(b,d){d.style[c.Private.animationDelay]=b*a.options.displayTypeSpeed+"ms"}),a.$obj.addClass("cbp-displayType-bottomToTop"),a.blocksOn.last(
29).one(c.Private.animationend,function(){a.$obj.removeClass("cbp-displayType-bottomToTop"),a.blocksOn.each(function(a,b){b.style[c.Private.animationDelay]=""}),a._triggerEvent("delayFrame")})},!0)}var c=a.fn.cubeportfolio.Constructor;c.Plugins.BottomToTop=function(a){return c.Private.modernBrowser&&"bottomToTop"===a.options.displayType&&0!==a.blocks.length?new b(a):null}}(jQuery,window,document),function(a){"use strict";function b(a){a._skipNextEvent("delayFrame"),a._registerEvent("initEndWrite",function(){a.obj.style[c.Private.animationDuration]=a.options.displayTypeSpeed+"ms",a.$obj.addClass("cbp-displayType-fadeInToTop"),a.$obj.one(c.Private.animationend,function(){a.$obj.removeClass("cbp-displayType-fadeInToTop"),a.obj.style[c.Private.animationDuration]="",a._triggerEvent("delayFrame")})},!0)}var c=a.fn.cubeportfolio.Constructor;c.Plugins.FadeInToTop=function(a){return c.Private.modernBrowser&&"fadeInToTop"===a.options.displayType&&0!==a.blocks.length?new b(a):null}}(jQuery,window,document),function(a){"use strict";function b(a){a._skipNextEvent("delayFrame"),a._registerEvent("initEndWrite",function(){a.obj.style[c.Private.animationDuration]=a.options.displayTypeSpeed+"ms",a.$obj.addClass("cbp-displayType-lazyLoading"),a.$obj.one(c.Private.animationend,function(){a.$obj.removeClass("cbp-displayType-lazyLoading"),a.obj.style[c.Private.animationDuration]="",a._triggerEvent("delayFrame")})},!0)}var c=a.fn.cubeportfolio.Constructor;c.Plugins.LazyLoading=function(a){return!c.Private.modernBrowser||"lazyLoading"!==a.options.displayType&&"fadeIn"!==a.options.displayType||0===a.blocks.length?null:new b(a)}}(jQuery,window,document),function(a){"use strict";function b(a){a._skipNextEvent("delayFrame"),a._registerEvent("initEndWrite",function(){a.blocksOn.each(function(b,d){d.style[c.Private.animationDelay]=b*a.options.displayTypeSpeed+"ms"}),a.$obj.addClass("cbp-displayType-sequentially"),a.blocksOn.last(
29).one(c.Private.animationend,function(){a.$obj.removeClass("cbp-displayType-sequentially"),a.blocksOn.each(function(a,b){b.style[c.Private.animationDelay]=""}),a._triggerEvent("delayFrame")})},!0)}var c=a.fn.cubeportfolio.Constructor;c.Plugins.DisplaySequentially=function(a){return c.Private.modernBrowser&&"sequentially"===a.options.displayType&&0!==a.blocks.length?new b(a):null}}(jQuery,window,document); 30"function"!==typeof Object.create&&(Object.create=function(f){function g(){}g.prototype=f;return new g}); 31(function(f,g,k){var l={init:function(a,b){this.$elem=f(b);this.options=f.extend({},f.fn.owlCarousel.options,this.$elem.data(),a);this.userOptions=a;this.loadContent()},loadContent:function(){function a(a){var d,e="";if("function"===typeof b.options.jsonSuccess)b.options.jsonSuccess.apply(this,[a]);else{for(d in a.owl)a.owl.hasOwnProperty(d)&&(e+=a.owl[d].item);b.$elem.html(e)}b.logIn()}var b=this,e;"function"===typeof b.options.beforeInit&&b.options.beforeInit.apply(this,[b.$elem]);"string"===typeof b.options.jsonPath? 32(e=b.options.jsonPath,f.getJSON(e,a)):b.logIn()},logIn:function(){this.$elem.data("owl-originalStyles",this.$elem.attr("style"));this.$elem.data("owl-originalClasses",this.$elem.attr("class"));this.$elem.css({opacity:0});this.orignalItems=this.options.items;this.checkBrowser();this.wrapperWidth=0;this.checkVisible=null;this.setVars()},setVars:function(){if(0===this.$elem.children().length)return!1;this.baseClass();this.eventTypes();this.$userItems=this.$elem.children();this.itemsAmount=this.$userItems.length; 33this.wrapItems();this.$owlItems=this.$elem.find(".owl-item");this.$owlWrapper=this.$elem.find(".owl-wrapper");this.playDirection="next";this.prevItem=0;this.prevArr=[0];this.currentItem=0;this.customEvents();this.onStartup()},onStartup:function(){this.updateItems();this.calculateAll();this.buildControls();this.updateControls();this.response();this.moveEvents();this.stopOnHover();this.owlStatus();!1!==this.options.transitionStyle&&this.transitionTypes(this.options.transitionStyle);!0===this.options.autoPlay&& 34(this.options.autoPlay=5E3);this.play();this.$elem.find(".owl-wrapper").css("display","block");this.$elem.is(":visible")?this.$elem.css("opacity",1):this.watchVisibility();this.onstartup=!1;this.eachMoveUpdate();"function"===typeof this.options.afterInit&&this.options.afterInit.apply(this,[this.$elem])},eachMoveUpdate:function(){!0===this.options.lazyLoad&&this.lazyLoad();!0===this.options.autoHeight&&this.autoHeight();this.onVisibleItems();"function"===typeof this.options.afterAction&&this.options.afterAction.apply(this, 35[this.$elem])},updateVars:function(){"function"===typeof this.options.beforeUpdate&&this.options.beforeUpdate.apply(this,[this.$elem]);this.watchVisibility();this.updateItems();this.calculateAll();this.updatePosition();this.updateControls();this.eachMoveUpdate();"function"===typeof this.options.afterUpdate&&this.options.afterUpdate.apply(this,[this.$elem])},reload:function(){var a=this;g.setTimeout(function(){a.updateVars()},0)},watchVisibility:function(){var a=this;if(!1===a.$elem.is(":visible"))a.$elem.css({opacity:0}), 36g.clearInterval(a.autoPlayInterval),g.clearInterval(a.checkVisible);else return!1;a.checkVisible=g.setInterval(function(){a.$elem.is(":visible")&&(a.reload(),a.$elem.animate({opacity:1},200),g.clearInterval(a.checkVisible))},500)},wrapItems:function(){this.$userItems.wrapAll('<div class="owl-wrapper">').wrap('<div class="owl-item"></div>');this.$elem.find(".owl-wrapper").wrap('<div class="owl-wrapper-outer">');this.wrapperOuter=this.$elem.find(".owl-wrapper-outer");this.$elem.css("display","block")}, 37baseClass:function(){var a=this.$elem.hasClass(this.options.baseClass),b=this.$elem.hasClass(this.options.theme);a||this.$elem.addClass(this.options.baseClass);b||this.$elem.addClass(this.options.theme)},updateItems:function(){var a,b;if(!1===this.options.responsive)return!1;if(!0===this.options.singleItem)return this.options.items=this.orignalItems=1,this.options.itemsCustom=!1,this.options.itemsDesktop=!1,this.options.itemsDesktopSmall=!1,this.options.itemsTablet=!1,this.options.itemsTabletSmall= 38!1,this.options.itemsMobile=!1;a=f(this.options.responsiveBaseWidth).width();a>(this.options.itemsDesktop[0]||this.orignalItems)&&(this.options.items=this.orignalItems);if(!1!==this.options.itemsCustom)for(this.options.itemsCustom.sort(function(a,b){return a[0]-b[0]}),b=0;b<this.options.itemsCustom.length;b+=1)this.options.itemsCustom[b][0]<=a&&(this.options.items=this.options.itemsCustom[b][1]);else a<=this.options.itemsDesktop[0]&&!1!==this.options.itemsDesktop&&(this.options.items=this.options.itemsDesktop[1]), 39a<=this.options.itemsDesktopSmall[0]&&!1!==this.options.itemsDesktopSmall&&(this.options.items=this.options.itemsDesktopSmall[1]),a<=this.options.itemsTablet[0]&&!1!==this.options.itemsTablet&&(this.options.items=this.options.itemsTablet[1]),a<=this.options.itemsTabletSmall[0]&&!1!==this.options.itemsTabletSmall&&(this.options.items=this.options.itemsTabletSmall[1]),a<=this.options.itemsMobile[0]&&!1!==this.options.itemsMobile&&(this.options.items=this.options.itemsMobile[1]);this.options.items>this.itemsAmount&& 40!0===this.options.itemsScaleUp&&(this.options.items=this.itemsAmount)},response:function(){var a=this,b,e;if(!0!==a.options.responsive)return!1;e=f(g).width();a.resizer=function(){f(g).width()!==e&&(!1!==a.options.autoPlay&&g.clearInterval(a.autoPlayInterval),g.clearTimeout(b),b=g.setTimeout(function(){e=f(g).width();
40a.updateVars()},a.options.responsiveRefreshRate))};f(g).resize(a.resizer)},updatePosition:function(){this.jumpTo(this.currentItem);!1!==this.options.autoPlay&&this.checkAp()},appendItemsSizes:function(){var a= 41this,b=0,e=a.itemsAmount-a.options.items;a.$owlItems.each(function(c){var d=f(this);d.css({width:a.itemWidth}).data("owl-item",Number(c));if(0===c%a.options.items||c===e)c>e||(b+=1);d.data("owl-roundPages",b)})},appendWrapperSizes:function(){this.$owlWrapper.css({width:this.$owlItems.length*this.itemWidth*2,left:0});this.appendItemsSizes()},calculateAll:function(){this.calculateWidth();this.appendWrapperSizes();this.loops();this.max()},calculateWidth:function(){this.itemWidth=Math.round(this.$elem.width()/ 42this.options.items)},max:function(){var a=-1*(this.itemsAmount*this.itemWidth-this.options.items*this.itemWidth);this.options.items>this.itemsAmount?this.maximumPixels=a=this.maximumItem=0:(this.maximumItem=this.itemsAmount-this.options.items,this.maximumPixels=a);return a},min:function(){return 0},loops:function(){var a=0,b=0,e,c;this.positionsInArray=[0];this.pagesInArray=[];for(e=0;e<this.itemsAmount;e+=1)b+=this.itemWidth,this.positionsInArray.push(-b),!0===this.options.scrollPerPage&&(c=f(this.$owlItems[e]), 43c=c.data("owl-roundPages"),c!==a&&(this.pagesInArray[a]=this.positionsInArray[e],a=c))},buildControls:function(){if(!0===this.options.navigation||!0===this.options.pagination)this.owlControls=f('<div class="owl-control
43s"/>').toggleClass("clickable",!this.browser.isTouch).appendTo(this.$elem);!0===this.options.pagination&&this.buildPagination();!0===this.options.navigation&&this.buildButtons()},buildButtons:function(){var a=this,b=f('<div class="owl-buttons"/>');a.owlControls.append(b);a.buttonPrev= 44f("<div/>",{"class":"owl-prev",html:a.options.navigationText[0]||""});a.buttonNext=f("<div/>",{"class":"owl-next",html:a.options.navigationText[1]||""});b.append(a.buttonPrev).append(a.buttonNext);b.on("touchstart.owlControls mousedown.owlControls",'div[class^="owl"]',function(a){a.preventDefault()});b.on("touchend.owlControls mouseup.owlControls",'div[class^="owl"]',function(b){b.preventDefault();f(this).hasClass("owl-next")?a.next():a.prev()})},buildPagination:function(){var a=this;a.paginationWrapper= 45f('<div class="owl-pagination"/>');a.owlControls.append(a.paginationWrapper);a.paginationWrapper.on("touchend.owlControls mouseup.owlControls",".owl-page",function(b){b.preventDefault();Number(f(this).data("owl-page"))!==a.currentItem&&a.goTo(Number(f(this).data("owl-page")),!0)})},updatePagination:function(){var a,b,e,c,d,g;if(!1===this.options.pagination)return!1;this.paginationWrapper.html("");a=0;b=this.itemsAmount-this.itemsAmount%this.options.items;for(c=0;c<this.itemsAmount;c+=1)0===c%this.options.items&& 46(a+=1,b===c&&(e=this.itemsAmount-this.options.items),d=f("<div/>",{"class":"owl-page"}),g=f("<span></span>",{text:!0===this.options.paginationNumbers?a:"","class":!0===this.options.paginationNumbers?"owl-numbers":""}),d.append(g),d.data("owl-page",b===c?e:c),d.data("owl-roundPages",a),this.paginationWrapper.append(d));this.checkPagination()},checkPagination:function(){var a=this;if(!1===a.options.pagination)return!1;a.paginationWrapper.find(".owl-page").each(function(){f(this).data("owl-roundPages")=== 47f(a.$owlItems[a.currentItem]).data("owl-roundPages")&&(a.paginationWrapper.find(".owl-page").removeClass("active"),f(this).addClass("active"))})},checkNavigation:function(){if(!1===this.options.navigation)return!1;!1===this.options.rewindNav&&(0===this.currentItem&&0===this.maximumItem?(this.buttonPrev.addClass("disabled"),this.buttonNext.addClass("disabled")):0===this.currentItem&&0!==this.maximumItem?(this.buttonPrev.addClass("disabled"),this.buttonNext.removeClass("disabled")):this.currentItem=== 48this.maximumItem?(this.buttonPrev.removeClass("disabled"),this.buttonNext.addClass("disabled")):0!==this.currentItem&&this.currentItem!==this.maximumItem&&(this.buttonPrev.removeClass("disabled"),this.buttonNext.removeClass("disabled")))},updateControls:function(){this.updatePagination();this.checkNavigation();this.owlControls&&(this.options.items>=this.itemsAmount?this.owlControls.hide():this.owlControls.show())},destroyControls:function(){this.owlControls&&this.owlControls.remove()},next:function(a){if(this.isTransition)return!1; 49this.currentItem+=!0===this.options.scrollPerPage?this.options.items:1;if(this.currentItem>this.maximumItem+(!0===this.options.scrollPerPage?this.options.items-1:0))if(!0===this.options.rewindNav)this.currentItem=0,a="rewind";else return this.currentItem=this.maximumItem,!1;this.goTo(this.currentItem,a)},prev:function(a){if(this.isTransition)return!1;this.currentItem=!0===this.options.scrollPerPage&&0<this.currentItem&&this.currentItem<this.options.items?0:this.currentItem-(!0===this.options.scrollPerPage? 50this.options.items:1);if(0>this.currentItem)if(!0===this.options.rewindNav)this.currentItem=this.maximumItem,a="rewind";else return this.currentItem=0,!1;this.goTo(this.currentItem,a)},goTo:function(a,b,e){var c=this;if(c.isTransition)return!1;"function"===typeof c.options.beforeMove&&c.options.beforeMove.apply(this,[c.$elem]);a>=c.maximumItem?a=c.maximumItem:0>=a&&(a=0);c.currentItem=c.owl.currentItem=a;if(!1!==c.options.transitionStyle&&"drag"!==e&&1===c.options.items&&!0===c.browser.support3d)return c.swapSpeed(0), 51!0===c.browser.support3d?c.transition3d(c.positionsInArray[a]):c.css2slide(c.positionsInArray[a],1),c.afterGo(),c.singleItemTransition(),!1;a=c.positionsInArray[a];!0===c.browser.support3d?(c.isCss3Finish=!1,!0===b?(c.swapSpeed("paginationSpeed"),g.setTimeout(function(){c.isCss3Finish=!0},c.options.paginationSpeed)):"rewind"===b?(c.swapSpeed(c.options.rewindSpeed),g.setTimeout(function(){c.isCss3Finish=!0},c.options.rewindSpeed)):(c.swapSpeed("slideSpeed"),g.setTimeout(function(){c.isCss3Finish=!0}, 52c.options.slideSpeed)),c.transition3d(a)):!0===b?c.css2slide(a,c.options.paginationSpeed):"rewind"===b?c.css2slide(a,c.options.rewindSpeed):c.css2slide(a,c.options.slideSpeed);c.afterGo()},jumpTo:function(a){"function"===typeof this.options.beforeMove&&this.options.beforeMove.apply(this,[this.$elem]);a>=this.maximumItem||-1===a?a=this.maximumItem:0>=a&&(a=0);this.swapSpeed(0);!0===this.browser.support3d?this.transition3d(this.positionsInArray[a]):this.css2slide(this.positionsInArray[a],1);this.currentItem= 53this.owl.currentItem=a;this.afterGo()},afterGo:function(){this.prevArr.push(this.currentItem);this.prevItem=this.owl.prevItem=this.prevArr[this.prevArr.length-2];this.prevArr.shift(0);this.prevItem!==this.currentItem&&(this.checkPagination(),this.checkNavigation(),this.eachMoveUpdate(),!1!==this.options.autoPlay&&this.checkAp());"function"===typeof this.options.afterMove&&this.prevItem!==this.currentItem&&this.options.afterMove.apply(this,[this.$elem])},stop:function(){this.apStatus="stop";g.clearInterval(this.autoPlayInterval)}, 54checkAp:function(){"stop"!==this.apStatus&&this.play()},play:function(){var a=this;a.apStatus="play";if(!1===a.options.autoPlay)return!1;g.clearInterval(a.autoPlayInterval);a.autoPlayInterval=g.setInterval(function(){a.next(!0)},a.options.autoPlay)},swapSpeed:function(a){"slideSpeed"===a?this.$owlWrapper.css(this.addCssSpeed(this.options.slideSpeed)):"paginationSpeed"===a?this.$owlWrapper.css(this.addCssSpeed(this.options.paginationSpeed)):"string"!==typeof a&&this.$owlWrapper.css(this.addCssSpeed(a))}, 55addCssSpeed:function(a){return{"-webkit-transition":"all "+a+"ms ease","-moz-transition":"all "+a+"ms ease","-o-transition":"all "+a+"ms ease",transition:"all "+a+"ms ease"}},removeTransition:function(){return{"-webkit-transition":"","-moz-transition":"","-o-transition":"",transition:""}},doTranslate:function(a){return{"-webkit-transform":"translate3d("+a+"px, 0px, 0px)","-moz-transform":"translate3d("+a+"px, 0px, 0px)","-o-transform":"translate3d("+a+"px, 0px, 0px)","-ms-transform":"translate3d("+ 56a+"px, 0px, 0px)",transform:"translate3d("+a+"px, 0px,0px)"}},transition3d:function(a){this.$owlWrapper.css(this.doTranslate(a))},css2move:function(a){this.$owlWrapper.css({left:a})},css2slide:function(a,b){var e=this;e.isCssFinish=!1;e.$owlWrapper.stop(!0,!0).animate({left:a},{duration:b||e.options.slideSpeed,complete:function(){e.isCssFinish=!0}})},checkBrowser:function(){var a=k.createElement("div");a.style.cssText=" -moz-transform:translate3d(0px, 0px, 0px); -ms-transform:translate3d(0px, 0px, 0px); -o-transform:translate3d(0px, 0px, 0px); -webkit-transform:translate3d(0px, 0px, 0px); transform:translate3d(0px, 0px, 0px)";
57a=a.style.cssText.match(/translate3d\(0px, 0px, 0px\)/g);this.browser={support3d:null!==a&&1===a.length,isTouch:"ontouchstart"in g||g.navigator.msMaxTouchPoints}},moveEvents:function(){if(!1!==this.options.mouseDrag||!1!==this.options.touchDrag)this.gestures(),this.disabledEvents()},eventTypes:function(){var a=["s","e","x"];this.ev_types={};!0===this.options.mouseDrag&&!0===this.options.touchDrag?a=["touchstart.owl mousedown.owl","touchmove.owl mousemove.owl","touchend.owl touchcancel.owl mouseup.owl"]: 58!1===this.options.mouseDrag&&!0===this.options.touchDrag?a=["touchstart.owl","touchmove.owl","touchend.owl touchcancel.owl"]:!0===this.options.mouseDrag&&!1===this.options.touchDrag&&(a=["mousedown.owl","mousemove.owl","mouseup.owl"]);this.ev_types.start=a[0];this.ev_types.move=a[1];this.ev_types.end=a[2]},disabledEvents:function(){this.$elem.on("dragstart.owl",function(a){a.preventDefault()});this.$elem.on("mousedown.disableTextSelect",function(a){return f(a.target).is("input, textarea, select, option")})}, 59gestures:function(){function a(a){if(void 0!==a.touches)return{x:a.touches[0].pageX,y:a.touches[0].pageY};if(void 0===a.touches){if(void 0!==a.pageX)return{x:a.pageX,y:a.pageY};if(void 0===a.pageX)return{x:a.clientX,y:a.clientY}}}function b(a){"on"===a?(f(k).on(d.ev_types.move,e),f(k).on(d.ev_types.end,c)):"off"===a&&(f(k).off(d.ev_types.move),f(k).off(d.ev_types.end))}function e(b){b=b.originalEvent||b||g.event;d.newPosX=a(b).x-h.offsetX;d.newPosY=a(b).y-h.offsetY;d.newRelativeX=d.newPosX-h.relativePos; 60"function"===typeof d.options.startDragging&&!0!==h.dragging&&0!==d.newRelativeX&&(h.dragging=!0,d.options.startDragging.apply(d,[d.$elem]));(8<d.newRelativeX||-8>d.newRelativeX)&&!0===d.browser.isTouch&&(void 0!==b.preventDefault?b.preventDefault():b.returnValue=!1,h.sliding=!0);(10<d.newPosY||-10>d.newPosY)&&!1===h.sliding&&f(k).off("touchmove.owl");d.newPosX=Math.max(Math.min(d.newPosX,d.newRelativeX/5),d.maximumPixels+d.newRelativeX/5);!0===d.browser.support3d?d.transition3d(d.newPosX):d.css2move(d.newPosX)} 61function c(a){a=a.originalEvent||a||g.event;var c;a.target=a.target||a.srcElement;h.dragging=!1;!0!==d.browser.isTouch&&d.$owlWrapper.removeClass("grabbing");d.dragDirection=0>d.newRelativeX?d.owl.dragDirection="left":d.owl.dragDirection="right";0!==d.newRelativeX&&(c=d.getNewPosition(),d.goTo(c,!1,"drag"),h.targetElement===a.target&&!0!==d.browser.isTouch&&(f(a.target).on("click.disable",function(a){a.stopImmediatePropagation();a.stopPropagation();a.preventDefault();f(a.target).off("click.disable")}), 62a=f._data(a.target,"events").click,c=a.pop(),a.splice(0,0,c)));b("off")}var d=this,h={offsetX:0,offsetY:0,baseElWidth:0,relativePos:0,position:null,minSwipe:null,maxSwipe:null,sliding:null,dargging:null,targetElement:null};d.isCssFinish=!0;d.$elem.on(d.ev_types.start,".owl-wrapper",function(c){c=c.originalEvent||c||g.event;var e;if(3===c.which)return!1;if(!(d.itemsAmount<=d.options.items)){if(!1===d.isCssFinish&&!d.options.dragBeforeAnimFinish||!1===d.isCss3Finish&&!d.options.dragBeforeAnimFinish)return!1; 63!1!==d.options.autoPlay&&g.clearInterval(d.autoPlayInterval);!0===d.browser.isTouch||d.$owlWrapper.hasClass("grabbing")||d.$owlWrapper.addClass("grabbing");d.newPosX=0;d.newRelativeX=0;f(this).css(d.removeTransition());e=f(this).position();h.relativePos=e.left;h.offsetX=a(c).x-e.left;h.offsetY=a(c).y-e.top;b("on");h.sliding=!1;h.targetElement=c.target||c.srcElement}})},getNewPosition:function(){var a=this.closestItem();a>this.maximumItem?a=this.currentItem=this.maximumItem:0<=this.newPosX&&(this.currentItem= 64a=0);return a},closestItem:function(){var a=this,b=!0===a.options.scrollPerPage?a.pagesInArray:a.positionsInArray,e=a.newPosX,c=null;f.each(b,function(d,g){e-a.itemWidth/20>b[d+1]&&e-a.itemWidth/20<g&&"left"===a.moveDirection()?(c=g,a.currentItem=!0===a.options.scrollPerPage?f.inArray(c,a.positionsInArray):d):e+a.itemWidth/20<g&&e+a.itemWidth/20>(b[d+1]||b[d]-a.itemWidth)&&"right"===a.moveDirection()&&(!0===a.options.scrollPerPage?(c=b[d+1]||b[b.length-1],a.currentItem=f.inArray(c,a.positionsInArray)): 65(c=b[d+1],a.currentItem=d+1))});return a.currentItem},moveDirection:function(){var a;0>this.newRelativeX?(a="right",this.playDirection="next"):(a="left",this.playDirection="prev");return a},customEvents:function(){var a=this;a.$elem.on("owl.next",function(){a.next()});a.$elem.on("owl.prev",function(){a.prev()});a.$elem.on("owl.play",function(b,e){a.options.autoPlay=e;a.play();a.hoverStatus="play"});a.$elem.on("owl.stop",function(){a.stop();a.hoverStatus="stop"});a.$elem.on("owl.goTo",function(b,e){a.goTo(e)}); 66a.$elem.on("owl.jumpTo",function(b,e){a.jumpTo(e)})},stopOnHover:function(){var a=this;!0===a.options.stopOnHover&&!0!==a.browser.isTouch&&!1!==a.options.autoPlay&&(a.$elem.on("mouseover",function(){a.stop()}),a.$elem.on("mouseout",function(){"stop"!==a.hoverStatus&&a.play()}))},lazyLoad:function(){var a,b,e,c,d;if(!1===this.options.lazyLoad)return!1;for(a=0;a<this.itemsAmount;a+=1)b=f(this.$owlItems[a]),"loaded"!==b.data("owl-loaded")&&(e=b.data("owl-item"),c=b.find(".lazyOwl"),"string"!==typeof c.data("src")? 67b.data("owl-loaded","loaded"):(void 0===b.data("owl-loaded")&&(c.hide(),b.addClass("loading").data("owl-loaded","checked")),(d=!0===this.options.lazyFollow?e>=this.currentItem:!0)&&e<this.currentItem+this.options.items&&c.length&&this.lazyPreload(b,c)))},lazyPreload:function(a,b){function e(){a.data("owl-loaded","loaded").removeClass("loading");b.removeAttr("data-src");"fade"===d.options.lazyEffect?b.fadeIn(400):b.show();"function"===typeof d.options.afterLazyLoad&&d.options.afterLazyLoad.apply(this, 68[d.$elem])}function c(){f+=1;d.completeImg(b.get(0))||!0===k?e():100>=f?g.setTimeout(c,100):e()}var d=this,f=0,k;"DIV"===b.prop("tagName")?(b.css("background-image","url("+b.data("src")+")"),k=!0):b[0].src=b.data("src");c()},autoHeight:function(){function a(){var a=f(e.$owlItems[e.currentItem]).height();e.wrapperOuter.css("height",a+"px");e.wrapperOuter.hasClass("autoHeight")||g.setTimeout(function(){e.wrapperOuter.addClass("autoHeight")},0)}function b(){d+=1;e.completeImg(c.get(0))?a():100>=d?g.setTimeout(b, 69100):e.wrapperOuter.css("height","")}var e=this,c=f(e.$owlItems[e.currentItem]).find("img"),d;void 0!==c.get(0)?(d=0,b()):a()},completeImg:function(a){return!a.complete||"undefined"!==typeof a.naturalWi
69dth&&0===a.naturalWidth?!1:!0},onVisibleItems:function(){var a;!0===this.options.addClassActive&&this.$owlItems.removeClass("active");this.visibleItems=[];for(a=this.currentItem;a<this.currentItem+this.options.items;a+=1)this.visibleItems.push(a),!0===this.options.addClassActive&&f(this.$owlItems[a]).addClass("active"); 70this.owl.visibleItems=this.visibleItems},transitionTypes:function(a){this.outClass="owl-"+a+"-out";this.inClass="owl-"+a+"-in"},singleItemTransition:function(){var a=this,b=a.outClass,e=a.inClass,c=a.$owlItems.eq(a.currentItem),d=a.$owlItems.eq(a.prevItem),f=Math.abs(a.positionsInArray[a.currentItem])+a.positionsInArray[a.prevItem],g=Math.abs(a.positionsInArray[a.currentItem])+a.itemWidth/2;a.isTransition=!0;a.$owlWrapper.addClass("owl-origin").css({"-webkit-transform-origin":g+"px","-moz-perspective-origin":g+ 71"px","perspective-origin":g+"px"});d.css({position:"relative",left:f+"px"}).addClass(b).on("webkitAnimationEnd oAnimationEnd MSAnimationEnd animationend",function(){a.endPrev=!0;d.off("webkitAnimationEnd oAnimationEnd MSAnimationEnd animationend");a.clearTransStyle(d,b)});c.addClass(e).on("webkitAnimationEnd oAnimationEnd MSAnimationEnd animationend",function(){a.endCurrent=!0;c.off("webkitAnimationEnd oAnimationEnd MSAnimationEnd animationend");a.clearTransStyle(c,e)})},clearTransStyle:function(a, 72b){a.css({position:"",left:""}).removeClass(b);this.endPrev&&this.endCurrent&&(this.$owlWrapper.removeClass("owl-origin"),this.isTransition=this.endCurrent=this.endPrev=!1)},owlStatus:function(){this.owl={userOptions:this.userOptions,baseElement:this.$elem,userItems:this.$userItems,owlItems:this.$owlItems,currentItem:this.currentItem,prevItem:this.prevItem,visibleItems:this.visibleItems,isTouch:this.browser.isTouch,browser:this.browser,dragDirection:this.dragDirection}},clearEvents:function(){this.$elem.off(".owl owl mousedown.disableTextSelect"); 73f(k).off(".owl owl");f(g).off("resize",this.resizer)},unWrap:function(){0!==this.$elem.children().length&&(this.$owlWrapper.unwrap(),this.$userItems.unwrap().unwrap(),this.owlControls&&this.owlControls.remove());this.clearEvents();this.$elem.attr("style",this.$elem.data("owl-originalStyles")||"").attr("class",this.$elem.data("owl-originalClasses"))},destroy:function(){this.stop();g.clearInterval(this.checkVisible);this.unWrap();this.$elem.removeData()},reinit:function(a){a=f.extend({},this.userOptions, 74a);this.unWrap();this.init(a,this.$elem)},addItem:function(a,b){var e;if(!a)return!1;if(0===this.$elem.children().length)return this.$elem.append(a),this.setVars(),!1;this.unWrap();e=void 0===b||-1===b?-1:b;e>=this.$userItems.length||-1===e?this.$userItems.eq(-1).after(a):this.$userItems.eq(e).before(a);this.setVars()},removeItem:function(a){if(0===this.$elem.children().length)return!1;a=void 0===a||-1===a?-1:a;this.unWrap();this.$userItems.eq(a).remove();this.setVars()}};f.fn.owlCarousel=function(a){return this.each(function(){if(!0=== 75f(this).data("owl-init"))return!1;f(this).data("owl-init",!0);var b=Object.create(l);b.init(a,this);f.data(this,"owlCarousel",b)})};f.fn.owlCarousel.options={items:5,itemsCustom:!1,itemsDesktop:[1199,4],itemsDesktopSmall:[979,3],itemsTablet:[768,2],itemsTabletSmall:!1,itemsMobile:[479,1],singleItem:!1,itemsScaleUp:!1,slideSpeed:200,paginationSpeed:800,rewindSpeed:1E3,autoPlay:!1,stopOnHover:!1,navigation:!1,navigationText:["prev","next"],rewindNav:!0,scrollPerPage:!1,pagination:!0,paginationNumbers:!1, 76responsive:!0,responsiveRefreshRate:200,responsiveBaseWidth:g,baseClass:"owl-carousel",theme:"owl-theme",lazyLoad:!1,lazyFollow:!0,lazyEffect:"fade",autoHeight:!1,jsonPath:!1,jsonSuccess:!1,dragBeforeAnimFinish:!0,mouseDrag:!0,touchDrag:!0,addClassActive:!1,transitionStyle:!1,beforeUpdate:!1,afterUpdate:!1,beforeInit:!1,afterInit:!1,beforeMove:!1,afterMove:!1,afterAction:!1,startDragging:!1,afterLazyLoad:!1}})(jQuery,window,document); 77/*! 78* jquery.counterup.js 1.0 79* 80* Copyright 2013, Benjamin Intal http://gambit.ph @bfintal 81* Released under the GPL v2 License 82* 83* Date: Nov 26, 2013 84*/ 85 86!function(t){"use strict";t.fn.counterUp=function(e){var n=t.extend({time:400,delay:10},e);return this.each(function(){var e=t(this),u=n,a=function(){var t=u.time/u.delay,n=e.text(),a=[n],r=/[0-9]+,[0-9]+/.test(n);n=n.replace(/,/g,"");for(var o=(/^[0-9]+$/.test(n),/^[0-9]+\.[0-9]+$/.test(n)),c=o?(n.split(".")[1]||[]).length:0,i=t;i>=1;i--){var s=parseInt(n/t*i);if(o&&(s=parseFloat(n/t*i).toFixed(c)),r)for(;/(\d+)(\d{3})/.test(s.toString());)s=s.toString().replace(/(\d+)(\d{3})/,"$1,$2");a.unshift(s)}e.data("counterup-nums",a),e.text("0");var d=function(){e.text(e.data("counterup-nums").shift()),e.data("counterup-nums").length?setTimeout(e.data("counterup-func"),u.delay):(delete e.data("counterup-nums"),e.data("counterup-nums",null),e.data("counterup-func",null))};e.data("counterup-func",d),setTimeout(e.data("counterup-func"),u.delay)};e.waypoint(a,{offset:"100%",triggerOnce:!0})})}}(jQuery); 87// Generated by CoffeeScript 1.6.2 88/* 89jQuery Waypoints - v2.0.3 90Copyright (c) 2011-2013 Caleb Troughton 91Dual licensed under the MIT license and GPL license. 92https://github.com/imakewebthings/jquery-waypoints/blob/master/licenses.txt 93*/ 94 95(function(){var t=[].indexOf||function(t){for(var e=0,n=this.length;e<n;e++){if(e in this&&this[e]===t)return e}return-1},e=[].slice;(function(t,e){if(typeof define==="function"&&define.amd){return define("waypoints",["jquery"],function(n){return e(n,t)})}else{return e(t.jQuery,t)}})(this,function(n,r){var i,o,l,s,f,u,a,c,h,d,p,y,v,w,g,m;i=n(r);c=t.call(r,"ontouchstart")>=0;s={horizontal:{},vertical:{}};f=1;a={};u="waypoints-context-id";p="resize.waypoints";y="scroll.waypoints";v=1;
vendor: 6,759 bytes, line 95
95w="waypoints-waypoint-ids";g="waypoint";m="waypoints";o=function(){function t(t){var e=this;this.$element=t;this.element=t[0];this.didResize=false;this.didScroll=false;this.id="context"+f++;this.oldScroll={x:t.scrollLeft(),y:t.scrollTop()};this.waypoints={horizontal:{},vertical:{}};t.data(u,this.id);a[this.id]=this;t.bind(y,function(){var t;if(!(e.didScroll||c)){e.didScroll=true;t=function(){e.doScroll();return e.didScroll=false};return r.setTimeout(t,n[m].settings.scrollThrottle)}});t.bind(p,function(){var t;if(!e.didResize){e.didResize=true;t=function(){n[m]("refresh");return e.didResize=false};return r.setTimeout(t,n[m].settings.resizeThrottle)}})}t.prototype.doScroll=function(){var t,e=this;t={horizontal:{newScroll:this.$element.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.$element.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};if(c&&(!t.vertical.oldScroll||!t.vertical.newScroll)){n[m]("refresh")}n.each(t,function(t,r){var i,o,l;l=[];o=r.newScroll>r.oldScroll;i=o?r.forward:r.backward;n.each(e.waypoints[t],function(t,e){var n,i;if(r.oldScroll<(n=e.offset)&&n<=r.newScroll){return l.push(e)}else if(r.newScroll<(i=e.offset)&&i<=r.oldScroll){return l.push(e)}});l.sort(function(t,e){return t.offset-e.offset});if(!o){l.reverse()}return n.each(l,function(t,e){if(e.options.continuous||t===l.length-1){return e.trigger([i])}})});return this.oldScroll={x:t.horizontal.newScroll,y:t.vertical.newScroll}};t.prototype.refresh=function(){var t,e,r,i=this;r=n.isWindow(this.element);e=this.$element.offset();this.doScroll();t={horizontal:{contextOffset:r?0:e.left,contextScroll:r?0:this.oldScroll.x,contextDimension:this.$element.width(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:r?0:e.top,contextScroll:r?0:this.oldScroll.y,contextDimension:r?n[m]("viewportHeight"):this.$element.height(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}};return n.each(t,function(t,e){return n.each(i.waypoints[t],function(t,r){var i,o,l,s,f;i=r.options.offset;l=r.offset;o=n.isWindow(r.element)?0:r.$element.offset()[e.offsetProp];if(n.isFunction(i)){i=i.apply(r.element)}else if(typeof i==="string"){i=parseFloat(i);if(r.options.offset.indexOf("%")>-1){i=Math.ceil(e.contextDimension*i/100)}}r.offset=o-e.contextOffset+e.contextScroll-i;if(r.options.onlyOnScroll&&l!=null||!r.enabled){return}if(l!==null&&l<(s=e.oldScroll)&&s<=r.offset){return r.trigger([e.backward])}else if(l!==null&&l>(f=e.oldScroll)&&f>=r.offset){return r.trigger([e.forward])}else if(l===null&&e.oldScroll>=r.offset){return r.trigger([e.forward])}})})};t.prototype.checkEmpty=function(){if(n.isEmptyObject(this.waypoints.horizontal)&&n.isEmptyObject(this.waypoints.vertical)){this.$element.unbind([p,y].join(" "));return delete a[this.id]}};return t}();l=function(){function t(t,e,r){var i,o;r=n.extend({},n.fn[g].defaults,r);if(r.offset==="bottom-in-view"){r.offset=function(){var t;t=n[m]("viewportHeight");if(!n.isWindow(e.element)){t=e.$element.height()}return t-n(this).outerHeight()}}this.$element=t;this.element=t[0];this.axis=r.horizontal?"horizontal":"vertical";this.callback=r.handler;this.context=e;this.enabled=r.enabled;this.id="waypoints"+v++;this.offset=null;this.options=r;e.waypoints[this.axis][this.id]=this;s[this.axis][this.id]=this;i=(o=t.data(w))!=null?o:[];i.push(this.id);t.data(w,i)}t.prototype.trigger=function(t){if(!this.enabled){return}if(this.callback!=null){this.callback.apply(this.element,t)}if(this.options.triggerOnce){return this.destroy()}};t.prototype.disable=function(){return this.enabled=false};t.prototype.enable=function(){this.context.refresh();return this.enabled=true};t.prototype.destroy=function(){delete s[this.axis][this.id];delete this.context.waypoints[this.axis][this.id];return this.context.checkEmpty()};t.getWaypointsByElement=function(t){var e,r;r=n(t).data(w);if(!r){return[]}e=n.extend({},s.horizontal,s.vertical);return n.map(r,function(t){return e[t]})};return t}();d={init:function(t,e){var r;if(e==null){e={}}if((r=e.handler)==null){e.handler=t}this.each(function(){var t,r,i,s;t=n(this);i=(s=e.context)!=null?s:n.fn[g].defaults.context;if(!n.isWindow(i)){i=t.closest(i)}i=n(i);r=a[i.data(u)];if(!r){r=new o(i)}return new l(t,r,e)});n[m]("refresh");return this},disable:function(){return d._invoke(this,"disable")},enable:function(){return d._invoke(this,"enable")},destroy:function(){return d._invoke(this,"destroy")},prev:function(t,e){return d._traverse.call(this,t,e,function(t,e,n){if(e>0){return t.push(n[e-1])}})},next:function(t,e){return d._traverse.call(this,t,e,function(t,e,n){if(e<n.length-1){return t.push(n[e+1])}})},_traverse:function(t,e,i){var o,l;if(t==null){t="vertical"}if(e==null){e=r}l=h.aggregate(e);o=[];this.each(function(){var e;e=n.inArray(this,l[t]);return i(o,e,l[t])});return this.pushStack(o)},_invoke:function(t,e){t.each(function(){var t;t=l.getWaypointsByElement(this);return n.each(t,function(t,n){n[e]();return true})});return this}};n.fn[g]=function(){var t,r;r=arguments[0],t=2<=arguments.length?e.call(arguments,1):[];if(d[r]){return d[r].apply(this,t)}else if(n.isFunction(r)){return d.init.apply(this,arguments)}else if(n.isPlainObject(r)){return d.init.apply(this,[null,r])}else if(!r){return n.error("jQuery Waypoints needs a callback function or handler option.")}else{return n.error("The "+r+" method does not exist in jQuery Waypoints.")}};n.fn[g].defaults={context:r,continuous:true,enabled:true,horizontal:false,offset:0,triggerOnce:false};h={refresh:function(){return n.each(a,function(t,e){return e.refresh()})},viewportHeight:function(){var t;return(t=r.innerHeight)!=null?t:i.height()},aggregate:function(t){var e,r,i;e=s;if(t){e=(i=a[n(t).data(u)])!=null?i.waypoints:void 0}if(!e){return[]}r={horizontal:[],vertical:[]};n.each(r,function(t,i){n.each(e[t],function(t,e){return i.push(e)});i.sort(function(t,e){return t.offset-e.offset});r[t]=n.map(i,function(t){return t.element});return r[t]=n.unique(r[t])});return r},above:function(t){if(t==null){t=r}return h._filter(t,"vertical",function(t,e){return e.offset<=t.oldScroll.y})},below:function(t){if(t==null){t=r}return h._filter(t,"vertical",function(t,e){return e.offset>t.oldScroll.y})},left:function(t){if(t==null){t=r}return h._filter(t,"horizontal",function(t,e){return e.offset<=t.oldScroll.x})},right:function(t){if(t==null){t=r}return h._filter(t,"horizontal",function(t,e){return e.offset>t.oldScroll.x})},enable:function(){return h._invoke("enable")},disable:function(){return h._invoke("disable")},destroy:function(){return h._invoke("destroy")},extendFn:function(t,e){return d[t]=e},_invoke:function(t){var e;e=n.extend({},s.vertical,s.horizontal);
vendor: 4,608 bytes, lines 95-105
95return n.each(e,function(e,n){n[t]();return true})},_filter:function(t,e,r){var i,o;i=a[n(t).data(u)];if(!i){return[]}o=[];n.each(i.waypoints[e],function(t,e){if(r(i,e)){return o.push(e)}});o.sort(function(t,e){return t.offset-e.offset});return n.map(o,function(t){return t.element})}};n[m]=function(){var t,n;n=arguments[0],t=2<=arguments.length?e.call(arguments,1):[];if(h[n]){return h[n].apply(null,t)}else{return h.aggregate.call(null,n)}};n[m].settings={resizeThrottle:100,scrollThrottle:30};return i.load(function(){return n[m]("refresh")})})}).call(this); 96/*! fancyBox v2.1.5 fancyapps.com | fancyapps.com/fancybox/#license */ 97 98(function(r,G,f,v){var J=f("html"),n=f(r),p=f(G),b=f.fancybox=function(){b.open.apply(this,arguments)},I=navigator.userAgent.match(/msie/i),B=null,s=G.createTouch!==v,t=function(a){return a&&a.hasOwnProperty&&a instanceof f},q=function(a){return a&&"string"===f.type(a)},E=function(a){return q(a)&&0<a.indexOf("%")},l=function(a,d){var e=parseInt(a,10)||0;d&&E(a)&&(e*=b.getViewport()[d]/100);return Math.ceil(e)},w=function(a,b){return l(a,b)+"px"};f.extend(b,{version:"2.1.5",defaults:{padding:15,margin:20, 99width:800,height:600,minWidth:100,minHeight:100,maxWidth:9999,maxHeight:9999,pixelRatio:1,autoSize:!0,autoHeight:!1,autoWidth:!1,autoResize:!0,autoCenter:!s,fitToView:!0,aspectRatio:!1,topRatio:0.5,leftRatio:0.5,scrolling:"auto",wrapCSS:"",arrows:!0,closeBtn:!0,closeClick:!1,nextClick:!1,mouseWheel:!0,autoPlay:!1,playSpeed:3E3,preload:3,modal:!1,loop:!0,ajax:{dataType:"html",headers:{"X-fancyBox":!0}},iframe:{scrolling:"auto",preload:!0},swf:{wmode:"transparent",allowfullscreen:"true",allowscriptaccess:"always"}, 100keys:{next:{13:"left",34:"up",39:"left",40:"up"},prev:{8:"right",33:"down",37:"right",38:"down"},close:[27],play:[32],toggle:[70]},direction:{next:"left",prev:"right"},scrollOutside:!0,index:0,type:null,href:null,content:null,title:null,tpl:{wrap:'<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>',image:'<img class="fancybox-image" src="{href}" alt="" />',iframe:'<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" frameborder="0" vspace="0" hspace="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen'+ 101(I?' allowtransparency="true"':"")+"></iframe>",error:'<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.</p>',closeBtn:'<a title="Close" class="fancybox-item fancybox-close" href="javascript:;"></a>',next:'<a title="Next" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>',prev:'<a title="Previous" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>'},openEffect:"fade",openSpeed:250,openEasing:"swing",openOpacity:!0, 102openMethod:"zoomIn",closeEffect:"fade",closeSpeed:250,closeEasing:"swing",closeOpacity:!0,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:250,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",prevSpeed:250,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:!0,title:!0},onCancel:f.noop,beforeLoad:f.noop,afterLoad:f.noop,beforeShow:f.noop,afterShow:f.noop,beforeChange:f.noop,beforeClose:f.noop,afterClose:f.noop},group:{},opts:{},previous:null,coming:null,current:null,isActive:!1, 103isOpen:!1,isOpened:!1,wrap:null,skin:null,outer:null,inner:null,player:{timer:null,isActive:!1},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(a,d){if(a&&(f.isPlainObject(d)||(d={}),!1!==b.close(!0)))return f.isArray(a)||(a=t(a)?f(a).get():[a]),f.each(a,function(e,c){var k={},g,h,j,m,l;"object"===f.type(c)&&(c.nodeType&&(c=f(c)),t(c)?(k={href:c.data("fancybox-href")||c.attr("href"),title:c.data("fancybox-title")||c.attr("title"),isDom:!0,element:c},f.metadata&&f.extend(!0,k, 104c.metadata())):k=c);g=d.href||k.href||(q(c)?c:null);h=d.title!==v?d.title:k.title||"";m=(j=d.content||k.content)?"html":d.type||k.type;!m&&k.isDom&&(m=c.data("fancybox-type"),m||(m=(m=c.prop("class").match(/fancybox\.(\w+)/))?m[1]:null));q(g)&&(m||(b.isImage(g)?m="image":b.isSWF(g)?m="swf":"#"===g.charAt(0)?m="inline":q(c)&&(m="html",j=c)),"ajax"===m&&(l=g.split(/\s+/,2),g=l.shift(),l=l.shift()));j||("inline"===m?g?j=f(q(g)?g.replace(/.*(?=#[^\s]+$)/,""):g):k.isDom&&(j=c):"html"===m?j=g:!m&&(!g&& 105k.isDom)&&(m="inline",j=c));f.extend(k,{href:g,type:m,content:j,title:h,selector:l});a[e]=k}),b.opts=f.extend(!0,{},b.defaults,d),d.keys!==v&&(b.opts.keys=d.keys?f.extend({},b.defaults.keys,d.keys):!1),b.group=a,b._start(b.opts.index)},cancel:function(){var a=b.coming;
105a&&!1!==b.trigger("onCancel")&&(b.hideLoading(),b.ajaxLoad&&b.ajaxLoad.abort(),b.ajaxLoad=null,b.imgPreload&&(b.imgPreload.onload=b.imgPreload.onerror=null),a.wrap&&a.wrap.stop(!0,!0).trigger("onReset").remove(),b.coming=null,b.current|| 106b._afterZoomOut(a))},close:function(a){b.cancel();!1!==b.trigger("beforeClose")&&(b.unbindEvents(),b.isActive&&(!b.isOpen||!0===a?(f(".fancybox-wrap").stop(!0).trigger("onReset").remove(),b._afterZoomOut()):(b.isOpen=b.isOpened=!1,b.isClosing=!0,f(".fancybox-item, .fancybox-nav").remove(),b.wrap.stop(!0,!0).removeClass("fancybox-opened"),b.transitions[b.current.closeMethod]())))},play:function(a){var d=function(){clearTimeout(b.player.timer)},e=function(){d();b.current&&b.player.isActive&&(b.player.timer= 107setTimeout(b.next,b.current.playSpeed))},c=function(){d();p.unbind(".player");b.player.isActive=!1;b.trigger("onPlayEnd")};if(!0===a||!b.player.isActive&&!1!==a){if(b.current&&(b.current.loop||b.current.index<b.group.length-1))b.player.isActive=!0,p.bind({"onCancel.player beforeClose.player":c,"onUpdate.player":e,"beforeLoad.player":d}),e(),b.trigger("onPlayStart")}else c()},next:function(a){var d=b.current;d&&(q(a)||(a=d.direction.next),b.jumpto(d.index+1,a,"next"))},prev:function(a){var d=b.current; 108d&&(q(a)||(a=d.direction.prev),b.jumpto(d.index-1,a,"prev"))},jumpto:function(a,d,e){var c=b.current;c&&(a=l(a),b.direction=d||c.direction[a>=c.index?"next":"prev"],b.router=e||"jumpto",c.loop&&(0>a&&(a=c.group.length+a%c.group.length),a%=c.group.length),c.group[a]!==v&&(b.cancel(),b._start(a)))},reposition:function(a,d){var e=b.current,c=e?e.wrap:null,k;c&&(k=b._getPosition(d),a&&"scroll"===a.type?(delete k.position,c.stop(!0,!0).animate(k,200)):(c.css(k),e.pos=f.extend({},e.dim,k)))},update:function(a){var d= 109a&&a.type,e=!d||"orientationchange"===d;e&&(clearTimeout(B),B=null);b.isOpen&&!B&&(B=setTimeout(function(){var c=b.current;c&&!b.isClosing&&(b.wrap.removeClass("fancybox-tmp"),(e||"load"===d||"resize"===d&&c.autoResize)&&b._setDimension(),"scroll"===d&&c.canShrink||b.reposition(a),b.trigger("onUpdate"),B=null)},e&&!s?0:300))},toggle:function(a){b.isOpen&&(b.current.fitToView="boolean"===f.type(a)?a:!b.current.fitToView,s&&(b.wrap.removeAttr("style").addClass("fancybox-tmp"),b.trigger("onUpdate")), 110b.update())},hideLoading:function(){p.unbind(".loading");f("#fancybox-loading").remove()},showLoading:function(){var a,d;b.hideLoading();a=f('<div id="fancybox-loading"><div></div></div>').click(b.cancel).appendTo("body");p.bind("keydown.loading",function(a){if(27===(a.which||a.keyCode))a.preventDefault(),b.cancel()});b.defaults.fixed||(d=b.getViewport(),a.css({position:"absolute",top:0.5*d.h+d.y,left:0.5*d.w+d.x}))},getViewport:function(){var a=b.current&&b.current.locked||!1,d={x:n.scrollLeft(), 111y:n.scrollTop()};a?(d.w=a[0].clientWidth,d.h=a[0].clientHeight):(d.w=s&&r.innerWidth?r.innerWidth:n.width(),d.h=s&&r.innerHeight?r.innerHeight:n.height());return d},unbindEvents:function(){b.wrap&&t(b.wrap)&&b.wrap.unbind(".fb");p.unbind(".fb");n.unbind(".fb")},bindEvents:function(){var a=b.current,d;a&&(n.bind("orientationchange.fb"+(s?"":" resize.fb")+(a.autoCenter&&!a.locked?" scroll.fb":""),b.update),(d=a.keys)&&p.bind("keydown.fb",function(e){var c=e.which||e.keyCode,k=e.target||e.srcElement; 112if(27===c&&b.coming)return!1;!e.ctrlKey&&(!e.altKey&&!e.shiftKey&&!e.metaKey&&(!k||!k.type&&!f(k).is("[contenteditable]")))&&f.each(d,function(d,k){if(1<a.group.length&&k[c]!==v)return b[d](k[c]),e.preventDefault(),!1;if(-1<f.inArray(c,k))return b[d](),e.preventDefault(),!1})}),f.fn.mousewheel&&a.mouseWheel&&b.wrap.bind("mousewheel.fb",function(d,c,k,g){for(var h=f(d.target||null),j=!1;h.length&&!j&&!h.is(".fancybox-skin")&&!h.is(".fancybox-wrap");)j=h[0]&&!(h[0].style.overflow&&"hidden"===h[0].style.overflow)&& 113(h[0].clientWidth&&h[0].scrollWidth>h[0].clientWidth||h[0].clientHeight&&h[0].scrollHeight>h[0].clientHeight),h=f(h).parent();if(0!==c&&!j&&1<b.group.length&&!a.canShrink){if(0<g||0<k)b.prev(0<g?"down":"left");else if(0>g||0>k)b.next(0>g?"up":"right");d.preventDefault()}}))},trigger:function(a,d){var e,c=d||b.coming||b.current;if(c){f.isFunction(c[a])&&(e=c[a].apply(c,Array.prototype.slice.call(arguments,1
vendor: 9,987 bytes, lines 113-133
113)));if(!1===e)return!1;c.helpers&&f.each(c.helpers,function(d,e){if(e&&b.helpers[d]&&f.isFunction(b.helpers[d][a]))b.helpers[d][a](f.extend(!0, 114{},b.helpers[d].defaults,e),c)});p.trigger(a)}},isImage:function(a){return q(a)&&a.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i)},isSWF:function(a){return q(a)&&a.match(/\.(swf)((\?|#).*)?$/i)},_start:function(a){var d={},e,c;a=l(a);e=b.group[a]||null;if(!e)return!1;d=f.extend(!0,{},b.opts,e);e=d.margin;c=d.padding;"number"===f.type(e)&&(d.margin=[e,e,e,e]);"number"===f.type(c)&&(d.padding=[c,c,c,c]);d.modal&&f.extend(!0,d,{closeBtn:!1,closeClick:!1,nextClick:!1,arrows:!1, 115mouseWheel:!1,keys:null,helpers:{overlay:{closeClick:!1}}});d.autoSize&&(d.autoWidth=d.autoHeight=!0);"auto"===d.width&&(d.autoWidth=!0);"auto"===d.height&&(d.autoHeight=!0);d.group=b.group;d.index=a;b.coming=d;if(!1===b.trigger("beforeLoad"))b.coming=null;else{c=d.type;e=d.href;if(!c)return b.coming=null,b.current&&b.router&&"jumpto"!==b.router?(b.current.index=a,b[b.router](b.direction)):!1;b.isActive=!0;if("image"===c||"swf"===c)d.autoHeight=d.autoWidth=!1,d.scrolling="visible";"image"===c&&(d.aspectRatio= 116!0);"iframe"===c&&s&&(d.scrolling="scroll");d.wrap=f(d.tpl.wrap).addClass("fancybox-"+(s?"mobile":"desktop")+" fancybox-type-"+c+" fancybox-tmp "+d.wrapCSS).appendTo(d.parent||"body");f.extend(d,{skin:f(".fancybox-skin",d.wrap),outer:f(".fancybox-outer",d.wrap),inner:f(".fancybox-inner",d.wrap)});f.each(["Top","Right","Bottom","Left"],function(a,b){d.skin.css("padding"+b,w(d.padding[a]))});b.trigger("onReady");if("inline"===c||"html"===c){if(!d.content||!d.content.length)return b._error("content")}else if(!e)return b._error("href"); 117"image"===c?b._loadImage():"ajax"===c?b._loadAjax():"iframe"===c?b._loadIframe():b._afterLoad()}},_error:function(a){f.extend(b.coming,{type:"html",autoWidth:!0,autoHeight:!0,minWidth:0,minHeight:0,scrolling:"no",hasError:a,content:b.coming.tpl.error});b._afterLoad()},_loadImage:function(){var a=b.imgPreload=new Image;a.onload=function(){this.onload=this.onerror=null;b.coming.width=this.width/b.opts.pixelRatio;b.coming.height=this.height/b.opts.pixelRatio;b._afterLoad()};a.onerror=function(){this.onload= 118this.onerror=null;b._error("image")};a.src=b.coming.href;!0!==a.complete&&b.showLoading()},_loadAjax:function(){var a=b.coming;b.showLoading();b.ajaxLoad=f.ajax(f.extend({},a.ajax,{url:a.href,error:function(a,e){b.coming&&"abort"!==e?b._error("ajax",a):b.hideLoading()},success:function(d,e){"success"===e&&(a.content=d,b._afterLoad())}}))},_loadIframe:function(){var a=b.coming,d=f(a.tpl.iframe.replace(/\{rnd\}/g,(new Date).getTime())).attr("scrolling",s?"auto":a.iframe.scrolling).attr("src",a.href); 119f(a.wrap).bind("onReset",function(){try{f(this).find("iframe").hide().attr("src","//about:blank").end().empty()}catch(a){}});a.iframe.preload&&(b.showLoading(),d.one("load",function(){f(this).data("ready",1);s||f(this).bind("load.fb",b.update);f(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show();b._afterLoad()}));a.content=d.appendTo(a.inner);a.iframe.preload||b._afterLoad()},_preloadImages:function(){var a=b.group,d=b.current,e=a.length,c=d.preload?Math.min(d.preload, 120e-1):0,f,g;for(g=1;g<=c;g+=1)f=a[(d.index+g)%e],"image"===f.type&&f.href&&((new Image).src=f.href)},_afterLoad:function(){var a=b.coming,d=b.current,e,c,k,g,h;b.hideLoading();if(a&&!1!==b.isActive)if(!1===b.trigger("afterLoad",a,d))a.wrap.stop(!0).trigger("onReset").remove(),b.coming=null;else{d&&(b.trigger("beforeChange",d),d.wrap.stop(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove());b.unbindEvents();e=a.content;c=a.type;k=a.scrolling;f.extend(b,{wrap:a.wrap,skin:a.skin, 121outer:a.outer,inner:a.inner,current:a,previous:d});g=a.href;switch(c){case "inline":case "ajax":case "html":a.selector?e=f("<div>").html(e).find(a.selector):t(e)&&(e.data("fancybox-placeholder")||e.data("fancybox-placeholder",f('<div class="fancybox-placeholder"></div>').insertAfter(e).hide()),e=e.show().detach(),a.wrap.bind("onReset",function(){f(this).find(e).length&&e.hide().replaceAll(e.data("fancybox-placeholder")).data("fancybox-placeholder",!1)}));break;case "image":e=a.tpl.image.replace("{href}", 122g);break;case "swf":e='<object id="fancybox-swf" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%"><param name="movie" value="'+g+'"></param>',h="",f.each(a.swf,function(a,b){e+='<param name="'+a+'" value="'+b+'"></param>';h+=" "+a+'="'+b+'"'}),e+='<embed src="'+g+'" type="application/x-shockwave-flash" width="100%" height="100%"'+h+"></embed></object>"}(!t(e)||!e.parent().is(a.inner))&&a.inner.append(e);b.trigger("beforeShow");a.inner.css("overflow","yes"===k?"scroll": 123"no"===k?"hidden":k);b._setDimension();b.reposition();b.isOpen=!1;b.coming=null;b.bindEvents();if(b.isOpened){if(d.prevMethod)b.transitions[d.prevMethod]()}else f(".fancybox-wrap").not(a.wrap).stop(!0).trigger("onReset").remove();b.transitions[b.isOpened?a.nextMethod:a.openMethod]();b._preloadImages()}},_setDimension:function(){var a=b.getViewport(),d=0,e=!1,c=!1,e=b.wrap,k=b.skin,g=b.inner,h=b.current,c=h.width,j=h.height,m=h.minWidth,u=h.minHeight,n=h.maxWidth,p=h.maxHeight,s=h.scrolling,q=h.scrollOutside? 124h.scrollbarWidth:0,x=h.margin,y=l(x[1]+x[3]),r=l(x[0]+x[2]),v,z,t,C,A,F,B,D,H;e.add(k).add(g).width("auto").height("auto").removeClass("fancybox-tmp");x=l(k.outerWidth(!0)-k.width());v=l(k.outerHeight(!0)-k.height());z=y+x;t=r+v;C=E(c)?(a.w-z)*l(c)/100:c;A=E(j)?(a.h-t)*l(j)/100:j;if("iframe"===h.type){if(H=h.content,h.autoHeight&&1===H.data("ready"))try{H[0].contentWindow.document.location&&(g.width(C).height(9999),F=H.contents().find("body"),q&&F.css("overflow-x","hidden"),A=F.outerHeight(!0))}catch(G){}}else if(h.autoWidth|| 125h.autoHeight)g.addClass("fancybox-tmp"),h.autoWidth||g.width(C),h.autoHeight||g.height(A),h.autoWidth&&(C=g.width()),h.autoHeight&&(A=g.height()),g.removeClass("fancybox-tmp");c=l(C);j=l(A);D=C/A;m=l(E(m)?l(m,"w")-z:m);n=l(E(n)?l(n,"w")-z:n);u=l(E(u)?l(u,"h")-t:u);p=l(E(p)?l(p,"h")-t:p);F=n;B=p;h.fitToView&&(n=Math.min(a.w-z,n),p=Math.min(a.h-t,p));z=a.w-y;r=a.h-r;h.aspectRatio?(c>n&&(c=n,j=l(c/D)),j>p&&(j=p,c=l(j*D)),c<m&&(c=m,j=l(c/D)),j<u&&(j=u,c=l(j*D))):(c=Math.max(m,Math.min(c,n)),h.autoHeight&& 126"iframe"!==h.type&&(g.width(c),j=g.height()),j=Math.max(u,Math.min(j,p)));if(h.fitToView)if(g.width(c).height(j),e.width(c+x),a=e.width(),y=e.height(),h.aspectRatio)for(;(a>z||y>r)&&(c>m&&j>u)&&!(19<d++);)j=Math.max(u,Math.min(p,j-10)),c=l(j*D),c<m&&(c=m,j=l(c/D)),c>n&&(c=n,j=l(c/D)),g.width(c).height(j),e.width(c+x),a=e.width(),y=e.height();else c=Math.max(m,Math.min(c,c-(a-z))),j=Math.max(u,Math.min(j,j-(y-r)));q&&("auto"===s&&j<A&&c+x+q<z)&&(c+=q);g.width(c).height(j);e.width(c+x);a=e.width(); 127y=e.height();e=(a>z||y>r)&&c>m&&j>u;c=h.aspectRatio?c<F&&j<B&&c<C&&j<A:(c<F||j<B)&&(c<C||j<A);f.extend(h,{dim:{width:w(a),height:w(y)},origWidth:C,origHeight:A,canShrink:e,canExpand:c,wPadding:x,hPadding:v,wrapSpace:y-k.outerHeight(!0),skinSpace:k.height()-j});!H&&(h.autoHeight&&j>u&&j<p&&!c)&&g.height("auto")},_getPosition:function(a){var d=b.current,e=b.getViewport(),c=d.margin,f=b.wrap.width()+c[1]+c[3],g=b.wrap.height()+c[0]+c[2],c={position:"absolute",top:c[0],left:c[3]};d.autoCenter&&d.fixed&& 128!a&&g<=e.h&&f<=e.w?c.position="fixed":d.locked||(c.top+=e.y,c.left+=e.x);c.top=w(Math.max(c.top,c.top+(e.h-g)*d.topRatio));c.left=w(Math.max(c.left,c.left+(e.w-f)*d.leftRatio));return c},_afterZoomIn:function(){var a=b.current;a&&(b.isOpen=b.isOpened=!0,b.wrap.css("overflow","visible").addClass("fancybox-opened"),b.update(),(a.closeClick||a.nextClick&&1<b.group.length)&&b.inner.css("cursor","pointer").bind("click.fb",function(d){!f(d.target).is("a")&&!f(d.target).parent().is("a")&&(d.preventDefault(), 129b[a.closeClick?"close":"next"]())}),a.closeBtn&&f(a.tpl.closeBtn).appendTo(b.skin).bind("click.fb",function(a){a.preventDefault();b.close()}),a.arrows&&1<b.group.length&&((a.loop||0<a.index)&&f(a.tpl.prev).appendTo(b.outer).bind("click.fb",b.prev),(a.loop||a.index<b.group.length-1)&&f(a.tpl.next).appendTo(b.outer).bind("click.fb",b.next)),b.trigger("afterShow"),!a.loop&&a.index===a.group.length-1?b.play(!1):b.opts.autoPlay&&!b.player.isActive&&(b.opts.autoPlay=!1,b.play()))},_afterZoomOut:function(a){a= 130a||b.current;f(".fancybox-wrap").trigger("onReset").remove();f.extend(b,{group:{},opts:{},router:!1,current:null,isActive:!1,isOpened:!1,isOpen:!1,isClosing:!1,wrap:null,skin:null,outer:null,inner:null});b.trigger("afterClose",a)}});b.transitions={getOrigPosition:function(){var a=b.current,d=a.element,e=a.orig,c={},f=50,g=50,h=a.hPadding,j=a.wPadding,m=b.getViewport();!e&&(a.isDom&&d.is(":visible"))&&(e=d.find("img:first"),e.length||(e=d));t(e)?(c=e.offset(),e.is("img")&&(f=e.outerWidth(),g=e.outerHeight())): 131(c.top=m.y+(m.h-g)*a.topRatio,c.left=m.x+(m.w-f)*a.leftRatio);if("fixed"===b.wrap.css("position")||a.locked)c.top-=m.y,c.left-=m.x;return c={top:w(c.top-h*a.topRatio),left:w(c.left-j*a.leftRatio),width:w(f+j),height:w(g+h)}},step:function(a,d){var e,c,f=d.prop;c=b.current;var g=c.wrapSpace,h=c.skinSpace;if("width"===f||"height"===f)e=d.end===d.start?1:(a-d.start)/(d.end-d.start),b.isClosing&&(e=1-e),c="width"===f?c.wPadding:c.hPadding,c=a-c,b.skin[f](l("width"===f?c:c-g*e)),b.inner[f](l("width"=== 132f?c:c-g*e-h*e))},zoomIn:function(){var a=b.current,d=a.pos,e=a.openEffect,c="elastic"===e,k=f.extend({opacity:1},d);delete k.position;c?(d=this.getOrigPosition(),a.openOpacity&&(d.opacity=0.1)):"fade"===e&&(d.opacity=0.1);b.wrap.css(d).animate(k,{duration:"none"===e?0:a.openSpeed,easing:a.openEasing,step:c?this.step:null,complete:b._afterZoomIn})},zoomOut:function(){var a=b.current,d=a.closeEffect,e="elastic"===d,c={opacity:0.1};e&&(c=this.getOrigPosition(),a.closeOpacity&&(c.opacity=0.1));b.wrap.animate(c, 133{duration:"none"===d?0:a.closeSpeed,easing:a.closeEasing,step:e?this.step:null,complete:b._afterZoomOut})}
133,changeIn:function(){var a=b.current,d=a.nextEffect,e=a.pos,c={opacity:1},f=b.direction,g;e.opacity=0.1;"elastic"===d&&(g="down"===f||"up"===f?"top":"left","down"===f||"right"===f?(e[g]=w(l(e[g])-200),c[g]="+=200px"):(e[g]=w(l(e[g])+200),c[g]="-=200px"));"none"===d?b._afterZoomIn():b.wrap.css(e).animate(c,{duration:a.nextSpeed,easing:a.nextEasing,complete:b._afterZoomIn})},changeOut:function(){var a= 134b.previous,d=a.prevEffect,e={opacity:0.1},c=b.direction;"elastic"===d&&(e["down"===c||"up"===c?"top":"left"]=("up"===c||"left"===c?"-":"+")+"=200px");a.wrap.animate(e,{duration:"none"===d?0:a.prevSpeed,easing:a.prevEasing,complete:function(){f(this).trigger("onReset").remove()}})}};b.helpers.overlay={defaults:{closeClick:!0,speedOut:200,showEarly:!0,css:{},locked:!s,fixed:!0},overlay:null,fixed:!1,el:f("html"),create:function(a){a=f.extend({},this.defaults,a);this.overlay&&this.close();this.overlay= 135f('<div class="fancybox-overlay"></div>').appendTo(b.coming?b.coming.parent:a.parent);this.fixed=!1;a.fixed&&b.defaults.fixed&&(this.overlay.addClass("fancybox-overlay-fixed"),this.fixed=!0)},open:function(a){var d=this;a=f.extend({},this.defaults,a);this.overlay?this.overlay.unbind(".overlay").width("auto").height("auto"):this.create(a);this.fixed||(n.bind("resize.overlay",f.proxy(this.update,this)),this.update());a.closeClick&&this.overlay.bind("click.overlay",function(a){if(f(a.target).hasClass("fancybox-overlay"))return b.isActive? 136b.close():d.close(),!1});this.overlay.css(a.css).show()},close:function(){var a,b;n.unbind("resize.overlay");this.el.hasClass("fancybox-lock")&&(f(".fancybox-margin").removeClass("fancybox-margin"),a=n.scrollTop(),b=n.scrollLeft(),this.el.removeClass("fancybox-lock"),n.scrollTop(a).scrollLeft(b));f(".fancybox-overlay").remove().hide();f.extend(this,{overlay:null,fixed:!1})},update:function(){var a="100%",b;this.overlay.width(a).height("100%");I?(b=Math.max(G.documentElement.offsetWidth,G.body.offsetWidth), 137p.width()>b&&(a=p.width())):p.width()>n.width()&&(a=p.width());this.overlay.width(a).height(p.height())},onReady:function(a,b){var e=this.overlay;f(".fancybox-overlay").stop(!0,!0);e||this.create(a);a.locked&&(this.fixed&&b.fixed)&&(e||(this.margin=p.height()>n.height()?f("html").css("margin-right").replace("px",""):!1),b.locked=this.overlay.append(b.wrap),b.fixed=!1);!0===a.showEarly&&this.beforeShow.apply(this,arguments)},beforeShow:function(a,b){var e,c;b.locked&&(!1!==this.margin&&(f("*").filter(function(){return"fixed"=== 138f(this).css("position")&&!f(this).hasClass("fancybox-overlay")&&!f(this).hasClass("fancybox-wrap")}).addClass("fancybox-margin"),this.el.addClass("fancybox-margin")),e=n.scrollTop(),c=n.scrollLeft(),this.el.addClass("fancybox-lock"),n.scrollTop(e).scrollLeft(c));this.open(a)},onUpdate:function(){this.fixed||this.update()},afterClose:function(a){this.overlay&&!b.coming&&this.overlay.fadeOut(a.speedOut,f.proxy(this.close,this))}};b.helpers.title={defaults:{type:"float",position:"bottom"},beforeShow:function(a){var d= 139b.current,e=d.title,c=a.type;f.isFunction(e)&&(e=e.call(d.element,d));if(q(e)&&""!==f.trim(e)){d=f('<div class="fancybox-title fancybox-title-'+c+'-wrap">'+e+"</div>");switch(c){case "inside":c=b.skin;break;case "outside":c=b.wrap;break;case "over":c=b.inner;break;default:c=b.skin,d.appendTo("body"),I&&d.width(d.width()),d.wrapInner('<span class="child"></span>'),b.current.margin[2]+=Math.abs(l(d.css("margin-bottom")))}d["top"===a.position?"prependTo":"appendTo"](c)}}};f.fn.fancybox=function(a){var d, 140e=f(this),c=this.selector||"",k=function(g){var h=f(this).blur(),j=d,k,l;!g.ctrlKey&&(!g.altKey&&!g.shiftKey&&!g.metaKey)&&!h.is(".fancybox-wrap")&&(k=a.groupAttr||"data-fancybox-group",l=h.attr(k),l||(k="rel",l=h.get(0)[k]),l&&(""!==l&&"nofollow"!==l)&&(h=c.length?f(c):e,h=h.filter("["+k+'="'+l+'"]'),j=h.index(this)),a.index=j,!1!==b.o
140pen(h,a)&&g.preventDefault())};a=a||{};d=a.index||0;!c||!1===a.live?e.unbind("click.fb-start").bind("click.fb-start",k):p.undelegate(c,"click.fb-start").delegate(c+ 141":not('.fancybox-item, .fancybox-nav')","click.fb-start",k);this.filter("[data-fancybox-start=1]").trigger("click");return this};p.ready(function(){var a,d;f.scrollbarWidth===v&&(f.scrollbarWidth=function(){var a=f('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo("body"),b=a.children(),b=b.innerWidth()-b.height(99).innerWidth();a.remove();return b});if(f.support.fixedPosition===v){a=f.support;d=f('<div style="position:fixed;top:20px;"></div>').appendTo("body");var e=20=== 142d[0].offsetTop||15===d[0].offsetTop;d.remove();a.fixedPosition=e}f.extend(b.defaults,{scrollbarWidth:f.scrollbarWidth(),fixed:f.support.fixedPosition,parent:f("body")});a=f(r).width();J.addClass("fancybox-lock-test");d=f(r).width();J.removeClass("fancybox-lock-test");f("<style type='text/css'>.fancybox-margin{margin-right:"+(d-a)+"px;}</style>").appendTo("head")})})(window,document,jQuery); 143/** 144 Core layout handlers and component wrappers 145 **/ 146 147// BEGIN: Layout Brand 148var LayoutBrand = function () { 149 150 return { 151 //main function to initiate the module 152 init: function () { 153 $('body').on('click', '.c-hor-nav-toggler', function () { 154 var target = $(this).data('target'); 155 $(target).toggleClass("c-shown"); 156 }); 157 } 158 159 }; 160}(); 161// END 162 163// BEGIN: Layout Brand 164var LayoutHeaderCart = function () { 165 166 return { 167 //main function to initiate the module 168 init: function () { 169 var cart = $('.c-cart-menu'); 170 171 if (cart.size() === 0) { 172 return; 173 } 174 175 if (App.getViewPort().width < App.getBreakpoint('md')) { // mpbile mode 176 $('body').on('click', '.c-cart-toggler', function (e) { 177 e.preventDefault(); 178 e.stopPropagation(); 179 $('body').toggleClass("c-header-cart-shown"); 180 }); 181 182 $('body').on('click', function (e) { 183 if (!cart.is(e.target) && cart.has(e.target).length === 0) { 184 $('body').removeClass('c-header-cart-shown'); 185 } 186 }); 187 } else { // desktop 188 $('body').on('hover', '.c-cart-toggler, .c-cart-menu', function (e) { 189 $('body').addClass("c-header-cart-shown"); 190 }); 191 192 $('body').on('hover', '.c-mega-menu > .navbar-nav > li:not(.c-cart-toggler-wrapper)', function (e) { 193 $('body').removeClass("c-header-cart-shown"); 194 }); 195 196 $('body').on('mouseleave', '.c-cart-menu', function (e) { 197 $('body').removeClass("c-header-cart-shown"); 198 }); 199 } 200 } 201 }; 202}(); 203// END 204 205// BEGIN: Layout Header 206var LayoutHeader = function () { 207 var offset = parseInt($('.c-layout-header').attr('data-minimize-offset') > 0 ? parseInt($('.c-layout-header').attr('data-minimize-offset')) : 0); 208 var _handleHeaderOnScroll = function () { 209 if ($(window).scrollTop() > offset) { 210 $("body").addClass("c-page-on-scroll"); 211 } else { 212 $("body").removeClass("c-page-on-scroll"); 213 } 214 } 215 216 var _handleTopbarCollapse = function () { 217 $('.c-layout-header .c-topbar-toggler').on('click', function (e) { 218 $('.c-layout-header-topbar-collapse').toggleClass("c-topbar-expanded"); 219 }); 220 } 221 222 return { 223 //main function to initiate the module 224 init: function () { 225 if ($('body').hasClass('c-layout-header-fixed-non-minimized')) { 226 return; 227 } 228 229 _handleHeaderOnScroll(); 230 _handleTopbarCollapse(); 231 232 $(window).scroll(function () { 233 _handleHeaderOnScroll(); 234 }); 235 } 236 }; 237}(); 238// END 239 240// BEGIN: Layout Mega Menu 241var LayoutMegaMenu = function () { 242 243 return { 244 //main function to initiate the module 245 init: function () { 246 $('.c-mega-menu').on('click', '.c-toggler', function (e) { 247 if (App.getViewPort().width < App.getBreakpoint('md')) { 248 e.preventDefault(); 249 if ($(this).closest("li").hasClass('c-open')) { 250 $(this).closest("li").removeClass('c-open'); 251 } else { 252 $(this).closest("li").addClass('c-open'); 253 } 254 } 255 }); 256 257 $('.c-layout-header .c-hor-nav-toggler:not(.c-quick-sidebar-toggler)').on('click', function () { 258 $('.c-layout-header').toggleClass('c-mega-menu-shown'); 259 260 if ($('body').hasClass('c-layout-header-mobile-fixed')) { 261 var height = App.getViewPort().height - $('.c-layout-header').outerHeight(true) - 60; 262 $('.c-mega-menu').css('max-height', height); 263 } 264 }); 265 } 266 }; 267}(); 268// END 269 270// BEGIN: Layout Mega Menu 271var LayoutSidebarMenu = function () { 272 273 return { 274 //main function to initiate the module 275 init: function () { 276 $('.c-layout-sidebar-menu > .c-sidebar-menu .c-toggler').on('click', function (e) { 277 e.preventDefault(); 278 $(this).closest('.c-dropdown').toggleClass('c-open'); 279 }); 280 } 281 }; 282}(); 283// END 284 285// BEGIN: Layout Mega Menu 286var LayoutQuickSearch = function () { 287 288 return { 289 //main function to initiate the module 290 init: function () { 291 // desktop mode 292 $('.c-layout-header').on('click', '.c-mega-menu .c-search-toggler', function (e) { 293 e.preventDefault(); 294 295 $('body').addClass('c-layout-quick-search-shown'); 296 297 if (App.isIE() === false) { 298 $('.c-quick-search > .form-control').focus(); 299 } 300 }); 301 302 // mobile mode 303 $('.c-layout-header').on('click', '.c-brand .c-search-toggler', function (e) { 304 e.preventDefault(); 305 306 $('body').addClass('c-layout-quick-search-shown'); 307 308 if (App.isIE() === false) { 309 $('.c-quick-search > .form-control').focus(); 310 } 311 }); 312 313 // handle close icon for mobile and desktop 314 $('.c-quick-search').on('click', '> span', function (e) { 315 e.preventDefault(); 316 $('body').removeClass('c-layout-quick-search-shown'); 317 }); 318 } 319 }; 320}(); 321// END 322 323var LayoutCartMenu = function () { 324 325 return { 326 //main function to initiate the module 327 init: function () { 328 // desktop mode 329 $('.c-layout-header').on('mouseenter', '.c-mega-menu .c-cart-toggler-wrapper', function (e) { 330 e.preventDefault(); 331 332 $('.c-cart-menu').addClass('c-layout-cart-menu-shown'); 333 334 }); 335 336 $('.c-cart-menu, .c-layout-header').on('mouseleave', function (e) { 337 e.preventDefault(); 338 339 $('.c-cart-menu').removeClass('c-layout-cart-menu-shown'); 340 341 }); 342 343 // mobile mode 344 $('.c-layout-header').on('click', '.c-brand .c-cart-toggler', function (e) { 345 e.preventDefault(); 346 347 $('.c-cart-menu').toggleClass('c-layout-cart-menu-shown'); 348 349 }); 350 } 351 }; 352}(); 353// END 354 355// BEGIN: Layout Mega Menu 356var LayoutQuickSidebar = function () { 357 358 return { 359 //main function to initiate the module 360 init: function () { 361 // desktop mode 362 $('.c-layout-header').on('click', '.c-quick-sidebar-toggler', function (e) { 363 e.preventDefault(); 364 e.stopPropagation(); 365
366 if ($('body').hasClass("c-layout-quick-sidebar-shown")) { 367 $('body').removeClass("c-layout-quick-sidebar-shown"); 368 } else { 369 $('body').addClass("c-layout-quick-sidebar-shown"); 370 } 371 }); 372 373 $('.c-layout-quick-sidebar').on('click', '.c-close', function (e) { 374 e.preventDefault(); 375 376 $('body').removeClass("c-layout-quick-sidebar-shown"); 377 }); 378 379 $('.c-layout-quick-sidebar').on('click', function (e) { 380 e.stopPropagation(); 381 }); 382 383 $(document).on('click', '.c-layout-quick-sidebar-shown', function (e) { 384 $(this).removeClass("c-layout-quick-sidebar-shown"); 385 }); 386 } 387 }; 388}(); 389// END 390 391// BEGIN: Layout Go To Top 392var LayoutGo2Top = function () { 393 394 var handle = function () { 395 var currentWindowPosition = $(window).scrollTop(); // current vertical position 396 if (currentWindowPosition > 300) { 397 $(".c-layout-go2top").show(); 398 } else { 399 $(".c-layout-go2top").hide(); 400 } 401 }; 402 403 return { 404 405 //main function to initiate the module 406 init: function () { 407 408 handle(); // call headerFix() when the page was loaded 409 410 if (navigator.userAgent.match(/iPhone|iPad|iPod/i)) { 411 $(window).bind("touchend touchcancel touchleave", function (e) { 412 handle(); 413 }); 414 } else { 415 $(window).scroll(function () { 416 handle(); 417 }); 418 } 419 420 $(".c-layout-go2top").on('click', function (e) { 421 e.preventDefault(); 422 $("html, body").animate({ 423 scrollTop: 0 424 }, 600); 425 }); 426 } 427 428 }; 429}(); 430// END: Layout Go To Top 431 432// BEGIN: Onepage Nav 433var LayoutOnepageNav = function () { 434 435 var handle = function () { 436 var offset; 437 var scrollspy; 438 var speed; 439 var nav; 440 441 $('body').addClass('c-page-on-scroll'); 442 offset = $('.c-layout-header-onepage').outerHeight(true); 443 $('body').removeClass('c-page-on-scroll'); 444 445 if ($('.c-mega-menu-onepage-dots').size() > 0) { 446 if ($('.c-onepage-dots-nav').size() > 0) { 447 $('.c-onepage-dots-nav').css('margin-top', -($('.c-onepage-dots-nav').outerHeight(true) / 2)); 448 } 449 scrollspy = $('body').scrollspy({ 450 target: '.c-mega-menu-onepage-dots', 451 offset: offset 452 }); 453 speed = parseInt($('.c-mega-menu-onepage-dots').attr('data-onepage-animation-speed')); 454 } else { 455 scrollspy = $('body').scrollspy({ 456 target: '.c-mega-menu-onepage', 457 offset: offset 458 }); 459 speed = parseInt($('.c-mega-menu-onepage').attr('data-onepage-animation-speed')); 460 } 461 462 scrollspy.on('activate.bs.scrollspy', function () { 463 $(this).find('.c-onepage-link.c-active').removeClass('c-active'); 464 $(this).find('.c-onepage-link.active').addClass('c-active'); 465 }); 466 467 $('.c-onepage-link > a').on('click', function (e) { 468 var section = $(this).attr('href'); 469 var top = 0; 470 471 if (section !== "#home") { 472 top = $(section).offset().top - offset + 1; 473 } 474 475 $('html, body').stop().animate({ 476 scrollTop: top, 477 }, speed, 'easeInExpo'); 478 479 e.preventDefault(); 480 481 if (App.getViewPort().width < App.getBreakpoint('md')) { 482 $('.c-hor-nav-toggler').click(); 483 } 484 }); 485 }; 486 487 return { 488 489 //main function to initiate the module 490 init: function () { 491 handle(); // call headerFix() when the page was loaded 492 } 493 494 }; 495}(); 496// END: Onepage Nav 497 498// BEGIN: Handle Theme Settings 499var LayoutThemeSettings = function () { 500 501 var handle = function () { 502 503 $('.c-settings .c-color').on('click', function () { 504 var val = $(this).attr('data-color'); 505 $('#style_theme').attr('href', 'assets/base/css/themes/' + val + '.css'); 506 507 $('.c-settings .c-color').removeClass('c-active'); 508 $(this).addClass('c-active'); 509 }); 510 511 $('.c-setting_header-type').on('click', function () { 512 var val = $(this).attr('data-value'); 513 if (val == 'fluid') { 514 $('.c-layout-header .c-topbar > .container').removeClass('container').addClass('container-fluid'); 515 $('.c-layout-header .c-navbar > .container').removeClass('container').addClass('container-fluid'); 516 } else { 517 $('.c-layout-header .c-topbar > .container-fluid').removeClass('container-fluid').addClass('container'); 518 $('.c-layout-header .c-navbar > .container-fluid').removeClass('container-fluid').addClass('container'); 519 } 520 $('.c-setting_header-type').removeClass('active'); 521 $(this).addClass('active'); 522 }); 523 524 $('.c-setting_header-mode').on('click', function () { 525 var val = $(this).attr('data-value'); 526 if (val == 'static') { 527 $('body').removeClass('c-layout-header-fixed').addClass('c-layout-header-static'); 528 } else { 529 $('body').removeClass('c-layout-header-static').addClass('c-layout-header-fixed'); 530 } 531 $('.c-setting_header-mode').removeClass('active'); 532 $(this).addClass('active'); 533 }); 534 535 $('.c-setting_font-style').on('click', function () { 536 var val = $(this).attr('data-value'); 537 538 if (val == 'light') { 539 $('.c-font-uppercase').addClass('c-font-uppercase-reset').removeClass('c-font-uppercase'); 540 $('.c-font-bold').addClass('c-font-bold-reset').removeClass('c-font-bold'); 541 542 $('.c-fonts-uppercase').addClass('c-fonts-uppercase-reset').removeClass('c-fonts-uppercase'); 543 $('.c-fonts-bold').addClass('c-fonts-bold-reset').removeClass('c-fonts-bold'); 544 } else { 545 $('.c-font-uppercase-reset').addClass('c-font-uppercase').removeClass('c-font-uppercase-reset'); 546 $('.c-font-bold-reset').addClass('c-font-bold').removeClass('c-font-bold-reset'); 547 548 $('.c-fonts-uppercase-reset').addClass('c-fonts-uppercase').removeClass('c-fonts-uppercase-reset'); 549 $('.c-fonts-bold-reset').addClass('c-fonts-bold').removeClass('c-fonts-bold-reset'); 550 } 551 552 $('.c-setting_font-style').removeClass('active'); 553 $(this).addClass('active'); 554 }); 555 556 $('.c-setting_megamenu-style').on('click', function () { 557 var val = $(this).attr('data-value'); 558 if (val == 'dark') { 559 $('.c-mega-menu').removeClass('c-mega-menu-light').addClass('c-mega-menu-dark'); 560 } else { 561 $('.c-mega-menu').removeClass('c-mega-menu-dark').addClass('c-mega-menu-light'); 562 } 563 $('.c-setting_megamenu-style').removeClass('active'); 564 $(this).addClass('active'); 565 }); 566 567 }; 568 569 return { 570 571 //main function to initiate the module 572 init: function () { 573 574 handle(); 575 } 576 577 }; 578}(); 579// END: Handle Theme Settings 580 581// BEGIN: OwlCarousel 582var ContentOwlcarousel = function () { 583 584 var _initInstances = function () {
585 $("[data-slider='owl'] .owl-carousel").each(function () { 586 var parent = $(this).parent(); 587 588 var items; 589 var itemsDesktop; 590 var itemsDesktopSmall; 591 var itemsTablet; 592 var itemsTabletSmall; 593 var itemsMobile; 594 595 if (parent.data("single-item") == "true") { 596 items = 1; 597 itemsDesktop = 1; 598 itemsDesktopSmall = 1; 599 itemsTablet = 1; 600 itemsTabletSmall = 1; 601 itemsMobile = 1; 602 } else { 603 items = parent.data('items'); 604 itemsDesktop = [1199, parent.data('desktop-items') ? parent.data('desktop-items') : items]; 605 itemsDesktopSmall = [979, parent.data('desktop-small-items') ? parent.data('desktop-small-items') : 3]; 606 itemsTablet = [768, parent.data('tablet-items') ? parent.data('tablet-items') : 2]; 607 itemsMobile = [479, parent.data('mobile-items') ? parent.data('mobile-items') : 1]; 608 } 609 610 $(this).owlCarousel({ 611 612 items: items, 613 itemsDesktop: itemsDesktop, 614 itemsDesktopSmall: itemsDesktopSmall, 615 itemsTablet: itemsTablet, 616 itemsTabletSmall: itemsTablet, 617 itemsMobile: itemsMobile, 618 619 navigation: parent.data("navigation") ? true : false, 620 navigationText: false, 621 slideSpeed: parent.data('slide-speed'), 622 paginationSpeed: parent.data('pagination-speed'), 623 singleItem: parent.data("single-item") ? true : false, 624 autoPlay: parent.data("auto-play") 625 }); 626 }); 627 }; 628 629 return { 630 631 //main function to initiate the module 632 init: function () { 633 634 _initInstances(); 635 } 636 637 }; 638}(); 639// END: OwlCarousel 640 641// BEGIN: ContentCubeLatestPortfolio 642var ContentCubeLatestPortfolio = function () { 643 644 var _initInstances = function () { 645 646 // init cubeportfolio 647 $('.c-content-latest-works').cubeportfolio({ 648 filters: '#filters-container', 649 loadMore: '#loadMore-container', 650 loadMoreAction: 'click', 651 layoutMode: 'grid', 652 defaultFilter: '*', 653 animationType: 'quicksand', 654 gapHorizontal: 20, 655 gapVertical: 23, 656 gridAdjustment: 'responsive', 657 mediaQueries: [{ 658 width: 1100, 659 cols: 4 660 }, { 661 width: 800, 662 cols: 3 663 }, { 664 width: 500, 665 cols: 2 666 }, { 667 width: 320, 668 cols: 1 669 }], 670 caption: 'zoom', 671 displayType: 'lazyLoading', 672 displayTypeSpeed: 100, 673 674 // lightbox 675 lightboxDelegate: '.cbp-lightbox', 676 lightboxGallery: true, 677 lightboxTitleSrc: 'data-title', 678 lightboxCounter: '<div class="cbp-popup-lightbox-counter">{{current}} of {{total}}</div>', 679 680 // singlePage popup 681 singlePageDelegate: '.cbp-singlePage', 682 singlePageDeeplinking: true, 683 singlePageStickyNavigation: true, 684 singlePageCounter: '<div class="cbp-popup-singlePage-counter">{{current}} of {{total}}</div>', 685 singlePageCallback: function (url, element) { 686 // to update singlePage content use the following method: this.updateSinglePage(yourContent) 687 var t = this; 688 689 $.ajax({
690 url: url, 691 type: 'GET', 692 dataType: 'html', 693 timeout: 5000 694 }) 695 .done(function (result) { 696 t.updateSinglePage(result); 697 }) 698 .fail(function () { 699 t.updateSinglePage("Error! Please refresh the page!"); 700 }); 701 }, 702 }); 703 704 $('.c-content-latest-works-fullwidth').cubeportfolio({ 705 loadMoreAction: 'auto', 706 layoutMode: 'grid', 707 defaultFilter: '*', 708 animationType: 'fadeOutTop', 709 gapHorizontal: 0, 710 gapVertical: 0, 711 gridAdjustment: 'responsive', 712 mediaQueries: [{ 713 width: 1600, 714 cols: 5 715 }, { 716 width: 1200, 717 cols: 4 718 }, { 719 width: 800, 720 cols: 3 721 }, { 722 width: 500, 723 cols: 2 724 }, { 725 width: 320, 726 cols: 1 727 }], 728 caption: 'zoom', 729 displayType: 'lazyLoading', 730 displayTypeSpeed: 100, 731 732 // lightbox 733 lightboxDelegate: '.cbp-lightbox', 734 lightboxGallery: true, 735 lightboxTitleSrc: 'data-title', 736 lightboxCounter: '<div class="cbp-popup-lightbox-counter">{{current}} of {{total}}</div>', 737 }); 738 739 }; 740 741 return { 742 743 //main function to initiate the module 744 init: function () { 745 _initInstances(); 746 } 747 748 }; 749}(); 750// END: ContentCubeLatestPortfolio 751 752// BEGIN: CounterUp 753var ContentCounterUp = function () { 754 755 var _initInstances = function () { 756 757 // init counter up 758 $("[data-counter='counterup']").counterUp({ 759 delay: 10, 760 time: 1000 761 }); 762 }; 763 764 return { 765 766 //main function to initiate the module 767 init: function () { 768 _initInstances(); 769 } 770 771 }; 772}(); 773// END: CounterUp 774 775// BEGIN: Fancybox 776var ContentFancybox = function () { 777 778 var _initInstances = function () { 779 // init fancybox 780 $("[data-lightbox='fancybox']").fancybox(); 781 }; 782 783 return { 784 785 //main function to initiate the module 786 init: function () { 787 _initInstances(); 788 } 789 790 }; 791}(); 792// END: Fancybox 793 794// BEGIN: Twitter 795var ContentTwitter = function () { 796 797 var _initInstances = function () { 798 // init twitter 799 if ($(".twitter-timeline")[0]) { 800 !function (d, s, id) { 801 var js, fjs = d.getElementsByTagName(s)[0], p = /^http:/.test(d.location) ? 'http' : 'https'; 802 if (!d.getElementById(id)) { 803 js = d.createElement(s); 804 js.id = id; 805 js.src = p + "://platform.twitter.com/widgets.js"; 806 fjs.parentNode.insertBefore(js, fjs); 807 } 808 }(document, "script", "twitter-wjs"); 809 } 810 }; 811 812 return { 813 814 //main function to initiate the module 815 init: function () { 816 _initInstances(); 817 } 818 819 }; 820}(); 821// END: Twitter 822 823 824// BEGIN : SCROLL TO VIEW DETECTION 825function isScrolledIntoView(elem) 826{ 827 var $elem = $(elem); 828 var $window = $(window); 829 830 var docViewTop = $window.scrollTop(); 831 var docViewBottom = docViewTop + $window.height(); 832 833 var elemTop = $elem.offset().top; 834 var elemBottom = elemTop + $elem.height(); 835 836 return ((elemBottom <= docViewBottom) && (elemTop >= docViewTop)); 837} 838// END : SCROLL TO VIEW FUNCTION 839 840// BEGIN : PROGRESS BAR 841var LayoutProgressBar = function ($) { 842 843 return { 844 init: function () { 845 var id_count = 0; // init progress bar id number 846 $('.c-progress-bar-line').each(function(){ 847 id_count++; // progress bar id running number 848 // build progress bar class selector with running id number 849 var this_id = $(this).attr('data-id', id_count); 850 var this_bar = '.c-progress-bar-line[data-id="'+id_count+'"]'; 851 852 // build progress bar object key 853 var progress_data = $(this).data('progress-bar'); 854 progress_data = progress_data.toLowerCase().replace(/\b[a-z]/g, function(letter) { 855 return letter.toUpperCase(); 856 }); 857 if(progress_data == 'Semicircle') { progress_data = 'SemiCircle'; } 858 859 // grab options 860 var bar_color = $(this).css('border-top-color'); // color 861 var this_animation = $(this).data('animation'); // animation type : linear, easeIn, easeOut, easeInOut, bounce 862 var stroke_width = $(this).data('stroke-width'); // stroke width 863 var bar_duration = $(this).data('duration'); // duration 864 var trail_width = $(this).data('trail-width'); // trail width 865 var trail_color = $(this).data('trail-color'); // trail color 866 var bar_progress = $(this).data('progress'); // progress value 867 var font_color = $(this).css('color'); // progress font color 868 869 // set default data if options is null / undefinded 870 if (bar_color == 'rgb(92, 104, 115)'){ bar_color = '#32c5d2'; } // set default color 871 if (trail_color == ''){ trail_color = '#5c6873'; } 872 if (trail_width == ''){ trail_width = '0'; } 873 if (bar_progress == ""){ bar_progress = '1'; } 874 if (stroke_width == ""){ stroke_width = '3'; } 875 if (this_animation == ""){ this_animation = 'easeInOut'; } 876 if (bar_duration == ""){ bar_duration = '1500'; } 877 878 879 // set progress bar 880 var bar = new ProgressBar[progress_data](this_bar, { 881 strokeWidth: stroke_width, 882 easing: this_animation, 883 duration: bar_duration, 884 color: bar_color, 885 trailWidth: trail_width, 886 trailColor: trail_color, 887 svgStyle: null, 888 step: function (state, bar) { 889 bar.setText(Math.round(bar.value() * 100) + '%'); 890 }, 891 text: { 892 style: { 893 color: font_color, 894 } 895 }, 896 }); 897 898 // init animation when progress bar in view without scroll 899 var check_scroll = isScrolledIntoView(this_bar); // check if progress bar is in view - return true / false 900 if (check_scroll == true){ 901 bar.animate(bar_progress); // Number from 0.0 to 1.0 902 } 903 904 // start progress bar animation upon scroll view 905 $(window).scroll(function (event) { 906 var check_scroll = isScrolledIntoView(this_bar); // check if progress bar is in view - return true / false 907 if (check_scroll == true){ 908 bar.animate(bar_progress); // Number from 0.0 to 1.0 909 } 910 }); 911 912 913 });
914 915 916 917 918 } 919 } 920}(jQuery); 921// END : PROGRESS BAR 922 923// Main theme initialization 924$(document).ready(function () { 925 // init layout handlers 926 LayoutBrand.init(); 927 LayoutHeader.init(); 928 LayoutHeaderCart.init(); 929 LayoutMegaMenu.init(); 930 LayoutSidebarMenu.init(); 931 LayoutQuickSearch.init(); 932 LayoutCartMenu.init(); 933 LayoutQuickSidebar.init(); 934 LayoutGo2Top.init(); 935 LayoutOnepageNav.init(); 936 LayoutThemeSettings.init(); 937 LayoutProgressBar.init(); 938 939 // init plugin wrappers 940 ContentOwlcarousel.init(); 941 ContentCubeLatestPortfolio.init(); 942 ContentCounterUp.init(); 943 ContentFancybox.init(); 944 ContentTwitter.init(); 945}); 946/** 947Core script to handle the entire theme and core functions 948**/ 949 950 951var App = function() { 952 953 // IE mode 954 var isRTL = false; 955 var isIE9 = false; 956 var isIE10 = false; 957 var isIE = false; 958 959 var resizeHandlers = []; 960 961 // initializes main settings 962 var handleInit = function() { 963 isIE9 = !!navigator.userAgent.match(/MSIE 9.0/); 964 isIE10 = !!navigator.userAgent.match(/MSIE 10.0/); 965 isIE = navigator.userAgent.indexOf("MSIE ") > -1 || navigator.userAgent.indexOf("Trident/") > -1; 966 967 if (isIE10) { 968 $('html').addClass('ie10'); // detect IE10 version 969 } 970 971 if (isIE9) { 972 $('html').addClass('ie9'); // detect IE10 version 973 } 974 975 if (isIE) { 976 $('html').addClass('ie'); // detect IE10 version 977 } 978 }; 979 980 // runs callback functions set by Jango.addResponsiveHandler(). 981 var _runResizeHandlers = function() { 982 // reinitialize other subscribed elements 983 for (var i = 0; i < resizeHandlers.length; i++) { 984 var each = resizeHandlers[i]; 985 each.call(); 986 } 987 }; 988 989 // handle group element heights 990 var handleHeight = function() { 991 $('[data-auto-height]').each(function() { 992 var parent = $(this); 993 var items = $('[data-height]', parent); 994 var height = 0; 995 var mode = parent.attr('data-mode'); 996 var offset = parseInt(parent.attr('data-offset') ? parent.attr('data-offset') : 0); 997 998 items.each(function() { 999 if ($(this).attr('data-height') == "height") { 1000 $(this).css('height', ''); 1001 } else { 1002 $(this).css('min-height', ''); 1003 } 1004 1005 var height_ = (mode == 'base-height' ? $(this).outerHeight() : $(this).outerHeight(true)); 1006 if (height_ > height) { 1007 height = height_; 1008 } 1009 }); 1010 1011 height = height + offset; 1012 1013 items.each(function() { 1014 if ($(this).attr('data-height') == "height") { 1015 $(this).css('height', height); 1016 } else { 1017 $(this).css('min-height', height); 1018 } 1019 }); 1020 1021 if(parent.attr('data-related')) { 1022 $(parent.attr('data-related')).css('height', parent.height()); 1023 } 1024 }); 1025 } 1026 1027 // handle the layout reinitialization on window resize 1028 var handleOnResize = function() { 1029 var resize; 1030 $(window).resize(function() { 1031 if (resize) { 1032 clearTimeout(resize); 1033 } 1034 resize = setTimeout(function() { 1035 _runResizeHandlers(); 1036 }, 50); // wait 50ms until window resize finishes. 1037 }); 1038 }; 1039 1040 // Handles custom checkboxes & radios using jQuery Uniform plugin 1041 var handleCheckboxRadios = function() { 1042 // Material design ckeckbox and radio effects 1043 $('body').on('click', '.c-checkbox > label, .c-radio > label', function() { 1044 var the = $(this); 1045 // find the first span which is our circle/bubble 1046 var el = $(this).children('span:first-child'); 1047 1048 // add the bubble class (we do this so it doesnt show on page load
1048) 1049 el.addClass('inc'); 1050 1051 // clone it 1052 var newone = el.clone(true); 1053 1054 // add the cloned version before our original 1055 el.before(newone); 1056 1057 // remove the original so that it is ready to run on next click 1058 $("." + el.attr("class") + ":last", the).remove(); 1059 }); 1060 }; 1061 1062 // Handles Bootstrap Accordions. 1063 var handleAccordions = function() { 1064 $('body').on('shown.bs.collapse', '.accordion.scrollable', function(e) { 1065 Jango.scrollTo($(e.target)); 1066 }); 1067 }; 1068 1069 // Handles Bootstrap Tabs. 1070 var handleTabs = function() { 1071 //activate tab if tab id provided in the URL 1072 if (location.hash) { 1073 var tabid = encodeURI(location.hash.substr(1)); 1074 $('a[href="#' + tabid + '"]').parents('.tab-pane:hidden').each(function() { 1075 var tabid = $(this).attr("id"); 1076 $('a[href="#' + tabid + '"]').click(); 1077 }); 1078 $('a[href="#' + tabid + '"]').click(); 1079 } 1080 }; 1081 1082 // Handles Bootstrap Modals. 1083 var handleModals = function() { 1084 // fix stackable modal issue: when 2 or more modals opened, closing one of modal will remove .modal-open class. 1085 $('body').on('hide.bs.modal', function() { 1086 if ($('.modal:visible').size() > 1 && $('html').hasClass('modal-open') === false) { 1087 $('html').addClass('modal-open'); 1088 } else if ($('.modal:visible').size() <= 1) { 1089 $('html').removeClass('modal-open'); 1090 } 1091 }); 1092 1093 // fix page scrollbars issue 1094 $('body').on('show.bs.modal', '.modal', function() { 1095 if ($(this).hasClass("modal-scroll")) { 1096 $('body').addClass("modal-open-noscroll"); 1097 } 1098 }); 1099 1100 // fix page scrollbars issue 1101 $('body').on('hide.bs.modal', '.modal', function() { 1102 $('body').removeClass("modal-open-noscroll"); 1103 }); 1104 1105 // remove ajax content and remove cache on modal closed 1106 $('body').on('hidden.bs.modal', '.modal:not(.modal-cached)', function() { 1107 $(this).removeData('bs.modal'); 1108 }); 1109 }; 1110 1111 // Handles Bootstrap Tooltips. 1112 var handleTooltips = function() { 1113 // global tooltips 1114 $('.tooltips').tooltip(); 1115 }; 1116 1117 // Handles Bootstrap Dropdowns 1118 var handleDropdowns = function() { 1119 /* 1120 Hold dropdown on click 1121 */ 1122 $('body').on('click', '.dropdown-menu.hold-on-click', function(e) { 1123 e.stopPropagation(); 1124 }); 1125 }; 1126 1127 var handleAlerts = function() { 1128 $('body').on('click', '[data-close="alert"]', function(e) { 1129 $(this).parent('.alert').hide(); 1130 $(this).closest('.note').hide(); 1131 e.preventDefault(); 1132 }); 1133 1134 $('body').on('click', '[data-close="note"]', function(e) { 1135 $(this).closest('.note').hide(); 1136 e.preventDefault(); 1137 }); 1138 1139 $('body').on('click', '[data-remove="note"]', function(e) { 1140 $(this).closest('.note').remove(); 1141 e.preventDefault(); 1142 }); 1143 }; 1144 1145 // Handle Hower Dropdowns 1146 var handleDropdownHover = function() { 1147 $('[data-hover="dropdown"]').not('.hover-initialized').each(function() { 1148 $(this).dropdownHover(); 1149 $(this).addClass('hover-initialized'); 1150 }); 1151 }; 1152 1153 // Handles Bootstrap Popovers 1154 1155 // last popep popover 1156 var lastPopedPopover; 1157 1158 var handlePopovers = function() { 1159 $('.popovers').popover(); 1160 1161 // close last displayed popover 1162 1163 $(document).on('click.bs.popover.data-api', function(e) { 1164 if (lastPopedPopover) { 1165 lastPopedPopover.popover('hide'); 1166 } 1167 }); 1168 }; 1169 1170 // Fix input placeholder issue for IE9 and IE10 1171 var handleFixInputPlaceholderForIE = function() { 1172 //fix html5 placeholder attribute for ie9 & ie10 1173 if (isIE9 || isIE10) { 1174 // this is html5 placeholder fix for inputs, inputs with placeholder-no-fix class will be skipped(e.g: we need this for password fields) 1175 $('input[placeholder]:not(.placeholder-no-fix), textarea[placeholder]:not(.placeholder-no-fix)').each(function() { 1176 var input = $(this); 1177 1178 if (input.val() === '' && input.attr("placeholder") !== '') { 1179 input.addClass("placeholder").val(input.attr('placeholder')); 1180 } 1181 1182 input.focus(function() { 1183 if (input.val() == input.attr('placeholder')) { 1184 input.val(''); 1185 } 1186 }); 1187 1188 input.blur(function() { 1189 if (input.val() === '' || input.val() == input.attr('placeholder')) { 1190 input.val(input.attr('placeholder')); 1191 } 1192 }); 1193 }); 1194 } 1195 }; 1196 1197 //* END:CORE HANDLERS *// 1198 1199 return { 1200 1201 //main function to initiate the theme 1202 init: function() { 1203 //IMPORTANT!!!: Do not modify the core handlers call order. 1204 1205 //Core handlers 1206 handleHeight(); 1207 this.addResizeHandler(handleHeight); // handle auto calculating height on window resize 1208 1209 handleInit(); // initialize core variables 1210 handleOnResize(); // set and handle responsive 1211 1212 //UI Component handlers 1213 //handleAnimate(); // handle animate 1214 handleCheckboxRadios() // handle checkbox & radios 1215 handleAlerts(); //handle closabled alerts 1216 handleDropdowns(); // handle dropdowns 1217 handleTabs(); // handle tabs 1218 handleTooltips(); // handle bootstrap tooltips 1219 handlePopovers(); // handles bootstrap popovers 1220 handleAccordions(); //handles accordions 1221 handleModals(); // handle modals 1222 1223 // Hacks 1224 handleFixInputPlaceholderForIE(); //IE9 & IE10 input placeholder issue fix 1225 }, 1226 1227 changeLogo: function(filename) { 1228 var path = '../assets/jango/img/layout/logos/' + filename + '.png'; 1229 $('.c-brand img.c-desktop-logo').attr('src', path); 1230 }, 1231 1232 //public function to remember last opened popover that needs to be closed on click
1233 setLastPopedPopover: function(el) { 1234 lastPopedPopover = el; 1235 }, 1236 1237 //public function to add callback a function which will be called on window resize 1238 addResizeHandler: function(func) { 1239 resizeHandlers.push(func); 1240 }, 1241 1242 //public functon to call _runresizeHandlers 1243 runResizeHandlers: function() { 1244 _runResizeHandlers(); 1245 }, 1246 1247 // wrJangoer function to scroll(focus) to an element 1248 scrollTo: function(el, offeset) { 1249 var pos = (el && el.size() > 0) ? el.offset().top : 0; 1250 1251 if (el) { 1252 if ($('body').hasClass('page-header-fixed')) { 1253 pos = pos - $('.page-header').height(); 1254 } 1255 pos = pos + (offeset ? offeset : -1 * el.height()); 1256 } 1257 1258 $('html,body').animate({ 1259 scrollTop: pos 1260 }, 'slow'); 1261 }, 1262 1263 // function to scroll to the top 1264 scrollTop: function() { 1265 Jango.scrollTo(); 1266 }, 1267 1268 1269 //public function to initialize the fancybox plugin 1270 initFancybox: function() { 1271 handleFancybox(); 1272 }, 1273 1274 //public helper function to get actual input value(used in IE9 and IE8 due to placeholder attribute not supported) 1275 getActualVal: function(el) { 1276 el = $(el); 1277 if (el.val() === el.attr("placeholder")) { 1278 return ""; 1279 } 1280 return el.val(); 1281 }, 1282 1283 //public function to get a paremeter by name from URL 1284 getURLParameter: function(paramName) { 1285 var searchString = window.location.search.substring(1), 1286 i, val, params = searchString.split("&"); 1287 1288 for (i = 0; i < params.length; i++) { 1289 val = params[i].split("="); 1290 if (val[0] == paramName) { 1291 return unescape(val[1]); 1292 } 1293 } 1294 return null; 1295 }, 1296 1297 // check for device touch support 1298 isTouchDevice: function() { 1299 try { 1300 document.createEvent("TouchEvent"); 1301 return true; 1302 } catch (e) { 1303 return false; 1304 } 1305 }, 1306 1307 // To get the correct viewport width based on http://andylangton.co.uk/articles/javascript/get-viewport-size-javascript/ 1308 getViewPort: function() { 1309 var e = window, 1310 a = 'inner'; 1311 if (!('innerWidth' in window)) { 1312 a = 'client'; 1313 e = document.documentElement || document.body; 1314 } 1315 1316 return { 1317 width: e[a + 'Width'], 1318 height: e[a + 'Height'] 1319 }; 1320 }, 1321 1322 // generate unique ID 1323 getUniqueID: function(prefix) { 1324 return 'prefix_' + Math.floor(Math.random() * (new Date()).getTime()); 1325 }, 1326 1327 // check IE9 mode 1328 isIE: function() { 1329 return isIE; 1330 }, 1331 1332 // check IE9 mode 1333 isIE9: function() { 1334 return isIE9; 1335 }, 1336 1337 // check IE9 mode 1338 isIE10: function() { 1339 return isIE10; 1340 }, 1341 1342 // responsive breakpoints 1343 getBreakpoint: function(size) { 1344 // bootstrap responsive breakpoints 1345 var sizes = { 1346 'xs': 480, // extra small 1347 'sm': 768, // small 1348 'md': 992, // medium 1349 'lg': 1200 // large 1350 }; 1351 1352 return sizes[size] ? sizes[size] : 0; 1353 } 1354 }; 1355 1356}(); 1357/******************************************** 1358 - THEMEPUNCH TOOLS Ver. 1.0 - 1359 Last Update of Tools 27.02.2015 1360*********************************************/ 1361 1362 1363/* 1364* @fileOverview TouchSwipe - jQuery Plugin 1365* @version 1.6.12 1366* 1367* @author Matt Bryson http://www.github.com/mattbryson 1368* @see https://github.com/mattbryson/TouchSwipe-Jquery-Plugin 1369* @see http://labs.rampinteractive.co.uk/touchSwipe/ 1370* @see http://plugins.jquery.com/project/touchSwipe 1371*
1372* Copyright (c) 2010-2015 Matt Bryson 1373* Dual licensed under the MIT or GPL Version 2 licenses. 1374* 1375*/ 1376 1377/* 1378* 1379* Changelog 1380* $Date: 2010-12-12 (Wed, 12 Dec 2010) $ 1381* $version: 1.0.0 1382* $version: 1.0.1 - removed multibyte comments 1383* 1384* $Date: 2011-21-02 (Mon, 21 Feb 2011) $ 1385* $version: 1.1.0 - added allowPageScroll property to allow swiping and scrolling of page 1386* - changed handler signatures so one handler can be used for multiple events 1387* $Date: 2011-23-02 (Wed, 23 Feb 2011) $ 1388* $version: 1.2.0 - added click handler. This is fired if the user simply clicks and does not swipe. The event object and click target are passed to handler. 1389* - If you use the http://code.google.com/p/jquery-ui-for-ipad-and-iphone/ plugin, you can also assign jQuery mouse events to children of a touchSwipe object. 1390* $version: 1.2.1 - removed console log! 1391* 1392* $version: 1.2.2 - Fixed bug where scope was not preserved in callback methods. 1393* 1394* $Date: 2011-28-04 (Thurs, 28 April 2011) $ 1395* $version: 1.2.4 - Changed licence terms to be MIT or GPL inline with jQuery. Added check for support of touch events to stop non compatible browsers erroring. 1396* 1397* $Date: 2011-27-09 (Tues, 27 September 2011) $
1398* $version: 1.2.5 - Added support for testing swipes with mouse on desktop browser (thanks to https://github.com/joelhy) 1399* 1400* $Date: 2012-14-05 (Mon, 14 May 2012) $ 1401* $version: 1.2.6 - Added timeThreshold between start and end touch, so user can ignore slow swipes (thanks to Mark Chase). Default is null, all swipes are detected 1402* 1403* $Date: 2012-05-06 (Tues, 05 June 2012) $ 1404* $version: 1.2.7 - Changed time threshold to have null default for backwards compatibility. Added duration param passed back in events, and refactored how time is handled. 1405* 1406* $Date: 2012-05-06 (Tues, 05 June 2012) $ 1407* $version: 1.2.8 - Added the possibility to return a value like null or false in the trigger callback. In that way we can control when the touch start/move should take effect or not (simply by returning in some cases return null; or return false;) This effects the ontouchstart/ontouchmove event. 1408* 1409* $Date: 2012-06-06 (Wed, 06 June 2012) $ 1410* $version: 1.3.0 - Refactored whole plugin to allow for methods to be executed, as well as exposed defaults for user override. Added 'enable', 'disable', and 'destroy' methods 1411* 1412* $Date: 2012-05-06 (Fri, 05 June 2012) $ 1413* $version: 1.3.1 - Bug fixes - bind() with false as last argument is no longer supported in jQuery 1.6, also, if you just click, the duration is now returned correctly. 1414* 1415* $Date: 2012-29-07 (Sun, 29 July 2012) $ 1416* $version: 1.3.2 - Added fallbackToMouseEvents option to NOT capture mouse events on non touch devices. 1417* - Added "all" fingers value to the fingers property, so any combination of fingers triggers the swipe, allowing event handlers to check the finger count 1418* 1419* $Date: 2012-09-08 (Thurs, 9 Aug 2012) $ 1420* $version: 1.3.3 - Code tidy prep for minefied version 1421* 1422* $Date: 2012-04-10 (wed, 4 Oct 2012) $ 1423* $version: 1.4.0 - Added pinch support, pinchIn and pinchOut 1424* 1425* $Date: 2012-11-10 (Thurs, 11 Oct 2012) $ 1426* $version: 1.5.0 - Added excludedElements, a jquery selector that specifies child elements that do NOT trigger swipes. By default, this is one select that removes all form, input select, button and anchor elements. 1427* 1428* $Date: 2012-22-10 (Mon, 22 Oct 2012) $ 1429* $version: 1.5.1 - Fixed bug with jQuery 1.8 and trailing comma in excludedElements 1430* - Fixed bug with IE and eventPreventDefault() 1431* $Date: 2013-01-12 (Fri, 12 Jan 2013) $ 1432* $version: 1.6.0 - Fixed bugs with pinching, mainly when both pinch and swipe enabled, as well as adding time threshold for multifinger gestures, so releasing one finger beofre the other doesnt trigger as single finger gesture. 1433* - made the demo site all static local HTML pages so they can be run locally by a developer 1434* - added jsDoc comments and added documentation for the plugin 1435* - code tidy 1436* - added triggerOnTouchLeave property that will end the event when the user swipes off the element. 1437* $Date: 2013-03-23 (Sat, 23 Mar 2013) $
1438* $version: 1.6.1 - Added support for ie8 touch events 1439* $version: 1.6.2 - Added support for events binding with on / off / bind in jQ for all callback names. 1440* - Deprecated the 'click' handler in favour of tap. 1441* - added cancelThreshold property 1442* - added option method to update init options at runtime 1443* $version 1.6.3 - added doubletap, longtap events and longTapThreshold, doubleTapThreshold property 1444* 1445* $Date: 2013-04-04 (Thurs, 04 April 2013) $ 1446* $version 1.6.4 - Fixed bug with cancelThreshold introduced in 1.6.3, where swipe status no longer fired start event, and stopped once swiping back. 1447* 1448* $Date: 2013-08-24 (Sat, 24 Aug 2013) $ 1449* $version 1.6.5 - Merged a few pull requests fixing various bugs, added AMD support. 1450* 1451* $Date: 2014-06-04 (Wed, 04 June 2014) $ 1452* $version 1.6.6 - Merge of pull requests. 1453* - IE10 touch support 1454* - Only prevent default event handling on valid swipe 1455* - Separate license/changelog comment 1456* - Detect if the swipe is valid at the end of the touch event. 1457* - Pass fingerdata to event handlers. 1458* - Add 'hold' gesture 1459* - Be more tolerant about the tap distance 1460* - Typos and minor fixes 1461* 1462* $Date: 2015-22-01 (Thurs, 22 Jan 2015) $ 1463* $version 1.6.7 - Added patch from https://github.com/mattbryson/TouchSwipe-Jquery-Plugin/issues/206 to fix memory leak 1464* 1465* $Date: 2015-2-2 (Mon, 2 Feb 2015) $ 1466* $version 1.6.8 - Added preventDefaultEvents option to proxy events regardless. 1467* - Fixed issue with swipe and pinch not triggering at the same time 1468* 1469* $Date: 2015-9-6 (Tues, 9 June 2015) $ 1470* $version 1.6.9 - Added PR from jdalton/hybrid to fix pointer events 1471* - Added scrolling demo 1472* - Added version property to plugin 1473* 1474* $Date: 2015-1-10 (Wed, 1 October 2015) $ 1475* $version 1.6.10 - Added PR from beatspace to fix tap events 1476* $version 1.6.11 - Added PRs from indri-indri ( Doc tidyup), kkirsche ( Bower tidy up ), UziTech (preventDefaultEvents fixes ) 1477* - Allowed setting multiple options via .swipe("options", options_hash) and more simply .swipe(options_hash) or exisitng instances 1478* $version 1.6.12 - Fixed bug with multi finger releases above 2 not triggering events 1479*/ 1480 1481/** 1482 * See (http://jquery.com/). 1483 * @name $ 1484 * @class 1485 * See the jQuery Library (http://jquery.com/) for full details. This just 1486 * documents the function and classes that are added to jQuery by this plug-in. 1487 */ 1488 1489/** 1490 * See (http://jquery.com/) 1491 * @name fn 1492 * @class 1493 * See the jQuery Library (http://jquery.com/) for full details. This just 1494 * documents the function and classes that are added to jQuery by this plug-in. 1495 * @memberOf $ 1496 */ 1497 1498 1499 1500 1501(function (factory) { 1502 if (typeof define === 'function' && define.amd && define.amd.jQuery) { 1503 // AMD. Register as anonymous module. 1504 define(['jquery'], factory); 1505 } else { 1506 // Browser globals. 1507 factory(jQuery); 1508 } 1509}(function ($) { 1510 "use strict"; 1511 1512 //Constants 1513 var VERSION = "1.6.12", 1514 LEFT = "left", 1515 RIGHT = "right", 1516 UP = "up", 1517 DOWN = "down", 1518 IN = "in", 1519 OUT = "out", 1520 1521 NONE = "none", 1522 AUTO = "auto", 1523 1524 SWIPE = "swipe", 1525 PINCH = "pinch", 1526 TAP = "tap", 1527 DOUBLE_TAP = "doubletap", 1528 LONG_TAP = "longtap", 1529 HOLD = "hold", 1530 1531 HORIZONTAL = "horizontal", 1532 VERTICAL = "vertical", 1533 1534 ALL_FINGERS = "all", 1535 1536 DOUBLE_TAP_THRESHOLD = 10, 1537 1538 PHASE_START = "start", 1539 PHASE_MOVE = "move", 1540 PHASE_END = "end", 1541 PHASE_CANCEL = "cancel", 1542 1543 SUPPORTS_TOUCH = 'ontouchstart' in window, 1544 1545 SUPPORTS_POINTER_IE10 = window.navigator.msPointerEnabled && !window.navigator.pointerEnabled, 1546 1547 SUPPORTS_POINTER = window.navigator.pointerEnabled || window.navigator.msPointerEnabled, 1548 1549 PLUGIN_NS = 'TouchSwipe'; 1550 1551 1552 1553 /** 1554 * The default configuration, and available options to configure touch swipe with. 1555 * You can set the default values by updating any of the properties prior to instantiation. 1556 * @name $.fn.swipe.defaults 1557 * @namespace 1558 * @property {int} [fingers=1] The number of fingers to detect in a swipe. Any swipes that do not meet this requirement will NOT trigger swipe handlers. 1559 * @property {int} [threshold=75] The number of pixels that the user must move their finger by before it is considered a swipe. 1560 * @property {int} [cancelThreshold=null] The number of pixels that the user must move their finger back from the original swipe direction to cancel the gesture. 1561 * @property {int} [pinchThreshold=20] The number of pixels that the user must pinch their finger by before it is considered a pinch. 1562 * @property {int} [maxTimeThreshold=null] Time, in milliseconds, between touchStart and touchEnd must NOT exceed in order to be considered a swipe. 1563 * @property {int} [fingerReleaseThreshold=250] Time in milliseconds between releasing multiple fingers. If 2 fingers are down, and are released one after the other, if they are within this threshold, it counts as a simultaneous release. 1564 * @property {int} [longTapThreshold=500] Time in milliseconds between tap and release for a long tap 1565 * @property {int} [doubleTapThreshold=200] Time in milliseconds between 2 taps to count as a double tap 1566 * @property {function} [swipe=null] A handler to catch all swipes. See {@link $.fn.swipe#event:swipe} 1567 * @property {function} [swipeLeft=null] A handler that is triggered for "left" swipes. See {@link $.fn.swipe#event:swipeLeft} 1568 * @property {function} [swipeRight=null] A handler that is triggered for "right" swipes. See {@link $.fn.swipe#event:swipeRight} 1569 * @property {function} [swipeUp=null] A handler that is triggered for "up" swipes. See {@link $.fn.swipe#event:swipeUp} 1570 * @property {function} [swipeDown=null] A handler that is triggered for "down" swipes. See {@link $.fn.swipe#event:swipeDown} 1571 * @property {function} [swipeStatus=null] A handler triggered for every phase of the swipe. See {@link $.fn.swipe#event:swipeStatus} 1572 * @property {function} [pinchIn=null] A handler triggered for pinch in events. See {@link $.fn.swipe#event:pinchIn} 1573 * @property {function} [pinchOut=null] A handler triggered for pinch out events. See {@link $.fn.swipe#event:pinchOut} 1574 * @property {function} [pinchStatus=null] A handler triggered for every phase of a pinch. See {@link $.fn.swipe#event:pinchStatus} 1575 * @property {function} [tap=null] A handler triggered when a user just taps on the item, rather than swipes it. If they do not move, tap is triggered, if they do move, it is not. 1576 * @property {function} [doubleTap=null] A handler triggered when a user double taps on the item. The delay between taps can be set with the doubleTapThreshold property. See {@link $.fn.swipe.defaults#doubleTapThreshold} 1577 * @property {function} [longTap=null] A handler triggered when a user long taps on the item. The delay between start and end can be set with the longTapThreshold property. See {@link $.fn.swipe.defaults#longTapThreshold} 1578 * @property (function) [hold=null] A handler triggered when a user reaches longTapThreshold on the item. See {@link $.fn.swipe.defaults#longTapThreshold} 1579 * @property {boolean} [triggerOnTouchEnd=true] If true, the swipe events are triggered when the touch end event is received (user releases finger). If false, it will be triggered on reaching the threshold, and then cancel the touch event automatically. 1580 * @property {boolean} [triggerOnTouchLeave=false] If true, then when the user leaves the swipe object, the swipe will end and trigger appropriate handlers. 1581 * @property {string|undefined} [allowPageScroll='auto'] How the browser handles page scrolls when the user is swiping on a touchSwipe object. See {@link $.fn.swipe.pageScroll}. <br/><br/> 1582 <code>"auto"</code> : all undefined swipes will cause the page to scroll in that direction. <br/> 1583 <code>"none"</code> : the page will not scroll when user swipes. <br/> 1584 <code>"horizontal"</code> : will force page to scroll on horizontal swipes. <br/> 1585 <code>"vertical"</code> : will force page to scroll on vertical swipes. <br/> 1586 * @property {boolean} [fallbackToMouseEvents=true] If true mouse events are used when run on a non touch device, false will stop swipes being triggered by mouse events on non tocuh devices. 1587 * @property {string} [excludedElements="button, input, select, textarea, a, .noSwipe"] A jquery selector that specifies child elements that do NOT trigger swipes. By default this excludes all form, input, select, button, anchor and .noSwipe elements. 1588 * @property {boolean} [preventDefaultEvents=true] by default default events are cancelled, so the page doesn't move. You can dissable this so both native events fire as well as your handlers. 1589 1590 */ 1591 var defaults = { 1592 fingers: 1, 1593 threshold: 75, 1594 cancelThreshold:null, 1595 pinchThreshold:20, 1596 maxTimeThreshold: null, 1597 fingerReleaseThreshold:250, 1598 longTapThreshold:500, 1599 doubleTapThreshold:200, 1600 swipe: null, 1601 swipeLeft: null, 1602 swipeRight: null, 1603 swipeUp: null, 1604 swipeDown: null, 1605 swipeStatus: null, 1606 pinchIn:null, 1607 pinchOut:null, 1608 pinchStatus:null, 1609 click:null, //Deprecated since 1.6.2 1610 tap:null, 1611 doubleTap:null, 1612 longTap:null, 1613 hold:null, 1614 triggerOnTouchEnd: true, 1615 triggerOnTouchLeave:false, 1616 allowPageScroll: "auto", 1617 fallbackToMouseEvents: true, 1618 excludedElements:"label, button, input, select, textarea, a, .noSwipe", 1619 preventDefaultEvents:true 1620 }; 1621 1622 1623 1624 /** 1625 * Applies TouchSwipe behaviour to one or more jQuery objects. 1626 * The TouchSwipe plugin can be instantiated via this method, or methods within
1627 * TouchSwipe can be executed via this method as per jQuery plugin architecture. 1628 * An existing plugin can have its options changed simply by re calling .swipe(options) 1629 * @see TouchSwipe 1630 * @class 1631 * @param {Mixed} method If the current DOMNode is a TouchSwipe object, and <code>method</code> is a TouchSwipe method, then 1632 * the <code>method</code> is executed, and any following arguments are passed to the TouchSwipe method. 1633 * If <code>method</code> is an object, then the TouchSwipe class is instantiated on the current DOMNode, passing the 1634 * configuration properties defined in the object. See TouchSwipe 1635 * 1636 */ 1637 $.fn.swipe = function (method) { 1638 var $this = $(this), 1639 plugin = $this.data(PLUGIN_NS); 1640 1641 //Check if we are already instantiated and trying to execute a method 1642 if (plugin && typeof method === 'string') { 1643 if (plugin[method]) { 1644 return plugin[method].apply(this, Array.prototype.slice.call(arguments, 1)); 1645 } else { 1646 $.error('Method ' + method + ' does not exist on jQuery.swipe'); 1647 } 1648 } 1649 1650 //Else update existing plugin with new options hash 1651 else if (plugin && typeof method === 'object') { 1652 plugin['option'].apply(this, arguments); 1653 } 1654 1655 //Else not instantiated and trying to pass init object (or nothing) 1656 else if (!plugin && (typeof method === 'object' || !method)) { 1657 return init.apply(this, arguments); 1658 } 1659 1660 return $this; 1661 }; 1662 1663 /** 1664 * The version of the plugin 1665 * @readonly 1666 */ 1667 $.fn.swipe.version = VERSION; 1668 1669 1670 1671 //Expose our defaults so a user could override the plugin defaults 1672 $.fn.swipe.defaults = defaults; 1673 1674 /** 1675 * The phases that a touch event goes through. The <code>phase</code> is passed to the event handlers. 1676 * These properties are read only, attempting to change them will not alter the values passed to the event handlers. 1677 * @namespace 1678 * @readonly 1679 * @property {string} PHASE_START Constant indicating the start phase of the touch event. Value is <code>"start"</code>. 1680 * @property {string} PHASE_MOVE Constant indicating the move phase of the touch event. Value is <code>"move"</code>. 1681 * @property {string} PHASE_END Constant indicating the end phase of the touch event. Value is <code>"end"</code>. 1682 * @property {string} PHASE_CANCEL Constant indicating the cancel phase of the touch event. Value is <code>"cancel"</code>. 1683 */ 1684 $.fn.swipe.phases = { 1685 PHASE_START: PHASE_START, 1686 PHASE_MOVE: PHASE_MOVE, 1687 PHASE_END: PHASE_END, 1688 PHASE_CANCEL: PHASE_CANCEL 1689 }; 1690 1691 /** 1692 * The direction constants that are passed to the event handlers. 1693 * These properties are read only, attempting to change them will not alter the values passed to the event handlers. 1694 * @namespace 1695 * @readonly 1696 * @property {string} LEFT Constant indicating the left direction. Value is <code>"left"</code>. 1697 * @property {string} RIGHT Constant indicating the right direction. Value is <code>"right"</code>. 1698 * @property {string} UP Constant indicating the up direction. Value is <code>"up"</code>. 1699 * @property {string} DOWN Constant indicating the down direction. Value is <code>"cancel"</code>. 1700 * @property {string} IN Constant indicating the in direction. Value is <code>"in"</code>. 1701 * @property {string} OUT Constant indicating the out direction. Value is <code>"out"</code>. 1702 */ 1703 $.fn.swipe.directions = { 1704 LEFT: LEFT, 1705 RIGHT: RIGHT, 1706 UP: UP, 1707 DOWN: DOWN, 1708 IN : IN, 1709 OUT: OUT 1710 }; 1711 1712 /** 1713 * The page scroll constants that can be used to set the value of <code>allowPageScroll</code> option 1714 * These properties are read only 1715 * @namespace 1716 * @readonly 1717 * @see $.fn.swipe.defaults#allowPageScroll 1718 * @property {string} NONE Constant indicating no page scrolling is allowed. Value is <code>"none"</code>. 1719 * @property {string} HORIZONTAL Constant indicating horizontal page scrolling is allowed. Value is <code>"horizontal"</code>. 1720 * @property {string} VERTICAL Constant indicating vertical page scrolling is allowed. Value is <code>"vertical"</code>. 1721 * @property {string} AUTO Constant indicating either horizontal or vertical will be allowed, depending on the swipe handlers registered. Value is <code>"auto"</code>. 1722 */ 1723 $.fn.swipe.pageScroll = { 1724 NONE: NONE, 1725 HORIZONTAL: HORIZONTAL, 1726 VERTICAL: VERTICAL, 1727 AUTO: AUTO 1728 }; 1729 1730 /** 1731 * Constants representing the number of fingers used in a swipe. These are used to set both the value of <code>fingers</code> in the 1732 * options object, as well as the value of the <code>fingers</code> event property. 1733 * These properties are read only, attempting to change them will not alter the values passed to the event handlers. 1734 * @namespace 1735 * @readonly 1736 * @see $.fn.swipe.defaults#fingers 1737 * @property {string} ONE Constant indicating 1 finger is to be detected / was detected. Value is <code>1</code>. 1738 * @property {string} TWO Constant indicating 2 fingers are to be detected / were detected. Value is <code>2</code>. 1739 * @property {string} THREE Constant indicating 3 finger are to be detected / were detected. Value is <code>3</code>. 1740 * @property {string} FOUR Constant indicating 4 finger are to be detected / were detected. Not all devices support this. Value is <code>4</code>. 1741 * @property {string} FIVE Constant indicating 5 finger are to be detected / were detected. Not all devices support this. Value is <code>5</code>. 1742 * @property {string} ALL Constant indicating any combination of finger are to be detected. Value is <code>"all"</code>. 1743 */ 1744 $.fn.swipe.fingers = { 1745 ONE: 1, 1746 TWO: 2, 1747 THREE: 3, 1748 FOUR: 4, 1749 FIVE: 5, 1750 ALL: ALL_FINGERS 1751 }; 1752 1753 /** 1754 * Initialise the plugin for each DOM element matched
vendor: 18,166 bytes, lines 1755-2295
1755 * This creates a new instance of the main TouchSwipe class for each DOM element, and then 1756 * saves a reference to that instance in the elements data property. 1757 * @internal 1758 */ 1759 function init(options) { 1760 //Prep and extend the options 1761 if (options && (options.allowPageScroll === undefined && (options.swipe !== undefined || options.swipeStatus !== undefined))) { 1762 options.allowPageScroll = NONE; 1763 } 1764 1765 //Check for deprecated options 1766 //Ensure that any old click handlers are assigned to the new tap, unless we have a tap 1767 if(options.click!==undefined && options.tap===undefined) { 1768 options.tap = options.click; 1769 } 1770 1771 if (!options) { 1772 options = {}; 1773 } 1774 1775 //pass empty object so we dont modify the defaults 1776 options = $.extend({}, $.fn.swipe.defaults, options); 1777 1778 //For each element instantiate the plugin 1779 return this.each(function () { 1780 var $this = $(this); 1781 1782 //Check we havent already initialised the plugin 1783 var plugin = $this.data(PLUGIN_NS); 1784 1785 if (!plugin) { 1786 plugin = new TouchSwipe(this, options); 1787 $this.data(PLUGIN_NS, plugin); 1788 } 1789 }); 1790 } 1791 1792 /** 1793 * Main TouchSwipe Plugin Class. 1794 * Do not use this to construct your TouchSwipe object, use the jQuery plugin method $.fn.swipe(); {@link $.fn.swipe} 1795 * @private 1796 * @name TouchSwipe 1797 * @param {DOMNode} element The HTML DOM object to apply to plugin to 1798 * @param {Object} options The options to configure the plugin with. @link {$.fn.swipe.defaults} 1799 * @see $.fh.swipe.defaults 1800 * @see $.fh.swipe 1801 * @class 1802 */ 1803 function TouchSwipe(element, options) { 1804 1805 //take a local/instacne level copy of the options - should make it this.options really... 1806 var options = $.extend({}, options); 1807 1808 var useTouchEvents = (SUPPORTS_TOUCH || SUPPORTS_POINTER || !options.fallbackToMouseEvents), 1809 START_EV = useTouchEvents ? (SUPPORTS_POINTER ? (SUPPORTS_POINTER_IE10 ? 'MSPointerDown' : 'pointerdown') : 'touchstart') : 'mousedown', 1810 MOVE_EV = useTouchEvents ? (SUPPORTS_POINTER ? (SUPPORTS_POINTER_IE10 ? 'MSPointerMove' : 'pointermove') : 'touchmove') : 'mousemove', 1811 END_EV = useTouchEvents ? (SUPPORTS_POINTER ? (SUPPORTS_POINTER_IE10 ? 'MSPointerUp' : 'pointerup') : 'touchend') : 'mouseup', 1812 LEAVE_EV = useTouchEvents ? null : 'mouseleave', //we manually detect leave on touch devices, so null event here 1813 CANCEL_EV = (SUPPORTS_POINTER ? (SUPPORTS_POINTER_IE10 ? 'MSPointerCancel' : 'pointercancel') : 'touchcancel'); 1814 1815 1816 1817 //touch properties 1818 var distance = 0, 1819 direction = null, 1820 duration = 0, 1821 startTouchesDistance = 0, 1822 endTouchesDistance = 0, 1823 pinchZoom = 1, 1824 pinchDistance = 0, 1825 pinchDirection = 0, 1826 maximumsMap=null; 1827 1828 1829 1830 //jQuery wrapped element for this instance 1831 var $element = $(element); 1832 1833 //Current phase of th touch cycle 1834 var phase = "start"; 1835 1836 // the current number of fingers being used. 1837 var fingerCount = 0; 1838 1839 //track mouse points / delta 1840 var fingerData = {}; 1841 1842 //track times 1843 var startTime = 0, 1844 endTime = 0, 1845 previousTouchEndTime=0, 1846 fingerCountAtRelease=0, 1847 doubleTapStartTime=0; 1848 1849 //Timeouts 1850 var singleTapTimeout=null, 1851 holdTimeout=null; 1852 1853 // Add gestures to all swipable areas if supported 1854 try { 1855 $element.bind(START_EV, touchStart); 1856 $element.bind(CANCEL_EV, touchCancel); 1857 } 1858 catch (e) { 1859 $.error('events not supported ' + START_EV + ',' + CANCEL_EV + ' on jQuery.swipe'); 1860 } 1861 1862 // 1863 //Public methods 1864 // 1865 1866 /** 1867 * re-enables the swipe plugin with the previous configuration 1868 * @function 1869 * @name $.fn.swipe#enable 1870 * @return {DOMNode} The Dom element that was registered with TouchSwipe 1871 * @example $("#element").swipe("enable"); 1872 */ 1873 this.enable = function () { 1874 $element.bind(START_EV, touchStart); 1875 $element.bind(CANCEL_EV, touchCancel); 1876 return $element; 1877 }; 1878 1879 /** 1880 * disables the swipe plugin 1881 * @function 1882 * @name $.fn.swipe#disable 1883 * @return {DOMNode} The Dom element that is now registered with TouchSwipe 1884 * @example $("#element").swipe("disable"); 1885 */ 1886 this.disable = function () { 1887 removeListeners(); 1888 return $element; 1889 }; 1890 1891 /** 1892 * Destroy the swipe plugin completely. To use any swipe methods, you must re initialise the plugin. 1893 * @function 1894 * @name $.fn.swipe#destroy 1895 * @example $("#element").swipe("destroy"); 1896 */ 1897 this.destroy = function () { 1898 removeListeners(); 1899 $element.data(PLUGIN_NS, null); 1900 $element = null; 1901 }; 1902 1903 1904 /** 1905 * Allows run time updating of the swipe configuration options. 1906 * @function 1907 * @name $.fn.swipe#option 1908 * @param {String} property The option property to get or set, or a has of multiple options to set 1909 * @param {Object} [value] The value to set the property to 1910 * @return {Object} If only a property name is passed, then that property value is returned. If nothing is passed the current options hash is returned. 1911 * @example $("#element").swipe("option", "threshold"); // return the threshold 1912 * @example $("#element").swipe("option", "threshold", 100); // set the threshold after init 1913 * @example $("#element").swipe("option", {threshold:100, fingers:3} ); // set multiple properties after init 1914 * @example $("#element").swipe({threshold:100, fingers:3} ); // set multiple properties after init - the "option" method is optional! 1915 * @example $("#element").swipe("option"); // Return the current options hash 1916 * @see $.fn.swipe.defaults 1917 * 1918 */ 1919 this.option = function (property, value) { 1920 1921 if(typeof property === 'object') { 1922 options = $.extend(options, property); 1923 } else if(options[property]!==undefined) { 1924 if(value===undefined) { 1925 return options[property]; 1926 } else { 1927 options[property] = value; 1928 } 1929 } else if (!property) { 1930 return options; 1931 } else { 1932 $.error('Option ' + property + ' does not exist on jQuery.swipe.options'); 1933 } 1934 1935 return null; 1936 } 1937 1938 1939 1940 // 1941 // Private methods 1942 // 1943 1944 // 1945 // EVENTS 1946 // 1947 /** 1948 * Event handler for a touch start event. 1949 * Stops the default click event from triggering and stores where we touched 1950 * @inner 1951 * @param {object} jqEvent The normalised jQuery event object. 1952 */ 1953 function touchStart(jqEvent) { 1954 1955 //If we already in a touch event (a finger already in use) then ignore subsequent ones.. 1956 if( getTouchInProgress() ) 1957 return; 1958 1959 //Check if this element matches any in the excluded elements selectors, or its parent is excluded, if so, DON'T swipe 1960 if( $(jqEvent.target).closest( options.excludedElements, $element ).length>0 ) 1961 return; 1962 1963 //As we use Jquery bind for events, we need to target the original event object 1964 //If these events are being programmatically triggered, we don't have an original event object, so use the Jq one. 1965 var event = jqEvent.originalEvent ? jqEvent.originalEvent : jqEvent; 1966 1967 var ret, 1968 touches = event.touches, 1969 evt = touches ? touches[0] : event; 1970 1971 phase = PHASE_START; 1972 1973 //If we support touches, get the finger count 1974 if (touches) { 1975 // get the total number of fingers touching the screen 1976 fingerCount = touches.length; 1977 } 1978 //Else this is the desktop, so stop the browser from dragging content 1979 else if(options.preventDefaultEvents !== false) { 1980 jqEvent.preventDefault(); //call this on jq event so we are cross browser 1981 } 1982 1983 //clear vars.. 1984 distance = 0; 1985 direction = null; 1986 pinchDirection=null; 1987 duration = 0; 1988 startTouchesDistance=0; 1989 endTouchesDistance=0; 1990 pinchZoom = 1; 1991 pinchDistance = 0; 1992 maximumsMap=createMaximumsData(); 1993 cancelMultiFingerRelease(); 1994 1995 //Create the default finger data 1996 createFingerData( 0, evt ); 1997 1998 // check the number of fingers is what we are looking for, or we are capturing pinches 1999 if (!touches || (fingerCount === options.fingers || options.fingers === ALL_FINGERS) || hasPinches()) { 2000 // get the coordinates of the touch 2001 startTime = getTimeStamp(); 2002 2003 if(fingerCount==2) { 2004 //Keep track of the initial pinch distance, so we can calculate the diff later 2005 //Store second finger data as start 2006 createFingerData( 1, touches[1] ); 2007 startTouchesDistance = endTouchesDistance = calculateTouchesDistance(fingerData[0].start, fingerData[1].start); 2008 } 2009 2010 if (options.swipeStatus || options.pinchStatus) { 2011 ret = triggerHandler(event, phase); 2012 } 2013 } 2014 else { 2015 //A touch with more or less than the fingers we are looking for, so cancel 2016 ret = false; 2017 } 2018 2019 //If we have a return value from the users handler, then return and cancel 2020 if (ret === false) { 2021 phase = PHASE_CANCEL; 2022 triggerHandler(event, phase); 2023 return ret; 2024 } 2025 else { 2026 if (options.hold) { 2027 holdTimeout = setTimeout($.proxy(function() { 2028 //Trigger the event 2029 $element.trigger('hold', [event.target]); 2030 //Fire the callback 2031 if(options.hold) { 2032 ret = options.hold.call($element, event, event.target); 2033 } 2034 }, this), options.longTapThreshold ); 2035 } 2036 2037 setTouchInProgress(true); 2038 } 2039 2040 return null; 2041 }; 2042 2043 2044 2045 /** 2046 * Event handler for a touch move event. 2047 * If we change fingers during move, then cancel the event 2048 * @inner 2049 * @param {object} jqEvent The normalised jQuery event object. 2050 */ 2051 function touchMove(jqEvent) { 2052 2053 //As we use Jquery bind for events, we need to target the original event object 2054 //If these events are being programmatically triggered, we don't have an original event object, so use the Jq one. 2055 var event = jqEvent.originalEvent ? jqEvent.originalEvent : jqEvent; 2056 2057 //If we are ending, cancelling, or within the threshold of 2 fingers being released, don't track anything.. 2058 if (phase === PHASE_END || phase === PHASE_CANCEL || inMultiFingerRelease()) 2059 return; 2060 2061 var ret, 2062 touches = event.touches, 2063 evt = touches ? touches[0] : event; 2064 2065 2066 //Update the finger data 2067 var currentFinger = updateFingerData(evt); 2068 endTime = getTimeStamp(); 2069 2070 if (touches) { 2071 fingerCount = touches.length; 2072 } 2073 2074 if (options.hold) 2075 clearTimeout(holdTimeout); 2076 2077 phase = PHASE_MOVE; 2078 2079 //If we have 2 fingers get Touches distance as well 2080 if(fingerCount==2) { 2081 2082 //Keep track of the initial pinch distance, so we can calculate the diff later 2083 //We do this here as well as the start event, in case they start with 1 finger, and the press 2 fingers 2084 if(startTouchesDistance==0) { 2085 //Create second finger if this is the first time... 2086 createFingerData( 1, touches[1] ); 2087 2088 startTouchesDistance = endTouchesDistance = calculateTouchesDistance(fingerData[0].start, fingerData[1].start); 2089 } else { 2090 //Else just update the second finger 2091 updateFingerData(touches[1]); 2092 2093 endTouchesDistance = calculateTouchesDistance(fingerData[0].end, fingerData[1].end); 2094 pinchDirection = calculatePinchDirection(fingerData[0].end, fingerData[1].end); 2095 } 2096 2097 2098 pinchZoom = calculatePinchZoom(startTouchesDistance, endTouchesDistance); 2099 pinchDistance = Math.abs(startTouchesDistance - endTouchesDistance); 2100 } 2101 2102 2103 2104 2105 if ( (fingerCount === options.fingers || options.fingers === ALL_FINGERS) || !touches || hasPinches() ) { 2106 2107 direction = calculateDirection(currentFinger.start, currentFinger.end); 2108 2109 //Check if we need to prevent default event (page scroll / pinch zoom) or not 2110 validateDefaultEvent(jqEvent, direction); 2111 2112 //Distance and duration are all off the main finger 2113 distance = calculateDistance(currentFinger.start, currentFinger.end); 2114 duration = calculateDuration(); 2115 2116 //Cache the maximum distance we made in this direction 2117 setMaxDistance(direction, distance); 2118 2119 2120 if (options.swipeStatus || options.pinchStatus) { 2121 ret = triggerHandler(event, phase); 2122 } 2123 2124 2125 //If we trigger end events when threshold are met, or trigger events when touch leaves element 2126 if(!options.triggerOnTouchEnd || options.triggerOnTouchLeave) { 2127 2128 var inBounds = true; 2129 2130 //If checking if we leave the element, run the bounds check (we can use touchleave as its not supported on webkit) 2131 if(options.triggerOnTouchLeave) { 2132 var bounds = getbounds( this ); 2133 inBounds = isInBounds( currentFinger.end, bounds ); 2134 } 2135 2136 //Trigger end handles as we swipe if thresholds met or if we have left the element if the user has asked to check these.. 2137 if(!options.triggerOnTouchEnd && inBounds) { 2138 phase = getNextPhase( PHASE_MOVE ); 2139 } 2140 //We end if out of bounds here, so set current phase to END, and check if its modified 2141 else if(options.triggerOnTouchLeave && !inBounds ) { 2142 phase = getNextPhase( PHASE_END ); 2143 } 2144 2145 if(phase==PHASE_CANCEL || phase==PHASE_END) { 2146 triggerHandler(event, phase); 2147 } 2148 } 2149 } 2150 else { 2151 phase = PHASE_CANCEL; 2152 triggerHandler(event, phase); 2153 } 2154 2155 if (ret === false) { 2156 phase = PHASE_CANCEL; 2157 triggerHandler(event, phase); 2158 } 2159 } 2160 2161 2162 2163 2164 /** 2165 * Event handler for a touch end event. 2166 * Calculate the direction and trigger events 2167 * @inner 2168 * @param {object} jqEvent The normalised jQuery event object. 2169 */ 2170 function touchEnd(jqEvent) { 2171 //As we use Jquery bind for events, we need to target the original event object 2172 //If these events are being programmatically triggered, we don't have an original event object, so use the Jq one. 2173 var event = jqEvent.originalEvent ? jqEvent.originalEvent : jqEvent, 2174 touches = event.touches; 2175 2176 //If we are still in a touch with the device wait a fraction and see if the other finger comes up 2177 //if it does within the threshold, then we treat it as a multi release, not a single release and end the touch / swipe 2178 if (touches) { 2179 if(touches.length && !inMultiFingerRelease()) { 2180 startMultiFingerRelease(); 2181 return true; 2182 } else if (touches.length && inMultiFingerRelease()) { 2183 return true; 2184 } 2185 } 2186 2187 //If a previous finger has been released, check how long ago, if within the threshold, then assume it was a multifinger release. 2188 //This is used to allow 2 fingers to release fractionally after each other, whilst maintainig the event as containg 2 fingers, not 1 2189 if(inMultiFingerRelease()) { 2190 fingerCount=fingerCountAtRelease; 2191 } 2192 2193 //Set end of swipe 2194 endTime = getTimeStamp(); 2195 2196 //Get duration incase move was never fired 2197 duration = calculateDuration(); 2198 2199 //If we trigger handlers at end of swipe OR, we trigger during, but they didnt trigger and we are still in the move phase 2200 if(didSwipeBackToCancel() || !validateSwipeDistance()) { 2201 phase = PHASE_CANCEL; 2202 triggerHandler(event, phase); 2203 } else if (options.triggerOnTouchEnd || (options.triggerOnTouchEnd == false && phase === PHASE_MOVE)) { 2204 //call this on jq event so we are cross browser 2205 if(options.preventDefaultEvents !== false) { 2206 jqEvent.preventDefault(); 2207 } 2208 phase = PHASE_END; 2209 triggerHandler(event, phase); 2210 } 2211 //Special cases - A tap should always fire on touch end regardless, 2212 //So here we manually trigger the tap end handler by itself 2213 //We dont run trigger handler as it will re-trigger events that may have fired already 2214 else if (!options.triggerOnTouchEnd && hasTap()) { 2215 //Trigger the pinch events... 2216 phase = PHASE_END; 2217 triggerHandlerForGesture(event, phase, TAP); 2218 } 2219 else if (phase === PHASE_MOVE) { 2220 phase = PHASE_CANCEL; 2221 triggerHandler(event, phase); 2222 } 2223 2224 setTouchInProgress(false); 2225 2226 return null; 2227 } 2228 2229 2230 2231 /** 2232 * Event handler for a touch cancel event. 2233 * Clears current vars 2234 * @inner 2235 */ 2236 function touchCancel() { 2237 // reset the variables back to default values 2238 fingerCount = 0; 2239 endTime = 0; 2240 startTime = 0; 2241 startTouchesDistance=0; 2242 endTouchesDistance=0; 2243 pinchZoom=1; 2244 2245 //If we were in progress of tracking a possible multi touch end, then re set it. 2246 cancelMultiFingerRelease(); 2247 2248 setTouchInProgress(false); 2249 } 2250 2251 2252 /** 2253 * Event handler for a touch leave event. 2254 * This is only triggered on desktops, in touch we work this out manually 2255 * as the touchleave event is not supported in webkit 2256 * @inner 2257 */ 2258 function touchLeave(jqEvent) { 2259 //If these events are being programmatically triggered, we don't have an original event object, so use the Jq one. 2260 var event = jqEvent.originalEvent ? jqEvent.originalEvent : jqEvent; 2261 2262 //If we have the trigger on leave property set.... 2263 if(options.triggerOnTouchLeave) { 2264 phase = getNextPhase( PHASE_END ); 2265 triggerHandler(event, phase); 2266 } 2267 } 2268 2269 /** 2270 * Removes all listeners that were associated with the plugin 2271 * @inner 2272 */ 2273 function removeListeners() { 2274 $element.unbind(START_EV, touchStart); 2275 $element.unbind(CANCEL_EV, touchCancel); 2276 $element.unbind(MOVE_EV, touchMove); 2277 $element.unbind(END_EV, touchEnd); 2278 2279 //we only have leave events on desktop, we manually calculate leave on touch as its not supported in webkit 2280 if(LEAVE_EV) { 2281 $element.unbind(LEAVE_EV, touchLeave); 2282 } 2283 2284 setTouchInProgress(false); 2285 } 2286 2287 2288 /** 2289 * Checks if the time and distance thresholds have been met, and if so then the appropriate handlers are fired. 2290 */ 2291 function getNextPhase(currentPhase) { 2292 2293 var nextPhase = currentPhase; 2294 2295 // Ensure we have valid swipe (under time and over distance and check if we are out of bound...)
2296 var validTime = validateSwipeTime(); 2297 var validDistance = validateSwipeDistance(); 2298 var didCancel = didSwipeBackToCancel(); 2299 2300 //If we have exceeded our time, then cancel 2301 if(!validTime || didCancel) { 2302 nextPhase = PHASE_CANCEL; 2303 } 2304 //Else if we are moving, and have reached distance then end 2305 else if (validDistance && currentPhase == PHASE_MOVE && (!options.triggerOnTouchEnd || options.triggerOnTouchLeave) ) { 2306 nextPhase = PHASE_END; 2307 } 2308 //Else if we have ended by leaving and didn't reach distance, then cancel 2309 else if (!validDistance && currentPhase==PHASE_END && options.triggerOnTouchLeave) { 2310 nextPhase = PHASE_CANCEL; 2311 } 2312 2313 return nextPhase; 2314 } 2315 2316 2317 /** 2318 * Trigger the relevant event handler 2319 * The handlers are passed the original event, the element that was swiped, and in the case of the catch all handler, the direction that was swiped, "left", "right", "up", or "down" 2320 * @param {object} event the original event object 2321 * @param {string} phase the phase of the swipe (start, end cancel etc) {@link $.fn.swipe.phases} 2322 * @inner 2323 */ 2324 function triggerHandler(event, phase) { 2325 2326 var ret, 2327 touches = event.touches; 2328 2329 //Swipes and pinches are not mutually exclusive - can happend at same time, so need to trigger 2 events potentially 2330 if( (didSwipe() && hasSwipes()) || (didPinch() && hasPinches()) ) { 2331 // SWIPE GESTURES 2332 if(didSwipe() && hasSwipes()) { //hasSwipes as status needs to fire even if swipe is invalid 2333 //Trigger the swipe events... 2334 ret = triggerHandlerForGesture(event, phase, SWIPE); 2335 } 2336 2337 // PINCH GESTURES (if the above didn't cancel) 2338 if((didPinch() && hasPinches()) && ret!==false) { 2339 //Trigger the pinch events... 2340 ret = triggerHandlerForGesture(event, phase, PINCH); 2341 } 2342 } 2343 else { 2344 2345 // CLICK / TAP (if the above didn't cancel) 2346 if(didDoubleTap() && ret!==false) { 2347 //Trigger the tap events... 2348 ret = triggerHandlerForGesture(event, phase, DOUBLE_TAP); 2349 } 2350 2351 // CLICK / TAP (if the above didn't cancel) 2352 else if(didLongTap() && ret!==false) { 2353 //Trigger the tap events... 2354 ret = triggerHandlerForGesture(event, phase, LONG_TAP); 2355 } 2356 2357 // CLICK / TAP (if the above didn't cancel) 2358 else if(didTap() && ret!==false) { 2359 //Trigger the tap event.. 2360 ret = triggerHandlerForGesture(event, phase, TAP); 2361 } 2362 } 2363 2364 // If we are cancelling the gesture, then manually trigger the reset handler 2365 if (phase === PHASE_CANCEL) { 2366 if(hasSwipes() ) { 2367 ret = triggerHandlerForGesture(event, phase, SWIPE); 2368 } 2369 2370 if(hasPinches()) { 2371 ret = triggerHandlerForGesture(event, phase, PINCH); 2372 } 2373 touchCancel(event); 2374 } 2375 2376 // If we are ending the gesture, then manually trigger the reset handler IF all fingers are off 2377 if(phase === PHASE_END) { 2378 //If we support touch, then check that all fingers are off before we cancel 2379 if (touches) { 2380 if(!touches.length) { 2381 touchCancel(event); 2382 } 2383 } 2384 else { 2385 touchCancel(event); 2386 } 2387 } 2388 2389 return ret; 2390 } 2391 2392 2393 2394 /** 2395 * Trigger the relevant event handler 2396 * The handlers are passed the original event, the element that was swiped, and in the case of the catch all handler, the direction that was swiped, "left", "right", "up", or "down" 2397 * @param {object} event the original event object 2398 * @param {string} phase the phase of the swipe (start, end cancel etc) {@link $.fn.swipe.phases} 2399 * @param {string} gesture the gesture to trigger a handler for : PINCH or SWIPE {@link $.fn.swipe.gestures} 2400 * @return Boolean False, to indicate that the event should stop propagation, or void. 2401 * @inner 2402 */ 2403 function triggerHandlerForGesture(event, phase, gesture) { 2404 2405 var ret; 2406 2407 //SWIPES.... 2408 if(gesture==SWIPE) { 2409 //Trigger status every time.. 2410 2411 //Trigger the event... 2412 $element.trigger('swipeStatus', [phase, direction || null, distance || 0, duration || 0, fingerCount, fingerData]); 2413 2414 //Fire the callback 2415 if (options.swipeStatus) { 2416 ret = options.swipeStatus.call($element, event, phase, direction || null, distance || 0, duration || 0, fingerCount, fingerData); 2417 //If the status cancels, then dont run the subsequent event handlers.. 2418 if(ret===false) return false; 2419 } 2420 2421 2422 2423 2424 if (phase == PHASE_END && validateSwipe()) {
vendor: 25,281 bytes, lines 2425-3272
2425 //Fire the catch all event 2426 $element.trigger('swipe', [direction, distance, duration, fingerCount, fingerData]); 2427 2428 //Fire catch all callback 2429 if (options.swipe) { 2430 ret = options.swipe.call($element, event, direction, distance, duration, fingerCount, fingerData); 2431 //If the status cancels, then dont run the subsequent event handlers.. 2432 if(ret===false) return false; 2433 } 2434 2435 //trigger direction specific event handlers 2436 switch (direction) { 2437 case LEFT: 2438 //Trigger the event 2439 $element.trigger('swipeLeft', [direction, distance, duration, fingerCount, fingerData]); 2440 2441 //Fire the callback 2442 if (options.swipeLeft) { 2443 ret = options.swipeLeft.call($element, event, direction, distance, duration, fingerCount, fingerData); 2444 } 2445 break; 2446 2447 case RIGHT: 2448 //Trigger the event 2449 $element.trigger('swipeRight', [direction, distance, duration, fingerCount, fingerData]); 2450 2451 //Fire the callback 2452 if (options.swipeRight) { 2453 ret = options.swipeRight.call($element, event, direction, distance, duration, fingerCount, fingerData); 2454 } 2455 break; 2456 2457 case UP: 2458 //Trigger the event 2459 $element.trigger('swipeUp', [direction, distance, duration, fingerCount, fingerData]); 2460 2461 //Fire the callback 2462 if (options.swipeUp) { 2463 ret = options.swipeUp.call($element, event, direction, distance, duration, fingerCount, fingerData); 2464 } 2465 break; 2466 2467 case DOWN: 2468 //Trigger the event 2469 $element.trigger('swipeDown', [direction, distance, duration, fingerCount, fingerData]); 2470 2471 //Fire the callback 2472 if (options.swipeDown) { 2473 ret = options.swipeDown.call($element, event, direction, distance, duration, fingerCount, fingerData); 2474 } 2475 break; 2476 } 2477 } 2478 } 2479 2480 2481 //PINCHES.... 2482 if(gesture==PINCH) { 2483 //Trigger the event 2484 $element.trigger('pinchStatus', [phase, pinchDirection || null, pinchDistance || 0, duration || 0, fingerCount, pinchZoom, fingerData]); 2485 2486 //Fire the callback 2487 if (options.pinchStatus) { 2488 ret = options.pinchStatus.call($element, event, phase, pinchDirection || null, pinchDistance || 0, duration || 0, fingerCount, pinchZoom, fingerData); 2489 //If the status cancels, then dont run the subsequent event handlers.. 2490 if(ret===false) return false; 2491 } 2492 2493 if(phase==PHASE_END && validatePinch()) { 2494 2495 switch (pinchDirection) { 2496 case IN: 2497 //Trigger the event 2498 $element.trigger('pinchIn', [pinchDirection || null, pinchDistance || 0, duration || 0, fingerCount, pinchZoom, fingerData]); 2499 2500 //Fire the callback 2501 if (options.pinchIn) { 2502 ret = options.pinchIn.call($element, event, pinchDirection || null, pinchDistance || 0, duration || 0, fingerCount, pinchZoom, fingerData); 2503 } 2504 break; 2505 2506 case OUT: 2507 //Trigger the event 2508 $element.trigger('pinchOut', [pinchDirection || null, pinchDistance || 0, duration || 0, fingerCount, pinchZoom, fingerData]); 2509 2510 //Fire the callback 2511 if (options.pinchOut) { 2512 ret = options.pinchOut.call($element, event, pinchDirection || null, pinchDistance || 0, duration || 0, fingerCount, pinchZoom, fingerData); 2513 } 2514 break; 2515 } 2516 } 2517 } 2518 2519 2520 2521 2522 2523 if(gesture==TAP) { 2524 if(phase === PHASE_CANCEL || phase === PHASE_END) { 2525 2526 2527 //Cancel any existing double tap 2528 clearTimeout(singleTapTimeout); 2529 //Cancel hold timeout 2530 clearTimeout(holdTimeout); 2531 2532 //If we are also looking for doubelTaps, wait incase this is one... 2533 if(hasDoubleTap() && !inDoubleTap()) { 2534 //Cache the time of this tap 2535 doubleTapStartTime = getTimeStamp(); 2536 2537 //Now wait for the double tap timeout, and trigger this single tap 2538 //if its not cancelled by a double tap 2539 singleTapTimeout = setTimeout($.proxy(function() { 2540 doubleTapStartTime=null; 2541 //Trigger the event 2542 $element.trigger('tap', [event.target]); 2543 2544 2545 //Fire the callback 2546 if(options.tap) { 2547 ret = options.tap.call($element, event, event.target); 2548 } 2549 }, this), options.doubleTapThreshold ); 2550 2551 } else { 2552 doubleTapStartTime=null; 2553 2554 //Trigger the event 2555 $element.trigger('tap', [event.target]); 2556 2557 2558 //Fire the callback 2559 if(options.tap) { 2560 ret = options.tap.call($element, event, event.target); 2561 } 2562 } 2563 } 2564 } 2565 2566 else if (gesture==DOUBLE_TAP) { 2567 if(phase === PHASE_CANCEL || phase === PHASE_END) { 2568 //Cancel any pending singletap 2569 clearTimeout(singleTapTimeout); 2570 doubleTapStartTime=null; 2571 2572 //Trigger the event 2573 $element.trigger('doubletap', [event.target]); 2574 2575 //Fire the callback 2576 if(options.doubleTap) { 2577 ret = options.doubleTap.call($element, event, event.target); 2578 } 2579 } 2580 } 2581 2582 else if (gesture==LONG_TAP) { 2583 if(phase === PHASE_CANCEL || phase === PHASE_END) { 2584 //Cancel any pending singletap (shouldnt be one) 2585 clearTimeout(singleTapTimeout); 2586 doubleTapStartTime=null; 2587 2588 //Trigger the event 2589 $element.trigger('longtap', [event.target]); 2590 2591 //Fire the callback 2592 if(options.longTap) { 2593 ret = options.longTap.call($element, event, event.target); 2594 } 2595 } 2596 } 2597 2598 return ret; 2599 } 2600 2601 2602 2603 2604 // 2605 // GESTURE VALIDATION 2606 // 2607 2608 /** 2609 * Checks the user has swipe far enough 2610 * @return Boolean if <code>threshold</code> has been set, return true if the threshold was met, else false. 2611 * If no threshold was set, then we return true. 2612 * @inner 2613 */ 2614 function validateSwipeDistance() { 2615 var valid = true; 2616 //If we made it past the min swipe distance.. 2617 if (options.threshold !== null) { 2618 valid = distance >= options.threshold; 2619 } 2620 2621 return valid; 2622 } 2623 2624 /** 2625 * Checks the user has swiped back to cancel. 2626 * @return Boolean if <code>cancelThreshold</code> has been set, return true if the cancelThreshold was met, else false. 2627 * If no cancelThreshold was set, then we return true. 2628 * @inner 2629 */ 2630 function didSwipeBackToCancel() { 2631 var cancelled = false; 2632 if(options.cancelThreshold !== null && direction !==null) { 2633 cancelled = (getMaxDistance( direction ) - distance) >= options.cancelThreshold; 2634 } 2635 2636 return cancelled; 2637 } 2638 2639 /** 2640 * Checks the user has pinched far enough 2641 * @return Boolean if <code>pinchThreshold</code> has been set, return true if the threshold was met, else false. 2642 * If no threshold was set, then we return true. 2643 * @inner 2644 */ 2645 function validatePinchDistance() { 2646 if (options.pinchThreshold !== null) { 2647 return pinchDistance >= options.pinchThreshold; 2648 } 2649 return true; 2650 } 2651 2652 /** 2653 * Checks that the time taken to swipe meets the minimum / maximum requirements 2654 * @return Boolean 2655 * @inner 2656 */ 2657 function validateSwipeTime() { 2658 var result; 2659 //If no time set, then return true 2660 2661 if (options.maxTimeThreshold) { 2662 if (duration >= options.maxTimeThreshold) { 2663 result = false; 2664 } else { 2665 result = true; 2666 } 2667 } 2668 else { 2669 result = true; 2670 } 2671 2672 return result; 2673 } 2674 2675 2676 2677 /** 2678 * Checks direction of the swipe and the value allowPageScroll to see if we should allow or prevent the default behaviour from occurring. 2679 * This will essentially allow page scrolling or not when the user is swiping on a touchSwipe object. 2680 * @param {object} jqEvent The normalised jQuery representation of the event object. 2681 * @param {string} direction The direction of the event. See {@link $.fn.swipe.directions} 2682 * @see $.fn.swipe.directions 2683 * @inner 2684 */ 2685 function validateDefaultEvent(jqEvent, direction) { 2686 2687 //If we have no pinches, then do this 2688 //If we have a pinch, and we we have 2 fingers or more down, then dont allow page scroll. 2689 2690 //If the option is set, allways allow the event to bubble up (let user handle wiredness) 2691 if( options.preventDefaultEvents === false) { 2692 return; 2693 } 2694 2695 if (options.allowPageScroll === NONE) { 2696 jqEvent.preventDefault(); 2697 } else { 2698 var auto = options.allowPageScroll === AUTO; 2699 2700 switch (direction) { 2701 case LEFT: 2702 if ((options.swipeLeft && auto) || (!auto && options.allowPageScroll != HORIZONTAL)) { 2703 jqEvent.preventDefault(); 2704 } 2705 break; 2706 2707 case RIGHT: 2708 if ((options.swipeRight && auto) || (!auto && options.allowPageScroll != HORIZONTAL)) { 2709 jqEvent.preventDefault(); 2710 } 2711 break; 2712 2713 case UP: 2714 if ((options.swipeUp && auto) || (!auto && options.allowPageScroll != VERTICAL)) { 2715 jqEvent.preventDefault(); 2716 } 2717 break; 2718 2719 case DOWN: 2720 if ((options.swipeDown && auto) || (!auto && options.allowPageScroll != VERTICAL)) { 2721 jqEvent.preventDefault(); 2722 } 2723 break; 2724 } 2725 } 2726 2727 } 2728 2729 2730 // PINCHES 2731 /** 2732 * Returns true of the current pinch meets the thresholds 2733 * @return Boolean 2734 * @inner 2735 */ 2736 function validatePinch() { 2737 var hasCorrectFingerCount = validateFingers(); 2738 var hasEndPoint = validateEndPoint(); 2739 var hasCorrectDistance = validatePinchDistance(); 2740 return hasCorrectFingerCount && hasEndPoint && hasCorrectDistance; 2741 2742 } 2743 2744 /** 2745 * Returns true if any Pinch events have been registered 2746 * @return Boolean 2747 * @inner 2748 */ 2749 function hasPinches() { 2750 //Enure we dont return 0 or null for false values 2751 return !!(options.pinchStatus || options.pinchIn || options.pinchOut); 2752 } 2753 2754 /** 2755 * Returns true if we are detecting pinches, and have one 2756 * @return Boolean 2757 * @inner 2758 */ 2759 function didPinch() { 2760 //Enure we dont return 0 or null for false values 2761 return !!(validatePinch() && hasPinches()); 2762 } 2763 2764 2765 2766 2767 // SWIPES 2768 /** 2769 * Returns true if the current swipe meets the thresholds 2770 * @return Boolean 2771 * @inner 2772 */ 2773 function validateSwipe() { 2774 //Check validity of swipe 2775 var hasValidTime = validateSwipeTime(); 2776 var hasValidDistance = validateSwipeDistance(); 2777 var hasCorrectFingerCount = validateFingers(); 2778 var hasEndPoint = validateEndPoint(); 2779 var didCancel = didSwipeBackToCancel(); 2780 2781 // if the user swiped more than the minimum length, perform the appropriate action 2782 // hasValidDistance is null when no distance is set 2783 var valid = !didCancel && hasEndPoint && hasCorrectFingerCount && hasValidDistance && hasValidTime; 2784 2785 return valid; 2786 } 2787 2788 /** 2789 * Returns true if any Swipe events have been registered 2790 * @return Boolean 2791 * @inner 2792 */ 2793 function hasSwipes() { 2794 //Enure we dont return 0 or null for false values 2795 return !!(options.swipe || options.swipeStatus || options.swipeLeft || options.swipeRight || options.swipeUp || options.swipeDown); 2796 } 2797 2798 2799 /** 2800 * Returns true if we are detecting swipes and have one 2801 * @return Boolean 2802 * @inner 2803 */ 2804 function didSwipe() { 2805 //Enure we dont return 0 or null for false values 2806 return !!(validateSwipe() && hasSwipes()); 2807 } 2808 2809 /** 2810 * Returns true if we have matched the number of fingers we are looking for 2811 * @return Boolean 2812 * @inner 2813 */ 2814 function validateFingers() { 2815 //The number of fingers we want were matched, or on desktop we ignore 2816 return ((fingerCount === options.fingers || options.fingers === ALL_FINGERS) || !SUPPORTS_TOUCH); 2817 } 2818 2819 /** 2820 * Returns true if we have an end point for the swipe 2821 * @return Boolean 2822 * @inner 2823 */ 2824 function validateEndPoint() { 2825 //We have an end value for the finger 2826 return fingerData[0].end.x !== 0; 2827 } 2828 2829 // TAP / CLICK 2830 /** 2831 * Returns true if a click / tap events have been registered 2832 * @return Boolean 2833 * @inner 2834 */ 2835 function hasTap() { 2836 //Enure we dont return 0 or null for false values 2837 return !!(options.tap) ; 2838 } 2839 2840 /** 2841 * Returns true if a double tap events have been registered 2842 * @return Boolean 2843 * @inner 2844 */ 2845 function hasDoubleTap() { 2846 //Enure we dont return 0 or null for false values 2847 return !!(options.doubleTap) ; 2848 } 2849 2850 /** 2851 * Returns true if any long tap events have been registered 2852 * @return Boolean 2853 * @inner 2854 */ 2855 function hasLongTap() { 2856 //Enure we dont return 0 or null for false values 2857 return !!(options.longTap) ; 2858 } 2859 2860 /** 2861 * Returns true if we could be in the process of a double tap (one tap has occurred, we are listening for double taps, and the threshold hasn't past. 2862 * @return Boolean 2863 * @inner 2864 */ 2865 function validateDoubleTap() { 2866 if(doubleTapStartTime==null){ 2867 return false; 2868 } 2869 var now = getTimeStamp(); 2870 return (hasDoubleTap() && ((now-doubleTapStartTime) <= options.doubleTapThreshold)); 2871 } 2872 2873 /** 2874 * Returns true if we could be in the process of a double tap (one tap has occurred, we are listening for double taps, and the threshold hasn't past. 2875 * @return Boolean 2876 * @inner 2877 */ 2878 function inDoubleTap() { 2879 return validateDoubleTap(); 2880 } 2881 2882 2883 /** 2884 * Returns true if we have a valid tap 2885 * @return Boolean 2886 * @inner 2887 */ 2888 function validateTap() { 2889 return ((fingerCount === 1 || !SUPPORTS_TOUCH) && (isNaN(distance) || distance < options.threshold)); 2890 } 2891 2892 /** 2893 * Returns true if we have a valid long tap 2894 * @return Boolean 2895 * @inner 2896 */ 2897 function validateLongTap() { 2898 //slight threshold on moving finger 2899 return ((duration > options.longTapThreshold) && (distance < DOUBLE_TAP_THRESHOLD)); 2900 } 2901 2902 /** 2903 * Returns true if we are detecting taps and have one 2904 * @return Boolean 2905 * @inner 2906 */ 2907 function didTap() { 2908 //Enure we dont return 0 or null for false values 2909 return !!(validateTap() && hasTap()); 2910 } 2911 2912 2913 /** 2914 * Returns true if we are detecting double taps and have one 2915 * @return Boolean 2916 * @inner 2917 */ 2918 function didDoubleTap() { 2919 //Enure we dont return 0 or null for false values 2920 return !!(validateDoubleTap() && hasDoubleTap()); 2921 } 2922 2923 /** 2924 * Returns true if we are detecting long taps and have one 2925 * @return Boolean 2926 * @inner 2927 */ 2928 function didLongTap() { 2929 //Enure we dont return 0 or null for false values 2930 return !!(validateLongTap() && hasLongTap()); 2931 } 2932 2933 2934 2935 2936 // MULTI FINGER TOUCH 2937 /** 2938 * Starts tracking the time between 2 finger releases, and keeps track of how many fingers we initially had up 2939 * @inner 2940 */ 2941 function startMultiFingerRelease() { 2942 previousTouchEndTime = getTimeStamp(); 2943 fingerCountAtRelease = event.touches.length+1; 2944 } 2945 2946 /** 2947 * Cancels the tracking of time between 2 finger releases, and resets counters 2948 * @inner 2949 */ 2950 function cancelMultiFingerRelease() { 2951 previousTouchEndTime = 0; 2952 fingerCountAtRelease = 0; 2953 } 2954 2955 /** 2956 * Checks if we are in the threshold between 2 fingers being released 2957 * @return Boolean 2958 * @inner 2959 */ 2960 function inMultiFingerRelease() { 2961 2962 var withinThreshold = false; 2963 2964 if(previousTouchEndTime) { 2965 var diff = getTimeStamp() - previousTouchEndTime 2966 if( diff<=options.fingerReleaseThreshold ) { 2967 withinThreshold = true; 2968 } 2969 } 2970 2971 return withinThreshold; 2972 } 2973 2974 2975 /** 2976 * gets a data flag to indicate that a touch is in progress 2977 * @return Boolean 2978 * @inner 2979 */ 2980 function getTouchInProgress() { 2981 //strict equality to ensure only true and false are returned 2982 return !!($element.data(PLUGIN_NS+'_intouch') === true); 2983 } 2984 2985 /** 2986 * Sets a data flag to indicate that a touch is in progress 2987 * @param {boolean} val The value to set the property to 2988 * @inner 2989 */ 2990 function setTouchInProgress(val) { 2991 2992 //Add or remove event listeners depending on touch status 2993 if(val===true) { 2994 $element.bind(MOVE_EV, touchMove); 2995 $element.bind(END_EV, touchEnd); 2996 2997 //we only have leave events on desktop, we manually calcuate leave on touch as its not supported in webkit 2998 if(LEAVE_EV) { 2999 $element.bind(LEAVE_EV, touchLeave); 3000 } 3001 } else { 3002 3003 $element.unbind(MOVE_EV, touchMove, false); 3004 $element.unbind(END_EV, touchEnd, false); 3005 3006 //we only have leave events on desktop, we manually calcuate leave on touch as its not supported in webkit 3007 if(LEAVE_EV) { 3008 $element.unbind(LEAVE_EV, touchLeave, false); 3009 } 3010 } 3011 3012 3013 //strict equality to ensure only true and false can update the value 3014 $element.data(PLUGIN_NS+'_intouch', val === true); 3015 } 3016 3017 3018 /** 3019 * Creates the finger data for the touch/finger in the event object. 3020 * @param {int} id The id to store the finger data under (usually the order the fingers were pressed) 3021 * @param {object} evt The event object containing finger data 3022 * @return finger data object 3023 * @inner 3024 */ 3025 function createFingerData(id, evt) { 3026 var f = { 3027 start:{ x: 0, y: 0 }, 3028 end:{ x: 0, y: 0 } 3029 }; 3030 f.start.x = f.end.x = evt.pageX||evt.clientX; 3031 f.start.y = f.end.y = evt.pageY||evt.clientY; 3032 fingerData[id] = f; 3033 return f; 3034 } 3035 3036 /** 3037 * Updates the finger data for a particular event object 3038 * @param {object} evt The event object containing the touch/finger data to upadte 3039 * @return a finger data object. 3040 * @inner 3041 */ 3042 function updateFingerData(evt) { 3043 var id = evt.identifier!==undefined ? evt.identifier : 0; 3044 var f = getFingerData( id ); 3045 3046 if (f === null) { 3047 f = createFingerData(id, evt); 3048 } 3049 3050 f.end.x = evt.pageX||evt.clientX; 3051 f.end.y = evt.pageY||evt.clientY; 3052 3053 return f; 3054 } 3055 3056 /** 3057 * Returns a finger data object by its event ID. 3058 * Each touch event has an identifier property, which is used 3059 * to track repeat touches 3060 * @param {int} id The unique id of the finger in the sequence of touch events. 3061 * @return a finger data object. 3062 * @inner 3063 */ 3064 function getFingerData(id) { 3065 return fingerData[id] || null; 3066 } 3067 3068 3069 /** 3070 * Sets the maximum distance swiped in the given direction. 3071 * If the new value is lower than the current value, the max value is not changed. 3072 * @param {string} direction The direction of the swipe 3073 * @param {int} distance The distance of the swipe 3074 * @inner 3075 */ 3076 function setMaxDistance(direction, distance) { 3077 distance = Math.max(distance, getMaxDistance(direction) ); 3078 maximumsMap[direction].distance = distance; 3079 } 3080 3081 /** 3082 * gets the maximum distance swiped in the given direction. 3083 * @param {string} direction The direction of the swipe 3084 * @return int The distance of the swipe 3085 * @inner 3086 */ 3087 function getMaxDistance(direction) { 3088 if (maximumsMap[direction]) return maximumsMap[direction].distance; 3089 return undefined; 3090 } 3091 3092 /** 3093 * Creats a map of directions to maximum swiped values. 3094 * @return Object A dictionary of maximum values, indexed by direction. 3095 * @inner 3096 */ 3097 function createMaximumsData() { 3098 var maxData={}; 3099 maxData[LEFT]=createMaximumVO(LEFT); 3100 maxData[RIGHT]=createMaximumVO(RIGHT); 3101 maxData[UP]=createMaximumVO(UP); 3102 maxData[DOWN]=createMaximumVO(DOWN); 3103 3104 return maxData; 3105 } 3106 3107 /** 3108 * Creates a map maximum swiped values for a given swipe direction 3109 * @param {string} The direction that these values will be associated with 3110 * @return Object Maximum values 3111 * @inner 3112 */ 3113 function createMaximumVO(dir) { 3114 return { 3115 direction:dir, 3116 distance:0 3117 } 3118 } 3119 3120 3121 // 3122 // MATHS / UTILS 3123 // 3124 3125 /** 3126 * Calculate the duration of the swipe 3127 * @return int 3128 * @inner 3129 */ 3130 function calculateDuration() { 3131 return endTime - startTime; 3132 } 3133 3134 /** 3135 * Calculate the distance between 2 touches (pinch) 3136 * @param {point} startPoint A point object containing x and y co-ordinates 3137 * @param {point} endPoint A point object containing x and y co-ordinates 3138 * @return int; 3139 * @inner 3140 */ 3141 function calculateTouchesDistance(startPoint, endPoint) { 3142 var diffX = Math.abs(startPoint.x - endPoint.x); 3143 var diffY = Math.abs(startPoint.y - endPoint.y); 3144 3145 return Math.round(Math.sqrt(diffX*diffX+diffY*diffY)); 3146 } 3147 3148 /** 3149 * Calculate the zoom factor between the start and end distances 3150 * @param {int} startDistance Distance (between 2 fingers) the user started pinching at 3151 * @param {int} endDistance Distance (between 2 fingers) the user ended pinching at 3152 * @return float The zoom value from 0 to 1. 3153 * @inner 3154 */ 3155 function calculatePinchZoom(startDistance, endDistance) { 3156 var percent = (endDistance/startDistance) * 1; 3157 return percent.toFixed(2); 3158 } 3159 3160 3161 /** 3162 * Returns the pinch direction, either IN or OUT for the given points 3163 * @return string Either {@link $.fn.swipe.directions.IN} or {@link $.fn.swipe.directions.OUT} 3164 * @see $.fn.swipe.directions 3165 * @inner 3166 */ 3167 function calculatePinchDirection() { 3168 if(pinchZoom<1) { 3169 return OUT; 3170 } 3171 else { 3172 return IN; 3173 } 3174 } 3175 3176 3177 /** 3178 * Calculate the length / distance of the swipe 3179 * @param {point} startPoint A point object containing x and y co-ordinates 3180 * @param {point} endPoint A point object containing x and y co-ordinates 3181 * @return int 3182 * @inner 3183 */ 3184 function calculateDistance(startPoint, endPoint) { 3185 return Math.round(Math.sqrt(Math.pow(endPoint.x - startPoint.x, 2) + Math.pow(endPoint.y - startPoint.y, 2))); 3186 } 3187 3188 /** 3189 * Calculate the angle of the swipe 3190 * @param {point} startPoint A point object containing x and y co-ordinates 3191 * @param {point} endPoint A point object containing x and y co-ordinates 3192 * @return int 3193 * @inner 3194 */ 3195 function calculateAngle(startPoint, endPoint) { 3196 var x = startPoint.x - endPoint.x; 3197 var y = endPoint.y - startPoint.y; 3198 var r = Math.atan2(y, x); //radians 3199 var angle = Math.round(r * 180 / Math.PI); //degrees 3200 3201 //ensure value is positive 3202 if (angle < 0) { 3203 angle = 360 - Math.abs(angle); 3204 } 3205 3206 return angle; 3207 } 3208 3209 /** 3210 * Calculate the direction of the swipe 3211 * This will also call calculateAngle to get the latest angle of swipe 3212 * @param {point} startPoint A point object containing x and y co-ordinates 3213 * @param {point} endPoint A point object containing x and y co-ordinates 3214 * @return string Either {@link $.fn.swipe.directions.LEFT} / {@link $.fn.swipe.directions.RIGHT} / {@link $.fn.swipe.directions.DOWN} / {@link $.fn.swipe.directions.UP} 3215 * @see $.fn.swipe.directions 3216 * @inner 3217 */ 3218 function calculateDirection(startPoint, endPoint ) { 3219 var angle = calculateAngle(startPoint, endPoint); 3220 3221 if ((angle <= 45) && (angle >= 0)) { 3222 return LEFT; 3223 } else if ((angle <= 360) && (angle >= 315)) { 3224 return LEFT; 3225 } else if ((angle >= 135) && (angle <= 225)) { 3226 return RIGHT; 3227 } else if ((angle > 45) && (angle < 135)) { 3228 return DOWN; 3229 } else { 3230 return UP; 3231 } 3232 } 3233 3234 3235 /** 3236 * Returns a MS time stamp of the current time 3237 * @return int 3238 * @inner 3239 */ 3240 function getTimeStamp() { 3241 var now = new Date(); 3242 return now.getTime(); 3243 } 3244 3245 3246 3247 /** 3248 * Returns a bounds object with left, right, top and bottom properties for the element specified. 3249 * @param {DomNode} The DOM node to get the bounds for. 3250 */ 3251 function getbounds( el ) { 3252 el = $(el); 3253 var offset = el.offset(); 3254 3255 var bounds = { 3256 left:offset.left, 3257 right:offset.left+el.outerWidth(), 3258 top:offset.top, 3259 bottom:offset.top+el.outerHeight() 3260 } 3261 3262 return bounds; 3263 } 3264 3265 3266 /** 3267 * Checks if the point object is in the bounds object. 3268 * @param {object} point A point object. 3269 * @param {int} point.x The x value of the point. 3270 * @param {int} point.y The x value of the point. 3271 * @param {object} bounds The bounds object to test 3272 * @param {int}
3272 bounds.left The leftmost value 3273 * @param {int} bounds.right The righttmost value 3274 * @param {int} bounds.top The topmost value 3275 * @param {int} bounds.bottom The bottommost value 3276 */ 3277 function isInBounds(point, bounds) { 3278 return (point.x > bounds.left && point.x < bounds.right && point.y > bounds.top && point.y < bounds.bottom); 3279 }; 3280 3281 3282 } 3283 3284 3285 3286 3287/** 3288 * A catch all handler that is triggered for all swipe directions. 3289 * @name $.fn.swipe#swipe 3290 * @event 3291 * @default null 3292 * @param {EventObject} event The original event object 3293 * @param {int} direction The direction the user swiped in. See {@link $.fn.swipe.directions} 3294 * @param {int} distance The distance the user swiped 3295 * @param {int} duration The duration of the swipe in milliseconds 3296 * @param {int} fingerCount The number of fingers used. See {@link $.fn.swipe.fingers} 3297 * @param {object} fingerData The coordinates of fingers in event 3298 */ 3299 3300 3301 3302 3303/** 3304 * A handler that is triggered for "left" swipes. 3305 * @name $.fn.swipe#swipeLeft 3306 * @event 3307 * @default null 3308 * @param {EventObject} event The original event object 3309 * @param {int} direction The direction the user swiped in. See {@link $.fn.swipe.directions} 3310 * @param {int} distance The distance the user swiped 3311 * @param {int} duration The duration of the swipe in milliseconds 3312 * @param {int} fingerCount The number of fingers used. See {@link $.fn.swipe.fingers} 3313 * @param {object} fingerData The coordinates of fingers in event 3314 */ 3315 3316/** 3317 * A handler that is triggered for "right" swipes. 3318 * @name $.fn.swipe#swipeRight 3319 * @event 3320 * @default null 3321 * @param {EventObject} event The original event object 3322 * @param {int} direction The direction the user swiped in. See {@link $.fn.swipe.directions} 3323 * @param {int} distance The distance the user swiped 3324 * @param {int} duration The duration of the swipe in milliseconds 3325 * @param {int} fingerCount The number of fingers used. See {@link $.fn.swipe.fingers} 3326 * @param {object} fingerData The coordinates of fingers in event 3327 */ 3328 3329/** 3330 * A handler that is triggered for "up" swipes. 3331 * @name $.fn.swipe#swipeUp 3332 * @event 3333 * @default null 3334 * @param {EventObject} event The original event object 3335 * @param {int} direction The direction the user swiped in. See {@link $.fn.swipe.directions} 3336 * @param {int} distance The distance the user swiped 3337 * @param {int} duration The duration of the swipe in milliseconds 3338 * @param {int} fingerCount The number of fingers used. See {@link $.fn.swipe.fingers} 3339 * @param {object} fingerData The coordinates of fingers in event 3340 */ 3341 3342/** 3343 * A handler that is triggered for "down" swipes. 3344 * @name $.fn.swipe#swipeDown 3345 * @event 3346 * @default null 3347 * @param {EventObject} event The original event object 3348 * @param {int} direction The direction the user swiped in. See {@link $.fn.swipe.directions} 3349 * @param {int} distance The distance the user swiped 3350 * @param {int} duration The duration of the swipe in milliseconds 3351 * @param {int} fingerCount The number of fingers used. See {@link $.fn.swipe.fingers} 3352 * @param {object} fingerData The coordinates of fingers in event 3353 */ 3354 3355/** 3356 * A handler triggered for every phase of the swipe. This handler is constantly fired for the duration of the pinch. 3357 * This is triggered regardless of swipe thresholds. 3358 * @name $.fn.swipe#swipeStatus 3359 * @event 3360 * @default null 3361 * @param {EventObject} event The original event object 3362 * @param {string} phase The phase of the swipe event. See {@link $.fn.swipe.phases} 3363 * @param {string} direction The direction the user swiped in. This is null if the user has yet to move. See {@link $.fn.swipe.directions} 3364 * @param {int} distance The distance the user swiped. This is 0 if the user has yet to move. 3365 * @param {int} duration The duration of the swipe in milliseconds 3366 * @param {int} fingerCount The number of fingers used. See {@link $.fn.swipe.fingers} 3367 * @param {object} fingerData The coordinates of fingers in event 3368 */ 3369 3370/** 3371 * A handler triggered for pinch in events. 3372 * @name $.fn.swipe#pinchIn 3373 * @event 3374 * @default null 3375 * @param {EventObject} event The original event object 3376 * @param {int} direction The direction the user pinched in. See {@link $.fn.swipe.directions} 3377 * @param {int} distance The distance the user pinched 3378 * @param {int} duration The duration of the swipe in milliseconds 3379 * @param {int} fingerCount The number of fingers used. See {@link $.fn.swipe.fingers} 3380 * @param {int} zoom The zoom/scale level the user pinched too, 0-1. 3381 * @param {object} fingerData The coordinates of fingers in event 3382 */ 3383 3384/** 3385 * A handler triggered for pinch out events. 3386 * @name $.fn.swipe#pinchOut 3387 * @event 3388 * @default null 3389 * @param {EventObject} event The original event object 3390 * @param {int} direction The direction the user pinched in. See {@link $.fn.swipe.directions} 3391 * @param {int} distance The distance the user pinched 3392 * @param {int} duration The duration of the swipe in milliseconds 3393 * @param {int} fingerCount The number of fingers used. See {@link $.fn.swipe.fingers} 3394 * @param {int} zoom The zoom/scale level the user pinched too, 0-1. 3395 * @param {object} fingerData The coordinates of fingers in event 3396 */ 3397 3398/** 3399 * A handler triggered for all pinch events. This handler is constantly f
3399ired for the duration of the pinch. This is triggered regardless of thresholds. 3400 * @name $.fn.swipe#pinchStatus 3401 * @event 3402 * @default null 3403 * @param {EventObject} event The original event object 3404 * @param {int} direction The direction the user pinched in. See {@link $.fn.swipe.directions} 3405 * @param {int} distance The distance the user pinched 3406 * @param {int} duration The duration of the swipe in milliseconds 3407 * @param {int} fingerCount The number of fingers used. See {@link $.fn.swipe.fingers} 3408 * @param {int} zoom The zoom/scale level the user pinched too, 0-1. 3409 * @param {object} fingerData The coordinates of fingers in event 3410 */ 3411 3412/** 3413 * A click handler triggered when a user simply clicks, rather than swipes on an element. 3414 * This is deprecated since version 1.6.2, any assignment to click will be assigned to the tap handler. 3415 * You cannot use <code>on</code> to bind to this event as the default jQ <code>click</code> event will be triggered. 3416 * Use the <code>tap</code> event instead. 3417 * @name $.fn.swipe#click 3418 * @event 3419 * @deprecated since version 1.6.2, please use {@link $.fn.swipe#tap} instead 3420 * @default null 3421 * @param {EventObject} event The original event object 3422 * @param {DomObject} target The element clicked on. 3423 */ 3424 3425 /** 3426 * A click / tap handler triggered when a user simply clicks or taps, rather than swipes on an element. 3427 * @name $.fn.swipe#tap 3428 * @event 3429 * @default null 3430 * @param {EventObject} event The original event object 3431 * @param {DomObject} target The element clicked on. 3432 */ 3433 3434/** 3435 * A double tap handler triggered when a user double clicks or taps on an element. 3436 * You can set the time delay for a double tap with the {@link $.fn.swipe.defaults#doubleTapThreshold} property. 3437 * Note: If you set both <code>doubleTap</code> and <code>tap</code> handlers, the <code>tap</code> event will be delayed by the <code>doubleTapThreshold</code> 3438 * as the script needs to check if its a double tap. 3439 * @name $.fn.swipe#doubleTap 3440 * @see $.fn.swipe.defaults#doubleTapThreshold 3441 * @event 3442 * @default null 3443 * @param {EventObject} event The original event object 3444 * @param {DomObject} target The element clicked on. 3445 */ 3446 3447 /** 3448 * A long tap handler triggered once a tap has been release if the tap was longer than the longTapThreshold. 3449 * You can set the time delay for a long tap with the {@link $.fn.swipe.defaults#longTapThreshold} property. 3450 * @name $.fn.swipe#longTap 3451 * @see $.fn.swipe.defaults#longTapThreshold 3452 * @event 3453 * @default null 3454 * @param {EventObject} event The original event object 3455 * @param {DomObject} target The element clicked on. 3456 */ 3457 3458 /** 3459 * A hold tap handler triggered as soon as the longTapThreshold is reached 3460 * You can set the time delay for a long tap with the {@link $.fn.swipe.defaults#longTapThreshold} property. 3461 * @name $.fn.swipe#hold 3462 * @see $.fn.swipe.defaults#longTapThreshold 3463 * @event 3464 * @default null 3465 * @param {EventObject} event The original event object 3466 * @param {DomObject} target The element clicked on. 3467 */ 3468 3469})); 3470 3471 3472// THEMEPUNCH INTERNAL HANDLINGS 3473if(typeof(console) === 'undefined') { 3474 var console = {}; 3475 console.log = console.error = console.info = console.debug = console.warn = console.trace = console.dir = console.dirxml = console.group = console.groupEnd = console.time = console.timeEnd = console.assert = console.profile = console.groupCollapsed = function() {}; 3476} 3477 3478// THEMEPUNCH LOGS 3479if (window.tplogs==true) 3480 try { 3481 console.groupCollapsed("ThemePunch GreenSocks Logs"); 3482 } catch(e) { } 3483 3484// SANDBOX GREENSOCK 3485var oldgs = window.GreenSockGlobals; 3486 oldgs_queue = window._gsQueue; 3487 3488var punchgs = window.GreenSockGlobals = {}; 3489 3490if (window.tplogs==true) 3491 try { 3492 console.info("Build GreenSock SandBox for ThemePunch Plugins"); 3493 console.info("GreenSock TweenLite Engine Initalised by ThemePunch Plugin"); 3494 } catch(e) {} 3495 3496/*! 3497 * VERSION: 1.18.0 3498 * DATE: 2015-09-03 3499 * UPDATES AND DOCS AT: http://greensock.com 3500 * 3501 * @license Copyright (c) 2008-2015, GreenSock. All rights reserved. 3502 * This work is subject to the terms at http://greensock.com/standard-license or for
3503 * Club GreenSock members, the software agreement that was issued with your membership. 3504 * 3505 * @author: Jack Doyle, [email protected] 3506 */ 3507(function(window, moduleName) { 3508 3509 "use strict"; 3510 var _globals = window.GreenSockGlobals = window.GreenSockGlobals || window; 3511 if (_globals.TweenLite) { 3512 return; //in case the core set of classes is already loaded, don't instantiate twice. 3513 } 3514 var _namespace = function(ns) { 3515 var a = ns.split("."), 3516 p = _globals, i; 3517 for (i = 0; i < a.length; i++) { 3518 p[a[i]] = p = p[a[i]] || {}; 3519 } 3520 return p; 3521 }, 3522 gs = _namespace("com.greensock"), 3523 _tinyNum = 0.0000000001, 3524 _slice = function(a) { //don't use Array.prototype.slice.call(target, 0) because that doesn't work in IE8 with a NodeList that's returned by querySelectorAll() 3525 var b = [], 3526 l = a.length, 3527 i; 3528 for (i = 0; i !== l; b.push(a[i++])) {} 3529 return b; 3530 }, 3531 _emptyFunc = function() {}, 3532 _isArray = (function() { //works around issues in iframe environments where the Array global isn't shared, thus if the object originates in a different window/iframe, "(obj instanceof Array)" will evaluate false. We added some speed optimizations to avoid Object.prototype.toString.call() unless it's absolutely necessary because it's VERY slow (like 20x slower) 3533 var toString = Object.prototype.toString, 3534 array = toString.call([]); 3535 return function(obj) { 3536 return obj != null && (obj instanceof Array || (typeof(obj) === "object" && !!obj.push && toString.call(obj) === array)); 3537 }; 3538 }()), 3539 a, i, p, _ticker, _tickerActive, 3540 _defLookup = {}, 3541 3542 /** 3543 * @constructor 3544 * Defines a GreenSock class, optionally with an array of dependencies that must be instantiated first and passed into the definition. 3545 * This allows users to load GreenSock JS files in any order even if they have interdependencies (like CSSPlugin extends TweenPlugin which is 3546 * inside TweenLite.js, but if CSSPlugin is loaded first, it should wait to run its code until TweenLite.js loads and instantiates TweenPlugin 3547 * and then pass TweenPlugin to CSSPlugin's definition). This is all done automatically and internally. 3548 * 3549 * Every definition will be added to a "com.greensock" global object (typically window, but if a window.GreenSockGlobals object is found, 3550 * it will go there as of v1.7). For example, TweenLite will be found at window.com.greensock.TweenLite and since it's a global class that should be available anywhere, 3551 * it is ALSO referenced at window.TweenLite. However some classes aren't considered global, like the base com.greensock.core.Animation class, so 3552 * those will only be at the package like window.com.greensock.core.Animation. Again, if you define a GreenSockGlobals object on the window, everything 3553 * gets tucked neatly inside there instead of on the window directly. This allows you to do advanced things like load multiple versions of GreenSock 3554 * files and put them into distinct objects (imagine a banner ad uses a newer version but the main site uses an older one). In that case, you could 3555 * sandbox the banner one like: 3556 * 3557 * <script> 3558 * var gs = window.GreenSockGlobals = {}; //the newer version we're about to load could now be referenced in a "gs" object, like gs.TweenLite.to(...). Use whatever alias you want as long as it's unique, "gs" or "banner" or whatever. 3559 * </script> 3560 * <script src="js/greensock/v1.7/TweenMax.js"></script> 3561 * <script> 3562 * window.GreenSockGlobals = window._gsQueue = window._gsDefine = null; //reset it back to null (along with the special _gsQueue variable) so that the next load of TweenMax affects the window and we can reference things directly like TweenLite.to(...) 3563 * </script> 3564 * <script src="js/greensock/v1.6/TweenMax.js"></script> 3565 * <script> 3566 * gs.TweenLite.to(...); //would use v1.7 3567 * TweenLite.to(...); //would use v1.6 3568 * </script> 3569 * 3570 * @param {!string} ns The namespace of the class definition, leaving off "com.greensock." as that's assumed. For example, "TweenLite" or "plugins.CSSPlugin" or "easing.Back". 3571 * @param {!Array.<string>}
3571 dependencies An array of dependencies (described as their namespaces minus "com.greensock." prefix). For example ["TweenLite","plugins.TweenPlugin","core.Animation"] 3572 * @param {!function():Object} func The function that should be called and passed the resolved dependencies which will return the actual class for this definition. 3573 * @param {boolean=} global If true, the class will be added to the global scope (typically window unless you define a window.GreenSockGlobals object) 3574 */ 3575 Definition = function(ns, dependencies, func, global) { 3576 this.sc = (_defLookup[ns]) ? _defLookup[ns].sc : []; //subclasses 3577 _defLookup[ns] = this; 3578 this.gsClass = null; 3579 this.func = func; 3580 var _classes = []; 3581 this.check = function(init) { 3582 var i = dependencies.length, 3583 missing = i, 3584 cur, a, n, cl, hasModule; 3585 while (--i > -1) { 3586 if ((cur = _defLookup[dependencies[i]] || new Definition(dependencies[i], [])).gsClass) { 3587 _classes[i] = cur.gsClass; 3588 missing--; 3589 } else if (init) { 3590 cur.sc.push(this); 3591 } 3592 } 3593 if (missing === 0 && func) { 3594 a = ("com.greensock." + ns).split("."); 3595 n = a.pop(); 3596 cl = _namespace(a.join("."))[n] = this.gsClass = func.apply(func, _classes); 3597 3598 //exports to multiple environments 3599 if (global) { 3600 _globals[n] = cl; //provides a way to avoid global namespace pollution. By default, the main classes like TweenLite, Power1, Strong, etc. are added to window unless a GreenSockGlobals is defined. So if you want to have things added to a custom object instead, just do something like window.GreenSockGlobals = {} before loading any GreenSock files. You can even set up an alias like window.GreenSockGlobals = windows.gs = {} so that you can access everything like gs.TweenLite. Also remember that ALL classes are added to the window.com.greensock object (in their respective packages, like com.greensock.easing.Power1, com.greensock.TweenLite, etc.) 3601 hasModule = (typeof(module) !== "undefined" && module.exports); 3602 if (!hasModule && typeof(define) === "function" && define.amd){ //AMD 3603 define((window.GreenSockAMDPath ? window.GreenSockAMDPath + "/" : "") + ns.split(".").pop(), [], function() { return cl; }); 3604 } else if (ns === moduleName && hasModule){ //node 3605 module.exports = cl; 3606 } 3607 } 3608 for (i = 0; i < this.sc.length; i++) { 3609 this.sc[i].check(); 3610 } 3611 } 3612 }; 3613 this.check(true); 3614 }, 3615 3616 //used to create Definition instances (which basically registers a class that has dependencies). 3617 _gsDefine = window._gsDefine = function(ns, dependencies, func, global) { 3618 return new Definition(ns, dependencies, func, global); 3619 }, 3620 3621 //a quick way to create a class that doesn't have any dependencies. Returns the class, but first registers it in the GreenSock namespace so that other classes can grab it (other classes might be dependent on the class). 3622 _class = gs._class = function(ns, func, global) { 3623 func = func || function() {}; 3624 _gsDefine(ns, [], function(){ return func; }, global); 3625 return func; 3626 }; 3627 3628 _gsDefine.globals = _globals; 3629 3630 3631 3632/* 3633 * ---------------------------------------------------------------- 3634 * Ease 3635 * ---------------------------------------------------------------- 3636 */ 3637 var _baseParams = [0, 0, 1, 1], 3638 _blankArray = [], 3639 Ease = _class("easing.Ease", function(func, extraParams, type, power) { 3640 this._func = func; 3641 this._type = type || 0; 3642 this._power = power || 0; 3643 this._params = extraParams ? _baseParams.concat(extraParams) : _baseParams; 3644 }, true), 3645 _easeMap = Ease.map = {}, 3646 _easeReg = Ease.register = function(ease, names, types, create) { 3647 var na = names.split(","), 3648 i = na.length, 3649 ta = (types || "easeIn,easeOut,easeInOut").split(","), 3650 e, name, j, type; 3651 while (--i > -1) { 3652 name = na[i]; 3653 e = create ? _class("easing."+name, null, true) : gs.easing[name] || {}; 3654 j = ta.length; 3655 while (--j > -1) { 3656 type = ta[j]; 3657 _easeMap[name + "." + type] = _easeMap[type + name] = e[type] = ease.getRatio ? ease : ease[type] || new ease(); 3658 } 3659 } 3660 }; 3661 3662 p = Ease.prototype; 3663 p._calcEnd = false; 3664 p.getRatio = function(p) { 3665 if (this._func) { 3666 this._params[0] = p; 3667 return this._func.apply(null, this._params); 3668 } 3669 var t = this._type, 3670 pw = this._power,
3671 r = (t === 1) ? 1 - p : (t === 2) ? p : (p < 0.5) ? p * 2 : (1 - p) * 2; 3672 if (pw === 1) { 3673 r *= r; 3674 } else if (pw === 2) { 3675 r *= r * r; 3676 } else if (pw === 3) { 3677 r *= r * r * r; 3678 } else if (pw === 4) { 3679 r *= r * r * r * r; 3680 } 3681 return (t === 1) ? 1 - r : (t === 2) ? r : (p < 0.5) ? r / 2 : 1 - (r / 2); 3682 }; 3683 3684 //create all the standard eases like Linear, Quad, Cubic, Quart, Quint, Strong, Power0, Power1, Power2, Power3, and Power4 (each with easeIn, easeOut, and easeInOut) 3685 a = ["Linear","Quad","Cubic","Quart","Quint,Strong"]; 3686 i = a.length; 3687 while (--i > -1) { 3688 p = a[i]+",Power"+i; 3689 _easeReg(new Ease(null,null,1,i), p, "easeOut", true); 3690 _easeReg(new Ease(null,null,2,i), p, "easeIn" + ((i === 0) ? ",easeNone" : "")); 3691 _easeReg(new Ease(null,null,3,i), p, "easeInOut"); 3692 } 3693 _easeMap.linear = gs.easing.Linear.easeIn; 3694 _easeMap.swing = gs.easing.Quad.easeInOut; //for jQuery folks 3695 3696 3697/* 3698 * ---------------------------------------------------------------- 3699 * EventDispatcher 3700 * ---------------------------------------------------------------- 3701 */ 3702 var EventDispatcher = _class("events.EventDispatcher", function(target) { 3703 this._listeners = {}; 3704 this._eventTarget = target || this; 3705 }); 3706 p = EventDispatcher.prototype; 3707 3708 p.addEventListener = function(type, callback, scope, useParam, priority) { 3709 priority = priority || 0; 3710 var list = this._listeners[type], 3711 index = 0, 3712 listener, i; 3713 if (list == null) { 3714 this._listeners[type] = list = []; 3715 } 3716 i = list.length; 3717 while (--i > -1) { 3718 listener = list[i]; 3719 if (listener.c === callback && listener.s === scope) { 3720 list.splice(i, 1); 3721 } else if (index === 0 && listener.pr < priority) { 3722 index = i + 1; 3723 } 3724 } 3725 list.splice(index, 0, {c:callback, s:scope, up:useParam, pr:priority}); 3726 if (this === _ticker && !_tickerActive) { 3727 _ticker.wake(); 3728 } 3729 }; 3730 3731 p.removeEventListener = function(type, callback) { 3732 var list = this._listeners[type], i; 3733 if (list) { 3734 i = list.length; 3735 while (--i > -1) { 3736 if (list[i].c === callback) { 3737 list.splice(i, 1); 3738 return; 3739 } 3740 } 3741 } 3742 }; 3743 3744 p.dispatchEvent = function(type) { 3745 var list = this._listeners[type], 3746 i, t, listener; 3747 if (list) { 3748 i = list.length; 3749 t = this._eventTarget; 3750 while (--i > -1) { 3751 listener = list[i]; 3752 if (listener) { 3753 if (listener.up) { 3754 listener.c.call(listener.s || t, {type:type, target:t}); 3755 } else { 3756 listener.c.call(listener.s || t); 3757 } 3758 } 3759 } 3760 } 3761 }; 3762 3763 3764/* 3765 * ---------------------------------------------------------------- 3766 * Ticker 3767 * ---------------------------------------------------------------- 3768 */ 3769 var _reqAnimFrame = window.requestAnimationFrame, 3770 _cancelAnimFrame = window.cancelAnimationFrame, 3771 _getTime = Date.now || function() {return new Date().getTime();}, 3772 _lastUpdate = _getTime(); 3773 3774 //now try to determine the requestAnimationFrame and cancelAnimationFrame functions and if none are found, we'll use a setTimeout()/clearTimeout() polyfill. 3775 a = ["ms","moz","webkit","o"]; 3776 i = a.length; 3777 while (--i > -1 && !_reqAnimFrame) { 3778 _reqAnimFrame = window[a[i] + "RequestAnimationFrame"]; 3779 _cancelAnimFrame = window[a[i] + "CancelAnimationFrame"] || window[a[i] + "CancelRequestAnimationFrame"]; 3780 } 3781 3782 _class("Ticker", function(fps, useRAF) { 3783 var _self = this, 3784 _startTime = _getTime(), 3785 _useRAF = (useRAF !== false && _reqAnimFrame), 3786 _lagThreshold = 500, 3787 _adjustedLag = 33, 3788 _tickWord = "tick", //helps reduce gc burden 3789 _fps, _req, _id, _gap, _nextTime, 3790 _tick = function(manual) { 3791 var elapsed = _getTime() - _lastUpdate, 3792 overlap, dispatch; 3793 if (elapsed > _lagThreshold) { 3794 _startTime += elapsed - _adjustedLag; 3795 } 3796 _lastUpdate += elapsed; 3797 _self.time = (_lastUpdate - _startTime) / 1000; 3798 overlap = _self.time - _nextTime; 3799 if (!_fps || overlap > 0 || manual === true) { 3800 _self.frame++; 3801 _nextTime += overlap + (overlap >= _gap ? 0.004 : _gap - overlap); 3802 dispatch = true; 3803 } 3804 if (manual !== true) { //make sure the request is made before we dispatch the "tick" event so that timing is maintained. Otherwise, if processing the "tick" requires a bunch of time (like 15ms) and we're using a setTimeout() that's based on 16.7ms, it'd technically take 31.7ms between frames otherwise. 3805 _id = _req(_tick); 3806 }
3807 if (dispatch) { 3808 _self.dispatchEvent(_tickWord); 3809 } 3810 }; 3811 3812 EventDispatcher.call(_self); 3813 _self.time = _self.frame = 0; 3814 _self.tick = function() { 3815 _tick(true); 3816 }; 3817 3818 _self.lagSmoothing = function(threshold, adjustedLag) { 3819 _lagThreshold = threshold || (1 / _tinyNum); //zero should be interpreted as basically unlimited 3820 _adjustedLag = Math.min(adjustedLag, _lagThreshold, 0); 3821 }; 3822 3823 _self.sleep = function() { 3824 if (_id == null) { 3825 return; 3826 } 3827 if (!_useRAF || !_cancelAnimFrame) { 3828 clearTimeout(_id); 3829 } else { 3830 _cancelAnimFrame(_id); 3831 } 3832 _req = _emptyFunc; 3833 _id = null; 3834 if (_self === _ticker) { 3835 _tickerActive = false; 3836 } 3837 }; 3838 3839 _self.wake = function() { 3840 if (_id !== null) { 3841 _self.sleep(); 3842 } else if (_self.frame > 10) { //don't trigger lagSmoothing if we're just waking up, and make sure that at least 10 frames have elapsed because of the iOS bug that we work around below with the 1.5-second setTimout(). 3843 _lastUpdate = _getTime() - _lagThreshold + 5; 3844 } 3845 _req = (_fps === 0) ? _emptyFunc : (!_useRAF || !_reqAnimFrame) ? function(f) { return setTimeout(f, ((_nextTime - _self.time) * 1000 + 1) | 0); } : _reqAnimFrame; 3846 if (_self === _ticker) { 3847 _tickerActive = true; 3848 } 3849 _tick(2); 3850 }; 3851 3852 _self.fps = function(value) { 3853 if (!arguments.length) { 3854 return _fps; 3855 } 3856 _fps = value; 3857 _gap = 1 / (_fps || 60); 3858 _nextTime = this.time + _gap; 3859 _self.wake(); 3860 }; 3861 3862 _self.useRAF = function(value) { 3863 if (!arguments.length) { 3864 return _useRAF; 3865 } 3866 _self.sleep(); 3867 _useRAF = value; 3868 _self.fps(_fps); 3869 }; 3870 _self.fps(fps); 3871 3872 //a bug in iOS 6 Safari occasionally prevents the requestAnimationFrame from working initially, so we use a 1.5-second timeout that automatically falls back to setTimeout() if it senses this condition. 3873 setTimeout(function() { 3874 if (_useRAF && _self.frame < 5) { 3875 _self.useRAF(false); 3876 } 3877 }, 1500); 3878 }); 3879 3880 p = gs.Ticker.prototype = new gs.events.EventDispatcher(); 3881 p.constructor = gs.Ticker; 3882 3883 3884/* 3885 * ---------------------------------------------------------------- 3886 * Animation 3887 * ---------------------------------------------------------------- 3888 */ 3889 var Animation = _class("core.Animation", function(duration, vars) { 3890 this.vars = vars = vars || {}; 3891 this._duration = this._totalDuration = duration || 0; 3892 this._delay = Number(vars.delay) || 0; 3893 this._timeScale = 1; 3894 this._active = (vars.immediateRender === true); 3895 this.data = vars.data; 3896 this._reversed = (vars.reversed === true); 3897 3898 if (!_rootTimeline) { 3899 return; 3900 } 3901 if (!_tickerActive) { //some browsers (like iOS 6 Safari) shut down JavaScript execution when the tab is disabled and they [occasionally] neglect to start up requestAnimationFrame again when returning - this code ensures that the engine starts up again properly. 3902 _ticker.wake(); 3903 } 3904 3905 var tl = this.vars.useFrames ? _rootFramesTimeline : _rootTimeline; 3906 tl.add(this, tl._time); 3907 3908 if (this.vars.paused) { 3909 this.paused(true); 3910 } 3911 }); 3912 3913 _ticker = Animation.ticker = new gs.Ticker(); 3914 p = Animation.prototype; 3915 p._dirty = p._gc = p._initted = p._paused = false; 3916 p._totalTime = p._time = 0; 3917 p._rawPrevTime = -1; 3918 p._next = p._last = p._onUpdate = p._timeline = p.timeline = null; 3919 p._paused = false; 3920 3921 3922 //some browsers (like iOS) occasionally drop the requestAnimationFrame event when the user switches to a different tab and then comes back again, so we use a 2-second setTimeout() to sense if/when that condition occurs and then wake() the ticker. 3923 var _checkTimeout = function() { 3924 if (_tickerActive && _getTime() - _lastUpdate > 2000) { 3925 _ticker.wake(); 3926 } 3927 setTimeout(_checkTimeout, 2000); 3928 }; 3929 _checkTimeout(); 3930 3931 3932 p.play = function(from, suppressEvents) { 3933 if (from != null) { 3934 this.seek(from, suppressEvents); 3935 } 3936 return this.reversed(false).paused(false); 3937 }; 3938 3939 p.pause = function(atTime, suppressEvents) { 3940 if (atTime != null) { 3941 this.seek(atTime, suppressEvents); 3942 } 3943 return this.paused(true); 3944 }; 3945 3946 p.resume = function(from, suppressEvents) { 3947 if (from != null) { 3948 this.seek(from, suppressEvents); 3949 } 3950 return this.paused(false); 3951 }; 3952 3953 p.seek = function(time, suppressEvents) { 3954 return this.totalTime(Number(time), suppressEvents !== false); 3955 }; 3956 3957 p.restart = function(includeDelay, suppressEvents) { 3958 return this.reversed(false).paused(false).totalTime(includeDelay ? -this._delay : 0, (suppressEvents !== false), true); 3959 }; 3960 3961 p.reverse = function(from, suppressEvents) { 3962 if (from != null) { 3963 this.seek((from || this.totalDuration()), suppressEvents); 3964 } 3965 return this.reversed(true).paused(false); 3966 }; 3967 3968 p.render = function(time, suppressEvents, force) { 3969 //stub - we override this method in subclasses. 3970 }; 3971 3972 p.invalidate = function() { 3973 this._time = this._totalTime = 0; 3974 this._initted = this._gc = false; 3975 this._rawPrevTime = -1; 3976 if (this._gc || !this.timeline) { 3977 this._enabled(true); 3978 } 3979 return this; 3980 }; 3981 3982 p.isActive = function() { 3983 var tl = this._timeline, //the 2 root timelines won't have a _timeline; they're always active. 3984 startTime = this._startTime, 3985 rawTime; 3986 return (!tl || (!this._gc && !this._paused && tl.isActive() && (rawTime = tl.rawTime()) >= startTime && rawTime < startTime + this.totalDuration() / this._timeScale)); 3987 }; 3988 3989 p._enabled = function (enabled, ignoreTimeline) { 3990 if (!_tickerActive) { 3991 _ticker.wake(); 3992 } 3993 this._gc = !enabled; 3994 this._active = this.isActive(); 3995 if (ignoreTimeline !== true) { 3996 if (enabled && !this.timeline) { 3997 this._timeline.add(this, this._startTime - this._delay); 3998 } else if (!enabled && this.timeline) { 3999 this._timeline._remove(this, true); 4000 } 4001 } 4002 return false; 4003 }; 4004 4005 4006 p._kill = function(vars, target) { 4007 return this._enabled(false, false); 4008 }; 4009 4010 p.kill = function(vars, target) { 4011 this._kill(vars, target); 4012 return this; 4013 }; 4014 4015 p._uncache = function(includeSelf) { 4016 var tween = includeSelf ? this : this.timeline; 4017 while (tween) { 4018 tween._dirty = true; 4019 tween = tween.timeline; 4020 } 4021 return this; 4022 }; 4023 4024 p._swapSelfInParams = function(params) { 4025 var i = params.length, 4026 copy = params.concat(); 4027 while (--i > -1) { 4028 if (params[i] === "{self}") { 4029 copy[i] = this; 4030 } 4031 } 4032 return copy; 4033 }; 4034 4035 p._callback = function(type) { 4036 var v = this.vars; 4037 v[type].apply(v[type + "Scope"] || v.callbackScope || this, v[type + "Params"] || _blankArray);
4038 }; 4039 4040//----Animation getters/setters -------------------------------------------------------- 4041 4042 p.eventCallback = function(type, callback, params, scope) { 4043 if ((type || "").substr(0,2) === "on") { 4044 var v = this.vars; 4045 if (arguments.length === 1) { 4046 return v[type]; 4047 } 4048 if (callback == null) { 4049 delete v[type]; 4050 } else { 4051 v[type] = callback; 4052 v[type + "Params"] = (_isArray(params) && params.join("").indexOf("{self}") !== -1) ? this._swapSelfInParams(params) : params; 4053 v[type + "Scope"] = scope; 4054 } 4055 if (type === "onUpdate") { 4056 this._onUpdate = callback; 4057 } 4058 } 4059 return this; 4060 }; 4061 4062 p.delay = function(value) { 4063 if (!arguments.length) { 4064 return this._delay; 4065 } 4066 if (this._timeline.smoothChildTiming) { 4067 this.startTime( this._startTime + value - this._delay ); 4068 } 4069 this._delay = value; 4070 return this; 4071 }; 4072 4073 p.duration = function(value) { 4074 if (!arguments.length) { 4075 this._dirty = false; 4076 return this._duration; 4077 } 4078 this._duration = this._totalDuration = value; 4079 this._uncache(true); //true in case it's a TweenMax or TimelineMax that has a repeat - we'll need to refresh the totalDuration. 4080 if (this._timeline.smoothChildTiming) if (this._time > 0) if (this._time < this._duration) if (value !== 0) { 4081 this.totalTime(this._totalTime * (value / this._duration), true); 4082 } 4083 return this; 4084 }; 4085 4086 p.totalDuration = function(value) { 4087 this._dirty = false; 4088 return (!arguments.length) ? this._totalDuration : this.duration(value); 4089 }; 4090 4091 p.time = function(value, suppressEvents) { 4092 if (!arguments.length) { 4093 return this._time; 4094 } 4095 if (this._dirty) { 4096 this.totalDuration(); 4097 } 4098 return this.totalTime((value > this._duration) ? this._duration : value, suppressEvents); 4099 }; 4100 4101 p.totalTime = function(time, suppressEvents, uncapped) { 4102 if (!_tickerActive) { 4103 _ticker.wake(); 4104 } 4105 if (!arguments.length) { 4106 return this._totalTime; 4107 } 4108 if (this._timeline) { 4109 if (time < 0 && !uncapped) { 4110 time += this.totalDuration(); 4111 } 4112 if (this._timeline.smoothChildTiming) { 4113 if (this._dirty) { 4114 this.totalDuration(); 4115 } 4116 var totalDuration = this._totalDuration, 4117 tl = this._timeline; 4118 if (time > totalDuration && !uncapped) { 4119 time = totalDuration; 4120 } 4121 this._startTime = (this._paused ? this._pauseTime : tl._time) - ((!this._reversed ? time : totalDuration - time) / this._timeScale); 4122 if (!tl._dirty) { //for performance improvement. If the parent's cache is already dirty, it already took care of marking the ancestors as dirty too, so skip the function call here. 4123 this._uncache(false); 4124 } 4125 //in case any of the ancestor timelines had completed but should now be enabled, we should reset their totalTime() which will also ensure that they're lined up properly and enabled. Skip for animations that are on the root (wasteful). Example: a TimelineLite.exportRoot() is performed when there's a paused tween on the root, the export will not complete until that tween is unpaused, but imagine a child gets restarted later, after all [unpaused] tweens have completed. The startTime of that child would get pushed out, but one of the ancestors may have completed. 4126 if (tl._timeline) { 4127 while (tl._timeline) { 4128 if (tl._timeline._time !== (tl._startTime + tl._totalTime) / tl._timeScale) { 4129 tl.totalTime(tl._totalTime, true); 4130 } 4131 tl = tl._timeline; 4132 } 4133 } 4134 } 4135 if (this._gc) { 4136 this._enabled(true, false); 4137 } 4138 if (this._totalTime !== time || this._duration === 0) { 4139 if (_lazyTweens.length) { 4140 _lazyRender(); 4141 } 4142 this.render(time, suppressEvents, false); 4143 if (_lazyTweens.length) { //in case rendering caused any tweens to lazy-init, we should render them because typically when someone calls seek() or time() or progress(), they expect an immediate render. 4144 _lazyRender(); 4145 } 4146 } 4147 } 4148 return this; 4149 }; 4150 4151 p.progress = p.totalProgress = function(value, suppressEvents) { 4152 var duration = this.duration(); 4153 return (!arguments.length) ? (duration ? this._time / duration : this.ratio) : this.totalTime(duration * value, suppressEvents); 4154 }; 4155 4156 p.startTime = function(value) { 4157 if (!arguments.length) { 4158 return this._startTime; 4159 } 4160 if (value !== this._startTime) { 4161 this._startTime = value; 4162 if (this.timeline) if (this.timeline._sortChildren) { 4163 this.timeline.add(this, value - this._delay); //ensures that any necessary re-sequencing of Animations in the timeline occurs to make sure the rendering order is correct. 4164 } 4165 } 4166 return this; 4167 }; 4168 4169 p.endTime = function(includeRepeats) { 4170 return this._startTime + ((includeRepeats != false) ? this.totalDuration() : this.duration()) / this._timeScale; 4171 }; 4172 4173 p.timeScale = function(value) { 4174 if (!arguments.length) { 4175 return this._timeScale; 4176 } 4177 value = value || _tinyNum; //can't allow zero because it'll throw the math off
4178 if (this._timeline && this._timeline.smoothChildTiming) { 4179 var pauseTime = this._pauseTime, 4180 t = (pauseTime || pauseTime === 0) ? pauseTime : this._timeline.totalTime(); 4181 this._startTime = t - ((t - this._startTime) * this._timeScale / value); 4182 } 4183 this._timeScale = value; 4184 return this._uncache(false); 4185 }; 4186 4187 p.reversed = function(value) { 4188 if (!arguments.length) { 4189 return this._reversed; 4190 } 4191 if (value != this._reversed) { 4192 this._reversed = value; 4193 this.totalTime(((this._timeline && !this._timeline.smoothChildTiming) ? this.totalDuration() - this._totalTime : this._totalTime), true); 4194 } 4195 return this; 4196 }; 4197 4198 p.paused = function(value) { 4199 if (!arguments.length) { 4200 return this._paused; 4201 } 4202 var tl = this._timeline, 4203 raw, elapsed; 4204 if (value != this._paused) if (tl) { 4205 if (!_tickerActive && !value) { 4206 _ticker.wake(); 4207 } 4208 raw = tl.rawTime(); 4209 elapsed = raw - this._pauseTime; 4210 if (!value && tl.smoothChildTiming) { 4211 this._startTime += elapsed; 4212 this._uncache(false); 4213 } 4214 this._pauseTime = value ? raw : null; 4215 this._paused = value; 4216 this._active = this.isActive(); 4217 if (!value && elapsed !== 0 && this._initted && this.duration()) { 4218 raw = tl.smoothChildTiming ? this._totalTime : (raw - this._startTime) / this._timeScale; 4219 this.render(raw, (raw === this._totalTime), true); //in case the target's properties changed via some other tween or manual update by the user, we should force a render. 4220 } 4221 } 4222 if (this._gc && !value) { 4223 this._enabled(true, false); 4224 } 4225 return this; 4226 }; 4227 4228 4229/* 4230 * ---------------------------------------------------------------- 4231 * SimpleTimeline 4232 * ---------------------------------------------------------------- 4233 */ 4234 var SimpleTimeline = _class("core.SimpleTimeline", function(vars) { 4235 Animation.call(this, 0, vars); 4236 this.autoRemoveChildren = this.smoothChildTiming = true; 4237 }); 4238 4239 p = SimpleTimeline.prototype = new Animation(); 4240 p.constructor = SimpleTimeline; 4241 p.kill()._gc = false; 4242 p._first = p._last = p._recent = null; 4243 p._sortChildren = false; 4244 4245 p.add = p.insert = function(child, position, align, stagger) { 4246 var prevTween, st; 4247 child._startTime = Number(position || 0) + child._delay; 4248 if (child._paused) if (this !== child._timeline) { //we only adjust the _pauseTime if it wasn't in this timeline already. Remember, sometimes a tween will be inserted again into the same timeline when its startTime is changed so that the tweens in the TimelineLite/Max are re-ordered properly in the linked list (so everything renders in the proper order). 4249 child._pauseTime = child._startTime + ((this.rawTime() - child._startTime) / child._timeScale); 4250 } 4251 if (child.timeline) { 4252 child.timeline._remove(child, true); //removes from existing timeline so that it can be properly added to this one. 4253 } 4254 child.timeline = child._timeline = this; 4255 if (child._gc) { 4256 child._enabled(true, true); 4257 } 4258 prevTween = this._last; 4259 if (this._sortChildren) { 4260 st = child._startTime; 4261 while (prevTween && prevTween._startTime > st) { 4262 prevTween = prevTween._prev; 4263 } 4264 } 4265 if (prevTween) { 4266 child._next = prevTween._next; 4267 prevTween._next = child; 4268 } else { 4269 child._next = this._first; 4270 this._first = child; 4271 } 4272 if (child._next) { 4273 child._next._prev = child; 4274 } else { 4275 this._last = child; 4276 } 4277 child._prev = prevTween; 4278 this._recent = child; 4279 if (this._timeline) { 4280 this._uncache(true); 4281 } 4282 return this; 4283 }; 4284 4285 p._remove = function(tween, skipDisable) { 4286 if (tween.timeline === this) { 4287 if (!skipDisable) { 4288 tween._enabled(false, true); 4289 } 4290 4291 if (tween._prev) { 4292 tween._prev._next = tween._next; 4293 } else if (this._first === tween) { 4294 this._first = tween._next; 4295 } 4296 if (tween._next) { 4297 tween._next._prev = tween._prev; 4298 } else if (this._last === tween) { 4299 this._last = tween._prev; 4300 } 4301 tween._next = tween._prev = tween.timeline = null; 4302 if (tween === this._recent) { 4303 this._recent = this._last; 4304 } 4305 4306 if (this._timeline) { 4307 this._uncache(true); 4308 } 4309 } 4310 return this; 4311 }; 4312 4313 p.render = function(time, suppressEvents, force) { 4314 var tween = this._first, 4315 next; 4316 this._totalTime = this._time = this._rawPrevTime = time; 4317 while (tween) { 4318 next = tween._next; //record it here because the value could change after rendering... 4319 if (tween._active || (time >= tween._startTime && !tween._paused)) { 4320 if (!tween._reversed) { 4321 tween.render((time - tween._startTime) * tween._timeScale, suppressEvents, force); 4322 } else { 4323 tween.render(((!tween._dirty) ? tween._totalDuration : tween.totalDuration()) - ((time - tween._startTime) * tween._timeScale), suppressEvents, force); 4324 } 4325 } 4326 tween = next; 4327 } 4328 }; 4329 4330 p.rawTime = function() { 4331 if (!_tickerActive) { 4332 _ticker.wake(); 4333 } 4334 return this._totalTime; 4335 }; 4336 4337/* 4338 * ---------------------------------------------------------------- 4339 * TweenLite 4340 * ---------------------------------------------------------------- 4341 */ 4342 var TweenLite = _class("TweenLite", function(target, duration, vars) { 4343 Animation.call(this, duration, vars); 4344 this.render = TweenLite.prototype.render; //speed optimization (avoid prototype lookup on this "hot" method) 4345 4346 if (target == null) { 4347 throw "Cannot tween a null target."; 4348 } 4349 4350 this.target = target = (typeof(target) !== "string") ? target : TweenLite.selector(target) || target; 4351 4352 var isSelector = (target.jquery || (target.length && target !== window && target[0] && (target[0] === window || (target[0].nodeType && target[0].style && !target.nodeType)))),
4353 overwrite = this.vars.overwrite, 4354 i, targ, targets; 4355 4356 this._overwrite = overwrite = (overwrite == null) ? _overwriteLookup[TweenLite.defaultOverwrite] : (typeof(overwrite) === "number") ? overwrite >> 0 : _overwriteLookup[overwrite]; 4357 4358 if ((isSelector || target instanceof Array || (target.push && _isArray(target))) && typeof(target[0]) !== "number") { 4359 this._targets = targets = _slice(target); //don't use Array.prototype.slice.call(target, 0) because that doesn't work in IE8 with a NodeList that's returned by querySelectorAll() 4360 this._propLookup = []; 4361 this._siblings = []; 4362 for (i = 0; i < targets.length; i++) { 4363 targ = targets[i]; 4364 if (!targ) { 4365 targets.splice(i--, 1); 4366 continue; 4367 } else if (typeof(targ) === "string") { 4368 targ = targets[i--] = TweenLite.selector(targ); //in case it's an array of strings 4369 if (typeof(targ) === "string") { 4370 targets.splice(i+1, 1); //to avoid an endless loop (can't imagine why the selector would return a string, but just in case) 4371 } 4372 continue; 4373 } else if (targ.length && targ !== window && targ[0] && (targ[0] === window || (targ[0].nodeType && targ[0].style && !targ.nodeType))) { //in case the user is passing in an array of selector objects (like jQuery objects), we need to check one more level and pull things out if necessary. Also note that <select> elements pass all the criteria regarding length and the first child having style, so we must also check to ensure the target isn't an HTML node itself. 4374 targets.splice(i--, 1); 4375 this._targets = targets = targets.concat(_slice(targ)); 4376 continue; 4377 } 4378 this._siblings[i] = _register(targ, this, false); 4379 if (overwrite === 1) if (this._siblings[i].length > 1) { 4380 _applyOverwrite(targ, this, null, 1, this._siblings[i]); 4381 } 4382 } 4383 4384 } else { 4385 this._propLookup = {}; 4386 this._siblings = _register(target, this, false); 4387 if (overwrite === 1) if (this._siblings.length > 1) { 4388 _applyOverwrite(target, this, null, 1, this._siblings); 4389 } 4390 } 4391 if (this.vars.immediateRender || (duration === 0 && this._delay === 0 && this.vars.immediateRender !== false)) { 4392 this._time = -_tinyNum; //forces a render without having to set the render() "force" parameter to true because we want to allow lazying by default (using the "force" parameter always forces an immediate full render) 4393 this.render(-this._delay); 4394 } 4395 }, true), 4396 _isSelector = function(v) { 4397 return (v && v.length && v !== window && v[0] && (v[0] === window || (v[0].nodeType && v[0].style && !v.nodeType))); //we cannot check "nodeType" if the target is window from within an iframe, otherwise it will trigger a security error in some browsers like Firefox. 4398 }, 4399 _autoCSS = function(vars, target) { 4400 var css = {}, 4401 p; 4402 for (p in vars) { 4403 if (!_reservedProps[p] && (!(p in target) || p === "transform" || p === "x" || p === "y" || p === "width" || p === "height" || p === "className" || p === "border") && (!_plugins[p] || (_plugins[p] && _plugins[p]._autoCSS))) { //note: <img> elements contain read-only "x" and "y" properties. We should also prioritize editing css width/height rather than the element's properties. 4404 css[p] = vars[p]; 4405 delete vars[p]; 4406 } 4407 } 4408 vars.css = css; 4409 }; 4410 4411 p = TweenLite.prototype = new Animation(); 4412 p.constructor = TweenLite; 4413 p.kill()._gc = false; 4414 4415//----TweenLite defaults, overwrite management, and root updates ---------------------------------------------------- 4416 4417 p.ratio = 0; 4418 p._firstPT = p._targets = p._overwrittenProps = p._startAt = null; 4419 p._notifyPluginsOfEnabled = p._lazy = false; 4420 4421 TweenLite.version = "1.18.0"; 4422 TweenLite.defaultEase = p._ease = new Ease(null, null, 1, 1); 4423 TweenLite.defaultOverwrite = "auto"; 4424 TweenLite.ticker = _ticker; 4425 TweenLite.autoSleep = 120; 4426 TweenLite.lagSmoothing = function(threshold, adjustedLag) { 4427 _ticker.lagSmoothing(threshold, adjustedLag); 4428 }; 4429 4430 TweenLite.selector = window.$ || window.jQuery || function(e) { 4431 var selector = window.$ || window.jQuery; 4432 if (selector) { 4433 TweenLite.selector = selector; 4434 return selector(e); 4435 } 4436 return (typeof(document) === "undefined") ? e : (document.querySelectorAll ? document.querySelectorAll(e) : document.getElementById((e.charAt(0) === "#") ? e.substr(1) : e)); 4437 }; 4438 4439 var _lazyTweens = [], 4440 _lazyLookup = {}, 4441 _numbersExp = /(?:(-|-=|\+=)?\d*\.?\d*(?:e[\-+]?\d+)?)[0-9]/ig, 4442 //_nonNumbersExp = /(?:([\-+](?!(\d|=)))|[^\d\-+=e]|(e(?![\-+][\d])))+/ig, 4443 _setRatio = function(v) { 4444 var pt = this._firstPT, 4445 min = 0.000001, 4446 val; 4447 while (pt) { 4448 val = !pt.blob ? pt.c * v + pt.s : v ? this.join("") : this.start; 4449 if (pt.r) { 4450 val = Math.round(val); 4451 } else if (val < min) if (val >
4451 -min) { //prevents issues with converting very small numbers to strings in the browser 4452 val = 0; 4453 } 4454 if (!pt.f) { 4455 pt.t[pt.p] = val; 4456 } else if (pt.fp) { 4457 pt.t[pt.p](pt.fp, val); 4458 } else { 4459 pt.t[pt.p](val); 4460 } 4461 pt = pt._next; 4462 } 4463 }, 4464 //compares two strings (start/end), finds the numbers that are different and spits back an array representing the whole value but with the changing values isolated as elements. For example, "rgb(0,0,0)" and "rgb(100,50,0)" would become ["rgb(", 0, ",", 50, ",0)"]. Notice it merges the parts that are identical (performance optimization). The array also has a linked list of PropTweens attached starting with _firstPT that contain the tweening data (t, p, s, c, f, etc.). It also stores the starting value as a "start" property so that we can revert to it if/when necessary, like when a tween rewinds fully. If the quantity of numbers differs between the start and end, it will always prioritize the end value(s). The pt parameter is optional - it's for a PropTween that will be appended to the end of the linked list and is typically for actually setting the value after all of the elements have been updated (with array.join("")). 4465 _blobDif = function(start, end, filter, pt) { 4466 var a = [start, end], 4467 charIndex = 0, 4468 s = "", 4469 color = 0, 4470 startNums, endNums, num, i, l, nonNumbers, currentNum; 4471 a.start = start; 4472 if (filter) { 4473 filter(a); //pass an array with the starting and ending values and let the filter do whatever it needs to the values. 4474 start = a[0]; 4475 end = a[1]; 4476 } 4477 a.length = 0; 4478 startNums = start.match(_numbersExp) || []; 4479 endNums = end.match(_numbersExp) || []; 4480 if (pt) { 4481 pt._next = null; 4482 pt.blob = 1; 4483 a._firstPT = pt; //apply last in the linked list (which means inserting it first) 4484 } 4485 l = endNums.length; 4486 for (i = 0; i < l; i++) { 4487 currentNum = endNums[i]; 4488 nonNumbers = end.substr(charIndex, end.indexOf(currentNum, charIndex)-charIndex); 4489 s += (nonNumbers || !i) ? nonNumbers : ","; //note: SVG spec allows omission of comma/space when a negative sign is wedged between two numbers, like 2.5-5.3 instead of 2.5,-5.3 but when tweening, the negative value may switch to positive, so we insert the comma just in case. 4490 charIndex += nonNumbers.length; 4491 if (color) { //sense rgba() values and round them. 4492 color = (color + 1) % 5; 4493 } else if (nonNumbers.substr(-5) === "rgba(") { 4494 color = 1; 4495 } 4496 if (currentNum === startNums[i] || startNums.length <= i) { 4497 s += currentNum; 4498 } else { 4499 if (s) { 4500 a.push(s); 4501 s = ""; 4502 } 4503 num = parseFloat(startNums[i]); 4504 a.push(num); 4505 a._firstPT = {_next: a._firstPT, t:a, p: a.length-1, s:num, c:((currentNum.charAt(1) === "=") ? parseInt(currentNum.charAt(0) + "1", 10) * parseFloat(currentNum.substr(2)) : (parseFloat(currentNum) - num)) || 0, f:0, r:(color && color < 4)}; 4506 //note: we don't set _prev because we'll never need to remove individual PropTweens from this list. 4507 } 4508 charIndex += currentNum.length; 4509 } 4510 s += end.substr(charIndex); 4511 if (s) { 4512 a.push(s); 4513 } 4514 a.setRatio = _setRatio; 4515 return a; 4516 }, 4517 //note: "funcParam" is only necessary for function-based getters/setters that require an extra parameter like getAttribute("width") and setAttribute("width", value). In this example, funcParam would be "width". Used by AttrPlugin for example. 4518 _addPropTween = function(target, prop, start, end, overwriteProp, round, funcParam, stringFilter) { 4519 var s = (start === "get") ? target[prop] : start, 4520 type = typeof(target[prop]), 4521 isRelative = (typeof(end) === "string" && end.charAt(1) === "="), 4522 pt = {t:target, p:prop, s:s, f:(type === "function"), pg:0, n:overwriteProp || prop, r:round, pr:0, c:isRelative ? parseInt(end.charAt(0) + "1", 10) * parseFloat(end.substr(2)) : (parseFloat(end) - s) || 0}, 4523 blob, getterName; 4524 if (type !== "number") { 4525 if (type === "function" && start === "get") { 4526 getterName = ((prop.indexOf("set") || typeof(target["get" + prop.substr(3)]) !== "function") ? prop : "get" + prop.substr(3)); 4527 pt.s = s = funcParam ? target[getterName](funcParam) : target[getterName](); 4528 } 4529 if (typeof(s) === "string" && (funcParam || isNaN(s))) { 4530 //a blob (string that has multiple numbers in it) 4531 pt.fp = funcParam; 4532 blob = _blobDif(s, end, stringFilter || TweenLite.defaultStringFilter, pt); 4533 pt = {t:blob, p:"setRatio", s:0, c:1, f:2, pg:0, n:overwriteProp || prop, pr:0}; //"2" indicates it's a Blob property tween. Needed for RoundPropsPlugin for example. 4534 } else if (!isRelative) { 4535 pt.c = (parseFloat(end) - parseFloat(s)) || 0; 4536 } 4537 } 4538 if (pt.c) { //only add it to the linked list if there's a change. 4539 if ((pt._next = this._firstPT)) { 4540 pt._next._prev = pt; 4541 } 4542 this._firstPT = pt; 4543 return pt; 4544 } 4545 }, 4546 _internals = TweenLite._internals = {isArray:_isArray, isSelector:_isSelector, lazyTweens:_lazyTweens, blobDif:_blobDif}, //gives us a way to expose certain private values to other GreenSock classes without contaminating tha main TweenLite object. 4547 _plugins = TweenLite._plugins = {}, 4548 _tweenLookup = _internals.tweenLookup = {}, 4549 _tweenLookupNum = 0, 4550 _reservedProps = _internals.reservedProps = {ease:1, delay:1, overwrite:1, onComplete:1, onCompleteParams:1, onCompleteScope:1, useFrames:1, runBackwards:1, startAt:1, onUp
4550date:1, onUpdateParams:1, onUpdateScope:1, onStart:1, onStartParams:1, onStartScope:1, onReverseComplete:1, onReverseCompleteParams:1, onReverseCompleteScope:1, onRepeat:1, onRepeatParams:1, onRepeatScope:1, easeParams:1, yoyo:1, immediateRender:1, repeat:1, repeatDelay:1, data:1, paused:1, reversed:1, autoCSS:1, lazy:1, onOverwrite:1, callbackScope:1, stringFilter:1}, 4551 _overwriteLookup = {none:0, all:1, auto:2, concurrent:3, allOnStart:4, preexisting:5, "true":1, "false":0}, 4552 _rootFramesTimeline = Animation._rootFramesTimeline = new SimpleTimeline(), 4553 _rootTimeline = Animation._rootTimeline = new SimpleTimeline(), 4554 _nextGCFrame = 30, 4555 _lazyRender = _internals.lazyRender = function() { 4556 var i = _lazyTweens.length, 4557 tween; 4558 _lazyLookup = {}; 4559 while (--i > -1) { 4560 tween = _lazyTweens[i]; 4561 if (tween && tween._lazy !== false) { 4562 tween.render(tween._lazy[0], tween._lazy[1], true); 4563 tween._lazy = false; 4564 } 4565 } 4566 _lazyTweens.length = 0; 4567 }; 4568 4569 _rootTimeline._startTime = _ticker.time; 4570 _rootFramesTimeline._startTime = _ticker.frame; 4571 _rootTimeline._active = _rootFramesTimeline._active = true; 4572 setTimeout(_lazyRender, 1); //on some mobile devices, there isn't a "tick" before code runs which means any lazy renders wouldn't run before the next official "tick". 4573 4574 Animation._updateRoot = TweenLite.render = function() { 4575 var i, a, p; 4576 if (_lazyTweens.length) { //if code is run outside of the requestAnimationFrame loop, there may be tweens queued AFTER the engine refreshed, so we need to ensure any pending renders occur before we refresh again. 4577 _lazyRender(); 4578 } 4579 _rootTimeline.render((_ticker.time - _rootTimeline._startTime) * _rootTimeline._timeScale, false, false); 4580 _rootFramesTimeline.render((_ticker.frame - _rootFramesTimeline._startTime) * _rootFramesTimeline._timeScale, false, false); 4581 if (_lazyTweens.length) { 4582 _lazyRender(); 4583 } 4584 if (_ticker.frame >= _nextGCFrame) { //dump garbage every 120 frames or whatever the user sets TweenLite.autoSleep to 4585 _nextGCFrame = _ticker.frame + (parseInt(TweenLite.autoSleep, 10) || 120); 4586 for (p in _tweenLookup) { 4587 a = _tweenLookup[p].tweens; 4588 i = a.length; 4589 while (--i > -1) { 4590 if (a[i]._gc) { 4591 a.splice(i, 1); 4592 } 4593 } 4594 if (a.length === 0) { 4595 delete _tweenLookup[p]; 4596 } 4597 } 4598 //if there are no more tweens in the root timelines, or if they're all paused, make the _timer sleep to reduce load on the CPU slightly 4599 p = _rootTimeline._first; 4600 if (!p || p._paused) if (TweenLite.autoSleep && !_rootFramesTimeline._first && _ticker._listeners.tick.length === 1) { 4601 while (p && p._paused) { 4602 p = p._next; 4603 } 4604 if (!p) { 4605 _ticker.sleep(); 4606 } 4607 } 4608 } 4609 }; 4610 4611 _ticker.addEventListener("tick", Animation._updateRoot); 4612 4613 var _register = function(target, tween, scrub) { 4614 var id = target._gsTweenID, a, i; 4615 if (!_tweenLookup[id || (target._gsTweenID = id = "t" + (_tweenLookupNum++))]) { 4616 _tweenLookup[id] = {target:target, tweens:[]}; 4617 } 4618 if (tween) { 4619 a = _tweenLookup[id].tweens; 4620 a[(i = a.length)] = tween; 4621 if (scrub) { 4622 while (--i > -1) { 4623 if (a[i] === tween) { 4624 a.splice(i, 1); 4625 } 4626 } 4627 } 4628 } 4629 return _tweenLookup[id].tweens; 4630 }, 4631 _onOverwrite = function(overwrittenTween, overwritingTween, target, killedProps) { 4632 var func = overwrittenTween.vars.onOverwrite, r1, r2; 4633 if (func) { 4634 r1 = func(overwrittenTween, overwritingTween, target, killedProps); 4635 } 4636 func = TweenLite.onOverwrite; 4637 if (func) { 4638 r2 = func(overwrittenTween, overwritingTween, target, killedProps); 4639 } 4640 return (r1 !== false && r2 !== false); 4641 }, 4642 _applyOverwrite = function(target, tween, props, mode, siblings) { 4643 var i, changed, curTween, l; 4644 if (mode === 1 || mode >= 4) { 4645 l = siblings.length; 4646 for (i = 0; i < l; i++) { 4647 if ((curTween = siblings[i]) !== tween) { 4648 if (!curTween._gc) { 4649 if (curTween._kill(null, target, tween)) { 4650 changed = true; 4651 } 4652 } 4653 } else if (mode === 5) { 4654 break; 4655 } 4656 } 4657 return changed; 4658 } 4659 //NOTE: Add 0.0000000001 to overcome floating point errors that can cause the startTime to be VERY slightly off (when a tween's time() is set for example) 4660 var startTime = tween._startTime + _tinyNum, 4661 overlaps = [], 4662 oCount = 0, 4663 zeroDur = (tween._duration === 0), 4664 globalStart; 4665 i = siblings.length; 4666 while (--i > -1) { 4667 if ((curTween = siblings[i]) === tween || curTween._gc || curTween._paused) { 4668 //ignore 4669 } else if (curTween._timeline !== tween._timeline) { 4670 globalStart = globalStart || _checkOverlap(tween, 0, zeroDur); 4671 if (_checkOverlap(curTween, globalStart, zeroDur) === 0) { 4672 overlaps[oCount++] = curTween; 4673 } 4674 } else if (curTween._startTime <= startTime) if (curTween._startTime + curTween.totalDuration() / curTween._timeScale > startTime) if (!((zeroDur || !curTween._initted) && startTime - curTween._startTime <= 0.0000000002)) { 4675 overlaps[oCount++] = curTween; 4676 } 4677 } 4678 4679 i = oCount; 4680 while (--i > -1) { 4681 curTween = overlaps[i]; 4682 if (mode === 2) if (curTween._kill(props, target, tween)) { 4683 changed = true; 4684 } 4685 if (mode !== 2 || (!curTween._firstPT && curTween._initted)) { 4686 if (mode !== 2 && !_onOverwrite(curTween, tween)) { 4687 continue; 4688 } 4689 if (curTween._enabled(false, false)) { //if all property tweens have been overwritten, kill the tween. 4690 changed = true; 4691 } 4692 } 4693 } 4694 return changed; 4695 }, 4696 _checkOverlap = function(tween, reference, zeroDur) { 4697 var tl = tween._timeline, 4698 ts = tl._timeScale, 4699 t = tween._startTime; 4700 while (tl._timeline) { 4701 t += tl._startTime; 4702 ts *= tl._timeScale; 4703 if (tl._paused) { 4704 return -100; 4705 } 4706 tl = tl._timeline; 4707 } 4708 t /= ts; 4709 return (t > reference) ? t - reference : ((zeroDur && t === reference) || (!tween._initted && t - reference < 2 * _tinyNum)) ? _tinyNum : ((t += tween.totalDuration() / tween._timeScale / ts) > reference + _tinyNum) ? 0 : t - reference - _tinyNum; 4710 }; 4711 4712 4713//---- TweenLite instance methods ----------------------------------------------------------------------------- 4714 4715 p._init = function() { 4716 var v = this.vars, 4717 op = this._overwrittenProps, 4718 dur = this._duration, 4719 immediate = !!v.immediateRender, 4720 ease = v.ease, 4721 i, initPlugins, pt, p, startVars; 4722 if (v.startAt) { 4723 if (this._startAt) { 4724 this._startAt.render(-1, true); //if we've run a startAt previously (when the tween instantiated), we should revert it so that the values re-instantiate correctly particularly for relative tweens. Without this, a TweenLite.fromTo(obj, 1, {x:"+=100"}, {x:"-=100"}), for example, would actually jump to +=200 because the startAt would run twice, doubling the relative change. 4725 this._startAt.kill(); 4726 } 4727 startVars = {}; 4728 for (p in v.startAt) { //copy the properties/values into a new object to avoid collisions, like var to = {x:0}, from = {x:500}; timeline.fromTo(e, 1, from, to).fromTo(e, 1, to, from); 4729 startVars[p] = v.startAt[p]; 4730 } 4731 startVars.overwrite = false; 4732 startVars.immediateRender = true; 4733 startVars.lazy = (immediate && v.lazy !== false);
4734 startVars.startAt = startVars.delay = null; //no nesting of startAt objects allowed (otherwise it could cause an infinite loop). 4735 this._startAt = TweenLite.to(this.target, 0, startVars); 4736 if (immediate) { 4737 if (this._time > 0) { 4738 this._startAt = null; //tweens that render immediately (like most from() and fromTo() tweens) shouldn't revert when their parent timeline's playhead goes backward past the startTime because the initial render could have happened anytime and it shouldn't be directly correlated to this tween's startTime. Imagine setting up a complex animation where the beginning states of various objects are rendered immediately but the tween doesn't happen for quite some time - if we revert to the starting values as soon as the playhead goes backward past the tween's startTime, it will throw things off visually. Reversion should only happen in TimelineLite/Max instances where immediateRender was false (which is the default in the convenience methods like from()). 4739 } else if (dur !== 0) { 4740 return; //we skip initialization here so that overwriting doesn't occur until the tween actually begins. Otherwise, if you create several immediateRender:true tweens of the same target/properties to drop into a TimelineLite or TimelineMax, the last one created would overwrite the first ones because they didn't get placed into the timeline yet before the first render occurs and kicks in overwriting. 4741 } 4742 } 4743 } else if (v.runBackwards && dur !== 0) { 4744 //from() tweens must be handled uniquely: their beginning values must be rendered but we don't want overwriting to occur yet (when time is still 0). Wait until the tween actually begins before doing all the routines like overwriting. At that time, we should render at the END of the tween to ensure that things initialize correctly (remember, from() tweens go backwards) 4745 if (this._startAt) { 4746 this._startAt.render(-1, true); 4747 this._startAt.kill(); 4748 this._startAt = null; 4749 } else { 4750 if (this._time !== 0) { //in rare cases (like if a from() tween runs and then is invalidate()-ed), immediateRender could be true but the initial forced-render gets skipped, so there's no need to force the render in this context when the _time is greater than 0 4751 immediate = false; 4752 } 4753 pt = {}; 4754 for (p in v) { //copy props into a new object and skip any reserved props, otherwise onComplete or onUpdate or onStart could fire. We should, however, permit autoCSS to go through. 4755 if (!_reservedProps[p] || p === "autoCSS") { 4756 pt[p] = v[p]; 4757 } 4758 } 4759 pt.overwrite = 0; 4760 pt.data = "isFromStart"; //we tag the tween with as "isFromStart" so that if [inside a plugin] we need to only do something at the very END of a tween, we have a way of identifying this tween as merely the one that's setting the beginning values for a "from()" tween. For example, clearProps in CSSPlugin should only get applied at the very END of a tween and without this tag, from(...{height:100, clearProps:"height", delay:1}) would wipe the height at the beginning of the tween and after 1 second, it'd kick back in. 4761 pt.lazy = (immediate && v.lazy !== false); 4762 pt.immediateRender = immediate; //zero-duration tweens render immediately by default, but if we're not specifically instructed to render this tween immediately, we should skip this and merely _init() to record the starting values (rendering them immediately would push them to completion which is wasteful in that case - we'd have to render(-1) immediately after) 4763 this._startAt = TweenLite.to(this.target, 0, pt); 4764 if (!immediate) { 4765 this._startAt._init(); //ensures that the initial values are recorded 4766 this._startAt._enabled(false); //no need to have the tween render on the next cycle. Disable it because we'll always manually control the renders of the _startAt tween. 4767 if (this.vars.immediateRender) { 4768 this._startAt = null; 4769 } 4770 } else if (this._time === 0) { 4771 return; 4772 } 4773 } 4774 } 4775 this._ease = ease = (!ease) ? TweenLite.defaultEase : (ease instanceof Ease) ? ease : (typeof(ease) === "function") ? new Ease(ease, v.easeParams) : _easeMap[ease] || TweenLite.defaultEase; 4776 if (v.easeParams instanceof Array && ease.config) { 4777 this._ease = ease.config.apply(ease, v.easeParams); 4778 } 4779 this._easeType = this._ease._type; 4780 this._easePower = this._ease._power; 4781 this._firstPT = null; 4782 4783 if (this._targets) { 4784 i = this._targets.length; 4785 while (--i > -1) { 4786 if ( this._initProps( this._targets[i], (this._propLookup[i] = {}), this._siblings[i], (op ? op[i] : null)) ) { 4787 initPlugins = true; 4788 } 4789 } 4790 } else { 4791 initPlugins = this._initProps(this.target, this._propLookup, this._siblings, op); 4792 } 4793 4794 if (initPlugins) { 4795 TweenLite._onPluginEvent("_onInitAllProps", this); //reorders the array in order of priority. Uses a static TweenPlugin method in order to minimize file size in TweenLite 4796 } 4797 if (op) if (!this._firstPT) if (typeof(this.target) !== "function") { //if all tweening properties have been overwritten, kill the tween. If the target is a function, it's probably a delayedCall so let it live. 4798 this._enabled(false, false); 4799 } 4800 if (v.runBackwards) { 4801 pt = this._firstPT; 4802 while (pt) { 4803 pt.s += pt.c; 4804 pt.c = -pt.c; 4805 pt = pt._next; 4806 } 4807 } 4808 this._onUpdate = v.onUpdate; 4809 this._initted = true; 4810 }; 4811 4812 p._initProps = function(target, propLookup, siblings, overwrittenProps) { 4813 var p, i, initPlugins, plugin, pt, v; 4814 if (target == null) { 4815 return false; 4816 } 4817 4818 if (_lazyLookup[target._gsTweenID]) { 4819 _lazyRender(); //if other tweens of the same target have recently initted but haven't rendered yet, we've got to force the render so that the starting values are correct (imagine populating a timeline with a bunch of sequential tweens and then jumping to the end) 4820 } 4821 4822 if (!this.vars.css) if (target.style) if (target !== window && target.nodeType) if (_plugins.css) if (this.vars.autoCSS !== false) { //it's so common to use TweenLite/Max to animate the css of DOM elements, we assume that if the target is a DOM element, that's what is intended (a convenience so that users don't have to wrap things in css:{}, although we still recommend it for a slight performance boost and better specificity). Note: we cannot check "nodeType" on the window inside an iframe. 4823 _autoCSS(this.vars, target); 4824 } 4825 for (p in this.vars) { 4826 v = this.vars[p]; 4827 if (_reservedProps[p]) { 4828 if (v) if ((v instanceof Array) || (v.push && _isArray(v))) if (v.join("").indexOf("{self}") !== -1) { 4829 this.vars[p] = v = this._swapSelfInParams(v, this); 4830 } 4831 4832 } else if (_plugins[p] && (plugin = new _plugins[p]())._onInitTween(target, this.vars[p], this)) { 4833 4834 //t - target [object] 4835 //p - property [string] 4836 //s - start [number] 4837 //c - change [number] 4838 //f - isFunction [boolean] 4839 //n - name [string] 4840 //pg - isPlugin [boolean] 4841 //pr - priority [number] 4842 this._firstPT = pt = {_next:this._firstPT, t:plugin, p:"setRatio", s:0, c:1, f:1, n:p, pg:1, pr:plugin._priority};
4843 i = plugin._overwriteProps.length; 4844 while (--i > -1) { 4845 propLookup[plugin._overwriteProps[i]] = this._firstPT; 4846 } 4847 if (plugin._priority || plugin._onInitAllProps) { 4848 initPlugins = true; 4849 } 4850 if (plugin._onDisable || plugin._onEnable) { 4851 this._notifyPluginsOfEnabled = true; 4852 } 4853 if (pt._next) { 4854 pt._next._prev = pt; 4855 } 4856 4857 } else { 4858 propLookup[p] = _addPropTween.call(this, target, p, "get", v, p, 0, null, this.vars.stringFilter); 4859 } 4860 } 4861 4862 if (overwrittenProps) if (this._kill(overwrittenProps, target)) { //another tween may have tried to overwrite properties of this tween before init() was called (like if two tweens start at the same time, the one created second will run first) 4863 return this._initProps(target, propLookup, siblings, overwrittenProps); 4864 } 4865 if (this._overwrite > 1) if (this._firstPT) if (siblings.length > 1) if (_applyOverwrite(target, this, propLookup, this._overwrite, siblings)) { 4866 this._kill(propLookup, target); 4867 return this._initProps(target, propLookup, siblings, overwrittenProps); 4868 } 4869 if (this._firstPT) if ((this.vars.lazy !== false && this._duration) || (this.vars.lazy && !this._duration)) { //zero duration tweens don't lazy render by default; everything else does. 4870 _lazyLookup[target._gsTweenID] = true; 4871 } 4872 return initPlugins; 4873 }; 4874 4875 p.render = function(time, suppressEvents, force) { 4876 var prevTime = this._time, 4877 duration = this._duration, 4878 prevRawPrevTime = this._rawPrevTime, 4879 isComplete, callback, pt, rawPrevTime; 4880 if (time >= duration) { 4881 this._totalTime = this._time = duration; 4882 this.ratio = this._ease._calcEnd ? this._ease.getRatio(1) : 1; 4883 if (!this._reversed ) { 4884 isComplete = true; 4885 callback = "onComplete"; 4886 force = (force || this._timeline.autoRemoveChildren); //otherwise, if the animation is unpaused/activated after it's already finished, it doesn't get removed from the parent timeline. 4887 } 4888 if (duration === 0) if (this._initted || !this.vars.lazy || force) { //zero-duration tweens are tricky because we must discern the momentum/direction of time in order to determine whether the starting values should be rendered or the ending values. If the "playhead" of its timeline goes past the zero-duration tween in the forward direction or lands directly on it, the end values should be rendered, but if the timeline's "playhead" moves past it in the backward direction (from a postitive time to a negative time), the starting values must be rendered. 4889 if (this._startTime === this._timeline._duration) { //if a zero-duration tween is at the VERY end of a timeline and that timeline renders at its end, it will typically add a tiny bit of cushion to the render time to prevent rounding errors from getting in the way of tweens rendering their VERY end. If we then reverse() that timeline, the zero-duration tween will trigger its onReverseComplete even though technically the playhead didn't pass over it again. It's a very specific edge case we must accommodate. 4890 time = 0; 4891 } 4892 if (time === 0 || prevRawPrevTime < 0 || (prevRawPrevTime === _tinyNum && this.data !== "isPause")) if (prevRawPrevTime !== time) { //note: when this.data is "isPause", it's a callback added by addPause() on a timeline that we should not be triggered when LEAVING its exact start time. In other words, tl.addPause(1).play(1) shouldn't pause. 4893 force = true; 4894 if (prevRawPrevTime > _tinyNum) { 4895 callback = "onReverseComplete"; 4896 } 4897 } 4898 this._rawPrevTime = rawPrevTime = (!suppressEvents || time || prevRawPrevTime === time) ? time : _tinyNum; //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration tween, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect. We set the _rawPrevTime to be a precise tiny number to indicate this scenario rather than using another property/variable which would increase memory usage. This technique is less readable, but more efficient. 4899 } 4900 4901 } else if (time < 0.0000001) { //to work around occasional floating point math artifacts, round super small values to 0. 4902 this._totalTime = this._time = 0; 4903 this.ratio = this._ease._calcEnd ? this._ease.getRatio(0) : 0; 4904 if (prevTime !== 0 || (duration === 0 && prevRawPrevTime > 0)) { 4905 callback = "onReverseComplete"; 4906 isComplete = this._reversed; 4907 } 4908 if (time < 0) { 4909 this._active = false; 4910 if (duration === 0) if (this._initted || !this.vars.lazy || force) { //zero-duration tweens are tricky because we must discern the momentum/direction of time in order to determine whether the starting values should be rendered or the ending values. If the "playhead" of its timeline goes past the zero-duration tween in the forward direction or lands directly on it, the end values should be rendered, but if the timeline's "playhead" moves past it in the backward direction (from a postitive time to a negative time), the starting values must be rendered. 4911 if (prevRawPrevTime >= 0 && !(prevRawPrevTime === _tinyNum && this.data === "isPause")) { 4912 force = true; 4913 } 4914 this._rawPrevTime = rawPrevTime = (!suppressEvents || time || prevRawPrevTime === time) ? time : _tinyNum; //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration tween, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect. We set the _rawPrevTime to be a precise tiny number to indicate this scenario rather than using another property/variable which would increase memory usage. This technique is less readable, but more efficient. 4915 } 4916 } 4917 if (!this._initted) { //if we render the very beginning (time == 0) of a fromTo(), we must force the render (normal tweens wouldn't need to render at a time of 0 when the prevTime was also 0). This is also mandatory to make sure overwriting kicks in immediately. 4918 force = true; 4919 } 4920 } else { 4921 this._totalTime = this._time = time; 4922 4923 if (this._easeType) { 4924 var r = time / duration, type = this._easeType, pow = this._easePower; 4925 if (type === 1 || (type === 3 && r >= 0.5)) { 4926 r = 1 - r; 4927 } 4928 if (type === 3) { 4929 r *= 2; 4930 } 4931 if (pow === 1) { 4932 r *= r; 4933 } else if (pow === 2) { 4934 r *= r * r; 4935 } else if (pow === 3) { 4936 r *= r * r * r; 4937 } else if (pow === 4) { 4938 r *= r * r * r * r; 4939 } 4940 4941 if (type === 1) { 4942 this.ratio = 1 - r; 4943 } else if (type === 2) { 4944 this.ratio = r; 4945 } else if (time / duration < 0.5) { 4946 this.ratio = r / 2; 4947 } else { 4948 this.ratio = 1 - (r / 2); 4949 } 4950 4951 } else { 4952 this.ratio = this._ease.getRatio(time / duration); 4953 } 4954 } 4955 4956 if (this._time === prevTime && !force) { 4957 return; 4958 } else if (!this._initted) { 4959 this._init(); 4960 if (!this._initted || this._gc) { //immediateRender tweens typically won't initialize until the playhead advances (_time is greater than 0) in order to ensure that over
4960writing occurs properly. Also, if all of the tweening properties have been overwritten (which would cause _gc to be true, as set in _init()), we shouldn't continue otherwise an onStart callback could be called for example. 4961 return; 4962 } else if (!force && this._firstPT && ((this.vars.lazy !== false && this._duration) || (this.vars.lazy && !this._duration))) { 4963 this._time = this._totalTime = prevTime; 4964 this._rawPrevTime = prevRawPrevTime; 4965 _lazyTweens.push(this); 4966 this._lazy = [time, suppressEvents]; 4967 return; 4968 } 4969 //_ease is initially set to defaultEase, so now that init() has run, _ease is set properly and we need to recalculate the ratio. Overall this is faster than using conditional logic earlier in the method to avoid having to set ratio twice because we only init() once but renderTime() gets called VERY frequently. 4970 if (this._time && !isComplete) { 4971 this.ratio = this._ease.getRatio(this._time / duration); 4972 } else if (isComplete && this._ease._calcEnd) { 4973 this.ratio = this._ease.getRatio((this._time === 0) ? 0 : 1); 4974 } 4975 } 4976 if (this._lazy !== false) { //in case a lazy render is pending, we should flush it because the new render is occurring now (imagine a lazy tween instantiating and then immediately the user calls tween.seek(tween.duration()), skipping to the end - the end render would be forced, and then if we didn't flush the lazy render, it'd fire AFTER the seek(), rendering it at the wrong time. 4977 this._lazy = false; 4978 } 4979 if (!this._active) if (!this._paused && this._time !== prevTime && time >= 0) { 4980 this._active = true; //so that if the user renders a tween (as opposed to the timeline rendering it), the timeline is forced to re-render and align it with the proper time/frame on the next rendering cycle. Maybe the tween already finished but the user manually re-renders it as halfway done. 4981 } 4982 if (prevTime === 0) { 4983 if (this._startAt) { 4984 if (time >= 0) { 4985 this._startAt.render(time, suppressEvents, force); 4986 } else if (!callback) { 4987 callback = "_dummyGS"; //if no callback is defined, use a dummy value just so that the condition at the end evaluates as true because _startAt should render AFTER the normal render loop when the time is negative. We could handle this in a more intuitive way, of course, but the render loop is the MOST important thing to optimize, so this technique allows us to avoid adding extra conditional logic in a high-frequency area. 4988 } 4989 } 4990 if (this.vars.onStart) if (this._time !== 0 || duration === 0) if (!suppressEvents) { 4991 this._callback("onStart"); 4992 } 4993 } 4994 pt = this._firstPT; 4995 while (pt) { 4996 if (pt.f) { 4997 pt.t[pt.p](pt.c * this.ratio + pt.s); 4998 } else { 4999 pt.t[pt.p] = pt.c * this.ratio + pt.s; 5000 } 5001 pt = pt._next; 5002 } 5003 5004 if (this._onUpdate) { 5005 if (time < 0) if (this._startAt && time !== -0.0001) { //if the tween is positioned at the VERY beginning (_startTime 0) of its parent timeline, it's illegal for the playhead to go back further, so we should not render the recorded startAt values. 5006 this._startAt.render(time, suppressEvents, force); //note: for performance reasons, we tuck this conditional logic inside less traveled areas (most tweens don't have an onUpdate). We'd just have it at the end before the onComplete, but the values should be updated before any onUpdate is called, so we ALSO put it here and then if it's not called, we do so later near the onComplete. 5007 } 5008 if (!suppressEvents) if (this._time !== prevTime || isComplete) { 5009 this._callback("onUpdate"); 5010 } 5011 } 5012 if (callback) if (!this._gc || force) { //check _gc because there's a chance that kill() could be called in an onUpdate 5013 if (time < 0 && this._startAt && !this._onUpdate && time !== -0.0001) { //-0.0001 is a special value that we use when looping back to the beginning of a repeated TimelineMax, in which case we shouldn't render the _startAt values. 5014 this._startAt.render(time, suppressEvents, force); 5015 } 5016 if (isComplete) { 5017 if (this._timeline.autoRemoveChildren) { 5018 this._enabled(false, false); 5019 } 5020 this._active = false; 5021 } 5022 if (!suppressEvents && this.vars[callback]) { 5023 this._callback(callback); 5024 } 5025 if (duration === 0 && this._rawPrevTime === _tinyNum && rawPrevTime !== _tinyNum) { //the onComplete or onReverseComplete could trigger movement of the playhead and for zero-duration tweens (which must discern direction) that land directly back on their start time, we don't want to fire again on the next render. Think of several addPause()'s in a timeline that forces the playhead to a certain spot, but what if it's already paused and another tween is tweening the "time" of the timeline? Each time it moves [forward] past that spot, it would move back, and since suppressEvents is true, it'd reset _rawPrevTime to _tinyNum so that when it begins again, the callback would fire (so ultimately it could bounce back and forth during that tween). Again, this is a very uncommon sce
5025nario, but possible nonetheless. 5026 this._rawPrevTime = 0; 5027 } 5028 } 5029 }; 5030 5031 p._kill = function(vars, target, overwritingTween) { 5032 if (vars === "all") { 5033 vars = null; 5034 } 5035 if (vars == null) if (target == null || target === this.target) { 5036 this._lazy = false; 5037 return this._enabled(false, false); 5038 } 5039 target = (typeof(target) !== "string") ? (target || this._targets || this.target) : TweenLite.selector(target) || target; 5040 var simultaneousOverwrite = (overwritingTween && this._time && overwritingTween._startTime === this._startTime && this._timeline === overwritingTween._timeline), 5041 i, overwrittenProps, p, pt, propLookup, changed, killProps, record, killed; 5042 if ((_isArray(target) || _isSelector(target)) && typeof(target[0]) !== "number") { 5043 i = target.length; 5044 while (--i > -1) { 5045 if (this._kill(vars, target[i], overwritingTween)) { 5046 changed = true; 5047 } 5048 } 5049 } else { 5050 if (this._targets) { 5051 i = this._targets.length; 5052 while (--i > -1) { 5053 if (target === this._targets[i]) { 5054 propLookup = this._propLookup[i] || {}; 5055 this._overwrittenProps = this._overwrittenProps || []; 5056 overwrittenProps = this._overwrittenProps[i] = vars ? this._overwrittenProps[i] || {} : "all"; 5057 break; 5058 } 5059 } 5060 } else if (target !== this.target) { 5061 return false; 5062 } else { 5063 propLookup = this._propLookup; 5064 overwrittenProps = this._overwrittenProps = vars ? this._overwrittenProps || {} : "all"; 5065 } 5066 5067 if (propLookup) { 5068 killProps = vars || propLookup; 5069 record = (vars !== overwrittenProps && overwrittenProps !== "all" && vars !== propLookup && (typeof(vars) !== "object" || !vars._tempKill)); //_tempKill is a super-secret way to delete a particular tweening property but NOT have it remembered as an official overwritten property (like in BezierPlugin) 5070 if (overwritingTween && (TweenLite.onOverwrite || this.vars.onOverwrite)) { 5071 for (p in killProps) { 5072 if (propLookup[p]) { 5073 if (!killed) { 5074 killed = []; 5075 } 5076 killed.push(p); 5077 } 5078 } 5079 if ((killed || !vars) && !_onOverwrite(this, overwritingTween, target, killed)) { //if the onOverwrite returned false, that means the user wants to override the overwriting (cancel it). 5080 return false; 5081 } 5082 } 5083 5084 for (p in killProps) { 5085 if ((pt = propLookup[p])) { 5086 if (simultaneousOverwrite) { //if another tween overwrites this one and they both start at exactly the same time, yet this tween has already rendered once (for example, at 0.001) because it's first in the queue, we should revert the values to where they were at 0 so that the starting values aren't contaminated on the overwriting tween. 5087 if (pt.f) { 5088 pt.t[pt.p](pt.s); 5089 } else { 5090 pt.t[pt.p] = pt.s; 5091 } 5092 changed = true; 5093 } 5094 if (pt.pg && pt.t._kill(killProps)) { 5095 changed = true; //some plugins need to be notified so they can perform cleanup tasks first 5096 } 5097 if (!pt.pg || pt.t._overwriteProps.length === 0) { 5098 if (pt._prev) { 5099 pt._prev._next = pt._next; 5100 } else if (pt === this._firstPT) { 5101 this._firstPT = pt._next; 5102 } 5103 if (pt._next) { 5104 pt._next._prev = pt._prev; 5105 } 5106 pt._next = pt._prev = null; 5107 } 5108 delete propLookup[p]; 5109 } 5110 if (record) { 5111 overwrittenProps[p] = 1; 5112 } 5113 } 5114 if (!this._firstPT && this._initted) { //if all tweening properties are killed, kill the tween. Without this line, if there's a tween with multiple targets and then you killTweensOf() each target individually, the tween would technically still remain active and fire its onComplete even though there aren't any more properties tweening. 5115 this._enabled(false, false); 5116 } 5117 } 5118 } 5119 return changed; 5120 }; 5121 5122 p.invalidate = function() { 5123 if (this._notifyPluginsOfEnabled) { 5124 TweenLite._onPluginEvent("_onDisable", this); 5125 } 5126 this._firstPT = this._overwrittenProps = this._startAt = this._onUpdate = null; 5127 this._notifyPluginsOfEnabled = this._active = this._lazy = false; 5128 this._propLookup = (this._targets) ? {} : []; 5129 Animation.prototype.invalidate.call(this); 5130 if (this.vars.immediateRender) { 5131 this._time = -_tinyNum; //forces a render without having to set the render() "force" parameter to true because we want to allow lazying by default (using the "force" parameter always forces an immediate full render) 5132 this.render(-this._delay); 5133 } 5134 return this; 5135 }; 5136 5137 p._enabled = function(enabled, ignoreTimeline) { 5138 if (!_tickerActive) { 5139 _ticker.wake(); 5140 } 5141 if (enabled && this._gc) { 5142 var targets = this._targets, 5143 i; 5144 if (targets) { 5145 i = targets.length; 5146 while (--i > -1) { 5147 this._siblings[i] = _register(targets[i], this, true); 5148 } 5149 } else { 5150 this._siblings = _register(this.target, this, true); 5151 } 5152 } 5153 Animation.prototype._enabled.call(this, enabled, ignoreTimeline); 5154 if (this._notifyPluginsOfEnabled) if (this._firstPT) { 5155 return TweenLite._onPluginEvent((enabled ? "_onEnable" : "_onDisable"), this); 5156 } 5157 return false; 5158 }; 5159 5160 5161//----TweenLite static methods ----------------------------------------------------- 5162 5163 TweenLite.to = function(target, duration, vars) { 5164 return new TweenLite(target, duration, vars); 5165 }; 5166 5167 TweenLite.from = function(target, duration, vars) { 5168 vars.runBackwards = true; 5169 vars.immediateRender = (vars.immediateRender != false); 5170 return new TweenLite(target, duration, vars); 5171 }; 5172 5173 TweenLite.fromTo = function(target, duration, fromVars, toVars) { 5174 toVars.startAt = fromVars; 5175 toVars.immediateRender = (toVars.immediateRender != false && fromVars.immediateRender != false); 5176 return new TweenLite(target, duration, toVars); 5177 }; 5178 5179 TweenLite.delayedCall = function(delay, callback, params, scope, useFrames) { 5180 return new TweenLite(callback, 0, {delay:delay, onComplete:callback, onCompleteParams:params, callbackScope:scope, onReverseComplete:callback, onReverseCompleteParams:params, immediateRender:false, lazy:false, useFrames:useFrames, overwrite:0}); 5181 }; 5182 5183 TweenLite.set = function(target, vars) { 5184 return new TweenLite(target, 0, vars); 5185 }; 5186 5187 TweenLite.getTweensOf = function(target, onlyActive) { 5188 if (target == null) { return []; } 5189 target = (typeof(target) !== "string") ? target : TweenLite.selector(target) || target; 5190 var i, a, j, t; 5191 if ((_isArray(target) || _isSelector(target)) && typeof(target[0]) !== "number") { 5192 i = target.length; 5193 a = []; 5194 while (--i > -1) { 5195 a = a.concat(TweenLite.getTweensOf(target[i], onlyActive)); 5196 } 5197 i = a.length; 5198 //now get rid of any duplicates (tweens of arrays of objects could cause duplicates) 5199 while (--i > -1) { 5200 t = a[i]; 5201 j = i; 5202 while (--j > -1) { 5203 if (t === a[j]) { 5204 a.splice(i, 1); 5205 } 5206 } 5207 } 5208 } else { 5209 a = _register(target).concat(); 5210 i = a.length; 5211 while (--i > -1) { 5212 if (a[i]._gc || (onlyActive && !a[i].isActive())) { 5213 a.splice(i, 1); 5214 } 5215 } 5216 } 5217 return a; 5218 }; 5219 5220 TweenLite.killTweensOf = TweenLite.killDelayedCallsTo = function(target, onlyActive, vars) { 5221 if (typeof(onlyActive) === "object") { 5222 vars = onlyActive; //for backwards compatibility (before "onlyActive" parameter was inserted) 5223 onlyActive = false; 5224 } 5225 var a = TweenLite.getTweensOf(target, onlyActive), 5226 i = a.length; 5227 while (--i > -1) { 5228 a[i]._kill(vars, target); 5229 } 5230 }; 5231 5232 5233 5234/* 5235 * ---------------------------------------------------------------- 5236 * TweenPlugin (could easily be split out as a separate file/class, but included for ease of use (so that people don't need to include another script call before loading plugins which is easy to forget) 5237 * ---------------------------------------------------------------- 5238 */ 5239 var TweenPlugin = _class("plugins.TweenPlugin", function(props, priority) { 5240 this._overwriteProps = (props || "").split(","); 5241 this._propName = this._overwriteProps[0]; 5242 this._priority = priority || 0; 5243 this._super = TweenPlugin.prototype; 5244 }, true); 5245 5246 p = TweenPlugin.prototype; 5247 TweenPlugin.version = "1.18.0"; 5248 TweenPlugin.API = 2; 5249 p._firstPT = null; 5250 p._addTween = _addPropTween; 5251 p.setRatio = _setRatio; 5252 5253 p._kill = function(lookup) { 5254 var a = this._overwriteProps, 5255 pt = this._firstPT, 5256 i; 5257 if (lookup[this._propName] != null) { 5258 this._overwriteProps = []; 5259 } else { 5260 i = a.length; 5261 while (--i > -1) { 5262 if (lookup[a[i]] != null) { 5263 a.splice(i, 1); 5264 } 5265 } 5266 } 5267 while (pt) { 5268 if (lookup[pt.n] != null) { 5269 if (pt._next) { 5270 pt._next._prev = pt._prev; 5271 } 5272 if (pt._prev) { 5273 pt._prev._next = pt._next; 5274 pt._prev = null; 5275 } else if (this._firstPT === pt) { 5276 this._firstPT = pt._next; 5277 } 5278 } 5279 pt = pt._next; 5280 } 5281 return false; 5282 }; 5283 5284 p._roundProps = function(lookup, value) { 5285 var pt = this._firstPT; 5286 while (pt) { 5287 if (lookup[this._propName] || (pt.n != null && lookup[ pt.n.split(this._propName + "_").join("") ])) { //some properties that are very plugin-specific add a prefix named after the _propName plus an underscore, so we need to ignore that extra stuff here. 5288 pt.r = value; 5289 } 5290 pt = pt._next; 5291 } 5292 }; 5293 5294 TweenLite._onPluginEvent = function(type, tween) { 5295 var pt = tween._firstPT, 5296 changed, pt2, first, last, next; 5297 if (type === "_onInitAllProps") { 5298 //sorts the PropTween linked list in order of priority because some plugins need to render earlier/later than others, like MotionBlurPlugin applies its effects after all x/y/alpha tweens have rendered on each frame. 5299 while (pt) { 5300 next = pt._next; 5301 pt2 = first; 5302 while (pt2 && pt2.pr > pt.pr) { 5303 pt2 = pt2._next; 5304 } 5305 if ((pt._prev = pt2 ? pt2._prev : last)) { 5306 pt._prev._next = pt; 5307 } else { 5308 first = pt; 5309 } 5310 if ((pt._next = pt2)) { 5311 pt2._prev = pt; 5312 } else { 5313 last = pt; 5314 } 5315 pt = next; 5316 } 5317 pt = tween._firstPT = first; 5318 } 5319 while (pt) { 5320 if (pt.pg) if (typeof(pt.t[type]) === "function") if (pt.t[type]()) { 5321 changed = true; 5322 } 5323 pt = pt._next; 5324 } 5325 return changed; 5326 }; 5327 5328 TweenPlugin.activate = function(plugins) { 5329 var i = plugins.length; 5330 while (--i > -1) { 5331 if (plugins[i].API === TweenPlugin.API) { 5332 _plugins[(new plugins[i]())._propName] = plugins[i]; 5333 } 5334 } 5335 return true; 5336 }; 5337 5338 //provides a more concise way to define plugins that have no depen
5338dencies besides TweenPlugin and TweenLite, wrapping common boilerplate stuff into one function (added in 1.9.0). You don't NEED to use this to define a plugin - the old way still works and can be useful in certain (rare) situations. 5339 _gsDefine.plugin = function(config) { 5340 if (!config || !config.propName || !config.init || !config.API) { throw "illegal plugin definition."; } 5341 var propName = config.propName, 5342 priority = config.priority || 0, 5343 overwriteProps = config.overwriteProps, 5344 map = {init:"_onInitTween", set:"setRatio", kill:"_kill", round:"_roundProps", initAll:"_onInitAllProps"}, 5345 Plugin = _class("plugins." + propName.charAt(0).toUpperCase() + propName.substr(1) + "Plugin", 5346 function() { 5347 TweenPlugin.call(this, propName, priority); 5348 this._overwriteProps = overwriteProps || []; 5349 }, (config.global === true)), 5350 p = Plugin.prototype = new TweenPlugin(propName), 5351 prop; 5352 p.constructor = Plugin; 5353 Plugin.API = config.API; 5354 for (prop in map) { 5355 if (typeof(config[prop]) === "function") { 5356 p[map[prop]] = config[prop]; 5357 } 5358 } 5359 Plugin.version = config.version; 5360 TweenPlugin.activate([Plugin]); 5361 return Plugin; 5362 }; 5363 5364 5365 //now run through all the dependencies discovered and if any are missing, log that to the console as a warning. This is why it's best to have TweenLite load last - it can check all the dependencies for you. 5366 a = window._gsQueue; 5367 if (a) { 5368 for (i = 0; i < a.length; i++) { 5369 a[i](); 5370 } 5371 for (p in _defLookup) { 5372 if (!_defLookup[p].func) { 5373 window.console.log("GSAP encountered missing dependency: com.greensock." + p); 5374 } 5375 } 5376 } 5377 5378 _tickerActive = false; //ensures that the first official animation forces a ticker.tick() to update the time when it is instantiated 5379 5380})((typeof(module) !== "undefined" && module.exports && typeof(global) !== "undefined") ? global : this || window, "TweenLite"); 5381 5382/*! 5383 * VERSION: 1.18.0 5384 * DATE: 2015-08-29 5385 * UPDATES AND DOCS AT: http://greensock.com 5386 * 5387 * @license Copyright (c) 2008-2015, GreenSock. All rights reserved. 5388 * This work is subject to the terms at http://greensock.com/standard-license or for 5389 * Club GreenSock members, the software agreement that was issued with your membership. 5390 * 5391 * @author: Jack Doyle, [email protected] 5392 */ 5393var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(global) !== "undefined") ? global : this || window; //helps ensure compatibility with AMD/RequireJS and CommonJS/Node 5394(_gsScope._gsQueue || (_gsScope._gsQueue = [])).push( function() { 5395 5396 "use strict"; 5397 5398 _gsScope._gsDefine("TimelineLite", ["core.Animation","core.SimpleTimeline","TweenLite"], function(Animation, SimpleTimeline, TweenLite) { 5399 5400 var TimelineLite = function(vars) { 5401 SimpleTimeline.call(this, vars); 5402 this._labels = {}; 5403 this.autoRemoveChildren = (this.vars.autoRemoveChildren === true); 5404 this.smoothChildTiming = (this.vars.smoothChildTiming === true); 5405 this._sortChildren = true; 5406 this._onUpdate = this.vars.onUpdate; 5407 var v = this.vars, 5408 val, p; 5409 for (p in v) { 5410 val = v[p]; 5411 if (_isArray(val)) if (val.join("").indexOf("{self}") !== -1) { 5412 v[p] = this._swapSelfInParams(val); 5413 } 5414 } 5415 if (_isArray(v.tweens)) { 5416 this.add(v.tweens, 0, v.align, v.stagger); 5417 } 5418 }, 5419 _tinyNum = 0.0000000001, 5420 TweenLiteInternals = TweenLite._internals, 5421 _internals = TimelineLite._internals = {}, 5422 _isSelector = TweenLiteInternals.isSelector, 5423 _isArray = TweenLiteInternals.isArray, 5424 _lazyTweens = TweenLiteInternals.lazyTweens, 5425 _lazyRender = TweenLiteInternals.lazyRender, 5426 _globals = _gsScope._gsDefine.globals, 5427 _copy = function(vars) { 5428 var copy = {}, p; 5429 for (p in vars) { 5430 copy[p] = vars[p]; 5431 } 5432 return copy; 5433 }, 5434 _applyCycle = function(vars, targets, i) { 5435 var alt = vars.cycle, 5436 p, val; 5437 for (p in alt) { 5438 val = alt[p]; 5439 vars[p] = (typeof(val) === "function") ? val.call(targets[i], i) : val[i % val.length]; 5440 } 5441 delete vars.cycle; 5442 }, 5443 _pauseCallback = _internals.pauseCallback = function() {}, 5444 _slice = function(a) { //don't use [].slice because that doesn't work in IE8 with a NodeList that's returned by querySelectorAll() 5445 var b = [], 5446 l = a.length, 5447 i; 5448 for (i = 0; i !== l; b.push(a[i++])); 5449 return b; 5450 }, 5451 p = TimelineLite.prototype = new SimpleTimeline(); 5452
5453 TimelineLite.version = "1.18.0"; 5454 p.constructor = TimelineLite; 5455 p.kill()._gc = p._forcingPlayhead = p._hasPause = false; 5456 5457 /* might use later... 5458 //translates a local time inside an animation to the corresponding time on the root/global timeline, factoring in all nesting and timeScales. 5459 function localToGlobal(time, animation) { 5460 while (animation) { 5461 time = (time / animation._timeScale) + animation._startTime; 5462 animation = animation.timeline; 5463 } 5464 return time; 5465 } 5466 5467 //translates the supplied time on the root/global timeline into the corresponding local time inside a particular animation, factoring in all nesting and timeScales 5468 function globalToLocal(time, animation) { 5469 var scale = 1; 5470 time -= localToGlobal(0, animation); 5471 while (animation) { 5472 scale *= animation._timeScale; 5473 animation = animation.timeline; 5474 } 5475 return time * scale; 5476 } 5477 */ 5478 5479 p.to = function(target, duration, vars, position) { 5480 var Engine = (vars.repeat && _globals.TweenMax) || TweenLite; 5481 return duration ? this.add( new Engine(target, duration, vars), position) : this.set(target, vars, position); 5482 }; 5483 5484 p.from = function(target, duration, vars, position) { 5485 return this.add( ((vars.repeat && _globals.TweenMax) || TweenLite).from(target, duration, vars), position); 5486 }; 5487 5488 p.fromTo = function(target, duration, fromVars, toVars, position) { 5489 var Engine = (toVars.repeat && _globals.TweenMax) || TweenLite; 5490 return duration ? this.add( Engine.fromTo(target, duration, fromVars, toVars), position) : this.set(target, toVars, position); 5491 }; 5492 5493 p.staggerTo = function(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams, onCompleteAllScope) { 5494 var tl = new TimelineLite({onComplete:onCompleteAll, onCompleteParams:onCompleteAllParams, callbackScope:onCompleteAllScope, smoothChildTiming:this.smoothChildTiming}), 5495 cycle = vars.cycle, 5496 copy, i; 5497 if (typeof(targets) === "string") { 5498 targets = TweenLite.selector(targets) || targets; 5499 } 5500 targets = targets || []; 5501 if (_isSelector(targets)) { //senses if the targets object is a selector. If it is, we should translate it into an array. 5502 targets = _slice(targets); 5503 } 5504 stagger = stagger || 0; 5505 if (stagger < 0) { 5506 targets = _slice(targets); 5507 targets.reverse(); 5508 stagger *= -1; 5509 } 5510 for (i = 0; i < targets.length; i++) { 5511 copy = _copy(vars); 5512 if (copy.startAt) { 5513 copy.startAt = _copy(copy.startAt); 5514 if (copy.startAt.cycle) { 5515 _applyCycle(copy.startAt, targets, i); 5516 } 5517 } 5518 if (cycle) { 5519 _applyCycle(copy, targets, i); 5520 } 5521 tl.to(targets[i], duration, copy, i * stagger); 5522 } 5523 return this.add(tl, position); 5524 }; 5525 5526 p.staggerFrom = function(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams, onCompleteAllScope) { 5527 vars.immediateRender = (vars.immediateRender != false); 5528 vars.runBackwards = true; 5529 return this.staggerTo(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams, onCompleteAllScope); 5530 }; 5531 5532 p.staggerFromTo = function(targets, duration, fromVars, toVars, stagger, position, onCompleteAll, onCompleteAllParams, onCompleteAllScope) { 5533 toVars.startAt = fromVars; 5534 toVars.immediateRender = (toVars.immediateRender != false && fromVars.immediateRender != false); 5535 return this.staggerTo(targets, duration, toVars, stagger, position, onCompleteAll, onCompleteAllParams, onCompleteAllScope); 5536 }; 5537 5538 p.call = function(callback, params, scope, position) { 5539 return this.add( TweenLite.delayedCall(0, callback, params, scope), position); 5540 }; 5541 5542 p.set = function(target, vars, position) { 5543 position = this._parseTimeOrLabel(position, 0, true); 5544 if (vars.immediateRender == null) { 5545 vars.immediateRender = (position === this._time && !this._paused); 5546 } 5547 return this.add( new TweenLite(target, 0, vars), position); 5548 }; 5549 5550 TimelineLite.exportRoot = function(vars, ignoreDelayedCalls) { 5551 vars = vars || {}; 5552 if (vars.smoothChildTiming == null) { 5553 vars.smoothChildTiming = true; 5554 } 5555 var tl = new TimelineLite(vars), 5556 root = tl._timeline, 5557 tween, next; 5558 if (ignoreDelayedCalls == null) { 5559 ignoreDelayedCalls = true; 5560 } 5561 root._remove(tl, true); 5562 tl._startTime = 0; 5563 tl._rawPrevTime = tl._time = tl._totalTime = root._time; 5564 tween = root._first; 5565 while (tween) { 5566 next = tween._next; 5567 if (!ignoreDelayedCalls || !(tween instanceof TweenLite && tween.target === tween.vars.onComplete)) { 5568 tl.add(tween, tween._startTime - tween._delay); 5569 } 5570 tween = next; 5571 } 5572 root.add(tl, 0); 5573 return tl; 5574 }; 5575 5576 p.add = function(value, position, align, stagger) { 5577 var curTime, l, i, child, tl, beforeRawTime; 5578 if (typeof(position) !== "number") { 5579 position = this._parseTimeOrLabel(position, 0, true, value); 5580 } 5581 if (!(value instanceof Animation)) { 5582 if ((value instanceof Array) || (value && value.push && _isArray(value))) {
5583 align = align || "normal"; 5584 stagger = stagger || 0; 5585 curTime = position; 5586 l = value.length; 5587 for (i = 0; i < l; i++) { 5588 if (_isArray(child = value[i])) { 5589 child = new TimelineLite({tweens:child}); 5590 } 5591 this.add(child, curTime); 5592 if (typeof(child) !== "string" && typeof(child) !== "function") { 5593 if (align === "sequence") { 5594 curTime = child._startTime + (child.totalDuration() / child._timeScale); 5595 } else if (align === "start") { 5596 child._startTime -= child.delay(); 5597 } 5598 } 5599 curTime += stagger; 5600 } 5601 return this._uncache(true); 5602 } else if (typeof(value) === "string") { 5603 return this.addLabel(value, position); 5604 } else if (typeof(value) === "function") { 5605 value = TweenLite.delayedCall(0, value); 5606 } else { 5607 throw("Cannot add " + value + " into the timeline; it is not a tween, timeline, function, or string."); 5608 } 5609 } 5610 5611 SimpleTimeline.prototype.add.call(this, value, position); 5612 5613 //if the timeline has already ended but the inserted tween/timeline extends the duration, we should enable this timeline again so that it renders properly. We should also align the playhead with the parent timeline's when appropriate. 5614 if (this._gc || this._time === this._duration) if (!this._paused) if (this._duration < this.duration()) { 5615 //in case any of the ancestors had completed but should now be enabled... 5616 tl = this; 5617 beforeRawTime = (tl.rawTime() > value._startTime); //if the tween is placed on the timeline so that it starts BEFORE the current rawTime, we should align the playhead (move the timeline). This is because sometimes users will create a timeline, let it finish, and much later append a tween and expect it to run instead of jumping to its end state. While technically one could argue that it should jump to its end state, that's not what users intuitively expect. 5618 while (tl._timeline) { 5619 if (beforeRawTime && tl._timeline.smoothChildTiming) { 5620 tl.totalTime(tl._totalTime, true); //moves the timeline (shifts its startTime) if necessary, and also enables it. 5621 } else if (tl._gc) { 5622 tl._enabled(true, false); 5623 } 5624 tl = tl._timeline; 5625 } 5626 } 5627 5628 return this; 5629 }; 5630 5631 p.remove = function(value) { 5632 if (value instanceof Animation) { 5633 this._remove(value, false); 5634 var tl = value._timeline = value.vars.useFrames ? Animation._rootFramesTimeline : Animation._rootTimeline; //now that it's removed, default it to the root timeline so that if it gets played again, it doesn't jump back into this timeline. 5635 value._startTime = (value._paused ? value._pauseTime : tl._time) - ((!value._reversed ? value._totalTime : value.totalDuration() - value._totalTime) / value._timeScale); //ensure that if it gets played again, the timing is correct. 5636 return this; 5637 } else if (value instanceof Array || (value && value.push && _isArray(value))) { 5638 var i = value.length; 5639 while (--i > -1) { 5640 this.remove(value[i]); 5641 } 5642 return this; 5643 } else if (typeof(value) === "string") { 5644 return this.removeLabel(value); 5645 } 5646 return this.kill(null, value); 5647 }; 5648 5649 p._remove = function(tween, skipDisable) { 5650 SimpleTimeline.prototype._remove.call(this, tween, skipDisable); 5651 var last = this._last; 5652 if (!last) { 5653 this._time = this._totalTime = this._duration = this._totalDuration = 0; 5654 } else if (this._time > last._startTime + last._totalDuration / last._timeScale) { 5655 this._time = this.duration(); 5656 this._totalTime = this._totalDuration; 5657 } 5658 return this; 5659 }; 5660 5661 p.append = function(value, offsetOrLabel) { 5662 return this.add(value, this._parseTimeOrLabel(null, offsetOrLabel, true, value)); 5663 }; 5664 5665 p.insert = p.insertMultiple = function(value, position, align, stagger) { 5666 return this.add(value, position || 0, align, stagger); 5667 }; 5668 5669 p.appendMultiple = function(tweens, offsetOrLabel, align, stagger) { 5670 return this.add(tweens, this._parseTimeOrLabel(null, offsetOrLabel, true, tweens), align, stagger); 5671 }; 5672 5673 p.addLabel = function(label, position) { 5674 this._labels[label] = this._parseTimeOrLabel(position); 5675 return this; 5676 }; 5677 5678 p.addPause = function(position, callback, params, scope) { 5679 var t = TweenLite.delayedCall(0, _pauseCallback, params, scope || this); 5680 t.vars.onComplete = t.vars.onReverseComplete = callback;
5681 t.data = "isPause"; 5682 this._hasPause = true; 5683 return this.add(t, position); 5684 }; 5685 5686 p.removeLabel = function(label) { 5687 delete this._labels[label]; 5688 return this; 5689 }; 5690 5691 p.getLabelTime = function(label) { 5692 return (this._labels[label] != null) ? this._labels[label] : -1; 5693 }; 5694 5695 p._parseTimeOrLabel = function(timeOrLabel, offsetOrLabel, appendIfAbsent, ignore) { 5696 var i; 5697 //if we're about to add a tween/timeline (or an array of them) that's already a child of this timeline, we should remove it first so that it doesn't contaminate the duration(). 5698 if (ignore instanceof Animation && ignore.timeline === this) { 5699 this.remove(ignore); 5700 } else if (ignore && ((ignore instanceof Array) || (ignore.push && _isArray(ignore)))) { 5701 i = ignore.length; 5702 while (--i > -1) { 5703 if (ignore[i] instanceof Animation && ignore[i].timeline === this) { 5704 this.remove(ignore[i]); 5705 } 5706 } 5707 } 5708 if (typeof(offsetOrLabel) === "string") { 5709 return this._parseTimeOrLabel(offsetOrLabel, (appendIfAbsent && typeof(timeOrLabel) === "number" && this._labels[offsetOrLabel] == null) ? timeOrLabel - this.duration() : 0, appendIfAbsent); 5710 } 5711 offsetOrLabel = offsetOrLabel || 0; 5712 if (typeof(timeOrLabel) === "string" && (isNaN(timeOrLabel) || this._labels[timeOrLabel] != null)) { //if the string is a number like "1", check to see if there's a label with that name, otherwise interpret it as a number (absolute value). 5713 i = timeOrLabel.indexOf("="); 5714 if (i === -1) { 5715 if (this._labels[timeOrLabel] == null) { 5716 return appendIfAbsent ? (this._labels[timeOrLabel] = this.duration() + offsetOrLabel) : offsetOrLabel; 5717 } 5718 return this._labels[timeOrLabel] + offsetOrLabel; 5719 } 5720 offsetOrLabel = parseInt(timeOrLabel.charAt(i-1) + "1", 10) * Number(timeOrLabel.substr(i+1)); 5721 timeOrLabel = (i > 1) ? this._parseTimeOrLabel(timeOrLabel.substr(0, i-1), 0, appendIfAbsent) : this.duration(); 5722 } else if (timeOrLabel == null) { 5723 timeOrLabel = this.duration(); 5724 } 5725 return Number(timeOrLabel) + offsetOrLabel; 5726 }; 5727 5728 p.seek = function(position, suppressEvents) { 5729 return this.totalTime((typeof(position) === "number") ? position : this._parseTimeOrLabel(position), (suppressEvents !== false)); 5730 }; 5731 5732 p.stop = function() { 5733 return this.paused(true); 5734 }; 5735 5736 p.gotoAndPlay = function(position, suppressEvents) { 5737 return this.play(position, suppressEvents); 5738 }; 5739 5740 p.gotoAndStop = function(position, suppressEvents) { 5741 return this.pause(position, suppressEvents); 5742 }; 5743 5744 p.render = function(time, suppressEvents, force) { 5745 if (this._gc) { 5746 this._enabled(true, false); 5747 } 5748 var totalDur = (!this._dirty) ? this._totalDuration : this.totalDuration(), 5749 prevTime = this._time, 5750 prevStart = this._startTime, 5751 prevTimeScale = this._timeScale, 5752 prevPaused = this._paused, 5753 tween, isComplete, next, callback, internalForce, pauseTween; 5754 if (time >= totalDur) { 5755 this._totalTime = this._time = totalDur; 5756 if (!this._reversed) if (!this._hasPausedChild()) { 5757 isComplete = true; 5758 callback = "onComplete"; 5759 internalForce = !!this._timeline.autoRemoveChildren; //otherwise, if the animation is unpaused/activated after it's already finished, it doesn't get removed from the parent timeline. 5760 if (this._duration === 0) if (time === 0 || this._rawPrevTime < 0 || this._rawPrevTime === _tinyNum) if (this._rawPrevTime !== time && this._first) { 5761 internalForce = true; 5762 if (this._rawPrevTime > _tinyNum) { 5763 callback = "onReverseComplete"; 5764 } 5765 } 5766 } 5767 this._rawPrevTime = (this._duration || !suppressEvents || time || this._rawPrevTime === time) ? time : _tinyNum; //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration timeline or tween, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect. We set the _rawPrevTime to be a precise tiny number to indicate this scenario rather than using another property/variable which would increase memory usage. This technique is less readable, but more efficient. 5768 time = totalDur + 0.0001; //to avoid occasional floating point rounding errors - sometimes child tweens/timelines were not being fully completed (their progress might be 0.999999999999998 instead of 1 because when _time - tween._startTime is performed, floating point errors would return a value that was SLIGHTLY off). Try (999999999999.7 - 999999999999) * 1 = 0.699951171875 instead of 0.7. 5769 5770 } else if (time < 0.0000001) { //to work around occasional floating point math artifacts, round super small values to 0. 5771 this._totalTime = this._time = 0; 5772 if (prevTime !== 0 || (this._duration === 0 && this._rawPrevTime !== _tinyNum && (this._rawPrevTime > 0 || (time < 0 && this._rawPrevTime >= 0)))) { 5773 callback = "onReverseComplete"; 5774 isComplete = this._reversed; 5775 } 5776 if (time < 0) { 5777 this._active = false; 5778 if (this._timeline.autoRemoveChildren && this._reversed) { //ensures proper GC if a timeline is resumed after it's finished reversing. 5779 internalForce = isComplete = true; 5780 callback = "onReverseComplete"; 5781 } else if (this._rawPrevTime >= 0 && this._first) { //when going back beyond the start, force a render so that zero-duration tweens that sit at the very beginning render their start values properly. Otherwise, if the parent timeline's playhead lands exactly at this timeline's startTime, and then moves backwards, the zero-duration tweens at the beginning would still be at their end state. 5782 internalForce = true; 5783 } 5784 this._rawPrevTime = time; 5785 } else { 5786 this._rawPrevTime = (this._duration || !suppressEvents || time || this._rawPrevTime === time) ? time : _tinyNum; //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration timeline or tween, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect. We set the _rawPrevTime to be a precise tiny number to indicate this scenario rather than using another property/variable which would increase memory usage. This technique is less readable, but more efficient. 5787 if (time === 0 && isComplete) { //if there's a zero-duration tween at the very beginning of a timeline and the playhead lands EXACTLY at time 0, that tween will correctly render its end values, but we need to keep the timeline alive for one more render so that the beginning values render properly as the parent's playhead keeps moving beyond the begining. Imagine obj.x starts at 0 and then we do tl.set(obj, {x:100}).to(obj, 1, {x:200}) and then later we tl.reverse()...the goal is to have obj.x revert to 0. If the playhead happens to land on exactly 0, without this chunk of code, it'd complete the timeline and remove it from the rendering queue (not good). 5788 tween = this._first; 5789 while (tween && tween._startTime === 0) { 5790 if (!tween._duration) { 5791 isComplete = false; 5792 } 5793 tween = tween._next; 5794 } 5795 } 5796 time = 0; //to avoid occasional floating point rounding errors (could cause problems especially with zero-duration tweens at the very beginning of the timeline) 5797 if (!this._initted) { 5798 internalForce = true; 5799 } 5800 } 5801 5802 } else { 5803 5804 if (this._hasPause && !this._forcingPlayhead && !suppressEvents) { 5805 if (time >= prevTime) { 5806 tween = this._first; 5807 while (tween && tween._startTime <= time && !pauseTween) { 5808 if (!tween._duration) if (tween.data === "isPause" && !tween.ratio && !(tween._startTime === 0 && this._rawPrevTime === 0)) { 5809 pauseTween = tween; 5810 } 5811 tween = tween._next; 5812 } 5813 } else { 5814 tween = this._last; 5815 while (tween && tween._startTime >= time && !pauseTween) { 5816 if (!tween._duration) if (tween.data === "isPause" && tween._rawPrevTime > 0) { 5817 pauseTween = tween; 5818 } 5819 tween = tween._prev; 5820 } 5821 } 5822 if (pauseTween) { 5823 this._time = time = pauseTween._startTime; 5824 this._totalTime = time + (this._cycle * (this._totalDuration + this._repeatDelay)); 5825 } 5826 } 5827 5828 this._totalTime = this._time = this._rawPrevTime = time; 5829 } 5830 if ((this._time === prevTime || !this._first) && !force && !internalForce && !pauseTween) { 5831 return; 5832 } else if (!this._initted) { 5833 this._initted = true; 5834 } 5835 5836 if (!this._active) if (!this._paused && this._time !== prevTime && time > 0) { 5837 this._active = true; //so that if the user renders the timeline (as opposed to the parent timeline rendering it), it is forced to re-render and align it with the proper time/frame on the next rendering cycle. Maybe the timeline already finished but the user manually re-renders it as halfway done, for example. 5838 } 5839 5840 if (prevTime === 0) if (this.vars.onStart) if (this._time !== 0) if (!suppressEvents) { 5841 this._callback("onStart"); 5842 } 5843 5844 if (this._time >= prevTime) { 5845 tween = this._first; 5846 while (tween) { 5847 next = tween._next; //record it here because the value could change after rendering... 5848 if (this._paused && !prevPaused) { //in case a tween pauses the timeline when rendering 5849 break; 5850 } else if (tween._active || (tween._startTime <= this._time && !tween._paused && !tween._gc)) { 5851 if (pauseTween === tween) { 5852 this.pause(); 5853 } 5854 if (!tween._reversed) { 5855 tween.render((time - tween._startTime) * tween._timeScale, suppressEvents, force); 5856 } else { 5857 tween.render(((!tween._dirty) ? tween._totalDuration : tween.totalDuration()) - ((time - tween._startTime) * tween._timeScale), suppressEvents, force); 5858 } 5859 } 5860 tween = next; 5861 } 5862 } else { 5863 tween = this._last; 5864 while (tween) { 5865 next = tween._prev; //record it here because the value could change after rendering... 5866 if (this._paused && !prevPaused) { //in case a tween pauses the timeline when rendering 5867 break; 5868 } else if (tween._active || (tween._startTime <= prevTime && !tween._paused && !tween._gc)) { 5869 if (pauseTween === tween) { 5870 pauseTween = tween._prev; //the linked list is organized by _startTime, thus it's possible that a tween could start BEFORE the pause and end after it, in which case it would be positioned before the pause tween in the linked list, but we should render it before we pause() the timeline and cease rendering. This is only a concern when going in reverse. 5871 while (pauseTween && pauseTween.endTime() > this._time) { 5872 pauseTween.render( (pauseTween._reversed ? pauseTween.totalDuration() - ((time - pauseTween._startTime) * pauseTween._timeScale) : (time - pauseTween._startTime) * pauseTween._timeScale), suppressEvents, force); 5873 pauseTween = pauseTween._prev; 5874 } 5875 pauseTween = null; 5876 this.pause(); 5877 } 5878 if (!tween._reversed) { 5879 tween.render((time - tween._startTime) * tween._timeScale, suppressEvents, force); 5880 } else { 5881 tween.render(((!tween._dirty) ? tween._totalDuration : tween.totalDuration()) - ((time - tween._startTime) * tween._timeScale), suppressEvents, force); 5882 } 5883 } 5884 tween = next; 5885 } 5886 } 5887 5888 if (this._onUpdate) if (!suppressEvents) { 5889 if (_lazyTweens.length) { //in case rendering caused any tweens to lazy-init, we should render them because typically when a timeline finishes, users expect things to have rendered fully. Imagine an onUpdate on a timeline that reports/checks tweened values. 5890 _lazyRender(); 5891 }
5892 this._callback("onUpdate"); 5893 } 5894 5895 if (callback) if (!this._gc) if (prevStart === this._startTime || prevTimeScale !== this._timeScale) if (this._time === 0 || totalDur >= this.totalDuration()) { //if one of the tweens that was rendered altered this timeline's startTime (like if an onComplete reversed the timeline), it probably isn't complete. If it is, don't worry, because whatever call altered the startTime would complete if it was necessary at the new time. The only exception is the timeScale property. Also check _gc because there's a chance that kill() could be called in an onUpdate 5896 if (isComplete) { 5897 if (_lazyTweens.length) { //in case rendering caused any tweens to lazy-init, we should render them because typically when a timeline finishes, users expect things to have rendered fully. Imagine an onComplete on a timeline that reports/checks tweened values. 5898 _lazyRender(); 5899 } 5900 if (this._timeline.autoRemoveChildren) { 5901 this._enabled(false, false); 5902 } 5903 this._active = false; 5904 } 5905 if (!suppressEvents && this.vars[callback]) { 5906 this._callback(callback); 5907 } 5908 } 5909 }; 5910 5911 p._hasPausedChild = function() { 5912 var tween = this._first; 5913 while (tween) { 5914 if (tween._paused || ((tween instanceof TimelineLite) && tween._hasPausedChild())) { 5915 return true; 5916 } 5917 tween = tween._next; 5918 } 5919 return false; 5920 }; 5921 5922 p.getChildren = function(nested, tweens, timelines, ignoreBeforeTime) { 5923 ignoreBeforeTime = ignoreBeforeTime || -9999999999; 5924 var a = [], 5925 tween = this._first, 5926 cnt = 0; 5927 while (tween) { 5928 if (tween._startTime < ignoreBeforeTime) { 5929 //do nothing 5930 } else if (tween instanceof TweenLite) { 5931 if (tweens !== false) { 5932 a[cnt++] = tween; 5933 } 5934 } else { 5935 if (timelines !== false) { 5936 a[cnt++] = tween; 5937 } 5938 if (nested !== false) { 5939 a = a.concat(tween.getChildren(true, tweens, timelines)); 5940 cnt = a.length; 5941 } 5942 } 5943 tween = tween._next; 5944 } 5945 return a; 5946 }; 5947 5948 p.getTweensOf = function(target, nested) { 5949 var disabled = this._gc, 5950 a = [], 5951 cnt = 0, 5952 tweens, i; 5953 if (disabled) { 5954 this._enabled(true, true); //getTweensOf() filters out disabled tweens, and we have to mark them as _gc = true when the timeline completes in order to allow clean garbage collection, so temporarily re-enable the timeline here. 5955 } 5956 tweens = TweenLite.getTweensOf(target); 5957 i = tweens.length; 5958 while (--i > -1) { 5959 if (tweens[i].timeline === this || (nested && this._contains(tweens[i]))) { 5960 a[cnt++] = tweens[i]; 5961 } 5962 } 5963 if (disabled) { 5964 this._enabled(false, true); 5965 } 5966 return a; 5967 }; 5968 5969 p.recent = function() { 5970 return this._recent; 5971 }; 5972 5973 p._contains = function(tween) { 5974 var tl = tween.timeline; 5975 while (tl) { 5976 if (tl === this) { 5977 return true; 5978 } 5979 tl = tl.timeline; 5980 } 5981 return false; 5982 }; 5983 5984 p.shiftChildren = function(amount, adjustLabels, ignoreBeforeTime) { 5985 ignoreBeforeTime = ignoreBeforeTime || 0; 5986 var tween = this._first, 5987 labels = this._labels, 5988 p; 5989 while (tween) { 5990 if (tween._startTime >= ignoreBeforeTime) { 5991 tween._startTime += amount; 5992 } 5993 tween = tween._next; 5994 } 5995 if (adjustLabels) { 5996 for (p in labels) { 5997 if (labels[p] >= ignoreBeforeTime) { 5998 labels[p] += amount; 5999 } 6000 } 6001 } 6002 return this._uncache(true); 6003 }; 6004 6005 p._kill = function(vars, target) { 6006 if (!vars && !target) { 6007 return this._enabled(false, false); 6008 } 6009 var tweens = (!target) ? this.getChildren(true, true, false) : this.getTweensOf(target), 6010 i = tweens.length, 6011 changed = false; 6012 while (--i > -1) { 6013 if (tweens[i]._kill(vars, target)) { 6014 changed = true; 6015 } 6016 } 6017 return changed; 6018 }; 6019 6020 p.clear = function(labels) { 6021 var tweens = this.getChildren(false, true, true), 6022 i = tweens.length; 6023 this._time = this._totalTime = 0; 6024 while (--i > -1) { 6025 tweens[i]._enabled(false, false); 6026 } 6027 if (labels !== false) { 6028 this._labels = {}; 6029 } 6030 return this._uncache(true); 6031 }; 6032 6033 p.invalidate = function() { 6034 var tween = this._first; 6035 while (tween) { 6036 tween.invalidate(); 6037 tween = tween._next; 6038 } 6039 return Animation.prototype.invalidate.call(this);; 6040 }; 6041 6042 p._enabled = function(enabled, ignoreTimeline) { 6043 if (enabled === this._gc) { 6044 var tween = this._first; 6045 while (tween) { 6046 tween._enabled(enabled, true); 6047 tween = tween._next; 6048 } 6049 } 6050 return SimpleTimeline.prototype._enabled.call(this, enabled, ignoreTimeline); 6051 }; 6052 6053 p.totalTime = function(time, suppressEvents, uncapped) { 6054 this._forcingPlayhead = true; 6055 var val = Animation.prototype.totalTime.apply(this, arguments); 6056 this._forcingPlayhead = false; 6057 return val; 6058 }; 6059 6060 p.duration = function(value) { 6061 if (!arguments.length) { 6062 if (this._dirty) { 6063 this.totalDuration(); //just triggers recalculation 6064 } 6065 return this._duration; 6066 } 6067 if (this.duration() !== 0 && value !== 0) { 6068 this.timeScale(this._duration / value); 6069 } 6070 return this; 6071 }; 6072 6073 p.totalDuration = function(value) { 6074 if (!arguments.length) { 6075 if (this._dirty) { 6076 var max = 0, 6077 tween = this._last, 6078 prevStart = 999999999999, 6079 prev, end; 6080 while (tween) { 6081 prev = tween._prev; //record it here in case the tween changes position in the sequence... 6082 if (tween._dirty) { 6083 tween.totalDuration(); //could change the tween._startTime, so make sure the tween's cache is clean before analyzing it. 6084 } 6085 if (tween._startTime > prevStart && this._sortChildren && !tween._paused) { //in case one of the tweens shifted out of order, it needs to be re-inserted into the correct position in the sequence 6086 this.add(tween, tween._startTime - tween._delay); 6087 } else { 6088 prevStart = tween._startTime; 6089 } 6090 if (tween._startTime < 0 && !tween._paused) { //children aren't allowed to have negative startTimes unless smoothChildTiming is true, so adjust here if one is found. 6091 max -= tween._startTime; 6092 if (this._timeline.smoothChildTiming) { 6093 this._startTime += tween._startTime / this._timeScale; 6094 } 6095 this.shiftChildren(-tween._startTime, false, -9999999999); 6096 prevStart = 0; 6097 } 6098 end = tween._startTime + (tween._totalDuration / tween._timeScale); 6099 if (end > max) { 6100 max = end; 6101 } 6102 tween = prev; 6103 } 6104 this._duration = this._totalDuration = max; 6105 this._dirty = false; 6106 } 6107 return this._totalDuration; 6108 } 6109 if (this.totalDuration() !== 0) if (value !== 0) { 6110 this.timeScale(this._totalDuration / value); 6111 } 6112 return this; 6113 }; 6114 6115 p.paused = function(value) { 6116 if (!value) { //if there's a pause directly at the spot from where we're unpausing, skip it. 6117 var tween = this._first, 6118 time = this._time; 6119 while (tween) { 6120 if (tween._startTime === time && tween.data === "isPause") { 6121 tween._rawPrevTime = 0; //remember, _rawPrevTime is how zero-duration tweens/callbacks sense directionality and determine whether or not to fire. If _rawPrevTime is the same as _startTime on the next render, it won't fire. 6122 } 6123 tween = tween._next; 6124 } 6125 } 6126 return Animation.prototype.paused.apply(this, arguments); 6127 }; 6128 6129 p.usesFrames = function() { 6130 var tl = this._timeline; 6131 while (tl._timeline) { 6132 tl = tl._timeline; 6133 } 6134 return (tl === Animation._rootFramesTimeline); 6135 }; 6136 6137 p.rawTime = function() { 6138 return this._paused ? this._totalTime : (this._timeline.rawTime() - this._startTime) * this._timeScale; 6139 }; 6140 6141 return TimelineLite; 6142 6143 }, true); 6144 6145 6146}); if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } 6147 6148//export to AMD/RequireJS and CommonJS/Node (precursor to full modular build system coming at a later date) 6149(function(name) { 6150 "use strict"; 6151 var getGlobal = function() { 6152 return (_gsScope.GreenSockGlobals || _gsScope)[name]; 6153 }; 6154 if (typeof(define) === "function" && define.amd) { //AMD 6155 define(["TweenLite"], getGlobal); 6156 } else if (typeof(module) !== "undefined" && module.exports) { //node 6157 require("./TweenLite.js"); //dependency 6158 module.exports = getGlobal(); 6159 } 6160}("TimelineLite")); 6161 6162/*! 6163 * VERSION: beta 1.15.2 6164 * DATE: 2015-01-27 6165 * UPDATES AND DOCS AT: http://greensock.com 6166 * 6167 * @license Copyright (c) 2008-2015, GreenSock. All rights reserved. 6168 * This work is subject to the terms at http://greensock.com/standard-license or for
6169 * Club GreenSock members, the software agreement that was issued with your membership. 6170 * 6171 * @author: Jack Doyle, [email protected] 6172 **/ 6173var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(global) !== "undefined") ? global : this || window; //helps ensure compatibility with AMD/RequireJS and CommonJS/Node 6174(_gsScope._gsQueue || (_gsScope._gsQueue = [])).push( function() { 6175 6176 "use strict"; 6177 6178 _gsScope._gsDefine("easing.Back", ["easing.Ease"], function(Ease) { 6179 6180 var w = (_gsScope.GreenSockGlobals || _gsScope), 6181 gs = w.com.greensock, 6182 _2PI = Math.PI * 2, 6183 _HALF_PI = Math.PI / 2, 6184 _class = gs._class, 6185 _create = function(n, f) { 6186 var C = _class("easing." + n, function(){}, true), 6187 p = C.prototype = new Ease(); 6188 p.constructor = C; 6189 p.getRatio = f; 6190 return C; 6191 }, 6192 _easeReg = Ease.register || function(){}, //put an empty function in place just as a safety measure in case someone loads an OLD version of TweenLite.js where Ease.register doesn't exist. 6193 _wrap = function(name, EaseOut, EaseIn, EaseInOut, aliases) { 6194 var C = _class("easing."+name, { 6195 easeOut:new EaseOut(), 6196 easeIn:new EaseIn(), 6197 easeInOut:new EaseInOut() 6198 }, true); 6199 _easeReg(C, name); 6200 return C; 6201 }, 6202 EasePoint = function(time, value, next) { 6203 this.t = time; 6204 this.v = value; 6205 if (next) { 6206 this.next = next; 6207 next.prev = this; 6208 this.c = next.v - value; 6209 this.gap = next.t - time; 6210 } 6211 }, 6212 6213 //Back 6214 _createBack = function(n, f) { 6215 var C = _class("easing." + n, function(overshoot) { 6216 this._p1 = (overshoot || overshoot === 0) ? overshoot : 1.70158; 6217 this._p2 = this._p1 * 1.525; 6218 }, true), 6219 p = C.prototype = new Ease(); 6220 p.constructor = C; 6221 p.getRatio = f; 6222 p.config = function(overshoot) { 6223 return new C(overshoot); 6224 }; 6225 return C; 6226 }, 6227 6228 Back = _wrap("Back", 6229 _createBack("BackOut", function(p) { 6230 return ((p = p - 1) * p * ((this._p1 + 1) * p + this._p1) + 1); 6231 }), 6232 _createBack("BackIn", function(p) { 6233 return p * p * ((this._p1 + 1) * p - this._p1); 6234 }), 6235 _createBack("BackInOut", function(p) { 6236 return ((p *= 2) < 1) ? 0.5 * p * p * ((this._p2 + 1) * p - this._p2) : 0.5 * ((p -= 2) * p * ((this._p2 + 1) * p + this._p2) + 2); 6237 }) 6238 ), 6239 6240 6241 //SlowMo 6242 SlowMo = _class("easing.SlowMo", function(linearRatio, power, yoyoMode) { 6243 power = (power || power === 0) ? power : 0.7; 6244 if (linearRatio == null) { 6245 linearRatio = 0.7; 6246 } else if (linearRatio > 1) { 6247 linearRatio = 1; 6248 } 6249 this._p = (linearRatio !== 1) ? power : 0; 6250 this._p1 = (1 - linearRatio) / 2; 6251 this._p2 = linearRatio; 6252 this._p3 = this._p1 + this._p2; 6253 this._calcEnd = (yoyoMode === true); 6254 }, true), 6255 p = SlowMo.prototype = new Ease(), 6256 SteppedEase, RoughEase, _createElastic; 6257 6258 p.constructor = SlowMo; 6259 p.getRatio = function(p) { 6260 var r = p + (0.5 - p) * this._p; 6261 if (p < this._p1) { 6262 return this._calcEnd ? 1 - ((p = 1 - (p / this._p1)) * p) : r - ((p = 1 - (p / this._p1)) * p * p * p * r); 6263 } else if (p > this._p3) { 6264 return this._calcEnd ? 1 - (p = (p - this._p3) / this._p1) * p : r + ((p - r) * (p = (p - this._p3) / this._p1) * p * p * p); 6265 } 6266 return this._calcEnd ? 1 : r; 6267 }; 6268 SlowMo.ease = new SlowMo(0.7, 0.7); 6269 6270 p.config = SlowMo.config = function(linearRatio, power, yoyoMode) { 6271 return new SlowMo(linearRatio, power, yoyoMode); 6272 }; 6273 6274 6275 //SteppedEase 6276 SteppedEase = _class("easing.SteppedEase", function(steps) { 6277 steps = steps || 1; 6278 this._p1 = 1 / steps; 6279 this._p2 = steps + 1; 6280 }, true); 6281 p = SteppedEase.prototype = new Ease(); 6282 p.constructor = SteppedEase; 6283 p.getRatio = function(p) { 6284 if (p < 0) { 6285 p = 0; 6286 } else if (p >= 1) { 6287 p = 0.999999999; 6288 } 6289 return ((this._p2 * p) >> 0) * this._p1; 6290 }; 6291 p.config = SteppedEase.config = function(steps) { 6292 return new SteppedEase(steps); 6293 }; 6294 6295 6296 //RoughEase 6297 RoughEase = _class("easing.RoughEase", function(vars) { 6298 vars = vars || {}; 6299 var taper = vars.taper || "none", 6300 a = [], 6301 cnt = 0, 6302 points = (vars.points || 20) | 0, 6303 i = points, 6304 randomize = (vars.randomize !== false), 6305 clamp = (vars.clamp === true), 6306 template = (vars.template instanceof Ease) ? vars.template : null,
6307 strength = (typeof(vars.strength) === "number") ? vars.strength * 0.4 : 0.4, 6308 x, y, bump, invX, obj, pnt; 6309 while (--i > -1) { 6310 x = randomize ? Math.random() : (1 / points) * i; 6311 y = template ? template.getRatio(x) : x; 6312 if (taper === "none") { 6313 bump = strength; 6314 } else if (taper === "out") { 6315 invX = 1 - x; 6316 bump = invX * invX * strength; 6317 } else if (taper === "in") { 6318 bump = x * x * strength; 6319 } else if (x < 0.5) { //"both" (start) 6320 invX = x * 2; 6321 bump = invX * invX * 0.5 * strength; 6322 } else { //"both" (end) 6323 invX = (1 - x) * 2; 6324 bump = invX * invX * 0.5 * strength; 6325 } 6326 if (randomize) { 6327 y += (Math.random() * bump) - (bump * 0.5); 6328 } else if (i % 2) { 6329 y += bump * 0.5; 6330 } else { 6331 y -= bump * 0.5; 6332 } 6333 if (clamp) { 6334 if (y > 1) { 6335 y = 1; 6336 } else if (y < 0) { 6337 y = 0; 6338 } 6339 } 6340 a[cnt++] = {x:x, y:y}; 6341 } 6342 a.sort(function(a, b) { 6343 return a.x - b.x; 6344 }); 6345 6346 pnt = new EasePoint(1, 1, null); 6347 i = points; 6348 while (--i > -1) { 6349 obj = a[i]; 6350 pnt = new EasePoint(obj.x, obj.y, pnt); 6351 } 6352 6353 this._prev = new EasePoint(0, 0, (pnt.t !== 0) ? pnt : pnt.next); 6354 }, true); 6355 p = RoughEase.prototype = new Ease(); 6356 p.constructor = RoughEase; 6357 p.getRatio = function(p) { 6358 var pnt = this._prev; 6359 if (p > pnt.t) { 6360 while (pnt.next && p >= pnt.t) { 6361 pnt = pnt.next; 6362 } 6363 pnt = pnt.prev; 6364 } else { 6365 while (pnt.prev && p <= pnt.t) { 6366 pnt = pnt.prev; 6367 } 6368 } 6369 this._prev = pnt; 6370 return (pnt.v + ((p - pnt.t) / pnt.gap) * pnt.c); 6371 }; 6372 p.config = function(vars) { 6373 return new RoughEase(vars); 6374 }; 6375 RoughEase.ease = new RoughEase(); 6376 6377 6378 //Bounce 6379 _wrap("Bounce", 6380 _create("BounceOut", function(p) { 6381 if (p < 1 / 2.75) { 6382 return 7.5625 * p * p; 6383 } else if (p < 2 / 2.75) { 6384 return 7.5625 * (p -= 1.5 / 2.75) * p + 0.75; 6385 } else if (p < 2.5 / 2.75) { 6386 return 7.5625 * (p -= 2.25 / 2.75) * p + 0.9375; 6387 } 6388 return 7.5625 * (p -= 2.625 / 2.75) * p + 0.984375; 6389 }), 6390 _create("BounceIn", function(p) { 6391 if ((p = 1 - p) < 1 / 2.75) { 6392 return 1 - (7.5625 * p * p); 6393 } else if (p < 2 / 2.75) { 6394 return 1 - (7.5625 * (p -= 1.5 / 2.75) * p + 0.75); 6395 } else if (p < 2.5 / 2.75) { 6396 return 1 - (7.5625 * (p -= 2.25 / 2.75) * p + 0.9375); 6397 } 6398 return 1 - (7.5625 * (p -= 2.625 / 2.75) * p + 0.984375); 6399 }), 6400 _create("BounceInOut", function(p) { 6401 var invert = (p < 0.5); 6402 if (invert) { 6403 p = 1 - (p * 2); 6404 } else { 6405 p = (p * 2) - 1; 6406 } 6407 if (p < 1 / 2.75) { 6408 p = 7.5625 * p * p; 6409 } else if (p < 2 / 2.75) { 6410 p = 7.5625 * (p -= 1.5 / 2.75) * p + 0.75; 6411 } else if (p < 2.5 / 2.75) { 6412 p = 7.5625 * (p -= 2.25 / 2.75) * p + 0.9375; 6413 } else { 6414 p = 7.5625 * (p -= 2.625 / 2.75) * p + 0.984375; 6415 } 6416 return invert ? (1 - p) * 0.5 : p * 0.5 + 0.5; 6417 }) 6418 ); 6419 6420 6421 //CIRC 6422 _wrap("Circ", 6423 _create("CircOut", function(p) { 6424 return Math.sqrt(1 - (p = p - 1) * p); 6425 }), 6426 _create("CircIn", function(p) { 6427 return -(Math.sqrt(1 - (p * p)) - 1); 6428 }), 6429 _create("CircInOut", function(p) { 6430 return ((p*=2) < 1) ? -0.5 * (Math.sqrt(1 - p * p) - 1) : 0.5 * (Math.sqrt(1 - (p -= 2) * p) + 1); 6431 }) 6432 ); 6433 6434 6435 //Elastic 6436 _createElastic = function(n, f, def) { 6437 var C = _class("easing." + n, function(amplitude, period) { 6438 this._p1 = (amplitude >= 1) ? amplitude : 1; //note: if amplitude is < 1, we simply adjust the period for a more natural feel. Otherwise the math doesn't work right and the curve starts at 1. 6439 this._p2 = (period || def) / (amplitude < 1 ? amplitude : 1); 6440 this._p3 = this._p2 / _2PI * (Math.asin(1 / this._p1) || 0); 6441 this._p2 = _2PI / this._p2; //precalculate to optimize 6442 }, true), 6443 p = C.prototype = new Ease(); 6444 p.constructor = C; 6445 p.getRatio = f; 6446 p.config = function(amplitude, period) { 6447 return new C(amplitude, period); 6448 }; 6449 return C;
6450 }; 6451 _wrap("Elastic", 6452 _createElastic("ElasticOut", function(p) { 6453 return this._p1 * Math.pow(2, -10 * p) * Math.sin( (p - this._p3) * this._p2 ) + 1; 6454 }, 0.3), 6455 _createElastic("ElasticIn", function(p) { 6456 return -(this._p1 * Math.pow(2, 10 * (p -= 1)) * Math.sin( (p - this._p3) * this._p2 )); 6457 }, 0.3), 6458 _createElastic("ElasticInOut", function(p) { 6459 return ((p *= 2) < 1) ? -0.5 * (this._p1 * Math.pow(2, 10 * (p -= 1)) * Math.sin( (p - this._p3) * this._p2)) : this._p1 * Math.pow(2, -10 *(p -= 1)) * Math.sin( (p - this._p3) * this._p2 ) * 0.5 + 1; 6460 }, 0.45) 6461 ); 6462 6463 6464 //Expo 6465 _wrap("Expo", 6466 _create("ExpoOut", function(p) { 6467 return 1 - Math.pow(2, -10 * p); 6468 }), 6469 _create("ExpoIn", function(p) { 6470 return Math.pow(2, 10 * (p - 1)) - 0.001; 6471 }), 6472 _create("ExpoInOut", function(p) { 6473 return ((p *= 2) < 1) ? 0.5 * Math.pow(2, 10 * (p - 1)) : 0.5 * (2 - Math.pow(2, -10 * (p - 1))); 6474 }) 6475 ); 6476 6477 6478 //Sine 6479 _wrap("Sine", 6480 _create("SineOut", function(p) { 6481 return Math.sin(p * _HALF_PI); 6482 }), 6483 _create("SineIn", function(p) { 6484 return -Math.cos(p * _HALF_PI) + 1; 6485 }), 6486 _create("SineInOut", function(p) { 6487 return -0.5 * (Math.cos(Math.PI * p) - 1); 6488 }) 6489 ); 6490 6491 _class("easing.EaseLookup", { 6492 find:function(s) { 6493 return Ease.map[s]; 6494 } 6495 }, true); 6496 6497 //register the non-standard eases 6498 _easeReg(w.SlowMo, "SlowMo", "ease,"); 6499 _easeReg(RoughEase, "RoughEase", "ease,"); 6500 _easeReg(SteppedEase, "SteppedEase", "ease,"); 6501 6502 return Back; 6503 6504 }, true); 6505 6506}); if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } 6507 6508 6509/*! 6510 * VERSION: 1.18.0 6511 * DATE: 2015-09-05 6512 * UPDATES AND DOCS AT: http://greensock.com 6513 * 6514 * @license Copyright (c) 2008-2015, GreenSock. All rights reserved. 6515 * This work is subject to the terms at http://greensock.com/standard-license or for 6516 * Club GreenSock members, the software agreement that was issued with your membership. 6517 * 6518 * @author: Jack Doyle, [email protected] 6519 */ 6520var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(global) !== "undefined") ? global : this || window; //helps ensure compatibility with AMD/RequireJS and CommonJS/Node 6521(_gsScope._gsQueue || (_gsScope._gsQueue = [])).push( function() { 6522 6523 "use strict"; 6524 6525 _gsScope._gsDefine("plugins.CSSPlugin", ["plugins.TweenPlugin","TweenLite"], function(TweenPlugin, TweenLite) { 6526 6527 /** @constructor **/ 6528 var CSSPlugin = function() { 6529 TweenPlugin.call(this, "css"); 6530 this._overwriteProps.length = 0; 6531 this.setRatio = CSSPlugin.prototype.setRatio; //speed optimization (avoid prototype lookup on this "hot" method) 6532 }, 6533 _globals = _gsScope._gsDefine.globals, 6534 _hasPriority, //turns true whenever a CSSPropTween instance is created that has a priority other than 0. This helps us discern whether or not we should spend the time organizing the linked list or not after a CSSPlugin's _onInitTween() method is called. 6535 _suffixMap, //we set this in _onInitTween() each time as a way to have a persistent variable we can use in other methods like _parse() without having to pass it around as a parameter and we keep _parse() decoupled from a particular CSSPlugin instance 6536 _cs, //computed style (we store this in a shared variable to conserve memory and make minification tighter 6537 _overwriteProps, //alias to the currently instantiating CSSPlugin's _overwriteProps array. We use this closure in order to avoid having to pass a reference around from method to method and aid in minification. 6538 _specialProps = {}, 6539 p = CSSPlugin.prototype = new TweenPlugin("css"); 6540 6541 p.constructor = CSSPlugin; 6542 CSSPlugin.version = "1.18.0"; 6543 CSSPlugin.API = 2; 6544 CSSPlugin.defaultTransformPerspective = 0; 6545 CSSPlugin.defaultSkewType = "compensated"; 6546 CSSPlugin.defaultSmoothOrigin = true; 6547 p = "px"; //we'll reuse the "p" variable to keep file size down 6548 CSSPlugin.suffixMap = {top:p, right:p, bottom:p, left:p, width:p, height:p, fontSize:p, padding:p, margin:p, perspective:p, lineHeight:""}; 6549 6550 6551 var _numExp = /(?:\d|\-\d|\.\d|\-\.\d)+/g, 6552 _relNumExp = /(?:\d|\-\d|\.\d|\-\.\d|\+=\d|\-=\d|\+=.\d|\-=\.\d)+/g,
6553 _valuesExp = /(?:\+=|\-=|\-|\b)[\d\-\.]+[a-zA-Z0-9]*(?:%|\b)/gi, //finds all the values that begin with numbers or += or -= and then a number. Includes suffixes. We use this to split complex values apart like "1px 5px 20px rgb(255,102,51)" 6554 _NaNExp = /(?![+-]?\d*\.?\d+|[+-]|e[+-]\d+)[^0-9]/g, //also allows scientific notation and doesn't kill the leading -/+ in -= and += 6555 _suffixExp = /(?:\d|\-|\+|=|#|\.)*/g, 6556 _opacityExp = /opacity *= *([^)]*)/i, 6557 _opacityValExp = /opacity:([^;]*)/i, 6558 _alphaFilterExp = /alpha\(opacity *=.+?\)/i, 6559 _rgbhslExp = /^(rgb|hsl)/, 6560 _capsExp = /([A-Z])/g, 6561 _camelExp = /-([a-z])/gi, 6562 _urlExp = /(^(?:url\(\"|url\())|(?:(\"\))$|\)$)/gi, //for pulling out urls from url(...) or url("...") strings (some browsers wrap urls in quotes, some don't when reporting things like backgroundImage) 6563 _camelFunc = function(s, g) { return g.toUpperCase(); }, 6564 _horizExp = /(?:Left|Right|Width)/i, 6565 _ieGetMatrixExp = /(M11|M12|M21|M22)=[\d\-\.e]+/gi, 6566 _ieSetMatrixExp = /progid\:DXImageTransform\.Microsoft\.Matrix\(.+?\)/i, 6567 _commasOutsideParenExp = /,(?=[^\)]*(?:\(|$))/gi, //finds any commas that are not within parenthesis 6568 _DEG2RAD = Math.PI / 180, 6569 _RAD2DEG = 180 / Math.PI, 6570 _forcePT = {}, 6571 _doc = document, 6572 _createElement = function(type) { 6573 return _doc.createElementNS ? _doc.createElementNS("http://www.w3.org/1999/xhtml", type) : _doc.createElement(type); 6574 }, 6575 _tempDiv = _createElement("div"), 6576 _tempImg = _createElement("img"), 6577 _internals = CSSPlugin._internals = {_specialProps:_specialProps}, //provides a hook to a few internal methods that we need to access from inside other plugins 6578 _agent = navigator.userAgent, 6579 _autoRound, 6580 _reqSafariFix, //we won't apply the Safari transform fix until we actually come across a tween that affects a transform property (to maintain best performance). 6581 6582 _isSafari, 6583 _isFirefox, //Firefox has a bug that causes 3D transformed elements to randomly disappear unless a repaint is forced after each update on each element. 6584 _isSafariLT6, //Safari (and Android 4 which uses a flavor of Safari) has a bug that prevents changes to "top" and "left" properties from rendering properly if changed on the same frame as a transform UNLESS we set the element's WebkitBackfaceVisibility to hidden (weird, I know). Doing this for Android 3 and earlier seems to actually cause other problems, though (fun!) 6585 _ieVers, 6586 _supportsOpacity = (function() { //we set _isSafari, _ieVers, _isFirefox, and _supportsOpacity all in one function here to reduce file size slightly, especially in the minified version. 6587 var i = _agent.indexOf("Android"), 6588 a = _createElement("a"); 6589 _isSafari = (_agent.indexOf("Safari") !== -1 && _agent.indexOf("Chrome") === -1 && (i === -1 || Number(_agent.substr(i+8, 1)) > 3)); 6590 _isSafariLT6 = (_isSafari && (Number(_agent.substr(_agent.indexOf("Version/")+8, 1)) < 6)); 6591 _isFirefox = (_agent.indexOf("Firefox") !== -1); 6592 if ((/MSIE ([0-9]{1,}[\.0-9]{0,})/).exec(_agent) || (/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/).exec(_agent)) { 6593 _ieVers = parseFloat( RegExp.$1 ); 6594 } 6595 if (!a) { 6596 return false; 6597 } 6598 a.style.cssText = "top:1px;opacity:.55;"; 6599 return /^0.55/.test(a.style.opacity); 6600 }()), 6601 _getIEOpacity = function(v) { 6602 return (_opacityExp.test( ((typeof(v) === "string") ? v : (v.currentStyle ? v.currentStyle.filter : v.style.filter) || "") ) ? ( parseFloat( RegExp.$1 ) / 100 ) : 1); 6603 }, 6604 _log = function(s) {//for logging messages, but in a way that won't throw errors in old versions of IE. 6605 if (window.console) { 6606 console.log(s); 6607 } 6608 }, 6609 6610 _prefixCSS = "", //the non-camelCase vendor prefix like "-o-", "-moz-", "-ms-", or "-webkit-" 6611 _prefix = "", //camelCase vendor prefix like "O", "ms", "Webkit", or "Moz". 6612 6613 // @private feed in a camelCase property name like "transform" and it will check to see if it is valid as-is or if it needs a vendor prefix. It returns the corrected camelCase property name (i.e. "WebkitTransform" or "MozTransform" or "transform" or null if no such property is found, like if the browser is IE8 or before, "transform" won't be found at all) 6614 _checkPropPrefix = function(p, e) { 6615 e = e || _tempDiv; 6616 var s = e.style, 6617 a, i; 6618 if (s[p] !== undefined) { 6619 return p; 6620 } 6621 p = p.charAt(0).toUpperCase() + p.substr(1); 6622 a = ["O","Moz","ms","Ms","Webkit"]; 6623 i = 5; 6624 while (--i > -1 && s[a[i]+p] === undefined) { } 6625 if (i >= 0) { 6626 _prefix = (i === 3) ? "ms" : a[i]; 6627 _prefixCSS = "-" + _prefix.toLowerCase() + "-"; 6628 return _prefix + p; 6629 } 6630 return null; 6631 }, 6632 6633 _getComputedStyle = _doc.defaultView ? _doc.defaultView.getComputedStyle : function() {}, 6634 6635 /** 6636 * @private Returns the css style for a particular property of an element. For example, to get whatever the current "left" css value for an element with an ID of "myElement", you could do: 6637 * var currentLeft = CSSPlugin.getStyle( document.getElementById("myElement"), "left"); 6638 * 6639 * @param {!Object} t Target element whose style property you want to query 6640 * @param {!string} p Property name (like "left" or "top" or "marginTop", etc.) 6641 * @param {Object=} cs Computed style object. This just provides a way to speed processing if you're going to get several properties on the same element in quick succession - you can reuse the result of the getComputedStyle() call. 6642 * @param {boolean=} calc If true, the value will not be read directly from the element's "style" property (if it exists there), but instead the getComputedStyle() result will be used. This can be useful when you want to ensure that the browser itself is interpreting the value. 6643 * @param {string=} dflt Default value that should be returned in the place of null, "none", "auto" or "auto auto". 6644 * @return {?string} The current property value 6645 */ 6646 _getStyle = CSSPlugin.getStyle = function(t, p, cs, calc, dflt) { 6647 var rv; 6648 if (!_supportsOpacity) if (p === "opacity") { //several versions of IE don't use the standard "opacity" property - they use things like filter:alpha(opacity=50), so we parse that here. 6649 return _getIEOpacity(t); 6650 } 6651 if (!calc && t.style[p]) { 6652 rv = t.style[p]; 6653 } else if ((cs = cs || _getComputedStyle(t))) { 6654 rv = cs[p] || cs.getPropertyValue(p) || cs.getPropertyValue(p.replace(_capsExp, "-$1").toLowerCase()); 6655 } else if (t.currentStyle) { 6656 rv = t.currentStyle[p]; 6657 } 6658 return (dflt != null && (!rv || rv === "none" || rv === "auto" || rv === "auto auto")) ? dflt : rv; 6659 }, 6660 6661 /** 6662 * @private Pass the target element, the property name, the numeric value, and the suffix (like "%", "em", "px", etc.) and it will spit back the equivalent pixel number. 6663 * @param {!Object} t Target element 6664 * @param {!string} p Property name (like "left", "top", "marginLeft", etc.) 6665 * @param {!number} v Value 6666 * @param {string=} sfx Suffix (like "px" or "%" or "em") 6667 * @param {boolean=} recurse If true, the call is a recursive one. In some browsers (like IE7/8), occasionally the value isn't accurately reported initially, but if we run the function again it will take effect. 6668 * @return {number} value in pixels 6669 */ 6670 _convertToPixels = _internals.convertToPixels = function(t, p, v, sfx, recurse) { 6671 if (sfx === "px" || !sfx) { return v; } 6672 if (sfx === "auto" || !v) { return 0; } 6673 var horiz = _horizExp.test(p), 6674 node = t, 6675 style = _tempDiv.style, 6676 neg = (v < 0), 6677 pix, cache, time; 6678 if (neg) { 6679 v = -v; 6680 } 6681 if (sfx === "%" && p.indexOf("border") !== -1) { 6682 pix = (v / 100) * (horiz ? t.clientWidth : t.clientHeight); 6683 } else { 6684 style.cssText = "border:0 solid red;position:" + _getStyle(t, "position") + ";line-height:0;"; 6685 if (sfx === "%" || !node.appendChild || sfx.charAt(0) === "v" || sfx === "rem") { 6686 node = t.parentNode || _doc.body; 6687 cache = node._gsCache; 6688 time = TweenLite.ticker.frame; 6689 if (cache && horiz && cache.time === time) { //performance optimization: we record the width of elements along with the ticker frame so that we can quickly get it again on the same tick (seems relatively safe to assume it wouldn't change on the same tick) 6690 return cache.width * v / 100; 6691 } 6692 style[(horiz ? "width" : "height")] = v + sfx; 6693 } else { 6694 style[(horiz ? "borderLeftWidth" : "borderTopWidth")] = v + sfx; 6695 } 6696 node.appendChild(_tempDiv); 6697 pix = parseFloat(_tempDiv[(horiz ? "offsetWidth" : "offsetHeight")]); 6698 node.removeChild(_tempDiv); 6699 if (horiz && sfx === "%" && CSSPlugin.cacheWidths !== false) { 6700 cache = node._gsCache = node._gsCache || {}; 6701 cache.time = time; 6702 cache.width = pix / v * 100; 6703 } 6704 if (pix === 0 && !recurse) { 6705 pix = _convertToPixels(t, p, v, sfx, true); 6706 } 6707 } 6708 return neg ? -pix : pix; 6709 }, 6710 _calculateOffset = _internals.calculateOffset = function(t, p, cs) { //for figuring out "top" or "left" in px when it's "auto". We need to factor in margin with the offsetLeft/offsetTop 6711 if (_getStyle(t, "position", cs) !== "absolute") { return 0; } 6712 var dim = ((p === "left") ? "Left" : "Top"),
6713 v = _getStyle(t, "margin" + dim, cs); 6714 return t["offset" + dim] - (_convertToPixels(t, p, parseFloat(v), v.replace(_suffixExp, "")) || 0); 6715 }, 6716 6717 // @private returns at object containing ALL of the style properties in camelCase and their associated values. 6718 _getAllStyles = function(t, cs) { 6719 var s = {}, 6720 i, tr, p; 6721 if ((cs = cs || _getComputedStyle(t, null))) { 6722 if ((i = cs.length)) { 6723 while (--i > -1) { 6724 p = cs[i]; 6725 if (p.indexOf("-transform") === -1 || _transformPropCSS === p) { //Some webkit browsers duplicate transform values, one non-prefixed and one prefixed ("transform" and "WebkitTransform"), so we must weed out the extra one here. 6726 s[p.replace(_camelExp, _camelFunc)] = cs.getPropertyValue(p); 6727 } 6728 } 6729 } else { //some browsers behave differently - cs.length is always 0, so we must do a for...in loop. 6730 for (i in cs) { 6731 if (i.indexOf("Transform") === -1 || _transformProp === i) { //Some webkit browsers duplicate transform values, one non-prefixed and one prefixed ("transform" and "WebkitTransform"), so we must weed out the extra one here. 6732 s[i] = cs[i]; 6733 } 6734 } 6735 } 6736 } else if ((cs = t.currentStyle || t.style)) { 6737 for (i in cs) { 6738 if (typeof(i) === "string" && s[i] === undefined) { 6739 s[i.replace(_camelExp, _camelFunc)] = cs[i]; 6740 } 6741 } 6742 } 6743 if (!_supportsOpacity) { 6744 s.opacity = _getIEOpacity(t); 6745 } 6746 tr = _getTransform(t, cs, false); 6747 s.rotation = tr.rotation; 6748 s.skewX = tr.skewX; 6749 s.scaleX = tr.scaleX; 6750 s.scaleY = tr.scaleY; 6751 s.x = tr.x; 6752 s.y = tr.y; 6753 if (_supports3D) { 6754 s.z = tr.z; 6755 s.rotationX = tr.rotationX; 6756 s.rotationY = tr.rotationY; 6757 s.scaleZ = tr.scaleZ; 6758 } 6759 if (s.filters) { 6760 delete s.filters; 6761 } 6762 return s; 6763 }, 6764 6765 // @private analyzes two style objects (as returned by _getAllStyles()) and only looks for differences between them that contain tweenable values (like a number or color). It returns an object with a "difs" property which refers to an object c
6765ontaining only those isolated properties and values for tweening, and a "firstMPT" property which refers to the first MiniPropTween instance in a linked list that recorded all the starting values of the different properties so that we can revert to them at the end or beginning of the tween - we don't want the cascading to get messed up. The forceLookup parameter is an optional generic object with properties that should be forced into the results - this is necessary for className tweens that are overwriting others because imagine a scenario where a rollover/rollout adds/removes a class and the user swipes the mouse over the target SUPER fast, thus nothing actually changed yet and the subsequent comparison of the properties would indicate they match (especially when px rounding is taken into consideration), thus no tweening is necessary even though it SHOULD tween and remove those properties after the tween (otherwise the inline styles will contaminate things). See the className SpecialProp code for details. 6766 _cssDif = function(t, s1, s2, vars, forceLookup) { 6767 var difs = {}, 6768 style = t.style, 6769 val, p, mpt; 6770 for (p in s2) { 6771 if (p !== "cssText") if (p !== "length") if (isNaN(p)) if (s1[p] !== (val = s2[p]) || (forceLookup && forceLookup[p])) if (p.indexOf("Origin") === -1) if (typeof(val) === "number" || typeof(val) === "string") { 6772 difs[p] = (val === "auto" && (p === "left" || p === "top")) ? _calculateOffset(t, p) : ((val === "" || val === "auto" || val === "none") && typeof(s1[p]) === "string" && s1[p].replace(_NaNExp, "") !== "") ? 0 : val; //if the ending value is defaulting ("" or "auto"), we check the starting value and if it can be parsed into a number (a string which could have a suffix too, like 700px), then we swap in 0 for "" or "auto" so that things actually tween. 6773 if (style[p] !== undefined) { //for className tweens, we must remember which properties already existed inline - the ones that didn't should be removed when the tween isn't in progress because they were only introduced to facilitate the transition between classes. 6774 mpt = new MiniPropTween(style, p, style[p], mpt); 6775 } 6776 } 6777 } 6778 if (vars) { 6779 for (p in vars) { //copy properties (except className) 6780 if (p !== "className") { 6781 difs[p] = vars[p]; 6782 } 6783 } 6784 } 6785 return {difs:difs, firstMPT:mpt}; 6786 }, 6787 _dimensions = {width:["Left","Right"], height:["Top","Bottom"]}, 6788 _margins = ["marginLeft","marginRight","marginTop","marginBottom"], 6789 6790 /** 6791 * @private Gets the width or height of an element 6792 * @param {!Object} t Target element 6793 * @param {!string} p Property name ("width" or "height") 6794 * @param {Object=} cs Computed style object (if one exists). Just a speed optimization. 6795 * @return {number} Dimension (in pixels) 6796 */ 6797 _getDimension = function(t, p, cs) { 6798 var v = parseFloat((p === "width") ? t.offsetWidth : t.offsetHeight), 6799 a = _dimensions[p], 6800 i = a.length; 6801 cs = cs || _getComputedStyle(t, null); 6802 while (--i > -1) { 6803 v -= parseFloat( _getStyle(t, "padding" + a[i], cs, true) ) || 0; 6804 v -= parseFloat( _getStyle(t, "border" + a[i] + "Width", cs, true) ) || 0; 6805 } 6806 return v; 6807 }, 6808 6809 // @private Parses position-related complex strings like "top left" or "50px 10px" or "70% 20%", etc. which are used for things like transformOrigin or backgroundPosition. Optionally decorates a supplied object (recObj) with the following properties: "ox" (offsetX), "oy" (offsetY), "oxp" (if true, "ox" is a percentage not a pixel value), and "oxy" (if true, "oy" is a percentage not a pixel value) 6810 _parsePosition = function(v, recObj) { 6811 if (v === "contain" || v === "auto" || v === "auto auto") { 6812 return v + " "; 6813 } 6814 if (v == null || v === "") { //note: Firefox uses "auto auto" as default whereas Chrome uses "auto". 6815 v = "0 0"; 6816 } 6817 var a = v.split(" "), 6818 x = (v.indexOf("left") !== -1) ? "0%" : (v.indexOf("right") !== -1) ? "100%" : a[0], 6819 y = (v.indexOf("top") !== -1) ? "0%" : (v.indexOf("bottom") !== -1) ? "100%" : a[1]; 6820 if (y == null) { 6821 y = (x === "center") ? "50%" : "0"; 6822 } else if (y === "center") { 6823 y = "50%"; 6824 } 6825 if (x === "center" || (isNaN(parseFloat(x)) && (x + "").indexOf("=") === -1)) { //remember, the user could flip-flop the values and say "bottom center" or "center bottom", etc. "center" is ambiguous because it c
6825ould be used to describe horizontal or vertical, hence the isNaN(). If there's an "=" sign in the value, it's relative. 6826 x = "50%"; 6827 } 6828 v = x + " " + y + ((a.length > 2) ? " " + a[2] : ""); 6829 if (recObj) { 6830 recObj.oxp = (x.indexOf("%") !== -1); 6831 recObj.oyp = (y.indexOf("%") !== -1); 6832 recObj.oxr = (x.charAt(1) === "="); 6833 recObj.oyr = (y.charAt(1) === "="); 6834 recObj.ox = parseFloat(x.replace(_NaNExp, "")); 6835 recObj.oy = parseFloat(y.replace(_NaNExp, "")); 6836 recObj.v = v; 6837 } 6838 return recObj || v; 6839 }, 6840 6841 /** 6842 * @private Takes an ending value (typically a string, but can be a number) and a starting value and returns the change between the two, looking for relative value indicators like += and -= and it also ignores suffixes (but make sure the ending value starts with a number or +=/-= and that the starting value is a NUMBER!) 6843 * @param {(number|string)} e End value which is typically a string, but could be a number 6844 * @param {(number|string)} b Beginning value which is typically a string but could be a number 6845 * @return {number} Amount of change between the beginning and ending values (relative values that have a "+=" or "-=" are recognized) 6846 */ 6847 _parseChange = function(e, b) { 6848 return (typeof(e) === "string" && e.charAt(1) === "=") ? parseInt(e.charAt(0) + "1", 10) * parseFloat(e.substr(2)) : parseFloat(e) - parseFloat(b); 6849 }, 6850 6851 /** 6852 * @private Takes a value and a default number, checks if the value is relative, null, or numeric and spits back a normalized number accordingly. Primarily used in the _parseTransform() function. 6853 * @param {Object} v Value to be parsed 6854 * @param {!number} d Default value (which is also used for relative calculations if "+=" or "-=" is found in the first parameter) 6855 * @return {number} Parsed value 6856 */ 6857 _parseVal = function(v, d) { 6858 return (v == null) ? d : (typeof(v) === "string" && v.charAt(1) === "=") ? parseInt(v.charAt(0) + "1", 10) * parseFloat(v.substr(2)) + d : parseFloat(v); 6859 }, 6860 6861 /** 6862 * @private Translates strings like "40deg" or "40" or 40rad" or "+=40deg" or "270_short" or "-90_cw" or "+=45_ccw" to a numeric radian angle. Of course a starting/default value must be fed in too so that relative values can be calculated properly. 6863 * @param {Object} v Value to be parsed 6864 * @param {!number} d Default value (which is also used for relative calculations if "+=" or "-=" is found in the first parameter) 6865 * @param {string=} p property name for directionalEnd (optional - only used when the parsed value is directional ("_short", "_cw", or "_ccw" suffix). We need a way to store the uncompensated value so that at the end of the tween, we set it to exactly what was requested with no directional compensation). Property name would be "rotation", "rotationX", or "rotationY" 6866 * @param {Object=} directionalEnd An object that will store the raw end values for directional angles ("_short", "_cw", or "_ccw" suffix). We need a way to store the uncompensated value so that at the end of the tween, we set it to exactly what was requested with no directional compensation. 6867 * @return {number} parsed angle in radians 6868 */ 6869 _parseAngle = function(v, d, p, directionalEnd) { 6870 var min = 0.000001, 6871 cap, split, dif, result, isRelative; 6872 if (v == null) { 6873 result = d; 6874 } else if (typeof(v) === "number") { 6875 result = v; 6876 } else { 6877 cap = 360; 6878 split = v.split("_"); 6879 isRelative = (v.charAt(1) === "="); 6880 dif = (isRelative ? parseInt(v.charAt(0) + "1", 10) * parseFloat(split[0].substr(2)) : parseFloat(split[0])) * ((v.indexOf("rad") === -1) ? 1 : _RAD2DEG) - (isRelative ? 0 : d); 6881 if (split.length) { 6882 if (directionalEnd) { 6883 directionalEnd[p] = d + dif; 6884 } 6885 if (v.indexOf("short") !== -1) { 6886 dif = dif % cap; 6887 if (dif !== dif % (cap / 2)) { 6888 dif = (dif < 0) ? dif + cap : dif - cap; 6889 } 6890 } 6891 if (v.indexOf("_cw") !== -1 && dif < 0) { 6892 dif = ((dif + cap * 9999999999) % cap) - ((dif / cap) | 0) * cap; 6893 } else if (v.indexOf("ccw") !== -1 && dif > 0) { 6894 dif = ((dif - cap * 9999999999) % cap) - ((dif / cap) | 0) * cap; 6895 } 6896 } 6897 result = d + dif; 6898 } 6899 if (result < min && result > -min) { 6900 result = 0; 6901 } 6902 return result; 6903 }, 6904 6905 _colorLookup = {aqua:[0,255,255], 6906 lime:[0,255,0], 6907 silver:[192,192,192], 6908 black:[0,0,0], 6909 maroon:[128,0,0], 6910 teal:[0,128,128], 6911 blue:[0,0,255], 6912 navy:[0,0,128], 6913 white:[255,255,255], 6914 fuchsia:[255,0,255], 6915 olive:[128,128,0], 6916 yellow:[255,255,0], 6917 orange:[255,165,0], 6918 gray:[128,128,128], 6919 purple:[128,0,128], 6920 green:[0,128,0], 6921 red:[255,0,0], 6922 pink:[255,192,203], 6923 cyan:[0,255,255], 6924 transparent:[255,255,255,0]}, 6925 6926 _hue = function(h, m1, m2) { 6927 h = (h < 0) ? h + 1 : (h > 1) ? h - 1 : h; 6928 return ((((h * 6 < 1) ? m1 + (m2 - m1) * h * 6 : (h < 0.5) ? m2 : (h * 3 < 2) ? m1 + (m2 - m1) * (2 / 3 - h) * 6 : m1) * 255) + 0.5) | 0; 6929 }, 6930 6931 /** 6932 * @private Parses a color (like #9F0, #FF9900, rgb(255,51,153) or hsl(108, 50%, 10%)) into an array with 3 elements for red, green, and blue or if toHSL parameter is true, it will populate the array with hue, saturation, and lightness values. If a relative value is found in an hsl() or hsla() string, it will preserve those relative prefixes and all the values in the array will be strings instead of numbers (in all other cases it will be populated with numbers). 6933 * @param {(string|number)} v The value the should be parsed which could be a string like #9F0 or rgb(255,102,51) or rgba(255,0,0,0.5) or it could be a number like 0xFF00CC or even a named color like red, blue, purple, etc. 6934 * @param {(boolean)} toHSL If true, an hsl() or hsla() value will be returned instead of rgb() or rgba() 6935 * @return {Array.<number>} An array containing red, green, and blue (and optionally alpha) in that order, or if the toHSL parameter was true, the array will contain hue, saturation and lightness (and optionally alpha) in that order. Always numbers unless there's a relative prefix found in an hsl() or hsla() string and toHSL is true. 6936 */ 6937 _parseColor = CSSPlugin.parseColor = function(v, toHSL) { 6938 var a, r, g, b, h, s, l, max, min, d, wasHSL; 6939 if (!v) { 6940 a = _colorLookup.black; 6941 } else if (typeof(v) === "number") { 6942 a = [v >> 16, (v >> 8) & 255, v & 255]; 6943 } else { 6944 if (v.charAt(v.length - 1) === ",") { //sometimes a trailing comma is included and we should chop it off (typically from a comma-delimited list of values like a textShadow:"2px 2px 2px blue, 5px 5px 5px rgb(255,0,0)" - in this example "blue," has a trailing comma. We could strip it out inside parseComplex() but we'd need to do it to the beginning and ending values plus it wouldn't provide protection from other potential scenarios like if the user passes in a similar value. 6945 v = v.substr(0, v.length - 1); 6946 } 6947 if (_colorLookup[v]) { 6948 a = _colorLookup[v]; 6949 } else if (v.charAt(0) === "#") { 6950 if (v.length === 4) { //for shorthand like #9F0 6951 r = v.charAt(1); 6952 g = v.charAt(2); 6953 b = v.charAt(3); 6954 v = "#" + r + r + g + g + b + b; 6955 } 6956 v = parseInt(v.substr(1), 16); 6957 a = [v >> 16, (v >> 8) & 255, v & 255]; 6958 } else if (v.substr(0, 3) === "hsl") { 6959 a = wasHSL = v.match(_numExp); 6960 if (!toHSL) { 6961 h = (Number(a[0]) % 360) / 360;
6962 s = Number(a[1]) / 100; 6963 l = Number(a[2]) / 100; 6964 g = (l <= 0.5) ? l * (s + 1) : l + s - l * s; 6965 r = l * 2 - g; 6966 if (a.length > 3) { 6967 a[3] = Number(v[3]); 6968 } 6969 a[0] = _hue(h + 1 / 3, r, g); 6970 a[1] = _hue(h, r, g); 6971 a[2] = _hue(h - 1 / 3, r, g); 6972 } else if (v.indexOf("=") !== -1) { //if relative values are found, just return the raw strings with the relative prefixes in place. 6973 return v.match(_relNumExp); 6974 } 6975 } else { 6976 a = v.match(_numExp) || _colorLookup.transparent; 6977 } 6978 a[0] = Number(a[0]); 6979 a[1] = Number(a[1]); 6980 a[2] = Number(a[2]); 6981 if (a.length > 3) { 6982 a[3] = Number(a[3]); 6983 } 6984 } 6985 if (toHSL && !wasHSL) { 6986 r = a[0] / 255; 6987 g = a[1] / 255; 6988 b = a[2] / 255; 6989 max = Math.max(r, g, b); 6990 min = Math.min(r, g, b); 6991 l = (max + min) / 2; 6992 if (max === min) { 6993 h = s = 0; 6994 } else { 6995 d = max - min; 6996 s = l > 0.5 ? d / (2 - max - min) : d / (max + min); 6997 h = (max === r) ? (g - b) / d + (g < b ? 6 : 0) : (max === g) ? (b - r) / d + 2 : (r - g) / d + 4; 6998 h *= 60; 6999 } 7000 a[0] = (h + 0.5) | 0; 7001 a[1] = (s * 100 + 0.5) | 0; 7002 a[2] = (l * 100 + 0.5) | 0; 7003 } 7004 return a; 7005 }, 7006 _formatColors = function(s, toHSL) { 7007 var colors = s.match(_colorExp) || [], 7008 charIndex = 0, 7009 parsed = colors.length ? "" : s, 7010 i, color, temp; 7011 for (i = 0; i < colors.length; i++) { 7012 color = colors[i]; 7013 temp = s.substr(charIndex, s.indexOf(color, charIndex)-charIndex); 7014 charIndex += temp.length + color.length; 7015 color = _parseColor(color, toHSL); 7016 if (color.length === 3) { 7017 color.push(1); 7018 } 7019 parsed += temp + (toHSL ? "hsla(" + color[0] + "," + color[1] + "%," + color[2] + "%," + color[3] : "rgba(" + color.join(",")) + ")"; 7020 } 7021 return parsed; 7022 }, 7023 _colorExp = "(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#.+?\\b"; //we'll dynamically build this Regular Expression to conserve file size. After building it, it will be able to find rgb(), rgba(), # (hexadecimal), and named color values like red, blue, purple, etc. 7024 7025 for (p in _colorLookup) { 7026 _colorExp += "|" + p + "\\b"; 7027 } 7028 _colorExp = new RegExp(_colorExp+")", "gi"); 7029 7030 CSSPlugin.colorStringFilter = function(a) { 7031 var combined = a[0] + a[1], 7032 toHSL; 7033 _colorExp.lastIndex = 0; 7034 if (_colorExp.test(combined)) { 7035 toHSL = (combined.indexOf("hsl(") !== -1 || combined.indexOf("hsla(") !== -1); 7036 a[0] = _formatColors(a[0], toHSL); 7037 a[1] = _formatColors(a[1], toHSL); 7038 } 7039 }; 7040 7041 if (!TweenLite.defaultStringFilter) { 7042 TweenLite.defaultStringFilter = CSSPlugin.colorStringFilter; 7043 } 7044 7045 /** 7046 * @private Returns a formatter function that handles taking a string (or number in some cases) and returning a consistently formatted one in terms of delimiters, quantity of values, etc. For example, we may get boxShadow values defined as "0px red" or "0px 0px 10px rgb(255,0,0)" or "0px 0px 20px 20px #F00" and we need to ensure that what we get back is described with 4 numbers and a color. This allows us to feed it into the _parseComplex() method and split the values up appropriately. The neat thing about this _getFormatter() function is that the dflt defines a pattern as well as a default, so for example, _getFormatter("0px 0px 0px 0px #777", true) not only sets the default as 0px for all distances and #777 for the color, but also sets the pattern such that 4 numbers and a color will always get returned. 7047 * @param {!string} dflt The default value and pattern to follow. So "0px 0px 0px 0px #777" will ensure that 4 numbers and a color will always get returned. 7048 * @param {boolean=} clr If true, the values should be searched for color-related data. For example, boxShadow values typically contain a color whereas borderRadius don't. 7049 * @param {boolean=} collapsible If true, the value is a top/left/right/bottom style one that acts like margin or padding, where if only one value is received, it's used for all 4; if 2 are received, the first is duplicated for 3rd (bottom) and the 2nd is duplicated for the 4th spot (left), etc. 7050 * @return {Function} formatter function 7051 */ 7052 var _getFormatter = function(dflt, clr, collapsible, multi) { 7053 if (dflt == null) { 7054 return function(v) {return v;}; 7055 } 7056 var dColor = clr ? (dflt.match(_colorExp) || [""])[0] : "", 7057 dVals = dflt.split(dColor).join("").match(_valuesExp) || [], 7058 pfx = dflt.substr(0, dflt.indexOf(dVals[0])), 7059 sfx = (dflt.charAt(dflt.length - 1) === ")") ? ")" : "", 7060 delim = (dflt.indexOf(" ") !== -1) ? " " : ",", 7061 numVals = dVals.length, 7062 dSfx = (numVals > 0) ? dVals[0].replace(_numExp, "") : "", 7063 formatter; 7064 if (!numVals) { 7065 return function(v) {return v;}; 7066 } 7067 if (clr) { 7068 formatter = function(v) { 7069 var color, vals, i, a; 7070 if (typeof(v) === "number") { 7071 v += dSfx; 7072 } else if (multi && _commasOutsideParenExp.test(v)) { 7073 a = v.replace(_commasOutsideParenExp, "|").split("|"); 7074 for (i = 0; i < a.length; i++) { 7075 a[i] = formatter(a[i]); 7076 } 7077 return a.join(","); 7078 } 7079 color = (v.match(_colorExp) || [dColor])[0]; 7080 vals = v.split(color).join("").match(_valuesExp) || []; 7081 i = vals.length; 7082 if (numVals > i--) { 7083 while (++i < numVals) { 7084 vals[i] = collapsible ? vals[(((i - 1) / 2) | 0)] : dVals[i];
7085 } 7086 } 7087 return pfx + vals.join(delim) + delim + color + sfx + (v.indexOf("inset") !== -1 ? " inset" : ""); 7088 }; 7089 return formatter; 7090 7091 } 7092 formatter = function(v) { 7093 var vals, a, i; 7094 if (typeof(v) === "number") { 7095 v += dSfx; 7096 } else if (multi && _commasOutsideParenExp.test(v)) { 7097 a = v.replace(_commasOutsideParenExp, "|").split("|"); 7098 for (i = 0; i < a.length; i++) { 7099 a[i] = formatter(a[i]); 7100 } 7101 return a.join(","); 7102 } 7103 vals = v.match(_valuesExp) || []; 7104 i = vals.length; 7105 if (numVals > i--) { 7106 while (++i < numVals) { 7107 vals[i] = collapsible ? vals[(((i - 1) / 2) | 0)] : dVals[i]; 7108 } 7109 } 7110 return pfx + vals.join(delim) + sfx; 7111 }; 7112 return formatter; 7113 }, 7114 7115 /** 7116 * @private returns a formatter function that's used for edge-related values like marginTop, marginLeft, paddingBottom, paddingRight, etc. Just pass a comma-delimited list of property names related to the edges. 7117 * @param {!string} props a comma-delimited list of property names in order from top to left, like "marginTop,marginRight,marginBottom,marginLeft" 7118 * @return {Function} a formatter function 7119 */ 7120 _getEdgeParser = function(props) { 7121 props = props.split(","); 7122 return function(t, e, p, cssp, pt, plugin, vars) { 7123 var a = (e + "").split(" "), 7124 i; 7125 vars = {}; 7126 for (i = 0; i < 4; i++) { 7127 vars[props[i]] = a[i] = a[i] || a[(((i - 1) / 2) >> 0)]; 7128 } 7129 return cssp.parse(t, vars, pt, plugin); 7130 }; 7131 }, 7132 7133 // @private used when other plugins must tween values first, like BezierPlugin or ThrowPropsPlugin, etc. That plugin's setRatio() gets called first so that the values are updated, and then we loop through the MiniPropTweens which handle copying the values into their appropriate slots so that they can then be applied correctly in the main CSSPlugin setRatio() method. Remember, we typically create a proxy object that has a bunch of uniquely-named properties that we feed to the sub-plugin and it does its magic normally, and then we must interpret those values and apply them to the css because often numbers must get combined/concatenated, suffixes added, etc. to work with css, like boxShadow could have 4 values plus a color. 7134 _setPluginRatio = _internals._setPluginRatio = function(v) { 7135 this.plugin.setRatio(v); 7136 var d = this.data, 7137 proxy = d.proxy, 7138 mpt = d.firstMPT, 7139 min = 0.000001, 7140 val, pt, i, str; 7141 while (mpt) { 7142 val = proxy[mpt.v]; 7143 if (mpt.r) { 7144 val = Math.round(val); 7145 } else if (val < min && val > -min) { 7146 val = 0; 7147 } 7148 mpt.t[mpt.p] = val; 7149 mpt = mpt._next; 7150 } 7151 if (d.autoRotate) { 7152 d.autoRotate.rotation = proxy.rotation; 7153 } 7154 //at the end, we must set the CSSPropTween's "e" (end) value dynamically here because that's what is used in the final setRatio() method. 7155 if (v === 1) { 7156 mpt = d.firstMPT; 7157 while (mpt) { 7158 pt = mpt.t; 7159 if (!pt.type) { 7160 pt.e = pt.s + pt.xs0; 7161 } else if (pt.type === 1) { 7162 str = pt.xs0 + pt.s + pt.xs1; 7163 for (i = 1; i < pt.l; i++) { 7164 str += pt["xn"+i] + pt["xs"+(i+1)]; 7165 } 7166 pt.e = str; 7167 } 7168 mpt = mpt._next; 7169 } 7170 } 7171 }, 7172 7173 /** 7174 * @private @constructor Used by a few SpecialProps to hold important values for proxies. For example, _parseToProxy() creates a MiniPropTween instance for each property that must get tweened on the proxy, and we record the original property name as well as the unique one we create for the proxy, plus whether or not the value needs to be rounded plus the original value. 7175 * @param {!Object} t target object whose property we're tweening (often a CSSPropTween) 7176 * @param {!string} p property name 7177 * @param {(number|string|object)} v value 7178 * @param {MiniPropTween=} next next MiniPropTween in the linked list 7179 * @param {boolean=} r if true, the tweened value should be rounded to the nearest integer 7180 */ 7181 MiniPropTween = function(t, p, v, next, r) { 7182 this.t = t; 7183 this.p = p; 7184 this.v = v; 7185 this.r = r; 7186 if (next) { 7187 next._prev = this; 7188 this._next = next; 7189 } 7190 }, 7191 7192 /** 7193 * @private Most other plugins (like BezierPlugin and ThrowPropsPlugin and others) can only tween numeric values, but CSSPlugin must accommodate special values that have a bunch of extra data (like a suffix or strings between numeric values, etc.). For example, boxShadow has values like "10px 10px 20px 30px rgb(255,0,0)" which would utterly confuse other plugins. This method allows us to split that data apart and grab only the numeric data and attach it to uniquely-named properties of a generic proxy object ({}) so that we can feed that to virtually any plugin to have the numbers tweened. However, we must also keep track of which properties from the proxy go with which CSSPropTween values and instances. So we create a linked list of MiniPropTweens. Each one records a target (the original CSSPropTween), property (like "s" or "xn1" or "xn2") that we're tweening and the unique property name that was used for the proxy (like "boxShadow_xn1" and "boxShadow_xn2") and whether or not they need to be roun
7193ded. That way, in the _setPluginRatio() method we can simply copy the values over from the proxy to the CSSPropTween instance(s). Then, when the main CSSPlugin setRatio() method runs and applies the CSSPropTween values accordingly, they're updated nicely. So the external plugin tweens the numbers, _setPluginRatio() copies them over, and setRatio() acts normally, applying css-specific values to the element. 7194 * This method returns an object that has the following properties: 7195 * - proxy: a generic object containing the starting values for all the properties that will be tweened by the external plugin. This is what we feed to the external _onInitTween() as the target 7196 * - end: a generic object containing the ending values for all the properties that will be tweened by the external plugin. This is what we feed to the external plugin's _onInitTween() as the destination values 7197 * - firstMPT: the first MiniPropTween in the linked list 7198 * - pt: the first CSSPropTween in the linked list that was created when parsing. If shallow is true, this linked list will NOT attach to the one passed into the _parseToProxy() as the "pt" (4th) parameter. 7199 * @param {!Object} t target object to be tweened 7200 * @param {!(Object|string)} vars the object containing the information about the tweening values (typically the end/destination values) that should be parsed 7201 * @param {!CSSPlugin} cssp The CSSPlugin instance 7202 * @param {CSSPropTween=} pt the next CSSPropTween in the linked list 7203 * @param {TweenPlugin=} plugin the external TweenPlugin instance that will be handling tweening the numeric values 7204 * @param {boolean=} shallow if true, the resulting linked list from the parse will NOT be attached to the CSSPropTween that was passed in as the "pt" (4th) parameter. 7205 * @return An object containing the following properties: proxy, end, firstMPT, and pt (see above for descriptions) 7206 */ 7207 _parseToProxy = _internals._parseToProxy = function(t, vars, cssp, pt, plugin, shallow) { 7208 var bpt = pt, 7209 start = {}, 7210 end = {}, 7211 transform = cssp._transform, 7212 oldForce = _forcePT, 7213 i, p, xp, mpt, firstPT; 7214 cssp._transform = null; 7215 _forcePT = vars; 7216 pt = firstPT = cssp.parse(t, vars, pt, plugin); 7217 _forcePT = oldForce; 7218 //break off from the linked list so the new ones are isolated. 7219 if (shallow) { 7220 cssp._transform = transform; 7221 if (bpt) { 7222 bpt._prev = null; 7223 if (bpt._prev) { 7224 bpt._prev._next = null; 7225 } 7226 } 7227 } 7228 while (pt && pt !== bpt) { 7229 if (pt.type <= 1) { 7230 p = pt.p; 7231 end[p] = pt.s + pt.c; 7232 start[p] = pt.s; 7233 if (!shallow) { 7234 mpt = new MiniPropTween(pt, "s", p, mpt, pt.r); 7235 pt.c = 0; 7236 } 7237 if (pt.type === 1) { 7238 i = pt.l; 7239 while (--i > 0) { 7240 xp = "xn" + i; 7241 p = pt.p + "_" + xp; 7242 end[p] = pt.data[xp]; 7243 start[p] = pt[xp]; 7244 if (!shallow) { 7245 mpt = new MiniPropTween(pt, xp, p, mpt, pt.rxp[xp]); 7246 } 7247 } 7248 } 7249 } 7250 pt = pt._next; 7251 } 7252 return {proxy:start, end:end, firstMPT:mpt, pt:firstPT}; 7253 }, 7254 7255 7256 7257 /** 7258 * @constructor Each property that is tweened has at least one CSSPropTween associated with it. These instances store important information like the target, property, starting value, amount of change, etc. They can also optionally have a number of "extra" strings and numeric values named xs1, xn1, xs2, xn2, xs3, xn3, etc. where "s" indicates string and "n" indicates number. These can be pieced together in a complex-value tween (type:1) that has alternating types of data like a string, number, string, number, etc. For example, boxShadow could be "5px 5px 8px rgb(102, 102, 51)". In that value, there are 6 numbers that may need to tween and then pieced back together into a string again with spaces, suffixes, etc. xs0 is special in that it stores the suffix for standard (type:0) tweens, -OR- the first string (prefix) in a complex-value (type:1) CSSPropTween -OR- it can be the non-tweening value in a type:-1 CSSPropTween. We do this to conserve memory. 7259 * CSSPropTweens have the following optional properties as well (not defined through the constructor): 7260 * - l: Length in terms of the number of extra properties that the CSSPropTween has (default: 0). For example, for a boxShadow we may need to tween 5 numbers in which case l would be 5; Keep in mind that the start/end values for the first number that's tweened are always stored in the s and c properties to conserve memory. All additional values thereafter are stored in xn1, xn2, etc. 7261 * - xfirst: The first instance of any sub-CSSPropTweens that are tweening properties of this instance. For example, we may split up a boxShadow tween so that there's a main CSSPropTween of type:1 that has various xs* and xn* values associated with the h-shadow, v-shadow, blur, color, etc. Then we spawn a CSSPropTween for each of those that has a higher priority and runs BEFORE the main CSSPropTween so that the values are all set by the time it needs to re-assemble them. The xfirst gives us an easy way to identify the first one in that chain which typically ends at the main one (because they're all prepende to the linked list) 7262 * - plugin: The TweenPlugin instance that will handle the tweening of any complex values. For example, sometimes we don't want to use normal subt
7262weens (like xfirst refers to) to tween the values - we might want ThrowPropsPlugin or BezierPlugin some other plugin to do the actual tweening, so we create a plugin instance and store a reference here. We need this reference so that if we get a request to round values or disable a tween, we can pass along that request. 7263 * - data: Arbitrary data that needs to be stored with the CSSPropTween. Typically if we're going to have a plugin handle the tweening of a complex-value tween, we create a generic object that stores the END values that we're tweening to and the CSSPropTween's xs1, xs2, etc. have the starting values. We store that object as data. That way, we can simply pass that object to the plugin and use the CSSPropTween as the target. 7264 * - setRatio: Only used for type:2 tweens that require custom functionality. In this case, we call the CSSPropTween's setRatio() method and pass the ratio each time the tween updates. This isn't quite as efficient as doing things directly in the CSSPlugin's setRatio() method, but it's very convenient and flexible. 7265 * @param {!Object} t Target object whose property will be tweened. Often a DOM element, but not always. It could be anything. 7266 * @param {string} p Property to tween (name). For example, to tween element.width, p would be "width". 7267 * @param {number} s Starting numeric value 7268 * @param {number} c Change in numeric value over the course of the entire tween. For example, if element.width starts at 5 and should end at 100, c would be 95. 7269 * @param {CSSPropTween=} next The next CSSPropTween in the linked list. If one is defined, we will define its _prev as the new instance, and the new instance's _next will be pointed at it. 7270 * @param {number=} type The type of CSSPropTween where -1 = a non-tweening value, 0 = a standard simple tween, 1 = a complex value (like one that has multiple numbers in a comma- or space-delimited string like border:"1px solid red"), and 2 = one that uses a custom setRatio function that does all of the work of applying the values on each update. 7271 * @param {string=} n Name of the property that should be used for overwriting purposes which is typically the same as p but not always. For example, we may need to create a subtween for the 2nd part of a "clip:rect(...)" tween in which case "p" might be xs1 but "n" is still "clip" 7272 * @param {boolean=} r If true, the value(s) should be rounded 7273 * @param {number=} pr Priority in the linked list order. Higher priority CSSPropTweens will be updated before lower priority ones. The default priority is 0. 7274 * @param {string=} b Beginning value. We store this to ensure that it is EXACTLY what it was when the tween began without any risk of interpretation issues. 7275 * @param {string=} e Ending value. We store this to ensure that it is EXACTLY what the user defined at the end of the tween without any risk of interpretation issues. 7276 */ 7277 CSSPropTween = _internals.CSSPropTween = function(t, p, s, c, next, type, n, r, pr, b, e) { 7278 this.t = t; //target 7279 this.p = p; //property 7280 this.s = s; //starting value 7281 this.c = c; //change value 7282 this.n = n || p; //name that this CSSPropTween should be associated to (usually the same as p, but not always - n is what overwriting looks at) 7283 if (!(t instanceof CSSPropTween)) { 7284 _overwriteProps.push(this.n); 7285 } 7286 this.r = r; //round (boolean) 7287 this.type = type || 0; //0 = normal tween, -1 = non-tweening (in which case xs0 will be applied to the target's property, like tp.t[tp.p] = tp.xs0), 1 = complex-value SpecialProp, 2 = custom setRatio() that does all the work 7288 if (pr) { 7289 this.pr = pr; 7290 _hasPriority = true; 7291 } 7292 this.b = (b === undefined) ? s : b; 7293 this.e = (e === undefined) ? s + c : e; 7294 if (next) { 7295 this._next = next; 7296 next._prev = this; 7297 } 7298 }, 7299 7300 _addNonTweeningNumericPT = function(target, prop, start, end, next, overwriteProp) { //cleans up some code redundancies and helps minification. Just a fast way to add a NUMERIC non-tweening CSSPropTween
7301 var pt = new CSSPropTween(target, prop, start, end - start, next, -1, overwriteProp); 7302 pt.b = start; 7303 pt.e = pt.xs0 = end; 7304 return pt; 7305 }, 7306 7307 /** 7308 * Takes a target, the beginning value and ending value (as strings) and parses them into a CSSPropTween (possibly with child CSSPropTweens) that accommodates multiple numbers, colors, comma-delimited values, etc. For example: 7309 * sp.parseComplex(element, "boxShadow", "5px 10px 20px rgb(255,102,51)", "0px 0px 0px red", true, "0px 0px 0px rgb(0,0,0,0)", pt); 7310 * It will walk through the beginning and ending values (which should be in the same format with the same number and type of values) and figure out which parts are numbers, what strings separate the numeric/tweenable values, and then create the CSSPropTweens accordingly. If a plugin is defined, no child CSSPropTweens will be created. Instead, the ending values will be stored in the "data" property of the returned CSSPropTween like: {s:-5, xn1:-10, xn2:-20, xn3:255, xn4:0, xn5:0} so that it can be fed to any other plugin and it'll be plain numeric tweens but the recomposition of the complex value will be handled inside CSSPlugin's setRatio(). 7311 * If a setRatio is defined, the type of the CSSPropTween will be set to 2 and recomposition of the values will be the responsibility of that method. 7312 * 7313 * @param {!Object} t Target whose property will be tweened 7314 * @param {!string} p Property that will be tweened (its name, like "left" or "backgroundColor" or "boxShadow") 7315 * @param {string} b Beginning value 7316 * @param {string} e Ending value 7317 * @param {boolean} clrs If true, the value could contain a color value like "rgb(255,0,0)" or "#F00" or "red". The default is false, so no colors will be recognized (a performance optimization) 7318 * @param {(string|number|Object)} dflt The default beginning value that should be used if no valid beginning value is defined or if the number of values inside the complex beginning and ending values don't match 7319 * @param {?CSSPropTween} pt CSSPropTween instance that is the current head of the linked list (we'll prepend to this). 7320 * @param {number=} pr Priority in the linked list order. Higher priority properties will be updated before lower priority ones. The default priority is 0. 7321 * @param {TweenPlugin=} plugin If a plugin should handle the tweening of extra properties, pass the plugin instance here. If one is defined, then NO subtweens will be created for any extra properties (the properties will be created - just not additional CSSPropTween instances to tween them) because the plugin is expected to do so. However, the end values WILL be populated in the "data" property, like {s:100, xn1:50, xn2:300} 7322 * @param {function(number)=} setRatio If values should be set in a custom function instead of being pieced together in a type:1 (complex-value) CSSPropTween, define that custom function here. 7323 * @return {CSSPropTween} The first CSSPropTween in the linked list which includes the new one(s) added by the parseComplex() call. 7324 */ 7325 _parseComplex = CSSPlugin.parseComplex = function(t, p, b, e, clrs, dflt, pt, pr, plugin, setRatio) { 7326 //DEBUG: _log("parseComplex: "+p+", b: "+b+", e: "+e); 7327 b = b || dflt || ""; 7328 pt = new CSSPropTween(t, p, 0, 0, pt, (setRatio ? 2 : 1), null, false, pr, b, e); 7329 e += ""; //ensures it's a string 7330 var ba = b.split(", ").join(",").split(" "), //beginning array 7331 ea = e.split(", ").join(",").split(" "), //ending array 7332 l = ba.length, 7333 autoRound = (_autoRound !== false), 7334 i, xi, ni, bv, ev, bnums, enums, bn, hasAlpha, temp, cv, str, useHSL; 7335 if (e.indexOf(",") !== -1 || b.indexOf(",") !== -1) { 7336 ba = ba.join(" ").replace(_commasOutsideParenExp, ", ").split(" "); 7337 ea = ea.join(" ").replace(_commasOutsideParenExp, ", ").split(" "); 7338 l = ba.length; 7339 } 7340 if (l !== ea.length) { 7341 //DEBUG: _log("mismatched formatting detected on " + p + " (" + b + " vs " + e + ")"); 7342 ba = (dflt || "").split(" "); 7343 l = ba.length; 7344 } 7345 pt.plugin = plugin; 7346 pt.setRatio = setRatio; 7347 _colorExp.lastIndex = 0; 7348 for (i = 0; i < l; i++) { 7349 bv = ba[i]; 7350 ev = ea[i]; 7351 bn = parseFloat(bv); 7352 //if the value begins with a number (most common). It's fine if it has a suffix like px 7353 if (bn || bn === 0) { 7354 pt.appendXtra("", bn, _parseChange(ev, bn), ev.replace(_relNumExp, ""), (autoRound && ev.indexOf("px") !== -1), true); 7355 7356 //if the value is a color 7357 } else if (clrs && _colorExp.test(bv)) { 7358 str = ev.charAt(ev.length - 1) === "," ? ")," : ")"; //if there's a comma at the end, retain it. 7359 useHSL = (ev.indexOf("hsl") !== -1 && _supportsOpacity); 7360 bv = _parseColor(bv, useHSL); 7361 ev = _parseColor(ev, useHSL); 7362 hasAlpha = (bv.length + ev.length > 6); 7363 if (hasAlpha && !_supportsOpacity && ev[3] === 0) { //older versions of IE don't support rgba(), so if the destination alpha is 0, just use "transparent" for the end color 7364 pt["xs" + pt.l] += pt.l ? " transparent" : "transparent"; 7365 pt.e = pt.e.split(ea[i]).join("transparent"); 7366 } else { 7367 if (!_supportsOpacity) { //old versions of IE don't support rgba(). 7368 hasAlpha = false; 7369 } 7370 if (useHSL) { 7371 pt.appendXtra((hasAlpha ? "hsla(" : "hsl("), bv[0], _parseChange(ev[0], bv[0]), ",", false, true) 7372 .appendXtra("", bv[1], _parseChange(ev[1], bv[1]), "%,", false) 7373 .appendXtra("", bv[2], _parseChange(ev[2], bv[2]), (hasAlpha ? "%," : "%" + str), false); 7374 } else { 7375 pt.appendXtra((hasAlpha ? "rgba(" : "rgb("), bv[0], ev[0] - bv[0], ",", true, true) 7376 .appendXtra("", bv[1], ev[1] - bv[1], ",", true) 7377 .appendXtra("", bv[2], ev[2] - bv[2], (hasAlpha ? "," : str), true); 7378 } 7379 7380 if (hasAlpha) { 7381 bv = (bv.length < 4) ? 1 : bv[3]; 7382 pt.appendXtra("", bv, ((ev.length < 4) ? 1 : ev[3]) - bv, str, false); 7383 } 7384 } 7385 _colorExp.lastIndex = 0; //otherwise the test() on the RegExp could move the lastIndex and taint future results. 7386 7387 } else { 7388 bnums = bv.match(_numExp); //gets each group of numbers in the beginning value string and drops them into an array 7389 7390 //if no number is found, treat it as a non-tweening value and just append the string to the current xs. 7391 if (!bnums) { 7392 pt["xs" + pt.l] += pt.l ? " " + bv : bv; 7393 7394 //loop through all the numbers that are found and construct the extra values on the pt. 7395 } else { 7396 enums = ev.match(_relNumExp); //get each group of numbers in the end value string and drop them into an array. We allow relative values too, like +=50 or -=.5 7397 if (!enums || enums.length !== bnums.length) { 7398 //DEBUG: _log("mismatched formatting detected on " + p + " (" + b + " vs " + e + ")"); 7399 return pt; 7400 } 7401 ni = 0; 7402 for (xi = 0; xi < bnums.length; xi++) { 7403 cv = bnums[xi]; 7404 temp = bv.indexOf(cv, ni); 7405 pt.appendXtra(bv.substr(ni, temp - ni), Number(cv), _parseChange(enums[xi], cv), "", (autoRound && bv.substr(temp + cv.length, 2) === "px"), (xi === 0)); 7406 ni = temp + cv.length; 7407 } 7408 pt["xs" + pt.l] += bv.substr(ni); 7409 } 7410 } 7411 } 7412 //if there are relative values ("+=" or "-=" prefix), we need to adjust the ending value to eliminate the prefixes and combine the values properly. 7413 if (e.indexOf("=") !== -1) if (pt.data) { 7414 str = pt.xs0 + pt.data.s; 7415 for (i = 1; i < pt.l; i++) { 7416 str += pt["xs" + i] + pt.data["xn" + i]; 7417 } 7418 pt.e = str + pt["xs" + i]; 7419 } 7420 if (!pt.l) { 7421 pt.type = -1; 7422 pt.xs0 = pt.e; 7423 } 7424 return pt.xfirst || pt; 7425 }, 7426 i = 9; 7427 7428 7429 p = CSSPropTween.prototype; 7430 p.l = p.pr = 0; //length (number of extra properties like xn1, xn2, xn3, etc. 7431 while (--i > 0) { 7432 p["xn" + i] = 0; 7433 p["xs" + i] = ""; 7434 } 7435 p.xs0 = ""; 7436 p._next = p._prev = p.xfirst = p.data = p.plugin = p.setRatio = p.rxp = null; 7437 7438 7439 /** 7440 * Appends and extra tweening value to a CSSPropTween and automatically manages any prefix and suffix strings. The first extra value is stored in the s and c of the main CSSPropTween instance, but thereafter any extras are stored in the xn1, xn2, xn3, etc. The prefixes and suffixes are stored in the xs0, xs1, xs2, etc. properties. For example, if I walk through a clip value like "rect(10px, 5px, 0px, 20px)", the values would be stored like this: 7441 * xs0:"rect(", s:10, xs1:"px, ", xn1:5, xs2:"px, ", xn2:0, xs3:"px, ", xn3:20, xn4:"px)" 7442 * And they'd all get joined together when the CSSPlugin renders (in the setRatio() method). 7443 * @param {string=} pfx Prefix (if any) 7444 * @param {!number} s Starting value 7445 * @param {!number} c Change in numeric value over the course of the entire tween. For example, if the start is 5 and the end is 100, the change would be 95. 7446 * @param {string=} sfx Suffix (if any) 7447 * @param {boolean=} r Round (if true). 7448 * @param {boolean=} pad If true, this extra value should be separated by the previous one by a space. If there is no previous extra and pad is true, it will automatically drop the space. 7449 * @return {CSSPropTween} returns itself so that multiple methods can be chained together. 7450 */ 7451 p.appendXtra = function(pfx, s, c, sfx, r, pad) { 7452 var pt = this, 7453 l = pt.l; 7454 pt["xs" + l] += (pad && l) ? " " + pfx : pfx || ""; 7455 if (!c) if (l !== 0 && !pt.plugin) { //typically we'll combine non-changing values right into the xs to optimize performance, but we don't combine them when there's a plugin that will be tweening the values because it may depend on the values being split apart, like for a bezier, if a value doesn't change between the first and second iteration but then it does on the 3rd, we'll run into trouble because there's no xn slot for that value! 7456 pt["xs" + l] += s + (sfx || ""); 7457 return pt; 7458 } 7459 pt.l++; 7460 pt.type = pt.setRatio ? 2 : 1; 7461 pt["xs" + pt.l] = sfx || ""; 7462 if (l > 0) { 7463 pt.data["xn" + l] = s + c; 7464 pt.rxp["xn" + l] = r; //round extra property (we need to tap into this in the _parseToProxy() method) 7465 pt["xn" + l] = s; 7466 if (!pt.plugin) { 7467 pt.xfirst = new CSSPropTween(pt, "xn" + l, s, c, pt.xfirst || pt, 0, pt.n, r, pt.pr); 7468 pt.xfirst.xs0 = 0; //just to ensure that the property stays numeric which helps modern browsers speed up processing. Remember, in the setRatio() method, we do pt.t[pt.p] = val + pt.xs0 so if pt.xs0 is "" (the default), it'll cast the end value as a string. When a property is a number sometimes and a string sometimes, it prevents the compiler from locking in the data type, slowing things down slightly. 7469 } 7470 return pt; 7471 } 7472 pt.data = {s:s + c}; 7473 pt.rxp = {}; 7474 pt.s = s; 7475 pt.c = c; 7476 pt.r = r; 7477 return pt; 7478 }; 7479 7480 /** 7481 * @constructor A SpecialProp is basically a css property that needs to be treated in a non-standard way, like if it may contain a complex value like boxShadow:"5px 10px 15px rgb(255, 102, 51)" or if it is associated with another plugin like ThrowPropsPlugin or BezierPlugin. Every SpecialProp is associated with a particular property name like "boxShadow" or "throwProps" or "bezier" and it will intercept those values in the vars object that's passed to the CSSPlugin and handle them accordingly. 7482 * @param {!string} p Property name (like "boxShadow" or "throwProps") 7483 * @param {Object=}
7483 options An object containing any of the following configuration options: 7484 * - defaultValue: the default value 7485 * - parser: A function that should be called when the associated property name is found in the vars. This function should return a CSSPropTween instance and it should ensure that it is properly inserted into the linked list. It will receive 4 paramters: 1) The target, 2) The value defined in the vars, 3) The CSSPlugin instance (whose _firstPT should be used for the linked list), and 4) A computed style object if one was calculated (this is a speed optimization that allows retrieval of starting values quicker) 7486 * - formatter: a function that formats any value received for this special property (for example, boxShadow could take "5px 5px red" and format it to "5px 5px 0px 0px red" so that both the beginning and ending values have a common order and quantity of values.) 7487 * - prefix: if true, we'll determine whether or not this property requires a vendor prefix (like Webkit or Moz or ms or O) 7488 * - color: set this to true if the value for this SpecialProp may contain color-related values like rgb(), rgba(), etc. 7489 * - priority: priority in the linked list order. Higher priority SpecialProps will be updated before lower priority ones. The default priority is 0. 7490 * - multi: if true, the formatter should accommodate a comma-delimited list of values, like boxShadow could have multiple boxShadows listed out. 7491 * - collapsible: if true, the formatter should treat the value like it's a top/right/bottom/left value that could be collapsed, like "5px" would apply to all, "5px, 10px" would use 5px for top/bottom and 10px for right/left, etc. 7492 * - keyword: a special keyword that can [optionally] be found inside the value (like "inset" for boxShadow). This allows us to validate beginning/ending values to make sure they match (if the keyword is found in one, it'll be added to the other for consistency by default). 7493 */ 7494 var SpecialProp = function(p, options) { 7495 options = options || {}; 7496 this.p = options.prefix ? _checkPropPrefix(p) || p : p; 7497 _specialProps[p] = _specialProps[this.p] = this; 7498 this.format = options.formatter || _getFormatter(options.defaultValue, options.color, options.collapsible, options.multi); 7499 if (options.parser) { 7500 this.parse = options.parser; 7501 } 7502 this.clrs = options.color; 7503 this.multi = options.multi; 7504 this.keyword = options.keyword; 7505 this.dflt = options.defaultValue; 7506 this.pr = options.priority || 0; 7507 }, 7508 7509 //shortcut for creating a new SpecialProp that can accept multiple properties as a comma-delimited list (helps minification). dflt can be an array for multiple values (we don't do a comma-delimited list because the default value may contain commas, like rect(0px,0px,0px,0px)). We attach this method to the SpecialProp class/object instead of using a private _createSpecialProp() method so that we can tap into it externally if necessary, like from another plugin. 7510 _registerComplexSpecialProp = _internals._registerComplexSpecialProp = function(p, options, defaults) { 7511 if (typeof(options) !== "object") { 7512 options = {parser:defaults}; //to make backwards compatible with older versions of BezierPlugin and ThrowPropsPlugin 7513 } 7514 var a = p.split(","), 7515 d = options.defaultValue, 7516 i, temp; 7517 defaults = defaults || [d]; 7518 for (i = 0; i < a.length; i++) { 7519 options.prefix = (i === 0 && options.prefix); 7520 options.defaultValue = defaults[i] || d; 7521 temp = new SpecialProp(a[i], options); 7522 } 7523 }, 7524 7525 //creates a placeholder special prop for a plugin so that the property gets caught the first time a tween of it is attempted, and at that time it makes the plugin register itself, thus taking over for all future tweens of that property. This allows us to not mandate that things load in a particular order and it also allows us to log() an error that informs the user when they attempt to tween an external plugin-related property without loading its .js file. 7526 _registerPluginProp = function(p) { 7527 if (!_specialProps[p]) { 7528 var pluginName = p.charAt(0).toUpperCase() + p.substr(1) + "Plugin"; 7529 _registerComplexSpecialProp(p, {parser:function(t, e, p, cssp, pt, plugin, vars) { 7530 var pluginClass = _globals.com.greensock.plugins[pluginName]; 7531 if (!pluginClass) { 7532 _log("Error: " + pluginName + " js file not loaded."); 7533 return pt; 7534 } 7535 pluginClass._cssRegister(); 7536 return _specialProps[p].parse(t, e, p, cssp, pt, plugin, vars); 7537 }}); 7538 } 7539 }; 7540 7541 7542 p = SpecialProp.prototype; 7543 7544 /** 7545 * Alias for _parseComplex() that automatically plugs in certain values for this SpecialProp, like its property name, whether or not colors should be sensed, the default value, and priority. It also looks for any keyword that the SpecialProp defines (like "inset" for boxSh
7545adow) and ensures that the beginning and ending values have the same number of values for SpecialProps where multi is true (like boxShadow and textShadow can have a comma-delimited list) 7546 * @param {!Object} t target element 7547 * @param {(string|number|object)} b beginning value 7548 * @param {(string|number|object)} e ending (destination) value 7549 * @param {CSSPropTween=} pt next CSSPropTween in the linked list 7550 * @param {TweenPlugin=} plugin If another plugin will be tweening the complex value, that TweenPlugin instance goes here. 7551 * @param {function=} setRatio If a custom setRatio() method should be used to handle this complex value, that goes here. 7552 * @return {CSSPropTween=} First CSSPropTween in the linked list 7553 */ 7554 p.parseComplex = function(t, b, e, pt, plugin, setRatio) { 7555 var kwd = this.keyword, 7556 i, ba, ea, l, bi, ei; 7557 //if this SpecialProp's value can contain a comma-delimited list of values (like boxShadow or textShadow), we must parse them in a special way, and look for a keyword (like "inset" for boxShadow) and ensure that the beginning and ending BOTH have it if the end defines it as such. We also must ensure that there are an equal number of values specified (we can't tween 1 boxShadow to 3 for example) 7558 if (this.multi) if (_commasOutsideParenExp.test(e) || _commasOutsideParenExp.test(b)) { 7559 ba = b.replace(_commasOutsideParenExp, "|").split("|"); 7560 ea = e.replace(_commasOutsideParenExp, "|").split("|"); 7561 } else if (kwd) { 7562 ba = [b]; 7563 ea = [e]; 7564 } 7565 if (ea) { 7566 l = (ea.length > ba.length) ? ea.length : ba.length; 7567 for (i = 0; i < l; i++) { 7568 b = ba[i] = ba[i] || this.dflt; 7569 e = ea[i] = ea[i] || this.dflt; 7570 if (kwd) { 7571 bi = b.indexOf(kwd); 7572 ei = e.indexOf(kwd); 7573 if (bi !== ei) { 7574 if (ei === -1) { //if the keyword isn't in the end value, remove it from the beginning one. 7575 ba[i] = ba[i].split(kwd).join(""); 7576 } else if (bi === -1) { //if the keyword isn't in the beginning, add it. 7577 ba[i] += " " + kwd; 7578 } 7579 } 7580 } 7581 } 7582 b = ba.join(", "); 7583 e = ea.join(", "); 7584 } 7585 return _parseComplex(t, this.p, b, e, this.clrs, this.dflt, pt, this.pr, plugin, setRatio); 7586 }; 7587 7588 /** 7589 * Accepts a target and end value and spits back a CSSPropTween that has been inserted into the CSSPlugin's linked list and conforms with all the conventions we use internally, like type:-1, 0, 1, or 2, setting up any extra property tweens, priority, etc. For example, if we have a boxShadow SpecialProp and call: 7590 * this._firstPT = sp.parse(element, "5px 10px 20px rgb(2550,102,51)", "boxShadow", this); 7591 * It should figure out the starting value of the element's boxShadow, compare it to the provided end value and create all the necessary CSSPropTweens of the appropriate types to tween the boxShadow. The CSSPropTween that gets spit back should already be inserted into the linked list (the 4th parameter is the current head, so prepend to that). 7592 * @param {!Object} t Target object whose property is being tweened 7593 * @param {Object} e End value as provided in the vars object (typically a string, but not always - like a throwProps would be an object). 7594 * @param {!string} p Property name 7595 * @param {!CSSPlugin} cssp The CSSPlugin instance that should be associated with this tween. 7596 * @param {?CSSPropTween} pt The CSSPropTween that is the current head of the linked list (we'll prepend to it) 7597 * @param {TweenPlugin=} plugin If a plugin will be used to tween the parsed value, this is the plugin instance. 7598 * @param {Object=} vars Original vars object that contains the data for parsing. 7599 * @return {CSSPropTween} The first CSSPropTween in the linked list which includes the new one(s) added by the parse() call. 7600 */ 7601 p.parse = function(t, e, p, cssp, pt, plugin, vars) { 7602 return this.parseComplex(t.style, this.format(_getStyle(t, this.p, _cs, false, this.dflt)), this.format(e), pt, plugin); 7603 }; 7604 7605 /** 7606 * Registers a special property that should be intercepted from any "css" objects defined in tweens. This allows you to handle them however you want without CSSPlugin doing it for you. The 2nd parameter should be a function that accepts 3 parameters: 7607 * 1) Target object whose property should be tweened (typically a DOM element) 7608 * 2) The end/destination value (could be a string, number, object, or whatever you want) 7609 * 3) The tween instance (you probably don't need to worry about this, but it can be useful for looking up information like the duration) 7610 * 7611 * Then, your function should return a function which will be called each time the tween gets rendered, passing a numeric "ratio" parameter to your function that indicates the change factor (usually between 0 and 1). For example: 7612 * 7613 * CSSPlugin.registerSpecialProp("myCustomProp", function(target, value, tween) { 7614 * var start = target.style.width;
7615 * return function(ratio) { 7616 * target.style.width = (start + value * ratio) + "px"; 7617 * console.log("set width to " + target.style.width); 7618 * } 7619 * }, 0); 7620 * 7621 * Then, when I do this tween, it will trigger my special property: 7622 * 7623 * TweenLite.to(element, 1, {css:{myCustomProp:100}}); 7624 * 7625 * In the example, of course, we're just changing the width, but you can do anything you want. 7626 * 7627 * @param {!string} name Property name (or comma-delimited list of property names) that should be intercepted and handled by your function. For example, if I define "myCustomProp", then it would handle that portion of the following tween: TweenLite.to(element, 1, {css:{myCustomProp:100}}) 7628 * @param {!function(Object, Object, Object, string):function(number)} onInitTween The function that will be called when a tween of this special property is performed. The function will receive 4 parameters: 1) Target object that should be tweened, 2) Value that was passed to the tween, 3) The tween instance itself (rarely used), and 4) The property name that's being tweened. Your function should return a function that should be called on every update of the tween. That function will receive a single parameter that is a "change factor" value (typically between 0 and 1) indicating the amount of change as a ratio. You can use this to determine how to set the values appropriately in your function. 7629 * @param {number=} priority Priority that helps the engine determine the order in which to set the properties (default: 0). Higher priority properties will be updated before lower priority ones. 7630 */ 7631 CSSPlugin.registerSpecialProp = function(name, onInitTween, priority) { 7632 _registerComplexSpecialProp(name, {parser:function(t, e, p, cssp, pt, plugin, vars) { 7633 var rv = new CSSPropTween(t, p, 0, 0, pt, 2, p, false, priority); 7634 rv.plugin = plugin; 7635 rv.setRatio = onInitTween(t, e, cssp._tween, p); 7636 return rv; 7637 }, priority:priority}); 7638 }; 7639 7640 7641 7642 7643 7644 7645 //transform-related methods and properties 7646 CSSPlugin.useSVGTransformAttr = _isSafari || _isFirefox; //Safari and Firefox both have some rendering bugs when applying CSS transforms to SVG elements, so default to using the "transform" attribute instead (users can override this). 7647 var _transformProps = ("scaleX,scaleY,scaleZ,x,y,z,skewX,skewY,rotation,rotationX,rotationY,perspective,xPercent,yPercent").split(","), 7648 _transformProp = _checkPropPrefix("transform"), //the Javascript (camelCase) transform property, like msTransform, WebkitTransform, MozTransform, or OTransform. 7649 _transformPropCSS = _prefixCSS + "transform", 7650 _transformOriginProp = _checkPropPrefix("transformOrigin"), 7651 _supports3D = (_checkPropPrefix("perspective") !== null), 7652 Transform = _internals.Transform = function() { 7653 this.perspective = parseFloat(CSSPlugin.defaultTransformPerspective) || 0; 7654 this.force3D = (CSSPlugin.defaultForce3D === false || !_supports3D) ? false : CSSPlugin.defaultForce3D || "auto"; 7655 }, 7656 _SVGElement = window.SVGElement, 7657 _useSVGTransformAttr, 7658 //Some browsers (like Firefox and IE) don't honor transform-origin properly in SVG elements, so we need to manually adjust the matrix accordingly. We feature detect here rather than always doing the conversion for certain browsers because they may fix the problem at some point in the future. 7659 7660 _createSVG = function(type, container, attributes) { 7661 var element = _doc.createElementNS("http://www.w3.org/2000/svg", type), 7662 reg = /([a-z])([A-Z])/g, 7663 p; 7664 for (p in attributes) { 7665 element.setAttributeNS(null, p.replace(reg, "$1-$2").toLowerCase(), attributes[p]); 7666 } 7667 container.appendChild(element); 7668 return element; 7669 }, 7670 _docElement = _doc.documentElement, 7671 _forceSVGTransformAttr = (function() { 7672 //IE and Android stock don't support CSS transforms on SVG elements, so we must write them to the "transform" attribute. We populate this variable in the _parseTransform() method, and only if/when we come across an SVG element 7673 var force = _ieVers || (/Android/i.test(_agent) && !window.chrome), 7674 svg, rect, width; 7675 if (_doc.createElementNS && !force) { //IE8 and earlier doesn't support SVG anyway 7676 svg = _createSVG("svg", _docElement); 7677 rect = _createSVG("rect", svg, {width:100, height:50, x:100}); 7678 width = rect.getBoundingClientRect().width; 7679 rect.style[_transformOriginProp] = "50% 50%"; 7680 rect.style[_transformProp] = "scaleX(0.5)"; 7681 force = (width === rect.getBoundingClientRect().width && !(_is
7681Firefox && _supports3D)); //note: Firefox fails the test even though it does support CSS transforms in 3D. Since we can't push 3D stuff into the transform attribute, we force Firefox to pass the test here (as long as it does truly support 3D). 7682 _docElement.removeChild(svg); 7683 } 7684 return force; 7685 })(), 7686 _parseSVGOrigin = function(e, local, decoratee, absolute, smoothOrigin) { 7687 var tm = e._gsTransform, 7688 m = _getMatrix(e, true), 7689 v, x, y, xOrigin, yOrigin, a, b, c, d, tx, ty, determinant, xOriginOld, yOriginOld; 7690 if (tm) { 7691 xOriginOld = tm.xOrigin; //record the original values before we alter them. 7692 yOriginOld = tm.yOrigin; 7693 } 7694 if (!absolute || (v = absolute.split(" ")).length < 2) { 7695 b = e.getBBox(); 7696 local = _parsePosition(local).split(" "); 7697 v = [(local[0].indexOf("%") !== -1 ? parseFloat(local[0]) / 100 * b.width : parseFloat(local[0])) + b.x, 7698 (local[1].indexOf("%") !== -1 ? parseFloat(local[1]) / 100 * b.height : parseFloat(local[1])) + b.y]; 7699 } 7700 decoratee.xOrigin = xOrigin = parseFloat(v[0]); 7701 decoratee.yOrigin = yOrigin = parseFloat(v[1]); 7702 if (absolute && m !== _identity2DMatrix) { //if svgOrigin is being set, we must invert the matrix and determine where the absolute point is, factoring in the current transforms. Otherwise, the svgOrigin would be based on the element's non-transformed position on the canvas. 7703 a = m[0]; 7704 b = m[1]; 7705 c = m[2]; 7706 d = m[3]; 7707 tx = m[4]; 7708 ty = m[5]; 7709 determinant = (a * d - b * c); 7710 x = xOrigin * (d / determinant) + yOrigin * (-c / determinant) + ((c * ty - d * tx) / determinant); 7711 y = xOrigin * (-b / determinant) + yOrigin * (a / determinant) - ((a * ty - b * tx) / determinant); 7712 xOrigin = decoratee.xOrigin = v[0] = x; 7713 yOrigin = decoratee.yOrigin = v[1] = y; 7714 } 7715 if (tm) { //avoid jump when transformOrigin is changed - adjust the x/y values accordingly 7716 if (smoothOrigin || (smoothOrigin !== false && CSSPlugin.defaultSmoothOrigin !== false)) { 7717 x = xOrigin - xOriginOld; 7718 y = yOrigin - yOriginOld; 7719 //originally, we simply adjusted the x and y values, but that would cause problems if, for example, you created a rotational tween part-way through an x/y tween. Managing the offset in a separate variable gives us ultimate flexibility. 7720 //tm.x -= x - (x * m[0] + y * m[2]); 7721 //tm.y -= y - (x * m[1] + y * m[3]); 7722 tm.xOffset += (x * m[0] + y * m[2]) - x; 7723 tm.yOffset += (x * m[1] + y * m[3]) - y; 7724 } else { 7725 tm.xOffset = tm.yOffset = 0; 7726 } 7727 } 7728 e.setAttribute("data-svg-origin", v.join(" ")); 7729 }, 7730 _isSVG = function(e) { 7731 return !!(_SVGElement && typeof(e.getBBox) === "function" && e.getCTM && (!e.parentNode || (e.parentNode.getBBox && e.parentNode.getCTM))); 7732 }, 7733 _identity2DMatrix = [1,0,0,1,0,0], 7734 _getMatrix = function(e, force2D) { 7735 var tm = e._gsTransform || new Transform(), 7736 rnd = 100000, 7737 isDefault, s, m, n, dec; 7738 if (_transformProp) { 7739 s = _getStyle(e, _transformPropCSS, null, true); 7740 } else if (e.currentStyle) { 7741 //for older versions of IE, we need to interpret the filter portion that is in the format: progid:DXImageTransform.Microsoft.Matrix(M11=6.123233995736766e-17, M12=-1, M21=1, M22=6.123233995736766e-17, sizingMethod='auto expand') Notice that we need to swap b and c compared to a normal matrix. 7742 s = e.currentStyle.filter.match(_ieGetMatrixExp); 7743 s = (s && s.length === 4) ? [s[0].substr(4), Number(s[2].substr(4)), Number(s[1].substr(4)), s[3].substr(4), (tm.x || 0), (tm.y || 0)].join(",") : ""; 7744 }
7745 isDefault = (!s || s === "none" || s === "matrix(1, 0, 0, 1, 0, 0)"); 7746 if (tm.svg || (e.getBBox && _isSVG(e))) { 7747 if (isDefault && (e.style[_transformProp] + "").indexOf("matrix") !== -1) { //some browsers (like Chrome 40) don't correctly report transforms that are applied inline on an SVG element (they don't get included in the computed style), so we double-check here and accept matrix values 7748 s = e.style[_transformProp]; 7749 isDefault = 0; 7750 } 7751 m = e.getAttribute("transform"); 7752 if (isDefault && m) { 7753 if (m.indexOf("matrix") !== -1) { //just in case there's a "transform" value specified as an attribute instead of CSS style. Accept either a matrix() or simple translate() value though. 7754 s = m; 7755 isDefault = 0; 7756 } else if (m.indexOf("translate") !== -1) { 7757 s = "matrix(1,0,0,1," + m.match(/(?:\-|\b)[\d\-\.e]+\b/gi).join(",") + ")"; 7758 isDefault = 0; 7759 } 7760 } 7761 } 7762 if (isDefault) { 7763 return _identity2DMatrix; 7764 } 7765 //split the matrix values out into an array (m for matrix) 7766 m = (s || "").match(/(?:\-|\b)[\d\-\.e]+\b/gi) || []; 7767 i = m.length; 7768 while (--i > -1) { 7769 n = Number(m[i]); 7770 m[i] = (dec = n - (n |= 0)) ? ((dec * rnd + (dec < 0 ? -0.5 : 0.5)) | 0) / rnd + n : n; //convert strings to Numbers and round to 5 decimal places to avoid issues with tiny numbers. Roughly 20x faster than Number.toFixed(). We also must make sure to round before dividing so that values like 0.9999999999 become 1 to avoid glitches in browser rendering and interpretation of flipped/rotated 3D matrices. And don't just multiply the number by rnd, floor it, and then divide by rnd because the bitwise operations max out at a 32-bit signed integer, thus it could get clipped at a relatively low value (like 22,000.00000 for example). 7771 } 7772 return (force2D && m.length > 6) ? [m[0], m[1], m[4], m[5], m[12], m[13]] : m; 7773 }, 7774 7775 /** 7776 * Parses the transform values for an element, returning an object with x, y, z, scaleX, scaleY, scaleZ, rotation, rotationX, rotationY, skewX, and skewY properties. Note: by default (for performance reasons), all skewing is combined into skewX and rotation but skewY still has a place in the transform object so that we can record how much of the skew is attributed to skewX vs skewY. Remember, a skewY of 10 looks the same as a rotation of 10 and skewX of -10. 7777 * @param {!Object} t target element 7778 * @param {Object=} cs computed style object (optional) 7779 * @param {boolean=} rec if true, the transform values will be recorded to the target element's _gsTransform object, like target._gsTransform = {x:0, y:0, z:0, scaleX:1...} 7780 * @param {boolean=} parse if true, we'll ignore any _gsTransform values that already exist on the element, and force a reparsing of the css (calculated style) 7781 * @return {object}
7781 object containing all of the transform properties/values like {x:0, y:0, z:0, scaleX:1...} 7782 */ 7783 _getTransform = _internals.getTransform = function(t, cs, rec, parse) { 7784 if (t._gsTransform && rec && !parse) { 7785 return t._gsTransform; //if the element already has a _gsTransform, use that. Note: some browsers don't accurately return the calculated style for the transform (particularly for SVG), so it's almost always safest to just use the values we've already applied rather than re-parsing things. 7786 } 7787 var tm = rec ? t._gsTransform || new Transform() : new Transform(), 7788 invX = (tm.scaleX < 0), //in order to interpret things properly, we need to know if the user applied a negative scaleX previously so that we can adjust the rotation and skewX accordingly. Otherwise, if we always interpret a flipped matrix as affecting scaleY and the user only wants to tween the scaleX on multiple sequential tweens, it would keep the negative scaleY without that being the user's intent. 7789 min = 0.00002, 7790 rnd = 100000, 7791 zOrigin = _supports3D ? parseFloat(_getStyle(t, _transformOriginProp, cs, false, "0 0 0").split(" ")[2]) || tm.zOrigin || 0 : 0, 7792 defaultTransformPerspective = parseFloat(CSSPlugin.defaultTransformPerspective) || 0, 7793 m, i, scaleX, scaleY, rotation, skewX; 7794 7795 tm.svg = !!(t.getBBox && _isSVG(t)); 7796 if (tm.svg) { 7797 _parseSVGOrigin(t, _getStyle(t, _transformOriginProp, _cs, false, "50% 50%") + "", tm, t.getAttribute("data-svg-origin")); 7798 _useSVGTransformAttr = CSSPlugin.useSVGTransformAttr || _forceSVGTransformAttr; 7799 } 7800 m = _getMatrix(t); 7801 if (m !== _identity2DMatrix) { 7802 7803 if (m.length === 16) { 7804 //we'll only look at these position-related 6 variables first because if x/y/z all match, it's relatively safe to assume we don't need to re-parse everything which risks losing important rotational information (like rotationX:180 plus rotationY:180 would look the same as rotation:180 - there's no way to know for sure which direction was taken based solely on the matrix3d() values) 7805 var a11 = m[0], a21 = m[1], a31 = m[2], a41 = m[3], 7806 a12 = m[4], a22 = m[5], a32 = m[6], a42 = m[7], 7807 a13 = m[8], a23 = m[9], a33 = m[10], 7808 a14 = m[12], a24 = m[13], a34 = m[14], 7809 a43 = m[11], 7810 angle = Math.atan2(a32, a33), 7811 t1, t2, t3, t4, cos, sin; 7812 7813 //we manually compensate for non-zero z component of transformOrigin to work around bugs in Safari 7814 if (tm.zOrigin) { 7815 a34 = -tm.zOrigin; 7816 a14 = a13*a34-m[12]; 7817 a24 = a23*a34-m[13]; 7818 a34 = a33*a34+tm.zOrigin-m[14]; 7819 } 7820 tm.rotationX = angle * _RAD2DEG; 7821 //rotationX 7822 if (angle) { 7823 cos = Math.cos(-angle); 7824 sin = Math.sin(-angle); 7825 t1 = a12*cos+a13*sin; 7826 t2 = a22*cos+a23*sin; 7827 t3 = a32*cos+a33*sin; 7828 a13 = a12*-sin+a13*cos; 7829 a23 = a22*-sin+a23*cos; 7830 a33 = a32*-sin+a33*cos; 7831 a43 = a42*-sin+a43*cos; 7832 a12 = t1; 7833 a22 = t2; 7834 a32 = t3; 7835 } 7836 //rotationY 7837 angle = Math.atan2(a13, a33); 7838 tm.rotationY = angle * _RAD2DEG; 7839 if (angle) { 7840 cos = Math.cos(-angle); 7841 sin = Math.sin(-angle); 7842 t1 = a11*cos-a13*sin; 7843 t2 = a21*cos-a23*sin; 7844 t3 = a31*cos-a33*sin; 7845 a23 = a21*sin+a23*cos; 7846 a33 = a31*sin+a33*cos; 7847 a43 = a41*sin+a43*cos; 7848 a11 = t1; 7849 a21 = t2; 7850 a31 = t3; 7851 } 7852 //rotationZ 7853 angle = Math.atan2(a21, a11); 7854 tm.rotation = angle * _RAD2DEG; 7855 if (angle) { 7856 cos = Math.cos(-angle); 7857 sin = Math.sin(-angle); 7858 a11 = a11*cos+a12*sin; 7859 t2 = a21*cos+a22*sin; 7860 a22 = a21*-sin+a22*cos; 7861 a32 = a31*-sin+a32*cos; 7862 a21 = t2; 7863 } 7864 7865 if (tm.rotationX && Math.abs(tm.rotationX) + Math.abs(tm.rotation) > 359.9) { //when rotationY is set, it will often be parsed as 180 degrees different than it should be, and rotationX and rotation both being 180 (it looks the same), so we adjust for that here. 7866 tm.rotationX = tm.rotation = 0; 7867 tm.rotationY += 180; 7868 } 7869 7870 tm.scaleX = ((Math.sqrt(a11 * a11 + a21 * a21) * rnd + 0.5) | 0) / rnd; 7871 tm.scaleY = ((Math.sqrt(a22 * a22 + a23 * a23) * rnd + 0.5) | 0) / rnd; 7872 tm.scaleZ = ((Math.sqrt(a32 * a32 + a33 * a33) * rnd + 0.5) | 0) / rnd; 7873 tm.skewX = 0; 7874 tm.perspective = a43 ? 1 / ((a43 < 0) ? -a43 : a43) : 0; 7875 tm.x = a14; 7876 tm.y = a24; 7877 tm.z = a34; 7878 if (tm.svg) { 7879 tm.x -= tm.xOrigin - (tm.xOrigin * a11 - tm.yOrigin * a12); 7880 tm.y -= tm.yOrigin - (tm.yOrigin * a21 - tm.xOrigin * a22); 7881 } 7882 7883 } else if ((!_supports3D || parse || !m.length || tm.x !== m[4] || tm.y !== m[5] || (!tm.rotationX && !tm.rotationY)) && !(tm.x !== undefined && _getStyle(t, "display", cs) === "
7883none")) { //sometimes a 6-element matrix is returned even when we performed 3D transforms, like if rotationX and rotationY are 180. In cases like this, we still need to honor the 3D transforms. If we just rely on the 2D info, it could affect how the data is interpreted, like scaleY might get set to -1 or rotation could get offset by 180 degrees. For example, do a TweenLite.to(element, 1, {css:{rotationX:180, rotationY:180}}) and then later, TweenLite.to(element, 1, {css:{rotationX:0}}) and without this conditional logic in place, it'd jump to a state of being unrotated when the 2nd tween starts. Then again, we need to honor the fact that the user COULD alter the transforms outside of CSSPlugin, like by manually applying new css, so we try to sense that by looking at x and y because if those changed, we know the changes were made outside CSSPlugin and we force a reinterpretation of the matrix values. Also, in Webkit browsers, if the element's "display" is "none", its calculated style value will always return empty, so if we've already recorded the values in the _gsTransform object, we'll just rely on those. 7884 var k = (m.length >= 6), 7885 a = k ? m[0] : 1, 7886 b = m[1] || 0, 7887 c = m[2] || 0, 7888 d = k ? m[3] : 1; 7889 tm.x = m[4] || 0; 7890 tm.y = m[5] || 0; 7891 scaleX = Math.sqrt(a * a + b * b); 7892 scaleY = Math.sqrt(d * d + c * c); 7893 rotation = (a || b) ? Math.atan2(b, a) * _RAD2DEG : tm.rotation || 0; //note: if scaleX is 0, we cannot accurately measure rotation. Same for skewX with a scaleY of 0. Therefore, we default to the previously recorded value (or zero if that doesn't exist). 7894 skewX = (c || d) ? Math.atan2(c, d) * _RAD2DEG + rotation : tm.skewX || 0; 7895 if (Math.abs(skewX) > 90 && Math.abs(skewX) < 270) { 7896 if (invX) { 7897 scaleX *= -1; 7898 skewX += (rotation <= 0) ? 180 : -180; 7899 rotation += (rotation <= 0) ? 180 : -180; 7900 } else { 7901 scaleY *= -1; 7902 skewX += (skewX <= 0) ? 180 : -180; 7903 } 7904 } 7905 tm.scaleX = scaleX; 7906 tm.scaleY = scaleY; 7907 tm.rotation = rotation; 7908 tm.skewX = skewX; 7909 if (_supports3D) { 7910 tm.rotationX = tm.rotationY = tm.z = 0; 7911 tm.perspective = defaultTransformPerspective; 7912 tm.scaleZ = 1; 7913 } 7914 if (tm.svg) { 7915 tm.x -= tm.xOrigin - (tm.xOrigin * a + tm.yOrigin * c); 7916 tm.y -= tm.yOrigin - (tm.xOrigin * b + tm.yOrigin * d); 7917 } 7918 } 7919 tm.zOrigin = zOrigin; 7920 //some browsers have a hard time with very small values like 2.4492935982947064e-16 (notice the "e-" towards the end) and would render the object slightly off. So we round to 0 in these cases. The conditional logic here is faster than calling Math.abs(). Also, browsers tend to render a SLIGHTLY rotated object in a fuzzy way, so we need to snap to exactly 0 when appropriate. 7921 for (i in tm) { 7922 if (tm[i] < min) if (tm[i] > -min) { 7923 tm[i] = 0; 7924 } 7925 } 7926 } 7927 //DEBUG: _log("parsed rotation of " + t.getAttribute("id")+": "+(tm.rotationX)+", "+(tm.rotationY)+", "+(tm.rotation)+", scale: "+tm.scaleX+", "+tm.scaleY+", "+tm.scaleZ+", position: "+tm.x+", "+tm.y+", "+tm.z+", perspective: "+tm.perspective+ ", origin: "+ tm.xOrigin+ ","+ tm.yOrigin); 7928 if (rec) { 7929 t._gsTransform = tm; //record to the object's _gsTransform which we use so that tweens can control individual properties independently (we need all the properties to accurately recompose the matrix in the setRatio() method) 7930 if (tm.svg) { //if we're supposed to apply transforms to the SVG element's "transform" attribute, make sure there aren't any CSS transforms applied or they'll override the attribute ones. Also clear the transform attribute if we're using CSS, just to be clean. 7931 if (_useSVGTransformAttr && t.style[_transformProp]) { 7932 TweenLite.delayedCall(0.001, function(){ //if we apply this right away (before anything has rendered), we risk there being no transforms for a brief moment and it also interferes with adjusting the transformOrigin in a tween with immediateRender:true (it'd try reading the matrix and it wouldn't have the appropriate data in place because we just removed it). 7933 _removeProp(t.style, _transformProp); 7934 });
7935 } else if (!_useSVGTransformAttr && t.getAttribute("transform")) { 7936 TweenLite.delayedCall(0.001, function(){ 7937 t.removeAttribute("transform"); 7938 }); 7939 } 7940 } 7941 } 7942 return tm; 7943 }, 7944 7945 //for setting 2D transforms in IE6, IE7, and IE8 (must use a "filter" to emulate the behavior of modern day browser transforms) 7946 _setIETransformRatio = function(v) { 7947 var t = this.data, //refers to the element's _gsTransform object 7948 ang = -t.rotation * _DEG2RAD, 7949 skew = ang + t.skewX * _DEG2RAD, 7950 rnd = 100000, 7951 a = ((Math.cos(ang) * t.scaleX * rnd) | 0) / rnd, 7952 b = ((Math.sin(ang) * t.scaleX * rnd) | 0) / rnd, 7953 c = ((Math.sin(skew) * -t.scaleY * rnd) | 0) / rnd, 7954 d = ((Math.cos(skew) * t.scaleY * rnd) | 0) / rnd, 7955 style = this.t.style, 7956 cs = this.t.currentStyle, 7957 filters, val; 7958 if (!cs) { 7959 return; 7960 } 7961 val = b; //just for swapping the variables an inverting them (reused "val" to avoid creating another variable in memory). IE's filter matrix uses a non-standard matrix configuration (angle goes the opposite way, and b and c are reversed and inverted) 7962 b = -c; 7963 c = -val; 7964 filters = cs.filter; 7965 style.filter = ""; //remove filters so that we can accurately measure offsetWidth/offsetHeight 7966 var w = this.t.offsetWidth, 7967 h = this.t.offsetHeight, 7968 clip = (cs.position !== "absolute"), 7969 m = "progid:DXImageTransform.Microsoft.Matrix(M11=" + a + ", M12=" + b + ", M21=" + c + ", M22=" + d, 7970 ox = t.x + (w * t.xPercent / 100), 7971 oy = t.y + (h * t.yPercent / 100), 7972 dx, dy; 7973 7974 //if transformOrigin is being used, adjust the offset x and y 7975 if (t.ox != null) { 7976 dx = ((t.oxp) ? w * t.ox * 0.01 : t.ox) - w / 2; 7977 dy = ((t.oyp) ? h * t.oy * 0.01 : t.oy) - h / 2; 7978 ox += dx - (dx * a + dy * b); 7979 oy += dy - (dx * c + dy * d); 7980 } 7981 7982 if (!clip) { 7983 m += ", sizingMethod='auto expand')"; 7984 } else { 7985 dx = (w / 2); 7986 dy = (h / 2); 7987 //translate to ensure that transformations occur around the correct origin (default is center). 7988 m += ", Dx=" + (dx - (dx * a + dy * b) + ox) + ", Dy=" + (dy - (dx * c + dy * d) + oy) + ")"; 7989 } 7990 if (filters.indexOf("DXImageTransform.Microsoft.Matrix(") !== -1) { 7991 style.filter = filters.replace(_ieSetMatrixExp, m); 7992 } else { 7993 style.filter = m + " " + filters; //we must always put the transform/matrix FIRST (before alpha(opacity=xx)) to avoid an IE bug that slices part of the object when rotation is applied with alpha. 7994 } 7995 7996 //at the end or beginning of the tween, if the matrix is normal (1, 0, 0, 1) and opacity is 100 (or doesn't exist), remove the filter to improve browser performance. 7997 if (v === 0 || v === 1) if (a === 1) if (b === 0) if (c === 0) if (d === 1) if (!clip || m.indexOf("Dx=0, Dy=0") !== -1) if (!_opacityExp.test(filters) || parseFloat(RegExp.$1) === 100) if (filters.indexOf("gradient(" && filters.indexOf("Alpha")) === -1) { 7998 style.removeAttribute("filter"); 7999 } 8000 8001 //we must set the margins AFTER applying the filter in order to avoid some bugs in IE8 that could (in rare scenarios) cause them to be ignored intermittently (vibration). 8002 if (!clip) { 8003 var mult = (_ieVers < 8) ? 1 : -1, //in Internet Explorer 7 and before, the box model is broken, causing the browser to treat the width/height of the actual rotated filtered image as the width/height of the box itself, but Microsoft corrected that in IE8. We must use a negative offset in IE8 on the right/bottom 8004 marg, prop, dif; 8005 dx = t.ieOffsetX || 0; 8006 dy = t.ieOffsetY || 0; 8007 t.ieOffsetX = Math.round((w - ((a < 0 ? -a : a) * w + (b < 0 ? -b : b) * h)) / 2 + ox); 8008 t.ieOffsetY = Math.round((h - ((d < 0 ? -d : d) * h + (c < 0 ? -c : c) * w)) / 2 + oy); 8009 for (i = 0; i < 4; i++) { 8010 prop = _margins[i]; 8011 marg = cs[prop]; 8012 //we need to get the current margin in case it is being tweened separately (we want to respect that tween's changes) 8013 val = (marg.indexOf("px") !== -1) ? parseFloat(marg) : _convertToPixels(this.t, prop, parseFloat(marg), marg.replace(_suffixExp, "")) || 0; 8014 if (val !== t[prop]) { 8015 dif = (i < 2) ? -t.ieOffsetX : -t.ieOffsetY; //if another tween is controlling a margin, we cannot only apply the difference in the ieOffsets, so we essentially zero-out the dx and dy here in that case. We record the margin(s) later so that we can keep comparing them, making this code very flexible. 8016 } else { 8017 dif = (i < 2) ? dx - t.ieOffsetX : dy - t.ieOffsetY; 8018 } 8019 style[prop] = (t[prop] = Math.round( val - dif * ((i === 0 || i === 2) ? 1 : mult) )) + "px"; 8020 } 8021 } 8022 }, 8023 8024 /* translates a super small decimal to a string WITHOUT scientific notation 8025 _safeDecimal = function(n) { 8026 var s = (n < 0 ? -n : n) + "", 8027 a = s.split("e-"); 8028 return (n < 0 ? "-0." : "0.") + new Array(parseInt(a[1], 10) || 0).join("0") + a[0].split(".").join(""); 8029 }, 8030 */ 8031 8032 _setTransformRatio = _internals.set3DTransformRatio = _internals.setTransformRatio = function(v) { 8033 var t = this.data, //refers to the element's _gsTransform object 8034 style = this.t.style, 8035 angle = t.rotation, 8036 rotationX = t.rotationX, 8037 rotationY = t.rotationY, 8038 sx = t.scaleX, 8039 sy = t.scaleY, 8040 sz = t.scaleZ, 8041 x = t.x, 8042 y = t.y, 8043 z = t.z, 8044 isSVG = t.svg, 8045 perspective = t.perspective, 8046 force3D = t.force3D, 8047 a11, a12, a13, a21, a22, a23, a31, a32, a33, a41, a42, a43, 8048 zOrigin, min, cos, sin, t1, t2, transform, comma, zero, skew, rnd; 8049 //check to see if we should render as 2D (and SVGs must use 2D when _useSVGTransformAttr is true) 8050 if (((((v === 1 || v === 0) && force3D === "auto" && (this.tween._totalTime === this.tween._totalDuration || !this.tween._totalTime)) || !force3D) && !z && !perspective && !rotationY && !rotationX) || (_useSVGTransformAttr && isSVG) || !_supports3D) { //on the final render (which could be 0 for a from tween), if there are no 3D aspects, render in 2D to free up memory and improve performance especially on mobile devices. Check the tween's totalTime/totalDuration too in order to make sure it doesn't happen between repeats if it's a repeating tween. 8051 8052 //2D 8053 if (angle || t.skewX || isSVG) { 8054 angle *= _DEG2RAD; 8055 skew = t.skewX * _DEG2RAD; 8056 rnd = 100000; 8057 a11 = Math.cos(angle) * sx; 8058 a21 = Math.sin(angle) * sx; 8059 a12 = Math.sin(angle - skew) * -sy;
8060 a22 = Math.cos(angle - skew) * sy; 8061 if (skew && t.skewType === "simple") { //by default, we compensate skewing on the other axis to make it look more natural, but you can set the skewType to "simple" to use the uncompensated skewing that CSS does 8062 t1 = Math.tan(skew); 8063 t1 = Math.sqrt(1 + t1 * t1); 8064 a12 *= t1; 8065 a22 *= t1; 8066 if (t.skewY) { 8067 a11 *= t1; 8068 a21 *= t1; 8069 } 8070 } 8071 if (isSVG) { 8072 x += t.xOrigin - (t.xOrigin * a11 + t.yOrigin * a12) + t.xOffset; 8073 y += t.yOrigin - (t.xOrigin * a21 + t.yOrigin * a22) + t.yOffset; 8074 if (_useSVGTransformAttr && (t.xPercent || t.yPercent)) { //The SVG spec doesn't support percentage-based translation in the "transform" attribute, so we merge it into the matrix to simulate it. 8075 min = this.t.getBBox(); 8076 x += t.xPercent * 0.01 * min.width; 8077 y += t.yPercent * 0.01 * min.height; 8078 } 8079 min = 0.000001; 8080 if (x < min) if (x > -min) { 8081 x = 0; 8082 } 8083 if (y < min) if (y > -min) { 8084 y = 0; 8085 } 8086 } 8087 transform = (((a11 * rnd) | 0) / rnd) + "," + (((a21 * rnd) | 0) / rnd) + "," + (((a12 * rnd) | 0) / rnd) + "," + (((a22 * rnd) | 0) / rnd) + "," + x + "," + y + ")"; 8088 if (isSVG && _useSVGTransformAttr) {
8089 this.t.setAttribute("transform", "matrix(" + transform); 8090 } else { 8091 //some browsers have a hard time with very small values like 2.4492935982947064e-16 (notice the "e-" towards the end) and would render the object slightly off. So we round to 5 decimal places. 8092 style[_transformProp] = ((t.xPercent || t.yPercent) ? "translate(" + t.xPercent + "%," + t.yPercent + "%) matrix(" : "matrix(") + transform; 8093 } 8094 } else { 8095 style[_transformProp] = ((t.xPercent || t.yPercent) ? "translate(" + t.xPercent + "%," + t.yPercent + "%) matrix(" : "matrix(") + sx + ",0,0," + sy + "," + x + "," + y + ")"; 8096 } 8097 return; 8098 8099 } 8100 if (_isFirefox) { //Firefox has a bug (at least in v25) that causes it to render the transparent part of 32-bit PNG images as black when displayed inside an iframe and the 3D scale is very small and doesn't change sufficiently enough between renders (like if you use a Power4.easeInOut to scale from 0 to 1 where the beginning values only change a tiny amount to begin the tween before accelerating). In this case, we force the scale to be 0.00002 instead which is visually the same but works around the Firefox issue. 8101 min = 0.0001; 8102 if (sx < min && sx > -min) { 8103 sx = sz = 0.00002; 8104 } 8105 if (sy < min && sy > -min) { 8106 sy = sz = 0.00002; 8107 } 8108 if (perspective && !t.z && !t.rotationX && !t.rotationY) { //Firefox has a bug that causes elements to have an odd super-thin, broken/dotted black border on elements that have a perspective set but aren't utilizing 3D space (no rotationX, rotationY, or z). 8109 perspective = 0; 8110 } 8111 } 8112 if (angle || t.skewX) { 8113 angle *= _DEG2RAD; 8114 cos = a11 = Math.cos(angle); 8115 sin = a21 = Math.sin(angle); 8116 if (t.skewX) { 8117 angle -= t.skewX * _DEG2RAD; 8118 cos = Math.cos(angle); 8119 sin = Math.sin(angle); 8120 if (t.skewType === "simple") { //by default, we compensate skewing on the other axis to make it look more natural, but you can set the skewType to "simple" to use the uncompensated skewing that CSS does 8121 t1 = Math.tan(t.skewX * _DEG2RAD); 8122 t1 = Math.sqrt(1 + t1 * t1); 8123 cos *= t1; 8124 sin *= t1; 8125 if (t.skewY) { 8126 a11 *= t1; 8127 a21 *= t1; 8128 } 8129 } 8130 } 8131 a12 = -sin; 8132 a22 = cos; 8133 8134 } else if (!rotationY && !rotationX && sz === 1 && !perspective && !isSVG) { //if we're only translating and/or 2D scaling, this is faster... 8135 style[_transformProp] = ((t.xPercent || t.yPercent) ? "translate(" + t.xPercent + "%," + t.yPercent + "%) translate3d(" : "translate3d(") + x + "px," + y + "px," + z +"px)" + ((sx !== 1 || sy !== 1) ? " scale(" + sx + "," + sy + ")" : ""); 8136 return; 8137 } else { 8138 a11 = a22 = 1; 8139 a12 = a21 = 0; 8140 } 8141 // KEY INDEX AFFECTS 8142 // a11 0 rotation, rotationY, scaleX 8143 // a21 1 rotation, rotationY, scaleX 8144 // a31 2 rotationY, scaleX 8145 // a41 3 rotationY, scaleX 8146 // a12 4 rotation, skewX, rotationX, scaleY 8147 // a22 5 rotation, skewX, rotationX, scaleY 8148 // a32 6 rotationX, scaleY 8149 // a42 7 rotationX, scaleY 8150 // a13 8 rotationY, rotationX, scaleZ 8151 // a23 9 rotationY, rotationX, scaleZ 8152 // a33 10 rotationY, rotationX, scaleZ 8153 // a43 11 rotationY, rotationX, perspective, scaleZ 8154 // a14 12 x, zOrigin, svgOrigin 8155 // a24 13 y, zOrigin, svgOrigin 8156 // a34 14 z, zOrigin 8157 // a44 15 8158 // rotation: Math.atan2(a21, a11) 8159 // rotationY: Math.atan2(a13, a33) (or Math.atan2(a13, a11)) 8160 // rotationX: Math.atan2(a32, a33) 8161 a33 = 1; 8162 a13 = a23 = a31 = a32 = a41 = a42 = 0; 8163 a43 = (perspective) ? -1 / perspective : 0; 8164 zOrigin = t.zOrigin; 8165 min = 0.000001; //threshold below which browsers use scientific notation which won't work. 8166 comma = ","; 8167 zero = "0"; 8168 angle = rotationY * _DEG2RAD; 8169 if (angle) { 8170 cos = Math.cos(angle); 8171 sin = Math.sin(angle); 8172 a31 = -sin; 8173 a41 = a43*-sin; 8174 a13 = a11*sin; 8175 a23 = a21*sin; 8176 a33 = cos; 8177 a43 *= cos; 8178 a11 *= cos; 8179 a21 *= cos; 8180 } 8181 angle = rotationX * _DEG2RAD; 8182 if (angle) { 8183 cos = Math.cos(angle); 8184 sin = Math.sin(angle); 8185 t1 = a12*cos+a13*sin; 8186 t2 = a22*cos+a23*sin; 8187 a32 = a33*sin; 8188 a42 = a43*sin; 8189 a13 = a12*-sin+a13*cos; 8190 a23 = a22*-sin+a23*cos; 8191 a33 = a33*cos; 8192 a43 = a43*cos; 8193 a12 = t1; 8194 a22 = t2; 8195 } 8196 if (sz !== 1) { 8197 a13*=sz; 8198 a23*=sz; 8199 a33*=sz; 8200 a43*=sz; 8201 } 8202 if (sy !== 1) { 8203 a12*=sy; 8204 a22*=sy; 8205 a32*=sy; 8206 a42*=sy; 8207 } 8208 if (sx !== 1) { 8209 a11*=sx; 8210 a21*=sx; 8211 a31*=sx; 8212 a41*=sx; 8213 } 8214 8215 if (zOrigin || isSVG) { 8216 if (zOrigin) { 8217 x += a13*-zOrigin; 8218 y += a23*-zOrigin; 8219 z += a33*-zOrigin+zOrigin; 8220 } 8221 if (isSVG) { //due to bugs in some browsers, we need to manage the transform-origin of SVG manually 8222 x += t.xOrigin - (t.xOrigin * a11 + t.yOrigin * a12) + t.xOffset; 8223 y += t.yOrigin - (t.xOrigin * a21 + t.yOrigin * a22) + t.yOffset; 8224 } 8225 if (x < min && x > -min) { 8226 x = zero; 8227 } 8228 if (y < min && y > -min) { 8229 y = zero; 8230 } 8231 if (z < min && z > -min) { 8232 z = 0; //don't use string because we calculate perspective later and need the number. 8233 } 8234 } 8235 8236 //optimized way of concatenating all the values into a string. If we do it all in one shot, it's slower because of the way browsers have to create temp strings and the way it affects memory. If we do it piece-by-piece with +=, it's a bit slower too. We found that doing it in these sized chunks works best overall: 8237 transform = ((t.xPercent || t.yPercent) ? "translate(" + t.xPercent + "%," + t.yPercent + "%) matrix3d(" : "matrix3d("); 8238 transform += ((a11 < min && a11 > -min) ? zero : a11) + comma + ((a21 < min && a21 > -min) ? zero : a21) + comma + ((a31 < min && a31 > -min) ? zero : a31); 8239 transform += comma + ((a41 < min && a41 > -min) ? zero : a41) + comma + ((a12 < min && a12 > -min) ? zero : a12) + comma + ((a22 < min && a22 > -min) ? zero : a22); 8240 if (rotationX || rotationY) { //performance optimization (often there's no rotationX or rotationY, so we can skip these calculations) 8241 transform += comma + ((a32 < min && a32 > -min) ? zero : a32) + comma + ((a42 < min && a42 > -min) ? zero : a42) + comma + ((a13 < min && a13 > -min) ? zero : a13); 8242 transform += comma + ((a23 < min && a23 > -min) ? zero : a23) + comma + ((a33 < min && a33 > -min) ? zero : a33) + comma + ((a43 < min && a43 > -min) ? zero : a43) + comma; 8243 } else { 8244 transform += ",0,0,0,0,1,0,"; 8245 } 8246 transform += x + comma + y + comma + z + comma + (perspective ? (1 + (-z / perspective)) : 1) + ")"; 8247 8248 style[_transformProp] = transform; 8249 }; 8250 8251 p = Transform.prototype; 8252 p.x = p.y = p.z = p.skewX = p.skewY = p.rotation = p.rotationX = p.rotationY = p.zOrigin = p.xPercent = p.yPercent = p.xOffset = p.yOffset = 0; 8253 p.scaleX = p.scaleY = p.scaleZ = 1; 8254 8255 _registerComplexSpecialProp("transform,scale,scaleX,scaleY,scaleZ,x,y,z,rotation,rotationX,rotationY,rotationZ,skewX,skewY,shortRotation,shortRotationX,shortRotationY,shortRotationZ,transformOrigin,svgOrigin,transformPerspective,directionalRotation,parseTransform,force3D,skewType,xPercent,yPercent,smoothOrigin", {parser:function(t, e, p, cssp, pt, plugin, vars) { 8256 if (cssp._lastParsedTransform === vars) { return pt; } //only need to parse the transform once, and only if the browser supports it. 8257 cssp._lastParsedTransform = vars; 8258 var originalGSTransform = t._gsTransform, 8259 style = t.style, 8260 min = 0.000001, 8261 i = _transformProps.length, 8262 v = vars, 8263 endRotations = {}, 8264 transformOriginString = "transformOrigin", 8265 m1, m2, skewY, copy, orig, has3D, hasChange, dr, x, y; 8266 if (vars.display) { //if the user is setting display during this tween, it may not be instantiated yet but we must force it here in order to get accurate readings. If display is "none", some browsers refuse to report the transform properties correctly. 8267 copy = _getStyle(t, "display"); 8268 style.display = "block"; 8269 m1 = _getTransform(t, _cs, true, vars.parseTransform); 8270 style.display = copy; 8271 } else { 8272 m1 = _getTransform(t, _cs, true, vars.parseTransform); 8273 } 8274 cssp._transform = m1; 8275 if (typeof(v.transform) === "string" && _transformProp) { //for values like transform:"rotate(60deg) scale(0.5, 0.8)" 8276 copy = _tempDiv.style; //don't use the original target because it might be SVG in which case some browsers don't report computed style correctly. 8277 copy[_transformProp] = v.transform; 8278 copy.display = "block"; //if display is "none", the browser often refuses to report the transform properties correctly. 8279 copy.position = "absolute"; 8280 _doc.body.appendChild(_tempDiv); 8281 m2 = _getTransform(_tempDiv, null, false); 8282 _doc.body.removeChild(_tempDiv); 8283 if (!m2.perspective) { 8284 m2.perspective = m1.perspective; //tweening to no perspective gives very unintuitive results - just keep the same perspective in that case. 8285 } 8286 if (v.xPercent != null) { 8287 m2.xPercent = _parseVal(v.xPercent, m1.xPercent); 8288 } 8289 if (v.yPercent != null) { 8290 m2.yPercent = _parseVal(v.yPercent, m1.yPercent); 8291 } 8292 } else if (typeof(v) === "object") { //for values like scaleX, scaleY, rotation, x, y, skewX, and skewY or transform:{...} (object) 8293 m2 = {scaleX:_parseVal((v.scaleX != null) ? v.scaleX : v.scale, m1.scaleX), 8294 scaleY:_parseVal((v.scaleY != null) ? v.scaleY : v.scale, m1.scaleY), 8295 scaleZ:_parseVal(v.scaleZ, m1.scaleZ), 8296 x:_parseVal(v.x, m1.x), 8297 y:_parseVal(v.y, m1.y), 8298 z:_parseVal(v.z, m1.z), 8299 xPercent:_parseVal(v.xPercent, m1.xPercent), 8300 yPercent:_parseVal(v.yPercent, m1.yPercent), 8301 perspective:_parseVal(v.transformPerspective, m1.perspective)}; 8302 dr = v.directionalRotation; 8303 if (dr != null) { 8304 if (typeof(dr) === "object") { 8305 for (copy in dr) { 8306 v[copy] = dr[copy]; 8307 } 8308 } else { 8309 v.rotation = dr; 8310 } 8311 } 8312 if (typeof(v.x) === "string" && v.x.indexOf("%") !== -1) { 8313 m2.x = 0; 8314 m2.xPercent = _parseVal(v.x, m1.xPercent); 8315 } 8316 if (typeof(v.y) === "string" && v.y.indexOf("%") !== -1) { 8317 m2.y = 0; 8318 m2.yPercent = _parseVal(v.y, m1.yPercent); 8319 } 8320 8321 m2.rotation = _parseAngle(("rotation" in v) ? v.rotation : ("shortRotation" in v) ? v.shortRotation + "_short" : ("rotationZ" in v) ? v.rotationZ : m1.rotation, m1.rotation, "rotation", endRotations); 8322 if (_supports3D) { 8323 m2.rotationX = _parseAngle(("rotationX" in v) ? v.rotationX : ("shortRotationX" in v) ? v.shortRotationX + "_short" : m1.rotationX || 0, m1.rotationX, "rotationX", endRotations); 8324 m2.rotationY = _parseAngle(("rotationY" in v) ? v.rotationY : ("shortRotationY" in v) ? v.shortRotationY + "_short" : m1.rotationY || 0, m1.rotationY, "rotationY", endRotations); 8325 }
8326 m2.skewX = (v.skewX == null) ? m1.skewX : _parseAngle(v.skewX, m1.skewX); 8327 8328 //note: for performance reasons, we combine all skewing into the skewX and rotation values, ignoring skewY but we must still record it so that we can discern how much of the overall skew is attributed to skewX vs. skewY. Otherwise, if the skewY would always act relative (tween skewY to 10deg, for example, multiple times and if we always combine things into skewX, we can't remember that skewY was 10 from last time). Remember, a skewY of 10 degrees looks the same as a rotation of 10 degrees plus a skewX of -10 degrees. 8329 m2.skewY = (v.skewY == null) ? m1.skewY : _parseAngle(v.skewY, m1.skewY); 8330 if ((skewY = m2.skewY - m1.skewY)) { 8331 m2.skewX += skewY; 8332 m2.rotation += skewY; 8333 } 8334 } 8335 if (_supports3D && v.force3D != null) { 8336 m1.force3D = v.force3D; 8337 hasChange = true; 8338 } 8339 8340 m1.skewType = v.skewType || m1.skewType || CSSPlugin.defaultSkewType; 8341 8342 has3D = (m1.force3D || m1.z || m1.rotationX || m1.rotationY || m2.z || m2.rotationX || m2.rotationY || m2.perspective); 8343 if (!has3D && v.scale != null) { 8344 m2.scaleZ = 1; //no need to tween scaleZ. 8345 } 8346 8347 while (--i > -1) { 8348 p = _transformProps[i]; 8349 orig = m2[p] - m1[p]; 8350 if (orig > min || orig < -min || v[p] != null || _forcePT[p] != null) { 8351 hasChange = true; 8352 pt = new CSSPropTween(m1, p, m1[p], orig, pt); 8353 if (p in endRotations) { 8354 pt.e = endRotations[p]; //directional rotations typically have compensated values during the tween, but we need to make sure they end at exactly what the user requested 8355 } 8356 pt.xs0 = 0; //ensures the value stays numeric in setRatio() 8357 pt.plugin = plugin; 8358 cssp._overwriteProps.push(pt.n); 8359 } 8360 } 8361 8362 orig = v.transformOrigin; 8363 if (m1.svg && (orig || v.svgOrigin)) { 8364 x = m1.xOffset; //when we change the origin, in order to prevent things from jumping we adjust the x/y so we must record those here so that we can create PropTweens for them and flip them at the same time as the origin 8365 y = m1.yOffset; 8366 _parseSVGOrigin(t, _parsePosition(orig), m2, v.svgOrigin, v.smoothOrigin); 8367 pt = _addNonTweeningNumericPT(m1, "xOrigin", (originalGSTransform ? m1 : m2).xOrigin, m2.xOrigin, pt, transformOriginString); //note: if there wasn't a transformOrigin defined yet, just start with the destination one; it's wasteful otherwise, and it causes problems with fromTo() tweens. For example, TweenLite.to("#wheel", 3, {rotation:180, transformOrigin:"50% 50%", delay:1}); TweenLite.fromTo("#wheel", 3, {scale:0.5, transformOrigin:"50% 50%"}, {scale:1, delay:2}); would cause a jump when the from values revert at the beginning of the 2nd tween. 8368 pt = _addNonTweeningNumericPT(m1, "yOrigin", (originalGSTransform ? m1 : m2).yOrigin, m2.yOrigin, pt, transformOriginString); 8369 if (x !== m1.xOffset || y !== m1.yOffset) { 8370 pt = _addNonTweeningNumericPT(m1, "xOffset", (originalGSTransform ? x : m1.xOffset), m1.xOffset, pt, transformOriginString); 8371 pt = _addNonTweeningNumericPT(m1, "yOffset", (originalGSTransform ? y : m1.yOffset), m1.yOffset, pt, transformOriginString); 8372 } 8373 orig = _useSVGTransformAttr ? null : "0px 0px"; //certain browsers (like firefox) completely botch transform-origin, so we must remove it to prevent it from contaminating transforms. We manage it ourselves with xOrigin and yOrigin 8374 } 8375 if (orig || (_supports3D && has3D && m1.zOrigin)) { //if anything 3D is happening and there's a transformOrigin with a z component that's non-zero, we must ensure that the transformOrigin's z-component is set to 0 so that we can manually do those calculations to get around Safari bugs. Even if the user didn't specifically define a "transformOrigin" in this particular tween (maybe they did it via css directly). 8376 if (_transformProp) { 8377 hasChange = true; 8378 p = _transformOriginProp; 8379 orig = (orig || _getStyle(t, p, _cs, false, "50% 50%")) + ""; //cast as string to avoid errors 8380 pt = new CSSPropTween(style, p, 0, 0, pt, -1, transformOriginString); 8381 pt.b = style[p]; 8382 pt.plugin = plugin; 8383 if (_supports3D) { 8384 copy = m1.zOrigin; 8385 orig = orig.split(" "); 8386 m1.zOrigin = ((orig.length > 2 && !(copy !== 0 && orig[2] === "0px")) ? parseFloat(orig[2]) : copy) || 0; //Safari doesn't handle the z part of transformOrigin correctly, so we'll manually handle it in the _set3DTransformRatio() method. 8387 pt.xs0 = pt.e = orig[0] + " " + (orig[1] || "50%") + " 0px"; //we must define a z value of 0px specifically otherwise iOS 5 Safari will stick with the old one (if one was defined)! 8388 pt = new CSSPropTween(m1, "zOrigin", 0, 0, pt, -1, pt.n); //we must create a CSSPropTween for the _gsTransform.zOrigin so that it gets reset properly at the beginning if the tween runs backward (as opposed to just setting m1.zOrigin here) 8389 pt.b = copy; 8390 pt.xs0 = pt.e = m1.zOrigin; 8391 } else { 8392 pt.xs0 = pt.e = orig; 8393 } 8394 8395 //for older versions of IE (6-8), we need to manually calculate things inside the setRatio() function. We record origin x and y (ox and oy) and whether or not the values are percentages (oxp and oyp). 8396 } else { 8397 _parsePosition(orig + "", m1); 8398 } 8399 } 8400 if (hasChange) { 8401 cssp._transformType = (!(m1.svg && _useSVGTransformAttr) && (has3D || this._transformType === 3)) ? 3 : 2; //quicker than calling cssp._enableTransforms(); 8402 } 8403 return pt; 8404 }, prefix:true}); 8405 8406 _registerComplexSpecialProp("boxShadow", {defaultValue:"0px 0px 0px 0px #999", prefix:true, color:true, multi:true, keyword:"inset"}); 8407 8408 _registerComplexSpecialProp("borderRadius", {defaultValue:"0px", parser:function(t, e, p, cssp, pt, plugin) { 8409 e = this.format(e); 8410 var props = ["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"], 8411 style = t.style, 8412 ea1, i, es2, bs2, bs, es, bn, en, w, h, esfx, bsfx, rel, hn, vn, em; 8413 w = parseFloat(t.offsetWidth);
8414 h = parseFloat(t.offsetHeight); 8415 ea1 = e.split(" "); 8416 for (i = 0; i < props.length; i++) { //if we're dealing with percentages, we must convert things separately for the horizontal and vertical axis! 8417 if (this.p.indexOf("border")) { //older browsers used a prefix 8418 props[i] = _checkPropPrefix(props[i]); 8419 } 8420 bs = bs2 = _getStyle(t, props[i], _cs, false, "0px"); 8421 if (bs.indexOf(" ") !== -1) { 8422 bs2 = bs.split(" "); 8423 bs = bs2[0]; 8424 bs2 = bs2[1]; 8425 } 8426 es = es2 = ea1[i]; 8427 bn = parseFloat(bs); 8428 bsfx = bs.substr((bn + "").length); 8429 rel = (es.charAt(1) === "="); 8430 if (rel) { 8431 en = parseInt(es.charAt(0)+"1", 10); 8432 es = es.substr(2); 8433 en *= parseFloat(es); 8434 esfx = es.substr((en + "").length - (en < 0 ? 1 : 0)) || ""; 8435 } else { 8436 en = parseFloat(es); 8437 esfx = es.substr((en + "").length); 8438 } 8439 if (esfx === "") { 8440 esfx = _suffixMap[p] || bsfx; 8441 } 8442 if (esfx !== bsfx) { 8443 hn = _convertToPixels(t, "borderLeft", bn, bsfx); //horizontal number (we use a bogus "borderLeft" property just because the _convertToPixels() method searches for the keywords "Left", "Right", "Top", and "Bottom" to determine of it's a horizontal or vertical property, and we need "border" in the name so that it knows it should measure relative to the element itself, not its parent. 8444 vn = _convertToPixels(t, "borderTop", bn, bsfx); //vertical number 8445 if (esfx === "%") { 8446 bs = (hn / w * 100) + "%"; 8447 bs2 = (vn / h * 100) + "%"; 8448 } else if (esfx === "em") { 8449 em = _convertToPixels(t, "borderLeft", 1, "em"); 8450 bs = (hn / em) + "em"; 8451 bs2 = (vn / em) + "em"; 8452 } else { 8453 bs = hn + "px"; 8454 bs2 = vn + "px"; 8455 } 8456 if (rel) { 8457 es = (parseFloat(bs) + en) + esfx; 8458 es2 = (parseFloat(bs2) + en) + esfx; 8459 } 8460 } 8461 pt = _parseComplex(style, props[i], bs + " " + bs2, es + " " + es2, false, "0px", pt); 8462 } 8463 return pt; 8464 }, prefix:true, formatter:_getFormatter("0px 0px 0px 0px", false, true)}); 8465 _registerComplexSpecialProp("backgroundPosition", {defaultValue:"0 0", parser:function(t, e, p, cssp, pt, plugin) { 8466 var bp = "background-position", 8467 cs = (_cs || _getComputedStyle(t, null)), 8468 bs = this.format( ((cs) ? _ieVers ? cs.getPropertyValue(bp + "-x") + " " + cs.getPropertyValue(bp + "-y") : cs.getPropertyValue(bp) : t.currentStyle.backgroundPositionX + " " + t.currentStyle.backgroundPositionY) || "0 0"), //Internet Explorer doesn't report background-position correctly - we must query background-position-x and background-position-y and combine them (even in IE10). Before IE9, we must do the same with the currentStyle object and use camelCase 8469 es = this.format(e), 8470 ba, ea, i, pct, overlap, src; 8471 if ((bs.indexOf("%") !== -1) !== (es.indexOf("%") !== -1)) { 8472 src = _getStyle(t, "backgroundImage").replace(_urlExp, ""); 8473 if (src && src !== "none") { 8474 ba = bs.split(" "); 8475 ea = es.split(" "); 8476 _tempImg.setAttribute("src", src); //set the temp IMG's src to the background-image so that we can measure its width/height 8477 i = 2; 8478 while (--i > -1) { 8479 bs = ba[i]; 8480 pct = (bs.indexOf("%") !== -1); 8481 if (pct !== (ea[i].indexOf("%") !== -1)) { 8482 overlap = (i === 0) ? t.offsetWidth - _tempImg.width : t.offsetHeight - _tempImg.height; 8483 ba[i] = pct ? (parseFloat(bs) / 100 * overlap) + "px" : (parseFloat(bs) / overlap * 100) + "%"; 8484 } 8485 } 8486 bs = ba.join(" "); 8487 } 8488 } 8489 return this.parseComplex(t.style, bs, es, pt, plugin); 8490 }, formatter:_parsePosition}); 8491 _registerComplexSpecialProp("backgroundSize", {defaultValue:"0 0", formatter:_parsePosition}); 8492 _registerComplexSpecialProp("perspective", {defaultValue:"0px", prefix:true}); 8493 _registerComplexSpecialProp("perspectiveOrigin", {defaultValue:"50% 50%", prefix:true}); 8494 _registerComplexSpecialProp("transformStyle", {prefix:true}); 8495 _registerComplexSpecialProp("backfaceVisibility", {prefix:true}); 8496 _registerComplexSpecialProp("userSelect", {prefix:true}); 8497 _registerComplexSpecialProp("margin", {parser:_getEdgeParser("marginTop,marginRight,marginBottom,marginLeft")}); 8498 _registerComplexSpecialProp("padding", {parser:_getEdgeParser("paddingTop,paddingRight,paddingBottom,paddingLeft")}); 8499 _registerComplexSpecialProp("clip", {defaultValue:"rect(0px,0px,0px,0px)", parser:function(t, e, p, cssp, pt, plugin){ 8500 var b, cs, delim; 8501 if (_ieVers < 9) { //IE8 and earlier don't report a "clip" value in the currentStyle - instead, the values are split apart into clipTop, clipRight, clipBottom, and clipLeft. Also, in IE7 and earlier, the values inside rect() are space-delimited, not comma-delimited. 8502 cs = t.currentStyle; 8503 delim = _ieVers < 8 ? " " : ","; 8504 b = "rect(" + cs.clipTop + delim + cs.clipRight + delim + cs.clipBottom + delim + cs.clipLeft + ")"; 8505 e = this.format(e).split(",").join(delim); 8506 } else { 8507 b = this.format(_getStyle(t, this.p, _cs, false, this.dflt)); 8508 e = this.format(e); 8509 } 8510 return this.parseComplex(t.style, b, e, pt, plugin); 8511 }}); 8512 _registerComplexSpecialProp("textShadow", {defaultValue:"0px 0px 0px #999", color:true, multi:true}); 8513 _registerComplexSpecialProp("autoRound,strictUnits", {parser:function(t, e, p, cssp, pt) {return pt;}}); //just so that we can ignore these properties (not tween them) 8514 _registerComplexSpecialProp("border", {defaultValue:"0px solid #000", parser:function(t, e, p, cssp, pt, plugin) { 8515 return this.parseComplex(t.style, this.format(_getStyle(t, "borderTopWidth", _cs, false, "0px") + " " + _getStyle(t, "borderTopStyle", _cs, false, "solid") + " " + _getStyle(t, "borderTopColor", _cs, false, "#000")), this.format(e), pt, plugin); 8516 }, color:true, formatter:function(v) { 8517 var a = v.split(" "); 8518 return a[0] + " " + (a[1] || "solid") + " " + (v.match(_colorExp) || ["#000"])[0]; 8519 }}); 8520 _registerComplexSpecialProp("borderWidth", {parser:_getEdgeParser("borderTopWidth,borderRightWidth,borderBottomWidth,borderLeftWidth")}); //Firefox doesn't pick up on borderWidth set in style sheets (only inline). 8521 _registerComplexSpecialProp("float,cssFloat,styleFloat", {parser:function(t, e, p, cssp, pt, plugin) { 8522 var s = t.style, 8523 prop = ("cssFloat" in s) ? "cssFloat" : "styleFloat"; 8524 return new CSSPropTween(s, prop, 0, 0, pt, -1, p, false, 0, s[prop], e); 8525 }}); 8526 8527 //opacity-related 8528 var _setIEOpacityRatio = function(v) { 8529 var t = this.t, //refers to the element's style property 8530 filters = t.filter || _getStyle(this.data, "filter") || "", 8531 val = (this.s + this.c * v) | 0, 8532 skip; 8533 if (val === 100) { //for older versions of IE that need to use a filter to apply opacity, we should remove the filter if opacity hits 1 in order to improve performance, but make sure there isn't a transform (matrix) or gradient in the filters. 8534 if (filters.indexOf("atrix(") === -1 && filters.indexOf("radient(") === -1 && filters.indexOf("oader(") === -1) { 8535 t.removeAttribute("filter"); 8536 skip = (!_getStyle(this.data, "filter")); //if a class is applied that has an alpha filter, it will take effect (we don't want that), so re-apply our alpha filter in that case. We must first remove it and then check. 8537 } else {
8538 t.filter = filters.replace(_alphaFilterExp, ""); 8539 skip = true; 8540 } 8541 } 8542 if (!skip) { 8543 if (this.xn1) { 8544 t.filter = filters = filters || ("alpha(opacity=" + val + ")"); //works around bug in IE7/8 that prevents changes to "visibility" from being applied properly if the filter is changed to a different alpha on the same frame. 8545 } 8546 if (filters.indexOf("pacity") === -1) { //only used if browser doesn't support the standard opacity style property (IE 7 and 8). We omit the "O" to avoid case-sensitivity issues 8547 if (val !== 0 || !this.xn1) { //bugs in IE7/8 won't render the filter properly if opacity is ADDED on the same frame/render as "visibility" changes (this.xn1 is 1 if this tween is an "autoAlpha" tween) 8548 t.filter = filters + " alpha(opacity=" + val + ")"; //we round the value because otherwise, bugs in IE7/8 can prevent "visibility" changes from being applied properly. 8549 } 8550 } else { 8551 t.filter = filters.replace(_opacityExp, "opacity=" + val); 8552 } 8553 } 8554 }; 8555 _registerComplexSpecialProp("opacity,alpha,autoAlpha", {defaultValue:"1", parser:function(t, e, p, cssp, pt, plugin) { 8556 var b = parseFloat(_getStyle(t, "opacity", _cs, false, "1")), 8557 style = t.style, 8558 isAutoAlpha = (p === "autoAlpha"); 8559 if (typeof(e) === "string" && e.charAt(1) === "=") { 8560 e = ((e.charAt(0) === "-") ? -1 : 1) * parseFloat(e.substr(2)) + b; 8561 } 8562 if (isAutoAlpha && b === 1 && _getStyle(t, "visibility", _cs) === "hidden" && e !== 0) { //if visibility is initially set to "hidden", we should interpret that as intent to make opacity 0 (a convenience) 8563 b = 0; 8564 } 8565 if (_supportsOpacity) { 8566 pt = new CSSPropTween(style, "opacity", b, e - b, pt); 8567 } else { 8568 pt = new CSSPropTween(style, "opacity", b * 100, (e - b) * 100, pt); 8569 pt.xn1 = isAutoAlpha ? 1 : 0; //we need to record whether or not this is an autoAlpha so that in the setRatio(), we know to duplicate the setting of the alpha in order to work around a bug in IE7 and IE8 that prevents changes to "visibility" from taking effect if the filter is changed to a different alpha(opacity) at the same time. Setting it to the SAME value first, then the new value works around the IE7/8 bug. 8570 style.zoom = 1; //helps correct an IE issue. 8571 pt.type = 2; 8572 pt.b = "alpha(opacity=" + pt.s + ")"; 8573 pt.e = "alpha(opacity=" + (pt.s + pt.c) + ")"; 8574 pt.data = t; 8575 pt.plugin = plugin; 8576 pt.setRatio = _setIEOpacityRatio; 8577 } 8578 if (isAutoAlpha) { //we have to create the "visibility" PropTween after the opacity one in the linked list so that they run in the order that works properly in IE8 and earlier 8579 pt = new CSSPropTween(style, "visibility", 0, 0, pt, -1, null, false, 0, ((b !== 0) ? "inherit" : "hidden"), ((e === 0) ? "hidden" : "inherit")); 8580 pt.xs0 = "inherit"; 8581 cssp._overwriteProps.push(pt.n); 8582 cssp._overwriteProps.push(p); 8583 } 8584 return pt; 8585 }}); 8586 8587 8588 var _removeProp = function(s, p) { 8589 if (p) { 8590 if (s.removeProperty) { 8591 if (p.substr(0,2) === "ms" || p.substr(0,6) === "webkit") { //Microsoft and some Webkit browsers don't conform to the standard of capitalizing the first prefix character, so we adjust so that when we prefix the caps with a dash, it's correct (otherwise it'd be "ms-transform" instead of "-ms-transform" for IE9, for example) 8592 p = "-" + p; 8593 } 8594 s.removeProperty(p.replace(_capsExp, "-$1").toLowerCase()); 8595 } else { //note: old versions of IE use "removeAttribute()" instead of "removeProperty()" 8596 s.removeAttribute(p); 8597 } 8598 } 8599 }, 8600 _setClassNameRatio = function(v) { 8601 this.t._gsClassPT = this; 8602 if (v === 1 || v === 0) { 8603 this.t.setAttribute("class", (v === 0) ? this.b : this.e); 8604 var mpt = this.data, //first MiniPropTween 8605 s = this.t.style; 8606 while (mpt) { 8607 if (!mpt.v) { 8608 _removeProp(s, mpt.p); 8609 } else { 8610 s[mpt.p] = mpt.v; 8611 } 8612 mpt = mpt._next; 8613 } 8614 if (v === 1 && this.t._gsClassPT === this) { 8615 this.t._gsClassPT = null; 8616 } 8617 } else if (this.t.getAttribute("class") !== this.e) { 8618 this.t.setAttribute("class", this.e); 8619 } 8620 }; 8621 _registerComplexSpecialProp("className", {parser:function(t, e, p, cssp, pt, plugin, vars) { 8622 var b = t.getAttribute("class") || "", //don't use t.className because it doesn't work consistently on SVG elements; getAttribute("class") and setAttribute("class", value") is more reliable. 8623 cssText = t.style.cssText, 8624 difData, bs, cnpt, cnptLookup, mpt; 8625 pt = cssp._classNamePT = new CSSPropTween(t, p, 0, 0, pt, 2); 8626 pt.setRatio = _setClassNameRatio; 8627 pt.pr = -11; 8628 _hasPriority = true; 8629 pt.b = b; 8630 bs = _getAllStyles(t, _cs); 8631 //if there's a className tween already operating on the target, force it to its end so that the necessary inline styles are removed and the class name is applied before we determine the end state (we don't want inline styles interfer
8631ing that were there just for class-specific values) 8632 cnpt = t._gsClassPT; 8633 if (cnpt) { 8634 cnptLookup = {}; 8635 mpt = cnpt.data; //first MiniPropTween which stores the inline styles - we need to force these so that the inline styles don't contaminate things. Otherwise, there's a small chance that a tween could start and the inline values match the destination values and they never get cleaned. 8636 while (mpt) { 8637 cnptLookup[mpt.p] = 1; 8638 mpt = mpt._next; 8639 } 8640 cnpt.setRatio(1); 8641 } 8642 t._gsClassPT = pt; 8643 pt.e = (e.charAt(1) !== "=") ? e : b.replace(new RegExp("\\s*\\b" + e.substr(2) + "\\b"), "") + ((e.charAt(0) === "+") ? " " + e.substr(2) : ""); 8644 t.setAttribute("class", pt.e); 8645 difData = _cssDif(t, bs, _getAllStyles(t), vars, cnptLookup); 8646 t.setAttribute("class", b); 8647 pt.data = difData.firstMPT; 8648 t.style.cssText = cssText; //we recorded cssText before we swapped classes and ran _getAllStyles() because in cases when a className tween is overwritten, we remove all the related tweening properties from that class change (otherwise class-specific stuff can't override properties we've directly set on the target's style object due to specificity). 8649 pt = pt.xfirst = cssp.parse(t, difData.difs, pt, plugin); //we record the CSSPropTween as the xfirst so that we can handle overwriting propertly (if "className" gets overwritten, we must kill all the properties associated with the className part of the tween, so we can loop through from xfirst to the pt itself) 8650 return pt; 8651 }}); 8652 8653 8654 var _setClearPropsRatio = function(v) { 8655 if (v === 1 || v === 0) if (this.data._totalTime === this.data._totalDuration && this.data.data !== "isFromStart") { //this.data refers to the tween. Only clear at the END of the tween (remember, from() tweens make the ratio go from 1 to 0, so we can't just check that and if the tween is the zero-duration one that's created internally to render the starting values in a from() tween, ignore that because otherwise, for example, from(...{height:100, clearProps:"height", delay:1}) would wipe the height at the beginning of the tween and after 1 second, it'd kick back in). 8656 var s = this.t.style, 8657 transformParse = _specialProps.transform.parse, 8658 a, p, i, clearTransform, transform; 8659 if (this.e === "all") { 8660 s.cssText = ""; 8661 clearTransform = true; 8662 } else { 8663 a = this.e.split(" ").join("").split(","); 8664 i = a.length; 8665 while (--i > -1) { 8666 p = a[i]; 8667 if (_specialProps[p]) { 8668 if (_specialProps[p].parse === transformParse) { 8669 clearTransform = true; 8670 } else { 8671 p = (p === "transformOrigin") ? _transformOriginProp : _specialProps[p].p; //ensures that special properties use the proper browser-specific property name, like "scaleX" might be "-webkit-transform" or "boxShadow" might be "-moz-box-shadow" 8672 } 8673 } 8674 _removeProp(s, p); 8675 } 8676 } 8677 if (clearTransform) { 8678 _removeProp(s, _transformProp); 8679 transform = this.t._gsTransform; 8680 if (transform) { 8681 if (transform.svg) { 8682 this.t.removeAttribute("data-svg-origin"); 8683 } 8684 delete this.t._gsTransform; 8685 } 8686 } 8687 8688 } 8689 }; 8690 _registerComplexSpecialProp("clearProps", {parser:function(t, e, p, cssp, pt) { 8691 pt = new CSSPropTween(t, p, 0, 0, pt, 2); 8692 pt.setRatio = _setClearPropsRatio; 8693 pt.e = e; 8694 pt.pr = -10; 8695 pt.data = cssp._tween; 8696 _hasPriority = true; 8697 return pt; 8698 }}); 8699 8700 p = "bezier,throwProps,physicsProps,physics2D".split(","); 8701 i = p.length; 8702 while (i--) { 8703 _registerPluginProp(p[i]); 8704 } 8705 8706 8707 8708 8709 8710 8711 8712 8713 p = CSSPlugin.prototype; 8714 p._firstPT = p._lastParsedTransform = p._transform = null; 8715 8716 //gets called when the tween renders for the first time. This kicks everything off, recording start/end values, etc. 8717 p._onInitTween = function(target, vars, tween) { 8718 if (!target.nodeType) { //css is only for dom elements 8719 return false; 8720 } 8721 this._target = target; 8722 this._tween = tween; 8723 this._vars = vars; 8724 _autoRound = vars.autoRound; 8725 _hasPriority = false; 8726 _suffixMap = vars.suffixMap || CSSPlugin.suffixMap; 8727 _cs = _getComputedStyle(target, ""); 8728 _overwriteProps = this._overwriteProps; 8729 var style = target.style, 8730 v, pt, pt2, first, last, next, zIndex, tpt, threeD; 8731 if (_reqSafariFix) if (style.zIndex === "") {
8732 v = _getStyle(target, "zIndex", _cs); 8733 if (v === "auto" || v === "") { 8734 //corrects a bug in [non-Android] Safari that prevents it from repainting elements in their new positions if they don't have a zIndex set. We also can't just apply this inside _parseTransform() because anything that's moved in any way (like using "left" or "top" instead of transforms like "x" and "y") can be affected, so it is best to ensure that anything that's tweening has a z-index. Setting "WebkitPerspective" to a non-zero value worked too except that on iOS Safari things would flicker randomly. Plus zIndex is less memory-intensive. 8735 this._addLazySet(style, "zIndex", 0); 8736 } 8737 } 8738 8739 if (typeof(vars) === "string") { 8740 first = style.cssText; 8741 v = _getAllStyles(target, _cs); 8742 style.cssText = first + ";" + vars; 8743 v = _cssDif(target, v, _getAllStyles(target)).difs; 8744 if (!_supportsOpacity && _opacityValExp.test(vars)) { 8745 v.opacity = parseFloat( RegExp.$1 ); 8746 } 8747 vars = v; 8748 style.cssText = first; 8749 } 8750 8751 if (vars.className) { //className tweens will combine any differences they find in the css with the vars that are passed in, so {className:"myClass", scale:0.5, left:20} would work. 8752 this._firstPT = pt = _specialProps.className.parse(target, vars.className, "className", this, null, null, vars); 8753 } else { 8754 this._firstPT = pt = this.parse(target, vars, null); 8755 } 8756 8757 if (this._transformType) { 8758 threeD = (this._transformType === 3); 8759 if (!_transformProp) { 8760 style.zoom = 1; //helps correct an IE issue. 8761 } else if (_isSafari) { 8762 _reqSafariFix = true; 8763 //if zIndex isn't set, iOS Safari doesn't repaint things correctly sometimes (seemingly at random). 8764 if (style.zIndex === "") { 8765 zIndex = _getStyle(target, "zIndex", _cs); 8766 if (zIndex === "auto" || zIndex === "") { 8767 this._addLazySet(style, "zIndex", 0); 8768 } 8769 } 8770 //Setting WebkitBackfaceVisibility corrects 3 bugs: 8771 // 1) [non-Android] Safari skips rendering changes to "top" and "left" that are made on the same frame/render as a transform update. 8772 // 2) iOS Safari sometimes neglects to repaint elements in their new positions. Setting "WebkitPerspective" to a non-zero value worked too except that on iOS Safari things would flicker randomly. 8773 // 3) Safari sometimes displayed odd artifacts when tweening the transform (or WebkitTransform) property, like ghosts of the edges of the element remained. Definitely a browser bug. 8774 //Note: we allow the user to override the auto-setting by defining WebkitBackfaceVisibility in the vars of the tween. 8775 if (_isSafariLT6) { 8776 this._addLazySet(style, "WebkitBackfaceVisibility", this._vars.WebkitBackfaceVisibility || (threeD ? "visible" : "hidden")); 8777 } 8778 } 8779 pt2 = pt; 8780 while (pt2 && pt2._next) { 8781 pt2 = pt2._next; 8782 } 8783 tpt = new CSSPropTween(target, "transform", 0, 0, null, 2); 8784 this._linkCSSP(tpt, null, pt2); 8785 tpt.setRatio = _transformProp ? _setTransformRatio : _setIETransformRatio; 8786 tpt.data = this._transform || _getTransform(target, _cs, true); 8787 tpt.tween = tween; 8788 tpt.pr = -1; //ensures that the transforms get applied after the components are updated. 8789 _overwriteProps.pop(); //we don't want to force the overwrite of all "transform" tweens of the target - we only care about individual transform properties like scaleX, rotation, etc. The CSSPropTween constructor automatically adds the property to _overwriteProps which is why we need to pop() here. 8790 } 8791 8792 if (_hasPriority) { 8793 //reorders the linked list in order of pr (priority) 8794 while (pt) { 8795 next = pt._next; 8796 pt2 = first; 8797 while (pt2 && pt2.pr > pt.pr) { 8798 pt2 = pt2._next; 8799 } 8800 if ((pt._prev = pt2 ? pt2._prev : last)) { 8801 pt._prev._next = pt; 8802 } else { 8803 first = pt; 8804 } 8805 if ((pt._next = pt2)) { 8806 pt2._prev = pt; 8807 } else { 8808 last = pt; 8809 } 8810 pt = next; 8811 } 8812 this._firstPT = first; 8813 } 8814 return true; 8815 }; 8816 8817 8818 p.parse = function(target, vars, pt, plugin) { 8819 var style = target.style, 8820 p, sp, bn, en, bs, es, bsfx, esfx, isStr, rel; 8821 for (p in vars) { 8822 es = vars[p]; //ending value string 8823 sp = _specialProps[p]; //SpecialProp lookup. 8824 if (sp) { 8825 pt = sp.parse(target, es, p, this, pt, plugin, vars); 8826 8827 } else { 8828 bs = _getStyle(target, p, _cs) + ""; 8829 isStr = (typeof(es) === "string"); 8830 if (p === "color" || p === "fill" || p === "stroke" || p.indexOf("Color") !== -1 || (isStr && _rgbhslExp.test(es))) { //Opera uses background: to define color sometimes in addition to backgroundColor: 8831 if (!isStr) { 8832 es = _parseColor(es); 8833 es = ((es.length > 3) ? "rgba(" : "rgb(") + es.join(",") + ")"; 8834 } 8835 pt = _parseComplex(style, p, bs, es, true, "transparent", pt, 0, plugin); 8836 8837 } else if (isStr && (es.indexOf(" ") !== -1 || es.indexOf(",") !== -1)) { 8838 pt = _parseComplex(style, p, bs, es, true, null, pt, 0, plugin); 8839 8840 } else { 8841 bn = parseFloat(bs); 8842 bsfx = (bn || bn === 0) ? bs.substr((bn + "").length) : ""; //remember, bs could be non-numeric like "normal" for fontWeight, so we should default to a blank suffix in that case. 8843 8844 if (bs === "" || bs === "auto") { 8845 if (p === "width" || p === "height") { 8846 bn = _getDimension(target, p, _cs); 8847 bsfx = "px"; 8848 } else if (p === "left" || p === "top") {
8849 bn = _calculateOffset(target, p, _cs); 8850 bsfx = "px"; 8851 } else { 8852 bn = (p !== "opacity") ? 0 : 1; 8853 bsfx = ""; 8854 } 8855 } 8856 8857 rel = (isStr && es.charAt(1) === "="); 8858 if (rel) { 8859 en = parseInt(es.charAt(0) + "1", 10); 8860 es = es.substr(2); 8861 en *= parseFloat(es); 8862 esfx = es.replace(_suffixExp, ""); 8863 } else { 8864 en = parseFloat(es); 8865 esfx = isStr ? es.replace(_suffixExp, "") : ""; 8866 } 8867 8868 if (esfx === "") { 8869 esfx = (p in _suffixMap) ? _suffixMap[p] : bsfx; //populate the end suffix, prioritizing the map, then if none is found, use the beginning suffix. 8870 } 8871 8872 es = (en || en === 0) ? (rel ? en + bn : en) + esfx : vars[p]; //ensures that any += or -= prefixes are taken care of. Record the end value before normalizing the suffix because we always want to end the tween on exactly what they intended even if it doesn't match the beginning value's suffix. 8873 8874 //if the beginning/ending suffixes don't match, normalize them... 8875 if (bsfx !== esfx) if (esfx !== "") if (en || en === 0) if (bn) { //note: if the beginning value (bn) is 0, we don't need to convert units! 8876 bn = _convertToPixels(target, p, bn, bsfx); 8877 if (esfx === "%") { 8878 bn /= _convertToPixels(target, p, 100, "%") / 100; 8879 if (vars.strictUnits !== true) { //some browsers report only "px" values instead of allowing "%" with getComputedStyle(), so we assume that if we're tweening to a %, we should start there too unless strictUnits:true is defined. This approach is particularly useful for responsive designs that use from() tweens. 8880 bs = bn + "%"; 8881 } 8882 8883 } else if (esfx === "em" || esfx === "rem") { 8884 bn /= _convertToPixels(target, p, 1, esfx); 8885 8886 //otherwise convert to pixels. 8887 } else if (esfx !== "px") { 8888 en = _convertToPixels(target, p, en, esfx); 8889 esfx = "px"; //we don't use bsfx after this, so we don't need to set it to px too. 8890 } 8891 if (rel) if (en || en === 0) { 8892 es = (en + bn) + esfx; //the changes we made affect relative calculations, so adjust the end value here. 8893 } 8894 } 8895 8896 if (rel) { 8897 en += bn; 8898 } 8899 8900 if ((bn || bn === 0) && (en || en === 0)) { //faster than isNaN(). Also, previously we required en !== bn but that doesn't really gain much performance and it prevents _parseToProxy() from working properly if beginning and ending values match but need to get tweened by an external plugin anyway. For example, a bezier tween where the target starts at left:0 and has these points: [{left:50},{left:0}] wouldn't work properly because when parsing the last point, it'd match the first (current) one and a non-tweening CSSPropTween would be recorded when we actually need a normal tween (type:0) so that things get updated during the tween properly. 8901 pt = new CSSPropTween(style, p, bn, en - bn, pt, 0, p, (_autoRound !== false && (esfx === "px" || p === "zIndex")), 0, bs, es); 8902 pt.xs0 = esfx; 8903 //DEBUG: _log("tween "+p+" from "+pt.b+" ("+bn+esfx+") to "+pt.e+" with suffix: "+pt.xs0); 8904 } else if (style[p] === undefined || !es && (es + "" === "NaN" || es == null)) { 8905 _log("invalid " + p + " tween value: " + vars[p]); 8906 } else { 8907 pt = new CSSPropTween(style, p, en || bn || 0, 0, pt, -1, p, false, 0, bs, es); 8908 pt.xs0 = (es === "none" && (p === "display" || p.indexOf("Style") !== -1)) ? bs : es; //intermediate value should typically be set immediately (end value) except for "display" or things like borderTopStyle, borderBottomStyle, etc. which should use the beginning value during the tween. 8909 //DEBUG: _log("non-tweening value "+p+": "+pt.xs0); 8910 } 8911 } 8912 } 8913 if (plugin) if (pt && !pt.plugin) { 8914 pt.plugin = plugin; 8915 } 8916 } 8917 return pt; 8918 }; 8919 8920 8921 //gets called every time the tween updates, passing the new ratio (typically a value between 0 and 1, but not always (for example, if an Elastic.easeOut is used, the value can jump above 1 mid-tween). It will always start and 0 and end at 1. 8922 p.setRatio = function(v) { 8923 var pt = this._firstPT, 8924 min = 0.000001, 8925 val, str, i; 8926 //at the end of the tween, we set the values to exactly what we received in order to make sure non-tweening values (like "position" or "float" or whatever) are set and so that if the beginning/ending suffixes (units) didn't match and we normalized to px, the value that the user passed in is used here. We check to see if the tween is at its beginning in case it's a from() tween in which case the ratio will actually go from 1 to 0 over the course of the tween (backwards). 8927 if (v === 1 && (this._tween._time === this._tween._duration || this._tween._time === 0)) { 8928 while (pt) { 8929 if (pt.type !== 2) { 8930 if (pt.r && pt.type !== -1) { 8931 val = Math.round(pt.s + pt.c); 8932 if (!pt.type) { 8933 pt.t[pt.p] = val + pt.xs0; 8934 } else if (pt.type === 1) { //complex value (one that typically has multiple numbers inside a string, like "rect(5px,10px,20px,25px)" 8935 i = pt.l; 8936 str = pt.xs0 + val + pt.xs1; 8937 for (i = 1; i < pt.l; i++) {
8938 str += pt["xn"+i] + pt["xs"+(i+1)]; 8939 } 8940 pt.t[pt.p] = str; 8941 } 8942 } else { 8943 pt.t[pt.p] = pt.e; 8944 } 8945 } else { 8946 pt.setRatio(v); 8947 } 8948 pt = pt._next; 8949 } 8950 8951 } else if (v || !(this._tween._time === this._tween._duration || this._tween._time === 0) || this._tween._rawPrevTime === -0.000001) { 8952 while (pt) { 8953 val = pt.c * v + pt.s; 8954 if (pt.r) { 8955 val = Math.round(val); 8956 } else if (val < min) if (val > -min) { 8957 val = 0; 8958 } 8959 if (!pt.type) { 8960 pt.t[pt.p] = val + pt.xs0; 8961 } else if (pt.type === 1) { //complex value (one that typically has multiple numbers inside a string, like "rect(5px,10px,20px,25px)" 8962 i = pt.l; 8963 if (i === 2) { 8964 pt.t[pt.p] = pt.xs0 + val + pt.xs1 + pt.xn1 + pt.xs2; 8965 } else if (i === 3) { 8966 pt.t[pt.p] = pt.xs0 + val + pt.xs1 + pt.xn1 + pt.xs2 + pt.xn2 + pt.xs3; 8967 } else if (i === 4) { 8968 pt.t[pt.p] = pt.xs0 + val + pt.xs1 + pt.xn1 + pt.xs2 + pt.xn2 + pt.xs3 + pt.xn3 + pt.xs4; 8969 } else if (i === 5) { 8970 pt.t[pt.p] = pt.xs0 + val + pt.xs1 + pt.xn1 + pt.xs2 + pt.xn2 + pt.xs3 + pt.xn3 + pt.xs4 + pt.xn4 + pt.xs5; 8971 } else { 8972 str = pt.xs0 + val + pt.xs1; 8973 for (i = 1; i < pt.l; i++) { 8974 str += pt["xn"+i] + pt["xs"+(i+1)]; 8975 } 8976 pt.t[pt.p] = str; 8977 } 8978 8979 } else if (pt.type === -1) { //non-tweening value 8980 pt.t[pt.p] = pt.xs0; 8981 8982 } else if (pt.setRatio) { //custom setRatio() for things like SpecialProps, external plugins, etc. 8983 pt.setRatio(v); 8984 } 8985 pt = pt._next; 8986 } 8987 8988 //if the tween is reversed all the way back to the beginning, we need to restore the original values which may have different units (like % instead of px or em or whatever). 8989 } else { 8990 while (pt) { 8991 if (pt.type !== 2) { 8992 pt.t[pt.p] = pt.b; 8993 } else { 8994 pt.setRatio(v); 8995 } 8996 pt = pt._next; 8997 } 8998 } 8999 }; 9000 9001 /** 9002 * @private 9003 * Forces rendering of the target's transforms (rotation, scale, etc.) whenever the CSSPlugin's setRatio() is called. 9004 * Basically, this tells the CSSPlugin to create a CSSPropTween (type 2) after instantiation that runs last in the linked 9005 * list and calls the appropriate (3D or 2D) rendering function. We separate this into its own method so that we can call 9006 * it from other plugins like BezierPlugin if, for example, it needs to apply an autoRotation and this CSSPlugin 9007 * doesn't have any transform-related properties of its own. You can call this method as many times as you 9008 * want and it won't create duplicate CSSPropTweens. 9009 * 9010 * @param {boolean} threeD if true, it should apply 3D tweens (otherwise, just 2D ones are fine and typically faster) 9011 */ 9012 p._enableTransforms = function(threeD) { 9013 this._transform = this._transform || _getTransform(this._target, _cs, true); //ensures that the element has a _gsTransform property with the appropriate values. 9014 this._transformType = (!(this._transform.svg && _useSVGTransformAttr) && (threeD || this._transformType === 3)) ? 3 : 2; 9015 }; 9016 9017 var lazySet = function(v) { 9018 this.t[this.p] = this.e; 9019 this.data._linkCSSP(this, this._next, null, true); //we purposefully keep this._next even though it'd make sense to null it, but this is a performance optimization, as this happens during the while (pt) {} loop in setRatio() at the bottom of which it sets pt = pt._next, so if we null it, the linked list will be broken in that loop. 9020 }; 9021 /** @private Gives us a way to set a value on the first render (and only the first render). **/ 9022 p._addLazySet = function(t, p, v) { 9023 var pt = this._firstPT = new CSSPropTween(t, p, 0, 0, this._firstPT, 2); 9024 pt.e = v; 9025 pt.setRatio = lazySet; 9026 pt.data = this; 9027 }; 9028 9029 /** @private **/ 9030 p._linkCSSP = function(pt, next, prev, remove) { 9031 if (pt) { 9032 if (next) { 9033 next._prev = pt; 9034 } 9035 if (pt._next) { 9036 pt._next._prev = pt._prev; 9037 } 9038 if (pt._prev) { 9039 pt._prev._next = pt._next; 9040 } else if (this._firstPT === pt) { 9041 this._firstPT = pt._next; 9042 remove = true; //just to prevent resetting this._firstPT 5 lines down in case pt._next is null. (optimized for speed) 9043 } 9044 if (prev) { 9045 prev._next = pt; 9046 } else if (!remove && this._firstPT === null) { 9047 this._firstPT = pt; 9048 } 9049 pt._next = next; 9050 pt._prev = prev; 9051 } 9052 return pt; 9053 }; 9054 9055 //we need to make sure that if alpha or autoAlpha is killed, opacity is too. And autoAlpha affects the "visibility" property. 9056 p._kill = function(lookup) { 9057 var copy = lookup, 9058 pt, p, xfirst; 9059 if (lookup.autoAlpha || lookup.alpha) { 9060 copy = {}; 9061 for (p in lookup) { //copy the lookup so that we're not changing the original which may be passed elsewhere. 9062 copy[p] = lookup[p]; 9063 } 9064 copy.opacity = 1; 9065 if (copy.autoAlpha) { 9066 copy.visibility = 1; 9067 } 9068 } 9069 if (lookup.className && (pt = this._classNamePT)) { //for className tweens, we need to kill any associated CSSPropTweens too; a linked list starts at the className's "xfirst". 9070 xfirst = pt.xfirst; 9071 if (xfirst && xfirst._prev) { 9072 this._linkCSSP(xfirst._prev, pt._next, xfirst._prev._prev); //break off the prev 9073 } else if (xfirst === this._firstPT) { 9074 this._firstPT = pt._next; 9075 } 9076 if (pt._next) { 9077 this._linkCSSP(pt._next, pt._next._next, xfirst._prev); 9078 } 9079 this._classNamePT = null; 9080 } 9081 return TweenPlugin.prototype._kill.call(this, copy); 9082 }; 9083 9084 9085 9086 //used by cascadeTo() for gathering all the style properties of each child element into an array for c
9086omparison. 9087 var _getChildStyles = function(e, props, targets) { 9088 var children, i, child, type; 9089 if (e.slice) { 9090 i = e.length; 9091 while (--i > -1) { 9092 _getChildStyles(e[i], props, targets); 9093 } 9094 return; 9095 } 9096 children = e.childNodes; 9097 i = children.length; 9098 while (--i > -1) { 9099 child = children[i]; 9100 type = child.type; 9101 if (child.style) { 9102 props.push(_getAllStyles(child)); 9103 if (targets) { 9104 targets.push(child); 9105 } 9106 } 9107 if ((type === 1 || type === 9 || type === 11) && child.childNodes.length) { 9108 _getChildStyles(child, props, targets); 9109 } 9110 } 9111 }; 9112 9113 /** 9114 * Typically only useful for className tweens that may affect child elements, this method creates a TweenLite 9115 * and then compares the style properties of all the target's child elements at the tween's start and end, and 9116 * if any are different, it also creates tweens for those and returns an array containing ALL of the resulting 9117 * tweens (so that you can easily add() them to a TimelineLite, for example). The reason this functionality is 9118 * wrapped into a separate static method of CSSPlugin instead of being integrated into all regular className tweens 9119 * is because it creates entirely new tweens that may have completely different targets than the original tween, 9120 * so if they were all lumped into the original tween instance, it would be inconsistent with the rest of the API 9121 * and it would create other problems. For example: 9122 * - If I create a tween of elementA, that tween instance may suddenly change its target to include 50 other elements (unintuitive if I specifically defined the target I wanted) 9123 * - We can't just create new independent tweens because otherwise, what happens if the original/parent tween is reversed or pause or dropped into a TimelineLite for tight control? You'd expect that tween's behavior to affect all the others. 9124 * - Analyzing every style property of every child before and after the tween is an expensive operation when there are many children, so this behavior shouldn't be imposed on all className tweens by default, especially since it's probably rare that this extra functionality is needed. 9125 * 9126 * @param {Object} target object to be tweened 9127 * @param {number} Duration in seconds (or frames for frames-based tweens) 9128 * @param {Object} Object containing the end values, like {className:"newClass", ease:Linear.easeNone} 9129 * @return {Array} An array of TweenLite instances 9130 */ 9131 CSSPlugin.cascadeTo = function(target, duration, vars) { 9132 var tween = TweenLite.to(target, duration, vars), 9133 results = [tween], 9134 b = [], 9135 e = [], 9136 targets = [], 9137 _reservedProps = TweenLite._internals.reservedProps, 9138 i, difs, p, from; 9139 target = tween._targets || tween.target; 9140 _getChildStyles(target, b, targets); 9141 tween.render(duration, true, true); 9142 _getChildStyles(target, e); 9143 tween.render(0, true, true); 9144 tween._enabled(true); 9145 i = targets.length; 9146 while (--i > -1) { 9147 difs = _cssDif(targets[i], b[i], e[i]); 9148 if (difs.firstMPT) { 9149 difs = difs.difs;
9150 for (p in vars) { 9151 if (_reservedProps[p]) { 9152 difs[p] = vars[p]; 9153 } 9154 } 9155 from = {}; 9156 for (p in difs) { 9157 from[p] = b[i][p]; 9158 } 9159 results.push(TweenLite.fromTo(targets[i], duration, from, difs)); 9160 } 9161 } 9162 return results; 9163 }; 9164 9165 TweenPlugin.activate([CSSPlugin]); 9166 return CSSPlugin; 9167 9168 }, true); 9169 9170}); if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } 9171 9172//export to AMD/RequireJS and CommonJS/Node (precursor to full modular build system coming at a later date) 9173(function(name) { 9174 "use strict"; 9175 var getGlobal = function() { 9176 return (_gsScope.GreenSockGlobals || _gsScope)[name]; 9177 }; 9178 if (typeof(define) === "function" && define.amd) { //AMD 9179 define(["TweenLite"], getGlobal); 9180 } else if (typeof(module) !== "undefined" && module.exports) { //node 9181 require("../TweenLite.js"); 9182 module.exports = getGlobal(); 9183 } 9184}("CSSPlugin")); 9185 9186 9187 9188/*! 9189 * VERSION: beta 0.3.4 9190 * DATE: 2015-08-15 9191 * UPDATES AND DOCS AT: http://greensock.com 9192 * 9193 * @license Copyright (c) 2008-2015, GreenSock. All rights reserved. 9194 * SplitText is a Club GreenSock membership benefit; You must have a valid membership to use 9195 * this code without violating the terms of use. Visit http://www.greensock.com/club/ to sign up or get more details. 9196 * This work is subject to the software agreement that was issued with your membership. 9197 * 9198 * @author: Jack Doyle, [email protected] 9199 */ 9200var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(global) !== "undefined") ? global : this || window; //helps ensure compatibility with AMD/RequireJS and CommonJS/Node 9201(function(window) { 9202 9203 "use strict"; 9204 var _globals = window.GreenSockGlobals || window, 9205 _namespace = function(ns) { 9206 var a = ns.split("."), 9207 p = _globals, i; 9208 for (i = 0; i < a.length; i++) { 9209 p[a[i]] = p = p[a[i]] || {}; 9210 } 9211 return p; 9212 }, 9213 pkg = _namespace("com.greensock.utils"), 9214 _getText = function(e) { 9215 var type = e.nodeType, 9216 result = ""; 9217 if (type === 1 || type === 9 || type === 11) { 9218 if (typeof(e.textContent) === "string") { 9219 return e.textContent; 9220 } else { 9221 for ( e = e.firstChild; e; e = e.nextSibling ) { 9222 result += _getText(e); 9223 } 9224 } 9225 } else if (type === 3 || type === 4) { 9226 return e.nodeValue; 9227 } 9228 return result; 9229 }, 9230 _doc = document, 9231 _getComputedStyle = _doc.defaultView ? _doc.defaultView.getComputedStyle : function() {}, 9232 _capsExp = /([A-Z])/g, 9233 _getStyle = function(t, p, cs, str) { 9234 var result; 9235 if ((cs = cs || _getComputedStyle(t, null))) { 9236 t = cs.getPropertyValue(p.replace(_capsExp, "-$1").toLowerCase()); 9237 result = (t || cs.length) ? t : cs[p]; //Opera behaves VERY strangely - length is usually 0 and cs[p] is the only way to get accurate results EXCEPT when checking for -o-transform which only works with cs.getPropertyValue()! 9238 } else if (t.currentStyle) { 9239 cs = t.currentStyle; 9240 result = cs[p]; 9241 } 9242 return str ? result : parseInt(result, 10) || 0; 9243 }, 9244 _isArrayLike = function(e) { 9245 return (e.length && e[0] && ((e[0].nodeType && e[0].style && !e.nodeType) || (e[0].length && e[0][0]))) ? true : false; //could be an array of jQuery objects too, so accommodate that. 9246 }, 9247 _flattenArray = function(a) { 9248 var result = [], 9249 l = a.length, 9250 i, e, j; 9251 for (i = 0; i < l; i++) { 9252 e = a[i]; 9253 if (_isArrayLike(e)) { 9254 j = e.length; 9255 for (j = 0; j < e.length; j++) { 9256 result.push(e[j]); 9257 } 9258 } else { 9259 result.push(e); 9260 } 9261 } 9262 return result; 9263 }, 9264 _brSwap = ")eefec303079ad17405c", 9265 _brExp = /(?:<br>|<br\/>|<br \/>)/gi, 9266 _isOldIE = (_doc.all && !_doc.addEventListener), 9267 _divStart = "<div style='position:relative;display:inline-block;" + (_isOldIE ? "*display:inline;*zoom:1;'" : "'"), //note: we must use both display:inline-block and *display:inline for IE8 and earlier, otherwise it won't flow correctly (and if we only use display:inline, IE won't render most of the property tweens - very odd). 9268 _cssClassFunc = function(cssClass) { 9269 cssClass = cssClass || ""; 9270 var iterate = (cssClass.indexOf("++") !== -1), 9271 num = 1; 9272 if (iterate) { 9273 cssClass = cssClass.split("++").join(""); 9274 } 9275 return function() { 9276 return _divStart + (cssClass ? " class='" + cssClass + (iterate ? num++ : "") + "'>" : ">"); 9277 }; 9278 }, 9279 SplitText = pkg.SplitText = _globals.SplitText = function(element, vars) { 9280 if (typeof(element) === "string") { 9281 element = SplitText.selector(element); 9282 } 9283 if (!element) { 9284 throw("cannot split a null element."); 9285 } 9286 this.elements = _isArrayLike(element) ? _flattenArray(element) : [element]; 9287 this.chars = []; 9288 this.words = []; 9289 this.lines = []; 9290 this._originals = []; 9291 this.vars = vars || {}; 9292 this.split(vars); 9293 }, 9294 _swapText = function(element, oldText, newText) { 9295 var type = element.nodeType; 9296 if (type === 1 || type === 9 || type === 11) { 9297 for ( element = element.firstChild; element; element = element.nextSibling ) { 9298 _swapText(element, oldText, newText); 9299 } 9300 } else if (type === 3 || type === 4) { 9301 element.nodeValue = element.nodeValue.split(oldText).join(newText); 9302 } 9303 }, 9304 _pushReversed = function(a, merge) { 9305 var i = merge.length; 9306 while (--i > -1) { 9307 a.push(merge[i]); 9308 } 9309 }, 9310 _split = function(element, vars, allChars, allWords, allLines) { 9311 if (_brExp.test(element.innerHTML)) { 9312 element.innerHTML = element.innerHTML.replace(_brExp, _brSwap); //swap in a unique string for <br/> tags so that we can identify it when we loop through later, and replace it appropriately 9313 } 9314 var text = _getText(element), 9315 types = vars.type || vars.split || "chars,words,lines", 9316 lines = (types.indexOf("lines") !== -1) ? [] : null, 9317 words = (types.indexOf("words") !== -1), 9318 chars = (types.indexOf("chars") !== -1), 9319 absolute = (vars.position === "absolute" || vars.absolute === true), 9320 space = absolute ? "­ " : " ", 9321 lineOffsetY = -999, 9322 cs = _getComputedStyle(element), 9323 paddingLeft = _getStyle(element, "paddingLeft", cs), 9324 borderTopAndBottom = _getStyle(element, "borderBottomWidth", cs) + _get
9324Style(element, "borderTopWidth", cs), 9325 borderLeftAndRight = _getStyle(element, "borderLeftWidth", cs) + _getStyle(element, "borderRightWidth", cs), 9326 padTopAndBottom = _getStyle(element, "paddingTop", cs) + _getStyle(element, "paddingBottom", cs), 9327 padLeftAndRight = _getStyle(element, "paddingLeft", cs) + _getStyle(element, "paddingRight", cs), 9328 textAlign = _getStyle(element, "textAlign", cs, true), 9329 origHeight = element.clientHeight, 9330 origWidth = element.clientWidth, 9331 wordEnd = "</div>", 9332 wordStart = _cssClassFunc(vars.wordsClass), 9333 charStart = _cssClassFunc(vars.charsClass), 9334 iterateLine = ((vars.linesClass || "").indexOf("++") !== -1), 9335 linesClass = vars.linesClass, 9336 hasTagStart = text.indexOf("<") !== -1, 9337 wordIsOpen = true, 9338 charArray = [], 9339 wordArray = [], 9340 lineArray = [], 9341 l, curLine, isChild, splitText, i, j, character, nodes, node, offset, lineNode, style, lineWidth, addWordSpaces; 9342 9343 if (iterateLine) { 9344 linesClass = linesClass.split("++").join(""); 9345 } 9346 if (hasTagStart) { 9347 text = text.split("<").join("{{LT}}"); //we can't leave "<" in the string, or when we set the innerHTML, it can be interpreted as 9348 } 9349 l = text.length; 9350 9351 splitText = wordStart(); 9352 for (i = 0; i < l; i++) { 9353 character = text.charAt(i); 9354 if (character === ")" && text.substr(i, 20) === _brSwap) { 9355 splitText += (wordIsOpen ? wordEnd : "") + "<BR/>"; 9356 wordIsOpen = false; 9357 if (i !== l - 20 && text.substr(i+20, 20) !== _brSwap) { 9358 splitText += " " + wordStart(); 9359 wordIsOpen = true; 9360 } 9361 i += 19; 9362 9363 } else if (character === " " && text.charAt(i-1) !== " " && i !== l-1 && text.substr(i-20, 20) !== _brSwap) { 9364 splitText += wordIsOpen ? wordEnd : ""; 9365 wordIsOpen = false; 9366 while (text.charAt(i + 1) === " ") { //skip over empty spaces (to avoid making them words) 9367 splitText += space; 9368 i++; 9369 } 9370 if (text.charAt(i + 1) !== ")" || text.substr(i + 1, 20) !== _brSwap) { 9371 splitText += space + wordStart(); 9372 wordIsOpen = true; 9373 } 9374 9375 } else if (character === "{" && text.substr(i, 6) === "{{LT}}") { 9376 splitText += chars ? charStart() + "{{LT}}" + "</div>" : "{{LT}}"; 9377 i += 5; 9378 } else { 9379 splitText += (chars && character !== " ") ? charStart() + character + "</div>" : character; 9380 } 9381 } 9382 element.innerHTML = splitText + (wordIsOpen ? wordEnd : ""); 9383 9384 if (hasTagStart) { 9385 _swapText(element, "{{LT}}", "<"); 9386 } 9387 //copy all the descendant nodes into an array (we can't use a regular nodeList because it's live and we may need to renest things) 9388 j = element.getElementsByTagName("*"); 9389 l = j.length; 9390 nodes = []; 9391 for (i = 0; i < l; i++) { 9392 nodes[i] = j[i]; 9393 } 9394 9395 //for absolute positioning, we need to record the x/y offsets and width/height for every <div>. And even if we're not positioning things absolutely, in order to accommodate lines, we must figure out where the y offset changes so that we can sense where the lines break, and we populate the lines array. 9396 if (lines || absolute) { 9397 for (i = 0; i < l; i++) { 9398 node = nodes[i]; 9399 isChild = (node.parentNode === element); 9400 if (isChild || absolute || (chars && !words)) { 9401 offset = node.offsetTop; 9402 if (lines && isChild && offset !== lineOffsetY && node.nodeName !== "BR") { 9403 curLine = []; 9404 lines.push(curLine); 9405 lineOffsetY = offset; 9406 } 9407 if (absolute) { //record offset x and y, as well as width and height so that we can access them later for positioning. Grabbing them at once ensures we don't trigger a browser paint & we maximize performance. 9408 node._x = node.offsetLeft; 9409 node._y = offset; 9410 node._w = node.offsetWidth; 9411 node._h = node.offsetHeight; 9412 } 9413 if (lines) { 9414 if (words === isChild || !chars) { 9415 curLine.push(node); 9416 node._x -= paddingLeft; 9417 } 9418 if (isChild && i) { 9419 nodes[i-1]._wordEnd = true; 9420 } 9421 if (node.nodeName === "BR" && node.nextSibling && node.nextSibling.nodeName === "BR") { //two consecutive <br> tags signify a new [empty] line. 9422 lines.push([]); 9423 } 9424 } 9425 } 9426 } 9427 } 9428 9429 for (i = 0; i < l; i++) { 9430 node = nodes[i];
9431 isChild = (node.parentNode === element); 9432 if (node.nodeName === "BR") { 9433 if (lines || absolute) { 9434 element.removeChild(node); 9435 nodes.splice(i--, 1); 9436 l--; 9437 } else if (!words) { 9438 element.appendChild(node); 9439 } 9440 continue; 9441 } 9442 9443 if (absolute) { 9444 style = node.style; 9445 if (!words && !isChild) { 9446 node._x += node.parentNode._x; 9447 node._y += node.parentNode._y; 9448 } 9449 style.left = node._x + "px"; 9450 style.top = node._y + "px"; 9451 style.position = "absolute"; 9452 style.display = "block"; 9453 //if we don't set the width/height, things collapse in older versions of IE and the origin for transforms is thrown off in all browsers. 9454 style.width = (node._w + 1) + "px"; //IE is 1px short sometimes. Avoid wrapping 9455 style.height = node._h + "px"; 9456 } 9457 9458 if (!words) { 9459 //we always start out wrapping words in their own <div> so that line breaks happen correctly, but here we'll remove those <div> tags if necessary and renest the characters directly into the element rather than inside the word <div> 9460 if (isChild) { 9461 element.removeChild(node); 9462 nodes.splice(i--, 1); 9463 l--; 9464 } else if (!isChild && chars) { 9465 offset = (!lines && !absolute && node.nextSibling); //if this is the last letter in the word (and we're not breaking by lines and not positioning things absolutely), we need to add a space afterwards so that the characters don't just mash together 9466 element.appendChild(node); 9467 if (!offset) { 9468 element.appendChild(_doc.createTextNode(" ")); 9469 } 9470 charArray.push(node); //TODO: push() 9471 } 9472 } else if (isChild && node.innerHTML !== "") { 9473 wordArray.push(node); //TODO: push() 9474 } else if (chars) { 9475 charArray.push(node); //TODO: push() 9476 } 9477 } 9478 9479 if (lines) { 9480 //the next 7 lines just give us the line width in the most reliable way and figure out the left offset (if position isn't relative or absolute). We must set the width along with text-align to ensure everything works properly for various alignments. 9481 if (absolute) { 9482 lineNode = _doc.createElement("div"); 9483 element.appendChild(lineNode); 9484 lineWidth = lineNode.offsetWidth + "px"; 9485 offset = (lineNode.offsetParent === element) ? 0 : element.offsetLeft; 9486 element.removeChild(lineNode); 9487 } 9488 style = element.style.cssText; 9489 element.style.cssText = "display:none;"; //to improve performance, set display:none on the element so that the browser doesn't have to worry about reflowing or rendering while we're renesting things. We'll revert the cssText later. 9490 //we can't use element.innerHTML = "" because that causes IE to literally delete all the nodes and their content even though we've stored them in an array! So we must loop through the children and remove them. 9491 while (element.firstChild) { 9492 element.removeChild(element.firstChild); 9493 } 9494 addWordSpaces = (!absolute || (!words && !chars)); 9495 for (i = 0; i < lines.length; i++) { 9496 curLine = lines[i]; 9497 lineNode = _doc.createElement("div"); 9498 lineNode.style.cssText = "display:block;text-align:" + textAlign + ";position:" + (absolute ? "absolute;" : "relative;"); 9499 if (linesClass) { 9500 lineNode.className = linesClass + (iterateLine ? i+1 : ""); 9501 } 9502 lineArray.push(lineNode); //TODO: push() 9503 l = curLine.length; 9504 for (j = 0; j < l; j++) { 9505 if (curLine[j].nodeName !== "BR") { 9506 node = curLine[j]; 9507 lineNode.appendChild(node); 9508 if (addWordSpaces && (node._wordEnd || words)) { 9509 lineNode.appendChild(_doc.createTextNode(" ")); 9510 } 9511 if (absolute) { 9512 if (j === 0) { 9513 lineNode.style.top = node._y + "px"; 9514 lineNode.style.left = (paddingLeft + offset) + "px"; 9515 } 9516 node.style.top = "0px"; 9517 if (offset) { 9518 node.style.left = (node._x - offset) + "px"; 9519 } 9520 } 9521 } 9522 } 9523 if (l === 0) { //if there are no nodes in the line (typically meaning there were tw
9523o consecutive <br> tags, just add a non-breaking space so that things display properly. 9524 lineNode.innerHTML = " "; 9525 } 9526 if (!words && !chars) { 9527 lineNode.innerHTML = _getText(lineNode).split(String.fromCharCode(160)).join(" "); 9528 } 9529 if (absolute) { 9530 lineNode.style.width = lineWidth; 9531 lineNode.style.height = node._h + "px"; 9532 } 9533 element.appendChild(lineNode); 9534 } 9535 element.style.cssText = style; 9536 } 9537 9538 //if everything shifts to being position:absolute, the container can collapse in terms of height or width, so fix that here. 9539 if (absolute) { 9540 if (origHeight > element.clientHeight) { 9541 element.style.height = (origHeight - padTopAndBottom) + "px"; 9542 if (element.clientHeight < origHeight) { //IE8 and earlier use a different box model - we must include padding and borders 9543 element.style.height = (origHeight + borderTopAndBottom)+ "px"; 9544 } 9545 } 9546 if (origWidth > element.clientWidth) { 9547 element.style.width = (origWidth - padLeftAndRight) + "px"; 9548 if (element.clientWidth < origWidth) { //IE8 and earlier use a different box model - we must include padding and borders 9549 element.style.width = (origWidth + borderLeftAndRight)+ "px"; 9550 } 9551 } 9552 } 9553 _pushReversed(allChars, charArray); 9554 _pushReversed(allWords, wordArray); 9555 _pushReversed(allLines, lineArray); 9556 }, 9557 p = SplitText.prototype; 9558 9559 p.split = function(vars) { 9560 if (this.isSplit) { 9561 this.revert(); 9562 } 9563 this.vars = vars || this.vars; 9564 this._originals.length = this.chars.length = this.words.length = this.lines.length = 0; 9565 var i = this.elements.length; 9566 //we split in reversed order so that if/when we position:absolute elements, they don't affect the position of the ones after them in the document flow (shifting them up as they're taken out of the document flow). 9567 while (--i > -1) { 9568 this._originals[i] = this.elements[i].innerHTML; 9569 _split(this.elements[i], this.vars, this.chars, this.words, this.lines); 9570 } 9571 this.chars.reverse(); 9572 this.words.reverse(); 9573 this.lines.reverse(); 9574 this.isSplit = true; 9575 return this; 9576 }; 9577 9578 p.revert = function() { 9579 if (!this._originals) { 9580 throw("revert() call wasn't scoped properly."); 9581 } 9582 var i = this._originals.length; 9583 while (--i > -1) { 9584 this.elements[i].innerHTML = this._originals[i]; 9585 } 9586 this.chars = []; 9587 this.words = []; 9588 this.lines = []; 9589 this.isSplit = false; 9590 return this; 9591 }; 9592 9593 SplitText.selector = window.$ || window.jQuery || function(e) { 9594 var selector = window.$ || window.jQuery; 9595 if (selector) { 9596 SplitText.selector = selector; 9597 return selector(e); 9598 } 9599 return (typeof(document) === "undefined") ? e : (document.querySelectorAll ? document.querySelectorAll(e) : document.getElementById((e.charAt(0) === "#") ? e.substr(1) : e)); 9600 }; 9601 SplitText.version = "0.3.4"; 9602 9603})(_gsScope); 9604 9605//export to AMD/RequireJS and CommonJS/Node (precursor to full modular build system coming at a later date) 9606(function(name) { 9607 "use strict"; 9608 var getGlobal = function() { 9609 return (_gsScope.GreenSockGlobals || _gsScope)[name]; 9610 }; 9611 if (typeof(define) === "function" && define.amd) { //AMD 9612 define(["TweenLite"], getGlobal); 9613 } else if (typeof(module) !== "undefined" && module.exports) { //node 9614 module.exports = getGlobal(); 9615 } 9616}("SplitText")); 9617 9618 9619// Sandboxing Greensock 9620try{ 9621 window.GreenSockGlobals = null; 9622 window._gsQueue = null; 9623 window._gsDefine = null; 9624 9625 delete(window.GreenSockGlobals); 9626 delete(window._gsQueue); 9627 delete(window._gsDefine); 9628 } catch(e) {} 9629 9630try{ 9631 window.GreenSockGlobals = oldgs; 9632 window._gsQueue = oldgs_queue; 9633 } catch(e) {} 9634 9635if (window.tplogs==true) 9636 try { 9637 console.groupEnd(); 9638 } catch(e) {} 9639 9640 9641;(function (factory) { 9642 if (typeof define === 'function' && define.amd) { 9643 // AMD. Register as an anonymous module. 9644 define(['jquery'], factory); 9645 } else if (typeof exports === 'object') { 9646 // CommonJS / nodejs module 9647 module.exports = factory(require('jquery')); 9648 } else { 9649 // Browser globals 9650 factory(jQuery); 9651 } 9652}(function ($) { 9653 // Namespace all events. 9654 var eventNamespace = 'waitForImages'; 9655 9656 // CSS properties which contain references to images. 9657 $.waitForImages = { 9658 hasImageProperties: [ 9659 'backgroundImage', 9660 'listStyleImage', 9661 'borderImage', 9662 'borderCornerImage', 9663 'cursor' 9664 ], 9665 hasImageAttributes: ['srcset'] 9666 }; 9667 9668 // Custom selector to find all `img` elements with a valid `src` attribute. 9669 $.expr[':']['has-src'] = function (obj) { 9670 // Ensure we are dealing with an `img` element with a valid 9671 // `src` attribute. 9672 return $(obj).is('img[src][src!=""]'); 9673 }; 9674 9675 // Custom selector to find images which are not already cached by the 9676 // browser. 9677 $.expr[':'].uncached = function (obj) { 9678 // Ensure we are dealing with an `img` element with a valid 9679 // `src` attribute. 9680 if (!$(obj).is(':has-src')) { 9681 return false; 9682 } 9683 9684 return !obj.complete; 9685 }; 9686 9687 $.fn.waitForImages = function () { 9688 9689 var allImgsLength = 0; 9690 var allImgsLoaded = 0; 9691 var deferred = $.Deferred(); 9692 9693 var finishedCallback; 9694 var eachCallback; 9695 var waitForAll; 9696 9697 // Handle options object (if passed). 9698 if ($.isPlainObject(arguments[0])) { 9699 9700 waitForAll = arguments[0].waitForAll; 9701 eachCallback = arguments[0].each; 9702 finishedCallback = arguments[0].finished; 9703 9704 } else { 9705 9706 // Handle if using deferred object and only one param was passed in. 9707 if (arguments.length === 1 && $.type(arguments[0]) === 'boolean') { 9708 waitForAll = arguments[0]; 9709 } else { 9710 finishedCallback = arguments[0]; 9711 eachCallback = arguments[1]; 9712 waitForAll = arguments[2]; 9713 } 9714 9715 } 9716 9717 // Handle missing callbacks. 9718 finishedCallback = finishedCallback || $.noop; 9719 eachCallback = eachCallback || $.noop; 9720 9721 // Convert waitForAll to Boolean 9722 waitForAll = !! waitForAll; 9723 9724 // Ensure callbacks are functions. 9725 if (!$.isFunction(finishedCallback) || !$.isFunction(eachCallback)) { 9726 throw new TypeError('An invalid callback was supplied.'); 9727 } 9728 9729 this.each(function () { 9730 // Build a list of all imgs, dependent on what images will 9731 // be considered. 9732 var obj = $(this); 9733 var allImgs = []; 9734 // CSS properties which may contain an image. 9735 var hasImgProperties = $.waitForImages.hasImageProperties || []; 9736 // Element attributes which may contain an image. 9737 var hasImageAttributes = $.waitForImages.hasImageAttributes || []; 9738 // To match `url()` references. 9739 // Spec: http://www.w3.org/TR/CSS2/syndata.html#value-def-uri 9740 var matchUrl = /url\(\s*(['"]?)(.*?)\1\s*\)/g; 9741 9742 if (waitForAll) { 9743 9744 // Get all elements (including the original), as any one of 9745 // them could have a background image. 9746 obj.find('*').addBack().each(function () { 9747 var element = $(this); 9748 9749 // If an `img` element, add it. But keep iterating in 9750 // case it has a background image too. 9751 if (element.is('img:has-src')) { 9752 allImgs.push({ 9753 src: element.attr('src'), 9754 element: element[0] 9755 }); 9756 } 9757 9758 $.each(hasImgProperties, function (i, property) { 9759 var propertyValue = element.css(property); 9760 var match; 9761 9762 // If it doesn't contain this property, skip. 9763 if (!propertyValue) { 9764 return true; 9765 } 9766 9767 // Get all url() of this element. 9768 while (match = matchUrl.exec(propertyValue)) { 9769 allImgs.push({ 9770 src: match[2], 9771 element: element[0] 9772 }); 9773 } 9774 }); 9775 9776 $.each(hasImageAttributes, function (i, attribute) { 9777 var attributeValue = element.attr(attribute); 9778 var attributeValues; 9779 9780 // If it doesn't contain this property, skip. 9781 if (!attributeValue) { 9782 return true; 9783 } 9784 9785 // Check for multiple comma separated images 9786 attributeValues = attributeValue.split(','); 9787 9788 $.each(attributeValues, function(i, value) { 9789 // Trim value and get string before first 9790 // whitespace (for use with srcset). 9791 value = $.trim(value).split(' ')[0]; 9792 allImgs.push({ 9793 src: value, 9794 element: element[0] 9795 }); 9796 }); 9797 }); 9798 }); 9799 } else { 9800 // For images only, the task is simpler. 9801 obj.find('img:has-src') 9802 .each(function () { 9803 allImgs.push({ 9804 src: this.src, 9805 element: this 9806 }); 9807 }); 9808 } 9809 9810 allImgsLength = allImgs.length; 9811 allImgsLoaded = 0; 9812 9813 // If no images found, don't bother. 9814 if (allImgsLength === 0) { 9815 finishedCallback.call(obj[0]); 9816 deferred.resolveWith(obj[0]); 9817 } 9818 9819 $.each(allImgs, function (i, img) { 9820 9821 var image = new Image(); 9822 var events = 9823 'load.' + eventNamespace + ' error.' + eventNamespace; 9824 9825 // Handle the image loading and error with the same callback. 9826 $(image).one(events, function me (event) { 9827 // If an error occurred with loading the image, set the 9828 // third argument accordingly. 9829 var eachArguments = [ 9830 allImgsLoaded, 9831 allImgsLength, 9832 event.type == 'load' 9833 ]; 9834 allImgsLoaded++; 9835 9836 eachCallback.apply(img.element, eachArguments); 9837 deferred.notifyWith(img.element, eachArguments); 9838 9839 // Unbind the event listeners. I use this in addition to 9840 // `one` as one of those events won't be called (either 9841 // 'load' or 'error' will be called). 9842 $(this).off(events, me); 9843 9844 if (allImgsLoaded == allImgsLength) { 9845 finishedCallback.call(obj[0]); 9846 deferred.resolveWith(obj[0]); 9847 return false; 9848 } 9849 9850 }); 9851 9852 image.src = img.src; 9853 }); 9854 }); 9855 9856 return deferred.promise(); 9857 9858 }; 9859})); 9860 9861/************************************************************************** 9862 * jquery.themepunch.revolution.js - jQuery Plugin for Revolution Slider 9863 * @version: 5.1.6 (04.12.2015) 9864 * @requires jQuery v1.7 or later (tested on 1.9) 9865 * @author ThemePunch 9866**************************************************************************/ 9867 9868(function(jQuery,undefined){ 9869 "use strict"; 9870 9871 jQuery.fn.extend({ 9872 9873 revolution: function(options) { 9874 9875 // SET DEFAULT VALUES OF ITEM // 9876 var defaults = { 9877 delay:9000, 9878 responsiveLevels:4064, // Single or Array for Responsive Levels i.e.: 4064 or i.e. [2048, 1024, 768, 480] 9879 visibilityLevels:[2048,1024,778,480], // Single or Array for Responsive Visibility Levels i.e.: 4064 or i.e. [2048, 1024, 768, 480] 9880 gridwidth:960, // Single or Array i.e. 960 or [960, 840,760,460] 9881 gridheight:500, // Single or Array i.e. 500 or [500, 450,400,350] 9882 minHeight:0, 9883 autoHeight:"off", 9884 sliderType : "standard", // standard, carousel, hero 9885 sliderLayout : "auto", // auto, fullwidth, fullscreen 9886 9887 fullScreenAutoWidth:"off", // Turns the FullScreen Slider to be a FullHeight but auto Width Slider 9888 fullScreenAlignForce:"off", 9889 fullScreenOffsetContainer:"", // Size for FullScreen Slider minimising Calculated on the Container sizes 9890 fullScreenOffset:"0", // Size for FullScreen Slider minimising 9891 9892 hideCaptionAtLimit:0, // It Defines if a caption should be shown under a Screen Resolution ( Basod on The Width of Browser) 9893 hideAllCaptionAtLimit:0, // Hide all The Captions if Width of Browser is less then this value 9894 hideSliderAtLimit:0, // Hide the whole slider, and stop also functions if Width of Browser is less than this value 9895 disableProgressBar:"off", // Hides Progress Bar if is set to "on" 9896 stopAtSlide:-1, // Stop Timer if Slide "x" has been Reached. If stopAfterLoops set to 0, then it stops already in the first Loop at slide X which defined. -1 means do not stop at any slide. stopAfterLoops has no sinn in this case. 9897 stopAfterLoops:-1, // Stop Timer if All slides has been played "x" times. IT will stop at THe slide which is defined via stopAtSlide:x, if set to -1 slide never stop automatic 9898 shadow:0, //0 = no Shadow, 1,2,3 = 3 Different Art of Shadows (No Shadow in Fullwidth Version !) 9899 dottedOverlay:"none", //twoxtwo, threexthree, twoxtwowhite, threexthreewhite 9900 startDelay:0, // Delay before the first Animation starts. 9901 lazyType : "smart", //full, smart, single 9902 spinner:"spinner0", 9903 shuffle:"off", // Random Order of Slides, 9904 9905 9906 viewPort:{ 9907 enable:false, // if enabled, slider wait with start or wait at first slide. 9908 outof:"wait", // wait,pause 9909 visible_area:"60%" 9910 }, 9911 9912 fallbacks:{ 9913 isJoomla:false, 9914 panZoomDisableOnMobile:"off", 9915 simplifyAll:"on", 9916 nextSlideOnWindowFocus:"off", 9917 disableFocusListener:true 9918 }, 9919 9920 parallax : { 9921 type : "off", // off, mouse, scroll, mouse+scroll 9922 levels: [10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85], 9923 origo:"enterpoint", // slidercenter or enterpoint 9924 speed:400, 9925 bgparallax : "on", 9926 opacity:"on", 9927 disable_onmobile:"off", 9928 ddd_shadow:"on", 9929 ddd_bgfreeze:"off", 9930 ddd_overflow:"visible", 9931 ddd_layer_overflow:"visible", 9932 ddd_z_correction:65, 9933 ddd_path:"mouse" 9934 9935 }, 9936 9937 carousel : { 9938 horizontal_align : "center", 9939 vertical_align : "center", 9940 infinity : "on", 9941 space : 0, 9942 maxVisibleItems : 3, 9943 stretch:"off", 9944 fadeout:"on", 9945 maxRotation:0, 9946 minScale:0, 9947 vary_fade:"off", 9948 vary_rotation:"on", 9949 vary_scale:"off", 9950 border_radius:"0px", 9951 padding_top:0, 9952 padding_bottom:0 9953 }, 9954 9955 navigation : { 9956 keyboardNavigation:"on", 9957 keyboard_direction:"horizontal", // horizontal - left/right arrows, vertical - top/bottom arrows 9958 mouseScrollNavigation:"off", // on, off, carousel 9959 onHoverStop:"on", // Stop Banner Timet at Hover on Slide on/off 9960 9961 touch:{ 9962 touchenabled:"off", // Enable Swipe Function : on/off 9963 swipe_treshold : 75, // The number of pixels that the user must move their finger by before it is considered a swipe. 9964 swipe_min_touches : 1, // Min Finger (touch) used for swipe 9965 drag_block_vertical:false, // Prevent Vertical Scroll during Swipe 9966 swipe_direction:"horizontal" 9967 }, 9968 arrows: { 9969 style:
9969"", 9970 enable:false, 9971 hide_onmobile:false, 9972 hide_onleave:true, 9973 hide_delay:200, 9974 hide_delay_mobile:1200, 9975 hide_under:0, 9976 hide_over:9999, 9977 tmp:'', 9978 left : { 9979 h_align:"left", 9980 v_align:"center", 9981 h_offset:20, 9982 v_offset:0, 9983 }, 9984 right : { 9985 h_align:"right", 9986 v_align:"center", 9987 h_offset:20, 9988 v_offset:0 9989 } 9990 }, 9991 bullets: { 9992 style:"", 9993 enable:false, 9994 hide_onmobile:false, 9995 hide_onleave:true, 9996 hide_delay:200, 9997 hide_delay_mobile:1200, 9998 hide_under:0, 9999 hide_over:9999, 10000 direction:"horizontal", 10001 h_align:"left", 10002 v_align:"center", 10003 space:0, 10004 h_offset:20, 10005 v_offset:0, 10006 tmp:'<span class="tp-bullet-image"></span><span class="tp-bullet-title"></span>' 10007 }, 10008 thumbnails: { 10009 style:"", 10010 enable:false, 10011 width:100, 10012 height:50, 10013 min_width:100, 10014 wrapper_padding:2, 10015 wrapper_color:"#f5f5f5", 10016 wrapper_opacity:1, 10017 tmp:'<span class="tp-thumb-image"></span><span class="tp-thumb-title"></span>', 10018 visibleAmount:5, 10019 hide_onmobile:false, 10020 hide_onleave:true, 10021 hide_delay:200, 10022 hide_delay_mobile:1200, 10023 hide_under:0, 10024 hide_over:9999, 10025 direction:"horizontal", 10026 span:false, 10027 position:"inner", 10028 space:2, 10029 h_align:"left", 10030 v_align:"center", 10031 h_offset:20, 10032 v_offset:0 10033 }, 10034 tabs: { 10035 style:"", 10036 enable:false, 10037 width:100, 10038 min_width:100, 10039 height:50, 10040 wrapper_padding:10, 10041 wrapper_color:"#f5f5f5", 10042 wrapper_opacity:1, 10043 tmp:'<span class="tp-tab-image"></span>', 10044 visibleAmount:5, 10045 hide_onmobile:false, 10046 hide_onleave:true, 10047 hide_delay:200, 10048 hide_delay_mobile:1200, 10049 hide_under:0, 10050 hide_over:9999, 10051 direction:"horizontal", 10052 span:false, 10053 space:0, 10054 position:"inner", 10055 h_align:"left", 10056 v_align:"center", 10057 h_offset:20, 10058 v_offset:0 10059 } 10060 }, 10061 extensions:"extensions/", //example extensions/ or extensions/source/ 10062 extensions_suffix:".min.js", 10063 debugMode:false 10064 }; 10065 10066 // Merge of Defaults 10067 options = jQuery.extend(true,{},defaults, options); 10068 10069 return this.each(function() { 10070 10071 var c = jQuery(this); 10072 //REMOVE SLIDES IF SLIDER IS HERO 10073 if (options.sliderType=="hero") { 10074 c.find('>ul>li').each(function(i) { 10075 if (i>0) jQuery(this).remove(); 10076 }) 10077 } 10078 options.jsFileLocation = options.jsFileLocation || getScriptLocation("themepunch.revolution.min.js"); 10079 options.jsFileLocation = options.jsFileLocation + options.extensions; 10080 options.scriptsneeded = getNeededScripts(options,c); 10081 options.curWinRange = 0; 10082 10083 if (options.navigation!=undefined && options.navigation.touch!=undefined) 10084 options.navigation.touch.swipe_min_touches = options.navigation.touch.swipe_min_touches >5 ? 1 : options.navigation.touch.swipe_min_touches; 10085 10086 10087 10088 jQuery(this).on("scriptsloaded",function() { 10089 if (options.modulesfailing ) { 10090 c.html('<div style="margin:auto;line-height:40px;font-size:14px;color:#fff;padding:15px;background:#e74c3c;margin:20px 0px;">!! Error at loading Slider Revolution 5.0 Extrensions.'+options.errorm+'</div>').show(); 10091 return false; 10092 } 10093 10094 // CHECK FOR MIGRATION 10095 if (_R.migration!=undefined) options = _R.migration(c,options); 10096 punchgs.force3D = true; 10097 if (options.simplifyAll!=="on") punchgs.TweenLite.lagSmoothing(1000,16); 10098 prepareOptions(c,options); 10099 initSlider(c,options); 10100 }); 10101 10102 waitForScripts(c,options.scriptsneeded); 10103 }) 10104 }, 10105 10106 // Remove a Slide from the Slider 10107 revremoveslide : function(sindex) { 10108 10109 return this.each(function() { 10110 10111 var container=jQuery(this); 10112 if (container!=undefined && container.length>0 && jQuery('body').find('#'+container.attr('id')).length>0) { 10113 var bt = container.parent().find('.tp-bannertimer'), 10114 opt = bt.data('opt'); 10115 if (opt && opt.li.length>0) { 10116 if (sindex>0 || sindex<=opt.li.length) { 10117 10118 var li = jQuery(opt.li[sindex]), 10119 ref = li.data("index"), 10120 nextslideafter = false; 10121 10122 opt.slideamount = opt.slideamount-1; 10123 removeNavWithLiref('.tp-bullet',ref,opt); 10124 removeNavWithLiref('.tp-tab',ref,opt); 10125 removeNavWithLiref('.tp-thumb',ref,opt); 10126 if (li.hasClass('active-revslide')) 10127 nextslideafter = true; 10128 li.remove(); 10129 opt.li = removeArray(opt.li,sindex); 10130 if (opt.carousel && opt.carousel.slides) 10131 opt.carousel.slides = removeArray(opt.carousel.slides,sindex) 10132 opt.thumbs = removeArray(opt.thumbs,sindex); 10133 if (_R.updateNavIndexes) _R.updateNavIndexes(opt); 10134 if (nextslideafter) container.revnext(); 10135 10136 } 10137 } 10138 } 10139 }); 10140 10141 }, 10142 10143 // Add a New Call Back to some Module 10144 revaddcallback: function(callback) { 10145 return this.each(function() { 10146 var container=jQuery(this); 10147 if (container!=undefined && container.length>0 && jQuery('body').find('#'+container.attr('id')).length>0) { 10148 var bt = container.parent().find('.tp-bannertimer'), 10149 opt = bt.data('opt'); 10150 if (opt.callBackArray === undefined) 10151 opt.callBackArray = new Array(); 10152 opt.callBackArray.push(callback); 10153 } 10154 }) 10155 }, 10156 10157 // Get Current Parallax Proc 10158 revgetparallaxproc : function() { 10159 var container=jQuery(this); 10160 if (container!=undefined && container.length>0 && jQuery('body').find('#'+container.attr('id')).length>0) { 10161 var bt = container.parent().find('.tp-bannertimer'), 10162 opt = bt.data('opt'); 10163 return opt.scrollproc; 10164 } 10165 10166 }, 10167 10168 // ENABLE DEBUG MODE 10169 revdebugmode: function() { 10170 return this.each(function() { 10171 var container=jQuery(this); 10172 if (container!=undefined && container.length>0 && jQuery('body').find('#'+container.attr('id')).length>0) { 10173 var bt = container.parent().find('.tp-bannertimer'), 10174 opt = bt.data('opt'); 10175 opt.debugMode = true; 10176 containerResized(container,opt); 10177 } 10178 }) 10179 }, 10180 10181 // METHODE SCROLL 10182 revscroll: function(oy) { 10183 return this.each(function() { 10184 var container=jQuery(this); 10185 if (container!=undefined && container.length>0 && jQuery('body').find('#'+container.attr('id')).length>0) 10186 jQuery('body,html').animate({scrollTop:(container.offset().top+(container.height())-oy)+"px"},{duration:400}); 10187 }) 10188 }, 10189 10190 // METHODE PAUSE 10191 revredraw: function(oy) { 10192 return this.each(function() { 10193 10194 var container=jQuery(this); 10195 if (container!=undefined && container.length>0 && jQuery('body').find('#'+container.attr('id')).length>0) { 10196 var bt = container.parent().find('.tp-bannertimer'); 10197 var opt = bt.data('opt'); 10198 containerResized(container,opt); 10199 } 10200 }) 10201 }, 10202 // METHODE PAUSE 10203 revkill: function(oy) { 10204 10205 var self = this, 10206 container=jQuery(this); 10207 10208 punchgs.TweenLite.killDelayedCallsTo(_R.showHideNavElements); 10209 if (_R.endMoveCaption) 10210 punchgs.TweenLite.killDelayedCallsTo(_R.endMoveCaption); 10211 10212 if (container!=undefined && container.length>0 && jQuery('body').find('#'+container.attr('id')).length>0) { 10213 10214 container.data('conthover',1); 10215 container.data('conthover-changed',1); 10216 container.trigger('revolution.slide.onpause'); 10217 var bt = container.parent().find('.tp-bannertimer'), 10218 opt = bt.data('opt'); 10219 opt.tonpause = true; 10220 container.trigger('stoptimer'); 10221 10222 punchgs.TweenLite.killTweensOf(container.find('*'),false); 10223 punchgs.TweenLite.killTweensOf(container,false); 10224 container.unbind('hover, mouseover, mouseenter,mouseleave, resize'); 10225 var resizid = "resize.revslider-"+container.attr('id'); 10226 jQuery(window).off(resizid); 10227 container.find('*').each(function() { 10228 var el = jQuery(this); 10229 10230 el.unbind('on, hover, mouseenter,mouseleave,mouseover, resize,restarttimer, stoptimer'); 10231 el.off('on, hover, mouseenter,mouseleave,mouseover, resize'); 10232 el.data('mySplitText',null); 10233 el.data('ctl',null); 10234 if (el.data('tween')!=undefined) 10235 el.data('tween').kill(); 10236 if (el.data('kenburn')!=undefined) 10237 el.data('kenburn').kill(); 10238 if (el.data('timeline_out')!=undefined) 10239 el.data('timeline_out').kill(); 10240 if (el.data('timeline')!=undefined) 10241 el.data('timeline').kill(); 10242 10243 el.remove(); 10244 el.empty(); 10245 el=null; 10246 }) 10247 10248 10249 punchgs.TweenLite.killTweensOf(container.find('*'),false); 10250 punchgs.TweenLite.killTweensOf(container,false); 10251 bt.remove(); 10252 try{container.closest('.forcefullwidth_wrapper_tp_banner').remove();} catch(e) {} 10253 try{container.closest('.rev_slider_wrapper').remove()} catch(e) {} 10254 try{container.remove();} catch(e) {} 10255 container.empty(); 10256 container.html(); 10257 container = null; 10258 10259 opt = null; 10260 delete(self.c); 10261 delete(self.opt); 10262 10263 return true; 10264 } else { 10265 return false; 10266 } 10267 10268 10269 }, 10270 10271 // METHODE PAUSE 10272 revpause: function() { 10273 return this.each(function() { 10274 var c=jQuery(this); 10275 if (c!=undefined && c.length>0 && jQuery('body').find('#'+c.attr('id')).length>0) { 10276 c.data('conthover',1); 10277 c.data('conthover-changed',1); 10278 c.trigger('revolution.slide.onpause'); 10279 var bt = c.parent().find('.tp-bannertimer'); 10280 var opt = bt.data('opt'); 10281 opt.tonpause = true; 10282 c.trigger('stoptimer'); 10283 } 10284 }) 10285 }, 10286 10287 // METHODE RESUME 10288 revresume: function() { 10289 return this.each(function() { 10290 var c=jQuery(this); 10291 if (c!=undefined && c.length>0 && jQuery('body').find('#'+c.attr('id')).length>0) { 10292 c.data('conthover',0); 10293 c.data('conthover-changed',1); 10294 c.trigger('revolution.slide.onresume'); 10295 var bt = c.parent().find('.tp-bannertimer'); 10296 var opt = bt.data('opt'); 10297 opt.tonpause = false; 10298 c.trigger('starttimer'); 10299 } 10300 }) 10301 }, 10302 10303 // METHODE NEXT 10304 revnext: function() { 10305 return this.each(function() { 10306 // CATCH THE CONTAINER 10307 var c=jQuery(this); 10308 if (c!=undefined && c.length>0 && jQuery('body').find('#'+c.attr('id')).length>0) { 10309 var bt = c.parent().find('.tp-bannertimer'), 10310 opt = bt.data('opt'); 10311 _R.callingNewSlide(opt,c,1); 10312 } 10313 }) 10314 }, 10315 10316 // METHODE RESUME 10317 revprev: function() { 10318 return this.each(function() { 10319 // CATCH THE CONTAINER 10320 var c=jQuery(this); 10321 if (c!=undefined && c.length>0 && jQuery('body').find('#'+c.attr('id')).length>0) { 10322 var bt = c.parent().find('.tp-bannertimer'), 10323 opt = bt.data('opt'); 10324 _R.callingNewSlide(opt,c,-1);
10325 } 10326 }) 10327 }, 10328 10329 // METHODE LENGTH 10330 revmaxslide: function() { 10331 // CATCH THE CONTAINER 10332 return jQuery(this).find('.tp-revslider-mainul >li').length; 10333 }, 10334 10335 10336 // METHODE CURRENT 10337 revcurrentslide: function() { 10338 // CATCH THE CONTAINER 10339 var c=jQuery(this); 10340 if (c!=undefined && c.length>0 && jQuery('body').find('#'+c.attr('id')).length>0) { 10341 var bt = c.parent().find('.tp-bannertimer'); 10342 var opt = bt.data('opt'); 10343 return parseInt(opt.act,0)+1; 10344 } 10345 }, 10346 10347 // METHODE CURRENT 10348 revlastslide: function() { 10349 // CATCH THE CONTAINER 10350 return jQuery(this).find('.tp-revslider-mainul >li').length; 10351 }, 10352 10353 10354 // METHODE JUMP TO SLIDE 10355 revshowslide: function(slide) { 10356 return this.each(function() { 10357 // CATCH THE CONTAINER 10358 var c=jQuery(this); 10359 if (c!=undefined && c.length>0 && jQuery('body').find('#'+c.attr('id')).length>0) { 10360 var bt = c.parent().find('.tp-bannertimer'), 10361 opt = bt.data('opt'); 10362 _R.callingNewSlide(opt,c,"to"+(slide-1)); 10363 } 10364 }) 10365 }, 10366 revcallslidewithid: function(slide) { 10367 return this.each(function() { 10368 // CATCH THE CONTAINER 10369 var c=jQuery(this); 10370 if (c!=undefined && c.length>0 && jQuery('body').find('#'+c.attr('id')).length>0) { 10371 var bt = c.parent().find('.tp-bannertimer'), 10372 opt = bt.data('opt'); 10373 _R.callingNewSlide(opt,c,slide); 10374 } 10375 }) 10376 } 10377}); 10378 10379 10380 10381////////////////////////////////////////////////////////////// 10382// - REVOLUTION FUNCTION EXTENSIONS FOR GLOBAL USAGE - // 10383////////////////////////////////////////////////////////////// 10384var _R = jQuery.fn.revolution; 10385 10386jQuery.extend(true, _R, { 10387 10388 simp : function(a,b,basic) { 10389 var c = Math.abs(a) - (Math.floor(Math.abs(a / b))*b); 10390 if (basic) 10391 return c; 10392 else 10393 return a<0 ? -1*c : c; 10394 }, 10395 10396 // - IS IOS VERSION OLDER THAN 5 ?? 10397 iOSVersion : function() { 10398 var oldios = false; 10399 if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/iPad/i))) { 10400 if (navigator.userAgent.match(/OS 4_\d like Mac OS X/i)) { 10401 oldios = true; 10402 } 10403 } else { 10404 oldios = false; 10405 } 10406 return oldios; 10407 }, 10408 10409 10410 // - CHECK IF BROWSER IS IE - 10411 isIE : function( version, comparison ){ 10412 var $div = jQuery('<div style="display:none;"/>').appendTo(jQuery('body')); 10413 $div.html('<!--[if '+(comparison||'')+' IE '+(version||'')+']><a> </a><![endif]-->'); 10414 var ieTest = $div.find('a').length; 10415 $div.remove(); 10416 return ieTest; 10417 }, 10418 10419 // - IS MOBILE ?? 10420 is_mobile : function() { 10421 var agents = ['android', 'webos', 'iphone', 'ipad', 'blackberry','Android', 'webos', ,'iPod', 'iPhone', 'iPad', 'Blackberry', 'BlackBerry']; 10422 var ismobile=false; 10423 for(var i in agents) { 10424
10425 if (navigator.userAgent.split(agents[i]).length>1) { 10426 ismobile = true; 10427 10428 } 10429 } 10430 return ismobile; 10431 }, 10432 10433 // - CALL BACK HANDLINGS - // 10434 callBackHandling : function(opt,type,position) { 10435 try{ 10436 if (opt.callBackArray) 10437 jQuery.each(opt.callBackArray,function(i,c) { 10438 if (c) { 10439 if (c.inmodule && c.inmodule === type) 10440 if (c.atposition && c.atposition === position) 10441 if (c.callback) 10442 c.callback.call(); 10443 } 10444 }); 10445 } catch(e) { 10446 console.log("Call Back Failed"); 10447 } 10448 }, 10449 10450 get_browser : function(){ 10451 var N=navigator.appName, ua=navigator.userAgent, tem; 10452 var M=ua.match(/(opera|chrome|safari|firefox|msie)\/?\s*(\.?\d+(\.\d+)*)/i); 10453 if(M && (tem= ua.match(/version\/([\.\d]+)/i))!= null) M[2]= tem[1]; 10454 M=M? [M[1], M[2]]: [N, navigator.appVersion, '-?']; 10455 return M[0]; 10456 }, 10457 10458 get_browser_version : function(){ 10459 var N=navigator.appName, ua=navigator.userAgent, tem; 10460 var M=ua.match(/(opera|chrome|safari|firefox|msie)\/?\s*(\.?\d+(\.\d+)*)/i); 10461 if(M && (tem= ua.match(/version\/([\.\d]+)/i))!= null) M[2]= tem[1]; 10462 M=M? [M[1], M[2]]: [N, navigator.appVersion, '-?']; 10463 return M[1]; 10464 }, 10465 10466 // GET THE HORIZONTAL OFFSET OF SLIDER BASED ON THE THU`MBNAIL AND TABS LEFT AND RIGHT SIDE 10467 getHorizontalOffset : function(container,side) { 10468 var thumbloff = gWiderOut(container,'.outer-left'), 10469 thumbroff = gWiderOut(container,'.outer-right'); 10470 10471 switch (side) { 10472 case "left": 10473 return thumbloff; 10474 break; 10475 case "right": 10476 return thumbroff; 10477 break; 10478 case "both": 10479 return thumbloff+thumbroff; 10480 break; 10481 } 10482 }, 10483 10484 10485 // - CALLING THE NEW SLIDE - // 10486 callingNewSlide : function(opt,container,direction) { 10487 10488 10489 var aindex = container.find('.next-revslide').length>0 ? container.find('.next-revslide').index() : container.find('.processing-revslide').length>0 ? container.find('.processing-revslide').index() : container.find('.active-revslide').index(), 10490 nindex = 0; 10491 10492 container.find('.next-revslide').removeClass("next-revslide"); 10493 10494 10495 // SET NEXT DIRECTION 10496 if (direction && jQuery.isNumeric(direction) || direction.match(/to/g)) { 10497 if (direction===1 || direction === -1) { 10498 nindex = aindex + direction; 10499 nindex = nindex<0 ? opt.slideamount-1 : nindex>=opt.slideamount ? 0 : nindex; 10500 } else { 10501 10502 direction=jQuery.isNumeric(direction) ? direction : parseInt(direction.split("to")[1],0); 10503 nindex = direction<0 ? 0 : direction>opt.slideamount-1 ? opt.slideamount-1 : direction; 10504 } 10505 container.find('.tp-revslider-slidesli:eq('+nindex+')').addClass("next-revslide"); 10506 } else 10507 if (direction) { 10508 10509 container.find('.tp-revslider-slidesli').each(function() { 10510 var li=jQuery(this); 10511 if (li.data('index')===direction) li.addClass("next-revslide"); 10512 }) 10513 } 10514 10515 10516 nindex = container.find('.next-revslide').index(); 10517 container.trigger("revolution.nextslide.waiting"); 10518 10519 10520 if (nindex !== aindex && nindex!=-1) 10521 swapSlide(container,opt); 10522 else 10523 container.find('.next-revslide').removeClass("next-revslide"); 10524 }, 10525 10526 slotSize : function(img,opt) { 10527 opt.slotw=Math.ceil(opt.width/opt.slots); 10528 10529 if (opt.sliderLayout=="fullscreen") 10530 opt.sloth=Math.ceil(jQuery(window).height()/opt.slots); 10531 else 10532 opt.sloth=Math.ceil(opt.height/opt.slots); 10533 10534 if (opt.autoHeight=="on" && img!==undefined && img!=="") 10535 opt.sloth=Math.ceil(img.height()/opt.slots); 10536 10537 10538 }, 10539 10540 setSize : function(opt) { 10541 10542 var ofh = (opt.top_outer || 0) + (opt.bottom_outer || 0), 10543 cpt = parseInt((opt.carousel.padding_top||0),0), 10544 cpb = parseInt((opt.carousel.padding_bottom||0),0), 10545 maxhei = opt.gridheight[opt.curWinRange]; 10546 10547 maxhei = maxhei<opt.minHeight ? opt.minHeight : maxhei; 10548 if (opt.sliderLayout=="fullwidth" && opt.autoHeight=="off") punchgs.TweenLite.set(opt.c,{maxHeight:maxhei+"px"}); 10549 opt.c.css({marginTop:cpt,marginBottom:cpb}); 10550 opt.width=opt.ul.width(); 10551 opt.height=opt.ul.height(); 10552 setScale(opt); 10553 10554 opt.height = Math.round(opt.gridheight[opt.curWinRange] * (opt.width/opt.gridwidth[opt.curWinRange])); 10555 10556 if (opt.height>opt.gridheight[opt.curWinRange] && opt.autoHeight!="on") opt.height=opt.gridheight[opt.curWinRange]; 10557 10558 if (opt.sliderLayout=="fullscreen" || opt.infullscreenmode) { 10559 opt.height = opt.bw * opt.gridheight[opt.curWinRange]; 10560 var cow = opt.c.parent().width(); 10561 var coh = jQuery(window).height(); 10562 10563 if (opt.fullScreenOffsetContainer!=undefined) { 10564 try{ 10565 var offcontainers = opt.fullScreenOffsetContainer.split(",");
10566 if (offcontainers) 10567 jQuery.each(offcontainers,function(index,searchedcont) { 10568 coh = jQuery(searchedcont).length>0 ? coh - jQuery(searchedcont).outerHeight(true) : coh; 10569 }); 10570 } catch(e) {} 10571 try{ 10572 if (opt.fullScreenOffset.split("%").length>1 && opt.fullScreenOffset!=undefined && opt.fullScreenOffset.length>0) 10573 coh = coh - (jQuery(window).height()* parseInt(opt.fullScreenOffset,0)/100); 10574 else 10575 if (opt.fullScreenOffset!=undefined && opt.fullScreenOffset.length>0) 10576 coh = coh - parseInt(opt.fullScreenOffset,0); 10577 } catch(e) {} 10578 } 10579 10580 coh = coh<opt.minHeight ? opt.minHeight : coh; 10581 coh = coh - ofh; 10582 opt.c.parent().height(coh); 10583 10584 opt.c.closest('.rev_slider_wrapper').height(coh); 10585 opt.c.css({'height':'100%'}); 10586 10587 opt.height=coh; 10588 if (opt.minHeight!=undefined && opt.height<opt.minHeight) 10589 opt.height = opt.minHeight; 10590 } else { 10591 10592 if (opt.minHeight!=undefined && opt.height<opt.minHeight) 10593 opt.height = opt.minHeight; 10594 opt.c.height(opt.height); 10595 } 10596 var si = { height:(cpt+cpb+ofh+opt.height)}; 10597 opt.c.closest('.forcefullwidth_wrapper_tp_banner').find('.tp-fullwidth-forcer').css(si); 10598 opt.c.closest('.rev_slider_wrapper').css(si); 10599 setScale(opt); 10600 }, 10601 10602 enterInViewPort : function(opt) { 10603 // START COUNTER IF VP ENTERED, AND COUNTDOWN WAS NOT ON YET 10604 if (opt.waitForCountDown) { 10605 countDown(opt.c,opt); 10606 opt.waitForCountDown=false; 10607 } 10608 // START FIRST SLIDE IF NOT YET STARTED AND VP ENTERED 10609 if (opt.waitForFirstSlide) { 10610 swapSlide(opt.c,opt); 10611 opt.waitForFirstSlide=false; 10612 } 10613 10614 if (opt.sliderlaststatus == "playing" || opt.sliderlaststatus==undefined) { 10615 opt.c.trigger("starttimer"); 10616 } 10617 10618 10619 if (opt.lastplayedvideos != undefined && opt.lastplayedvideos.length>0) { 10620 10621 jQuery.each(opt.lastplayedvideos,function(i,_nc) { 10622 10623 _R.playVideo(_nc,opt); 10624 }); 10625 } 10626 }, 10627 10628 leaveViewPort : function(opt) { 10629 opt.sliderlaststatus = opt.sliderstatus; 10630 opt.c.trigger("stoptimer"); 10631 if (opt.playingvideos != undefined && opt.playingvideos.length>0) { 10632 opt.lastplayedvideos = jQuery.extend(true,[],opt.playingvideos); 10633 if (opt.playingvideos) 10634 jQuery.each(opt.playingvideos,function(i,_nc) { 10635 if (_R.stopVideo) _R.stopVideo(_nc,opt); 10636 }); 10637 } 10638 }, 10639 10640 unToggleState : function(a) { 10641 if (a!=undefined && a.length>0) 10642 jQuery.each(a,function(i,layer) { 10643 layer.removeClass("rs-toggle-content-active"); 10644 }); 10645 }, 10646 10647 toggleState : function(a) { 10648 if (a!=undefined && a.length>0) 10649 jQuery.each(a,function(i,layer) { 10650 layer.addClass("rs-toggle-content-active"); 10651 }); 10652 }, 10653 lastToggleState : function(a) { 10654 var state = 0; 10655 if (a!=undefined && a.length>0) 10656 jQuery.each(a,function(i,layer) { 10657 state = layer.hasClass("rs-toggle-content-active"); 10658 }); 10659 return state; 10660 } 10661 10662}); 10663 10664 10665var _ISM = _R.is_mobile(); 10666 10667 10668 10669//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 10670//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 10671//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 10672//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 10673var removeArray = function(arr,i) { 10674 var newarr = []; 10675 jQuery.each(arr,function(a,b) { 10676 if (a!=i) newarr.push(b); 10677 }) 10678 return newarr; 10679 } 10680 10681var removeNavWithLiref = function(a,ref,opt) { 10682 opt.c.find(a).each(function() { 10683 var a = jQuery(this); 10684 if (a.data('liref')===ref) 10685 a.remove(); 10686 }) 10687} 10688 10689 10690var lAjax = function(s,o) { 10691 if (jQuery('body').data(s)) return false; 10692 if (o.filesystem) { 10693 if (o.errorm===undefined) 10694 o.errorm = "<br>Local Filesystem Detected !<br>Put this to your header:"; 10695 console.warn('Local Filesystem detected !');
10696 o.errorm = o.errorm+'<br><script type="text/javascript" src="'+o.jsFileLocation+s+o.extensions_suffix+'"></script>'; 10697 console.warn(o.jsFileLocation+s+o.extensions_suffix+' could not be loaded !'); 10698 console.warn('Please use a local Server or work online or make sure that you load all needed Libraries manually in your Document.'); 10699 console.log(" "); 10700 o.modulesfailing = true; 10701 return false; 10702 } 10703 jQuery.ajax({ 10704 url:o.jsFileLocation+s+o.extensions_suffix, 10705 'dataType':'script', 10706 'cache':true, 10707 "error":function(e) { 10708 console.warn("Slider Revolution 5.0 Error !") 10709 console.error("Failure at Loading:"+s+o.extensions_suffix+" on Path:"+o.jsFileLocation) 10710 console.info(e); 10711 } 10712 }); 10713 jQuery('body').data(s,true); 10714} 10715 10716var getNeededScripts = function(o,c) { 10717 var n = new Object(), 10718 _n = o.navigation; 10719 10720 n.kenburns = false; 10721 n.parallax = false; 10722 n.carousel = false; 10723 n.navigation = false; 10724 n.videos = false; 10725 n.actions = false; 10726 n.layeranim = false; 10727 n.migration = false; 10728 10729 10730 // MIGRATION EXTENSION 10731 if (!c.data('version') || !c.data('version').toString().match(/5./gi)) { 10732 n.kenburns = true; 10733 n.parallax = true; 10734 n.carousel = false; 10735 n.navigation = true; 10736 n.videos = true; 10737 n.actions = true; 10738 n.layeranim = true; 10739 n.migration = true; 10740 } 10741 else { 10742 // KEN BURN MODUL 10743 c.find('img').each(function(){ 10744 if (jQuery(this).data('kenburns')=="on") n.kenburns = true; 10745 }); 10746 10747 // NAVIGATION EXTENSTION 10748 if (o.sliderType =="carousel" || _n.keyboardNavigation=="on" || _n.mouseScrollNavigation=="on" || _n.touch.touchenabled=="on" || _n.arrows.enable || _n.bullets.enable || _n.thumbnails.enable || _n.tabs.enable ) 10749 n.navigation = true; 10750 10751 // LAYERANIM, VIDEOS, ACTIONS EXTENSIONS 10752 c.find('.tp-caption, .tp-static-layer, .rs-background-video-layer').each(function(){ 10753 var _nc = jQuery(this); 10754 if ((_nc.data('ytid')!=undefined || _nc.find('iframe').length>0 && _nc.find('iframe').attr('src').toLowerCase().indexOf('youtube')>0)) 10755 n.videos = true; 10756 if ((_nc.data('vimeoid')!=undefined || _nc.find('iframe').length>0 && _nc.find('iframe').attr('src').toLowerCase().indexOf('vimeo')>0)) 10757 n.videos = true; 10758 if (_nc.data('actions')!==undefined) 10759 n.actions = true; 10760 n.layeranim = true; 10761 }); 10762 10763 c.find('li').each(function() { 10764 if (jQuery(this).data('link') && jQuery(this).data('link')!=undefined) { 10765 n.layeranim = true; 10766 n.actions = true; 10767 } 10768 }) 10769 10770 // VIDEO EXTENSION 10771 if (!n.videos && (c.find('.rs-background-video-layer').length>0 || c.find(".tp-videolayer").length>0 || c.find('iframe').length>0 || c.find('video').length>0)) 10772 n.videos = true; 10773 10774 // VIDEO EXTENSION 10775 if (o.sliderType =="carousel") 10776 n.carousel = true; 10777 10778 10779 10780 if (o.parallax.type!=="off" || o.viewPort.enable || o.viewPort.enable=="true") 10781 n.parallax = true; 10782 } 10783 10784 if (o.sliderType=="hero") { 10785 n.carousel = false; 10786 n.navigation = false; 10787 } 10788 10789 if (window.location.href.match(/file:/gi)) { 10790 n.filesystem = true; 10791 o.filesystem = true; 10792 } 10793 10794 // LOAD THE NEEDED LIBRARIES 10795 if (n.videos && typeof _R.isVideoPlaying=='undefined') lAjax('revolution.extension.video',o); 10796 if (n.carousel && typeof _R.prepareCarousel=='undefined') lAjax('revolution.extension.carousel',o); 10797 if (!n.carousel && typeof _R.animateSlide=='undefined') lAjax('revolution.extension.slideanims',o); 10798 if (n.actions && typeof _R.checkActions=='undefined') lAjax('revolution.extension.actions',o); 10799 if (n.layeranim && typeof _R.handleStaticLayers=='undefined') lAjax('revolution.extension.layeranimation',o); 10800 if (n.kenburns && typeof _R.stopKenBurn=='undefined') lAjax('revolution.extension.kenburn',o); 10801 if (n.navigation && typeof _R.createNavigation=='undefined') lAjax('revolution.extension.navigation',o); 10802 if (n.migration && typeof _R.migration=='undefined') lAjax('revolution.extension.migration',o); 10803 if (n.parallax && typeof _R.checkForParallax=='undefined') lAjax('revolution.extension.parallax',o); 10804 10805 10806 10807 return n; 10808} 10809 10810/////////////////////////////////// 10811// - WAIT FOR SCRIPT LOADS - // 10812/////////////////////////////////// 10813var waitForScripts = function(c,n) { 10814 // CHECK KEN BURN DEPENDENCIES 10815 10816 if (n.filesystem || 10817 (typeof punchgs !== 'undefined' && 10818 (!n.kenburns || (n.kenburns && typeof _R.stopKenBurn !== 'undefined')) && 10819 (!n.navigation || (n.navigation && typeof _R.createNavigation !== 'undefined')) && 10820 (!n.carousel || (n.carousel && typeof _R.prepareCarousel !== 'undefined')) && 10821 (!n.videos || (n.videos && typeof _R.resetVideo !== 'undefined')) && 10822 (!n.actions || (n.actions && typeof _R.checkActions !== 'undefined')) && 10823 (!n.layeranim || (n.layeranim && typeof _R.handleStaticLayers !== 'undefined')) && 10824 (!n.migration || (n.migration && typeof _R.migration !== 'undefined')) && 10825 (!n.parallax || (n.parallax && typeof _R.checkForParallax !== 'undefined')) && 10826 (n.carousel || (!n.carousel && typeof _R.animateSlide !== 'undefined')) 10827 )) 10828 c.trigger("scriptsloaded"); 10829 else
10830 setTimeout(function() { 10831 waitForScripts(c,n); 10832 },50); 10833 10834} 10835 10836////////////////////////////////// 10837// - GET SCRIPT LOCATION - // 10838////////////////////////////////// 10839var getScriptLocation = function(a) { 10840 10841 var srcexp = new RegExp("themepunch.revolution.min.js","gi"), 10842 ret = ""; 10843 jQuery("script").each(function() { 10844 var src = jQuery(this).attr("src"); 10845 if (src && src.match(srcexp)) 10846 ret = src; 10847 }); 10848 10849 ret = ret.replace('jquery.themepunch.revolution.min.js', ''); 10850 ret = ret.replace('jquery.themepunch.revolution.js', ''); 10851 ret = ret.split("?")[0]; 10852 return ret; 10853} 10854 10855////////////////////////////////////////// 10856// - ADVANCED RESPONSIVE LEVELS - // 10857////////////////////////////////////////// 10858var setCurWinRange = function(opt,vis) { 10859 var curlevel = 0, 10860 curwidth = 9999, 10861 lastmaxlevel = 0, 10862 lastmaxid = 0, 10863 curid = 0, 10864 winw = jQuery(window).width(), 10865 l = vis && opt.responsiveLevels==9999 ? opt.visibilityLevels : opt.responsiveLevels; 10866 10867 if (l && l.length) 10868 jQuery.each(l,function(index,level) { 10869 if (winw<level) { 10870 if (lastmaxlevel==0 || lastmaxlevel>level) { 10871 curwidth = level; 10872 curid = index; 10873 lastmaxlevel = level; 10874 } 10875 } 10876 10877 if (winw>level && lastmaxlevel<level) { 10878 lastmaxlevel = level; 10879 lastmaxid = index; 10880 } 10881 }); 10882 10883 if (lastmaxlevel<curwidth) 10884 curid = lastmaxid; 10885 10886 10887 if (!vis) 10888 opt.curWinRange = curid; 10889 else 10890 opt.forcedWinRange = curid; 10891 10892 10893} 10894 10895 10896 10897 10898////////////////////////////////////////// 10899// - INITIALISATION OF OPTIONS - // 10900////////////////////////////////////////// 10901var prepareOptions = function(container,opt) { 10902 opt.carousel.maxVisibleItems = opt.carousel.maxVisibleItems < 1 ? 999 : opt.carousel.maxVisibleItems; // === 1 ? 2 : opt.carousel.maxVisibleItems; 10903 opt.carousel.vertical_align = opt.carousel.vertical_align === "top" ? "0%" : opt.carousel.vertical_align==="bottom" ? "100%" : "50%"; 10904} 10905 10906var gWiderOut = function(c,cl) { 10907 var r = 0; 10908 c.find(cl).each(function() { 10909 var a = jQuery(this); 10910 if (!a.hasClass("tp-forcenotvisible") && r<a.outerWidth()) 10911 r = a.outerWidth(); 10912 }); 10913 return r; 10914} 10915 10916 10917 10918 10919////////////////////////////////////////// 10920// - INITIALISATION OF SLIDER - // 10921////////////////////////////////////////// 10922var initSlider = function (container,opt) { 10923 if (container==undefined) return false; 10924 10925 // CHECK FOR ALTERNATIVE IMAGE, AND IFRAM EXIST, AND WE ARE IN IE8, MOBILE, DRAW IT SIMPLE 10926 if (container.data('aimg')!=undefined) 10927 if ((container.data('aie8')=="enabled" && _R.isIE(8)) || (container.data('amobile')=="enabled" && _ISM)) 10928 container.html('<img class="tp-slider-alternative-image" src="'+container.data("aimg")+'">'); 10929 10930 // PREPRARE SOME CLASSES AND VARIABLES 10931 container.find('>ul').addClass("tp-revslider-mainul"); 10932 10933 10934 // CREATE SOME DEFAULT OPTIONS FOR LATER 10935 opt.c=container; 10936 opt.ul = container.find('.tp-revslider-mainul'); 10937 10938 // Remove Not Needed Slides for Mobile Devices 10939 opt.ul.find('>li').each(function(i) { 10940 var li = jQuery(this); 10941 if (li.data('hideslideonmobile')=="on" && _ISM) li.remove(); 10942 }); 10943 10944 10945 opt.cid = container.attr('id'); 10946 opt.ul.css({visibility:"visible"}); 10947 opt.slideamount = opt.ul.find('>li').length; 10948 opt.slayers = container.find('.tp-static-layers'); 10949 10950 10951 10952 10953 // Save Original Index of Slides 10954 opt.ul.find('>li').each(function(i) { 10955 jQuery(this).data('originalindex',i); 10956 }); 10957 10958 // RANDOMIZE THE SLIDER SHUFFLE MODE 10959 if (opt.shuffle=="on") { 10960 var fsa = new Object, 10961 fli = opt.ul.find('>li:first-child'); 10962 fsa.fstransition = fli.data('fstransition'); 10963 fsa.fsmasterspeed = fli.data('fsmasterspeed'); 10964 fsa.fsslotamount = fli.data('fsslotamount'); 10965 10966 for (var u=0;u<opt.slideamount;u++) { 10967 var it = Math.round(Math.random()*opt.slideamount); 10968 opt.ul.find('>li:eq('+it+')').prependTo(opt.ul); 10969 } 10970 10971 var newfli = opt.ul.find('>li:first-child'); 10972 newfli.data('fstransition',fsa.fstransition); 10973 newfli.data('fsmasterspeed',fsa.fsmasterspeed); 10974 newfli.data('fsslotamount',fsa.fsslotamount); 10975 // COLLECT ALL LI INTO AN ARRAY 10976 opt.li = opt.ul.find('>li'); 10977 } 10978 10979 10980 opt.li = opt.ul.find('>li'); 10981 opt.thumbs = new Array(); 10982 10983 opt.slots=4; 10984 opt.act=-1; 10985 opt.firststart=1; 10986 opt.loadqueue = new Array(); 10987 opt.syncload = 0; 10988 opt.conw = container.width(); 10989 opt.conh = container.height(); 10990 10991 if (opt.responsiveLevels.length>1) 10992 opt.responsiveLevels[0] = 9999; 10993 else
10994 opt.responsiveLevels = 9999; 10995 10996 // RECORD THUMBS AND SET INDEXES 10997 jQuery.each(opt.li,function(index,li) { 10998 var li = jQuery(li), 10999 img = li.find('.rev-slidebg') || li.find('img').first(), 11000 i = 0; 11001 11002 11003 li.addClass("tp-revslider-slidesli"); 11004 if (li.data('index')===undefined) li.data('index','rs-'+Math.round(Math.random()*999999)); 11005 11006 var obj = new Object; 11007 obj.params = new Array(); 11008 11009 obj.id = li.data('index'); 11010 obj.src = li.data('thumb')!==undefined ? li.data('thumb') : img.data('lazyload') !== undefined ? img.data('lazyload') : img.attr('src'); 11011 if (li.data('title') !== undefined) obj.params.push({from:RegExp("\\{\\{title\\}\\}","g"), to:li.data("title")}) 11012 if (li.data('description') !== undefined) obj.params.push({from:RegExp("\\{\\{description\\}\\}","g"), to:li.data("description")}) 11013 for (var i=1;i<=10;i++) { 11014 if (li.data("param"+i)!==undefined) 11015 obj.params.push({from:RegExp("\\{\\{param"+i+"\\}\\}","g"), to:li.data("param"+i)}) 11016 } 11017 opt.thumbs.push(obj); 11018 11019 li.data('origindex',li.index()); 11020 11021 // IF LINK ON SLIDE EXISTS, NEED TO CREATE A PROPER LAYER FOR IT. 11022 if (li.data('link')!=undefined) { 11023 var link = li.data('link'), 11024 target= li.data('target') || "_self", 11025 zindex= li.data('slideindex')==="back" ? 0 : 60, 11026 linktoslide=li.data('linktoslide'), 11027 checksl = linktoslide; 11028 11029 if (linktoslide != undefined) 11030 if (linktoslide!="next" && linktoslide!="prev") 11031 opt.li.each(function() { 11032 var t = jQuery(this); 11033 if (t.data('origindex')+1==checksl) linktoslide = t.data('index'); 11034 }); 11035 11036 11037 if (link!="slide") linktoslide="no"; 11038 11039 var apptxt = '<div class="tp-caption sft slidelink" style="cursor:pointer;width:100%;height:100%;z-index:'+zindex+';" data-x="center" data-y="center" ', 11040 jts = linktoslide==="scroll_under" ? '[{"event":"click","action":"scrollbelow","offset":"100px","delay":"0"}]' : 11041 linktoslide==="prev" ? '[{"event":"click","action":"jumptoslide","slide":"prev","delay":"0.2"}]' : 11042 linktoslide==="next" ? '[{"event":"click","action":"jumptoslide","slide":"next","delay":"0.2"}]' : '[{"event":"click","action":"jumptoslide","slide":"'+linktoslide+'","delay":"0.2"}]' 11043 11044 apptxt = linktoslide=="no" ? apptxt +' data-start="0">' : apptxt + 'data-actions='+"'"+jts + "'"+' data-start="0">'; 11045 apptxt = apptxt + '<a style="width:100%;height:100%;display:block"'; 11046 apptxt = link!="slide" ? apptxt + ' target="'+target+'" href="'+link+'"' : apptxt; 11047 apptxt = apptxt + '><span style="width:100%;height:100%;display:block"></span></a></div>'; 11048 li.append(apptxt); 11049 } 11050 }); 11051 11052 11053 // CREATE GRID WIDTH AND HEIGHT ARRAYS 11054 opt.rle = opt.responsiveLevels.length || 1; 11055 opt.gridwidth = cArray(opt.gridwidth,opt.rle); 11056 opt.gridheight = cArray(opt.gridheight,opt.rle); 11057 // END OF VERSION 5.0 INIT MODIFICATION 11058 11059 11060 11061 // SIMPLIFY ANIMATIONS ON OLD IOS AND IE8 IF NEEDED 11062 if (opt.simplifyAll=="on" && (_R.isIE(8) || _R.iOSVersion())) { 11063 container.find('.tp-caption').each(function() { 11064 var tc = jQuery(this); 11065 tc.removeClass("customin customout").addClass("fadein fadeout"); 11066 tc.data('splitin',""); 11067 tc.data('speed',400); 11068 }) 11069 opt.li.each(function() { 11070 var li= jQuery(this); 11071 li.data('transition',"fade"); 11072 li.data('masterspeed',500); 11073 li.data('slotamount',1); 11074 var img = li.find('.rev-slidebg') || li.find('>img').first(); 11075 img.data('kenburns',"off"); 11076 }); 11077 } 11078 11079 opt.desktop = !navigator.userAgent.match(/(iPhone|iPod|iPad|Android|BlackBerry|BB10|mobi|tablet|opera mini|nexus 7)/i); 11080 11081 // SOME OPTIONS WHICH SHOULD CLOSE OUT SOME OTHER SETTINGS 11082 opt.autoHeight = opt.sliderLayout=="fullscreen" ? "on" : opt.autoHeight; 11083 11084 if (opt.sliderLayout=="fullwidth" && opt.autoHeight=="off") container.css({maxHeight:opt.gridheight[opt.curWinRange]+"px"}); 11085 11086 // BUILD A FORCE FULLWIDTH CONTAINER, TO SPAN THE FULL SLIDER TO THE FULL WIDTH OF BROWSER 11087 if (opt.sliderLayout!="auto" && container.closest('.forcefullwidth_wrapper_tp_banner').length==0) { 11088 if (opt.sliderLayout!=="fullscreen" || opt.fullScreenAutoWidth!="on") { 11089 var cp = container.parent(), 11090 mb = cp.css('marginBottom'), 11091 mt = cp.css('marginTop'); 11092 mb = mb===undefined ? 0 : mb; 11093 mt = mt===undefined ? 0 : mt; 11094 11095 cp.wrap('<div class="forcefullwidth_wrapper_tp_banner" style="position:relative;width:100%;height:auto;margin-top:'+mt+';margin-bottom:'+mb+'"></div>');
11096 container.closest('.forcefullwidth_wrapper_tp_banner').append('<div class="tp-fullwidth-forcer" style="width:100%;height:'+container.height()+'px"></div>'); 11097 container.parent().css({marginTop:"0px",marginBottom:"0px"}); 11098 //container.css({'backgroundColor':container.parent().css('backgroundColor'),'backgroundImage':container.parent().css('backgroundImage')}); 11099 container.parent().css({position:'absolute'}); 11100 } 11101 } 11102 11103 11104 11105 // SHADOW ADD ONS 11106 if (opt.shadow!==undefined && opt.shadow>0) { 11107 container.parent().addClass('tp-shadow'+opt.shadow); 11108 container.parent().append('<div class="tp-shadowcover"></div>'); 11109 container.parent().find('.tp-shadowcover').css({'backgroundColor':container.parent().css('backgroundColor'),'backgroundImage':container.parent().css('backgroundImage')}); 11110 } 11111 11112 // ESTIMATE THE CURRENT WINDOWS RANGE INDEX 11113 setCurWinRange(opt); 11114 setCurWinRange(opt,true); 11115 11116 // IF THE CONTAINER IS NOT YET INITIALISED, LETS GO FOR IT 11117 if (!container.hasClass("revslider-initialised")) { 11118 // MARK THAT THE CONTAINER IS INITIALISED WITH SLIDER REVOLUTION ALREADY 11119 container.addClass("revslider-initialised"); 11120 11121 // FOR BETTER SELECTION, ADD SOME BASIC CLASS 11122 container.addClass("tp-simpleresponsive"); 11123 11124 // WE DONT HAVE ANY ID YET ? WE NEED ONE ! LETS GIVE ONE RANDOMLY FOR RUNTIME 11125 if (container.attr('id')==undefined) container.attr('id',"revslider-"+Math.round(Math.random()*1000+5)); 11126 11127 // CHECK IF FIREFOX 13 IS ON WAY.. IT HAS A STRANGE BUG, CSS ANIMATE SHOULD NOT BE USED 11128 opt.firefox13 = false; 11129 opt.ie = !jQuery.support.opacity; 11130 opt.ie9 = (document.documentMode == 9); 11131 11132 opt.origcd=opt.delay; 11133 11134 11135 11136 // CHECK THE jQUERY VERSION 11137 var version = jQuery.fn.jquery.split('.'), 11138 versionTop = parseFloat(version[0]), 11139 versionMinor = parseFloat(version[1]), 11140 versionIncrement = parseFloat(version[2] || '0'); 11141 if (versionTop==1 && versionMinor < 7) 11142 container.html('<div style="text-align:center; padding:40px 0px; font-size:20px; color:#992222;"> The Current Version of jQuery:'+version+' <br>Please update your jQuery Version to min. 1.7 in Case you wish to use the Revolution Slider Plugin</div>'); 11143 if (versionTop>1) opt.ie=false; 11144 11145 11146 11147 // PREPARE VIDEO PLAYERS 11148 var addedApis = new Object(); 11149 addedApis.addedyt=0; 11150 addedApis.addedvim=0; 11151 addedApis.addedvid=0; 11152 11153 container.find('.tp-caption, .rs-background-video-layer').each(function(i) { 11154 var _nc = jQuery(this), 11155 an = _nc.data('autoplayonlyfirsttime'), 11156 ap = _nc.data('autoplay'); 11157 11158 11159 if (_nc.hasClass("tp-static-layer") && _R.handleStaticLayers) 11160 _R.handleStaticLayers(_nc,opt); 11161 11162 var pom = _nc.data('noposteronmobile') || _nc.data('noPosterOnMobile') || _nc.data('posteronmobile') || _nc.data('posterOnMobile') || _nc.data('posterOnMObile'); 11163 _nc.data('noposteronmobile',pom); 11164 11165 // FIX VISIBLE IFRAME BUG IN SAFARI 11166 var iff = 0; 11167 _nc.find('iframe').each(function() { 11168 punchgs.TweenLite.set(jQuery(this),{autoAlpha:0}); 11169 iff++; 11170 }) 11171 if (iff>0) 11172 _nc.data('iframes',true) 11173 11174 if (_nc.hasClass("tp-caption")) { 11175 // PREPARE LAYERS AND WRAP THEM WITH PARALLAX, LOOP, MASK HELP CONTAINERS 11176 var ec = _nc.hasClass("slidelink") ? "width:100% !important;height:100% !important;" : ""; 11177 _nc.wrap('<div class="tp-parallax-wrap" style="'+ec+'position:absolute;visibility:hidden"><div class="tp-loop-wrap" style="'+ec+'position:absolute;"><div class="tp-mask-wrap" style="'+ec+'position:absolute" ></div></div></div>'); 11178 var lar = ['pendulum', 'rotate','slideloop','pulse','wave'], 11179 _lc = _nc.closest('.tp-loop-wrap'); 11180 11181 jQuery.each(lar,function(i,k) { 11182 var lw = _nc.find('.rs-'+k), 11183 f = lw.data() || ""; 11184 if (f!="") { 11185 _lc.data(f); 11186 _lc.addClass("rs-"+k); 11187 lw.children(0).unwrap(); 11188 _nc.data('loopanimation',"on"); 11189 } 11190 }); 11191 punchgs.TweenLite.set(_nc,{visibility:"hidden"}); 11192 } 11193 11194 var as = _nc.data('actions'); 11195 if (as!==undefined) _R.checkActions(_nc,opt,as); 11196 11197 checkHoverDependencies(_nc,opt); 11198
11199 if (_R.checkVideoApis) 11200 addedApis = _R.checkVideoApis(_nc,opt,addedApis); 11201 11202 // REMOVE VIDEO AUTOPLAYS FOR MOBILE DEVICES 11203 if (_ISM) { 11204 if (an == true || an=="true") { 11205 _nc.data('autoplayonlyfirsttime',"false"); 11206 an=false; 11207 } 11208 if (ap==true || ap=="true" || ap=="on" || ap=="1sttime") { 11209 _nc.data('autoplay',"off"); 11210 ap="off"; 11211 } 11212 11213 } 11214 11215 11216 // PREPARE TIMER BEHAVIOUR BASED ON AUTO PLAYED VIDEOS IN SLIDES 11217 if (an == true || an=="true" || ap == "1sttime") 11218 _nc.closest('li.tp-revslider-slidesli').addClass("rs-pause-timer-once"); 11219 11220 if (ap==true || ap=="true" || ap == "on" || ap == "no1sttime") 11221 _nc.closest('li.tp-revslider-slidesli').addClass("rs-pause-timer-always"); 11222 11223 11224 }); 11225 11226 container.hover( 11227 function() { 11228 container.trigger('tp-mouseenter'); 11229 opt.overcontainer=true; 11230 }, 11231 function() { 11232 container.trigger('tp-mouseleft'); 11233 opt.overcontainer=false; 11234 }); 11235 11236 11237 container.on('mouseover',function() { 11238 container.trigger('tp-mouseover'); 11239 opt.overcontainer=true; 11240 }) 11241 11242 // REMOVE ANY VIDEO JS SETTINGS OF THE VIDEO IF NEEDED (OLD FALL BACK, AND HELP FOR 3THD PARTY PLUGIN CONFLICTS) 11243 container.find('.tp-caption video').each(function(i) { 11244 var v = jQuery(this); 11245 v.removeClass("video-js vjs-default-skin"); 11246 v.attr("preload",""); 11247 v.css({display:"none"}); 11248 }); 11249 11250 //PREPARE LOADINGS ALL IN SEQUENCE 11251 if (opt.sliderType!=="standard") opt.lazyType = "all"; 11252 11253 11254 // PRELOAD STATIC LAYERS 11255 loadImages(container.find('.tp-static-layers'),opt,0); 11256 11257 waitForCurrentImages(container.find('.tp-static-layers img'),opt,function() { 11258 container.find('.tp-static-layers img').each(function() { 11259 var e = jQuery(this), 11260 src = e.data('lazyload') != undefined ? e.data('lazyload') : e.attr('src'), 11261 loadobj = getLoadObj(opt,src); 11262 e.attr('src',loadobj.src) 11263 }) 11264 }) 11265 11266 11267 11268 // SET ALL LI AN INDEX AND INIT LAZY LOADING 11269 opt.li.each(function(i) { 11270 var li = jQuery(this); 11271 11272 if (opt.lazyType=="all" || (opt.lazyType=="smart" && (i==0 || i == 1 || i == opt.slideamount || i == opt.slideamount-1))) { 11273 loadImages(li,opt,i); 11274 waitForCurrentImages(li,opt,function() { 11275 if (opt.sliderType=="carousel") 11276 punchgs.TweenLite.to(li,1,{autoAlpha:1,ease:punchgs.Power3.easeInOut}); 11277 }); 11278 } 11279 11280 }); 11281 11282 11283 11284 // IF DEEPLINK HAS BEEN SET 11285 var deeplink = getUrlVars("#")[0]; 11286 if (deeplink.length<9) { 11287 if (deeplink.split('slide').length>1) { 11288 var dslide=parseInt(deeplink.split('slide')[1],0); 11289 if (dslide<1) dslide=1; 11290 if (dslide>opt.slideamount) dslide=opt.slideamount; 11291 opt.startWithSlide=dslide-1; 11292 } 11293 } 11294 11295 // PREPARE THE SPINNER 11296 container.append( '<div class="tp-loader '+opt.spinner+'">'+ 11297 '<div class="dot1"></div>'+ 11298 '<div class="dot2"></div>'+ 11299 '<div class="bounce1"></div>'+ 11300 '<div class="bounce2"></div>'+ 11301 '<div class="bounce3"></div>'+ 11302 '</div>'); 11303 11304 11305 // RESET THE TIMER 11306 if (container.find('.tp-bannertimer').length===0) container.append('<div class="tp-bannertimer" style="visibility:hidden"></div>'); 11307 container.find('.tp-bannertimer').css({'width':'0%'}); 11308 container.find('.tp-bannertimer').data('opt',opt); 11309 11310 11311 // PREPARE THE SLIDES 11312 opt.ul.css({'display':'block'}); 11313 prepareSlides(container,opt); 11314 if (opt.parallax.type!=="off") _R.checkForParallax(container,opt); 11315 11316 11317 // PREPARE SLIDER SIZE 11318 _R.setSize(opt); 11319 11320 11321 // Call the Navigation Builder 11322 if (opt.sliderType!=="hero") _R.createNavigation(container,opt); 11323 if (_R.resizeThumbsTabs) _R.resizeThumbsTabs(opt); 11324 contWidthManager(opt); 11325 var _v = opt.viewPort; 11326 opt.inviewport = false; 11327 11328 if (_v !=undefined && _v.enable) { 11329 if (!jQuery.isNumeric(_v.visible_area)) 11330 if (_v.visible_area.indexOf('%')!==-1) 11331 _v.visible_area = parseInt(_v.visible_area)/100; 11332 11333 if (_R.scrollTicker) _R.scrollTicker(opt,container); 11334 } 11335 11336 11337 11338 // START THE SLIDER 11339 setTimeout(function() { 11340 if ( opt.sliderType =="carousel") _R.prepareCarousel(opt); 11341 11342 if (!_v.enable || (_v.enable && opt.inviewport) || (_v.enable && !opt.inviewport && !_v.outof=="wait")) { 11343 swapSlide(container,opt); 11344 } 11345 else 11346 opt.waitForFirstSlide = true; 11347 11348 if (_R.manageNavigation) _R.manageNavigation(opt); 11349 11350 11351 // START COUNTDOWN 11352 if (opt.slideamount>1) { 11353 if (!_v.enable || (_v.enable && opt.inviewport)) 11354 countDown(container,opt); 11355 else 11356 opt.waitForCountDown = true; 11357 } 11358 setTimeout(function() { 11359 container.trigger('revolution.slide.onloaded'); 11360 },100); 11361 },opt.startDelay); 11362 opt.startDelay=0; 11363 11364 11365 11366 /****************************** 11367 - FULLSCREEN CHANGE - 11368 ********************************/ 11369 // FULLSCREEN MODE TESTING 11370 jQuery("body").data('rs-fullScreenMode',false); 11371 jQuery(window).on ('mozfullscreenchange webkitfullscreenchange fullscreenchange',function(){ 11372 jQuery("body").data('rs-fullScreenMode',!jQuery("body").data('rs-fullScreenMode')); 11373 if (jQuery("body").data('rs-fullScreenMode')) { 11374 setTimeout(function() { 11375 jQuery(window).trigger("resize"); 11376 },200);
11377 } 11378 }); 11379 11380 var resizid = "resize.revslider-"+container.attr('id'); 11381 11382 // IF RESIZED, NEED TO STOP ACTUAL TRANSITION AND RESIZE ACTUAL IMAGES 11383 jQuery(window).on(resizid,function() { 11384 if (container==undefined) return false; 11385 11386 if (jQuery('body').find(container)!=0) 11387 contWidthManager(opt); 11388 11389 if (container.outerWidth(true)!=opt.width || container.is(":hidden") || (opt.sliderLayout=="fullscreen" && jQuery(window).height()!=opt.lastwindowheight)) { 11390 opt.lastwindowheight = jQuery(window).height(); 11391 containerResized(container,opt); 11392 } 11393 11394 11395 }); 11396 11397 hideSliderUnder(container,opt); 11398 contWidthManager(opt); 11399 if (!opt.fallbacks.disableFocusListener && opt.fallbacks.disableFocusListener != "true" && opt.fallbacks.disableFocusListener !== true) tabBlurringCheck(container,opt); 11400 } 11401} 11402 11403/************************************* 11404 - CREATE SIMPLE ARRAYS - 11405**************************************/ 11406var cArray = function(b,l) { 11407 if (!jQuery.isArray(b)) { 11408 var t = b; 11409 b = new Array(); 11410 b.push(t); 11411 } 11412 if (b.length<l) { 11413 var t = b[b.length-1]; 11414 for (var i=0;i<(l-b.length)+2;i++) 11415 b.push(t) 11416 } 11417 return b; 11418} 11419 11420 11421 11422var checkHoverDependencies = function(_nc,opt) { 11423 11424 if (_nc.data('start')==="sliderenter") { 11425 if (opt.layersonhover===undefined) { 11426 opt.c.on('tp-mouseenter',function() { 11427 if (opt.layersonhover) 11428 jQuery.each(opt.layersonhover,function(i,tnc) { 11429 tnc.data('animdirection',"in"); 11430 var otl = tnc.data('timeline_out'), 11431 base_offsetx = opt.sliderType==="carousel" ? 0 : opt.width/2 - (opt.gridwidth[opt.curWinRange]*opt.bw)/2, 11432 base_offsety=0, 11433 cli = tnc.closest('.tp-revslider-slidesli'); 11434 11435 if (cli.hasClass("active-revslide") || cli.hasClass("processing-revslide")) { 11436 11437 if (otl!=undefined) { 11438 otl.pause(0); 11439 otl.kill(); 11440 } 11441 _R.animateSingleCaption(tnc,opt,base_offsetx,base_offsety,0,false,true); 11442 var tl = tnc.data('timeline'); 11443 tnc.data('triggerstate',"on"); 11444 tl.play(0); 11445 } 11446 }); 11447 }); 11448 opt.c.on('tp-mouseleft',function() { 11449 if (opt.layersonhover) 11450 jQuery.each(opt.layersonhover,function(i,tnc) { 11451 tnc.data('animdirection',"out"); 11452 tnc.data('triggered',true); 11453 tnc.data('triggerstate',"off"); 11454 if (_R.stopVideo) _R.stopVideo(tnc,opt); 11455 if (_R.endMoveCaption) _R.endMoveCaption(tnc,null,null,opt); 11456 }); 11457 }); 11458 opt.layersonhover = new Array; 11459 } 11460 opt.layersonhover.push(_nc); 11461 } 11462} 11463 11464 11465 11466var contWidthManager = function(opt) { 11467 11468 var rl = _R.getHorizontalOffset(opt.c,"left"); 11469 11470 if (opt.sliderLayout!="auto" && (opt.sliderLayout!=="fullscreen" || opt.fullScreenAutoWidth!="on")) { 11471 var loff = Math.ceil(opt.c.closest('.forcefullwidth_wrapper_tp_banner').offset().left - rl); 11472 punchgs.TweenLite.set(opt.c.parent(),{'left':(0-loff)+"px",'width':jQuery(window).width()-_R.getHorizontalOffset(opt.c,"both")}); 11473 } else { 11474 if (opt.sliderLayout=="fullscreen" && opt.fullScreenAutoWidth=="on") 11475 punchgs.TweenLite.set(opt.ul,{left:0,width:opt.c.width()}); 11476 else 11477 punchgs.TweenLite.set(opt.ul,{left:rl,width:opt.c.width()-_R.getHorizontalOffset(opt.c,"both")}); 11478 } 11479 11480 11481 // put Static Layer Wrapper in Position 11482 if (opt.slayers && (opt.sliderLayout!="fullwidth" && opt.sliderLayout!="fullscreen")) 11483 punchgs.TweenLite.set(opt.slayers,{left:rl}); 11484} 11485 11486 11487var cv = function(a,d) { 11488 return a===undefined ? d : a; 11489} 11490 11491 11492var hideSliderUnder = function(container,opt,resized) { 11493 // FIRST TIME STOP/START HIDE / SHOW SLIDER 11494 //REMOVE AND SHOW SLIDER ON DEMAND 11495 var contpar= container.parent(); 11496 if (jQuery(window).width()<opt.hideSliderAtLimit) { 11497 container.trigger('stoptimer'); 11498 if (contpar.css('display')!="none") 11499 contpar.data('olddisplay',contpar.css('display')); 11500 contpar.css({display:"none"}); 11501 } else { 11502 if (container.is(":hidden") && resized) { 11503 if (contpar.data('olddisplay')!=undefined && contpar.data('olddisplay')!="undefined" && contpar.data('olddisplay') != "none") 11504 contpar.css({display:contpar.data('olddisplay')}); 11505 else 11506 contpar.css({display:"block"}); 11507 container.trigger('restarttimer'); 11508 setTimeout(function() { 11509 containerResized(container,opt); 11510 },150) 11511 } 11512 } 11513 if (_R.hideUnHideNav) _R.hideUnHideNav(opt); 11514} 11515 11516 11517////////////////////////// 11518// CONTAINER RESIZED // 11519///////////////////////// 11520var containerResized = function (c,opt) { 11521 if (opt.infullscreenmode == true) 11522 opt.minHeight = jQuery(window).height(); 11523 11524 11525 setCurWinRange(opt); 11526 setCurWinRange(opt,true); 11527 if (!_R.resizeThumbsTabs || _R.resizeThumbsTabs(opt)===true) { 11528 11529 hideSliderUnder(c,opt,true); 11530 contWidthManager(opt); 11531 11532 if ( opt.sliderType =="carousel") _R.prepareCarousel(opt,true); 11533 11534 if (c===undefined) return false; 11535 11536 _R.setSize(opt); 11537 11538 opt.conw = opt.c.width(); 11539 opt.conh = opt.infullscreenmode ? opt.minHeight : opt.c.height(); 11540 11541 11542 var actsh = c.find('.active-revslide .slotholder'), 11543 nextsh = c.find('.processing-revslide .slotholder'); 11544 11545 removeSlots(c,opt,c,2); 11546 11547 if (opt.sliderType==="standard") { 11548 punchgs.TweenLite.set(nextsh.find('.defaultimg'),{opacity:0}
11548); 11549 actsh.find('.defaultimg').css({'opacity':1}); 11550 } 11551 11552 11553 if ( opt.sliderType =="carousel" && opt.lastconw != opt.conw) { 11554 clearTimeout(opt.pcartimer); 11555 opt.pcartimer = setTimeout(function() { 11556 _R.prepareCarousel(opt,true); 11557 },100); 11558 opt.lastconw = opt.conw; 11559 } 11560 11561 if (_R.manageNavigation) _R.manageNavigation(opt); 11562 11563 11564 if (_R.animateTheCaptions) _R.animateTheCaptions(c.find('.active-revslide'), opt,true); 11565 11566 if (nextsh.data('kenburns')=="on") 11567 _R.startKenBurn(nextsh,opt,nextsh.data('kbtl').progress()); 11568 11569 if (actsh.data('kenburns')=="on") 11570 _R.startKenBurn(actsh,opt,actsh.data('kbtl').progress()); 11571 11572 // DOUBLE CALL FOR SOME FUNCTION TO AVOID PORTRAIT/LANDSCAPE ISSUES, AND TO AVOID FULLSCREEN/NORMAL SWAP ISSUES 11573 if (_R.animateTheCaptions) _R.animateTheCaptions(nextsh.closest('li'), opt,true); 11574 if (_R.manageNavigation) _R.manageNavigation(opt); 11575 11576 } 11577} 11578 11579 11580 11581 11582 11583 11584//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 11585/////////////////////////////////////////////////////////////////////////////// PREPARING / REMOVING //////////////////////////////////////////////////////// 11586//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 11587var setScale = function(opt) { 11588 opt.bw = (opt.width / opt.gridwidth[opt.curWinRange]); 11589 opt.bh = (opt.height / opt.gridheight[opt.curWinRange]); 11590 11591 11592 if (opt.bh>opt.bw) 11593 opt.bh=opt.bw 11594 else 11595 opt.bw = opt.bh; 11596 11597 if (opt.bh>1 || opt.bw>1) { opt.bw=1; opt.bh=1; } 11598} 11599 11600 11601 11602 11603 11604///////////////////////////////////////// 11605// - PREPARE THE SLIDES / SLOTS - // 11606/////////////////////////////////////// 11607var prepareSlides = function(container,opt) { 11608 11609 container.find('.tp-caption').each(function() { 11610 var c = jQuery(this); 11611 if (c.data('transition')!==undefined) c.addClass(c.data('transition')); 11612 }); 11613 11614 // PREPARE THE UL CONTAINER TO HAVEING MAX HEIGHT AND HEIGHT FOR ANY SITUATION 11615 opt.ul.css({overflow:'hidden',width:'100%',height:'100%',maxHeight:container.parent().css('maxHeight')}) 11616 if (opt.autoHeight=="on") { 11617 opt.ul.css({overflow:'hidden',width:'100%',height:'100%',maxHeight:"none"}); 11618 container.css({'maxHeight':'none'}); 11619 container.parent().css({'maxHeight':'none'}); 11620 } 11621 //_R.setSize("",opt); 11622 opt.li.each(function(j) { 11623 var li=jQuery(this), 11624 originalIndex = li.data('originalindex'); 11625 11626 //START WITH CORRECT SLIDE 11627 if ((opt.startWithSlide !=undefined && originalIndex==opt.startWithSlide) || opt.startWithSlide ===undefined && j==0) 11628 li.addClass("next-revslide"); 11629 11630 11631 // MAKE LI OVERFLOW HIDDEN FOR FURTHER ISSUES 11632 li.css({'width':'100%','height':'100%','overflow':'hidden'}); 11633 11634 }); 11635 11636 if (opt.sliderType === "carousel") { 11637 //SET CAROUSEL 11638 opt.ul.css({overflow:"visible"}).wrap('<div class="tp-carousel-wrapper" style="width:100%;height:100%;position:absolute;top:0px;left:0px;overflow:hidden;"></div>'); 11639 var apt = '<div style="clear:both;display:block;width:100%;height:1px;position:relative;margin-bottom:-1px"></div>'; 11640 opt.c.parent().prepend(apt); 11641 opt.c.parent().append(apt); 11642 _R.prepareCarousel(opt); 11643 } 11644 11645 // RESOLVE OVERFLOW HIDDEN OF MAIN CONTAINER 11646 container.parent().css({'overflow':'visible'}); 11647 11648 11649 opt.li.find('>img').each(function(j) { 11650 11651 var img=jQuery(this), 11652 bgvid = img.closest('li').find('.rs-background-video-layer'); 11653 11654 bgvid.addClass("defaultvid").css({zIndex:30}); 11655 11656 img.addClass('defaultimg'); 11657 11658 // TURN OF KEN BURNS IF WE ARE ON MOBILE AND IT IS WISHED SO 11659 if (opt.fallbacks.panZoomDisableOnMobile == "on" && _ISM) { 11660 img.data('kenburns',"off"); 11661 img.data('bgfit',"cover"); 11662 } 11663 11664 img.wrap('<div class="slotholder" style="width:100%;height:100%;"></div>'); 11665 bgvid.appendTo(img.closest('li').find('.slotholder')); 11666 var dts = img.data(); 11667 img.closest('.slotholder').data(dts); 11668 11669 if (bgvid.length>0 && dts.bgparallax!=undefined) 11670 bgvid.data('bgparallax',dts.bgparallax); 11671 11672 if (opt.dottedOverlay!="none" && opt.dottedOverlay!=undefined) 11673 img.closest('.slotholder').append('<div class="tp-dottedoverlay '+opt.dottedOverlay+'"></div>'); 11674 11675 var src=img.attr('src'); 11676 dts.src = src; 11677 dts.bgfit = dts.bgfit || "cover"; 11678 dts.bgrepeat = dts.bgrepeat || "no-repeat", 11679 dts.bgposition = dts.bgposition || "center center"; 11680 11681 var pari = img.closest('.slotholder'); 11682 img.parent().append('<div class="tp-bgimg defaultimg" style="background-color:'+img.css("backgroundColor")+';background-repeat:'+dts.bgrepeat+';background-image:url('+src+');background-size:'+dts.bgfit+';background-position:'+dts.bgposition+';width:100%;height:100%;"></div>'); 11683 var comment = document.createComment("Runtime Modification - Img tag is Still Available for SEO Goals in Source - " + img.get(0).outerHTML); 11684 img.replaceWith(comment); 11685 img = pari.find('.tp-bgimg'); 11686 img.data(dts); 11687 img.attr("src",src); 11688 11689 if (opt.sliderType === "standard" || opt.sliderType==="undefined") 11690 img.css({'opacity':0}); 11691 11692 }) 11693 11694 11695} 11696 11697 11698// REMOVE SLOTS // 11699var removeSlots = function(container,opt,where,addon) { 11700 opt.removePrepare = opt.removePrepare + addon; 11701 where.find('.slot, .slot-circle-wrapper').each(function() { 11702 jQuery(this).remove(); 11703 }); 11704 opt.transition = 0; 11705 opt.removePrepare = 0; 11706} 11707 11708 11709////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
11710/////////////////////////////////////////////////////////////////////////////// SLIDE SWAPS //////////////////////////////////////////////////////////// 11711//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 11712 11713 11714// THE IMAGE IS LOADED, WIDTH, HEIGHT CAN BE SAVED 11715var cutParams = function(a) { 11716 var b = a; 11717 if (a!=undefined && a.length>0) 11718 b = a.split("?")[0]; 11719 return b; 11720} 11721 11722var relativeRedir = function(redir){ 11723 return location.pathname.replace(/(.*)\/[^/]*/, "$1/"+redir); 11724} 11725 11726var abstorel = function (base, relative) { 11727 var stack = base.split("/"), 11728 parts = relative.split("/"); 11729 stack.pop(); // remove current file name (or empty string) 11730 // (omit if "base" is the current folder without trailing slash) 11731 for (var i=0; i<parts.length; i++) { 11732 if (parts[i] == ".") 11733 continue; 11734 if (parts[i] == "..") 11735 stack.pop(); 11736 else 11737 stack.push(parts[i]); 11738 } 11739 return stack.join("/"); 11740} 11741 11742var imgLoaded = function(img,opt,progress) { 11743 opt.syncload--; 11744 if (opt.loadqueue) 11745 jQuery.each(opt.loadqueue, function(index,queue) { 11746 11747 var mqsrc = queue.src.replace(/\.\.\/\.\.\//gi,""), 11748 fullsrc = self.location.href, 11749 origin = document.location.origin, 11750 fullsrc_b = fullsrc.substring(0,fullsrc.length-1)+"/"+mqsrc, 11751 origin_b = origin+"/"+mqsrc, 11752 absolute = abstorel(self.location.href,queue.src); 11753 11754 fullsrc = fullsrc.substring(0,fullsrc.length-1)+mqsrc; 11755 origin = origin+mqsrc; 11756 11757 if (cutParams(origin) === cutParams(decodeURIComponent(img.src)) || 11758 cutParams(fullsrc)=== cutParams(decodeURIComponent(img.src)) || 11759 cutParams(absolute)=== cutParams(decodeURIComponent(img.src)) || 11760 cutParams(origin_b) === cutParams(decodeURIComponent(img.src)) || 11761 cutParams(fullsrc_b)=== cutParams(decodeURIComponent(img.src)) || 11762 cutParams(queue.src) === cutParams(decodeURIComponent(img.src)) || 11763 cutParams(queue.src).replace(/^.*\/\/[^\/]+/, '') === cutParams(decodeURIComponent(img.src)).replace(/^.*\/\/[^\/]+/, '') || 11764 (window.location.origin==="file://" && cutParams(img.src).match(new RegExp(mqsrc)))) { 11765 queue.progress = progress; 11766 queue.width = img.width; 11767 queue.height = img.height; 11768 } 11769 }); 11770 progressImageLoad(opt); 11771} 11772 11773// PRELOAD IMAGES 3 PIECES ON ONE GO, CHECK LOAD PRIORITY 11774var progressImageLoad = function(opt) { 11775 if (opt.syncload == 3) return; 11776 if (opt.loadqueue) 11777 jQuery.each(opt.loadqueue, function(index,queue) { 11778 if (queue.progress.match(/prepared/g)) { 11779 if (opt.syncload<=3) { 11780 opt.syncload++; 11781 var img = new Image(); 11782 11783 img.onload = function() { 11784 imgLoaded(this,opt,"loaded"); 11785 }; 11786 img.onerror = function() { 11787 imgLoaded(this,opt,"failed"); 11788 }; 11789 img.src=queue.src; 11790 queue.progress="inload"; 11791 } 11792 } 11793 }); 11794} 11795 11796// ADD TO QUEUE THE NOT LOADED IMAGES YES 11797var addToLoadQueue = function(src,opt,prio) { 11798 var alreadyexist = false; 11799 if (opt.loadqueue) 11800 jQuery.each(opt.loadqueue, function(index,queue) { 11801 if (queue.src === src) alreadyexist = true; 11802 }); 11803 11804 11805 if (!alreadyexist) { 11806 var loadobj = new Object(); 11807 loadobj.src = src; 11808 loadobj.prio = prio; 11809 loadobj.progress = "prepared"; 11810 opt.loadqueue.push(loadobj); 11811 } 11812 11813} 11814 11815// LOAD THE IMAGES OF THE PREDEFINED CONTAINER 11816var loadImages = function(container,opt,prio) { 11817 11818 container.find('img,.defaultimg').each(function() { 11819 var element = jQuery(this), 11820 src = element.data('lazyload') !== undefined && element.data('lazyload')!=="undefined" ? element.data('lazyload') : element.attr('src'); 11821 11822 element.data('start-to-load',jQuery.now()); 11823 addToLoadQueue(src,opt,prio); 11824 }); 11825 progressImageLoad(opt); 11826} 11827 11828// FIND SEARCHED IMAGE IN THE LOAD QUEUE 11829var getLoadObj = function(opt,src) { 11830 var obj = new Object(); 11831 if (opt.loadqueue) 11832 jQuery.each(opt.loadqueue, function(index,queue) { 11833 if (queue.src == src) obj = queue; 11834 }); 11835 return obj;
11836} 11837 11838// WAIT PROGRESS TILL THE PREDEFINED CONTAINER HAS ALL IMAGES LOADED INSIDE 11839var waitForCurrentImages = function(nextli,opt,callback) { 11840 11841 var waitforload = false; 11842 nextli.find('img,.defaultimg').each(function() { 11843 var element = jQuery(this), 11844 src = element.data('lazyload') != undefined ? element.data('lazyload') : element.attr('src'), 11845 loadobj = getLoadObj(opt,src); 11846 11847 11848 // IF ELEMENTS IS NOT LOADED YET, AND IT IS NOW LOADED 11849 if (element.data('loaded')===undefined && loadobj !==undefined && loadobj.progress && loadobj.progress.match(/loaded/g)) { 11850 11851 element.attr('src',loadobj.src); 11852 // IF IT IS A DEFAULT IMG, WE NEED TO ASSIGN SOME SPECIAL VALUES TO IT 11853 if (element.hasClass("defaultimg")) { 11854 if (!_R.isIE(8)) 11855 element.css({backgroundImage:'url("'+loadobj.src+'")'}); 11856 else { 11857 defimg.attr('src',loadobj.src); 11858 } 11859 nextli.data('owidth',loadobj.width); 11860 nextli.data('oheight',loadobj.height); 11861 nextli.find('.slotholder').data('owidth',loadobj.width); 11862 nextli.find('.slotholder').data('oheight',loadobj.height); 11863 } else { 11864 var w = element.data('ww'), 11865 h = element.data('hh'); 11866 11867 element.data('owidth',loadobj.width); 11868 element.data('oheight',loadobj.height); 11869 11870 w = w==undefined || w =="auto" || w=="" ? loadobj.width : w; 11871 h = h==undefined || h =="auto" || h=="" ? loadobj.height : h; 11872 11873 11874 element.data('ww',w); 11875 element.data('hh',h); 11876 11877 } 11878 // ELEMENT IS NOW FULLY LOADED 11879 element.data('loaded',true); 11880 } 11881 11882 11883 if (loadobj && loadobj.progress && loadobj.progress.match(/inprogress|inload|prepared/g)) 11884 if (jQuery.now()-element.data('start-to-load')<5000) 11885 waitforload = true; 11886 else 11887 console.error(src+" Could not be loaded !"); 11888 11889 // WAIT FOR VIDEO API'S 11890 if (opt.youtubeapineeded == true && (!window['YT'] || YT.Player==undefined)) { 11891 waitforload = true; 11892 if (jQuery.now()-opt.youtubestarttime>5000 && opt.youtubewarning!=true) { 11893 opt.youtubewarning = true; 11894 var txt = "YouTube Api Could not be loaded !"; 11895 if (location.protocol === 'https:') txt = txt + " Please Check and Renew SSL Certificate !"; 11896 console.error(txt); 11897 opt.c.append('<div style="position:absolute;top:50%;width:100%;color:#e74c3c; font-size:16px; text-align:center; padding:15px;background:#000; display:block;"><strong>'+txt+'</strong></div>') 11898 } 11899 } 11900 11901 if (opt.vimeoapineeded == true && !window['Froogaloop']) { 11902 waitforload = true; 11903 if (jQuery.now()-opt.vimeostarttime>5000 && opt.vimeowarning!=true) { 11904 opt.vimeowarning= true; 11905 var txt = "Vimeo Froogaloop Api Could not be loaded !"; 11906 if (location.protocol === 'https:') txt = txt + " Please Check and Renew SSL Certificate !"; 11907 console.error(txt); 11908 opt.c.append('<div style="position:absolute;top:50%;width:100%;color:#e74c3c; font-size:16px; text-align:center; padding:15px;background:#000; display:block;"><strong>'+txt+'</strong></div>') 11909 } 11910 } 11911 }); 11912 11913 11914 if (waitforload) 11915 setTimeout(function() { 11916 waitForCurrentImages(nextli,opt,callback) ; 11917 },19); 11918 else 11919 callback(); 11920 11921} 11922 11923 11924////////////////////////////////////// 11925// - CALL TO SWAP THE SLIDES - // 11926///////////////////////////////////// 11927var swapSlide = function(container,opt) { 11928 11929 clearTimeout(opt.waitWithSwapSlide); 11930 11931 11932 11933 if (container.find('.processing-revslide').length>0) { 11934 opt.waitWithSwapSlide = setTimeout(function() { 11935 swapSlide(container,opt); 11936 11937 },150); 11938 return false; 11939 } 11940 11941 var actli = container.find('.active-revslide'), 11942 nextli = container.find('.next-revslide'), 11943 defimg= nextli.find('.defaultimg'); 11944 11945 11946 if (nextli.index() === actli.index()) { 11947 nextli.removeClass("next-revslide"); 11948 return false; 11949 } 11950 nextli.removeClass("next-revslide").addClass("processing-revslide"); 11951 11952 nextli.data('slide_on_focus_amount',(nextli.data('slide_on_focus_amount')+1) || 1); 11953 // CHECK IF WE ARE ALREADY AT LAST ITEM TO PLAY IN REAL LOOP SESSION 11954 if (opt.stopLoop=="on" && nextli.index()==opt.lastslidetoshow-1) { 11955 container.find('.tp-bannertimer').css({'visibility':'hidden'}); 11956 container.trigger('revolution.slide.onstop'); 11957 opt.noloopanymore = 1; 11958 } 11959 11960 // INCREASE LOOP AMOUNTS 11961 if (nextli.index()===opt.slideamount-1) { 11962 opt.looptogo=opt.looptogo-1; 11963 if (opt.looptogo<=0) 11964 opt.stopLoop="on"; 11965 } 11966 11967 opt.tonpause = true; 11968 container.trigger('stoptimer'); 11969 opt.cd=0; 11970 if (opt.spinner==="off")
11971 container.find('.tp-loader').css({display:"none"}); 11972 else 11973 container.find('.tp-loader').css({display:"block"}); 11974 11975 11976 loadImages(nextli,opt,1); 11977 11978 11979 // WAIT FOR SWAP SLIDE PROGRESS 11980 waitForCurrentImages(nextli,opt,function() { 11981 11982 11983 // MANAGE BG VIDEOS 11984 nextli.find('.rs-background-video-layer').each(function() { 11985 var _nc = jQuery(this); 11986 if (!_nc.hasClass("HasListener")) { 11987 _nc.data('bgvideo',1); 11988 _R.manageVideoLayer(_nc,opt); 11989 } 11990 if (_nc.find('.rs-fullvideo-cover').length==0) 11991 _nc.append('<div class="rs-fullvideo-cover"></div>') 11992 }); 11993 swapSlideProgress(opt,defimg,container) 11994 }); 11995 11996} 11997 11998////////////////////////////////////// 11999// - PROGRESS SWAP THE SLIDES - // 12000///////////////////////////////////// 12001var swapSlideProgress = function(opt,defimg,container) { 12002 12003 var actli = container.find('.active-revslide'), 12004 nextli = container.find('.processing-revslide'), 12005 actsh = actli.find('.slotholder'), 12006 nextsh = nextli.find('.slotholder'); 12007 opt.tonpause = false; 12008 opt.cd=0; 12009 container.trigger('nulltimer'); 12010 12011 12012 container.find('.tp-loader').css({display:"none"}); 12013 // if ( opt.sliderType =="carousel") _R.prepareCarousel(opt); 12014 _R.setSize(opt); 12015 _R.slotSize(defimg,opt); 12016 12017 if (_R.manageNavigation) _R.manageNavigation(opt); 12018 var data={}; 12019 data.nextslide=nextli; 12020 data.currentslide=actli; 12021 container.trigger('revolution.slide.onbeforeswap',data); 12022 12023 opt.transition = 1; 12024 opt.videoplaying = false; 12025 12026 // IF DELAY HAS BEEN SET VIA THE SLIDE, WE TAKE THE NEW VALUE, OTHER WAY THE OLD ONE... 12027 if (nextli.data('delay')!=undefined) { 12028 opt.cd=0; 12029 opt.delay=nextli.data('delay'); 12030 } else 12031 opt.delay=opt.origcd; 12032 12033 12034 var ai = actli.index(), 12035 ni = nextli.index(); 12036 opt.sdir = ni<ai ? 1 : 0; 12037 12038 if (opt.sc_indicator=="arrow") { 12039 if (ai==0 && ni==opt.slideamount-1) opt.sdir = 1; 12040 if (ai==opt.slideamount-1 && ni==0) opt.sdir = 0; 12041 } 12042 12043 opt.lsdir = opt.lsdir === undefined ? opt.sdir : opt.lsdir; 12044 opt.dirc = opt.lsdir != opt.sdir; 12045 opt.lsdir = opt.sdir; 12046 12047 /////////////////////////// 12048 // REMOVE THE CAPTIONS // 12049 /////////////////////////// 12050 12051 12052 12053 if (actli.index() != nextli.index() && opt.firststart!=1) 12054 if (_R.removeTheCaptions) _R.removeTheCaptions(actli,opt); 12055 12056 12057 if (!nextli.hasClass('rs-pause-timer-once') && !nextli.hasClass("rs-pause-timer-always")) 12058 container.trigger('restarttimer'); 12059 else 12060 opt.videoplaying = true; 12061 12062 nextli.removeClass("rs-pause-timer-once"); 12063 12064 var nexttrans, 12065 direction=-1, 12066 mtl; 12067 12068 // SELECT SLIDER TYPE 12069 if ( opt.sliderType =="carousel") { 12070 mtl = new punchgs.TimelineLite(); 12071 _R.prepareCarousel(opt,mtl); 12072 letItFree(container,opt,nextsh,actsh,nextli,actli,mtl); 12073 opt.transition = 0; 12074 opt.firststart = 0; 12075 } else { 12076 mtl = new punchgs.TimelineLite({onComplete:function() { 12077 letItFree(container,opt,nextsh,actsh,nextli,actli,mtl); 12078 }}); 12079 mtl.add(punchgs.TweenLite.set(nextsh.find('.defaultimg'),{opacity:0})); 12080 mtl.pause(); 12081 12082 if (opt.firststart==1) { 12083 punchgs.TweenLite.set(actli,{autoAlpha:0}); 12084 opt.firststart=0; 12085 } 12086 12087 12088 punchgs.TweenLite.set(actli,{zIndex:18}); 12089 punchgs.TweenLite.set(nextli,{autoAlpha:0,zIndex:20}); 12090 12091 12092 // IF THERE IS AN OTHER FIRST SLIDE START HAS BEED SELECTED 12093 if (nextli.data('differentissplayed') =='prepared') { 12094 nextli.data('differentissplayed','done'); 12095 nextli.data('transition',nextli.data('savedtransition')); 12096 nextli.data('slotamount',nextli.data('savedslotamount')); 12097 nextli.data('masterspeed',nextli.data('savedmasterspeed')); 12098 } 12099 12100 12101 if (nextli.data('fstransition') != undefined && nextli.data('differentissplayed') !="done") { 12102 12103 nextli.data('savedtransition',nextli.data('transition')); 12104 nextli.data('savedslotamount',nextli.data('slotamount')); 12105 nextli.data('savedmasterspeed',nextli.data('masterspeed')); 12106 nextli.data('transition',nextli.data('fstransition')); 12107 nextli.data('slotamount',nextli.data('fsslotamount')); 12108 nextli.data('masterspeed',nextli.data('fsmasterspeed')); 12109 nextli.data('differentissplayed','prepared'); 12110 } 12111 12112 if (nextli.data('transition')==undefined) nextli.data('transition',"random"); 12113 12114 nexttrans = 0; 12115 var transtext = nextli.data('transition') !== undefined ? nextli.data('transition').split(",") : "fade", 12116 curtransid = nextli.data('nexttransid') == undefined ? -1 : nextli.data('nexttransid'); 12117 if (nextli.data('randomtransition')=="on") 12118 curtransid = Math.round(Math.random()*transtext.length); 12119 else 12120 curtransid=curtransid+1; 12121 12122 if (curtransid==transtext.length) curtransid=0; 12123 nextli.data('nexttransid',curtransid); 12124 12125 var comingtransition = transtext[curtransid]; 12126 12127 if (opt.ie) {
12128 if (comingtransition=="boxfade") comingtransition = "boxslide"; 12129 if (comingtransition=="slotfade-vertical") comingtransition = "slotzoom-vertical"; 12130 if (comingtransition=="slotfade-horizontal") comingtransition = "slotzoom-horizontal"; 12131 } 12132 12133 if (_R.isIE(8)) 12134 comingtransition = 11; 12135 12136 12137 12138 mtl = _R.animateSlide(nexttrans, comingtransition, container, opt, nextli, actli, nextsh, actsh, mtl); 12139 if (nextsh.data('kenburns')=="on") { 12140 _R.startKenBurn(nextsh,opt); 12141 mtl.add(punchgs.TweenLite.set(nextsh,{autoAlpha:0})) 12142 } 12143 12144 // SHOW FIRST LI && ANIMATE THE CAPTIONS 12145 mtl.pause(); 12146 } 12147 12148 if (_R.scrollHandling) { 12149 _R.scrollHandling(opt, true); 12150 mtl.eventCallback("onUpdate",function() { 12151 _R.scrollHandling(opt, true); 12152 }); 12153 } 12154 12155 // START PARALLAX IF NEEDED 12156 if (opt.parallax.type!="off" && opt.parallax.firstgo==undefined && _R.scrollHandling) { 12157 opt.parallax.firstgo = true; 12158 opt.lastscrolltop = -999; 12159 _R.scrollHandling(opt,true); 12160 setTimeout(function() { 12161 opt.lastscrolltop = -999; 12162 _R.scrollHandling(opt,true); 12163 },210); 12164 setTimeout(function() { 12165 opt.lastscrolltop = -999; 12166 _R.scrollHandling(opt,true); 12167 },420); 12168 } 12169 12170 12171 if (_R.animateTheCaptions) { 12172 _R.animateTheCaptions(nextli, opt,null,mtl); 12173 } else { 12174 if (mtl != undefined) setTimeout(function() { 12175 mtl.resume(); 12176 },30); 12177 } 12178 punchgs.TweenLite.to(nextli,0.001,{autoAlpha:1}); 12179 12180 12181 //if (_R.callStaticDDDParallax) _R.callStaticDDDParallax(container,opt,nextli); 12182 12183} 12184 12185 12186////////////////////////////////////////// 12187// GIVE FREE THE TRANSITIOSN // 12188////////////////////////////////////////// 12189var letItFree = function(container,opt,nextsh,actsh,nextli,actli,mtl) { 12190 12191 if (opt.sliderType==="carousel") { 12192 // CAROUSEL SLIDER 12193 } else { 12194 opt.removePrepare = 0; 12195 punchgs.TweenLite.to(nextsh.find('.defaultimg'),0.001,{zIndex:20,autoAlpha:1,onComplete:function() { 12196 removeSlots(container,opt,nextli,1); 12197 12198 }}); 12199 if (nextli.index()!=actli.index()) { 12200 punchgs.TweenLite.to(actli,0.2,{zIndex:18,autoAlpha:0,onComplete:function() { 12201 removeSlots(container,opt,actli,1); 12202 }}); 12203 } 12204 } 12205 12206 12207 container.find('.active-revslide').removeClass("active-revslide"); 12208 container.find('.processing-revslide').removeClass("processing-revslide").addClass("active-revslide"); 12209 opt.act=nextli.index(); 12210 12211 12212 if (opt.parallax.type=="scroll" || opt.parallax.type=="scroll+mouse" || opt.parallax.type=="mouse+scroll") { 12213 opt.lastscrolltop = -999; 12214 _R.scrollHandling(opt); 12215 } 12216 12217 mtl.clear(); 12218 12219 12220 if (actsh.data('kbtl')!=undefined) { 12221 actsh.data('kbtl').reverse(); 12222 actsh.data('kbtl').timeScale(25); 12223 } 12224 if (nextsh.data('kenburns')=="on") { 12225 if (nextsh.data('kbtl')!=undefined) { 12226 nextsh.data('kbtl').timeScale(1); 12227 nextsh.data('kbtl').play(); 12228 } 12229 else 12230 _R.startKenBurn(nextsh,opt); 12231 } 12232 12233 nextli.find('.rs-background-video-layer').each(function(i) { 12234 if (_ISM) return false; 12235 var _nc = jQuery(this) 12236 _R.resetVideo(_nc,opt); 12237 12238 punchgs.TweenLite.fromTo(_nc,1,{autoAlpha:0},{autoAlpha:1,ease:punchgs.Power3.easeInOut,delay:0.2,onComplete:function() { 12239 if (_R.animcompleted) _R.animcompleted(_nc,opt); 12240 }}); 12241 }); 12242 12243 12244 actli.find('.rs-background-video-layer').each(function(i) { 12245 if (_ISM) return false; 12246 var _nc = jQuery(this); 12247 if (_R.stopVideo) { 12248 _R.resetVideo(_nc,opt); 12249 _R.stopVideo(_nc,opt); 12250 } 12251 punchgs.TweenLite.to(_nc,1,{autoAlpha:0,ease:punchgs.Power3.easeInOut,delay:0.2}); 12252 }); 12253 // TIRGGER THE ON CHANGE EVENTS 12254 var data={}; 12255 data.slideIndex=nextli.index()+1; 12256 data.slideLIIndex=nextli.index(); 12257 data.slide = nextli; 12258 data.currentslide=nextli; 12259 data.prevslide = actli; 12260 container.trigger('revolution.slide.onchange',data); 12261 container.trigger('revolution.slide.onafterswap',data); 12262 12263 opt.duringslidechange = false; 12264 12265 var lastSlideLoop = actli.data('slide_on_focus_amount'), 12266 lastSlideMaxLoop = actli.data('hideafterloop'); 12267 if (lastSlideMaxLoop!=0 && lastSlideMaxLoop<=lastSlideLoop) { 12268 opt.c.revremoveslide(actli.index()); 12269 } 12270 //if (_R.callStaticDDDParallax) _R.callStaticDDDParallax(container,opt,nextli); 12271 12272} 12273 12274 12275 12276 12277 12278/////////////////////////// 12279// REMOVE THE LISTENERS // 12280/////////////////////////// 12281var removeAllListeners = function(container,opt) { 12282 container.children().each(function() { 12283 try{ jQuery(this).die('click'); } catch(e) {} 12284 try{ jQuery(this).die('mouseenter');} catch(e) {} 12285 try{ jQuery(this).die('mouseleave');} catch(e) {} 12286 try{ jQuery(this).unbind('hover');} catch(e) {} 12287 }) 12288 try{ container.die('click','mouseenter','mouseleave');} catch(e) {} 12289 clearInterval(opt.cdint); 12290 container=null; 12291} 12292 12293/////////////////////////// 12294// - countDown - // 12295///////////////////////// 12296var countDown = function(container,opt) { 12297 opt.cd=0; 12298 opt.loop=0; 12299 if (opt.stopAfterLoops!=undefined && opt.stopAfterLoops>-1) 12300 opt.looptogo=opt.stopAfterLoops; 12301 else
12302 opt.looptogo=9999999; 12303 12304 if (opt.stopAtSlide!=undefined && opt.stopAtSlide>-1) 12305 opt.lastslidetoshow=opt.stopAtSlide; 12306 else 12307 opt.lastslidetoshow=999; 12308 12309 opt.stopLoop="off"; 12310 12311 if (opt.looptogo==0) opt.stopLoop="on"; 12312 12313 12314 var bt=container.find('.tp-bannertimer'); 12315 12316 // LISTENERS //container.trigger('stoptimer'); 12317 container.on('stoptimer',function() { 12318 var bt = jQuery(this).find('.tp-bannertimer'); 12319 bt.data('tween').pause(); 12320 if (opt.disableProgressBar=="on") bt.css({visibility:"hidden"}); 12321 opt.sliderstatus = "paused"; 12322 _R.unToggleState(opt.slidertoggledby); 12323 }); 12324 12325 12326 container.on('starttimer',function() { 12327 if (opt.conthover!=1 && opt.videoplaying!=true && opt.width>opt.hideSliderAtLimit && opt.tonpause != true && opt.overnav !=true) 12328 if (opt.noloopanymore !== 1 && (!opt.viewPort.enable || opt.inviewport)) { 12329 bt.css({visibility:"visible"}); 12330 bt.data('tween').resume(); 12331 opt.sliderstatus = "playing"; 12332 } 12333 12334 if (opt.disableProgressBar=="on") bt.css({visibility:"hidden"}); 12335 _R.toggleState(opt.slidertoggledby); 12336 }); 12337 12338 12339 container.on('restarttimer',function() { 12340 12341 var bt = jQuery(this).find('.tp-bannertimer'); 12342 if (opt.mouseoncontainer && opt.navigation.onHoverStop=="on" && (!_ISM)) return false; 12343 if (opt.noloopanymore !== 1 && (!opt.viewPort.enable || opt.inviewport)) { 12344 bt.css({visibility:"visible"}); 12345 bt.data('tween').kill(); 12346 bt.data('tween',punchgs.TweenLite.fromTo(bt,opt.delay/1000,{width:"0%"},{force3D:"auto",width:"100%",ease:punchgs.Linear.easeNone,onComplete:countDownNext,delay:1})); 12347 opt.sliderstatus = "playing"; 12348 } 12349 if (opt.disableProgressBar=="on") bt.css({visibility:"hidden"}); 12350 _R.toggleState(opt.slidertoggledby); 12351 }); 12352 12353 container.on('nulltimer',function() { 12354 bt.data('tween').pause(0); 12355 if (opt.disableProgressBar=="on") bt.css({visibility:"hidden"}); 12356 opt.sliderstatus = "paused"; 12357 }); 12358 12359 var countDownNext = function() { 12360 if (jQuery('body').find(container).length==0) { 12361 removeAllListeners(container,opt); 12362 clearInterval(opt.cdint); 12363 } 12364 12365 container.trigger("revolution.slide.slideatend"); 12366 12367 //STATE OF API CHANGED -> MOVE TO AIP BETTER 12368 if (container.data('conthover-changed') == 1) { 12369 opt.conthover= container.data('conthover'); 12370 container.data('conthover-changed',0); 12371 } 12372 12373 _R.callingNewSlide(opt,container,1); 12374 } 12375 12376 bt.data('tween',punchgs.TweenLite.fromTo(bt,opt.delay/1000,{width:"0%"},{force3D:"auto",width:"100%",ease:punchgs.Linear.easeNone,onComplete:countDownNext,delay:1})); 12377 bt.data('opt',opt); 12378 12379 if (opt.slideamount >1 && !(opt.stopAfterLoops==0 && opt.stopAtSlide==1)) { 12380 container.trigger("starttimer"); 12381 } 12382 else { 12383 opt.noloopanymore = 1; 12384 container.trigger("nulltimer"); 12385 } 12386 12387 container.on('tp-mouseenter',function() { 12388 opt.mouseoncontainer = true; 12389 if (opt.navigation.onHoverStop=="on" && (!_ISM)) { 12390 container.trigger('stoptimer'); 12391 container.trigger('revolution.slide.onpause'); 12392 } 12393 }); 12394 container.on('tp-mouseleft',function() { 12395 opt.mouseoncontainer = false; 12396 if (container.data('conthover')!=1 && opt.navigation.onHoverStop=="on" && ((opt.viewPort.enable==true && opt.inviewport) || opt.viewPort.enable==false)) { 12397 container.trigger('revolution.slide.onresume'); 12398 container.trigger('starttimer'); 12399 } 12400 }); 12401 12402} 12403 12404 12405 12406 12407////////////////////////////////////////////////////// 12408// * Revolution Slider - NEEDFULL FUNCTIONS 12409// * @version: 1.0 (30.10.2014) 12410// * @author ThemePunch 12411////////////////////////////////////////////////////// 12412 12413 12414 12415// - BLUR / FOXUS FUNCTIONS ON BROWSER 12416 12417var vis = (function(){ 12418 var stateKey, 12419 eventKey, 12420 keys = { 12421 hidden: "visibilitychange", 12422 webkitHidden: "webkitvisibilitychange", 12423 mozHidden: "mozvisibilitychange", 12424 msHidden: "msvisibilitychange" 12425 }; 12426 for (stateKey in keys) { 12427 if (stateKey in document) { 12428 eventKey = keys[stateKey]; 12429 break; 12430 } 12431 } 12432 return function(c) { 12433 if (c) document.addEventListener(eventKey, c); 12434 return !document[stateKey]; 12435 } 12436 })(); 12437 12438var restartOnFocus = function(opt) { 12439 if (opt==undefined || opt.c==undefined) return false; 12440 if (opt.windowfocused!=true) { 12441 opt.windowfocused = true; 12442 punchgs.TweenLite.delayedCall(0.3,function(){ 12443 // TAB IS ACTIVE, WE CAN START ANY PART OF THE SLIDER 12444 if (opt.fallbacks.nextSlideOnWindowFocus=="on") opt.c.revnext(); 12445 opt.c.revredraw(); 12446 if (opt.lastsliderstatus=="playing") 12447 opt.c.revresume(); 12448 }); 12449 } 12450} 12451 12452var lastStatBlur = function(opt) { 12453 opt.windowfocused = false; 12454 opt.lastsliderstatus = opt.sliderstatus; 12455 opt.c.revpause(); 12456 var actsh = opt.c.find('.active-revslide .slotholder'), 12457 nextsh = opt.c.find('.processing-revslide .slotholder'); 12458 12459 if (nextsh.data('kenburns')=="on") 12460 _R.stopKenBurn(nextsh,opt); 12461 12462 if (actsh.data('kenburns')=="on") 12463 _R.stopKenBurn(actsh,opt); 12464 12465 12466} 12467 12468var tabBlurringCheck = function(container,opt) { 12469 var notIE = (document.documentMode === undefined), 12470 isChromium = window.chrome; 12471 12472 if (notIE && !isChromium) { 12473 // checks for Firefox and other NON IE Chrome versions 12474 jQuery(window).on("focusin", function () { 12475 restartOnFocus(opt); 12476 }).on("focusout", function () { 12477 lastStatBlur(opt); 12478 }); 12479 } else { 12480 // checks for IE and Chromium versions 12481 if (window.addEventListener) { 12482 // bind focus event 12483 window.addEventListener("focus", function (event) { 12484 restartOnFocus(opt); 12485 }, false); 12486 // bind blur event 12487 window.addEventListener("blur", function (event) { 12488 lastStatBlur(opt); 12489 }, false); 12490 12491 } else { 12492 // bind focus event 12493 window.attachEvent("focus", function (event) { 12494 restartOnFocus(opt); 12495 }); 12496 // bind focus event 12497 window.attachEvent("blur", function (event) { 12498 lastStatBlur(opt); 12499 }); 12500 } 12501 } 12502} 12503 12504 12505// - GET THE URL PARAMETER // 12506 12507var getUrlVars = function (hashdivider){ 12508 var vars = [], hash; 12509 var hashes = window.location.href.slice(window.location.href.indexOf(hashdivider) + 1).split('_'); 12510 for(var i = 0; i < hashes.length; i++) 12511 { 12512 hashes[i] = hashes[i].replace('%3D',"="); 12513 hash = hashes[i].split('='); 12514 vars.push(hash[0]); 12515 vars[hash[0]] = hash[1]; 12516 } 12517 return vars; 12518} 12519})(jQuery); 12520/******************************************** 12521 * REVOLUTION 5.0 EXTENSION - ACTIONS 12522 * @version: 1.1 (25.11.2015) 12523 * @requires jquery.themepunch.revolution.js 12524 * @author ThemePunch 12525*********************************************/ 12526 12527!function($){var _R=jQuery.fn.revolution,_ISM=_R.is_mobile();jQuery.extend(!0,_R,{checkActions:function(e,t,a){checkActions_intern(e,t,a)}});var checkActions_intern=function(e,t,a){a&&jQuery.each(a,function(a,o){o.delay=parseInt(o.delay,0)/1e3,e.addClass("noSwipe"),t.fullscreen_esclistener||("exitfullscreen"==o.action||"togglefullscreen"==o.action)&&(jQuery(document).keyup(function(t){27==t.keyCode&&jQuery("#rs-go-fullscreen").length>0&&e.trigger(o.event)}),t.fullscreen_esclistener=!0);var l="backgroundvideo"==o.layer?jQuery(".rs-background-video-layer"):"firstvideo"==o.layer?jQuery(".tp-revslider-slidesli").find(".tp-vi
12527deolayer"):jQuery("#"+o.layer);switch(o.action){case"togglevideo":jQuery.each(l,function(t,a){a=jQuery(a);var o=a.data("videotoggledby");void 0==o&&(o=new Array),o.push(e),a.data("videotoggledby",o)});break;case"togglelayer":jQuery.each(l,function(t,a){a=jQuery(a);var o=a.data("layertoggledby");void 0==o&&(o=new Array),o.push(e),a.data("layertoggledby",o)});break;case"toggle_mute_video":jQuery.each(l,function(t,a){a=jQuery(a);var o=a.data("videomutetoggledby");void 0==o&&(o=new Array),o.push(e),a.data("videomutetoggledby",o)});break;case"toggleslider":void 0==t.slidertoggledby&&(t.slidertoggledby=new Array),t.slidertoggledby.push(e);break;case"togglefullscreen":void 0==t.fullscreentoggledby&&(t.fullscreentoggledby=new Array),t.fullscreentoggledby.push(e)}switch(e.on(o.event,function(){var a="backgroundvideo"==o.layer?jQuery(".active-revslide .slotholder .rs-background-video-layer"):"firstvideo"==o.layer?jQuery(".active-revslide .tp-videolayer").first():jQuery("#"+o.layer);if("stoplayer"==o.action||"togglelayer"==o.action||"startlayer"==o.action){if(a.length>0)if("startlayer"==o.action||"togglelayer"==o.action&&"in"!=a.data("animdirection")){a.data("animdirection","in");var l=a.data("timeline_out"),r="carousel"===t.sliderType?0:t.width/2-t.gridwidth[t.curWinRange]*t.bw/2,i=0;void 0!=l&&l.pause(0).kill(),_R.animateSingleCaption&&_R.animateSingleCaption(a,t,r,i,0,!1,!0);var n=a.data("timeline");a.data("triggerstate","on"),_R.toggleState(a.data("layertoggledby")),punchgs.TweenLite.delayedCall(o.delay,function(){n.play(0)},[n])}else("stoplayer"==o.action||"togglelayer"==o.action&&"out"!=a.data("animdirection"))&&(a.data("animdirection","out"),a.data("triggered",!0),a.data("triggerstate","off"),_R.stopVideo&&_R.stopVideo(a,t),_R.endMoveCaption&&punchgs.TweenLite.delayedCall(o.delay,_R.endMoveCaption,[a,null,null,t]),_R.unToggleState(a.data("layertoggledby")))}else!_ISM||"playvideo"!=o.action&&"stopvideo"!=o.action&&"togglevideo"!=o.action&&"mutevideo"!=o.action&&"unmutevideo"!=o.action&&"toggle_mute_video"!=o.action?punchgs.TweenLite.delayedCall(o.delay,function(){actionSwitches(a,t,o,e)},[a,t,o,e]):actionSwitches(a,t,o,e)}),o.action){case"togglelayer":case"startlayer":case"playlayer":case"stoplayer":var l=jQuery("#"+o.layer);"bytrigger"!=l.data("start")&&(l.data("triggerstate","on"),l.data("animdirection","in"))}})},actionSwitches=function(tnc,opt,a,_nc){switch(a.action){case"scrollbelow":_nc.addClass("tp-scrollbelowslider"),_nc.data("scrolloffset",a.offset),_nc.data("scrolldelay",a.delay);var off=getOffContH(opt.fullScreenOffsetContainer)||0,aof=parseInt(a.offset,0)||0;off=off-aof||0,jQuery("body,html").animate({scrollTop:opt.c.offset().top+jQuery(opt.li[0]).height()-off+"px"},{duration:400});break;case"callback":eval(a.callback);break;case"jumptoslide":switch(a.slide.toLowerCase()){case"+1":case"next":opt.sc_indicator="arrow",_R.callingNewSlide(opt,opt.c,1);break;case"previous":case"prev":case"-1":opt.sc_indicator="arrow",_R.callingNewSlide(opt,opt.c,-1);break;default:var ts=jQuery.isNumeric(a.slide)?parseInt(a.slide,0):a.slide;_R.callingNewSlide(opt,opt.c,ts)}break;case"simplelink":window.open(a.url,a.target);break;case"toggleslider":opt.noloopanymore=0,"playing"==opt.sliderstatus?(opt.c.revpause(),_R.unToggleState(opt.slidertoggledby)):(opt.c.revresume(),_R.toggleState(opt.slidertoggledby));break;case"pauseslider":opt.c.revpause(),_R.unToggleState(opt.slidertoggledby);break;case"playslider":opt.noloopanymore=0,opt.c.revresume(),_R.toggleState(opt.slidertoggledby);break;case"playvideo":tnc.length>0&&_R.playVideo(tnc,opt);break;case"stopvideo":tnc.length>0&&_R.stopVideo&&_R.stopVideo(tnc,opt);break;case"togglevideo":tnc.length>0&&(_R.isVideoPlaying(tnc,opt)?_R.stopVideo&&_R.stopVideo(tnc,opt):_R.playVideo(tnc,opt));break;case"mutevideo":tnc.length>0&&_R.muteVideo(tnc,opt);break;case"unmutevideo":tnc.length>0&&_R.unMuteVideo&&_R.unMuteVideo(tnc,opt);break;case"toggle_mute_video":tnc.length>0&&(_R.isVideoMuted(tnc,opt)?_R.unMuteVideo(tnc,opt):_R.muteVideo&&_R.muteVideo(tnc,opt)),_nc.toggleClass("rs-toggle-content-active");break;case"simulateclick":tnc.length>0&&tnc.click();break;case"toggleclass":tnc.length>0&&(tnc.hasClass(a.classname)?tnc.removeClass(a.classname):tnc.addClass(a.classname));break;case"gofullscreen":case"exitfullscreen":case"togglefullscreen":if(jQuery("#rs-go-fullscreen").length>0&&("togglefullscreen"==a.action||"exitfullscreen"==a.action)){jQuery("#rs-go-fullscreen").appendTo(jQuery("#rs-was-here"));var paw=opt.c.closest(".forcefullwidth_wrapper_tp_banner").length>0?opt.c.closest(".forcefullwidth_wrapper_tp_banner"):opt.c.closest(".rev_slider_wrapper");paw.unwrap(),paw.unwrap(),opt.minHeight=opt.oldminheight,opt.infullscreenmode=!1,opt.c.revredraw(),void 0!=opt.playingvideos&&opt.playingvideos.length>0&&jQuery.each(opt.playingvideos,function(e,t){_R.playVideo(t,opt)}),_R.unToggleState(opt.fullscreentoggledby)}else if(0==jQuery("#rs-go-fullscreen").length&&("togglefullscreen"==a.action||"gofullscreen"==a.action)){var paw=opt.c.closest(".forcefullwidth_wrapper_tp_banner").length>0?opt.c.closest(".forcefullwidth_wrapper_tp_banner"):opt.c.closest(".rev_slider_wrapper");paw.wrap('<div id="rs-was-here"><div id="rs-go-fullscreen"></div></div>');var gf=jQuery("#rs-go-fullscreen");gf.appendTo(jQuery("body")),gf.css({position:"fixed",width:"100%",height:"100%",top:"0px",left:"0px",zIndex:"9999999",background:"#ffffff"}),opt.oldminheight=opt.minHeight,opt.minHeight=jQuery(window).height(),opt.infullscreenmode=!0,opt.c.revredraw(),void 0!=opt.playingvideos&&opt.playingvideos.length>0&&jQuery.each(opt.playingvideos,function(e,t){_R.playVideo(t,opt)}),_R.toggleState(opt.fullscreentoggledby)}}},getOffContH=function(e){if(void 0==e)return 0;if(e.split(",").length>1){oc=e.split(",");var t=0;return oc&&jQuery.each(oc,function(e,a){jQuery(a).length>0&&(t+=jQuery(a).outerHeight(!0))}),t}return jQuery(e).height()}}(jQuery); 12528/******************************************** 12529 * REVOLUTION 5.0 EXTENSION - CAROUSEL 12530 * @version: 1.0.2 (01.10.2015) 12531 * @requires jquery.themepunch.revolution.js 12532 * @author ThemePunch 12533*********************************************/ 12534 12535!function(){var e=jQuery.fn.revolution;jQuery.extend(!0,e,{prepareCarousel:function(i,l,o){o=i.carousel.lastdirection=a(o,i.carousel.lastdirection),t(i),i.carousel.slide_offset_target=r(i),void 0==l?e.carouselToEvalPosition(i,o):s(i,o,!1)},carouselToEvalPosition:function(i,t){var l=i.carousel;t=l.lastdirection=a(t,l.lastdirection);var o="center"===l.horizontal_align?(l.wrapwidth/2-l.slide_width/2-l.slide_globaloffset)/l.slide_width:(0-l.slide_globaloffset)/l.slide_width,r=e.simp(o,i.slideamount,!1),n=r-Math.floor(r),d=0,f=-1*(Math.ceil(r)-r),h=-1*(Math.floor(r)-r);d=n>=.3&&"left"===t||n>=.7&&"right"===t?f:.3>n&&"left"===t||.7>n&&"right"===t?h:d,d="off"===l.infinity?0>r?r:o>i.slideamount-1?o-(i.slideamount-1):d:d,l.slide_offset_target=d*l.slide_width,0!==Math.abs(l.slide_offset_target)?s(i,t,!0):e.organiseCarousel(i,t)},organiseCarousel:function(e,i,t,a){i=void 0===i||"down"==i||"up"==i||null===i||jQuery.isEmptyObject(i)?"left":i;
12535for(var s=e.carousel,l=new Array,o=s.slides.length,r="right"===s.horizontal_align?r=e.width:0,n=0;o>n;n++){var d=n*s.slide_width+s.slide_offset;"on"===s.infinity&&(d=d>s.wrapwidth-s.inneroffset&&"right"==i?s.slide_offset-(s.slides.length-n)*s.slide_width:d,d=d<0-s.inneroffset-s.slide_width&&"left"==i?d+s.maxwidth:d),l[n]=d}var f=999;s.slides&&jQuery.each(s.slides,function(a,r){var n=l[a];"on"===s.infinity&&(n=n>s.wrapwidth-s.inneroffset&&"left"===i?l[0]-(o-a)*s.slide_width:n,n=n<0-s.inneroffset-s.slide_width?"left"==i?n+s.maxwidth:"right"===i?l[o-1]+(a+1)*s.slide_width:n:n);var d=new Object;d.left=n+s.inneroffset;var h="center"===s.horizontal_align?(Math.abs(s.wrapwidth/2)-(d.left+s.slide_width/2))/s.slide_width:(s.inneroffset-d.left)/s.slide_width,w="center"===s.horizontal_align?2:1;if((t&&Math.abs(h)<f||0===h)&&(f=Math.abs(h),s.focused=a),d.width=s.slide_width,d.x=0,d.transformPerspective=1200,d.transformOrigin="50% "+s.vertical_align,"on"===s.fadeout)if("on"===s.vary_fade)d.autoAlpha=1-Math.abs(1/Math.ceil(s.maxVisibleItems/w)*h);else switch(s.horizontal_align){case"center":d.autoAlpha=Math.abs(h)<Math.ceil(s.maxVisibleItems/w-1)?1:1-(Math.abs(h)-Math.floor(Math.abs(h)));break;case"left":d.autoAlpha=1>h&&h>0?1-h:Math.abs(h)>s.maxVisibleItems-1?1-(Math.abs(h)-(s.maxVisibleItems-1)):1;break;case"right":d.autoAlpha=h>-1&&0>h?1-Math.abs(h):h>s.maxVisibleItems-1?1-(Math.abs(h)-(s.maxVisibleItems-1)):1}else d.autoAlpha=Math.abs(h)<Math.ceil(s.maxVisibleItems/w)?1:0;if(void 0!==s.minScale&&s.minScale>0)if("on"===s.vary_scale){d.scale=1-Math.abs(s.minScale/100/Math.ceil(s.maxVisibleItems/w)*h);var c=(s.slide_width-s.slide_width*d.scale)*Math.abs(h)}else{d.scale=h>=1||-1>=h?1-s.minScale/100:(100-s.minScale*Math.abs(h))/100;var c=(s.slide_width-s.slide_width*(1-s.minScale/100))*Math.abs(h)}void 0!==s.maxRotation&&0!=Math.abs(s.maxRotation)&&("on"===s.vary_rotation?(d.rotationY=Math.abs(s.maxRotation)-Math.abs((1-Math.abs(1/Math.ceil(s.maxVisibleItems/w)*h))*s.maxRotation),d.autoAlpha=Math.abs(d.rotationY)>90?0:d.autoAlpha):d.rotationY=h>=1||-1>=h?s.maxRotation:Math.abs(h)*s.maxRotation,d.rotationY=0>h?-1*d.rotationY:d.rotationY),d.x=-1*s.space*h,d.left=Math.floor(d.left),d.x=Math.floor(d.x),void 0!==d.scale?0>h?d.x-c:d.x+c:d.x,d.zIndex=Math.round(100-Math.abs(5*h)),d.transformStyle="3D"!=e.parallax.type&&"3d"!=e.parallax.type?"flat":"preserve-3d",punchgs.TweenLite.set(r,d)}),a&&(e.c.find(".next-revslide").removeClass("next-revslide"),jQuery(s.slides[s.focused]).addClass("next-revslide"),e.c.trigger("revolution.nextslide.waiting"));s.wrapwidth/2-s.slide_offset,s.maxwidth+s.slide_offset-s.wrapwidth/2}});var i=function(e){var i=e.carousel;i.infbackup=i.infinity,i.maxVisiblebackup=i.maxVisibleItems,i.slide_globaloffset="none",i.slide_offset=0,i.wrap=e.c.find(".tp-carousel-wrapper"),i.slides=e.c.find(".tp-revslider-slidesli"),0!==i.maxRotation&&("3D"!=e.parallax.type&&"3d"!=e.parallax.type?punchgs.TweenLite.set(i.wrap,{perspective:1200,transformStyle:"flat"}):punchgs.TweenLite.set(i.wrap,{perspective:1600,transformStyle:"preserve-3d"})),void 0!==i.border_radius&&parseInt(i.border_radius,0)>0&&punchgs.TweenLite.set(e.c.find(".tp-revslider-slidesli"),{borderRadius:i.border_radius})},t=function(t){void 0===t.bw&&e.setSize(t);var a=t.carousel,s=e.getHorizontalOffset(t.c,"left"),l=e.getHorizontalOffset(t.c,"right");void 0===a.wrap&&i(t),a.slide_width="on"!==a.stretch?t.gridwidth[t.curWinRange]*t.bw:t.c.width(),a.maxwidth=t.slideamount*a.slide_width,a.maxVisiblebackup>a.slides.length+1&&(a.maxVisibleItems=a.slides.length+2),a.wrapwidth=a.maxVisibleItems*a.slide_width+(a.maxVisibleItems-1)*a.space,a.wrapwidth="auto"!=t.sliderLayout?a.wrapwidth>t.c.closest(".tp-simpleresponsive").width()?t.c.closest(".tp-simpleresponsive").width():a.wrapwidth:a.wrapwidth>t.ul.width()?t.ul.width():a.wrapwidth,a.infinity=a.wrapwidth>=a.maxwidth?"off":a.infbackup,a.wrapoffset="center"===a.horizontal_align?(t.c.width()-l-s-a.wrapwidth)/2:0,a.wrapoffset="auto"!=t.sliderLayout&&t.outernav?0:a.wrapoffset<s?s:a.wrapoffset;var o="hidden";("3D"==t.parallax.type||"3d"==t.parallax.type)&&(o="visible"),"right"===a.horizontal_align?punchgs.TweenLite.set(a.wrap,{left:"auto",right:a.wrapoffset+"px",width:a.wrapwidth,overflow:o}):punchgs.TweenLite.set(a.wrap,{right:"auto",left:a.wrapoffset+"px",width:a.wrapwidth,overflow:o}),a.inneroffset="right"===a.horizontal_align?a.wrapwidth-a.slide_width:0,a.realoffset=Math.abs(a.wrap.position().left),a.windhalf=jQuery(window).width()/2},a=function(e,i){return null===e||jQuery.isEmptyObject(e)?i:void 0===e?"right":e},s=function(i,t,s){var l=i.carousel;t=l.lastdirection=a(t,l.lastdirection);var o=new Object;o.from=0,o.to=l.slide_offset_target,void 0!==l.positionanim&&l.positionanim.pause(),l.positionanim=punchgs.TweenLite.to(o,1.2,{from:o.to,onUpdate:function(){l.
12535slide_offset=l.slide_globaloffset+o.from,l.slide_offset=e.simp(l.slide_offset,l.maxwidth),e.organiseCarousel(i,t,!1,!1)},onComplete:function(){l.slide_globaloffset="off"===l.infinity?l.slide_globaloffset+l.slide_offset_target:e.simp(l.slide_globaloffset+l.slide_offset_target,l.maxwidth),l.slide_offset=e.simp(l.slide_offset,l.maxwidth),e.organiseCarousel(i,t,!1,!0);var a=jQuery(i.li[l.focused]);i.c.find(".next-revslide").removeClass("next-revslide"),s&&e.callingNewSlide(i,i.c,a.data("index"))},ease:punchgs.Expo.easeOut})},l=function(e,i){return Math.abs(e)>Math.abs(i)?e>0?e-Math.abs(Math.floor(e/i)*i):e+Math.abs(Math.floor(e/i)*i):e},o=function(e,i,t){var t,t,a=i-e,s=i-t-e;return a=l(a,t),s=l(s,t),Math.abs(a)>Math.abs(s)?s:a},r=function(i){var t=0,a=i.carousel;if(void 0!==a.positionanim&&a.positionanim.kill(),"none"==a.slide_globaloffset)a.slide_globaloffset=t="center"===a.horizontal_align?a.wrapwidth/2-a.slide_width/2:0;else{a.slide_globaloffset=a.slide_offset,a.slide_offset=0;var s=i.c.find(".processing-revslide").index(),l="center"===a.horizontal_align?(a.wrapwidth/2-a.slide_width/2-a.slide_globaloffset)/a.slide_width:(0-a.slide_globaloffset)/a.slide_width;l=e.simp(l,i.slideamount,!1),s=s>=0?s:i.c.find(".active-revslide").index(),s=s>=0?s:0,t="off"===a.infinity?l-s:-o(l,s,i.slideamount),t*=a.slide_width}return t}}(jQuery); 12536/******************************************** 12537 * REVOLUTION 5.0 EXTENSION - KEN BURN 12538 * @version: 1.0.0 (03.08.2015) 12539 * @requires jquery.themepunch.revolution.js 12540 * @author ThemePunch 12541*********************************************/ 12542 12543!function(){var t=jQuery.fn.revolution;jQuery.extend(!0,t,{stopKenBurn:function(t){void 0!=t.data("kbtl")&&t.data("kbtl").pause()},startKenBurn:function(t,e,a){var r=t.data(),n=t.find(".defaultimg"),s=n.data("lazyload")||n.data("src"),i=(r.owidth/r.oheight,"carousel"===e.sliderType?e.carousel.slide_width:e.ul.width()),o=e.ul.height();t.data("kbtl")&&t.data("kbtl").kill(),a=a||0,0==t.find(".tp-kbimg").length&&(t.append('<div class="tp-kbimg-wrap" style="z-index:2;width:100%;height:100%;top:0px;left:0px;position:absolute;"><img class="tp-kbimg" src="'+s+'" style="position:absolute;" width="'+r.owidth+'" height="'+r.oheight+'"></div>'),t.data("kenburn",t.find(".tp-kbimg")));var d=function(t,e,a,r,n,s,i){var o=t*a,d=e*a,l=Math.abs(r-o),h=Math.abs(n-d),p=new Object;return p.l=(0-s)*l,p.r=p.l+o,p.t=(0-i)*h,p.b=p.t+d,p.h=s,p.v=i,p},l=function(t,e,a,r,n){var s=t.bgposition.split(" ")||"center center",i="center"==s[0]?"50%":"left"==s[0]||"left"==s[1]?"0%":"right"==s[0]||"right"==s[1]?"100%":s[0],o="center"==s[1]?"50%":"top"==s[0]||"top"==s[1]?"0%":"bottom"==s[0]||"bottom"==s[1]?"100%":s[1];i=parseInt(i,0)/100||0,o=parseInt(o,0)/100||0;var l=new Object;return l.start=d(n.start.width,n.start.height,n.start.scale,e,a,i,o),l.end=d(n.start.width,n.start.height,n.end.scale,e,a,i,o),l},h=function(t,e,a){var r=a.scalestart/100,n=a.scaleend/100,s=void 0!=a.oofsetstart?a.offsetstart.split(" ")||[0,0]:[0,0],i=void 0!=a.offsetend?a.offsetend.split(" ")||[0,0]:[0,0];a.bgposition="center center"==a.bgposition?"50% 50%":a.bgposition;{var o=new Object,d=t*r,h=(d/a.owidth*a.oheight,t*n);h/a.owidth*a.oheight}if(o.start=new Object,o.starto=new Object,o.end=new Object,o.endo=new Object,o.start.width=t,o.start.height=o.start.width/a.owidth*a.oheight,o.start.height<e){var p=e/o.start.height;o.start.height=e,o.start.width=o.start.width*p}o.start.transformOrigin=a.bgposition,o.start.scale=r,o.end.scale=n,o.start.rotation=a.rotatestart+"deg",o.end.rotation=a.rotateend+"deg";var g=l(a,t,e,s,o);s[0]=parseFloat(s[0])+g.start.l,i[0]=parseFloat(i[0])+g.end.l,s[1]=parseFloat(s[1])+g.start.t,i[1]=parseFloat(i[1])+g.end.t;var c=g.start.r-g.start.l,b=g.start.b-g.start.t,u=g.end.r-g.end.l,f=g.end.b-g.end.t;return s[0]=s[0]>0?0:c+s[0]<t?t-c:s[0],i[0]=i[0]>0?0:u+i[0]<t?t-u:i[0],s[1]=s[1]>0?0:b+s[1]<e?e-b:s[1],i[1]=i[1]>0?0:f+i[1]<e?e-f:i[1],o.starto.x=s[0]+"px",o.starto.y=s[1]+"px",o.endo.x=i[0]+"px",o.endo.y=i[1]+"px",o.end.ease=o.endo.ease=a.ease,o.end.force3D=o.endo.force3D=!0,o};void 0!=t.data("kbtl")&&(t.data("kbtl").kill(),t.removeData("kbtl"));var p=t.data("kenburn"),g=p.parent(),c=h(i,o,r),b=new punchgs.TimelineLite;b.pause(),c.start.transformOrigin="0% 0%",c.starto.transformOrigin="0% 0%",b.add(punchgs.TweenLite.fromTo(p,r.duration/1e3,c.start,c.end),0),b.add(punchgs.TweenLite.fromTo(g,r.duration/1e3,c.starto,c.endo),0),b.progress(a),b.play(),t.data("kbtl",b)}})}(jQuery); 12544/******************************************** 12545 * REVOLUTION 5.0 EXTENSION - LAYER ANIMATION 12546 * @version: 1.4 (15.12.2015) 12547 * @requires jquery.themepunch.revolution.js 12548 * @author ThemePunch 12549*********************************************/ 12550 12551!function(a){function e(a,e,t,i,n,o,r){var d=a.find(e);d.css("borderWidth",o+"px"),d.css(t,0-o+"px"),d.css(i,"0px solid transparent"),d.css(n,r)}var t=jQuery.fn.revolution;t.is_mobile();jQuery.extend(!0,t,{animcompleted:function(a,e){var i=a.data("videotype"),n=a.data("autoplay"),o=a.data("autoplayonlyfirsttime");void 0!=i&&"none"!=i&&(1==n||"true"==n||"on"==n||"1sttime"==n||o?(t.playVideo(a,e),t.toggleState(a.data("videotoggledby")),(
12551o||"1sttime"==n)&&(a.data("autoplayonlyfirsttime",!1),a.data("autoplay","off"))):("no1sttime"==n&&a.data("autoplay","on"),t.unToggleState(a.data("videotoggledby"))))},handleStaticLayers:function(a,e){var t=parseInt(a.data("startslide"),0),i=parseInt(a.data("endslide"),0);0>t&&(t=0),0>i&&(i=e.slideamount),0===t&&i===e.slideamount-1&&(i=e.slideamount+1),a.data("startslide",t),a.data("endslide",i)},animateTheCaptions:function(a,e,i,n){var o="carousel"===e.sliderType?0:e.width/2-e.gridwidth[e.curWinRange]*e.bw/2,r=0,d=a.data("index");e.layers=e.layers||new Object,e.layers[d]=e.layers[d]||a.find(".tp-caption"),e.layers["static"]=e.layers["static"]||e.c.find(".tp-static-layers").find(".tp-caption");var s=new Array;if(e.conh=e.c.height(),e.conw=e.c.width(),e.ulw=e.ul.width(),e.ulh=e.ul.height(),e.debugMode){a.addClass("indebugmode"),a.find(".helpgrid").remove(),e.c.find(".hglayerinfo").remove(),a.append('<div class="helpgrid" style="width:'+e.gridwidth[e.curWinRange]*e.bw+"px;height:"+e.gridheight[e.curWinRange]*e.bw+'px;"></div>');var l=a.find(".helpgrid");l.append('<div class="hginfo">Zoom:'+Math.round(100*e.bw)+"% Device Level:"+e.curWinRange+" Grid Preset:"+e.gridwidth[e.curWinRange]+"x"+e.gridheight[e.curWinRange]+"</div>"),e.c.append('<div class="hglayerinfo"></div>'),l.append('<div class="tlhg"></div>')}s&&jQuery.each(s,function(a){var e=jQuery(this);punchgs.TweenLite.set(e.find(".tp-videoposter"),{autoAlpha:1}),punchgs.TweenLite.set(e.find("iframe"),{autoAlpha:0})}),e.layers[d]&&jQuery.each(e.layers[d],function(a,e){s.push(e)}),e.layers["static"]&&jQuery.each(e.layers["static"],function(a,e){s.push(e)}),s&&jQuery.each(s,function(a){t.animateSingleCaption(jQuery(this),e,o,r,a,i)});var p=jQuery("body").find("#"+e.c.attr("id")).find(".tp-bannertimer");p.data("opt",e),void 0!=n&&setTimeout(function(){n.resume()},30)},animateSingleCaption:function(a,n,r,u,w,y,b){var x=y,T=h(a,n,"in",!0),L=a.data("_pw")||a.closest(".tp-parallax-wrap"),W=a.data("_lw")||a.closest(".tp-loop-wrap"),C=a.data("_mw")||a.closest(".tp-mask-wrap"),j=a.data("responsive")||"on",I=a.data("responsive_offset")||"on",R=a.data("basealign")||"grid",k="grid"===R?n.width:n.ulw,_="grid"===R?n.height:n.ulh,S=jQuery("body").hasClass("rtl");if(a.data("_pw")||(a.data("_pw",L),a.data("_lw",W),a.data("_mw",C)),"fullscreen"==n.sliderLayout&&(u=_/2-n.gridheight[n.curWinRange]*n.bh/2),("on"==n.autoHeight||void 0!=n.minHeight&&n.minHeight>0)&&(u=n.conh/2-n.gridheight[n.curWinRange]*n.bh/2),0>u&&(u=0),n.debugMode){a.closest("li").find(".helpgrid").css({top:u+"px",left:r+"px"});var z=n.c.find(".hglayerinfo");a.on("hover, mouseenter",function(){var e="";a.data()&&jQuery.each(a.data(),function(a,t){"object"!=typeof t&&(e=e+'<span style="white-space:nowrap"><span style="color:#27ae60">'+a+":</span>"+t+"</span> ")}),z.html(e)})}var Q=p(a.data("visibility"),n)[n.forcedWinRange]||p(a.data("visibility"),n)||"on";if("off"==Q||k<n.hideCaptionAtLimit&&"on"==a.data("captionhidden")||k<n.hideAllCaptionAtLimit?a.addClass("tp-hidden-caption"):a.removeClass("tp-hidden-caption"),a.data("layertype","html"),0>r&&(r=0),void 0!=a.data("thumbimage")&&void 0==a.data("videoposter")&&a.data("videoposter",a.data("thumbimage")),a.find("img").length>0){var M=a.find("img");a.data("layertype","image"),0==M.width()&&M.css({width:"auto"}),0==M.height()&&M.css({height:"auto"}),void 0==M.data("ww")&&M.width()>0&&M.data("ww",M.width()),void 0==M.data("hh")&&M.height()>0&&M.data("hh",M.height());var O=M.data("ww"),H=M.data("hh"),B="slide"==R?n.ulw:n.gridwidth[n.curWinRange],A="slide"==R?n.ulh:n.gridheight[n.curWinRange],O=p(M.data("ww"),n)[n.curWinRange]||p(M.data("ww"),n)||"auto",H=p(M.data("hh"),n)[n.curWinRange]||p(M.data("hh"),n)||"auto",F="full"===O||"full-proportional"===O,D="full"===H||"full-proportional"===H;if("full-proportional"===O){var P=M.data("owidth"),X=M.data("oheight");X/A>P/B?(O=B,H=X*(B/P)):(H=A,O=P*(A/X))}else O=F?B:parseFloat(O),H=D?A:parseFloat(H);void 0==O&&(O=0),void 0==H&&(H=0),"off"!==j?("grid"!=R&&F?M.width(O):M.width(O*n.bw),"grid"!=R&&D?M.height(H):M.height(H*n.bh)):(M.width(O),M.height(H))}if("slide"===R&&(r=0,u=0),a.hasClass("tp-videolayer")||a.find("iframe").length>0||a.find("video").length>0){if(a.data("layertype","video"),t.manageVideoLayer(a,n,y,x),!y&&!x){a.data("videotype");t.resetVideo(a,n)}var Y=a.data("aspectratio");void 0!=Y&&Y.split(":").length>1&&t.prepareCoveredVideo(Y,n,a);var M=a.find("iframe")?a.find("iframe"):M=a.find("video"),V=a.find("iframe")?!1:!0,N=a.hasClass("coverscreenvideo");M.css({display:"block"}),void 0==a.data("videowidth")&&(a.data("videowidth",M.width()),a.data("videoheight",M.height()));var Z,O=p(a.data("videowidth"),n)[n.curWinRange]||p(a.data("videowidth"),n)||"auto",H=p(a.data("videoheight"),n)[n.curWinRange]||p(a.data("videoheight"),n)||"auto";O=parseFloat(O),H=parseFloat(H),void 0===a.data("cssobj")&&(Z=g(
12551a,0),a.data("cssobj",Z));var $=m(a.data("cssobj"),n);if("auto"==$.lineHeight&&($.lineHeight=$.fontSize+4),a.hasClass("fullscreenvideo")||N){r=0,u=0,a.data("x",0),a.data("y",0);var G=_;"on"==n.autoHeight&&(G=n.conh),a.css({width:k,height:G})}else punchgs.TweenLite.set(a,{paddingTop:Math.round($.paddingTop*n.bh)+"px",paddingBottom:Math.round($.paddingBottom*n.bh)+"px",paddingLeft:Math.round($.paddingLeft*n.bw)+"px",paddingRight:Math.round($.paddingRight*n.bw)+"px",marginTop:$.marginTop*n.bh+"px",marginBottom:$.marginBottom*n.bh+"px",marginLeft:$.marginLeft*n.bw+"px",marginRight:$.marginRight*n.bw+"px",borderTopWidth:Math.round($.borderTopWidth*n.bh)+"px",borderBottomWidth:Math.round($.borderBottomWidth*n.bh)+"px",borderLeftWidth:Math.round($.borderLeftWidth*n.bw)+"px",borderRightWidth:Math.round($.borderRightWidth*n.bw)+"px",width:O*n.bw+"px",height:H*n.bh+"px"});(0==V&&!N||1!=a.data("forcecover")&&!a.hasClass("fullscreenvideo")&&!N)&&(M.width(O*n.bw),M.height(H*n.bh))}a.find(".tp-resizeme, .tp-resizeme *").each(function(){v(jQuery(this),n,"rekursive",j)}),a.hasClass("tp-resizeme")&&a.find("*").each(function(){v(jQuery(this),n,"rekursive",j)}),v(a,n,0,j);var U=a.outerHeight(),q=a.css("backgroundColor");e(a,".frontcorner","left","borderRight","borderTopColor",U,q),e(a,".frontcornertop","left","borderRight","borderBottomColor",U,q),e(a,".backcorner","right","borderLeft","borderBottomColor",U,q),e(a,".backcornertop","right","borderLeft","borderTopColor",U,q),"on"==n.fullScreenAlignForce&&(r=0,u=0);var E=a.data("arrobj");if(void 0===E){var E=new Object;E.voa=p(a.data("voffset"),n)[n.curWinRange]||p(a.data("voffset"),n)[0],E.hoa=p(a.data("hoffset"),n)[n.curWinRange]||p(a.data("hoffset"),n)[0],E.elx=p(a.data("x"),n)[n.curWinRange]||p(a.data("x"),n)[0],E.ely=p(a.data("y"),n)[n.curWinRange]||p(a.data("y"),n)[0]}var J=0==E.voa.length?0:E.voa,K=0==E.hoa.length?0:E.hoa,aa=0==E.elx.length?0:E.elx,ea=0==E.ely.length?0:E.ely,ta=a.outerWidth(!0),ia=a.outerHeight(!0);0==ta&&0==ia&&(ta=n.ulw,ia=n.ulh);var na="off"!==I?parseInt(J,0)*n.bw:parseInt(J,0),oa="off"!==I?parseInt(K,0)*n.bw:parseInt(K,0),ra="grid"===R?n.gridwidth[n.curWinRange]*n.bw:k,da="grid"===R?n.gridheight[n.curWinRange]*n.bw:_;"on"==n.fullScreenAlignForce&&(ra=n.ulw,da=n.ulh),aa="center"===aa||"middle"===aa?ra/2-ta/2+oa:"left"===aa?oa:"right"===aa?ra-ta-oa:"off"!==I?aa*n.bw:aa,ea="center"==ea||"middle"==ea?da/2-ia/2+na:"top"==ea?na:"bottom"==ea?da-ia-na:"off"!==I?ea*n.bw:ea,S&&(aa+=ta);var sa=a.data("lasttriggerstate"),la=a.data("triggerstate"),pa=a.data("start")||100,ha=a.data("end"),ca=b?0:"bytrigger"===pa||"sliderenter"===pa?0:parseFloat(pa)/1e3,ga=aa+r,ma=ea+u,ua=a.css("z-Index");b||("reset"==sa&&"bytrigger"!=pa?(a.data("triggerstate","on"),a.data("animdirection","in"),la="on"):"reset"==sa&&"bytrigger"==pa&&(a.data("triggerstate","off"),a.data("animdirection","out"),la="off")),punchgs.TweenLite.set(L,{zIndex:ua,top:ma,left:ga,overwrite:"auto"}),0==T&&(x=!0),void 0==a.data("timeline")||x||(2!=T&&a.data("timeline").gotoAndPlay(0),x=!0),!y&&a.data("timeline_out")&&2!=T&&0!=T&&(a.data("timeline_out").kill(),a.data("outstarted",0)),b&&void 0!=a.data("timeline")&&(a.removeData("$anims"),a.data("timeline").pause(0),a.data("timeline").kill(),void 0!=a.data("newhoveranim")&&(a.data("newhoveranim").progress(0),a.data("newhoveranim").kill()),a.removeData("timeline"),punchgs.TweenLite.killTweensOf(a),a.unbind("hover"),a.removeClass("rs-hover-ready"),a.removeData("newhoveranim"));var va=a.data("timeline")?a.data("timeline").time():0,fa=void 0!==a.data("timeline")?a.data("timeline").progress():0,wa=a.data("timeline")||new punchgs.TimelineLite({smoothChildTiming:!0});if(fa=jQuery.isNumeric(fa)?fa:0,wa.pause(),1>fa&&1!=a.data("outstarted")||2==T||b){var ya=a;if(void 0!=a.data("mySplitText")&&a.data("mySplitText").revert(),void 0!=a.data("splitin")&&a.data("splitin").match(/chars|words|lines/g)||void 0!=a.data("splitout")&&a.data("splitout").match(/chars|words|lines/g)){var ba=a.find("a").length>0?a.find("a"):a;a.data("mySplitText",new punchgs.SplitText(ba,{type:"lines,words,chars",charsClass:"tp-splitted",wordsClass:"tp-splitted",linesClass:"tp-splitted"})),a.addClass("splitted")}void 0!==a.data("mySplitText")&&a.data("splitin")&&a.data("splitin").match(/chars|words|lines/g)&&(ya=a.data("mySplitText")[a.data("splitin")]);var xa=new Object,Ta=void 0!=a.data("transform_in")?a.data("transform_in").match(/\(R\)/gi):!1;if(!a.data("$anims")||b||Ta){var La=i(),Wa=i(),Ca=o(),ja=void 0!==a.data("transform_hover")||void 0!==a.data("style_hover");Wa=s(Wa,a.data("transform_idle")),La=s(Wa,a.data("transform_in"),1==n.sdir),ja&&(Ca=s(Ca,a.data("transform_hover")),Ca=c(Ca,a.data("style_hover")),a.data("hover",Ca)),La.elemdelay=void 0==a.data("elementdelay")?0:a.data("elementdelay"),Wa.anim.ease=La.anim.ease=La.anim.ease||punchgs.Power1.easeInOut,ja&&!a.hasClass("rs-hover-ready")&&(a.addClass("rs-hover-ready"),a.hover(function(a){var e=jQuery(a.currentTarget),t=e.data("hover"),i=e.data("timeline");i&&1==i.progress()&&(void 0===e.data("newhoveranim")||"none"===e.data("newhoveranim")?e.data("newhoveranim",punchgs.TweenLite.to(e,t.speed,t.anim)):(e.data("newhoveranim").progress(0),e.data("newhoveranim").play()))},function(a){var e=jQuery(a.currentTarget),t=e.data("timeline");t&&1==t.progress()&&void 0!=e.data("newhoveranim")&&e.data("newhoveranim").reverse()})),xa=new Object,xa.f=La,xa.r=Wa,a.data("$anims")}else xa=a.data("$anims");var Ia=l(a.data("mask_in")),Ra=new punchgs.TimelineLite;if(xa.f.anim.x=xa.f.anim.x*n.bw||d(xa.f.anim.x,n,ta,ia,ma,ga,"horizontal"),xa.f.anim.y=xa.f.anim.y*n.bw||d(xa.f.anim.y,n,ta,ia,ma,ga,"vertical"),2!=T||b){if(ya!=a){var ka=xa.r.anim.ease;wa.add(punchgs.TweenLite.set(a,xa.r.anim)),xa.r=i(),xa.r.anim.ease=ka}if(xa.f.anim.visibility="hidden",Ra.eventCallback("onStart",function(){punchgs.TweenLite.set(a,{visibility:"visible"}),a.data("iframes")&&a.find("iframe").each(function(){punchgs.TweenLite.set(jQuery(this),{autoAlpha:1})}),punchgs.TweenLite.set(L,{visibility:"visible"});var e={};e.layer=a,e.eventtype="enterstage",e.layertype=a.data("layertype"),e.layersettings=a.data(),n.c.trigger("revolution.layeraction",e)}),Ra.eventCallback("onComplete",function(){var e={};e.layer=a,e.eventtype="enteredstage",e.layertype=a.data("layertype"),e.layersettings=a.data(),n.c.trigger("revolution.layeraction",e),t.animcompleted(a,n)}
12551),"sliderenter"==pa&&n.overcontainer&&(ca=.6),wa.add(Ra.staggerFromTo(ya,xa.f.speed,xa.f.anim,xa.r.anim,xa.f.elemdelay),ca),Ia){var _a=new Object;_a.ease=xa.r.anim.ease,_a.overflow=Ia.anim.overflow="hidden",_a.x=_a.y=0,Ia.anim.x=Ia.anim.x*n.bw||d(Ia.anim.x,n,ta,ia,ma,ga,"horizontal"),Ia.anim.y=Ia.anim.y*n.bw||d(Ia.anim.y,n,ta,ia,ma,ga,"vertical"),wa.add(punchgs.TweenLite.fromTo(C,xa.f.speed,Ia.anim,_a,La.elemdelay),ca)}else wa.add(punchgs.TweenLite.set(C,{overflow:"visible"},La.elemdelay),0)}a.data("timeline",wa),n.sliderscrope=void 0===n.sliderscrope?Math.round(99999*Math.random()):n.sliderscrope,T=h(a,n,"in"),0!==fa&&2!=T||"bytrigger"===ha||b||"sliderleave"==ha||(void 0==ha||-1!=T&&2!=T||"bytriger"===ha?punchgs.TweenLite.delayedCall(999999,t.endMoveCaption,[a,C,L,n],n.sliderscrope):punchgs.TweenLite.delayedCall(parseInt(a.data("end"),0)/1e3,t.endMoveCaption,[a,C,L,n],n.sliderscrope)),wa=a.data("timeline"),"on"==a.data("loopanimation")&&f(W,n.bw),("sliderenter"!=pa||"sliderenter"==pa&&n.overcontainer)&&(-1==T||1==T||b||0==T&&1>fa&&a.hasClass("rev-static-visbile"))&&(1>fa&&fa>0||0==fa&&"bytrigger"!=pa&&"keep"!=sa||0==fa&&"bytrigger"!=pa&&"keep"==sa&&"on"==la||"bytrigger"==pa&&"keep"==sa&&"on"==la)&&(wa.resume(va),t.toggleState(a.data("layertoggledby")))}"on"==a.data("loopanimation")&&punchgs.TweenLite.set(W,{minWidth:ta,minHeight:ia}),0==a.data("slidelink")||1!=a.data("slidelink")&&!a.hasClass("slidelink")?(punchgs.TweenLite.set(C,{width:"auto",height:"auto"}),a.data("slidelink",0)):(punchgs.TweenLite.set(C,{width:"100%",height:"100%"}),a.data("slidelink",1))},endMoveCaption:function(a,e,t,o){if(e=e||a.data("_mw"),t=t||a.data("_pw"),a.data("outstarted",1),a.data("timeline"))a.data("timeline").pause();else if(void 0===a.data("_pw"))return;var r=new punchgs.TimelineLite,p=new punchgs.TimelineLite,h=new punchgs.TimelineLite,c=s(i(),a.data("transform_in"),1==o.sdir),g=a.data("transform_out")?s(n(),a.data("transform_out"),1==o.sdir):s(n(),a.data("transform_in"),1==o.sdir),m=a.data("splitout")&&a.data("splitout").match(/words|chars|lines/g)?a.data("mySplitText")[a.data("splitout")]:a,u=void 0==a.data("endelementdelay")?0:a.data("endelementdelay"),v=a.innerWidth(),f=a.innerHeight(),w=t.position();a.data("transform_out")&&a.data("transform_out").match(/auto:auto/g)&&(c.speed=g.speed,c.anim.ease=g.anim.ease,g=c);var y=l(a.data("mask_out"));g.anim.x=g.anim.x*o.bw||d(g.anim.x,o,v,f,w.top,w.left,"horizontal"),g.anim.y=g.anim.y*o.bw||d(g.anim.y,o,v,f,w.top,w.left,"vertical"),p.eventCallback("onStart",function(){var e={};e.layer=a,e.eventtype="leavestage",e.layertype=a.data("layertype"),e.layersettings=a.data(),o.c.trigger("revolution.layeraction",e)}),p.eventCallback("onComplete",function(){punchgs.TweenLite.set(a,{visibility:"hidden"}),punchgs.TweenLite.set(t,{visibility:"hidden"});var e={};e.layer=a,e.eventtype="leftstage",e.layertype=a.data("layertype"),e.layersettings=a.data(),o.c.trigger("revolution.layeraction",e)}),r.add(p.staggerTo(m,g.speed,g.anim,u),0),y?(y.anim.ease=g.anim.ease,y.anim.overflow="hidden",y.anim.x=y.anim.x*o.bw||d(y.anim.x,o,v,f,w.top,w.left,"horizontal"),y.anim.y=y.anim.y*o.bw||d(y.anim.y,o,v,f,w.top,w.left,"vertical"),r.add(h.to(e,g.speed,y.anim,u),0)):r.add(h.set(e,{overflow:"visible",overwrite:"auto"},u),0),a.data("timeline_out",r)},removeTheCaptions:function(a,e){var i=a.data("index"),n=new Array;e.layers[i]&&jQuery.each(e.layers[i],function(a,e){n.push(e)}),e.layers["static"]&&jQuery.each(e.layers["static"],function(a,e){n.push(e)}),punchgs.TweenLite.killDelayedCallsTo(t.endMoveCaption,!1,e.sliderscrope),n&&jQuery.each(n,function(a){var i=jQuery(this),n=h(i,e,"out");0!=n&&(w(i),clearTimeout(i.data("videoplaywait")),t.stopVideo&&t.stopVideo(i,e),t.endMoveCaption(i,null,null,e),e.playingvideos=[],e.lastplayedvideos=[])})}});var i=function(){var a=new Object;return a.anim=new Object,a.anim.x=0,a.anim.y=0,a.anim.z=0,a.anim.rotationX=0,a.anim.rotationY=0,a.anim.rotationZ=0,a.anim.scaleX=1,a.anim.scaleY=1,a.anim.skewX=0,a.anim.skewY=0,a.anim.opacity=1,a.anim.transformOrigin="50% 50%",a.anim.transformPerspective=600,a.anim.rotation=0,a.anim.ease=punchgs.Power3.easeOut,a.anim.force3D="auto",a.speed=.3,a.anim.autoAlpha=1,a.anim.visibility="visible",a.anim.overwrite="all",a},n=function(){var a=new Object;return a.anim=new Object,a.anim.x=0,a.anim.y=0,a.anim.z=0,a},o=function(){var a=new Object;return a.anim=new Object,a.speed=.2,a},r=function(a,e){if(jQuery.isNumeric(parseFloat(a)))return parseFloat(a);if(void 0===a||"inherit"===a)return e;if(a.split("{").length>1){var t=a.split(","),i=parseFloat(t[1].split("}")[0]);t=parseFloat(t[0].split("{")[1]),a=Math.random()*(i-t)+t}return a},d=function(a,e,t,i,n,o,r){return!jQuery.isNumeric(a)&&a.match(/%]/g)?(a=a.split("[")[1].split("]")[0],"horizontal"==r?a=(t
12551+2)*parseInt(a,0)/100:"vertical"==r&&(a=(i+2)*parseInt(a,0)/100)):(a="layer_left"===a?0-t:"layer_right"===a?t:a,a="layer_top"===a?0-i:"layer_bottom"===a?i:a,a="left"===a||"stage_left"===a?0-t-o:"right"===a||"stage_right"===a?e.conw-o:"center"===a||"stage_center"===a?e.conw/2-t/2-o:a,a="top"===a||"stage_top"===a?0-i-n:"bottom"===a||"stage_bottom"===a?e.conh-n:"middle"===a||"stage_middle"===a?e.conh/2-i/2-n:a),a},s=function(a,e,t){var i=new Object;if(i=jQuery.extend(!0,{},i,a),void 0===e)return i;var n=e.split(";");return n&&jQuery.each(n,function(a,e){var n=e.split(":"),o=n[0],d=n[1];t&&void 0!=d&&d.length>0&&d.match(/\(R\)/)&&(d=d.replace("(R)",""),d="right"===d?"left":"left"===d?"right":"top"===d?"bottom":"bottom"===d?"top":d,"["===d[0]&&"-"===d[1]?d=d.replace("[-","["):"["===d[0]&&"-"!==d[1]?d=d.replace("[","[-"):"-"===d[0]?d=d.replace("-",""):d[0].match(/[1-9]/)&&(d="-"+d)),void 0!=d&&(d=d.replace(/\(R\)/,""),("rotationX"==o||"rX"==o)&&(i.anim.rotationX=r(d,i.anim.rotationX)+"deg"),("rotationY"==o||"rY"==o)&&(i.anim.rotationY=r(d,i.anim.rotationY)+"deg"),("rotationZ"==o||"rZ"==o)&&(i.anim.rotation=r(d,i.anim.rotationZ)+"deg"),("scaleX"==o||"sX"==o)&&(i.anim.scaleX=r(d,i.anim.scaleX)),("scaleY"==o||"sY"==o)&&(i.anim.scaleY=r(d,i.anim.scaleY)),("opacity"==o||"o"==o)&&(i.anim.opacity=r(d,i.anim.opacity)),("skewX"==o||"skX"==o)&&(i.anim.skewX=r(d,i.anim.skewX)),("skewY"==o||"skY"==o)&&(i.anim.skewY=r(d,i.anim.skewY)),"x"==o&&(i.anim.x=r(d,i.anim.x)),"y"==o&&(i.anim.y=r(d,i.anim.y)),"z"==o&&(i.anim.z=r(d,i.anim.z)),("transformOrigin"==o||"tO"==o)&&(i.anim.transformOrigin=d.toString()),("transformPerspective"==o||"tP"==o)&&(i.anim.transformPerspective=parseInt(d,0)),("speed"==o||"s"==o)&&(i.speed=parseFloat(d)/1e3),("ease"==o||"e"==o)&&(i.anim.ease=d))}),i},l=function(a){if(void 0===a)return!1;var e=new Object;e.anim=new Object;var t=a.split(";");return t&&jQuery.each(t,function(a,t){t=t.split(":");var i=t[0],n=t[1];"x"==i&&(e.anim.x=n),"y"==i&&(e.anim.y=n),"s"==i&&(e.speed=parseFloat(n)/1e3),("e"==i||"ease"==i)&&(e.anim.ease=n)}),e},p=function(a,e,t){if(void 0==a&&(a=0),!jQuery.isArray(a)&&"string"===jQuery.type(a)&&(a.split(",").length>1||a.split("[").length>1)){a=a.replace("[",""),a=a.replace("]","");var i=a.match(/'/g)?a.split("',"):a.split(",");a=new Array,i&&jQuery.each(i,function(e,t){t=t.replace("'",""),t=t.replace("'",""),a.push(t)})}else{var n=a;jQuery.isArray(a)||(a=new Array,a.push(n))}var n=a[a.length-1];if(a.length<e.rle)for(var o=1;o<=e.curWinRange;o++)a.push(n);return a},h=function(a,e,t,i){var n=-1;if(a.hasClass("tp-static-layer")){var o=parseInt(a.data("startslide"),0),r=parseInt(a.data("endslide"),0),d=e.c.find(".processing-revslide").index(),s=-1!=d?d:e.c.find(".active-revslide").index();s=-1==s?0:s,"in"===t?a.hasClass("rev-static-visbile")?n=r==s||o>s||s>r?2:0:s>=o&&r>=s||o==s||r==s?(i||(a.addClass("rev-static-visbile"),a.removeClass("rev-static-hidden")),n=1):n=0:a.hasClass("rev-static-visbile")?o>s||s>r?(n=2,i||(a.removeClass("rev-static-visbile"),a.addClass("rev-static-hidden"))):n=0:n=2}return n},c=function(a,e){if(void 0===e)return a;e=e.replace("c:","color:"),e=e.replace("bg:","background-color:"),e=e.replace("bw:","border-width:"),e=e.replace("bc:","border-color:"),e=e.replace("br:","borderRadius:"),e=e.replace("bs:","border-style:"),e=e.replace("td:","text-decoration:");var t=e.split(";");return t&&jQuery.each(t,function(e,t){var i=t.split(":");i[0].length>0&&(a.anim[i[0]]=i[1])}),a},g=function(a,e){var t,i=new Object,n=!1;if("rekursive"==e&&(t=a.closest(".tp-caption"),t&&a.css("fontSize")===t.css("fontSize")&&(n=!0)),i.basealign=a.data("basealign")||"grid",i.fontSize=n?void 0===t.data("fontsize")?parseInt(t.css("fontSize"),0)||0:t.data("fontsize"):void 0===a.data("fontsize")?parseInt(a.css("fontSize"),0)||0:a.data("fontsize"),i.fontWeight=n?void 0===t.data("fontweight")?parseInt(t.css("fontWeight"),0)||0:t.data("fontweight"):void 0===a.data("fontweight")?parseInt(a.css("fontWeight"),0)||0:a.data("fontweight"),i.whiteSpace=n?void 0===t.data("whitespace")?t.css("whitespace")||"normal":t.data("whitespace"):void 0===a.data("whitespace")?a.css("whitespace")||"normal":a.data("whitespace"),i.lineHeight=n?void 0===t.data("lineheight")?parseInt(t.css("lineHeight"),0)||0:t.data("lineheight"):void 0===a.data("lineheight")?parseInt(a.css("lineHeight"),0)||0:a.data("lineheight"),i.letterSpacing=n?void 0===t.data("letterspacing")?parseFloat(t.css("letterSpacing"),0)||0:t.data("letterspacing"):void 0===a.data("letterspacing")?parseFloat(a.css("letterSpacing"))||0:a.data("letterspacing"),i.paddingTop=void 0===a.data("paddingtop")?parseInt(a.css("paddingTop"),0)||0:a.data("paddingtop"),i.paddingBottom=void 0===a.data("paddingbottom")?parseInt(a.css("paddingBottom"),0)||0:a.data("paddingbottom"),i.paddingLeft=void 0===a.data("paddingleft")?parseInt(a.css("paddingLeft"),0)||0:a.data("paddingleft"),i.paddingRight=void 0===a.data("paddingright")?parseInt(a.css("paddingRight"),0)||0:a.data("paddingright"),i.marginTop=void 0===a.data("margintop")?parseInt(a.css("marginTop"),
125510)||0:a.data("margintop"),i.marginBottom=void 0===a.data("marginbottom")?parseInt(a.css("marginBottom"),0)||0:a.data("marginbottom"),i.marginLeft=void 0===a.data("marginleft")?parseInt(a.css("marginLeft"),0)||0:a.data("marginleft"),i.marginRight=void 0===a.data("marginright")?parseInt(a.css("marginRight"),0)||0:a.data("marginright"),i.borderTopWidth=void 0===a.data("bordertopwidth")?parseInt(a.css("borderTopWidth"),0)||0:a.data("bordertopwidth"),i.borderBottomWidth=void 0===a.data("borderbottomwidth")?parseInt(a.css("borderBottomWidth"),0)||0:a.data("borderbottomwidth"),i.borderLeftWidth=void 0===a.data("borderleftwidth")?parseInt(a.css("borderLeftWidth"),0)||0:a.data("borderleftwidth"),i.borderRightWidth=void 0===a.data("borderrightwidth")?parseInt(a.css("borderRightWidth"),0)||0:a.data("borderrightwidth"),"rekursive"!=e){if(i.color=void 0===a.data("color")?"nopredefinedcolor":a.data("color"),i.whiteSpace=n?void 0===t.data("whitespace")?t.css("whiteSpace")||"nowrap":t.data("whitespace"):void 0===a.data("whitespace")?a.css("whiteSpace")||"nowrap":a.data("whitespace"),i.minWidth=void 0===a.data("width")?parseInt(a.css("minWidth"),0)||0:a.data("width"),i.minHeight=void 0===a.data("height")?parseInt(a.css("minHeight"),0)||0:a.data("height"),void 0!=a.data("videowidth")&&void 0!=a.data("videoheight")){var o=a.data("videowidth"),r=a.data("videoheight");o="100%"===o?"none":o,r="100%"===r?"none":r,a.data("width",o),a.data("height",r)}i.maxWidth=void 0===a.data("width")?parseInt(a.css("maxWidth"),0)||"none":a.data("width"),i.maxHeight=void 0===a.data("height")?parseInt(a.css("maxHeight"),0)||"none":a.data("height"),i.wan=void 0===a.data("wan")?parseInt(a.css("-webkit-transition"),0)||"none":a.data("wan"),i.moan=void 0===a.data("moan")?parseInt(a.css("-moz-animation-transition"),0)||"none":a.data("moan"),i.man=void 0===a.data("man")?parseInt(a.css("-ms-animation-transition"),0)||"none":a.data("man"),i.ani=void 0===a.data("ani")?parseInt(a.css("transition"),0)||"none":a.data("ani")}return i.styleProps=a.css(["background-color","border-top-color","border-bottom-color","border-right-color","border-left-color","border-top-style","border-bottom-style","border-left-style","border-right-style","border-left-width","border-right-width","border-bottom-width","border-top-width","color","text-decoration","font-style","border-radius"]),i},m=function(a,e){var t=new Object;return a&&jQuery.each(a,function(i,n){t[i]=p(n,e)[e.curWinRange]||a[i]}),t},u=function(a,e,t,i){return a=jQuery.isNumeric(a)?a*e+"px":a,a="full"===a?i:"auto"===a||"none"===a?t:a},v=function(a,e,t,i){var n;void 0===a.data("cssobj")?(n=g(a,t),a.data("cssobj",n)):n=a.data("cssobj");var o=m(n,e),r=e.bw,d=e.bh;if("off"===i&&(r=1,d=1),"auto"==o.lineHeight&&(o.lineHeight=o.fontSize+4),!a.hasClass("tp-splitted")){a.css("-webkit-transition","none"),a.css("-moz-transition","none"),a.css("-ms-transition","none"),a.css("transition","none");var s=void 0!==a.data("transform_hover")||void 0!==a.data("style_hover");if(s&&punchgs.TweenLite.set(a,o.styleProps),punchgs.TweenLite.set(a,{fontSize:Math.round(o.fontSize*r)+"px",fontWeight:o.fontWeight,letterSpacing:Math.floor(o.letterSpacing*r)+"px",paddingTop:Math.round(o.paddingTop*d)+"px",paddingBottom:Math.round(o.paddingBottom*d)+"px",paddingLeft:Math.round(o.paddingLeft*r)+"px",paddingRight:Math.round(o.paddingRight*r)+"px",marginTop:o.marginTop*d+"px",marginBottom:o.marginBottom*d+"px",marginLeft:o.marginLeft*r+"px",marginRight:o.marginRight*r+"px",borderTopWidth:Math.round(o.borderTopWidth*d)+"px",borderBottomWidth:Math.round(o.borderBottomWidth*d)+"px",borderLeftWidth:Math.round(o.borderLeftWidth*r)+"px",borderRightWidth:Math.round(o.borderRightWidth*r)+"px",lineHeight:Math.round(o.lineHeight*d)+"px",overwrite:"auto"}),"rekursive"!=t){var l="slide"==o.basealign?e.ulw:e.gridwidth[e.curWinRange],p="slide"==o.basealign?e.ulh:e.gridheight[e.curWinRange],h=u(o.maxWidth,r,"none",l),c=u(o.maxHeight,d,"none",p),v=u(o.minWidth,r,"0px",l),f=u(o.minHeight,d,"0px",p);punchgs.TweenLite.set(a,{maxWidth:h,maxHeight:c,minWidth:v,minHeight:f,whiteSpace:o.whiteSpace,overwrite:"auto"}),"nopredefinedcolor"!=o.color&&punchgs.TweenLite.set(a,{color:o.color,overwrite:"auto"})}setTimeout(function(){a.css("-webkit-transition",a.data("wan")),a.css("-moz-transition",a.data("moan")),a.css("-ms-transition",a.data("man")),a.css("transition",a.data("ani"))},30)}},f=function(a,e){if(a.hasClass("rs-pendulum")&&void 0==a.data("loop-timeline")){a.data("loop-timeline",new punchgs.TimelineLite);var t=void 0==a.data("startdeg")?-20:a.data("startdeg"),i=void 0==a.data("enddeg")?20:a.data("enddeg"),n=void 0==a.data("speed")?2:a.data("speed"),o=void 0==a.data("origin")?"50% 50%":a.data("origin"),r=void 0==a.data("easing")?punchgs.Power2.easeInOut:a.data("ease");t*=e,i*=e,a.data("loop-timeline").append(new punchgs.TweenLite.fromTo(a,n,{force3D:"auto",rotation:t,transformOrigin:o},{rotation:i,ease:r})),a.data("loop-timeline").append(new punchgs.TweenLite.fromTo(a,n,{force3D:"auto",rotation:i,transformOrigin:o},{rotation:t,ease:r,onComplete:function(){a.data("loop-timeline").restart()}}))}if(a.hasClass("rs-rotate")&&void 0==a.data("loop-timeline")){a.data("loop-timeline",new punchgs.TimelineLite);var t=void 0==a.data("startdeg")?0:a.data("startdeg"),i=void 0==a.data("enddeg")?360:a.data("enddeg");n=void 0==a.data("speed")?2:a.data("speed"),o=void 0==a.data("origin")?"50% 50%":a.data("origin"),r=void 0==a.data("easing")?punchgs.Power2.easeInOut:a.data("easing"),t*=e,i*=e,a.data("loop-timeline").append(new punchgs.TweenLite.fromTo(a,n,{force3D:"auto",rotation:t,transformOrigin:o},{rotation:i,ease:r,onComplete:function(){a.data("loop-timeline").restart()}}))}if(a.hasClass("rs-slideloop")&&void 0==a.data("loop-timeline")){a.data("loop-timeline",new punchgs.TimelineLite);var d=void 0==a.data("xs")?0:a.data("xs"),s=void 0==a.data("ys")?0:a.data("ys"),l=void 0==a.data("xe")?0:a.data("xe"),p=void 0==a.data("ye")?0:a.data("ye"),n=void 0==a.data("speed")?2:a.data("speed"),r=void 0==a.data("easing")?punchgs.Power2.easeInOut:a.data("easing");d*=e,s*=e,l*=e,p*=e,a.data("loop-timeline").append(new punchgs.TweenLite.fromTo(a,n,{force3D:"auto",x:d,y:s},{x:l,y:p,ease:r})),a.data("loop-timeline").append(new punchgs.TweenLite.fromTo(a,n,{force3D:"auto",x:l,y:p},{x:d,y:s,onComplete:function(){a.data("loop-timeline").restart()}}))}if(a.hasClass("rs-pulse")&&void 0==a.data("loop-timeline")){a.data("loop-timeline",new punchgs.TimelineLite);var h=void 0==a.data("zoomstart")?0:a.data("zoomstart"),c=void 0==a.data("zoomend")?0:a.data("zoomend"),n=void 0==a.data("speed")?2:a.data("speed"),r=void 0==a.data("easing")?punchgs.Power2.easeInOut:a.data("easing");a.data("loop-timeline").append(new punchgs.TweenLite.fromTo(a,n,{force3D:"auto",scale:h},{scale:c,ease:r})),a.data("loop-timeline").append(new punchgs.TweenLite.fromTo(a,n,{force3D:"auto",scale:c},{scale:h,onComplete:function(){a.data("loop-timeline").restart()}}))}if(a.hasClass("rs-wave")&&void 0==a.data("loop-timeline")){a.data("loop-timeline",new punchgs.TimelineLite);var g=void 0==a.data("angle")?10:parseInt(a.data("angle"),0),m=void 0==a.data("radius")?10:parseInt(a.data("radius"),0),n=void 0==a.data("speed")?-20:a.data("speed"),o=void 0==a.data("origin")?"50% 50%":a.data("origin"),u=o.split(" "),v=new Object;u.length>=1?(v.x=u[0],v.y=u[1]):(v.x="50%",v.y="50%"),g*=e,m*=e;var f=0-a.height()/2+m*(-1+parseInt(v.y,0)/100),w=a.width()*(-.5+parseInt(v.x,0)/100),y={a:0,ang:g,element:a,unit:m,xoffset:w,yoffset:f};a.data("loop-timeline").append(new punchgs.TweenLite.fromTo(y,n,{a:360},{a:0,force3D:"auto",ease:punchgs.Linear.easeNone,onUpdate:function(){var a=y.a*(Math.PI/180);punchgs.TweenLite.to(y.element,.1,{force3D:"auto",x:y.xoffset+Math.cos(a)*y.unit,y:y.yoffset+y.unit*(1-Math.sin(a))})},onComplete:function(){a.data("loop-timeline").restart()}}))}},w=function(a){a.find(".rs-pendulum, .rs-slideloop, .rs-pulse, .rs-wave").each(function(){var a=jQuery(this);void 0!=a.data("loop-timeline")&&(a.data("loop-timeline").pause(),a.data("loop-timeline",null))})}}(jQuery); 12552/***************************************************************************************************** 12553 * jquery.themepunch.revmigrate.js - jQuery Plugin for Revolution Slider Migration from 4.x to 5.0 12554 * @version: 1.0.1 (18.08.2015) 12555 * @requires jQuery v1.7 or later (tested on 1.9) 12556 * @author ThemePunch 12557*****************************************************************************************************/ 12558 12559!function(){var t=jQuery.fn.revolution;jQuery.extend(!0,t,{migration:function(t,e){return e=a(e),o(t,e),e}});var a=function(t){if(t.parallaxLevels||t.parallaxBgFreeze){var a=new Object;a.type=t.parallax,a.levels=t.parallaxLevels,a.bgparallax="on"==t.parallaxBgFreeze?"off":"on",a.disable_onmobile=t.parallaxDisableOnMobile,t.parallax=a}if(void 0===t.disableProgressBar&&(t.disableProgressBar=t.hideTimerBar||"off"),(t.startwidth||t.startheight)&&(t.gridwidth=t.startwidth,t.gridheight=t.startheight),void 0===t.sliderType&&(t.sliderType="standard"),"on"===t.fullScreen&&(t.sliderLayout="fullscreen"),"on"===t.fullWidth&&(t.sliderLayout="fullwidth"),void 0===t.sliderLayout&&(t.sliderLayout="auto"),void 0===t.navigation){var o=new Object;if("solo"==t.navigationArrows||"nextto"==t.navigationArrows){var e=new Object;e.enable=!0,e.style=t.navigationStyle||"",e.hide_onmobile="on"===t.hideArrowsOnMobile?!0:!1,e.hide_onleave=t.hideThumbs>0?!0:!1,e.hide_delay=t.hideThumbs>0?t.hideThumbs:200,e.hide_delay_mobile=t.hideNavDelayOnMobile||1500,e.hide_under=0,e.tmp="",e.left={h_align:t.soloArrowLeftHalign,v_align:t.soloArrowLeftValign,h_offset:t.soloArrowLeftHOffset,v_offset:t.soloArrowLeftVOffset},e.right={h_align:t.soloArrowRightHalign,v_align:t.soloArrowRightValign,h_offset:t.soloArrowRightHOffset,v_offset:t.soloArrowRightVOffset},o.arrows=e}if("bullet"==t.navigationType){var r=new Object;r.style=t.navigationStyle||"",r.enable=!0,r.hide_onmobile="on"===t.hideArrowsOnMobile?!0:!1,r.hide_onleave=t.hideThumbs>0?!0:!1,r.hide_delay=t.hideThumbs>0?t.hideThumbs:200,r.hide_delay_mobile=t.hideNavDelayOnMobile||1500,r.hide_under=0,r.direction="horizontal",r.h_align=t.navigationHAlign||"center",r.v_align=t.navigationVAlign||"bottom",r.space=5,r.h_offset=t.navigationHOffset||0,r.v_offset=t.navigationVOffset||20,r.tmp='<span class="tp-bullet-image"></span><span class="tp-bullet-title"></span>',o.bullets=r}if("thumb"==t.navigationType){var i=new Object;i.style=t.navigationStyle||"",i.enable=!0,i.width=t.thumbWidth||100,i.height=t.thumbHeight||50,i.min_width=t.thumbWidth||100,i.wrapper_padding=2,i.wrapper_color="#f5f5f5",i.wrapper_opacity=1,i.visibleAmou
12559nt=t.thumbAmount||3,i.hide_onmobile="on"===t.hideArrowsOnMobile?!0:!1,i.hide_onleave=t.hideThumbs>0?!0:!1,i.hide_delay=t.hideThumbs>0?t.hideThumbs:200,i.hide_delay_mobile=t.hideNavDelayOnMobile||1500,i.hide_under=0,i.direction="horizontal",i.span=!1,i.position="inner",i.space=2,i.h_align=t.navigationHAlign||"center",i.v_align=t.navigationVAlign||"bottom",i.h_offset=t.navigationHOffset||0,i.v_offset=t.navigationVOffset||20,i.tmp='<span class="tp-thumb-image"></span><span class="tp-thumb-title"></span>',o.thumbnails=i}t.navigation=o,t.navigation.keyboardNavigation=t.keyboardNavigation||"on",t.navigation.onHoverStop=t.onHoverStop||"on",t.navigation.touch={touchenabled:t.touchenabled||"on",swipe_treshold:t.swipe_treshold||75,swipe_min_touches:t.swipe_min_touches||1,drag_block_vertical:t.drag_block_vertical||!1}}return t.fallbacks={isJoomla:t.isJoomla||!1,panZoomDisableOnMobile:t.parallaxDisableOnMobile||"off",simplifyAll:t.simplifyAll||"on",nextSlideOnWindowFocus:t.nextSlideOnWindowFocus||"off",disableFocusListener:t.disableFocusListener||!0},t},o=function(t){var a=new Object,o=t.width(),e=t.height();a.skewfromleftshort="x:-50;skX:85;o:0",a.skewfromrightshort="x:50;skX:-85;o:0",a.sfl="x:-50;o:0",a.sfr="x:50;o:0",a.sft="y:-50;o:0",a.sfb="y:50;o:0",a.skewfromleft="x:top;skX:85;o:0",a.skewfromright="x:bottom;skX:-85;o:0",a.lfl="x:top;o:0",a.lfr="x:bottom;o:0",a.lft="y:left;o:0",a.lfb="y:right;o:0",a.fade="o:0";720*Math.random()-360;t.find(".tp-caption").each(function(){var t=jQuery(this),r=(2*Math.random()*o-o,2*Math.random()*e-e,3*Math.random(),720*Math.random()-360,70*Math.random()-35,70*Math.random()-35,t.attr("class"));a.randomrotate="x:{-400,400};y:{-400,400};sX:{0,2};sY:{0,2};rZ:{-180,180};rX:{-180,180};rY:{-180,180};o:0;",r.match("randomrotate")?t.data("transform_in",a.randomrotate):r.match(/\blfl\b/)?t.data("transform_in",a.lfl):r.match(/\blfr\b/)?t.data("transform_in",a.lfr):r.match(/\blft\b/)?t.data("transform_in",a.lft):r.match(/\blfb\b/)?t.data("transform_in",a.lfb):r.match(/\bsfl\b/)?t.data("transform_in",a.sfl):r.match(/\bsfr\b/)?t.data("transform_in",a.sfr):r.match(/\bsft\b/)?t.data("transform_in",a.sft):r.match(/\bsfb\b/)?t.data("transform_in",a.sfb):r.match(/\bskewfromleftshort\b/)?t.data("transform_in",a.skewfromleftshort):r.match(/\bskewfromrightshort\b/)?t.data("transform_in",a.skewfromrightshort):r.match(/\bskewfromleft\b/)?t.data("transform_in",a.skewfromleft):r.match(/\bskewfromright\b/)?t.data("transform_in",a.skewfromright):r.match(/\bfade\b/)&&t.data("transform_in",a.fade),r.match(/\brandomrotateout\b/)?t.data("transform_out",a.randomrotate):r.match(/\bltl\b/)?t.data("transform_out",a.lfl):r.match(/\bltr\b/)?t.data("transform_out",a.lfr):r.match(/\bltt\b/)?t.data("transform_out",a.lft):r.match(/\bltb\b/)?t.data("transform_out",a.lfb):r.match(/\bstl\b/)?t.data("transform_out",a.sfl):r.match(/\bstr\b/)?t.data("transform_out",a.sfr):r.match(/\bstt\b/)?t.data("transform_out",a.sft):r.match(/\bstb\b/)?t.data("transform_out",a.sfb):r.match(/\bskewtoleftshortout\b/)?t.data("transform_out",a.skewfromleftshort):r.match(/\bskewtorightshortout\b/)?t.data("transform_out",a.skewfromrightshort):r.match(/\bskewtoleftout\b/)?t.data("transform_out",a.skewfromleft):r.match(/\bskewtorightout\b/)?t.data("transform_out",a.skewfromright):r.match(/\bfadeout\b/)&&t.data("transform_out",a.fade),void 0!=t.data("customin")&&t.data("transform_in",t.data("customin")),void 0!=t.data("customout")&&t.data("transform_out",t.data("customout"))})}}(jQuery); 12560/******************************************** 12561 * REVOLUTION 5.1.5 EXTENSION - NAVIGATION 12562 * @version: 1.1 (04.01.2016) 12563 * @requires jquery.themepunch.revolution.js 12564 * @author ThemePunch 12565*********************************************/ 12566 12567!function(t){var e=jQuery.fn.revolution,i=e.is_mobile();jQuery.extend(!0,e,{hideUnHideNav:function(t){var e=t.c.width(),i=t.navigation.arrows,a=t.navigation.bullets,n=t.navigation.thumbnails,s=t.navigation.tabs;p(i)&&T(t.c.find(".tparrows"),i.hide_under,e,i.hide_over),p(a)&&T(t.c.find(".tp-bullets"),a.hide_under,e,a.hide_over),p(n)&&T(t.c.parent().find(".tp-thumbs"),n.hide_under,e,n.hide_over),p(s)&&T(t.c.parent().find(".tp-tabs"),s.hide_under,e,s.hide_over),y(t)},resizeThumbsTabs:function(t,e){if(t.navigation&&t.navigation.tabs.enable||t.navigation&&t.navigation.thumbnails.enable){var i=(jQuery(window).width()-480)/500,a=new punchgs.TimelineLite,s=t.navigation.tabs,r=t.navigation.thumbnails,o=t.navigation.bullets;if(a.pause(),i=i>1?1:0>i?0:i,p(s)&&(e||s.width>s.min_width)&&n(i,a,t.c,s,t.slideamount,"tab"),p(r)&&(e||r.width>r.min_width)&&n(i,a,t.c,r,t.slideamount,"thumb"),p(o)&&e){var d=t.c.find(".tp-bullets");d.find(".tp-bullet").each(function(t){var e=jQuery(this),i=t+1,a=e.outerWidth()+parseInt(void 0===o.space?0:o.space,0),n=e.outerHeight()+parseInt(void 0===o.space?0:o.space,0);"vertical"===o.direction?(e.css({top:(i-1)*n+"px",left:"0px"}),d.css({height:(i-1)*n+e.outerHeight(),width:e.outerWidth()})):(e.css({left:(i-1)*a+"px",top:"0px"}),d.css({width:(i-1)*a+e.outerWidth(),height:e.outerHeight()}))})}a.play(),y(t)}return!0},updateNavIndexes:function(t){function i(t){a.find(t).lenght>0&&a.find(t).each(function(t){jQuery(this).data("liindex",t)})}var a=t.c;i(".tp-tab"),i(".tp-bullet"),i(".tp-thumb"),e.resizeThumbsTabs(t,!0),e.manageNavigation(t)},manageNavigation:function(t){var i=e.getHorizontalOffset(t.c.parent(),"left"),n=e.getHorizontalOffset(t.c.parent(),"right");p(t.navigation.bullets)&&("fullscreen"!=t.sliderLayout&&"fullwidth"!=t.sliderLayout&&(t.navigation.bullets.h_offset_old=void 0===t.navigation.bullets.h_offset_old?t.navigation.bullets.h_offset:t.navigation.bullets.h_offset_old,t.n
12567avigation.bullets.h_offset="center"===t.navigation.bullets.h_align?t.navigation.bullets.h_offset_old+i/2-n/2:t.navigation.bullets.h_offset_old+i-n),b(t.c.find(".tp-bullets"),t.navigation.bullets)),p(t.navigation.thumbnails)&&b(t.c.parent().find(".tp-thumbs"),t.navigation.thumbnails),p(t.navigation.tabs)&&b(t.c.parent().find(".tp-tabs"),t.navigation.tabs),p(t.navigation.arrows)&&("fullscreen"!=t.sliderLayout&&"fullwidth"!=t.sliderLayout&&(t.navigation.arrows.left.h_offset_old=void 0===t.navigation.arrows.left.h_offset_old?t.navigation.arrows.left.h_offset:t.navigation.arrows.left.h_offset_old,t.navigation.arrows.left.h_offset="right"===t.navigation.arrows.left.h_align?t.navigation.arrows.left.h_offset_old+n:t.navigation.arrows.left.h_offset_old+i,t.navigation.arrows.right.h_offset_old=void 0===t.navigation.arrows.right.h_offset_old?t.navigation.arrows.right.h_offset:t.navigation.arrows.right.h_offset_old,t.navigation.arrows.right.h_offset="right"===t.navigation.arrows.right.h_align?t.navigation.arrows.right.h_offset_old+n:t.navigation.arrows.right.h_offset_old+i),b(t.c.find(".tp-leftarrow.tparrows"),t.navigation.arrows.left),b(t.c.find(".tp-rightarrow.tparrows"),t.navigation.arrows.right)),p(t.navigation.thumbnails)&&a(t.c.parent().find(".tp-thumbs"),t.navigation.thumbnails),p(t.navigation.tabs)&&a(t.c.parent().find(".tp-tabs"),t.navigation.tabs)},createNavigation:function(t,e){var n=t.parent(),s=e.navigation.arrows,d=e.navigation.bullets,u=e.navigation.thumbnails,v=e.navigation.tabs,m=p(s),b=p(d),_=p(u),y=p(v);r(t,e),o(t,e),m&&f(t,s,e),e.li.each(function(i){var a=jQuery(this);b&&w(t,d,a,e),_&&x(t,u,a,"tp-thumb",e),y&&x(t,v,a,"tp-tab",e)}),t.bind("revolution.slide.onafterswap revolution.nextslide.waiting",function(){var i=0==t.find(".next-revslide").length?t.find(".active-revslide").data("index"):t.find(".next-revslide").data("index");t.find(".tp-bullet").each(function(){var t=jQuery(this);t.data("liref")===i?t.addClass("selected"):t.removeClass("selected")}),n.find(".tp-thumb, .tp-tab").each(function(){var t=jQuery(this);t.data("liref")===i?(t.addClass("selected"),t.hasClass("tp-tab")?a(n.find(".tp-tabs"),v):a(n.find(".tp-thumbs"),u)):t.removeClass("selected")});var r=0,o=!1;e.thumbs&&jQuery.each(e.thumbs,function(t,e){r=o===!1?t:r,o=e.id===i||t===i?!0:o});var d=r>0?r-1:e.slideamount-1,l=r+1==e.slideamount?0:r+1;if(s.enable===!0){var h=s.tmp;jQuery.each(e.thumbs[d].params,function(t,e){h=h.replace(e.from,e.to)}),s.left.j.html(h),h=s.tmp,jQuery.each(e.thumbs[l].params,function(t,e){h=h.replace(e.from,e.to)}),s.right.j.html(h),punchgs.TweenLite.set(s.left.j.find(".tp-arr-imgholder"),{backgroundImage:"url("+e.thumbs[d].src+")"}),punchgs.TweenLite.set(s.right.j.find(".tp-arr-imgholder"),{backgroundImage:"url("+e.thumbs[l].src+")"})}}),h(s),h(d),h(u),h(v),n.on("mouseenter mousemove",function(){n.hasClass("tp-mouseover")||(n.addClass("tp-mouseover"),punchgs.TweenLite.killDelayedCallsTo(g),m&&s.hide_onleave&&g(n.find(".tparrows"),s,"show"),b&&d.hide_onleave&&g(n.find(".tp-bullets"),d,"show"),_&&u.hide_onleave&&g(n.find(".tp-thumbs"),u,"show"),y&&v.hide_onleave&&g(n.find(".tp-tabs"),v,"show"),i&&(n.removeClass("tp-mouseover"),c(t,e)))}),n.on("mouseleave",function(){n.removeClass("tp-mouseover"),c(t,e)}),m&&s.hide_onleave&&g(n.find(".tparrows"),s,"hide",0),b&&d.hide_onleave&&g(n.find(".tp-bullets"),d,"hide",0),_&&u.hide_onleave&&g(n.find(".tp-thumbs"),u,"hide",0),y&&v.hide_onleave&&g(n.find(".tp-tabs"),v,"hide",0),_&&l(n.find(".tp-thumbs"),e),y&&l(n.find(".tp-tabs"),e),"carousel"===e.sliderType&&l(t,e,!0),"on"==e.navigation.touch.touchenabled&&l(t,e,"swipebased")}});var a=function(t,e){var i=(t.hasClass("tp-thumbs")?".tp-thumbs":".tp-tabs",t.hasClass("tp-thumbs")?".tp-thumb-mask":".tp-tab-mask"),a=t.hasClass("tp-thumbs")?".tp-thumbs-inner-wrapper":".tp-tabs-inner-wrapper",n=t.hasClass("tp-thumbs")?".tp-thumb":".tp-tab",s=t.find(i),r=s.find(a),o=e.direction,d="vertical"===o?s.find(n).first().outerHeight(!0)+e.space:s.find(n).first().outerWidth(!0)+e.space,l="vertical"===o?s.height():s.width(),h=parseInt(s.find(n+".selected").data("liindex"),0),p=l/d,u="vertical"===o?s.height():s.width(),c=0-h*d,g="vertical"===o?r.height():r.width(),f=0-(g-u)>c?0-(g-u):f>0?0:c,v=r.data("offset");p>2&&(f=0>=c-(v+d)?0-d>c-(v+d)?v:f+d:f,f=d>c-d+v+l&&c+(Math.round(p)-2)*d<v?c+(Math.round(p)-2)*d:f),f=0-(g-u)>f?0-(g-u):f>0?0:f,"vertical"!==o&&s.width()>=r.width()&&(f=0),"vertical"===o&&s.height()>=r.height()&&(f=0),t.hasClass("dragged")||("vertical"===o?r.data("tmmove",punchgs.TweenLite.to(r,.5,{top:f+"px",ease:punchgs.Power3.easeInOut})):r.data("tmmove",punchgs.TweenLite.to(r,.5,{left:f+"px",ease:punchgs.Power3.easeInOut})),r.data("offset",f))}
12567,n=function(t,e,i,a,n,s){var r=i.parent().find(".tp-"+s+"s"),o=r.find(".tp-"+s+"s-inner-wrapper"),d=r.find(".tp-"+s+"-mask"),l=a.width*t<a.min_width?a.min_width:Math.round(a.width*t),h=Math.round(l/a.width*a.height),p="vertical"===a.direction?l:l*n+a.space*(n-1),u="vertical"===a.direction?h*n+a.space*(n-1):h,c="vertical"===a.direction?{width:l+"px"}:{height:h+"px"};e.add(punchgs.TweenLite.set(r,c)),e.add(punchgs.TweenLite.set(o,{width:p+"px",height:u+"px"})),e.add(punchgs.TweenLite.set(d,{width:p+"px",height:u+"px"}));var g=o.find(".tp-"+s);return g&&jQuery.each(g,function(t,i){"vertical"===a.direction?e.add(punchgs.TweenLite.set(i,{top:t*(h+parseInt(void 0===a.space?0:a.space,0)),width:l+"px",height:h+"px"})):"horizontal"===a.direction&&e.add(punchgs.TweenLite.set(i,{left:t*(l+parseInt(void 0===a.space?0:a.space,0)),width:l+"px",height:h+"px"}))}),e},s=function(t){var e=0,i=0,a=0,n=0,s=1,r=1,o=1;return"detail"in t&&(i=t.detail),"wheelDelta"in t&&(i=-t.wheelDelta/120),"wheelDeltaY"in t&&(i=-t.wheelDeltaY/120),"wheelDeltaX"in t&&(e=-t.wheelDeltaX/120),"axis"in t&&t.axis===t.HORIZONTAL_AXIS&&(e=i,i=0),a=e*s,n=i*s,"deltaY"in t&&(n=t.deltaY),"deltaX"in t&&(a=t.deltaX),(a||n)&&t.deltaMode&&(1==t.deltaMode?(a*=r,n*=r):(a*=o,n*=o)),a&&!e&&(e=1>a?-1:1),n&&!i&&(i=1>n?-1:1),n=navigator.userAgent.match(/mozilla/i)?10*n:n,(n>300||-300>n)&&(n/=10),{spinX:e,spinY:i,pixelX:a,pixelY:n}},r=function(t,i){"on"===i.navigation.keyboardNavigation&&jQuery(document).keydown(function(a){("horizontal"==i.navigation.keyboard_direction&&39==a.keyCode||"vertical"==i.navigation.keyboard_direction&&40==a.keyCode)&&(i.sc_indicator="arrow",i.sc_indicator_dir=0,e.callingNewSlide(i,t,1)),("horizontal"==i.navigation.keyboard_direction&&37==a.keyCode||"vertical"==i.navigation.keyboard_direction&&38==a.keyCode)&&(i.sc_indicator="arrow",i.sc_indicator_dir=1,e.callingNewSlide(i,t,-1))})},o=function(t,i){if("on"===i.navigation.mouseScrollNavigation||"carousel"===i.navigation.mouseScrollNavigation){i.isIEEleven=!!navigator.userAgent.match(/Trident.*rv\:11\./),i.isSafari=!!navigator.userAgent.match(/safari/i),i.ischrome=!!navigator.userAgent.match(/chrome/i);var a=i.ischrome?-49:i.isIEEleven||i.isSafari?-9:navigator.userAgent.match(/mozilla/i)?-29:-49,n=i.ischrome?49:i.isIEEleven||i.isSafari?9:navigator.userAgent.match(/mozilla/i)?29:49;t.on("mousewheel DOMMouseScroll",function(r){var o=s(r.originalEvent),d=t.find(".tp-revslider-slidesli.active-revslide").index(),l=t.find(".tp-revslider-slidesli.processing-revslide").index(),h=-1!=d&&0==d||-1!=l&&0==l?!0:!1,p=-1!=d&&d==i.slideamount-1||1!=l&&l==i.slideamount-1?!0:!1,u=!0;return"carousel"==i.navigation.mouseScrollNavigation&&(h=p=!1),-1==l?o.pixelY<a?h||(i.sc_indicator="arrow",i.sc_indicator_dir=0,e.callingNewSlide(i,t,-1),u=!1):o.pixelY>n&&(p||(i.sc_indicator="arrow",i.sc_indicator_dir=1,e.callingNewSlide(i,t,1),u=!1)):u=!p&&o.spinY>0||!h&&o.spinY<=0?!1:!0,0==u?(r.preventDefault(r),!1):void 0})}},d=function(t,e,a){return t=i?jQuery(a.target).closest("."+t).length||jQuery(a.srcElement).closest("."+t).length:jQuery(a.toElement).closest("."+t).length||jQuery(a.originalTarget).closest("."+t).length,t===!0||1===t?1:0},l=function(t,a,n){t.data("opt",a);var s=a.carousel;jQuery(".bullet, .bullets, .tp-bullets, .tparrows").addClass("noSwipe"),s.Limit="endless";var r=(i||"Firefox"===e.get_browser(),t),o="vertical"===a.navigation.thumbnails.direction||"vertical"===a.navigation.tabs.direction?"none":"vertical",l=a.navigation.touch.swipe_direction||"horizontal";o="swipebased"==n&&"vertical"==l?"none":n?"vertical":o,jQuery.fn.swipetp||(jQuery.fn.swipetp=jQuery.fn.swipe),jQuery.fn.swipetp.defaults&&jQuery.fn.swipetp.defaults.excludedElements||jQuery.fn.swipetp.defaults||(jQuery.fn.swipetp.defaults=new Object),jQuery.fn.swipetp.defaults.excludedElements="label, button, input, select, textarea, .noSwipe",r.swipetp({allowPageScroll:o,triggerOnTouchLeave:!0,treshold:a.navigation.touch.swipe_treshold,fingers:a.navigation.touch.swipe_min_touches,excludeElements:jQuery.fn.swipetp.defaults.excludedElements,swipeStatus:function(i,n,r,o,h,p,u){var c=d("rev_slider_wrapper",t,i),g=d("tp-thumbs",t,i),f=d("tp-tabs",t,i),v=jQuery(this).attr("class"),m=v.match(/tp-tabs|tp-thumb/gi)?!0:!1;if("carousel"===a.sliderType&&(("move"===n||"end"===n||"cancel"==n)&&a.dragStartedOverSlider&&!a.dragStartedOverThumbs&&!a.dragStartedOverTabs||"start"===n&&c>0&&0===g&&0===f))switch(a.dragStartedOverSlider=!0,o=r&&r.match(/left|up/g)?Math.round(-1*o):o=Math.round(1*o),n){case"start":void 0!==s.positionanim&&(s.positionanim.kill(),s.slide_globaloffset="off"===s.infinity?s.slide_offset:e.simp(s.slide_offset,s.maxwidth)),s.overpull="none",s.wrap.addClass("dragged");break;case"move":if(s.slide_offset="off"===s.infinity?s.slide_globaloffset+o:e.simp(s.slide_globaloffset+o,s.maxwidth),"off"===s.infinity){var b="center"===s.horizontal_align?(s.wrapwidth/2-s.slide_width/2-s.slide_offset)/s.slide_width:(0-s.slide_offset)/s.slide_width;
12567"none"!==s.overpull&&0!==s.overpull||!(0>b||b>a.slideamount-1)?b>=0&&b<=a.slideamount-1&&(b>=0&&o>s.overpull||b<=a.slideamount-1&&o<s.overpull)&&(s.overpull=0):s.overpull=o,s.slide_offset=0>b?s.slide_offset+(s.overpull-o)/1.1+Math.sqrt(Math.abs((s.overpull-o)/1.1)):b>a.slideamount-1?s.slide_offset+(s.overpull-o)/1.1-Math.sqrt(Math.abs((s.overpull-o)/1.1)):s.slide_offset}e.organiseCarousel(a,r,!0,!0);break;case"end":case"cancel":s.slide_globaloffset=s.slide_offset,s.wrap.removeClass("dragged"),e.carouselToEvalPosition(a,r),a.dragStartedOverSlider=!1,a.dragStartedOverThumbs=!1,a.dragStartedOverTabs=!1}else{if(("move"!==n&&"end"!==n&&"cancel"!=n||a.dragStartedOverSlider||!a.dragStartedOverThumbs&&!a.dragStartedOverTabs)&&!("start"===n&&c>0&&(g>0||f>0))){if("end"==n&&!m){if(a.sc_indicator="arrow","horizontal"==l&&"left"==r||"vertical"==l&&"up"==r)return a.sc_indicator_dir=0,e.callingNewSlide(a,a.c,1),!1;if("horizontal"==l&&"right"==r||"vertical"==l&&"down"==r)return a.sc_indicator_dir=1,e.callingNewSlide(a,a.c,-1),!1}return a.dragStartedOverSlider=!1,a.dragStartedOverThumbs=!1,a.dragStartedOverTabs=!1,!0}g>0&&(a.dragStartedOverThumbs=!0),f>0&&(a.dragStartedOverTabs=!0);var w=a.dragStartedOverThumbs?".tp-thumbs":".tp-tabs",_=a.dragStartedOverThumbs?".tp-thumb-mask":".tp-tab-mask",x=a.dragStartedOverThumbs?".tp-thumbs-inner-wrapper":".tp-tabs-inner-wrapper",y=a.dragStartedOverThumbs?".tp-thumb":".tp-tab",T=a.dragStartedOverThumbs?a.navigation.thumbnails:a.navigation.tabs;o=r&&r.match(/left|up/g)?Math.round(-1*o):o=Math.round(1*o);var j=t.parent().find(_),L=j.find(x),S=T.direction,C="vertical"===S?L.height():L.width(),I="vertical"===S?j.height():j.width(),k="vertical"===S?j.find(y).first().outerHeight(!0)+T.space:j.find(y).first().outerWidth(!0)+T.space,O=void 0===L.data("offset")?0:parseInt(L.data("offset"),0),Q=0;switch(n){case"start":t.parent().find(w).addClass("dragged"),O="vertical"===S?L.position().top:L.position().left,L.data("offset",O),L.data("tmmove")&&L.data("tmmove").pause();break;case"move":if(I>=C)return!1;Q=O+o,Q=Q>0?"horizontal"===S?Q-L.width()*(Q/L.width()*Q/L.width()):Q-L.height()*(Q/L.height()*Q/L.height()):Q;var M="vertical"===S?0-(L.height()-j.height()):0-(L.width()-j.width());Q=M>Q?"horizontal"===S?Q+L.width()*(Q-M)/L.width()*(Q-M)/L.width():Q+L.height()*(Q-M)/L.height()*(Q-M)/L.height():Q,"vertical"===S?punchgs.TweenLite.set(L,{top:Q+"px"}):punchgs.TweenLite.set(L,{left:Q+"px"});break;case"end":case"cancel":if(m)return Q=O+o,Q="vertical"===S?Q<0-(L.height()-j.height())?0-(L.height()-j.height()):Q:Q<0-(L.width()-j.width())?0-(L.width()-j.width()):Q,Q=Q>0?0:Q,Q=Math.abs(o)>k/10?0>=o?Math.floor(Q/k)*k:Math.ceil(Q/k)*k:0>o?Math.ceil(Q/k)*k:Math.floor(Q/k)*k,Q="vertical"===S?Q<0-(L.height()-j.height())?0-(L.height()-j.height()):Q:Q<0-(L.width()-j.width())?0-(L.width()-j.width()):Q,Q=Q>0?0:Q,"vertical"===S?punchgs.TweenLite.to(L,.5,{top:Q+"px",ease:punchgs.Power3.easeOut}):punchgs.TweenLite.to(L,.5,{left:Q+"px",ease:punchgs.Power3.easeOut}),Q=Q?Q:"vertical"===S?L.position().top:L.position().left,L.data("offset",Q),L.data("distance",o),setTimeout(function(){a.dragStartedOverSlider=!1,a.dragStartedOverThumbs=!1,a.dragStartedOverTabs=!1},100),t.parent().find(w).removeClass("dragged"),!1}}}})},h=function(t){t.hide_delay=jQuery.isNumeric(parseInt(t.hide_delay,0))?t.hide_delay/1e3:.2,t.hide_delay_mobile=jQuery.isNumeric(parseInt(t.hide_delay_mobile,0))?t.hide_delay_mobile/1e3:.2},p=function(t){return t&&t.enable},u=function(t){return t&&t.enable&&t.hide_onleave===!0&&(void 0===t.position?!0:!t.position.match(/outer/g))},c=function(t,e){var a=t.parent();u(e.navigation.arrows)&&punchgs.TweenLite.delayedCall(i?e.navigation.arrows.hide_delay_mobile:e.navigation.arrows.hide_delay,g,[a.find(".tparrows"),e.navigation.arrows,"hide"]),u(e.navigation.bullets)&&punchgs.TweenLite.delayedCall(i?e.navigation.bullets.hide_delay_mobile:e.navigation.bullets.hide_delay,g,[a.find(".tp-bullets"),e.navigation.bullets,"hide"]),u(e.navigation.thumbnails)&&punchgs.TweenLite.delayedCall(i?e.navigation.thumbnails.hide_delay_mobile:e.navigation.thumbnails.hide_delay,g,[a.find(".tp-thumbs"),e.navigation.thumbnails,"hide"]),u(e.navigation.tabs)&&punchgs.TweenLite.delayedCall(i?e.navigation.tabs.hide_delay_mobile:e.navigation.tabs.hide_delay,g,[a.find(".tp-tabs"),e.navigation.tabs,"hide"])}
12567,g=function(t,e,i,a){switch(a=void 0===a?.5:a,i){case"show":punchgs.TweenLite.to(t,a,{autoAlpha:1,ease:punchgs.Power3.easeInOut,overwrite:"auto"});break;case"hide":punchgs.TweenLite.to(t,a,{autoAlpha:0,ease:punchgs.Power3.easeInOu,overwrite:"auto"})}},f=function(t,e,i){e.style=void 0===e.style?"":e.style,e.left.style=void 0===e.left.style?"":e.left.style,e.right.style=void 0===e.right.style?"":e.right.style,0===t.find(".tp-leftarrow.tparrows").length&&t.append('<div class="tp-leftarrow tparrows '+e.style+" "+e.left.style+'">'+e.tmp+"</div>"),0===t.find(".tp-rightarrow.tparrows").length&&t.append('<div class="tp-rightarrow tparrows '+e.style+" "+e.right.style+'">'+e.tmp+"</div>");var a=t.find(".tp-leftarrow.tparrows"),n=t.find(".tp-rightarrow.tparrows");n.click(function(){i.sc_indicator="arrow",i.sc_indicator_dir=0,t.revnext()}),a.click(function(){i.sc_indicator="arrow",i.sc_indicator_dir=1,t.revprev()}),e.right.j=t.find(".tp-rightarrow.tparrows"),e.left.j=t.find(".tp-leftarrow.tparrows"),e.padding_top=parseInt(i.carousel.padding_top||0,0),e.padding_bottom=parseInt(i.carousel.padding_bottom||0,0),b(a,e.left),b(n,e.right),("outer-left"==e.position||"outer-right"==e.position)&&(i.outernav=!0)},v=function(t,e){var i=t.outerHeight(!0),a=(t.outerWidth(!0),"top"===e.v_align?{top:"0px",y:Math.round(e.v_offset)+"px"}:"center"===e.v_align?{top:"50%",y:Math.round(0-i/2+e.v_offset)+"px"}:{top:"100%",y:Math.round(0-(i+e.v_offset))+"px"});t.hasClass("outer-bottom")||punchgs.TweenLite.set(t,a)},m=function(t,e){var i=(t.outerHeight(!0),t.outerWidth(!0)),a="left"===e.h_align?{left:"0px",x:Math.round(e.h_offset)+"px"}:"center"===e.h_align?{left:"50%",x:Math.round(0-i/2+e.h_offset)+"px"}:{left:"100%",x:Math.round(0-(i+e.h_offset))+"px"};punchgs.TweenLite.set(t,a)},b=function(t,e){var i=t.closest(".tp-simpleresponsive").length>0?t.closest(".tp-simpleresponsive"):t.closest(".tp-revslider-mainul").length>0?t.closest(".tp-revslider-mainul"):t.closest(".rev_slider_wrapper").length>0?t.closest(".rev_slider_wrapper"):t.parent().find(".tp-revslider-mainul"),a=i.width(),n=i.height();if(v(t,e),m(t,e),"outer-left"!==e.position||"fullwidth"!=e.sliderLayout&&"fullscreen"!=e.sliderLayout?"outer-right"!==e.position||"fullwidth"!=e.sliderLayout&&"fullscreen"!=e.sliderLayout||punchgs.TweenLite.set(t,{right:0-t.outerWidth()+"px",x:e.h_offset+"px"}):punchgs.TweenLite.set(t,{left:0-t.outerWidth()+"px",x:e.h_offset+"px"}),t.hasClass("tp-thumbs")||t.hasClass("tp-tabs")){var s=t.data("wr_padding"),r=t.data("maxw"),o=t.data("maxh"),d=t.hasClass("tp-thumbs")?t.find(".tp-thumb-mask"):t.find(".tp-tab-mask"),l=parseInt(e.padding_top||0,0),h=parseInt(e.padding_bottom||0,0);r>a&&"outer-left"!==e.position&&"outer-right"!==e.position?(punchgs.TweenLite.set(t,{left:"0px",x:0,maxWidth:a-2*s+"px"}),punchgs.TweenLite.set(d,{maxWidth:a-2*s+"px"})):(punchgs.TweenLite.set(t,{maxWidth:r+"px"}),punchgs.TweenLite.set(d,{maxWidth:r+"px"})),o+2*s>n&&"outer-bottom"!==e.position&&"outer-top"!==e.position?(punchgs.TweenLite.set(t,{top:"0px",y:0,maxHeight:l+h+(n-2*s)+"px"}),punchgs.TweenLite.set(d,{maxHeight:l+h+(n-2*s)+"px"})):(punchgs.TweenLite.set(t,{maxHeight:o+"px"}),punchgs.TweenLite.set(d,{maxHeight:o+"px"})),"outer-left"!==e.position&&"outer-right"!==e.position&&(l=0,h=0),e.span===!0&&"vertical"===e.direction?(punchgs.TweenLite.set(t,{maxHeight:l+h+(n-2*s)+"px",height:l+h+(n-2*s)+"px",top:0-l,y:0}),v(d,e)):e.span===!0&&"horizontal"===e.direction&&(punchgs.TweenLite.set(t,{maxWidth:"100%",width:a-2*s+"px",left:0,x:0}),m(d,e))}},w=function(t,e,i,a){0===t.find(".tp-bullets").length&&(e.style=void 0===e.style?"":e.style,t.append('<div class="tp-bullets '+e.style+" "+e.direction+'"></div>'));var n=t.find(".tp-bullets"),s=i.data("index"),r=e.tmp;jQuery.each(a.thumbs[i.index()].params,function(t,e){r=r.replace(e.from,e.to)}),n.append('<div class="justaddedbullet tp-bullet">'+r+"</div>");var o=t.find(".justaddedbullet"),d=t.find(".tp-bullet").length,l=o.outerWidth()+parseInt(void 0===e.space?0:e.space,0),h=o.outerHeight()+parseInt(void 0===e.space?0:e.space,0);"vertical"===e.direction?(o.css({top:(d-1)*h+"px",left:"0px"}),n.css({height:(d-1)*h+o.outerHeight(),width:o.outerWidth()}
12567)):(o.css({left:(d-1)*l+"px",top:"0px"}),n.css({width:(d-1)*l+o.outerWidth(),height:o.outerHeight()})),o.find(".tp-bullet-image").css({backgroundImage:"url("+a.thumbs[i.index()].src+")"}),o.data("liref",s),o.click(function(){a.sc_indicator="bullet",t.revcallslidewithid(s),t.find(".tp-bullet").removeClass("selected"),jQuery(this).addClass("selected")}),o.removeClass("justaddedbullet"),e.padding_top=parseInt(a.carousel.padding_top||0,0),e.padding_bottom=parseInt(a.carousel.padding_bottom||0,0),("outer-left"==e.position||"outer-right"==e.position)&&(a.outernav=!0),b(n,e)},_=function(t,e){e=parseFloat(e),t=t.replace("#","");var i=parseInt(t.substring(0,2),16),a=parseInt(t.substring(2,4),16),n=parseInt(t.substring(4,6),16),s="rgba("+i+","+a+","+n+","+e+")";return s},x=function(t,e,i,a,n){var s="tp-thumb"===a?".tp-thumbs":".tp-tabs",r="tp-thumb"===a?".tp-thumb-mask":".tp-tab-mask",o="tp-thumb"===a?".tp-thumbs-inner-wrapper":".tp-tabs-inner-wrapper",d="tp-thumb"===a?".tp-thumb":".tp-tab",l="tp-thumb"===a?".tp-thumb-image":".tp-tab-image";if(e.visibleAmount=e.visibleAmount>n.slideamount?n.slideamount:e.visibleAmount,e.sliderLayout=n.sliderLayout,0===t.parent().find(s).length){e.style=void 0===e.style?"":e.style;var h=e.span===!0?"tp-span-wrapper":"",p='<div class="'+a+"s "+h+" "+e.position+" "+e.style+'"><div class="'+a+'-mask"><div class="'+a+'s-inner-wrapper" style="position:relative;"></div></div></div>';"outer-top"===e.position?t.parent().prepend(p):"outer-bottom"===e.position?t.after(p):t.append(p),e.padding_top=parseInt(n.carousel.padding_top||0,0),e.padding_bottom=parseInt(n.carousel.padding_bottom||0,0),("outer-left"==e.position||"outer-right"==e.position)&&(n.outernav=!0)}var u=i.data("index"),c=t.parent().find(s),g=c.find(r),f=g.find(o),v="horizontal"===e.direction?e.width*e.visibleAmount+e.space*(e.visibleAmount-1):e.width,m="horizontal"===e.direction?e.height:e.height*e.visibleAmount+e.space*(e.visibleAmount-1),w=e.tmp;jQuery.each(n.thumbs[i.index()].params,function(t,e){w=w.replace(e.from,e.to)}),f.append('<div data-liindex="'+i.index()+'" data-liref="'+u+'" class="justaddedthumb '+a+'" style="width:'+e.width+"px;height:"+e.height+'px;">'+w+"</div>");var x=c.find(".justaddedthumb"),y=c.find(d).length,T=x.outerWidth()+parseInt(void 0===e.space?0:e.space,0),j=x.outerHeight()+parseInt(void 0===e.space?0:e.space,0);x.find(l).css({backgroundImage:"url("+n.thumbs[i.index()].src+")"}),"vertical"===e.direction?(x.css({top:(y-1)*j+"px",left:"0px"}),f.css({height:(y-1)*j+x.outerHeight(),width:x.outerWidth()})):(x.css({left:(y-1)*T+"px",top:"0px"}),f.css({width:(y-1)*T+x.outerWidth(),height:x.outerHeight()})),c.data("maxw",v),c.data("maxh",m),c.data("wr_padding",e.wrapper_padding);var L="outer-top"===e.position||"outer-bottom"===e.position?"relative":"absolute";"outer-top"!==e.position&&"outer-bottom"!==e.position||"center"!==e.h_align?"0":"auto";g.css({maxWidth:v+"px",maxHeight:m+"px",overflow:"hidden",position:"relative"}),c.css({maxWidth:v+"px",maxHeight:m+"px",overflow:"visible",position:L,background:_(e.wrapper_color,e.wrapper_opacity),padding:e.wrapper_padding+"px",boxSizing:"contet-box"}),x.click(function(){n.sc_indicator="bullet";var e=t.parent().find(o).data("distance");e=void 0===e?0:e,Math.abs(e)<10&&(t.revcallslidewithid(u),t.parent().find(s).removeClass("selected"),jQuery(this).addClass("selected"))}),x.removeClass("justaddedthumb"),b(c,e)},y=function(t){var e=t.c.parent().find(".outer-top"),i=t.c.parent().find(".outer-bottom");t.top_outer=e.hasClass("tp-forcenotvisible")?0:e.outerHeight()||0,t.bottom_outer=i.hasClass("tp-forcenotvisible")?0:i.outerHeight()||0},T=function(t,e,i,a){e>i||i>a?t.addClass("tp-forcenotvisible"):t.removeClass("tp-forcenotvisible")}}(jQuery); 12568/******************************************** 12569 * REVOLUTION 5.1.6 EXTENSION - PARALLAX 12570 * @version: 1.2 (04.01.2016) 12571 * @requires jquery.themepunch.revolution.js 12572 * @author ThemePunch 12573*********************************************/ 12574 12575!function(e){var a=jQuery.fn.revolution,r=a.is_mobile();jQuery.extend(!0,a,{checkForParallax:function(e,t){var o=t.parallax;if(r&&"on"==o.disable_onmobile)return!1;("3D"==o.type||"3d"==o.type)&&(punchgs.TweenLite.set(t.c,{overflow:o.ddd_overflow}),punchgs.TweenLite.set(t.ul,{overflow:o.ddd_overflow}),"carousel"!=t.sliderType&&"on"==o.ddd_shadow&&(t.c.prepend('<div class="dddwrappershadow"></div>'),punchgs.TweenLite.set(t.c.find(".dddwrappershadow"),{force3D:"auto",transformPerspective:1600,transformOrigin:"50% 50%",width:"100%",height:"100%",position:"absolute",top:0,left:0,zIndex:0}))),t.li.each(function(){var e=jQuery(this);if("3D"==o.type||"3d"==o.type){e.find(".slotholder").wrapAll('<div class="dddwrapper" style="width:100%;height:100%;position:absolute;top:0px;left:0px;overflow:hidden"></div>
12575'),e.find(".tp-parallax-wrap").wrapAll('<div class="dddwrapper-layer" style="width:100%;height:100%;position:absolute;top:0px;left:0px;z-index:5;overflow:'+o.ddd_layer_overflow+';"></div>'),e.find(".rs-parallaxlevel-tobggroup").closest(".tp-parallax-wrap").wrapAll('<div class="dddwrapper-layertobggroup" style="position:absolute;top:0px;left:0px;z-index:50;width:100%;height:100%"></div>');var a=e.find(".dddwrapper"),r=e.find(".dddwrapper-layer"),l=e.find(".dddwrapper-layertobggroup");l.appendTo(a),"carousel"==t.sliderType&&("on"==o.ddd_shadow&&a.addClass("dddwrappershadow"),punchgs.TweenLite.set(a,{borderRadius:t.carousel.border_radius})),punchgs.TweenLite.set(e,{overflow:"visible",transformStyle:"preserve-3d",perspective:1600}),punchgs.TweenLite.set(a,{force3D:"auto",transformOrigin:"50% 50%"}),punchgs.TweenLite.set(r,{force3D:"auto",transformOrigin:"50% 50%",zIndex:5}),punchgs.TweenLite.set(t.ul,{transformStyle:"preserve-3d",transformPerspective:1600})}});for(var l=1;l<=o.levels.length;l++)t.c.find(".rs-parallaxlevel-"+l).each(function(){var e=jQuery(this),a=e.closest(".tp-parallax-wrap");a.data("parallaxlevel",o.levels[l-1]),a.addClass("tp-parallax-container")});("mouse"==o.type||"scroll+mouse"==o.type||"mouse+scroll"==o.type||"3D"==o.type||"3d"==o.type)&&(e.mouseenter(function(a){var r=e.find(".active-revslide"),t=e.offset().top,o=e.offset().left,l=a.pageX-o,i=a.pageY-t;r.data("enterx",l),r.data("entery",i)}),e.on("mousemove.hoverdir, mouseleave.hoverdir, trigger3dpath",function(a,r){var l=r&&r.li?r.li:e.find(".active-revslide");if("enterpoint"==o.origo){var i=e.offset().top,s=e.offset().left;void 0==l.data("enterx")&&l.data("enterx",a.pageX-s),void 0==l.data("entery")&&l.data("entery",a.pageY-i);var n=l.data("enterx")||a.pageX-s,d=l.data("entery")||a.pageY-i,p=n-(a.pageX-s),c=d-(a.pageY-i),u=o.speed/1e3||.4}else var i=e.offset().top,s=e.offset().left,p=t.conw/2-(a.pageX-s),c=t.conh/2-(a.pageY-i),u=o.speed/1e3||3;"mouseleave"==a.type&&(p=o.ddd_lasth||0,c=o.ddd_lastv||0,u=1.5);var h=[];if(l.find(".tp-parallax-container").each(function(e){h.push(jQuery(this))}),e.find(".tp-static-layers .tp-parallax-container").each(function(){h.push(jQuery(this))}),jQuery.each(h,function(){var e=jQuery(this),a=parseInt(e.data("parallaxlevel"),0),r="3D"==o.type||"3d"==o.type?a/200:a/100,t=p*r,l=c*r;"scroll+mouse"==o.type||"mouse+scroll"==o.type?punchgs.TweenLite.to(e,u,{force3D:"auto",x:t,ease:punchgs.Power3.easeOut,overwrite:"all"}):punchgs.TweenLite.to(e,u,{force3D:"auto",x:t,y:l,ease:punchgs.Power3.easeOut,overwrite:"all"})}),"3D"==o.type||"3d"==o.type){var f=".tp-revslider-slidesli .dddwrapper, .dddwrappershadow, .tp-revslider-slidesli .dddwrapper-layer";"carousel"===t.sliderType&&(f=".tp-revslider-slidesli .dddwrapper, .tp-revslider-slidesli .dddwrapper-layer"),t.c.find(f).each(function(){var e=jQuery(this),r=o.levels[o.levels.length-1]/200,l=p*r,i=c*r,s=0==t.conw?0:Math.round(p/t.conw*r*100)||0,n=0==t.conh?0:Math.round(c/t.conh*r*100)||0,d=e.closest("li"),h=0,f=!1;e.hasClass("dddwrapper-layer")&&(h=o.ddd_z_correction||65,f=!0),e.hasClass("dddwrapper-layer")&&(l=0,i=0),d.hasClass("active-revslide")||"carousel"!=t.sliderType?"on"!=o.ddd_bgfreeze||f?punchgs.TweenLite.to(e,u,{rotationX:n,rotationY:-s,x:l,z:h,y:i,ease:punchgs.Power3.easeOut,overwrite:"all"}):punchgs.TweenLite.to(e,.5,{force3D:"auto",rotationY:0,rotationX:0,z:0,ease:punchgs.Power3.easeOut,overwrite:"all"}):punchgs.TweenLite.to(e,.5,{force3D:"auto",rotationY:0,z:0,x:0,y:0,rotationX:0,z:0,ease:punchgs.Power3.easeOut,overwrite:"all"}),"mouseleave"==a.type&&punchgs.TweenLite.to(jQuery(this),3.8,{z:0,ease:punchgs.Power3.easeOut})})}}),r&&(window.ondeviceorientation=function(a){var r=Math.round(a.beta||0)-70,l=Math.round(a.gamma||0),i=e.find(".active-revslide");if(jQuery(window).width()>jQuery(window).height()){var s=l;l=r,r=s}var n=e.width(),d=e.height(),p=360/n*l,c=180/d*r,u=o.speed/1e3||3,h=[];if(i.find(".tp-parallax-container").each(function(e){h.push(jQuery(this))}),e.find(".tp-static-layers .tp-parallax-container").each(function(){h.push(jQuery(this))}),jQuery.each(h,function(){var e=jQuery(this),a=parseInt(e.data("parallaxlevel"),0),r=a/100,t=p*r*2,o=c*r*4;punchgs.TweenLite.to(e,u,{force3D:"auto",x:t,y:o,ease:punchgs.Power3.easeOut,overwrite:"all"})}),"3D"==o.type||"3d"==o.type){var f=".tp-revslider-slidesli .dddwrapper, .dddwrappershadow, .tp-revslider-slidesli .dddwrapper-layer";"carousel"===t.sliderType&&(f=".tp-revslider-slidesli .dddwrapper, .tp-revslider-slidesli .dddwrapper-layer"),t.c.find(f).each(function(){var e=jQuery(this),r=o.levels[o.levels.length-1]/200;offsh=p*r,offsv=c*r*3,offrv=0==t.conw?0:Math.round(p/t.conw*r*500)||0,offrh=0==t.conh?0:Math.round(c/t.conh*r*700)||0,li=e.closest("li"),zz=0,itslayer=!1,e.hasClass("dddwrapper-layer")&&(zz=o.ddd_z_correction||65,itslayer=!0),e.hasClass("dddwrapper-layer")&&(offsh=0,offsv=0),li.hasClass("active-revslide")||"carousel"!=t.sliderType?"on"!=o.ddd_bgfreeze||itslayer?punchgs.TweenLite.to(e,u,{rotationX:offrh,rotationY:-offrv,x:offsh,z:zz,y:offsv,ease:punchgs.Power3.easeOut,overwrite:"all"}):punchgs.TweenLite.to(e,.5,{force3D:"auto",rotationY:0,rotationX:0,z:0,ease:punchgs.Power3.easeOut,overwrite:"all"}):punchgs.TweenLite.to(e,.5,{force3D:"auto",rotationY:0,z:0,x:0,y:0,rotationX:0,z:0,ease:punchgs.Power3.easeOut,overwrite:"all"}),"mouseleave"==a.type&&punchgs.TweenLite.to(jQuery(this),3.8,{z:0,ease:punchgs.Power3.easeOut})})}})),a.scrollTicker(t,e)},scrollTicker:function(e,t){1!=e.scrollTicker&&(e.scrollTicker=!0,r?(punchgs.TweenLite.ticker.fps(150),punchgs.TweenLite.ticker.addEventListener("tick",function(){a.scrollHandling(e)},t,!1,1)):jQuery(window).on("scroll mousewheel DOMMouseScroll",function(){a.scrollHandling(e,!0)})),a.scrollHandling(e,!0)},scrollHandling:function(e,t){function o(e,a){e.lastscrolltop=a}e.lastwindowheight=e.lastwindowheight||jQuery(window).height();var l=e.c.offset().top,i=jQuery(window).scrollTop(),s=new Object,n=e.viewPort,d=e.parallax;if(e.lastscrolltop==i&&!e.duringslidechange&&!t)return!1;punchgs.TweenLite.delayedCall(.2,o,[e,i]),s.top=l-i,s.h=0==e.conh?e.c.height():e.conh,s.bottom=l-i+s.h;var p=s.top<0?s.top/s.h:s.bottom>e.lastwindowheight?(s.bottom-e.lastwindowheight)/s.h:0;if(e.scrollproc=p,a.callBackHandling&&a.callBackHandling(e,"parallax","start"),n.enable){var c=1-Math.abs(p);c=0>c?0:c,jQuery.isNumeric(n.visible_area)||-1!==n.visible_area.indexOf("%")&&(n.visible_area=parseInt(n.visible_area)/100),1-n.visible_area<=c?e.inviewport||(e.inviewport=!0,a.enterInViewPort(e)):e.inviewport&&(e.inviewport=!1,a.leaveViewPort(e))}if(r&&"on"==e.parallax.disable_onmobile)return!1;var u=new punchgs.TimelineLite;u.pause(),"3d"!=d.type&&"3D"!=d.type&&(("scroll"==d.type||"scroll+mouse"==d.type||"mouse+scroll"==d.type)&&e.c.find(".tp-
12575parallax-container").each(function(a){var r=jQuery(this),t=parseInt(r.data("parallaxlevel"),0)/100,o=p*-(t*e.conh)||0;r.data("parallaxoffset",o),u.add(punchgs.TweenLite.set(r,{force3D:"auto",y:o}),0)}),e.c.find(".tp-revslider-slidesli .slotholder, .tp-revslider-slidesli .rs-background-video-layer").each(function(){var a=jQuery(this),r=a.data("bgparallax")||e.parallax.bgparallax;if(r="on"==r?1:r,void 0!==r||"off"!==r){var t=e.parallax.levels[parseInt(r,0)-1]/100,o=p*-(t*e.conh)||0;jQuery.isNumeric(o)&&u.add(punchgs.TweenLite.set(a,{position:"absolute",top:"0px",left:"0px",backfaceVisibility:"hidden",force3D:"true",y:o+"px"}),0)}})),a.callBackHandling&&a.callBackHandling(e,"parallax","end"),u.play(0)}})}(jQuery); 12576/************************************************ 12577 * REVOLUTION 5.0 EXTENSION - SLIDE ANIMATIONS 12578 * @version: 1.1.0 (10.11.2015) 12579 * @requires jquery.themepunch.revolution.js 12580 * @author ThemePunch 12581************************************************/ 12582 12583!function(){var t=jQuery.fn.revolution;jQuery.extend(!0,t,{animateSlide:function(t,e,o,a,n,r,s,l,d){return i(t,e,o,a,n,r,s,l,d)}});var e=function(e,o,a,i){var n=e,r=n.find(".defaultimg"),s=n.data("zoomstart"),l=n.data("rotationstart");void 0!=r.data("currotate")&&(l=r.data("currotate")),void 0!=r.data("curscale")&&"box"==i?s=100*r.data("curscale"):void 0!=r.data("curscale")&&(s=r.data("curscale")),t.slotSize(r,o);var d=r.attr("src"),h=r.css("backgroundColor"),f=o.width,c=o.height,p=r.data("fxof"),u=0;"on"==o.autoHeight&&(c=o.c.height()),void 0==p&&(p=0);var g=0,w=r.data("bgfit"),v=r.data("bgrepeat"),m=r.data("bgposition");switch(void 0==w&&(w="cover"),void 0==v&&(v="no-repeat"),void 0==m&&(m="center center"),i){case"box":for(var x=0,y=0,T=0;T<o.slots;T++){y=0;for(var z=0;z<o.slots;z++)n.append('<div class="slot" style="position:absolute;top:'+(u+y)+"px;left:"+(p+x)+"px;width:"+o.slotw+"px;height:"+o.sloth+'px;overflow:hidden;"><div class="slotslide" data-x="'+x+'" data-y="'+y+'" style="position:absolute;top:0px;left:0px;width:'+o.slotw+"px;height:"+o.sloth+'px;overflow:hidden;"><div style="position:absolute;top:'+(0-y)+"px;left:"+(0-x)+"px;width:"+f+"px;height:"+c+"px;background-color:"+h+";background-image:url("+d+");background-repeat:"+v+";background-size:"+w+";background-position:"+m+';"></div></div></div>'),y+=o.sloth,void 0!=s&&void 0!=l&&punchgs.TweenLite.set(n.find(".slot").last(),{rotationZ:l});x+=o.slotw}break;case"vertical":case"horizontal":if("horizontal"==i){if(!a)var g=0-o.slotw;for(var z=0;z<o.slots;z++)n.append('<div class="slot" style="position:absolute;top:'+(0+u)+"px;left:"+(p+z*o.slotw)+"px;overflow:hidden;width:"+(o.slotw+.6)+"px;height:"+c+'px"><div class="slotslide" style="position:absolute;top:0px;left:'+g+"px;width:"+(o.slotw+.6)+"px;height:"+c+'px;overflow:hidden;"><div style="background-color:'+h+";position:absolute;top:0px;left:"+(0-z*o.slotw)+"px;width:"+f+"px;height:"+c+"px;background-image:url("+d+");background-repeat:"+v+";background-size:"+w+";background-position:"+m+';"></div></div></div>'),void 0!=s&&void 0!=l&&punchgs.TweenLite.set(n.find(".slot").last(),{rotationZ:l})}else{if(!a)var g=0-o.sloth;for(var z=0;z<o.slots+2;z++)n.append('<div class="slot" style="position:absolute;top:'+(u+z*o.sloth)+"px;left:"+p+"px;overflow:hidden;width:"+f+"px;height:"+o.sloth+'px"><div class="slotslide" style="position:absolute;top:'+g+"px;left:0px;width:"+f+"px;height:"+o.sloth+'px;overflow:hidden;"><div style="background-color:'+h+";position:absolute;top:"+(0-z*o.sloth)+"px;left:0px;width:"+f+"px;height:"+c+"px;background-image:url("+d+");background-repeat:"+v+";background-size:"+w+";background-position:"+m+';"></div></div></div>'),void 0!=s&&void 0!=l&&punchgs.TweenLite.set(n.find(".slot").last(),{rotationZ:l})}}},o=function(t,e,o,a,i){function n(){jQuery.each(y,function(t,e){(e[0]==o||e[8]==o)&&(w=e[1],v=e[2],m=x),x+=1})}var r=punchgs.Power1.easeIn,s=punchgs.Power1.easeOut,l=punchgs.Power1.easeInOut,d=punchgs.Power2.easeIn,h=punchgs.Power2.easeOut,f=punchgs.Power2.easeInOut,c=(punchgs.Power3.easeIn,punchgs.Power3.easeOut),p=punchgs.Power3.easeInOut,u=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],g=[16,17,18,19,20,21,22,23,24,25,27],w=0,v=1,m=0,x=0,y=(new Array,[["boxslide",0,1,10,0,"box",!1,null,0,s,s,500,6],["boxfade",1,0,10,0,"box",!1,null,1,l,l,700,5],["slotslide-horizontal",2,0,0,200,"horizontal",!0,!1,2,f,f,700,3],["slotslide-vertical",3,0,0,200,"vertical",!0,!1,3,f,f,700,3],["curtain-1",4,3,0,0,"horizontal",!0,!0,4,s,s,300,5],["curtain-2",5,3,0,0,"horizontal",!0,!0,5,s,s,300,5],["curtain-3",6,3,25,0,"horizontal",!0,!0,6,s,s,300,5],["slotzoom-horizontal",7,0,0,400,"horizontal",!0,!0,7,s,s,300,7],["slotzoom-vertical",8,0,0,0,"vertical",!0,!0,8,h,h,500,8],["slotfade-horizontal",9,0,0,500,"horizontal",!0,null,9,h,h,500,25],["slotfade-vertical",10,0,0,500,"vertical",!0,null,10,h,h,500,25],["fade",11,0,1,300,"horizontal",!0,null,11,f,f,1e3,1],["crossfade",11,1,1,300,"horizontal",!0,null,11,f,f,1e3,1],["fadethroughdark",11,2,1,300,"horizontal",!0,null,11,f,f,1e3,1],["fadethroughlight",11,3,1,300,"horizontal",!0,null,11,f,f,1e3,1],["fadethroughtransparent",11,4,1,300,"horizontal",!0,null,11,f,f,1e3,1],["slideleft",12,0,1,0,"horizontal",!0,!0,12,p,p,1e3,1],["slideup",13,0,1,0,"horizontal",!0,!0,13,p,p,1e3,1],["slidedown",14,0,1,0,"horizontal",!0,!0,14,p,p,1e3,1],["slideright",15,0,1,0,"horizontal",!0,!0,15,p,p,1e3,1],["slideoverleft",12,7,1,0,"horizontal",!0,!0,12,p,p,1e3,1],["slideoverup",13,7,1,0,"horizontal",!0,!0,13,p,p,1e3,1],["slideoverdown",14,7,1,0,"horizontal",!0,!0,14,p,p,1e3,1],["slideoverright",15,7,1,0,"horizontal",!0,!0,15,p,p,1e3,1],["slideremoveleft",12,8,1,0,"horizontal",!0,!0,12,p,p,1e3,1],["slideremoveup",13,8,1,0,"horizontal",!0,!0,13,p,p,1e3,1],["slideremovedown",14,8,1,0,"horizontal",!0,!0,14,p,p,1e3,1],["slideremoveright",15,8,1,0,"horizontal",!0,!0,15,p,p,1e3,1],["papercut",16,0,0,600,"",null,null,16,p,p,1e3,2],["3dcurtain-horizontal",17,0,20,100,"vertical",!1,!0,17,l,l,500,7],["3dcurtain-vertical",18,0,10,100,"horizontal",!1,!0,18,l,l,500,5],["cubic",19,0,20,600,"horizontal",!1,!0,19,p,p,500,1],["cube",19,0,20,600,"horizontal",!1,!0,20,p,p,500,1],["flyin",20,0,4,600,"vertical",!1,!0,21,c,p,500,1],["turnoff",21,0,1,500,"horizontal",!1,!0,22,p,p,500,1],["incube",22,0,20,200,"horizontal",!1,!0,23,f,f,500,1],["cubic-horizontal",23,0,20,500,"vertical",!1,!0,24,h,h,500,1],["cube-horizontal",23,0,20,500,"vertical",!1,!0,25,h,h,500,1],["incube-horizontal",24,0,20,500,"vertical",!1,!0,26,f,f,500,1],["turnoff-vertical",25,0,1,200,"horizontal",!1,!0,27,f,f,500,1],["fadefromright",12,1,1,0,"horizontal",!0,!0,28,f,f,1e3,1],["fadefromleft",15,1,1,0,"horizontal",!0,!0,29,f,f,1e3,1],["fadefromto
12583p",14,1,1,0,"horizontal",!0,!0,30,f,f,1e3,1],["fadefrombottom",13,1,1,0,"horizontal",!0,!0,31,f,f,1e3,1],["fadetoleftfadefromright",12,2,1,0,"horizontal",!0,!0,32,f,f,1e3,1],["fadetorightfadefromleft",15,2,1,0,"horizontal",!0,!0,33,f,f,1e3,1],["fadetobottomfadefromtop",14,2,1,0,"horizontal",!0,!0,34,f,f,1e3,1],["fadetotopfadefrombottom",13,2,1,0,"horizontal",!0,!0,35,f,f,1e3,1],["parallaxtoright",12,3,1,0,"horizontal",!0,!0,36,f,d,1500,1],["parallaxtoleft",15,3,1,0,"horizontal",!0,!0,37,f,d,1500,1],["parallaxtotop",14,3,1,0,"horizontal",!0,!0,38,f,r,1500,1],["parallaxtobottom",13,3,1,0,"horizontal",!0,!0,39,f,r,1500,1],["scaledownfromright",12,4,1,0,"horizontal",!0,!0,40,f,d,1e3,1],["scaledownfromleft",15,4,1,0,"horizontal",!0,!0,41,f,d,1e3,1],["scaledownfromtop",14,4,1,0,"horizontal",!0,!0,42,f,d,1e3,1],["scaledownfrombottom",13,4,1,0,"horizontal",!0,!0,43,f,d,1e3,1],["zoomout",13,5,1,0,"horizontal",!0,!0,44,f,d,1e3,1],["zoomin",13,6,1,0,"horizontal",!0,!0,45,f,d,1e3,1],["slidingoverlayup",27,0,1,0,"horizontal",!0,!0,47,l,s,2e3,1],["slidingoverlaydown",28,0,1,0,"horizontal",!0,!0,48,l,s,2e3,1],["slidingoverlayright",30,0,1,0,"horizontal",!0,!0,49,l,s,2e3,1],["slidingoverlayleft",29,0,1,0,"horizontal",!0,!0,50,l,s,2e3,1],["parallaxcirclesup",31,0,1,0,"horizontal",!0,!0,51,f,r,1500,1],["parallaxcirclesdown",32,0,1,0,"horizontal",!0,!0,52,f,r,1500,1],["parallaxcirclesright",33,0,1,0,"horizontal",!0,!0,53,f,r,1500,1],["parallaxcirclesleft",34,0,1,0,"horizontal",!0,!0,54,f,r,1500,1],["notransition",26,0,1,0,"horizontal",!0,null,46,f,d,1e3,1],["parallaxright",12,3,1,0,"horizontal",!0,!0,55,f,d,1500,1],["parallaxleft",15,3,1,0,"horizontal",!0,!0,56,f,d,1500,1],["parallaxup",14,3,1,0,"horizontal",!0,!0,57,f,r,1500,1],["parallaxdown",13,3,1,0,"horizontal",!0,!0,58,f,r,1500,1]]);e.duringslidechange=!0,e.testanims=!1,1==e.testanims&&(e.nexttesttransform=void 0===e.nexttesttransform?34:e.nexttesttransform+1,e.nexttesttransform=e.nexttesttransform>70?0:e.nexttesttransform,o=y[e.nexttesttransform][0],console.log(o+" "+e.nexttesttransform+" "+y[e.nexttesttransform][1]+" "+y[e.nexttesttransform][2])),jQuery.each(["parallaxcircles","slidingoverlay","slide","slideover","slideremove","parallax"],function(t,e){o==e+"horizontal"&&(o=1!=i?e+"left":e+"right"),o==e+"vertical"&&(o=1!=i?e+"up":e+"down")}),"random"==o&&(o=Math.round(Math.random()*y.length-1),o>y.length-1&&(o=y.length-1)),"random-static"==o&&(o=Math.round(Math.random()*u.length-1),o>u.length-1&&(o=u.length-1),o=u[o]),"random-premium"==o&&(o=Math.round(Math.random()*g.length-1),o>g.length-1&&(o=g.length-1),o=g[o]);var T=[12,13,14,15,16,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45];if(1==e.isJoomla&&void 0!=window.MooTools&&-1!=T.indexOf(o)){var z=Math.round(Math.random()*(g.length-2))+1;z>g.length-1&&(z=g.length-1),0==z&&(z=1),o=g[z]}n(),w>30&&(w=30),0>w&&(w=0);var L=new Object;return L.nexttrans=w,L.STA=y[m],L.specials=v,L},a=function(t,e){return void 0==e||jQuery.isNumeric(t)?t:void 0==t?t:t.split(",")[e]},i=function(t,i,n,r,s,l,d,h,f){function c(t,e,o,a,i){var n=t.find(".slot"),r=6,s=[2,1.2,.9,.7,.55,.42],l=t.width(),h=t.height();n.wrap('<div class="slot-circle-wrapper" style="overflow:hidden;position:absolute;border:1px solid #fff"></div>');for(var c=0;r>c;c++)n.parent().clone(!1).appendTo(d);t.find(".slot-circle-wrapper").each(function(t){if(r>t){var a=jQuery(this),n=a.find(".slot"),d=l>h?s[t]*l:s[t]*h,c=d,p=0+(c/2-l/2),u=0+(d/2-h/2),g=0!=t?"50%":"0",w=31==o?h/2-d/2:32==o?h/2-d/2:h/2-d/2,v=33==o?l/2-c/2:34==o?l-c:l/2-c/2,m={scale:1,transformOrigo:"50% 50%",width:c+"px",height:d+"px",top:w+"px",left:v+"px",borderRadius:g},x={scale:1,top:h/2-d/2,left:l/2-c/2,ease:i},y=31==o?u:32==o?u:u,T=33==o?p:34==o?p+l/2:p,z={width:l,height:h,autoAlpha:1,top:y+"px",position:"absolute",left:T+"px"},L={top:u+"px",left:p+"px",ease:i},b=e,D=0;f.add(punchgs.TweenLite.fromTo(a,b,m,x),D),f.add(punchgs.TweenLite.fromTo(n,b,z,L),D),f.add(punchgs.TweenLite.fromTo(a,.001,{autoAlpha:0},{autoAlpha:1}),0)}})}var p=l.index(),u=s.index(),g=p>u?1:0;"arrow"==r.sc_indicator&&(g=r.sc_indicator_dir);var w=o(n,r,i,d,g),v=w.STA,m=w.specials,t=w.nexttrans;"on"==d.data("kenburns")&&(t=11);var x=s.data("nexttransid")||0,y=a(s.data("masterspeed"),x);
12583y="default"===y?v[11]:"random"===y?Math.round(1e3*Math.random()+300):void 0!=y?parseInt(y,0):v[11],y=y>r.delay?r.delay:y,y+=v[4],r.slots=a(s.data("slotamount"),x),r.slots=void 0==r.slots||"default"==r.slots?v[12]:"random"==r.slots?Math.round(12*Math.random()+4):r.slots,r.slots=r.slots<1?"boxslide"==i?Math.round(6*Math.random()+3):"flyin"==i?Math.round(4*Math.random()+1):r.slots:r.slots,r.slots=(4==t||5==t||6==t)&&r.slots<3?3:r.slots,r.slots=0!=v[3]?Math.min(r.slots,v[3]):r.slots,r.slots=9==t?r.width/20:10==t?r.height/20:r.slots,r.rotate=a(s.data("rotate"),x),r.rotate=void 0==r.rotate||"default"==r.rotate?0:999==r.rotate||"random"==r.rotate?Math.round(360*Math.random()):r.rotate,r.rotate=!jQuery.support.transition||r.ie||r.ie9?0:r.rotate,11!=t&&(null!=v[7]&&e(h,r,v[7],v[5]),null!=v[6]&&e(d,r,v[6],v[5])),f.add(punchgs.TweenLite.set(d.find(".defaultvid"),{y:0,x:0,top:0,left:0,scale:1}),0),f.add(punchgs.TweenLite.set(h.find(".defaultvid"),{y:0,x:0,top:0,left:0,scale:1}),0),f.add(punchgs.TweenLite.set(d.find(".defaultvid"),{y:"+0%",x:"+0%"}),0),f.add(punchgs.TweenLite.set(h.find(".defaultvid"),{y:"+0%",x:"+0%"}),0),f.add(punchgs.TweenLite.set(d,{autoAlpha:1,y:"+0%",x:"+0%"}),0),f.add(punchgs.TweenLite.set(h,{autoAlpha:1,y:"+0%",x:"+0%"}),0),f.add(punchgs.TweenLite.set(d.parent(),{backgroundColor:"transparent"}),0),f.add(punchgs.TweenLite.set(h.parent(),{backgroundColor:"transparent"}),0);var T=a(s.data("easein"),x),z=a(s.data("easeout"),x);if(T="default"===T?v[9]||punchgs.Power2.easeInOut:T||v[9]||punchgs.Power2.easeInOut,z="default"===z?v[10]||punchgs.Power2.easeInOut:z||v[10]||punchgs.Power2.easeInOut,0==t){var L=Math.ceil(r.height/r.sloth),b=0;d.find(".slotslide").each(function(t){var e=jQuery(this);b+=1,b==L&&(b=0),f.add(punchgs.TweenLite.from(e,y/600,{opacity:0,top:0-r.sloth,left:0-r.slotw,rotation:r.rotate,force3D:"auto",ease:T}),(15*t+30*b)/1500)})}if(1==t){var D,A=0;d.find(".slotslide").each(function(t){var e=jQuery(this),o=Math.random()*y+300,a=500*Math.random()+200;o+a>D&&(D=a+a,A=t),f.add(punchgs.TweenLite.from(e,o/1e3,{autoAlpha:0,force3D:"auto",rotation:r.rotate,ease:T}),a/1e3)})}if(2==t){var j=new punchgs.TimelineLite;h.find(".slotslide").each(function(){var t=jQuery(this);j.add(punchgs.TweenLite.to(t,y/1e3,{left:r.slotw,ease:T,force3D:"auto",rotation:0-r.rotate}),0),f.add(j,0)}),d.find(".slotslide").each(function(){var t=jQuery(this);j.add(punchgs.TweenLite.from(t,y/1e3,{left:0-r.slotw,ease:T,force3D:"auto",rotation:r.rotate}),0),f.add(j,0)})}if(3==t){var j=new punchgs.TimelineLite;h.find(".slotslide").each(function(){var t=jQuery(this);j.add(punchgs.TweenLite.to(t,y/1e3,{top:r.sloth,ease:T,rotation:r.rotate,force3D:"auto",transformPerspective:600}),0),f.add(j,0)}),d.find(".slotslide").each(function(){var t=jQuery(this);j.add(punchgs.TweenLite.from(t,y/1e3,{top:0-r.sloth,rotation:r.rotate,ease:z,force3D:"auto",transformPerspective:600}),0),f.add(j,0)})}if(4==t||5==t){setTimeout(function(){h.find(".defaultimg").css({opacity:0})},100);var k=y/1e3,j=new punchgs.TimelineLite;h.find(".slotslide").each(function(e){var o=jQuery(this),a=e*k/r.slots;5==t&&(a=(r.slots-e-1)*k/r.slots/1.5),j.add(punchgs.TweenLite.to(o,3*k,{transformPerspective:600,force3D:"auto",top:0+r.height,opacity:.5,rotation:r.rotate,ease:T,delay:a}),0),f.add(j,0)}),d.find(".slotslide").each(function(e){var o=jQuery(this),a=e*k/r.slots;5==t&&(a=(r.slots-e-1)*k/r.slots/1.5),j.add(punchgs.TweenLite.from(o,3*k,{top:0-r.height,opacity:.5,rotation:r.rotate,force3D:"auto",ease:punchgs.eo,delay:a}),0),f.add(j,0)})}if(6==t){r.slots<2&&(r.slots=2),r.slots%2&&(r.slots=r.slots+1);var j=new punchgs.TimelineLite;setTimeout(function(){h.find(".defaultimg").css({opacity:0})},100),h.find(".slotslide").each(function(t){var e=jQuery(this);if(t+1<r.slots/2)var o=90*(t+2);else var o=90*(2+r.slots-t);j.add(punchgs.TweenLite.to(e,(y+o)/1e3,{top:0+r.height,opacity:1,force3D:"auto",rotation:r.rotate,ease:T}),0),f.add(j,0)}),d.find(".slotslide").each(function(t){var e=jQuery(this);if(t+1<r.slots/2)var o=90*(t+2);else var o=90*(2+r.slots-t);j.add(punchgs.TweenLite.from(e,(y+o)/1e3,{top:0-r.height,opacity:1,force3D:"auto",rotation:r.rotate,ease:z}
12583),0),f.add(j,0)})}if(7==t){y=2*y,y>r.delay&&(y=r.delay);var j=new punchgs.TimelineLite;setTimeout(function(){h.find(".defaultimg").css({opacity:0})},100),h.find(".slotslide").each(function(){var t=jQuery(this).find("div");j.add(punchgs.TweenLite.to(t,y/1e3,{left:0-r.slotw/2+"px",top:0-r.height/2+"px",width:2*r.slotw+"px",height:2*r.height+"px",opacity:0,rotation:r.rotate,force3D:"auto",ease:T}),0),f.add(j,0)}),d.find(".slotslide").each(function(t){var e=jQuery(this).find("div");j.add(punchgs.TweenLite.fromTo(e,y/1e3,{left:0,top:0,opacity:0,transformPerspective:600},{left:0-t*r.slotw+"px",ease:z,force3D:"auto",top:"0px",width:r.width,height:r.height,opacity:1,rotation:0,delay:.1}),0),f.add(j,0)})}if(8==t){y=3*y,y>r.delay&&(y=r.delay);var j=new punchgs.TimelineLite;h.find(".slotslide").each(function(){var t=jQuery(this).find("div");j.add(punchgs.TweenLite.to(t,y/1e3,{left:0-r.width/2+"px",top:0-r.sloth/2+"px",width:2*r.width+"px",height:2*r.sloth+"px",force3D:"auto",ease:T,opacity:0,rotation:r.rotate}),0),f.add(j,0)}),d.find(".slotslide").each(function(t){var e=jQuery(this).find("div");j.add(punchgs.TweenLite.fromTo(e,y/1e3,{left:0,top:0,opacity:0,force3D:"auto"},{left:"0px",top:0-t*r.sloth+"px",width:d.find(".defaultimg").data("neww")+"px",height:d.find(".defaultimg").data("newh")+"px",opacity:1,ease:z,rotation:0}),0),f.add(j,0)})}if(9==t||10==t){var M=0;d.find(".slotslide").each(function(t){var e=jQuery(this);M++,f.add(punchgs.TweenLite.fromTo(e,y/1e3,{autoAlpha:0,force3D:"auto",transformPerspective:600},{autoAlpha:1,ease:T,delay:5*t/1e3}),0)})}if(27==t||28==t||29==t||30==t){var P=d.find(".slot"),Q=27==t||28==t?1:2,O=27==t||29==t?"-100%":"+100%",I=27==t||29==t?"+100%":"-100%",X=27==t||29==t?"-80%":"80%",Y=27==t||29==t?"80%":"-80%",S=27==t||29==t?"10%":"-10%",_={overwrite:"all"},C={autoAlpha:0,zIndex:1,force3D:"auto",ease:T},V={position:"inherit",autoAlpha:0,overwrite:"all",zIndex:1},Z={autoAlpha:1,force3D:"auto",ease:z},H={overwrite:"all",zIndex:2},J={autoAlpha:1,force3D:"auto",overwrite:"all",ease:T},N={overwrite:"all",zIndex:2},R={autoAlpha:1,force3D:"auto",ease:T},q=1==Q?"y":"x";_[q]="0px",C[q]=O,V[q]=S,Z[q]="0%",H[q]=I,J[q]=O,N[q]=X,R[q]=Y,P.append('<span style="background-color:rgba(0,0,0,0.6);width:100%;height:100%;position:absolute;top:0px;left:0px;display:block;z-index:2"></span>'),f.add(punchgs.TweenLite.fromTo(h,y/1e3,_,C),0),f.add(punchgs.TweenLite.fromTo(d.find(".defaultimg"),y/2e3,V,Z),y/2e3),f.add(punchgs.TweenLite.fromTo(P,y/1e3,H,J),0),f.add(punchgs.TweenLite.fromTo(P.find(".slotslide div"),y/1e3,N,R),0)}if(31==t||32==t||33==t||34==t){y=6e3,T=punchgs.Power3.easeInOut;var B=y/1e3;mas=B-B/5,_nt=t,fy=31==_nt?"+100%":32==_nt?"-100%":"0%",fx=33==_nt?"+100%":34==_nt?"-100%":"0%",ty=31==_nt?"-100%":32==_nt?"+100%":"0%",tx=33==_nt?"-100%":34==_nt?"+100%":"0%",f.add(punchgs.TweenLite.fromTo(h,B-.2*B,{y:0,x:0},{y:ty,x:tx,ease:z}),.2*B),f.add(punchgs.TweenLite.fromTo(d,B,{y:fy,x:fx},{y:"0%",x:"0%",ease:T}),0),d.find(".slot").remove(),d.find(".defaultimg").clone().appendTo(d).addClass("slot"),c(d,B,_nt,"in",T)}if(11==t){m>4&&(m=0);var M=0,E=2==m?"#000000":3==m?"#ffffff":"transparent";switch(m){case 0:f.add(punchgs.TweenLite.fromTo(d,y/1e3,{autoAlpha:0},{autoAlpha:1,force3D:"auto",ease:T}),0);break;case 1:f.add(punchgs.TweenLite.fromTo(d,y/1e3,{autoAlpha:0},{autoAlpha:1,force3D:"auto",ease:T}),0),f.add(punchgs.TweenLite.fromTo(h,y/1e3,{autoAlpha:1},{autoAlpha:0,force3D:"auto",ease:T}),0);break;case 2:case 3:case 4:f.add(punchgs.TweenLite.set(h.parent(),{backgroundColor:E,force3D:"auto"}),0),f.add(punchgs.TweenLite.set(d.parent(),{backgroundColor:"transparent",force3D:"auto"}),0),f.add(punchgs.TweenLite.to(h,y/2e3,{autoAlpha:0,force3D:"auto",ease:T}),0),f.add(punchgs.TweenLite.fromTo(d,y/2e3,{autoAlpha:0},{autoAlpha:1,force3D:"auto",ease:T}),y/2e3)}f.add(punchgs.TweenLite.set(d.find(".defaultimg"),{autoAlpha:1}),0),f.add(punchgs.TweenLite.set(h.find("defaultimg"),{autoAlpha:1}),0)}if(26==t){var M=0;y=0,f.add(punchgs.TweenLite.fromTo(d,y/1e3,{autoAlpha:0},{autoAlpha:1,force3D:"auto",ease:T}),0),f.add(punchgs.TweenLite.to(h,y/1e3,{autoAlpha:0,force3D:"auto",ease:T}),0),f.add(punchgs.TweenLite.set(d.find(".defaultimg"),{autoAlpha:1}),0),f.add(punchgs.TweenLite.set(h.find("defaultimg"),{autoAlpha:1}),0)}if(12==t||13==t||14==t||15==t){y=y,y>r.delay&&(y=r.delay),setTimeout(function(){punchgs.TweenLite.set(h.find(".defaultimg"),{autoAlpha:0})},100);var F=r.width,G=r.height,K=d.find(".slotslide, .defaultvid"),U=0,W=0,$=1,te=1,ee=1,oe=y/1e3,ae=oe;("fullwidth"==r.sliderLayout||"fullscreen"==r.sliderLayout)&&(F=K.width(),G=K.height()),12==t?U=F:15==t?U=0-F:13==t?W=G:14==t&&(W=0-G),1==m&&($=0),2==m&&($=0),3==m&&(oe=y/1300),(4==m||5==m)&&(te=.6),6==m&&(te=1.4),(5==m||6==m)&&(ee=1.4,$=0,F=0,G=0,U=0,W=0),6==m&&(ee=.6);7==m&&(F=0,G=0);var ie=d.find(".slotslide"),ne=h.find(".slotslide, .defaultvid");if(f.add(punchgs.TweenLite.set(l,{zIndex:15}),0),f.add(punchgs.TweenLite.set(s,{zIndex:20}),0),8==m?(f.add(punchgs.TweenLite.set(l,{zIndex:20}),0),f.add(punchgs.TweenLite.set(s,{zIndex:15}
12583),0),f.add(punchgs.TweenLite.set(ie,{left:0,top:0,scale:1,opacity:1,rotation:0,ease:T,force3D:"auto"}),0)):f.add(punchgs.TweenLite.from(ie,oe,{left:U,top:W,scale:ee,opacity:$,rotation:r.rotate,ease:T,force3D:"auto"}),0),(4==m||5==m)&&(F=0,G=0),1!=m)switch(t){case 12:f.add(punchgs.TweenLite.to(ne,ae,{left:0-F+"px",force3D:"auto",scale:te,opacity:$,rotation:r.rotate,ease:z}),0);break;case 15:f.add(punchgs.TweenLite.to(ne,ae,{left:F+"px",force3D:"auto",scale:te,opacity:$,rotation:r.rotate,ease:z}),0);break;case 13:f.add(punchgs.TweenLite.to(ne,ae,{top:0-G+"px",force3D:"auto",scale:te,opacity:$,rotation:r.rotate,ease:z}),0);break;case 14:f.add(punchgs.TweenLite.to(ne,ae,{top:G+"px",force3D:"auto",scale:te,opacity:$,rotation:r.rotate,ease:z}),0)}}if(16==t){var j=new punchgs.TimelineLite;f.add(punchgs.TweenLite.set(l,{position:"absolute","z-index":20}),0),f.add(punchgs.TweenLite.set(s,{position:"absolute","z-index":15}),0),l.wrapInner('<div class="tp-half-one" style="position:relative; width:100%;height:100%"></div>'),l.find(".tp-half-one").clone(!0).appendTo(l).addClass("tp-half-two"),l.find(".tp-half-two").removeClass("tp-half-one");var F=r.width,G=r.height;"on"==r.autoHeight&&(G=n.height()),l.find(".tp-half-one .defaultimg").wrap('<div class="tp-papercut" style="width:'+F+"px;height:"+G+'px;"></div>'),l.find(".tp-half-two .defaultimg").wrap('<div class="tp-papercut" style="width:'+F+"px;height:"+G+'px;"></div>'),l.find(".tp-half-two .defaultimg").css({position:"absolute",top:"-50%"}),l.find(".tp-half-two .tp-caption").wrapAll('<div style="position:absolute;top:-50%;left:0px;"></div>'),f.add(punchgs.TweenLite.set(l.find(".tp-half-two"),{width:F,height:G,overflow:"hidden",zIndex:15,position:"absolute",top:G/2,left:"0px",transformPerspective:600,transformOrigin:"center bottom"}),0),f.add(punchgs.TweenLite.set(l.find(".tp-half-one"),{width:F,height:G/2,overflow:"visible",zIndex:10,position:"absolute",top:"0px",left:"0px",transformPerspective:600,transformOrigin:"center top"}),0);var re=(l.find(".defaultimg"),Math.round(20*Math.random()-10)),se=Math.round(20*Math.random()-10),le=Math.round(20*Math.random()-10),de=.4*Math.random()-.2,he=.4*Math.random()-.2,fe=1*Math.random()+1,ce=1*Math.random()+1,pe=.3*Math.random()+.3;f.add(punchgs.TweenLite.set(l.find(".tp-half-one"),{overflow:"hidden"}),0),f.add(punchgs.TweenLite.fromTo(l.find(".tp-half-one"),y/800,{width:F,height:G/2,position:"absolute",top:"0px",left:"0px",force3D:"auto",transformOrigin:"center top"},{scale:fe,rotation:re,y:0-G-G/4,autoAlpha:0,ease:T}),0),f.add(punchgs.TweenLite.fromTo(l.find(".tp-half-two"),y/800,{width:F,height:G,overflow:"hidden",position:"absolute",top:G/2,left:"0px",force3D:"auto",transformOrigin:"center bottom"},{scale:ce,rotation:se,y:G+G/4,ease:T,autoAlpha:0,onComplete:function(){punchgs.TweenLite.set(l,{position:"absolute","z-index":15}),punchgs.TweenLite.set(s,{position:"absolute","z-index":20}),l.find(".tp-half-one").length>0&&(l.find(".tp-half-one .defaultimg").unwrap(),l.find(".tp-half-one .slotholder").unwrap()),l.find(".tp-half-two").remove()}}),0),j.add(punchgs.TweenLite.set(d.find(".defaultimg"),{autoAlpha:1}),0),null!=l.html()&&f.add(punchgs.TweenLite.fromTo(s,(y-200)/1e3,{scale:pe,x:r.width/4*de,y:G/4*he,rotation:le,force3D:"auto",transformOrigin:"center center",ease:z},{autoAlpha:1,scale:1,x:0,y:0,rotation:0}),0),f.add(j,0)}if(17==t&&d.find(".slotslide").each(function(t){var e=jQuery(this);f.add(punchgs.TweenLite.fromTo(e,y/800,{opacity:0,rotationY:0,scale:.9,rotationX:-110,force3D:"auto",transformPerspective:600,transformOrigin:"center center"},{opacity:1,top:0,left:0,scale:1,rotation:0,rotationX:0,force3D:"auto",rotationY:0,ease:T,delay:.06*t}),0)}),18==t&&d.find(".slotslide").each(function(t){var e=jQuery(this);f.add(punchgs.TweenLite.fromTo(e,y/500,{autoAlpha:0,rotationY:110,scale:.9,rotationX:10,force3D:"auto",transformPerspective:600,transformOrigin:"center center"},{autoAlpha:1,top:0,left:0,scale:1,rotation:0,rotationX:0,force3D:"auto",rotationY:0,ease:T,delay:.06*t}),0)}),19==t||22==t){var j=new punchgs.TimelineLite;f.add(punchgs.TweenLite.set(l,{zIndex:20}),0),f.add(punchgs.TweenLite.set(s,{zIndex:20}),0),setTimeout(function(){h.find(".defaultimg").css({opacity:0}
12583)},100);var ue=90,$=1,ge="center center ";1==g&&(ue=-90),19==t?(ge=ge+"-"+r.height/2,$=0):ge+=r.height/2,punchgs.TweenLite.set(n,{transformStyle:"flat",backfaceVisibility:"hidden",transformPerspective:600}),d.find(".slotslide").each(function(t){var e=jQuery(this);j.add(punchgs.TweenLite.fromTo(e,y/1e3,{transformStyle:"flat",backfaceVisibility:"hidden",left:0,rotationY:r.rotate,z:10,top:0,scale:1,force3D:"auto",transformPerspective:600,transformOrigin:ge,rotationX:ue},{left:0,rotationY:0,top:0,z:0,scale:1,force3D:"auto",rotationX:0,delay:50*t/1e3,ease:T}),0),j.add(punchgs.TweenLite.to(e,.1,{autoAlpha:1,delay:50*t/1e3}),0),f.add(j)}),h.find(".slotslide").each(function(t){var e=jQuery(this),o=-90;1==g&&(o=90),j.add(punchgs.TweenLite.fromTo(e,y/1e3,{transformStyle:"flat",backfaceVisibility:"hidden",autoAlpha:1,rotationY:0,top:0,z:0,scale:1,force3D:"auto",transformPerspective:600,transformOrigin:ge,rotationX:0},{autoAlpha:1,rotationY:r.rotate,top:0,z:10,scale:1,rotationX:o,delay:50*t/1e3,force3D:"auto",ease:z}),0),f.add(j)}),f.add(punchgs.TweenLite.set(l,{zIndex:18}),0)}if(20==t){if(setTimeout(function(){h.find(".defaultimg").css({opacity:0})},100),1==g)var we=-r.width,ue=80,ge="20% 70% -"+r.height/2;else var we=r.width,ue=-80,ge="80% 70% -"+r.height/2;d.find(".slotslide").each(function(t){var e=jQuery(this),o=50*t/1e3;f.add(punchgs.TweenLite.fromTo(e,y/1e3,{left:we,rotationX:40,z:-600,opacity:$,top:0,scale:1,force3D:"auto",transformPerspective:600,transformOrigin:ge,transformStyle:"flat",rotationY:ue},{left:0,rotationX:0,opacity:1,top:0,z:0,scale:1,rotationY:0,delay:o,ease:T}),0)}),h.find(".slotslide").each(function(t){var e=jQuery(this),o=50*t/1e3;if(o=t>0?o+y/9e3:0,1!=g)var a=-r.width/2,i=30,n="20% 70% -"+r.height/2;else var a=r.width/2,i=-30,n="80% 70% -"+r.height/2;z=punchgs.Power2.easeInOut,f.add(punchgs.TweenLite.fromTo(e,y/1e3,{opacity:1,rotationX:0,top:0,z:0,scale:1,left:0,force3D:"auto",transformPerspective:600,transformOrigin:n,transformStyle:"flat",rotationY:0},{opacity:1,rotationX:20,top:0,z:-600,left:a,force3D:"auto",rotationY:i,delay:o,ease:z}),0)})}if(21==t||25==t){setTimeout(function(){h.find(".defaultimg").css({opacity:0})},100);var ue=90,we=-r.width,ve=-ue;if(1==g)if(25==t){var ge="center top 0";ue=r.rotate}else{var ge="left center 0";ve=r.rotate}else if(we=r.width,ue=-90,25==t){var ge="center bottom 0";ve=-ue,ue=r.rotate}else{var ge="right center 0";ve=r.rotate}d.find(".slotslide").each(function(){var t=jQuery(this),e=y/1.5/3;f.add(punchgs.TweenLite.fromTo(t,2*e/1e3,{left:0,transformStyle:"flat",rotationX:ve,z:0,autoAlpha:0,top:0,scale:1,force3D:"auto",transformPerspective:1200,transformOrigin:ge,rotationY:ue},{left:0,rotationX:0,top:0,z:0,autoAlpha:1,scale:1,rotationY:0,force3D:"auto",delay:e/1e3,ease:T}),0)}),1!=g?(we=-r.width,ue=90,25==t?(ge="center top 0",ve=-ue,ue=r.rotate):(ge="left center 0",ve=r.rotate)):(we=r.width,ue=-90,25==t?(ge="center bottom 0",ve=-ue,ue=r.rotate):(ge="right center 0",ve=r.rotate)),h.find(".slotslide").each(function(){var t=jQuery(this);f.add(punchgs.TweenLite.fromTo(t,y/1e3,{left:0,transformStyle:"flat",rotationX:0,z:0,autoAlpha:1,top:0,scale:1,force3D:"auto",transformPerspective:1200,transformOrigin:ge,rotationY:0},{left:0,rotationX:ve,top:0,z:0,autoAlpha:1,force3D:"auto",scale:1,rotationY:ue,ease:z}),0)})}if(23==t||24==t){setTimeout(function(){h.find(".defaultimg").css({opacity:0})},100);var ue=-90,$=1,me=0;if(1==g&&(ue=90),23==t){var ge="center center -"+r.width/2;$=0}else var ge="center center "+r.width/2;punchgs.TweenLite.set(n,{transformStyle:"preserve-3d",backfaceVisibility:"hidden",perspective:2500}),d.find(".slotslide").each(function(t){var e=jQuery(this);f.add(punchgs.TweenLite.fromTo(e,y/1e3,{left:me,rotationX:r.rotate,force3D:"auto",opacity:$,top:0,scale:1,transformPerspective:1200,transformOrigin:ge,rotationY:ue},{left:0,rotationX:0,autoAlpha:1,top:0,z:0,scale:1,rotationY:0,delay:50*t/500,ease:T}),0)}),ue=90,1==g&&(ue=-90),h.find(".slotslide").each(function(e){var o=jQuery(this);f.add(punchgs.TweenLite.fromTo(o,y/1e3,{left:0,rotationX:0,top:0,z:0,scale:1,force3D:"auto",transformStyle:"flat",transformPerspective:1200,transformOrigin:ge,rotationY:0},{left:me,rotationX:r.rotate,top:0,scale:1,rotationY:ue,delay:50*e/500,ease:z}
12583),0),23==t&&f.add(punchgs.TweenLite.fromTo(o,y/2e3,{autoAlpha:1},{autoAlpha:0,delay:50*e/500+y/3e3,ease:z}),0)})}return f}}(jQuery); 12584/******************************************** 12585 * REVOLUTION 5.1 EXTENSION - VIDEO FUNCTIONS 12586 * @version: 1.2.1 (26.11.2015) 12587 * @requires jquery.themepunch.revolution.js 12588 * @author ThemePunch 12589*********************************************/ 12590 12591!function(e){function t(e){return void 0==e?-1:jQuery.isNumeric(e)?e:e.split(":").length>1?60*parseInt(e.split(":")[0],0)+parseInt(e.split(":")[1],0):e}var a=jQuery.fn.revolution,i=a.is_mobile();jQuery.extend(!0,a,{resetVideo:function(e,d){switch(e.data("videotype")){case"youtube":e.data("player");try{if("on"==e.data("forcerewind")&&!i){var o=t(e.data("videostartat"));o=-1==o?0:o,void 0!=e.data("player")&&(e.data("player").seekTo(o),e.data("player").pauseVideo())}}catch(r){}0==e.find(".tp-videoposter").length&&punchgs.TweenLite.to(e.find("iframe"),.3,{autoAlpha:1,display:"block",ease:punchgs.Power3.easeInOut});break;case"vimeo":var n=$f(e.find("iframe").attr("id"));try{if("on"==e.data("forcerewind")&&!i){var o=t(e.data("videostartat"));o=-1==o?0:o,n.api("seekTo",o),n.api("pause")}}catch(r){}0==e.find(".tp-videoposter").length&&punchgs.TweenLite.to(e.find("iframe"),.3,{autoAlpha:1,display:"block",ease:punchgs.Power3.easeInOut});break;case"html5":if(i&&1==e.data("disablevideoonmobile"))return!1;var s=e.find("video"),l=s[0];if(punchgs.TweenLite.to(s,.3,{autoAlpha:1,display:"block",ease:punchgs.Power3.easeInOut}),"on"==e.data("forcerewind")&&!e.hasClass("videoisplaying"))try{var o=t(e.data("videostartat"));l.currentTime=-1==o?0:o}catch(r){}("mute"==e.data("volume")||a.lastToggleState(e.data("videomutetoggledby")))&&(l.muted=!0)}},isVideoMuted:function(e,t){var a=!1;switch(e.data("videotype")){case"youtube":try{var i=e.data("player");a=i.isMuted()}catch(d){}break;case"vimeo":try{$f(e.find("iframe").attr("id"));"mute"==e.data("volume")&&(a=!0)}catch(d){}break;case"html5":var o=e.find("video"),r=o[0];"mute"==e.data("volume")&&(r.muted=!0)}return a},muteVideo:function(e,t){switch(e.data("videotype")){case"youtube":try{var a=e.data("player");a.mute()}catch(i){}break;case"vimeo":try{var d=$f(e.find("iframe").attr("id"));e.data("volume","mute"),d.api("setVolume",0)}catch(i){}break;case"html5":var o=e.find("video"),r=o[0];r.muted=!0}},unMuteVideo:function(e,t){switch(e.data("videotype")){case"youtube":try{var a=e.data("player");a.unMute()}catch(i){}break;case"vimeo":try{var d=$f(e.find("iframe").attr("id"));e.data("volume","1"),d.api("setVolume",1)}catch(i){}break;case"html5":var o=e.find("video"),r=o[0];r.muted=!1}},stopVideo:function(e,t){switch(e.data("videotype")){case"youtube":try{var a=e.data("player");a.pauseVideo()}catch(i){}break;case"vimeo":try{var d=$f(e.find("iframe").attr("id"));d.api("pause")}catch(i){}break;case"html5":var o=e.find("video"),r=o[0];r.pause()}},playVideo:function(e,o){switch(clearTimeout(e.data("videoplaywait")),e.data("videotype")){case"youtube":if(0==e.find("iframe").length)e.append(e.data("videomarkup")),r(e,o,!0);else if(void 0!=e.data("player").playVideo){var n=t(e.data("videostartat")),s=e.data("player").getCurrentTime();1==e.data("nextslideatend-triggered")&&(s=-1,e.data("nextslideatend-triggered",0)),-1!=n&&n>s&&e.data("player").seekTo(n),e.data("player").playVideo()}else e.data("videoplaywait",setTimeout(function(){a.playVideo(e,o)},50));break;case"vimeo":if(0==e.find("iframe").length)e.append(e.data("videomarkup")),r(e,o,!0);else if(e.hasClass("rs-apiready")){var l=e.find("iframe").attr("id"),p=$f(l);void 0==p.api("play")?e.data("videoplaywait",setTimeout(function(){a.playVideo(e,o)},50)):setTimeout(function(){p.api("play");var a=t(e.data("videostartat")),i=e.data("currenttime");1==e.data("nextslideatend-triggered")&&(i=-1,e.data("nextslideatend-triggered",0)),-1!=a&&a>i&&p.api("seekTo",a)},510)}else e.data("videoplaywait",setTimeout(function(){a.playVideo(e,o)},50));break;case"html5":if(i&&1==e.data("disablevideoonmobile"))return!1;var v=e.find("video"),u=v[0],c=v.parent();if(1!=c.data("metaloaded"))d(u,"loadedmetadata",function(e){a.resetVideo(e,o),u.play();var i=t(e.data("videostartat")),d=u.currentTime;1==e.data("nextslideatend-triggered")&&(d=-1,e.data("nextslideatend-triggered",0)),-1!=i&&i>d&&(u.currentTime=i)}(e));else{u.play();var n=t(e.data("videostartat")),s=u.currentTime;1==e.data("nextslideatend-triggered")&&(s=-1,e.data("nextslideatend-triggered",0)),-1!=n&&n>s&&(u.currentTime=n)}}},isVideoPlaying:function(e,t){var a=!1;return void 0!=t.playingvideos&&jQuery.each(t.playingvideos,function(t,i){e.attr("id")==i.attr("id")&&(a=!0)}),a},prepareCoveredVideo:function(e,t,a){var i=a.find("iframe, video"),d=e.split(":")[0],o=e.split(":")[1],r=a.closest(".tp-revslider-slidesli"),n=r.width()/r.height(),s=d/o,l=n/s*100,p=s/n*100;n>s?punchgs.TweenLite.to(i,.001,{height:l+"%",width:"100%",top:-(l-100)/2+"%",left:"0px",position:"absolute"}):punchgs.TweenLite.to(i,.001,{width:p+"%",height:"100%",left:-(p-100)/2+"%",top:"0px",position:"absolute"})},checkVideoApis:function(e,t,a){var i="https:"===location.protocol?"https":"http";if((void 0!=e.data("ytid")||e.find("iframe").length>0&&e.find("iframe").attr("src").toLowerCase().indexOf("youtube")>0)&&(t.youtubeapineeded=!0),(void 0!=e.data("ytid")||e.find("iframe").length>0&&e.find("iframe").attr("src").toLowerCase().indexOf("youtube")>0)&&0==a.addedyt){t.youtubestarttime=jQuery.now(),a.addedyt=1;var d=document.createElement("script");d.src="https://www.youtube.com/iframe_api";var o=document.getElementsByTagName("script")[0],r=!0;jQuery("head").find("*").each(function(){"https://www.youtube.com/iframe_api"==jQuery(this).attr("src")&&(r=!1)}),r&&o.parentNode.insertBefore(d,o)}if((void 0!=e.data("vimeoid")||e.find("iframe").length>0&&e.find("iframe").attr("src").toLowerCase().indexOf("vimeo")>0)&&(t.vimeoapineeded=!0),(void 0!=e.data("vimeoid")||e.find("iframe").length>0&&e.find("iframe").attr("src").toLowerCase().indexOf("vimeo")>0)&&0==a.addedvim){t.vimeostarttime=jQuery.now(),a.addedvim=1;var n=document.createElement("script"),o=document.getElementsByTagName("script")[0],r=!0;n.src=i+"://f.vimeocdn.com/js/froogaloop2.min.js",jQuery("head").find("*").each(function(){jQuery(this).attr("src")==i+"://a.vimeocdn.com/js/froogaloop2.min.js"&&(r=!1)}),r&&o.parentNode.insertBefore(n,o)}return a},manageVideoLayer:function(e,o,s,l){var p=e.data("videoattributes"),v=e.data("ytid"),u=e.data("vimeoid"),c=e.data("videpreload"),g=e.data("videomp4"),f=e.data("videowebm"),y=e.data("videoogv"),m=e.data("allowfullscreenvideo"),h=e.data("videocontrols"),b="http",w="loop"==e.data("videoloop")?"loop":"loopandnoslidestop"==e.data("videoloop")?"loop":"",T=void 0!=g||void 0!=f?"html5":void 0!=v&&String(v).length>1?"youtube":void 0!=u&&String(u).length>1?"vimeo":"none",k="html5"==T&&0==e.find("video").length?"html5":"youtube"==T&&0==e.find("iframe").length?"youtube":"vimeo"==T&&0==e.find("iframe").length?"vimeo":"none";switch(e.data("videotype",T),k){case"html5":"controls"!=h&&(h="");var x='<video style="object-fit:cover;background-size:cover;visible:hidden;width:100%; height:100%" class="" '+w+' preload="'+c+'">';
12591void 0!=f&&"firefox"==a.get_browser().toLowerCase()&&(x=x+'<source src="'+f+'" type="video/webm" />'),void 0!=g&&(x=x+'<source src="'+g+'" type="video/mp4" />'),void 0!=y&&(x=x+'<source src="'+y+'" type="video/ogg" />'),x+="</video>";var L="";("true"===m||m===!0)&&(L='<div class="tp-video-button-wrap"><button type="button" class="tp-video-button tp-vid-full-screen">Full-Screen</button></div>'),"controls"==h&&(x+='<div class="tp-video-controls"><div class="tp-video-button-wrap"><button type="button" class="tp-video-button tp-vid-play-pause">Play</button></div><div class="tp-video-seek-bar-wrap"><input type="range" class="tp-seek-bar" value="0"></div><div class="tp-video-button-wrap"><button type="button" class="tp-video-button tp-vid-mute">Mute</button></div><div class="tp-video-vol-bar-wrap"><input type="range" class="tp-volume-bar" min="0" max="1" step="0.1" value="1"></div>'+L+"</div>"),e.data("videomarkup",x),e.append(x),(i&&1==e.data("disablevideoonmobile")||a.isIE(8))&&e.find("video").remove(),e.find("video").each(function(t){var i=this,r=jQuery(this);r.parent().hasClass("html5vid")||r.wrap('<div class="html5vid" style="position:relative;top:0px;left:0px;width:100%;height:100%; overflow:hidden;"></div>');var s=r.parent();1!=s.data("metaloaded")&&d(i,"loadedmetadata",function(e){n(e,o),a.resetVideo(e,o)}(e))});break;case"youtube":b="http","https:"===location.protocol&&(b="https"),"none"==h&&(p=p.replace("controls=1","controls=0"),-1==p.toLowerCase().indexOf("controls")&&(p+="&controls=0"));var V=t(e.data("videostartat")),P=t(e.data("videoendat"));-1!=V&&(p=p+"&start="+V),-1!=P&&(p=p+"&end="+P);var I=p.split("origin="+b+"://"),C="";I.length>1?(C=I[0]+"origin="+b+"://",self.location.href.match(/www/gi)&&!I[1].match(/www/gi)&&(C+="www."),C+=I[1]):C=p;var j="true"===m||m===!0?"allowfullscreen":"";e.data("videomarkup",'<iframe style="visible:hidden" src="'+b+"://www.youtube.com/embed/"+v+"?"+C+'" '+j+' width="100%" height="100%" style="width:100%;height:100%"></iframe>');break;case"vimeo":"https:"===location.protocol&&(b="https"),e.data("videomarkup",'<iframe style="visible:hidden" src="'+b+"://player.vimeo.com/video/"+u+"?"+p+'" webkitallowfullscreen mozallowfullscreen allowfullscreen width="100%" height="100%" style="100%;height:100%"></iframe>')}var _=i&&"on"==e.data("noposteronmobile");if(void 0!=e.data("videoposter")&&e.data("videoposter").length>2&&!_)0==e.find(".tp-videoposter").length&&e.append('<div class="tp-videoposter noSwipe" style="cursor:pointer; position:absolute;top:0px;left:0px;width:100%;height:100%;z-index:3;background-image:url('+e.data("videoposter")+'); background-size:cover;background-position:center center;"></div>'),0==e.find("iframe").length&&e.find(".tp-videoposter").click(function(){if(a.playVideo(e,o),i){if(1==e.data("disablevideoonmobile"))return!1;punchgs.TweenLite.to(e.find(".tp-videoposter"),.3,{autoAlpha:0,force3D:"auto",ease:punchgs.Power3.easeInOut}),punchgs.TweenLite.to(e.find("iframe"),.3,{autoAlpha:1,display:"block",ease:punchgs.Power3.easeInOut})}});else{if(i&&1==e.data("disablevideoonmobile"))return!1;0!=e.find("iframe").length||"youtube"!=T&&"vimeo"!=T||(e.append(e.data("videomarkup")),r(e,o,!1))}"none"!=e.data("dottedoverlay")&&void 0!=e.data("dottedoverlay")&&1!=e.find(".tp-dottedoverlay").length&&e.append('<div class="tp-dottedoverlay '+e.data("dottedoverlay")+'"></div>'),e.addClass("HasListener"),1==e.data("bgvideo")&&punchgs.TweenLite.set(e.find("video, iframe"),{autoAlpha:0})}});var d=function(e,t,a){e.addEventListener?e.addEventListener(t,a,!1):e.attachEvent(t,a,!1)},o=function(e,t,a){var i={};return i.video=e,i.videotype=t,i.settings=a,i},r=function(e,d,r){var n=e.find("iframe"),p="iframe"+Math.round(1e5*Math.random()+1),v=e.data("videoloop"),u="loopandnoslidestop"!=v;if(v="loop"==v||"loopandnoslidestop"==v,1==e.data("forcecover")){e.removeClass("fullscreenvideo").addClass("coverscreenvideo");var c=e.data("aspectratio");void 0!=c&&c.split(":").length>1&&a.prepareCoveredVideo(c,d,e)}if(1==e.data("bgvideo")){var c=e.data("aspectratio");void 0!=c&&c.split(":").length>1&&a.prepareCoveredVideo(c,d,e)}if(n.attr("id",p),r&&e.data("startvideonow",!0),1!==e.data("videolistenerexist"))switch(e.data("videotype")){case"youtube":var g=new YT.Player(p,{events:{onStateChange:function(e){var i=e.target.getVideoEmbedCode(),r=jQuery("#"+i.split('id="')[1].split('"')[0]),n=r.closest(".tp-simpleresponsive"),p=r.parent(),c=r.parent().data("player");if(e.data==YT.PlayerState.PLAYING)punchgs.TweenLite.to(p.find(".tp-vi
12591deoposter"),.3,{autoAlpha:0,force3D:"auto",ease:punchgs.Power3.easeInOut}),punchgs.TweenLite.to(p.find("iframe"),.3,{autoAlpha:1,display:"block",ease:punchgs.Power3.easeInOut}),"mute"==p.data("volume")||a.lastToggleState(p.data("videomutetoggledby"))?c.mute():(c.unMute(),c.setVolume(parseInt(p.data("volume"),0)||75)),d.videoplaying=!0,s(p,d),u?d.c.trigger("stoptimer"):d.videoplaying=!1,d.c.trigger("revolution.slide.onvideoplay",o(c,"youtube",p.data())),a.toggleState(p.data("videotoggledby"));else{if(0==e.data&&v){var g=t(p.data("videostartat"));-1!=g&&c.seekTo(g),c.playVideo(),a.toggleState(p.data("videotoggledby"))}(0==e.data||2==e.data)&&"on"==p.data("showcoveronpause")&&p.find(".tp-videoposter").length>0&&(punchgs.TweenLite.to(p.find(".tp-videoposter"),.3,{autoAlpha:1,force3D:"auto",ease:punchgs.Power3.easeInOut}),punchgs.TweenLite.to(p.find("iframe"),.3,{autoAlpha:0,ease:punchgs.Power3.easeInOut})),-1!=e.data&&3!=e.data&&(d.videoplaying=!1,l(p,d),n.trigger("starttimer"),d.c.trigger("revolution.slide.onvideostop",o(c,"youtube",p.data())),(void 0==d.currentLayerVideoIsPlaying||d.currentLayerVideoIsPlaying.attr("id")==p.attr("id"))&&a.unToggleState(p.data("videotoggledby"))),0==e.data&&1==p.data("nextslideatend")?(p.data("nextslideatend-triggered",1),d.c.revnext(),l(p,d)):(l(p,d),d.videoplaying=!1,n.trigger("starttimer"),d.c.trigger("revolution.slide.onvideostop",o(c,"youtube",p.data())),(void 0==d.currentLayerVideoIsPlaying||d.currentLayerVideoIsPlaying.attr("id")==p.attr("id"))&&a.unToggleState(p.data("videotoggledby")))}},onReady:function(e){var a=e.target.getVideoEmbedCode(),d=jQuery("#"+a.split('id="')[1].split('"')[0]),o=d.parent(),r=o.data("videorate");o.data("videostart");if(o.addClass("rs-apiready"),void 0!=r&&e.target.setPlaybackRate(parseFloat(r)),o.find(".tp-videoposter").unbind("click"),o.find(".tp-videoposter").click(function(){i||g.playVideo()}),o.data("startvideonow")){o.data("player").playVideo();var n=t(o.data("videostartat"));-1!=n&&o.data("player").seekTo(n)}o.data("videolistenerexist",1)}}});e.data("player",g);break;case"vimeo":for(var f,y=n.attr("src"),m={},h=y,b=/([^&=]+)=([^&]*)/g;f=b.exec(h);)m[decodeURIComponent(f[1])]=decodeURIComponent(f[2]);y=void 0!=m.player_id?y.replace(m.player_id,p):y+"&player_id="+p;try{y=y.replace("api=0","api=1")}catch(w){}y+="&api=1",n.attr("src",y);var g=e.find("iframe")[0],T=(jQuery("#"+p),$f(p));T.addEvent("ready",function(){if(e.addClass("rs-apiready"),T.addEvent("play",function(t){e.data("nextslidecalled",0),punchgs.TweenLite.to(e.find(".tp-videoposter"),.3,{autoAlpha:0,force3D:"auto",ease:punchgs.Power3.easeInOut}),punchgs.TweenLite.to(e.find("iframe"),.3,{autoAlpha:1,display:"block",ease:punchgs.Power3.easeInOut}),d.c.trigger("revolution.slide.onvideoplay",o(T,"vimeo",e.data())),d.videoplaying=!0,s(e,d),u?d.c.trigger("stoptimer"):d.videoplaying=!1,"mute"==e.data("volume")||a.lastToggleState(e.data("videomutetoggledby"))?T.api("setVolume","0"):T.api("setVolume",parseInt(e.data("volume"),0)/100||.75),a.toggleState(e.data("videotoggledby"))}),T.addEvent("playProgress",function(a){var i=t(e.data("videoendat"));if(e.data("currenttime",a.seconds),0!=i&&Math.abs(i-a.seconds)<.3&&i>a.seconds&&1!=e.data("nextslidecalled"))if(v){T.api("play");var o=t(e.data("videostartat"));-1!=o&&T.api("seekTo",o)}else 1==e.data("nextslideatend")&&(e.data("nextslideatend-triggered",1),e.data("nextslidecalled",1),d.c.revnext()),T.api("pause")}),T.addEvent("finish",function(t){l(e,d),d.videoplaying=!1,d.c.trigger("starttimer"),d.c.trigger("revolution.slide.onvideostop",o(T,"vimeo",e.data())),1==e.data("nextslideatend")&&(e.data("nextslideatend-triggered",1),d.c.revnext()),(void 0==d.currentLayerVideoIsPlaying||d.currentLayerVideoIsPlaying.attr("id")==e.attr("id"))&&a.unToggleState(e.data("videotoggledby"))}),T.addEvent("pause",function(t){e.find(".tp-videoposter").length>0&&"on"==e.data("showcoveronpause")&&(punchgs.TweenLite.to(e.find(".tp-videoposter"),.3,{autoAlpha:1,force3D:"auto",ease:punchgs.Power3.easeInOut}),punchgs.TweenLite.to(e.find("iframe"),.3,{autoAlpha:0,ease:punchgs.Power3.easeInOut})),d.videoplaying=!1,l(e,d),d.c.trigger("starttimer"),d.c.trigger("revolution.slide.onvideostop",o(T,"vimeo",e.data())),(void 0==d.currentLayerVideoIsPlaying||d.currentLayerVideoIsPlaying.attr("id")==e.attr("id"))&&a.unToggleState(e.data("videotoggledby"))}
12591),e.find(".tp-videoposter").unbind("click"),e.find(".tp-videoposter").click(function(){return i?void 0:(T.api("play"),!1)}),e.data("startvideonow")){T.api("play");var r=t(e.data("videostartat"));-1!=r&&T.api("seekTo",r)}e.data("videolistenerexist",1)})}else{var k=t(e.data("videostartat"));switch(e.data("videotype")){case"youtube":r&&(e.data("player").playVideo(),-1!=k&&e.data("player").seekTo());break;case"vimeo":if(r){var T=$f(e.find("iframe").attr("id"));T.api("play"),-1!=k&&T.api("seekTo",k)}}}},n=function(e,r,n){if(i&&1==e.data("disablevideoonmobile"))return!1;var p=e.find("video"),v=p[0],u=p.parent(),c=e.data("videoloop"),g="loopandnoslidestop"!=c;if(c="loop"==c||"loopandnoslidestop"==c,u.data("metaloaded",1),void 0==p.attr("control")&&(0!=e.find(".tp-video-play-button").length||i||e.append('<div class="tp-video-play-button"><i class="revicon-right-dir"></i><span class="tp-revstop"> </span></div>'),e.find("video, .tp-poster, .tp-video-play-button").click(function(){e.hasClass("videoisplaying")?v.pause():v.play()})),1==e.data("forcecover")||e.hasClass("fullscreenvideo")||1==e.data("bgvideo"))if(1==e.data("forcecover")||1==e.data("bgvideo")){u.addClass("fullcoveredvideo");var f=e.data("aspectratio")||"4:3";a.prepareCoveredVideo(f,r,e)}else u.addClass("fullscreenvideo");var y=e.find(".tp-vid-play-pause")[0],m=e.find(".tp-vid-mute")[0],h=e.find(".tp-vid-full-screen")[0],b=e.find(".tp-seek-bar")[0],w=e.find(".tp-volume-bar")[0];void 0!=y&&d(y,"click",function(){1==v.paused?v.play():v.pause()}),void 0!=m&&d(m,"click",function(){0==v.muted?(v.muted=!0,m.innerHTML="Unmute"):(v.muted=!1,m.innerHTML="Mute")}),void 0!=h&&h&&d(h,"click",function(){v.requestFullscreen?v.requestFullscreen():v.mozRequestFullScreen?v.mozRequestFullScreen():v.webkitRequestFullscreen&&v.webkitRequestFullscreen()}),void 0!=b&&(d(b,"change",function(){var e=v.duration*(b.value/100);v.currentTime=e}),d(b,"mousedown",function(){e.addClass("seekbardragged"),v.pause()}),d(b,"mouseup",function(){e.removeClass("seekbardragged"),v.play()})),d(v,"timeupdate",function(){var a=100/v.duration*v.currentTime,i=t(e.data("videoendat")),d=v.currentTime;if(void 0!=b&&(b.value=a),0!=i&&-1!=i&&Math.abs(i-d)<=.3&&i>d&&1!=e.data("nextslidecalled"))if(c){v.play();var o=t(e.data("videostartat"));-1!=o&&(v.currentTime=o)}else 1==e.data("nextslideatend")&&(e.data("nextslideatend-triggered",1),e.data("nextslidecalled",1),r.just_called_nextslide_at_htmltimer=!0,r.c.revnext(),setTimeout(function(){r.just_called_nextslide_at_htmltimer=!1},1e3)),v.pause()}),void 0!=w&&d(w,"change",function(){v.volume=w.value}),d(v,"play",function(){e.data("nextslidecalled",0),"mute"==e.data("volume")&&(v.muted=!0),e.addClass("videoisplaying"),s(e,r),g?(r.videoplaying=!0,r.c.trigger("stoptimer"),r.c.trigger("revolution.slide.onvideoplay",o(v,"html5",e.data()))):(r.videoplaying=!1,r.c.trigger("starttimer"),r.c.trigger("revolution.slide.onvideostop",o(v,"html5",e.data()))),punchgs.TweenLite.to(e.find(".tp-videoposter"),.3,{autoAlpha:0,force3D:"auto",ease:punchgs.Power3.easeInOut}),punchgs.TweenLite.to(e.find("video"),.3,{autoAlpha:1,display:"block",ease:punchgs.Power3.easeInOut});var t=e.find(".tp-vid-play-pause")[0],i=e.find(".tp-vid-mute")[0];void 0!=t&&(t.innerHTML="Pause"),void 0!=i&&v.muted&&(i.innerHTML="Unmute"),a.toggleState(e.data("videotoggledby"))}),d(v,"pause",function(){e.find(".tp-videoposter").length>0&&"on"==e.data("showcoveronpause")&&!e.hasClass("seekbardragged")&&(punchgs.TweenLite.to(e.find(".tp-videoposter"),.3,{autoAlpha:1,force3D:"auto",ease:punchgs.Power3.easeInOut}),punchgs.TweenLite.to(e.find("video"),.3,{autoAlpha:0,ease:punchgs.Power3.easeInOut})),e.removeClass("videoisplaying"),r.videoplaying=!1,l(e,r),r.c.trigger("starttimer"),r.c.trigger("revolution.slide.onvideostop",o(v,"html5",e.data()));var t=e.find(".tp-vid-play-pause")[0];void 0!=t&&(t.innerHTML="Play"),(void 0==r.currentLayerVideoIsPlaying||r.currentLayerVideoIsPlaying.attr("id")==e.attr("id"))&&a.unToggleState(e.data("videotoggledby"))}),d(v,"ended",function(){l(e,r),r.videoplaying=!1,l(e,r),r.c.trigger("starttimer"),r.c.trigger("revolution.slide.onvideostop",o(v,"html5",e.data())),1==e.data("nextslideatend")&&(1==!r.just_called_nextslide_at_htmltimer&&(e.data("nextslideatend-triggered",1),r.c.revnext(),r.just_called_nextslide_at_htmltimer=!0),setTimeout(function(){r.just_called_nextslide_at_htmltimer=!1},1500)),e.removeClass("videoisplaying")})},s=function(e,t){void 0==t.playingvideos&&(t.playingvideos=new Array),e.data("stop
12591allvideos")&&void 0!=t.playingvideos&&t.playingvideos.length>0&&(t.lastplayedvideos=jQuery.extend(!0,[],t.playingvideos),jQuery.each(t.playingvideos,function(e,i){a.stopVideo(i,t)})),t.playingvideos.push(e),t.currentLayerVideoIsPlaying=e},l=function(e,t){void 0!=t.playingvideos&&t.playingvideos.splice(jQuery.inArray(e,t.playingvideos),1)}}(jQuery); 12592jQuery(document).ready(function() { 12593 App.init(); // init core 12594 12595 if(jQuery('#frontpage').length) { 12596 //init main slider 12597 var slider = jQuery('.c-layout-revo-slider .tp-banner'); 12598 var cont = jQuery('.c-layout-revo-slider .tp-banner-container'); 12599 var api = slider.show().revolution({ 12600 delay: 15000, 12601 startwidth:1170, 12602 startheight: 620, 12603 navigationType: "hide", 12604 navigationArrows: "solo", 12605 touchenabled: "on", 12606 onHoverStop: "on", 12607 keyboardNavigation: "off", 12608 navigationStyle: "circle", 12609 navigationHAlign: "center", 12610 navigationVAlign: "center", 12611 fullScreenAlignForce:"off", 12612 shadow: 0, 12613 fullWidth: "on", 12614 fullScreen: "off", 12615 spinner: "spinner2", 12616 forceFullWidth: "on", 12617 hideTimerBar:"on", 12618 hideThumbsOnMobile: "on", 12619 hideNavDelayOnMobile: 1500, 12620 hideBulletsOnMobile: "on", 12621 hideArrowsOnMobile: "on", 12622 hideThumbsUnderResolution: 0, 12623 videoJsPath: "rs-plugin/videojs/", 12624 }); 12625 } 12626}); 12627 12628 12629 12630 12631 12632 12633 12634 12635 12636 12637 12638 12639 12640/* 12641 12642 12643 12644 12645 12646 12647 12648 12649 12650 12651*/ 12652 12653 12654;
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.