-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoctopus-min.js
4 lines (4 loc) · 109 KB
/
octopus-min.js
1
2
3
4
(function(t,e){"use strict";var i,n=i={version:"0.1"};n.define=function(){var t=arguments.length,e=arguments[0],i=arguments[t-1],s="function"==typeof i.initialize?i.initialize:function(){e.apply(this,arguments)};if(t>1){var o=[s,e].concat(Array.prototype.slice.call(arguments).slice(1,t-1),i);n.inherit.apply(null,o)}else s.prototype=i,s.prototype.constructor=s;return s},n.inherit=function(t,e){var i,s=function(){},o=e.prototype;s.prototype=o,i=t.prototype=new s,i.constructor=t;var r,a,l;for(r=2,a=arguments.length;a>r;r++)l=arguments[r],"function"==typeof l&&(l=l.prototype),n.extend(t.prototype,l)},n.extend=function(i,n){if(i=i||{},n){for(var s in n){var o=n[s];o!==e&&(i[s]=o)}var r="function"==typeof t.Event&&n instanceof t.Event;!r&&n.hasOwnProperty&&n.hasOwnProperty("toString")&&(i.toString=n.toString)}return i},n.util=n.util||{},n.util.lastSeqId=0,n.util.createUniqueID=function(t){return t=null===t||t===e?"octopus":t.replace(/\./g,"_"),n.util.lastSeqId++,t+n.util.lastSeqId},t.octopus=n})(window),function(t,e){"use strict";var i=t.util=t.util||{};i.LEFT="left",i.RIGHT="right",i.UP="up",i.DOWN="down",i.getCenter=function(t){for(var e=[],i=[],n=0,s=t.length;s>n;n++)e.push(t[n].pageX),i.push(t[n].pageY);return{pageX:(Math.min.apply(Math,e)+Math.max.apply(Math,e))/2,pageY:(Math.min.apply(Math,i)+Math.max.apply(Math,i))/2}},i.getVelocity=function(t,e,i){return{x:Math.abs(e/t)||0,y:Math.abs(i/t)||0}},i.getAngle=function(t,e){var i=e.pageY-t.pageY,n=e.pageX-t.pageX;return 180*Math.atan2(i,n)/Math.PI},i.getDirection=function(t,e){var n=Math.abs(t.pageX-e.pageX),s=Math.abs(t.pageY-e.pageY);return n>=s?t.pageX-e.pageX>0?i.LEFT:i.RIGHT:t.pageY-e.pageY>0?i.UP:i.DOWN},i.getDistance=function(t,e){var i=e.pageX-t.pageX,n=e.pageY-t.pageY;return Math.sqrt(i*i+n*n)},i.getScale=function(t,e){return t.length>=2&&e.length>=2?this.getDistance(e[0],e[1])/this.getDistance(t[0],t[1]):1},i.getRotation=function(t,e){return t.length>=2&&e.length>=2?this.getAngle(e[1],e[0])-this.getAngle(t[1],t[0]):0},i.encodeHtml=function(t){return(t+"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")},i.htmlDecodeDict={quot:'"',lt:"<",gt:">",amp:"&","#39":"'"},i.decodeHtml=function(t){return(t+"").replace(/&(quot|lt|gt|amp|#39);/gi,function(t,e){return i.htmlDecodeDict[e]}).replace(/&#u([a-f\d]{4});/gi,function(t,e){return String.fromCharCode(parseInt("0x"+e))}).replace(/&#(\d+);/gi,function(t,e){return String.fromCharCode(+e)})},i.loadImage=function(){var t=[],i=null,n=function(){for(var e=0;t.length>e;e++)t[e].end?t.splice(e--,1):t[e]();!t.length&&s()},s=function(){clearInterval(i),i=null};return function(s,o,r,a){var l,u,h,c,d,p=new Image;return p.src=s,p.complete?(o.call(p),r&&r.call(p),e):(u=p.width,h=p.height,p.onerror=function(){a&&a.call(p),l.end=!0,p=p.onload=p.onerror=null},l=function(){c=p.width,d=p.height,(c!==u||d!==h||c*d>1024)&&(o.call(p),l.end=!0)},l(),p.onload=function(){!l.end&&l(),r&&r.call(p),p=p.onload=p.onerror=null},l.end||(t.push(l),null===i&&(i=setInterval(n,40))),e)}}(),i.empty=function(){},i.bind=function(t,e){var i=Array.prototype.slice.apply(arguments,[2]);return function(){var n=i.concat(Array.prototype.slice.apply(arguments,[0]));return t.apply(e,n)}},i.bindAsEventListener=function(t,e){return function(i){return t.call(e,i||window.event)}},i.isNode=function(t){return!(!t||1!==t.nodeType)},i.isObject=function(t){return"function"==typeof t||!(!t||"object"!=typeof t)},i.isString=function(t){return"[object String]"==Object.prototype.toString.call(t)},i.isArray=function(t){return"[object Array]"==Object.prototype.toString.call(t)},i.isNumeric=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},i.isPlain=function(t){var i,n=Object.prototype.hasOwnProperty;if(!(t&&"[object Object]"===Object.prototype.toString.call(t)&&"isPrototypeOf"in t))return!1;if(t.constructor&&!n.call(t,"constructor")&&!n.call(t.constructor.prototype,"isPrototypeOf"))return!1;for(i in t);return i===e||n.call(t,i)},i.isEmpty=function(t){var e,i,n,s,o=[e,null,!1,0,"","0"];for(n=0,s=o.length;s>n;n++)if(t===o[n])return!0;if("object"==typeof t){for(i in t)return!1;return!0}return!1},i.clone=function(t){var e,n,s=t;if(!t||t instanceof Number||t instanceof String||t instanceof Boolean)return s;if(i.isNode(t))return t.cloneNode(!0);if(i.isArray(t)){s=[];for(var o=0,e=0,n=t.length;n>e;e++)s[o++]=i.clone(t[e])}else if(i.isPlain(t)){s={};for(e in t)t.hasOwnProperty(e)&&(s[e]=i.clone(t[e]))}return s},i.each=function(t,e){if(i.isArray(t))return Array.forEach?t.forEach(e):function(t,e){for(var i=t.length,n=0;i>n;n++){var s=e.call(this,t[n],n);if(s===!0)break}}(t,e);if(i.isObject(t))for(var n in t)if(t.hasOwnProperty(n)){var s=e.call(this,t[n],n);if(s===!0)break}return!1},i.applyDefaults=function(t,i){t=t||{};var n="function"==typeof window.Event&&i instanceof window.Event;for(var s in i)(t[s]===e||!n&&i.hasOwnProperty&&i.hasOwnProperty(s)&&!t.hasOwnProperty(s))&&(t[s]=i[s]);return!n&&i&&i.hasOwnProperty&&i.hasOwnProperty("toString")&&!t.hasOwnProperty("toString")&&(t.toString=i.toString),t},i.applyAdd=function(t,n){t=t||{};var s="function"==typeof window.Event&&n instanceof window.Event;for(var o in n)i.isObject(t[o])&&i.isObject(n[o])?t[o]=i.applyAdd(t[o],n[o]):n[o]!==e&&(t[o]=n[o]);return!s&&n&&n.hasOwnProperty&&n.hasOwnProperty("toString")&&!t.hasOwnProperty("toString")&&(t.toString=n.toString),t},i.urlAppend=function(t,e){var i=t;if(e){var n=(t+" ").split(/[?&]/);i+=" "===n.pop()?e:n.length?"&"+e:"?"+e}return i},i.getParameterString=function(t){var i=[];for(var n in t){var s=t[n];if(null!=s&&"function"!=typeof s){var o;if("object"==typeof s&&s.constructor==Array){for(var r,a=[],l=0,u=s.length;u>l;l++)r=s[l],a.push(encodeURIComponent(null===r||r===e?"":r));o=a.join(",")}else o=encodeURIComponent(s);i.push(encodeURIComponent(n)+"="+o)}}return i.join("&")},i.getParameters=function(t){t=null===t||t===e?window.location.href:t;var i="";if(-1!=t.indexOf("?")){var n=t.indexOf("?")+1,s=-1!=t.indexOf("#")?t.indexOf("#"):t.length;i=t.substring(n,s)}for(var o={},r=i.split(/[&;]/),a=0,l=r.length;l>a;a++){var u=r[a].split("=");if(u[0]){var h=u[0];try{h=decodeURIComponent(h)}catch(c){h=unescape(h)}var d=(u[1]||"").replace(/\+/g," ");try{d=decodeURIComponent(d)}catch(c){d=unescape(d)}d=d.split(","),1==d.length&&(d=d[0]),o[h]=d}}return o},i.createUrlObject=function(t,e){if(e=e||{},t=t||window.location.href,!/^\w+:\/\//.test(t)){var n=window.location,s=n.port?":"+n.port:"",o=n.protocol+"//"+n.host.split(":").shift()+s;if(0===t.indexOf("/"))t=o+t;else{var r=n.pathname.split("/");r.pop(),t=o+r.join("/")+"/"+t}}e.ignoreCase&&(t=t.toLowerCase());var a=document.createElement("a");a.href=t;var l={};l.host=a.host.split(":").shift(),l.protocol=a.protocol,l.port=e.ignorePort80?"80"==a.port||"0"==a.port?"":a.port:""==a.port||"0"==a.port?"80":a.port,l.hash=e.ignoreHash||"#"===a.hash?"":a.hash;var u=a.search;if(!u){var h=t.indexOf("?");u=-1!=h?t.substr(h):""}return l.args=i.getParameters(u),l.pathname="/"==a.pathname.charAt(0)?a.pathname:"/"+a.pathname,l},i.trim=function(t){return t+="",t.trim?t.trim():t.replace(RegExp("(^[\\s\\t\\xa0\\u3000]+)|([\\u3000\\xa0\\s\\t]+$)","g"),"")},i.removeItem=function(t,e){for(var i=t.length,n=i;n--;)t[n]===e&&t.splice(n,1);return t},i.upperCaseObject=function(t){var e={};for(var i in t)e[i.toUpperCase()]=t[i];return e},i.camelize=function(t){for(var e=t.split(/[\-|_|\s|\.]/g),i=e[0],n=1,s=e.length;s>n;n++){var o=e[n];i+=o.charAt(0).toUpperCase()+o.substring(1)}return i},i.styleCss=function(t){var e=!0,t=t.replace(/\-(\S)/g,function(t,i){return e?(e=!1,i):i.toUpperCase()});return t},i.cssStyle=function(t){var t=t.replace(/(^\S|[A-Z])/g,function(t){return"-"+t.toLowerCase()});return t},i.requestAnimation=function(){var t=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){window.setTimeout(t,16)};return function(e,i){t.apply(window,[e,i])}}()}(octopus),function(t){"use strict";function e(e){var s=window["inner"+e],o=i.isNumeric(s)&&s>0?s:"CSS1Compat"==n.compatMode?n.documentElement["client"+e]:t.dom["get"+e](n.body);return o>0?o:0}var i=t.util,n=document;t.dom={g:function(t){var t=i.isString(t)?n.getElementById(t):i.isObject(t)&&t;return t||null},$:function(e,i){var i=i||n,s=t.g(i);return t.util.isNode(s)||s==n?s.querySelectorAll(e):null},one:function(e,i){var i=i||n,s=t.g(i);return t.util.isNode(s)||s==n?s.querySelector(e):null},hasClass:function(e,i){e=t.g(e);var n;return e.classList?e.classList.contains(i):(n=e.className,!!n&&RegExp("(^|\\s)"+i+"(\\s|$)").test(n))},addClass:function(e,i){if(e=t.g(e),i=i||null,!i)return!1;var n=e.classList;return n?n.contains(i)||e.classList.add(i):t.dom.hasClass(e,i)||(e.className+=(e.className?" ":"")+i),e},removeClass:function(e,n){e=t.g(e);var s,o=e.classList;return o?o.contains(n)&&e.classList.remove(n):t.dom.hasClass(e,n)&&(s=e.className,s&&(e.className=i.trim(s).replace(RegExp("(^|\\s+)"+n+"(\\s+|$)")," "))),e},toggleClass:function(e,i){e=t.g(e);var n=t.dom.hasClass(e,i);return n?t.dom.removeClass(e,i):t.dom.addClass(e,i),!n},getWidth:function(e){var e=t.g(e),i=e.offsetWidth?e.offsetWidth:e.clientWidth;return i>0?i:0},getScreenWidth:function(){return e("Width")},getScreenHeight:function(){return e("Height")},getHeight:function(e){var e=t.g(e),i=e.offsetHeight?e.offsetHeight:e.clientHeight;return i>0?i:0},insertAfter:function(e,i){return e=t.g(e),i=t.g(i),i.parentNode.insertBefore(e,i.nextSibling),e},insertFirst:function(e,i){var e=t.g(e),i=t.g(i),n=i.firstChild;n?i.insertBefore(e,n):i.appendChild(e)},setStyles:function(e,n,s){if(s=s||!1,e=t.g(e),s)var o="";for(var r in n)if(s)o+=r+": "+n[r]+";";else{var a=r;r.match(/^-(webkit|o|ms|moz)/g)&&(a=i.styleCss(r)),e.style[a]=n[r]}o&&(e.style.cssText=o)},getStyle:function(e,s){e=t.g(e);var o=null;if(e&&e.style){if(o=e.style[i.camelize(s)],!o)if(n.defaultView&&n.defaultView.getComputedStyle){var r=n.defaultView.getComputedStyle(e,null);o=r?r.getPropertyValue(s):null}else e.currentStyle&&(o=e.currentStyle[i.camelize(s)]);var a=["left","top","right","bottom"];window.opera&&-1!=a.indexOf(s)&&"static"==t.dom.getStyle(e,"position")&&(o="auto")}return"auto"==o?null:o},getParentNode:function(e,n,s){var e=t.g(e);s=s||50;var o=0,r=null;for(e=e.parentNode;i.isNode(e)&&s>o;){var a=e.parentNode,l=a.querySelectorAll(n);if(l&&l.length>0&&i.each(l,function(t){return i.isNode(t)&&t==e?(r=t,!0):undefined}),e=e.parentNode,r||"HTML"==e.tagName)break;o++}return r},getPosition:function(e){e=t.g(e);var i=e.ownerDocument?e.ownerDocument:e,n=t.dom.getStyle,s={left:0,top:0},o=i.documentElement,r=e;if(e==o)return s;do{if(s.left+=r.offsetLeft,s.top+=r.offsetTop,"fixed"==n(r,"position")){s.left+=i.body.scrollLeft,s.top+=i.body.scrollTop;break}r=r.offsetParent}while(r&&r!=e);for("absolute"==n(e,"position")&&(s.top-=i.body.offsetTop),r=e.offsetParent;r&&r!=i.body;)s.left-=r.scrollLeft,"TR"!=r.tagName&&(s.top-=r.scrollTop),r=r.offsetParent;return s},createDom:function(e,s,o){var r=n.createElement(e);return s&&i.each(s,function(e,i){"innerHTML"==i||"innerText"==i?r[i]=t.util.encodeHtml(e):r.setAttribute(i,e)}),o&&t.dom.setStyles(r,o,!0),r},cloneNode:function(e,n,s){n=n||!1,s=s||!1;var o=t.g(e).cloneNode(!s);if(!n||!e._eventCacheID)return o;var r=t.event.observers[e._eventCacheID];return i.each(r,function(e){var n=e.name,s=i.clone(e.observer),r=i.clone(e.useCapture);t.event.on(o,n,s,r)}),o},scrollLite:function(e,i,n){var s={left:0,top:0};n&&(n=t.g(n),t.event.on(n,"touchmove",function(e){t.event.stop(e,!0)},!1)),e=t.g(e),t.dom.setStyles(e,{"-webkit-overflow-scrolling":"touch"}),t.event.on(e,"touchstart",function(t){var e=t.touches;e&&(s={left:e[0].pageX,top:e[0].pageY})}),t.event.on(e,"touchmove",function(t){var e=t.touches;if(e){var n=t.currentTarget,o=n.scrollTop,r=n.scrollLeft,a=e[0].pageX,l=e[0].pageY,u=s.top,h=s.left;if(i){if(0>=r&&a>h||r>=n.scrollWidth-n.clientWidth-5&&h>a)return t.preventDefault(),undefined;t.stopPropagation()}else{if(0>=o&&l>u||o>=n.scrollHeight-n.clientHeight-5&&u>l)return t.preventDefault(),undefined;t.stopPropagation()}}})},data:function(e,n){var s={};if(e=t.g(e),i.isString(n)){var o=n.split(" "),r=o.length;if(1==r)return e.dataset&&e.dataset[o[0]]||e.getAttribute("data-"+o[0])||null;i.each(o,function(t){var n=i.camelize(t);s[t]=e.dataset&&e.dataset[n]||e.getAttribute("data-"+t)||null})}else{s=n;for(var a in s)e.setAttribute("data-"+a,s[a])}return s},attr:function(e,n){var s={};if(e=t.g(e),i.isString(n)){var o=n.split(" "),r=o.length;if(1==r)return e.getAttribute(o[0])||null;i.each(o,function(t){s[t]=e.getAttribute(t)||null})}else{s=n;for(var a in s)e.setAttribute(a,s[a])}return s}},t.g=t.dom.g,t.$=t.dom.$,t.one=t.dom.one,!window.$&&(window.$=t.$)}(octopus),function(t,e){"use strict";t.event={observers:null,element:function(t){return t.target||t.srcElement},isSingleTouch:function(t){return t.touches&&1==t.touches.length},isMultiTouch:function(t){return t.touches&&t.touches.length>1},isLeftClick:function(t){return!!(t.which&&1==t.which||t.button&&1==t.button)},isRightClick:function(t){return!!(t.which&&3==t.which||t.button&&2==t.button)},stop:function(t,e){e||(t.preventDefault?t.preventDefault():t.returnValue=!1),t.stopPropagation?t.stopPropagation():t.cancelBubble=!0},findElement:function(e){for(var i=t.event.element(e);i.parentNode&&(!i.tagName||i.tagName.toUpperCase()!=tagName.toUpperCase());)i=i.parentNode;return i},on:function(e,i,n,s){var o=i.split(" "),r=o.length,a=r;if(0==r)return!1;var l=t.g(e),u=t.event;if(s=s||!1,u.observers||(u.observers={}),!l._eventCacheID){var h="eventCacheID_";l.id&&(h=l.id+"_"+h),l._eventCacheID=t.util.createUniqueID(h)}for(;a--;)u._on(l,o[a],n,s);return l},_on:function(e,i,n,s){"ortchange"==i&&(i="orientationchange"in window?"orientationchange":"resize"),"ready"==i&&(i="DOMContentLoaded");var o=e._eventCacheID,r=t.event;r.observers[o]||(r.observers[o]=[]),r.observers[o].push({element:e,name:i,observer:n,useCapture:s}),e.addEventListener?e.addEventListener(i,n,s):e.attachEvent&&e.attachEvent("on"+i,n)},stopObservingElement:function(e){var i=t.g(e),n=i._eventCacheID;this._removeElementObservers(t.event.observers[n])},stopEventObserver:function(e,i){var n=t.g(e)._eventCacheID,s=t.event,o=s.observers[n];if(o)for(var r=o.length;r--;){var a=o[r];if(i==a.name){var l=[a.element,a.name,a.observer,a.useCapture];s.un.apply(this,l)}}},_removeElementObservers:function(e){if(e)for(var i=e.length;i--;){var n=e[i],s=[n.element,n.name,n.observer,n.useCapture];t.event.un.apply(this,s)}},un:function(e,i,n,s){var o=i.split(" "),r=o.length,a=r;if(0==r)return!1;var l=t.g(e),u=l._eventCacheID,h=!1;for(s=s||!1;a--;)h=t.event._un(l,o[a],n,s,u);return h},_un:function(e,i,n,s,o){"ortchange"==i&&(i="orientationchange"in window?"orientationchange":"resize"),"ready"==i&&(i="DOMContentLoaded"),"keypress"==i&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||e.detachEvent)&&(i="keydown");var r=!1,a=t.event.observers[o];if(a)for(var l=0;!r&&a.length>l;){var u=a[l];if(u.name==i&&u.observer==n&&u.useCapture==s){a.splice(l,1),0==a.length&&(t.event.observers[o]=null),r=!0;break}l++}return r&&(e.removeEventListener?e.removeEventListener(i,n,s):e&&e.detachEvent&&e.detachEvent("on"+i,n)),r},unloadCache:function(){if(t.event&&t.event.observers){for(var e in t.event.observers){var i=t.event.observers[e];t.event._removeElementObservers.apply(this,[i])}t.event.observers=!1}}},t.event.on(window,"unload",t.event.unloadCache,!1),t.Events=t.define({BROWSER_EVENTS:["mouseover","mouseout","mousedown","mouseup","mousemove","click","dblclick","rightclick","dblrightclick","resize","focus","blur","touchstart","touchmove","touchend","keydown"],listeners:null,obj:null,el:null,eventHandler:null,fallThrough:!1,extensions:null,extensionCount:null,initialize:function(e,i,n,s){t.extend(this,s),this.obj=e,this.fallThrough=n,this.listeners={},this.extensions={},this.extensionCount={},null!=i&&this.attachToElement(i)},destroy:function(){for(var e in this.extensions)"boolean"!=typeof this.extensions[e]&&this.extensions[e].destroy();this.extensions=null,this.el&&t.event.stopObservingElement(this.el),this.el=null,this.listeners=null,this.obj=null,this.fallThrough=null,this.eventHandler=null},attachToElement:function(e){this.el?t.event.stopObservingElement(this.el):this.eventHandler=t.util.bindAsEventListener(this.handleBrowserEvent,this),this.el=e;for(var i=0,n=this.BROWSER_EVENTS.length;n>i;i++)t.event.on(e,this.BROWSER_EVENTS[i],this.eventHandler);t.event.on(e,"dragstart",t.event.stop)},handleBrowserEvent:function(t){var e=t.type,i=this.listeners[e];if(i&&0!=i.length){var n=t.touches;if(n&&n[0]){for(var s,o=0,r=0,a=n.length,l=0;a>l;++l)s=n[l],o+=s.clientX,r+=s.clientY;t.clientX=o/a,t.clientY=r/a}this.triggerEvent(e,t)}},on:function(i,n,s,o){if(i in t.Events&&!this.extensions[i]&&(this.extensions[i]=new t.Events[i](this)),null!=n){(null==s||s==e)&&(s=this.obj);var r=this.listeners[i];r||(r=[],this.listeners[i]=r,this.extensionCount[i]=0);var a={obj:s,func:n};o?(r.splice(this.extensionCount[i],0,a),"object"==typeof o&&o.extension&&this.extensionCount[i]++):r.push(a)}},un:function(t,e,i){null==i&&(i=this.obj);var n=this.listeners[t];if(null!=n)for(var s=0,o=n.length;o>s;s++)if(n[s].obj==i&&n[s].func==e){n.splice(s,1);break}},triggerEvent:function(i,n){var s=this.listeners[i];if(!s||0==s.length)return e;null==n&&(n={}),n.obj=this.obj,n.el=this.el,n.type||(n.type=i),s=s.slice();for(var o,r=0,a=s.length;a>r;r++){var l=s[r];if(o=l.func.apply(l.obj,[n]),o===!1)break}return this.fallThrough||t.event.stop(n,!0),o},remove:function(t){null!=this.listeners[t]&&(this.listeners[t]=[])},register:function(t){for(var e in t)"scope"!=e&&t.hasOwnProperty(e)&&this.on(e,t[e],t.scope,!1)},unregister:function(t){for(var e in t)"scope"!=e&&t.hasOwnProperty(e)&&this.un(e,t[e],t.scope)},CLASS_NAME:"Octopus.Events"})}(octopus),function(t,e){"use strict";t.Tween=t.define({el:null,propertyName:null,startValue:null,endValue:null,duration:null,func:null,ease:null,needParams:null,paramsDics:null,requestAnimation:null,colorList:null,stopRequest:!0,vector:null,prefix:null,eventPrefix:null,isOffCss:!1,endEvent:null,isTransform:!1,eventTimer:null,delay:null,initialize:function(i,n,s,o,r,a,l){if(!t.util.isNode(i))throw Error("require a node!");t.extend(this,l),this.el=i,this.propertyName=n,this.startValue=s,this.endValue=o,this.duration=r,this.func=a||t.util.empty,this.needParams=[],this.colorList=[],this.paramsDics=["width","height","left","top","right","bottom","padding","padding-left","padding-top","padding-bottom","padding-right","margin","margin-left","margin-top","margin-bottom","margin-right","font-size","background-position","line-height","border-width","border-left-width","border-top-width","border-right-width","border-bottom-width"];var u=this.check();if(this.ease=this.ease||(this.isTransform?"ease-out":t.easing.linear.easeOut),this.delay=this.delay||0,!u)throw Error("Illegal arguments!");if(t.util.isObject(this.ease)&&!this.isTransform)if(this.requestAnimation=t.util.requestAnimation,this.delay>0){var h=this;window.setTimeout(function(){h.executeWithJs()},1e3*this.delay)}else this.executeWithJs();else{this.vector={"":"",Webkit:"webkit",Moz:"",O:"o",ms:"MS"};for(var c in this.vector)if(this.el.style[c+"TransitionProperty"]!==e){this.prefix="-"+c.toLowerCase()+"-",this.eventPrefix=this.vector[c];break}this.isOffCss=null==this.eventPrefix&&this.el.style.transitionProperty==e,this.endEvent=this.eventPrefix?this.eventPrefix+"TransitionEnd":"transitionEnd",this.executeWithCss()}},check:function(){var e,i=t.util.isArray(this.propertyName)&&t.util.isArray(this.startValue)&&t.util.isArray(this.endValue),n=!1;i||(this.propertyName=[this.propertyName],this.startValue=[this.startValue],this.endValue=[this.endValue]);var s=this.propertyName.length==this.startValue.length&&this.startValue.length==this.endValue.length;if(s){for(var o=!1,r=this.propertyName.length,a=r;a--;){e=this.checkValue(this.propertyName[a],this.startValue[a],this.endValue[a]),e||(o=!0),this.needParams[a]=-1!=this.paramsDics.indexOf(this.propertyName[a]);var l=RegExp("/color|background-color|border-color/i").test(this.propertyName[a]);this.colorList[a]={isColor:l,startValue:l?this.getColor(this.startValue[a]):null,endValue:l?this.getColor(this.endValue[a]):null}}n=!o&&!isNaN(this.duration)}else n=!1;return n},checkValue:function(e,i,n){var s=!1;if(/transform/i.test(e)||/-webkit-/i.test(e))this.isTransform=!0,s=!!i&&t.util.isString(i)&&!!n&&t.util.isString(n);else if(-1!=e.indexOf("color")){var o=/(^\s*)|(\s*$)/g;s=!!i&&""!=i.replace(o,"")&&!!n&&""!=n.replace(o,"")}else s=!isNaN(i)&&!isNaN(n);return s},getColor:function(t){t=t.replace(/(^\s*)|(\s*$)/g,"");var e=/^\s*rgb\s*\(\s*\d{1,3}\s*\,\s*\d{1,3}\s*\,\s*\d{1,3}\s*\)\s*$/i,i=/^\s*\#[a-zA-Z0-9]{3}\s*$/,n=/^\s*\#[a-zA-Z0-9]{6}\s*$/,s=[];if(e.test(t)){for(var o=t.split("(")[1].split(")")[0].split(","),r=0;o.length>r;r++)s.push(o[r]/1);return s}if(n.test(t)){for(var a=t.replace("#","").match(/(\w|\d){2}/g),r=0;a.length>r;r++)s.push(Number("0x"+a[r]).toString(10)/1);return s}if(i.test(t)){for(var l=t.replace("#","").split(""),r=0;l.length>r;r++)s.push(Number("0x"+(l[r]+l[r])).toString(10)/1);return s}return null},executeWithJs:function(){this.stopRequest=!1;var t=this,i=0,n=function(){return!t.el||t.stopRequest?(t.stop(),e):(t.getSetValue(i,!1),i>=1e3*t.duration?(t.getSetValue(null,!0),t.func&&t.func(),t.el=null,e):(i+=16,t.requestAnimation(n),e))};this.requestAnimation(n,this.el)},executeWithCss:function(){this.isOffCss&&(this.duration=0);var e=this.propertyName,i=e.length,n=this,s=[],o=this.prefix+"transition";this.el.style[o]="",t.util.each(e,function(t,e){n.el.style[t]=n.getValue(n.startValue[e],e),s.push(t+" "+n.duration+"s "+n.ease)}),t.event.on(this.el,this.endEvent,t.util.bindAsEventListener(this.onEndEventCompleted,this),!1),window.setTimeout(function(){n.el.style[o]=s.join(", ");var r=n;window.setTimeout(function(){for(var n=0;i>n;n++){var s=r.endValue[n];r.el.style[e[n]]=r.getValue(s,n)}r.clearEventTimer(),r.eventTimer=setTimeout(t.util.bind(r.onFinish,r),1e3*r.duration)},1e3*n.delay)},0)},clearEventTimer:function(){this.eventTimer&&(window.clearTimeout(this.eventTimer),this.eventTimer=null)},onFinish:function(){this.el&&(t.event.stopEventObserver(this.el,this.endEvent),this.el.style[this.prefix+"transition"]=""),this.func&&this.func(),this.destroy()},onEndEventCompleted:function(t){t.target===t.currentTarget&&(this.clearEventTimer(),this.onFinish())},stop:function(){null==this.endEvent?this.stopRequest=!0:(this.func&&this.func(),this.el&&(t.event.stopEventObserver(this.el,this.endEvent),this.el.style[this.prefix+"transition"]="")),this.destroy()},destroy:function(){this.el=null},getSetValue:function(t,e){for(var i=[],n=0,s=this.propertyName.length;s>n;n++){var o;if(this.colorList[n].isColor){var r,a,l,u=this.colorList[n].startValue[0],h=this.colorList[n].startValue[1],c=this.colorList[n].startValue[2],d=this.colorList[n].endValue[0],p=this.colorList[n].endValue[1],g=this.colorList[n].endValue[2];e?(r=d,a=p,l=g):(r=Math.ceil(this.ease(t,u,d-u,1e3*this.duration)),a=Math.ceil(this.ease(t,h,p-h,1e3*this.duration)),l=Math.ceil(this.ease(t,c,g-c,1e3*this.duration))),o="rgb("+r+", "+a+", "+l+")"}else o=e?this.endValue[n]:Math.ceil(this.ease(t,this.startValue[n],this.endValue[n]-this.startValue[n],1e3*this.duration));i.push({propertyName:this.propertyName[n],curValue:o,isColor:this.colorList[n].isColor})}this.setValue(i)},setValue:function(t){for(var e={},i=!1,n=0,s=t.length;s>n;n++){var o=t[n].propertyName,r=t[n].curValue,a=t[n].isColor;"opacity"==o&&(r/=100),"scrollLeft"==o||"scrollTop"==o?this.el[o]=this.getValue(r,n):(e[o]=a?r:this.getValue(r,n),i=!0)}if(i)for(var l in e)this.el.style[l]=e[l]},getValue:function(t,e){return this.needParams[e]?t+"px":t},CLASS_NAME:"octopus.Tween"}),t.StepTween=t.define({type:"normal",ease:null,startValue:null,endValue:null,duration:null,func:null,count:0,playing:!1,initialize:function(e){t.extend(this,e),this.ease=this.ease||t.easing.expo.easeOut,this.start(this.startValue,this.endValue,this.duration,this.func)},start:function(e,i,n,s){this.playing=!0,this.startValue=e,this.endValue=i,this.duration=n,this.func=s,this.count=0,this.func&&this.func.start&&this.func.start.call(this,this.startValue),t.util.requestAnimation(t.util.bind(this.play,this))},stop:function(){this.playing&&(this.func&&this.func.done&&this.func.done.call(this,this.endValue),this.playing=!1,this.destroy())},destroy:function(){this.func=null,this.startValue=null,this.endValue=null,this.duration=null,this.count=null},play:function(){if(0!=this.playing){var i={};for(var n in this.startValue){var s=this.startValue[n],o=this.endValue[n];if(null==s||null==o||isNaN(s)||isNaN(o))throw Error("invalid value for Tween");var r=o-s;i[n]=this.ease.apply(this,[this.count,s,r,this.duration])}return this.count++,this.func&&this.func.eachStep&&this.func.eachStep.call(this,i),this.count>this.duration?(this.stop(),e):(t.util.requestAnimation(t.util.bind(this.play,this)),e)}},CLASS_NAME:"octopus.StepTween"}),t.easing=t.easing||{},t.easing.linear={easeIn:function(t,e,i,n){return i*t/n+e},easeOut:function(t,e,i,n){return i*t/n+e},easeInOut:function(t,e,i,n){return i*t/n+e}},t.easing.expo={easeIn:function(t,e,i,n){return 0==t?e:i*Math.pow(2,10*(t/n-1))+e},easeOut:function(t,e,i,n){return t==n?e+i:i*(-Math.pow(2,-10*t/n)+1)+e},easeInOut:function(t,e,i,n){return 0==t?e:t==n?e+i:1>(t/=n/2)?i/2*Math.pow(2,10*(t-1))+e:i/2*(-Math.pow(2,-10*--t)+2)+e}},t.easing.quad={easeIn:function(t,e,i,n){return i*(t/=n)*t+e},easeOut:function(t,e,i,n){return-i*(t/=n)*(t-2)+e},easeInOut:function(t,e,i,n){return 1>(t/=n/2)?i/2*t*t+e:-i/2*(--t*(t-2)-1)+e}},t.easing.back={easeIn:function(t,i,n,s,o){return o==e&&(o=1.70158),n*(t/=s)*t*((o+1)*t-o)+i},easeOut:function(t,i,n,s,o){return o==e&&(o=1.70158),n*((t=t/s-1)*t*((o+1)*t+o)+1)+i},easeInOut:function(t,i,n,s,o){return o==e&&(o=1.70158),1>(t/=s/2)?n/2*t*t*(((o*=1.525)+1)*t-o)+i:n/2*((t-=2)*t*(((o*=1.525)+1)*t+o)+2)+i}},t.easing.bounce={easeIn:function(e,i,n,s){return n-t.easing.bounce.easeOut(s-e,0,n,s)+i},easeOut:function(t,e,i,n){return 1/2.75>(t/=n)?i*7.5625*t*t+e:2/2.75>t?i*(7.5625*(t-=1.5/2.75)*t+.75)+e:2.5/2.75>t?i*(7.5625*(t-=2.25/2.75)*t+.9375)+e:i*(7.5625*(t-=2.625/2.75)*t+.984375)+e},easeInOut:function(e,i,n,s){return s/2>e?.5*t.easing.bounce.easeIn(2*e,0,n,s)+i:.5*t.easing.bounce.easeOut(2*e-s,0,n,s)+.5*n+i}},t.easing.elastic={easeIn:function(t,e,i,n,s,o){if(0==t)return e;if(1==(t/=n))return e+i;if(o||(o=.3*n),!s||Math.abs(i)>s){s=i;var r=o/4}else var r=o/(2*Math.PI)*Math.asin(i/s);return-(s*Math.pow(2,10*(t-=1))*Math.sin((t*n-r)*2*Math.PI/o))+e},easeOut:function(t,e,i,n,s,o){if(0==t)return e;if(1==(t/=n))return e+i;if(o||(o=.3*n),!s||Math.abs(i)>s){s=i;var r=o/4}else var r=o/(2*Math.PI)*Math.asin(i/s);return s*Math.pow(2,-10*t)*Math.sin((t*n-r)*2*Math.PI/o)+i+e},easeInOut:function(t,e,i,n,s,o){if(0==t)return e;if(2==(t/=n/2))return e+i;if(o||(o=n*.3*1.5),!s||Math.abs(i)>s){s=i;var r=o/4}else var r=o/(2*Math.PI)*Math.asin(i/s);return 1>t?-.5*s*Math.pow(2,10*(t-=1))*Math.sin((t*n-r)*2*Math.PI/o)+e:.5*s*Math.pow(2,-10*(t-=1))*Math.sin((t*n-r)*2*Math.PI/o)+i+e}},t.easing.circ={easeIn:function(t,e,i,n){return-i*(Math.sqrt(1-(t/=n)*t)-1)+e},easeOut:function(t,e,i,n){return i*Math.sqrt(1-(t=t/n-1)*t)+e},easeInOut:function(t,e,i,n){return 1>(t/=n/2)?-i/2*(Math.sqrt(1-t*t)-1)+e:i/2*(Math.sqrt(1-(t-=2)*t)+1)+e}},t.easing.sine={easeIn:function(t,e,i,n){return-i*Math.cos(t/n*(Math.PI/2))+i+e},easeOut:function(t,e,i,n){return i*Math.sin(t/n*(Math.PI/2))+e},easeInOut:function(t,e,i,n){return-i/2*(Math.cos(Math.PI*t/n)-1)+e}},t.easing.quint={easeIn:function(t,e,i,n){return i*(t/=n)*t*t*t*t+e},easeOut:function(t,e,i,n){return i*((t=t/n-1)*t*t*t*t+1)+e},easeInOut:function(t,e,i,n){return 1>(t/=n/2)?i/2*t*t*t*t*t+e:i/2*((t-=2)*t*t*t*t+2)+e}},t.easing.quart={easeIn:function(t,e,i,n){return i*(t/=n)*t*t*t+e},easeOut:function(t,e,i,n){return-i*((t=t/n-1)*t*t*t-1)+e},easeInOut:function(t,e,i,n){return 1>(t/=n/2)?i/2*t*t*t*t+e:-i/2*((t-=2)*t*t*t-2)+e}},t.easing.cubic={easeIn:function(t,e,i,n){return i*(t/=n)*t*t+e},easeOut:function(t,e,i,n){return i*((t=t/n-1)*t*t+1)+e},easeInOut:function(t,e,i,n){return 1>(t/=n/2)?i/2*t*t*t+e:i/2*((t-=2)*t*t+2)+e}}}(octopus),function(t){"use strict";t.animate=function(e){return t.animation[e.type]?t.animation[e.type](e.el,e.config,e.func):null},octopus.animation=octopus.animation||{slide:function(e,i,n){var s=t.extend({direction:"left",out:!0,duration:.4,isFade:!1,ease:"ease-out",isScale:!1},i);n=n||t.util.empty;var o,r,e=e,a=s.out,l=s.direction,u=0,h=0,c=0,d=0,p=100,g=[],m=[],f=[];if("left"==l||"right"==l?a?u=-p:c=p:("up"==l||"down"==l)&&(a?h=-p:d=p),("right"==l||"down"==l)&&(h*=-1,u*=-1,d*=-1,c*=-1),g.push("-webkit-transform"),m.push("translate3d("+c+"%, "+d+"%, 0)"),f.push("translate3d("+u+"%, "+h+"%, 0)"),s.isFade&&(r=a?0:1,o=a?1:0,m.push(o),f.push(r),g.push("opacity")),s.isScale&&a){var v=1,y=.8;m.push("scale("+v+")"),f.push("scale("+y+")"),g.push("-webkit-transform");var w=g.indexOf("opacity");-1==w?(g.push("opacity"),f.push(a?1:0),m.push(a?0:1)):(f[w]=a?1:0,m[w]=a?0:1)}return new t.Tween(e,g,m,f,s.duration,n,{ease:s.ease})},fade:function(e,i,n){var s=t.extend({out:!0,duration:.4,ease:"ease-out"},i);n=n||t.util.empty;var e=e,o=1,r=1,a=s.out;a?r=0:o=0;var l=[o],u=[r];return new t.Tween(e,["opacity"],l,u,s.duration,n,{ease:s.ease})},pop:function(e,i,n){var s=t.extend({out:!0,duration:.4,ease:"ease-out",scaleOnExit:!0},i);n=n||t.util.empty;var e=e,o=1,r=1,a=1,l=1,u=t.dom.getStyle(e,"z-index")||0,h=u,c=u,d=s.out;d?s.scaleOnExit?(r=.01,l=0):l=.8:(o=.01,h=u+1,c=u+1,a=0);var p=["-webkit-transform","-webkit-transform-origin","opacity","z-index"],g=["scale("+o+")","50% 50%",a,h],m=["scale("+r+")","50% 50%",l,c];return new t.Tween(e,p,g,m,s.duration,n,{ease:s.ease})},flip:function(e,i,n){var s=t.extend({out:!0,duration:.4,ease:"ease-out",direction:"left"},i);n=n||t.util.empty;var e=e,o=s.direction,r="Y",a=1,l=1,u=0,h=s.out,c=0;return h?(c=-180,l=.8):(u=180,a=.8),("up"==o||"down"==o)&&(r="X"),("right"==o||"left"==o)&&(c*=-1,u*=-1),e.style.webkitBackfaceVisibility="hidden",new t.Tween(e,"-webkit-transform","rotate"+r+"("+u+"deg) scale("+a+")","rotate"+r+"("+c+"deg) scale("+l+")",s.duration,n,{ease:s.ease})},wipe:function(e,i,n){var s=t.extend({out:!0,duration:.4,ease:"ease-out"},i);n=n||t.util.empty;var o,e=e,r=t.dom.getStyle(e,"z-index")||0,a=s.out,l="";if(!a){o=r+1,l="-webkit-gradient(linear, left bottom, right bottom, from(transparent), to(#000), color-stop(66%, #000), color-stop(33%, transparent))";var u=t.dom.getWidth(e);return e.style.webkitMaskImage=l,e.style.maskImage=l,e.style.webkitMaskSize=3*u+"px"+t.dom.getHeight(e)+"px",e.style.maskSize=3*u+"px"+t.dom.getHeight(e)+"px",e.style.zIndex=o,new t.Tween(e,"-webkit-mask-position-x","0",0-u+"px",s.duration,n,{ease:s.ease})}return window.setTimeout(n,1e3*s.duration),null},roll:function(e,i,n){var s=t.extend({out:!0,duration:.4,ease:"ease-out",isFade:!1},i);n=n||t.util.empty;var e=e,o=s.out,r="translateX(-100%) rotate(-120deg)",a="translateX(0px) rotate(0deg)",l=["-webkit-transform"],u=[],h=[];if(o){var c=r;r=a,a=c}return u.push(r),h.push(a),s.isFade&&(l.push("opacity"),u.push(s.out?1:0),h.push(s.out?0:1)),new t.Tween(e,l,u,h,s.duration,n,{ease:s.ease})},rotate:function(e,i,n){var s=t.extend({out:!0,duration:.4,ease:"ease-out",horizon:"center",direction:"center",isFade:!1},i);n=n||t.util.empty;var e=e,o=s.out,r=["-webkit-transform"],a=[],l="rotate(200deg)",u="rotate(0)",h=[];if("up"==s.direction?s.direction="top":"down"==s.direction&&(s.direction="bottom"),e.style.webkitTransformOrigin=s.horizon+" "+s.direction,"left"==s.horizon?l="rotate(90deg)":"right"==s.horizon&&(l="rotate(-90deg)"),o){var c=l;l=u,u=c}return a.push(l),h.push(u),s.isFade&&(r.push("opacity"),a.push(s.out?1:0),h.push(s.out?0:1)),new t.Tween(e,r,a,h,s.duration,n,{ease:s.ease})
},fold:function(e,i,n){var s=t.extend({out:!0,duration:.4,ease:"ease-out",direction:"left",isFade:!1},i);n=n||t.util.empty;var e=e,o=s.out,r=s.direction,a={left:{origin:"100% 50%",startTransform:"translateX(-100%) rotateY(-90deg)"},right:{origin:"0% 50%",startTransform:"translateX(100%) rotateY(90deg)"},up:{origin:"50% 100%",startTransform:"translateY(-100%) rotateX(90deg)"},down:{origin:"50% 0%",startTransform:"translateY(100%) rotateX(-90deg)"}},l=["-webkit-transform"],u=[],h=[],c=a[r].startTransform,d="translate3d(0, 0, 0) rotate(0)";if(e.style.webkitTransformOrigin=a[r].origin,o){var p=c;c=d,d=p}return u.push(c),h.push(d),s.isFade&&(l.push("opacity"),u.push(s.out?1:0),h.push(s.out?0:1)),new t.Tween(e,l,u,h,s.duration,n,{ease:s.ease})},carousel:function(e,i,n){var s=t.extend({out:!0,duration:.4,ease:"ease-out",direction:"left",isFade:!1},i);n=n||t.util.empty;var e=e,o=s.out,r=s.direction,a={left:{originOut:"100% 50%",originIn:"0% 50%",startTransformOut:"translateX(-200%) scale(.4) rotateY(-65deg)",startTransformIn:"translateX(200%) scale(.4) rotateY(65deg)"},right:{originOut:"0% 50%",originIn:"100% 50%",startTransformOut:"translateX(200%) scale(.4) rotateY(65deg)",startTransformIn:"translateX(-200%) scale(.4) rotateY(-65deg)"},up:{originOut:"50% 100%",originIn:"50% 0%",startTransformOut:"translateY(-200%) scale(.4) rotateX(65deg)",startTransformIn:"translateY(200%) scale(.4) rotateX(-65deg)"},down:{originOut:"50% 0%",originIn:"50% 100%",startTransformOut:"translateY(200%) scale(.4) rotateX(-65deg)",startTransformIn:"translateY(-200%) scale(.4) rotateX(65deg)"}},l=["-webkit-transform"],u=[],h=[],c=a[r].startTransformOut,d="translate3d(0, 0, 0) rotate(0)";return e.style.webkitTransformOrigin=o?a[r].originIn:a[r].originOut,o&&(c=d,d=a[r].startTransformIn),u.push(c),h.push(d),s.isFade&&(l.push("opacity"),u.push(s.out?1:0),h.push(s.out?0:1)),new t.Tween(e,l,u,h,s.duration,n,{ease:s.ease})}}}(octopus),function(t){"use strict";t.template=t.template||{},t.extend(t.template,{caches:{},templateText:function(e){return t.util.isNode(e)?/^(input|textarea)$/i.test(e.tagName)?e.value:t.util.decodeHtml(e.innerHTML):""},register:function(e,i){return e?this.caches[e]?this.caches[e]:this.caches[e]=this.parse(t.util.isString(i)?i:this.templateText(t.g(i))):undefined},parse:function(t){var e=[];e.push("with(this){"),e.push(t.replace(/[\r\n]+/g,"\n").replace(/^\n+|\s+$/gm,"").replace(/((^\s*[<>!#^&\u0000-\u0008\u007F-\uffff].*$|^.*[<>]\s*$|^(?!\s*(else|do|try|finally)\s*$)[^'":;,\[\]{}()\n\/]+$|^(\s*(([\w-]+\s*=\s*"[^"]*")|([\w-]+\s*=\s*'[^']*')))+\s*$|^\s*([.#][\w\-.]+(:\w+)?(\s*|,))*(?!(else|do|while|try|return)\b)[.#]?[\w\-\.*]+(:\w+)?\s*\{.*$)\s?)+/gm,function(t){return t=['"',t.replace(/&none;/g,"").replace(/["'\\]/g,"\\$&").replace(/\n/g,"\\n").replace(/(!?#)\{(.*?)\}/g,function(t,e,i){i=i.replace(/\\n/g,"\n").replace(/\\([\\'"])/g,"$1");var n=/^[a-z$][\w+$]+$/i.test(i)&&!/^(true|false|NaN|null|this)$/.test(i);return['",',n?["typeof ",i,'=="undefined"?"":'].join(""):"","#"==e?"_encode_":"","(",i,'),"'].join("")}),'"'].join("").replace(/^"",|,""$/g,""),t?["_output_.push(",t,");"].join(""):""})),e.push("}");var i=Function("_output_","_encode_","helper",e.join(""));return i},format:function(e,i,n){if(!e)return"";var s,o;t.util.isNode(e)&&(o=e,e=o.getAttribute("id")),n=n||this,s=this.caches[e],s||(/[^\w-]/.test(e)?s=this.parse(e):(o||(o=t.g(e)),s=this.register(e,o)));var r=[];return s.call(i||"",r,t.util.encodeHtml,n),r.join("")}})}(octopus),function(t,e){t.ajax=t.ajax||{},t.extend(t.ajax,{DEFAULT_CONFIG:{type:"GET",url:window.location.href,async:!0,user:e,password:e,data:null,complete:t.util.empty,success:null,error:null,scope:null,beforeSend:null,timeout:0,crossDomain:!1},jsonpID:0,jsonType:"application/json",htmlType:"text/html",SCRIPT_REGEX:/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,SCRIPT_TYPE_REGEX:/^(?:text|application)\/javascript/i,XML_TYPE_REGEX:/^(?:text|application)\/xml/i,URL_SPLIT_REGEX:/([^:]*:)\/\/([^:]*:?[^@]*@)?([^:\/\?]*):?([^\/\?]*)/,BLANK_REGEX:/^\s*$/,accepts:{script:"text/javascript, application/javascript",json:this.jsonType,xml:"application/xml, text/xml",html:this.htmlType,text:"text/plain"},xhr:function(){return new window.XMLHttpRequest},mimeToDataType:function(t){return t&&(t==this.htmlType?"html":t==this.jsonType?"json":this.SCRIPT_TYPE_REGEX.test(t)?"script":this.XML_TYPE_REGEX.test(t)&&"xml")||"text"},request:function(e){var i=this.DEFAULT_CONFIG,n=t.util.applyDefaults(e,i),s=n.dataType,o=n.url,r=n.data||{},a=n.headers||{},l=t.util.createUrlObject(o);n.crossDomain||(n.crossDomain=l.host!=window.location.host);var u,h=!1;for(u in a)"x-requested-with"===u.toLowerCase()&&(h=!0);h!==!1&&n.crossDomain||(a["X-Requested-With"]="XMLHttpRequest"),n.url=t.util.urlAppend(o,t.util.getParameterString(r||{}));var c,d=this.accepts[s],p={},g=this.xhr();d&&(p.Accept=d,d.indexOf(",")>-1&&(d=d.split(",",2)[0]),g.overrideMimeType&&g.overrideMimeType(d)),a=t.extend(p,a||{}),g.open(n.type,n.url,n.async,n.user,n.password);for(var m in a)g.setRequestHeader(m,a[m]);var f=this;return g.onreadystatechange=function(){4==g.readyState&&(clearTimeout(c),f.runCallbacks({request:g,config:n,requestUrl:n.url}))},n.async===!1?g.send(n.data?n.data:null):window.setTimeout(function(){0!==g.readyState&&g.send(n.data?n.data:null)},0),n.timeout>0&&(c=setTimeout(function(){g.onreadystatechange=t.util.empty,g.abort();var e;n.error&&(e=n.scope?t.util.bind(n.error,n.scope):n.error),e(g,"timeout")},n.timeout)),g},runCallbacks:function(e){var i,n=e.request,s=e.config,o=s.scope?t.util.bind(s.complete,s.scope):s.complete;s.success&&(i=s.scope?t.util.bind(s.success,s.scope):s.success);var r;s.error&&(r=s.scope?t.util.bind(s.error,s.scope):s.error),o(n);var a,l=!1,u=s.dataType;if(n.status>=200&&300>n.status||304==n.status||0==n.status&&"file:"==t.util.createUrlObject(s.url).protocol){u=u||this.mimeToDataType(n.getResponseHeader("content-type")),a=n.responseText;try{"script"==u?(1,eval)(a):"xml"==u?a=n.responseXML:"json"==u&&(a=this.BLANK_REGEX.test(a)?null:JSON.parse(a))}catch(h){l=h}e.result=a,i&&i(n,a)}else r&&r(n,"error")},get:function(e){return e=t.extend(e,{type:"GET"}),t.ajax.request(e)},post:function(e){return e=t.extend(e,{type:"POST"}),e.headers=e.headers?e.headers:{},"CONTENT-TYPE"in t.util.upperCaseObject(e.headers)||(e.headers["Content-Type"]="application/xml"),t.ajax.request(e)},put:function(e){return e=t.extend(e,{type:"PUT"}),e.headers=e.headers?e.headers:{},"CONTENT-TYPE"in t.util.upperCaseObject(e.headers)||(e.headers["Content-Type"]="application/xml"),t.ajax.request(e)},"delete":function(e){return e=t.extend(e,{type:"DELETE"}),t.ajax.request(e)},head:function(e){return e=t.extend(e,{type:"HEAD"}),t.ajax.request(e)},options:function(e){return e=t.extend(e,{type:"OPTIONS"}),t.ajax.request(e)},_createScriptTag:function(t,e,i){t.setAttribute("type","text/javascript"),i&&t.setAttribute("charset",i),t.setAttribute("src",e),document.getElementsByTagName("head")[0].appendChild(t)},_removeScriptTag:function(t){if(t.clearAttributes)t.clearAttributes();else for(var e in t)t.hasOwnProperty(e)&&delete t[e];t&&t.parentNode&&t.parentNode.removeChild(t),t=null,delete t},ajaxJSONP:function(e){function i(e){return function(){try{e?g():(clearTimeout(s),p.apply(window,arguments)),window[n]=t.util.empty}catch(i){}finally{c._removeScriptTag(o)}}}var n,s,o=document.createElement("script"),r=this.DEFAULT_CONFIG,a="jsonp",e=t.util.applyDefaults(e,r),l=e.charset,u=e.data||{},h=e.timeout||0,c=this,d=e.url,p=e.success||e.complete,g=e.error||t.util.empty;return console.log(e),t.util.isString(p)?n=p:(n=a+Math.floor(2147483648*Math.random()).toString(36),window[n]=i(0)),h>0&&(s=setTimeout(i(1),h)),o.onerror=function(){c._removeScriptTag(o),n in window&&(window[n]=function(){}),g()},d=t.util.urlAppend(t.util.urlAppend(d,t.util.getParameterString(u||{})),"callback="+n),this._createScriptTag(o,d,l),e.xhr}})}(octopus),function(t,e){"use strict";function i(){if(!n.READY){n.event.determineEventTypes();for(var t in n.gestures)n.gestures.hasOwnProperty(t)&&n.detection.register(n.gestures[t]);n.event.onTouch(n.DOCUMENT,n.EVENT_MOVE,n.detection.detect),n.event.onTouch(n.DOCUMENT,n.EVENT_END,n.detection.detect),n.READY=!0}}var n=function(t,e){return new n.Instance(t,e||{})};n.defaults={stop_browser_behavior:{userSelect:"none",touchAction:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},n.HAS_POINTEREVENTS=navigator.pointerEnabled||navigator.msPointerEnabled,n.HAS_TOUCHEVENTS="ontouchstart"in window,n.MOBILE_REGEX=/mobile|tablet|ip(ad|hone|od)|android/i,n.NO_MOUSEEVENTS=n.HAS_TOUCHEVENTS&&navigator.userAgent.match(n.MOBILE_REGEX),n.EVENT_TYPES={},n.DIRECTION_DOWN="down",n.DIRECTION_LEFT="left",n.DIRECTION_UP="up",n.DIRECTION_RIGHT="right",n.POINTER_MOUSE="mouse",n.POINTER_TOUCH="touch",n.POINTER_PEN="pen",n.EVENT_START="start",n.EVENT_MOVE="move",n.EVENT_END="end",n.DOCUMENT=document,n.plugins={},n.READY=!1,n.Instance=function(t,e){var s=this;return i(),this.element=t,this.enabled=!0,this.options=n.utils.extend(n.utils.extend({},n.defaults),e||{}),this.options.stop_browser_behavior&&n.utils.stopDefaultBrowserBehavior(this.element,this.options.stop_browser_behavior),n.event.onTouch(t,n.EVENT_START,function(t){s.enabled&&n.detection.startDetect(s,t)}),this},n.Instance.prototype={on:function(t,e){for(var i=t.split(" "),n=0;i.length>n;n++)this.element.addEventListener(i[n],e,!1);return this},off:function(t,e){for(var i=t.split(" "),n=0;i.length>n;n++)this.element.removeEventListener(i[n],e,!1);return this},trigger:function(t,e){var i=n.DOCUMENT.createEvent("Event");i.initEvent(t,!0,!0),i.gesture=e;var s=this.element;return n.utils.hasParent(e.target,s)&&(s=e.target),s.dispatchEvent(i),this},enable:function(t){return this.enabled=t,this}};var s=null,o=!1,r=!1;n.event={bindDom:function(t,e,i){for(var n=e.split(" "),s=0;n.length>s;s++)t.addEventListener(n[s],i,!1)},onTouch:function(t,e,i){var a=this;this.bindDom(t,n.EVENT_TYPES[e],function(l){var u=l.type.toLowerCase();if(!u.match(/mouse/)||!r){(u.match(/touch/)||u.match(/pointerdown/)||u.match(/mouse/)&&1===l.which)&&(o=!0),u.match(/touch|pointer/)&&(r=!0);var h=0;o&&(n.HAS_POINTEREVENTS&&e!=n.EVENT_END?h=n.PointerEvent.updatePointer(e,l):u.match(/touch/)?h=l.touches.length:r||(h=u.match(/up/)?0:1),h>0&&e==n.EVENT_END?e=n.EVENT_MOVE:h||(e=n.EVENT_END),h||null===s?s=l:l=s,i.call(n.detection,a.collectEventData(t,e,l)),n.HAS_POINTEREVENTS&&e==n.EVENT_END&&(h=n.PointerEvent.updatePointer(e,l))),h||(s=null,o=!1,r=!1,n.PointerEvent.reset())}})},determineEventTypes:function(){var t;t=n.HAS_POINTEREVENTS?n.PointerEvent.getEvents():n.NO_MOUSEEVENTS?["touchstart","touchmove","touchend touchcancel"]:["touchstart mousedown","touchmove mousemove","touchend touchcancel mouseup"],n.EVENT_TYPES[n.EVENT_START]=t[0],n.EVENT_TYPES[n.EVENT_MOVE]=t[1],n.EVENT_TYPES[n.EVENT_END]=t[2]},getTouchList:function(t){return n.HAS_POINTEREVENTS?n.PointerEvent.getTouchList():t.touches?t.touches:[{identifier:1,pageX:t.pageX,pageY:t.pageY,target:t.target}]},collectEventData:function(e,i,s){var o=this.getTouchList(s,i),r=n.POINTER_TOUCH;return(s.type.match(/mouse/)||n.PointerEvent.matchType(n.POINTER_MOUSE,s))&&(r=n.POINTER_MOUSE),{center:t.util.getCenter(o),timeStamp:(new Date).getTime(),target:s.target,touches:o,eventType:i,pointerType:r,srcEvent:s,preventDefault:function(){this.srcEvent.preventManipulation&&this.srcEvent.preventManipulation(),this.srcEvent.preventDefault&&this.srcEvent.preventDefault()},stopPropagation:function(){this.srcEvent.stopPropagation()},stopDetect:function(){return n.detection.stopDetect()}}}},n.PointerEvent={pointers:{},getTouchList:function(){var t=this,e=[];return Object.keys(t.pointers).sort().forEach(function(i){e.push(t.pointers[i])}),e},updatePointer:function(t,e){return t==n.EVENT_END?this.pointers={}:(e.identifier=e.pointerId,this.pointers[e.pointerId]=e),Object.keys(this.pointers).length},matchType:function(t,e){if(!e.pointerType)return!1;var i={};return i[n.POINTER_MOUSE]=e.pointerType==e.MSPOINTER_TYPE_MOUSE||e.pointerType==n.POINTER_MOUSE,i[n.POINTER_TOUCH]=e.pointerType==e.MSPOINTER_TYPE_TOUCH||e.pointerType==n.POINTER_TOUCH,i[n.POINTER_PEN]=e.pointerType==e.MSPOINTER_TYPE_PEN||e.pointerType==n.POINTER_PEN,i[t]},getEvents:function(){return["pointerdown MSPointerDown","pointermove MSPointerMove","pointerup pointercancel MSPointerUp MSPointerCancel"]},reset:function(){this.pointers={}}},n.utils={extend:function(t,i,n){for(var s in i)t[s]!==e&&n||(t[s]=i[s]);return t},hasParent:function(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1},isVertical:function(t){return t==n.DIRECTION_UP||t==n.DIRECTION_DOWN},stopDefaultBrowserBehavior:function(t,e){var i,n=["webkit","khtml","moz","ms","o",""];if(e&&t.style){for(var s=0;n.length>s;s++)for(var o in e)e.hasOwnProperty(o)&&(i=o,n[s]&&(i=n[s]+i.substring(0,1).toUpperCase()+i.substring(1)),t.style[i]=e[o]);"none"==e.userSelect&&(t.onselectstart=function(){return!1})}}},n.detection={gestures:[],current:null,previous:null,stopped:!1,startDetect:function(t,e){this.current||(this.stopped=!1,this.current={inst:t,startEvent:n.utils.extend({},e),lastEvent:!1,name:""},this.detect(e))},detect:function(t){if(this.current&&!this.stopped){t=this.extendEventData(t);for(var e=this.current.inst.options,i=0,s=this.gestures.length;s>i;i++){var o=this.gestures[i];if(!this.stopped&&e[o.name]!==!1&&o.handler.call(o,t,this.current.inst)===!1){this.stopDetect();break}}return this.current&&(this.current.lastEvent=t),t.eventType==n.EVENT_END&&!t.touches.length-1&&this.stopDetect(),t}},stopDetect:function(){this.previous=n.utils.extend({},this.current),this.current=null,this.stopped=!0},extendEventData:function(e){var i=this.current.startEvent;if(i&&(e.touches.length!=i.touches.length||e.touches===i.touches)){i.touches=[];for(var s=0,o=e.touches.length;o>s;s++)i.touches.push(n.utils.extend({},e.touches[s]))}var r=e.timeStamp-i.timeStamp,a=e.center.pageX-i.center.pageX,l=e.center.pageY-i.center.pageY,u=t.util.getVelocity(r,a,l);return n.utils.extend(e,{deltaTime:r,deltaX:a,deltaY:l,velocityX:u.x,velocityY:u.y,distance:t.util.getDistance(i.center,e.center),angle:t.util.getAngle(i.center,e.center),direction:t.util.getDirection(i.center,e.center),scale:t.util.getScale(i.touches,e.touches),rotation:t.util.getRotation(i.touches,e.touches),startEvent:i}),e},register:function(t){var i=t.defaults||{};return i[t.name]===e&&(i[t.name]=!0),n.utils.extend(n.defaults,i,!0),t.index=t.index||1e3,this.gestures.push(t),this.gestures.sort(function(t,e){return t.index<e.index?-1:t.index>e.index?1:0}),this.gestures}},n.gestures=n.gestures||{},n.gestures.LonTap={name:"lontap",index:10,defaults:{hold_timeout:500,hold_threshold:1},timer:null,handler:function(t,e){switch(t.eventType){case n.EVENT_START:clearTimeout(this.timer),n.detection.current.name=this.name,this.timer=setTimeout(function(){"lontap"==n.detection.current.name&&e.trigger("lontap",t)},e.options.hold_timeout);break;case n.EVENT_MOVE:t.distance>e.options.hold_threshold&&clearTimeout(this.timer);break;case n.EVENT_END:clearTimeout(this.timer)}}},n.gestures.Tap={name:"tap",index:100,defaults:{tap_max_touchtime:250,tap_max_distance:10,tap_always:!0,doubletap_distance:20,doubletap_interval:300},handler:function(t,e){if(t.eventType==n.EVENT_END){var i=n.detection.previous,s=!1;if(t.deltaTime>e.options.tap_max_touchtime||t.distance>e.options.tap_max_distance)return;i&&"tap"==i.name&&t.timeStamp-i.lastEvent.timeStamp<e.options.doubletap_interval&&t.distance<e.options.doubletap_distance&&(e.trigger("doubletap",t),s=!0),(!s||e.options.tap_always)&&(n.detection.current.name="tap",e.trigger(n.detection.current.name,t))}}},n.gestures.Swipe={name:"swipe",index:40,defaults:{swipe_max_touches:1,swipe_velocity:.7},handler:function(t,e){if(t.eventType==n.EVENT_END){if(e.options.swipe_max_touches>0&&t.touches.length>e.options.swipe_max_touches)return;(t.velocityX>e.options.swipe_velocity||t.velocityY>e.options.swipe_velocity)&&(e.trigger(this.name,t),e.trigger(this.name+t.direction,t))}}},n.gestures.Drag={name:"drag",index:50,defaults:{drag_min_distance:10,drag_max_touches:1,drag_block_horizontal:!1,drag_block_vertical:!1,drag_lock_to_axis:!1,drag_lock_min_distance:25},triggered:!1,handler:function(t,i){if(n.detection.current.name!=this.name&&this.triggered)return i.trigger(this.name+"end",t),this.triggered=!1,e;if(!(i.options.drag_max_touches>0&&t.touches.length>i.options.drag_max_touches))switch(t.eventType){case n.EVENT_START:this.triggered=!1;break;case n.EVENT_MOVE:if(t.distance<i.options.drag_min_distance&&n.detection.current.name!=this.name)return;n.detection.current.name=this.name,(n.detection.current.lastEvent.drag_locked_to_axis||i.options.drag_lock_to_axis&&i.options.drag_lock_min_distance<=t.distance)&&(t.drag_locked_to_axis=!0);var s=n.detection.current.lastEvent.direction;t.drag_locked_to_axis&&s!==t.direction&&(t.direction=n.utils.isVertical(s)?0>t.deltaY?n.DIRECTION_UP:n.DIRECTION_DOWN:0>t.deltaX?n.DIRECTION_LEFT:n.DIRECTION_RIGHT),this.triggered||(i.trigger(this.name+"start",t),this.triggered=!0),i.trigger(this.name,t),i.trigger(this.name+t.direction,t),(i.options.drag_block_vertical&&n.utils.isVertical(t.direction)||i.options.drag_block_horizontal&&!n.utils.isVertical(t.direction))&&t.preventDefault();break;case n.EVENT_END:this.triggered&&i.trigger(this.name+"end",t),this.triggered=!1}}},n.gestures.Transform={name:"transform",index:45,defaults:{transform_min_scale:.01,transform_min_rotation:1,transform_always_block:!1},triggered:!1,handler:function(t,i){if(n.detection.current.name!=this.name&&this.triggered)return i.trigger(this.name+"end",t),this.triggered=!1,e;if(!(2>t.touches.length))switch(i.options.transform_always_block&&t.preventDefault(),t.eventType){case n.EVENT_START:this.triggered=!1;break;case n.EVENT_MOVE:var s=Math.abs(1-t.scale),o=Math.abs(t.rotation);if(i.options.transform_min_scale>s&&i.options.transform_min_rotation>o)return;n.detection.current.name=this.name,this.triggered||(i.trigger(this.name+"start",t),this.triggered=!0),i.trigger(this.name,t),o>i.options.transform_min_rotation&&i.trigger("rotate",t),s>i.options.transform_min_scale&&(i.trigger("pinch",t),i.trigger("pinch"+(1>t.scale?"in":"out"),t));break;case n.EVENT_END:this.triggered&&i.trigger(this.name+"end",t),this.triggered=!1}}},n.gestures.Touch={name:"touch",index:-1/0,defaults:{prevent_default:!1,prevent_mouseevents:!1},handler:function(t,i){return i.options.prevent_mouseevents&&t.pointerType==n.POINTER_MOUSE?(t.stopDetect(),e):(i.options.prevent_default&&t.preventDefault(),t.eventType==n.POINTER_MOUSE&&i.trigger(this.name,t),e)}},n.gestures.Release={name:"release",index:1/0,handler:function(t,e){t.eventType==n.EVENT_END&&e.trigger(this.name,t)}},t.gesture=n}(octopus),function(t){"use strict";t.ScrollLite=t.define({el:null,scrollEl:null,gesture:null,isDrag:!1,pageDragStartC:null,pageDragTempC:null,pageDragEndC:null,stop:!1,tempV:0,maxV:150,dragDirection:null,distance:350,swipeVelocity:.8,duration:.8,isTween:!1,isTransform:!1,dragTween:null,limitV:null,time:0,touchStartPixelX:null,touchStartPixelY:null,initialize:function(e){e.el=t.g(e.el),e.scrollEl=t.g(e.scrollEl),t.extend(this,e);var i=e.el,n=e.scrollEl;if(!i||!n)throw Error("Illegal arguments!");this.gesture=t.gesture,i.style.overflow="hidden",n.style.webkitBackfaceVisibility="hidden",this.isTransform||(n.style.position="relative","static"==t.dom.getStyle(i,"position")&&(i.style.position="relative")),this.initEvent()},updateV:function(t){this.tempV=t},initEvent:function(){t.event.on(this.el,"touchstart",t.util.bindAsEventListener(this.onTouchStart,this)),t.event.on(this.el,"touchmove",t.util.bindAsEventListener(this.onTouchMove,this)),t.event.on(this.el,"touchend",t.util.bindAsEventListener(this.onTouchEnd,this)),t.event.on(this.el,"touchcancel",t.util.bindAsEventListener(this.onTouchEnd,this));var e=this;t.event.on(window,"ortchange",function(){if(e.tempV<-e.limitV){var t;if(e.isTransform)t="translate3d(-"+e.limitV+"px, 0, 0)",e.scrollEl.style.webkitTransform=t;else{t=-e.limitV+"px";var i="left";e.scrollEl.style[i]=t}}}),t.gesture(this.scrollEl,{swipe_velocity:this.swipeVelocity}).on("swipe",function(t){e.onSwipe(t)})},onSwipe:function(e){if(!this.isTween){var i=Date.now(),n=i-this.time;if(this.time=i,!(1500*this.duration>n)){var s=e.gesture,o=s.velocityX,r=s.direction,a=this.distance*o,l=this,u=this.limitV;if(!(this.tempV>0||-u>this.tempV)){var h,c,d,p;if("right"==r||"down"==r?(p=this.tempV+a,c=p>0?0:p):(p=this.tempV-a,c=-u>p?-u:p),this.isTransform)h="translate3d("+this.tempV+"px, 0, 0px)",d="translate3d("+c+"px, 0, 0px)",this.isTween=!0,new t.Tween(this.scrollEl,"-webkit-transform",h,d,this.duration,function(){l.updateV(c),l.isTween=!1},{ease:"ease-out"});else{var g="left",m={prop:l.tempV},f={prop:c};this.dragTween=new t.StepTween({startValue:m,endValue:f,func:{eachStep:t.util.bind(function(t){l.scrollEl.style[g]=t.prop+"px",l.updateV(t.prop)},l)},duration:100*l.duration})}}}}},updateLimitV:function(){this.limitV=t.dom.getWidth(this.scrollEl)-t.dom.getWidth(this.el)},onTouchStart:function(e){if(!this.isTween){this.limitV||this.updateLimitV();var i=e.touches;if(i&&!(i.length>1)){this.stopDragTween(),this.stop=!1,this.isDrag=!0;var n=i[0];this.touchStartPixelX=n.pageX,this.touchStartPixelY=n.pageY,this.pageDragStartC=this.pageDragTempC=n.pageX;var s=this;t.util.requestAnimation(function(){s.onDragTimer()})}}},stopDragTween:function(){this.dragTween&&(this.dragTween.stop(),this.dragTween=null)},onDragTimer:function(){if(!this.stop){var e=this;if(this.pageDragTempC==this.pageDragEndC||this.isTween)return this.pageDragStartC=this.pageDragTempC,t.util.requestAnimation(function(){e.onDragTimer()}),undefined;this.pageDragTempC>this.pageDragStartC?this.dragDirection="next":this.pageDragTempC<this.pageDragStartC&&(this.dragDirection="pre"),this.pageDragEndC=this.pageDragTempC;var i=this.pageDragTempC-this.pageDragStartC;this.pageDragStartC=this.pageDragTempC;var n,s,o=this.tempV,r=o+i;if("next"==this.dragDirection)r>this.maxV&&(r=this.maxV);else{var a=this.limitV;-(this.maxV+a)>r&&(r=-(this.maxV+a))}if(r==this.tempV)return t.util.requestAnimation(function(){e.onDragTimer()}),undefined;this.isTransform?(s="webkitTransform",n="translate3d("+r+"px, 0, 0)"):(n=r+"px",s="left"),this.scrollEl.style[s]=n,this.updateV(r),t.util.requestAnimation(function(){e.onDragTimer()})}},onTouchMove:function(e){var i=e.touches;if(this.isDrag&&i&&!(i.length>1)){var n=i[0];if(this.pageDragTempC!=n.pageX){var s={pageX:this.touchStartPixelX,pageY:this.touchStartPixelY},o=t.util.getDirection(s,n);("left"==o||"right"==o)&&t.event.stop(e),this.pageDragTempC=n.pageX}}},onTouchEnd:function(){this.isDrag=!1,this.stop=!0;var e,i,n=this.limitV,s=0,o=this;if(this.isTransform?(e="translate3d("+this.tempV+"px, 0, 0)",i="translate3d(-"+n+"px, 0, 0)"):(e=this.tempV,i=-n),this.tempV>0||-n>this.tempV)if(this.isTransform)this.tempV>0?i="translate3d(0, 0, 0)":s=-n,this.isTween=!0,new t.Tween(this.scrollEl,"-webkit-transform",e,i,.4,function(){o.updateV(s),o.isTween=!1},{ease:"ease-out"});else{this.tempV>0?i=0:s=-n,this.stopDragTween();var r="left",a={prop:e},l={prop:s};this.dragTween=new t.StepTween({startValue:a,endValue:l,func:{eachStep:t.util.bind(function(t){o.scrollEl.style[r]=t.prop+"px",o.updateV(t.prop)},o)},duration:50})}},CLASS_NAME:"octopus.ScrollLite"})}(octopus),function(t){"use strict";t.lazyImg=function(e){return new t.ImgLazyLoad(e||{}).check()},t.ImgLazyLoad=t.define({el:null,container:null,imgs:null,srcName:"src",opts:null,isScroll:!1,event:null,initialize:function(e){this.opts=t.extend({},e),this.container=t.g(e.container)||document.body;var i=this,n=this.container==document.body?window:this.container,s=e.imgs;this.imgs=[],this.event=new t.Events(this),this.setDoms(s),t.event.on(n,"scroll",function(){i.isScroll||(t.util.requestAnimation(t.util.bind(i.check,i)),i.isScroll=!0)},!1),t.event.on(window,"ortchange",t.util.bind(this.reset,this),!1)},on:function(t,e){this.event.on(t,e)},un:function(t,e){this.event.un(t,e)},notify:function(t,e){this.event.triggerEvent(t,e)},setDoms:function(e){if(e)if(t.util.isArray(e))this.imgs=this.imgs.concat(e);else{var i=t.g(e);t.util.isNode(i)&&this.imgs.push(i)}else if(this.opts.el){this.el=this.el||t.g(this.opts.el);var n=t.$("img",this.el),s=n.length;if(s>0){var o=this;t.util.each(n,function(e){t.util.isNode(e)&&!t.dom.data(e,"loaded")&&t.dom.data(e,o.srcName)&&o.imgs.push(e)})}else"img"==this.el.tagName.toLowerCase()&&!t.dom.data(this.el,"loaded")&&t.dom.data(this.el,this.srcName)&&this.imgs.push(this.el)}},reset:function(t){this.setDoms(t),this.check()},check:function(){this.isScroll=!1;var e=this.imgs.length;if(0==e)return this;var i=this.container.scrollTop,n=t.dom.getHeight(this.container);if(this.container==document.body){var s=t.dom.getScreenHeight();n>s&&(n=s)}for(var o=e;o--;){var r=this.imgs[o];t.dom.data(r,"loaded")?this.imgs.splice(o,1):this.checkImg(r,i,n)}return this},checkImg:function(e,i,n){var s=t.util;if(s.isNode(e)){var o=t.dom,r=o.data(e,"loaded"),a=o.data(e,this.srcName);if(!r){var l=o.getPosition(e),u=o.getHeight(e),h=l.top;if(i>=h-n&&h+u+n>=i){var c=this;s.loadImage(a,s.empty,function(){c.notify("imglazyload-core-loadimgsuccess",e),o.attr(e,{src:a,"data-loaded":"loaded"})},function(){c.notify("imglazyload-core-loadimgfaile",e)})}}}}})}(octopus),function(o,undefined){"use strict";o.Widget=o.define({id:null,options:null,el:null,container:null,autoActivate:!1,active:!1,events:null,isShow:!1,gesture:null,eventListeners:null,widgetManager:null,initialize:function(t){t=t||{},this.addOptions(t),this.events=new o.Events(this),this.gesture=o.gesture,this.id=this.id||o.util.createUniqueID(this.CLASS_NAME+"_"),this.eventListeners instanceof Object&&this.events.register(this.eventListeners),this.el=this.el||document.createElement("div"),this.el.id?this.id=this.el.id:this.el.id=this.id},render:function(){var t=arguments.length;if(this.container=0==t?this.container||document.body:o.g(arguments[0]),this.container.appendChild===undefined)throw Error("Illegal Dom!");if(arguments[1]){var e=o.dom.cloneNode(this.container,!0);this.appendChild(this.el,e),this.container.parentNode.replaceChild(e,this.container),this.container=e}else this.appendChild(this.el,this.container);this.active||this.activate(),this.isShow||this.show()},appendChild:function(t,e){e.appendChild(t)},activate:function(){this.active||(o.dom.addClass(this.el,"activate"),this.active=!0)},deactivate:function(){this.active&&(o.dom.removeClass(this.el,"activate"),this.active=!1)},destroy:function(){this.container&&(this.container.removeChild(this.el),this.container=null),this.el=null},on:function(t,e,i){var n=o.Widget.GESTURES;return-1!=n.indexOf(t)?(this.gesture(this.el,i).on(t,e),undefined):(this.events.on(t,e),undefined)},un:function(t,e){this.events.un(t,e)},notify:function(t,e){this.events.triggerEvent(t,e)},addOptions:function(t){null==this.options&&(this.options={}),o.extend(this.options,t),o.extend(this,t)},show:function(){this.isShow||(this.isShow=!0,this.el.style.display="block")},hidden:function(){this.isShow&&(this.isShow=!1,this.el.style.display="none")},toggleVisible:function(){this.isShow?this.hidden():this.show()},clone:function(){return eval("new "+this.CLASS_NAME+"(o.util.clone(this.options))")},getEl:function(){return this.el},getHeight:function(){return o.dom.getHeight(this.el)||o.dom.getStyle(this.el,"height")},getWidth:function(){return o.dom.getWidth(this.el)||o.dom.getStyle(this.el,"width")},setManager:function(t){this.widgetManager=t},setZIndex:function(t){this.el.style.zIndex=t},CLASS_NAME:"octopus.Widget"}),o.Widget.GESTURES=["tap","lontap","doubletap","swipe","swipeleft","swiperight","swipeup","swipedown","drag","drapleft","dragright","dragup","dragdown","touch","release"],o.widgetManager=function(t,e){return new o.WidgetManager(t,e)},o.WidgetManager=o.define({el:null,els:null,opts:null,classFilter:null,widgets:null,supportType:null,event:null,initialize:function(t,e){if(this.opts=o.extend({},e||{}),this.el=o.g(t),!o.util.isNode(this.el))throw Error("require a node to initialize!");return this.els=[],this.event=new o.Events(this),this.widgets=[],this.supportType=this.opts.supportType||["slider","back2top"],this.classFilter=this.opts.classFilter||".octopusui-container",this},init:function(){var t=o.$(this.classFilter,this.el),e=this;o.util.each(t,function(t){o.util.isNode(t)&&e.els.push(t)}),0!=this.els.length&&o.util.each(this.els,o.util.bind(this.initWidgets,this))},initWidgets:function(t){var e=o.dom.data(t,"octopusui-type"),i=this.supportType.indexOf(e);if(-1!=i&&!o.dom.data(t,"octopusui-loaded")){var n=this[this.supportType[i]](t);this.register(n),o.dom.data(n.el,{"octopusui-loaded":"true"})}},getWidgetBy:function(t,e){for(var i=[],n=this.widgets.length,s=n;s--;){var o=this.widgets[s];if(o[t]==e){if("id"==t)return o;i.push(o)}}return i},getWidgetById:function(t){return this.getWidgetBy("id",t)},getWidgetByClass:function(t){return this.getWidgetBy("CLASS_NAME",t)},slider:function(t){return o.Widget.slider(t)},back2top:function(t){return o.Widget.back2top(t)},register:function(t){return-1!=this.widgets.indexOf(t)?!1:(this.widgets.push(t),t.setManager(this),undefined)},unregister:function(t){var e=this.widgets.indexOf(t);return-1==e?!1:(this.widgets[e].setManager(null),this.widgets.splice(e,1),undefined)},CLASS_NAME:"octopus.WidgetManager"})}(octopus),function(t){"use strict";t.Widget.Slider=t.define(t.Widget,{data:null,width:null,height:null,children:null,doms:null,length:0,_type:"img",dataField:null,viewDiv:null,isLon:!1,isNewTab:!0,isDisableA:!1,current:null,loadImageNumber:4,timer:null,autoPlayTime:4e3,animationTime:400,animationType:"ease-out",disableAll:!1,disScroll:!1,loop:!0,autoPlay:!0,hasButton:!0,hasTitle:!0,hasGizmos:!0,preDom:null,nextDom:null,currentGizmos:null,gizmosDoms:null,isSlide:!1,isDrag:!1,isTimer:!1,pageDragStartC:0,pageDragEndC:0,pageDragTempC:0,pageDragDirection:!1,dragtimer:null,translateValue:0,changeDis:0,springBackDis:10,eventTimer:null,unloadImage:null,touchStartPixelX:null,touchStartPixelY:null,initialize:function(){if(t.Widget.prototype.initialize.apply(this,arguments),this.dataField=this.dataField||{title:"title",url:"url",image_url:"image_url"},this.doms=this.children||[],this.unloadImage=[],this.length=0==this.doms.length?this.data.length:this.doms.length,this.current={index:0,dom:null},this.buildDoms(this.el),this.buildSlider(),this.el.style.cssText="overflow: hidden; width: 100%; height: 100%; position: relative;",this.autoActivate){if(null==this.width||null==this.height)throw Error("Require the Slider's width and height!");this.activate()}},buildDoms:function(e){if(this.viewDiv=this.viewDiv||t.dom.createDom("div",{style:"position: relative; text-align: center; -webkit-transform: translate3d(0, 0, 0); -webkit-backface-visibility: hidden; -webkit-user-select: none; -webkit-user-drag: none; -webkit-transition: -webkit-transform 0ms "+this.animationType+";","class":"octopusui-slider-view"}),this.hasButton&&!this.disableAll&&this.length>1){var i="display: block; text-decoration: none;";this.preDom=t.dom.createDom("div",{href:"",style:i,"class":"octopusui-slider-button octopusui-slider-prebutton"}),this.nextDom=t.dom.createDom("div",{href:"",style:i,"class":"octopusui-slider-button octopusui-slider-nextbutton"});var n=this;this.gesture(this.preDom).on("tap",function(e){t.event.stop(e),n._selectPre(),n.autoPlay&&n.start()}),this.gesture(this.nextDom).on("tap",function(e){t.event.stop(e),n._selectNext(),n.autoPlay&&n.start()}),e.appendChild(this.preDom),e.appendChild(this.nextDom)}if(this.hasGizmos){this.gizmosDoms=Array(this.length);for(var s=this.length,o=0,r=document.createDocumentFragment(),a=t.dom.createDom("div",{"class":"octopusui-slider-gizmos"});s>o;o++){var l="octopusui-slider-gizmositem";0==o&&(l="octopusui-slider-gizmositem octopusui-slider-currentgizmositem");var u=t.dom.createDom("div",{"class":l});
this.gizmosDoms[o]=u,r.appendChild(u)}this.currentGizmos=this.gizmosDoms[0],a.appendChild(r),e.appendChild(a)}},setCurrent:function(e){if(this.current=t.extend(this.current,e),this.currentGizmos){var i=this.current.index;this.currentGizmos!=this.gizmosDoms[i]&&(t.dom.removeClass(this.currentGizmos,"octopusui-slider-currentgizmositem"),this.currentGizmos=this.gizmosDoms[i],t.dom.addClass(this.currentGizmos,"octopusui-slider-currentgizmositem"))}},buildSlider:function(){var t;if(t=null==this.children?this.buildDefaultSlider():this.buildDomSlider(),this.loop&&this.length>1){var e=this.doms[0].cloneNode(!0),i=this.doms[this.length-1].cloneNode(!0);"img"==this._type&&(this.setImageLoad(0,e),this.setImageLoad(this.length-1,i)),t.appendChild(e),t.appendChild(i),this.doms.push(e),this.doms.push(i),this.length+=2}this.setCurrent({dom:this.doms[0]}),this.viewDiv.appendChild(t),this.el.appendChild(this.viewDiv)},buildSliderItem:function(e){var i=t.dom.createDom("div",{"class":"octopusui-slider-children",style:"position: relative; -webkit-transform: translate3d(0, 0, 0); overflow: hidden;"}),n=t.dom.createDom("img",{"class":"octopusui-slider-imgChildren",style:"max-width: 100%; max-height: 100%; position: absolute; left: 0; right: 0; top: 0; bottom: 0; margin: auto;"}),s=this.getDataBy(e,"url")||"",o=this.isNewTab?"_blank":"_self",r=this;if(t.event.on(n,"click",function(){return r.isDisableA?(r.notify("slider-item-ontap",r.data[e]),undefined):(window.open(s,o),undefined)}),Math.ceil(this.loadImageNumber/2)>e||e>=Math.floor(this.length-this.loadImageNumber/2)?this.setImageLoad(e,n):this.unloadImage.push({index:e,dom:n}),i.appendChild(n),this.hasTitle){var a=t.dom.createDom("div",{"class":"octopusui-slider-imgTitle"}),l=t.dom.createDom("div",{"class":"octopusui-slider-imgTitleContent octopusui-text-limit"});l.innerHTML=t.util.encodeHtml(this.getDataBy(e,"title")),a.appendChild(l),i.appendChild(a)}return this.doms.push(i),i},on:function(e){t.Widget.prototype.on.apply(this,arguments),"slider-item-ontap"!=e||this.isDisableA||(this.isDisableA=!0)},buildDefaultSlider:function(){var t=this.data.length;if(!t)throw Error("Require data of image!");for(var e=0,i=document.createDocumentFragment();t>e;e++){var n=this.buildSliderItem(e);i.appendChild(n)}return i},setImageLoad:function(e,i){var n=this.getDataBy(e,"image_url"),s=t.one(".octopusui-slider-imgChildren",i)||i;t.util.loadImage(n,t.util.empty,function(){s.src=n,t.animation.fade(s,{out:!1})},function(){console.error("Image "+n+" load failed!")})},buildDomSlider:function(){var t=document.createDocumentFragment(),e=this.doms.length,i=0;for(this._type="dom";e>i;i++)t.appendChild(this.doms[i]);return t},render:function(){t.Widget.prototype.render.apply(this,arguments),this.autoPlay&&this.length>1&&this.start(),this.notify("slider-ui-afterrender")},activate:function(){t.Widget.prototype.activate.apply(this,arguments),this.calcSelfSize(),this.disableAll||this.initSelfEvent()},onOrtChanged:function(){this.calcSelfSize(),this.select(this.current.index)},updateTranslateValue:function(t){!t&&0!=t||this.translateValue==t||(this.translateValue=t)},calcSelfSize:function(){this.isLon?this.initDomsProperty("width","height",!1):this.initDomsProperty("height","width",!0)},initDomsProperty:function(e,i,n){var s=this,o=this.length;this.viewDiv.style[e]="100%";var r=t.dom["get"+i.charAt(0).toUpperCase()+i.substring(1)](this.el);this[i]=r,this.viewDiv.style[i]=r*o+"px",t.util.each(this.doms,function(t,a){if(t.style[e]="100%",t.style[i]=r+"px",n&&(t.style.float="left"),a==o-1&&s.loop&&s.length>1){var l=s.isLon?"top":"left";t.style[l]=0-r*o+"px"}})},initSelfEvent:function(){this.length>1&&(t.event.on(this.el,"touchstart",t.util.bindAsEventListener(this.onTouchStart,this)),t.event.on(this.el,"touchmove",t.util.bindAsEventListener(this.onTouchMove,this)),t.event.on(this.el,"touchend touchcancel",t.util.bindAsEventListener(this.onTouchEnd,this))),t.event.on(window,"ortchange",t.util.bind(this.onOrtChanged,this),!1)},onTouchStart:function(e){if(!this.eventTimer&&!this.isSlide){this.disScroll&&t.event.stop(e);var i=e.touches;if(i&&!(i.length>1)){this.viewDiv.style.webkitTransitionDuration="0ms",this.isDrag=!0,this.autoPlay&&this.stop();var n,s=i[0];n=this.isLon?s.pageY:s.pageX,this.touchStartPixelX=s.pageX,this.touchStartPixelY=s.pageY,this.pageDragStartC=this.pageDragTempC=n;var o=this;this.dragtimer=window.setInterval(function(){if(o.pageDragTempC!=o.pageDragEndC){o.pageDragEndC=o.pageDragTempC;var t=o.pageDragTempC-o.pageDragStartC;o.pageDragStartC=o.pageDragTempC;var e,i=o.translateValue,n=i+t;e=o.isLon?"translate3d(0, "+n+"px, 0)":"translate3d("+n+"px, 0, 0)",o.updateTranslateValue(n),o.changeDis+=t,o.viewDiv.style.webkitTransform=e}},16)}}},onTouchMove:function(e){var i=e.touches;if(this.isDrag&&i&&!(i.length>1)){var n,s=i[0];if(n=this.isLon?s.pageY:s.pageX,this.pageDragTempC!=n){var o={pageX:this.touchStartPixelX,pageY:this.touchStartPixelY},r=t.util.getDirection(o,s);return this.pageDragTempC=n,this.disScroll?t.event.stop(e):((this.isLon&&("up"==r||"down"==r)||!this.isLon&&("left"==r||"right"==r))&&t.event.stop(e),undefined)}}},onTouchEnd:function(t){this.isDrag=!1,this.dragtimer&&(window.clearInterval(this.dragtimer),this.dragtimer=null);var e=t.target;e!=this.preDom&&e!=this.nextDom&&(Math.abs(this.changeDis)<=this.springBackDis?this.select(this.current.index):this.loop?0>this.changeDis?this._selectNext():this._selectPre():this.loop||(0>this.changeDis&&this.current.index!=this.length-1?this._selectNext():this.changeDis>0&&0!=this.current.index?this._selectPre():this.select(this.current.index)),this.changeDis=0,this.autoPlay&&this.start())},getDataBy:function(t,e){return this.data[t][this.dataField[e]]},start:function(){this.stop(),this.timer=window.setTimeout(t.util.bind(this._calcCurrent,this),this.autoPlayTime)},_calcCurrent:function(){var t=this.current.index,e=this.loop?this.length-2:this.length;t=++t==e?0:t,this.select(t,"next"),this.start()},stop:function(){this.timer&&(window.clearTimeout(this.timer),this.timer=null)},select:function(t){if(this.isSlide=!0,this.viewDiv.style.webkitTransitionDuration=this.animationTime+"ms",this.loop?this.selectLoop(t,arguments[1]):this.selectNoLoop(t),this.setCurrent({index:t,dom:this.doms[t]}),"img"==this._type&&this.unloadImage.length>0)for(var e=t+Math.ceil(this.loadImageNumber/2),i=Math.floor(this.loadImageNumber/2),n=this.unloadImage.length,s=n;s--;){var o=this.unloadImage[s].index;(e>o&&!this.pageDragDirection||i>=t-o&&this.pageDragDirection)&&(this.setImageLoad(o,this.unloadImage[s].dom),this.unloadImage.splice(s,1))}var r=this;window.setTimeout(function(){r.isSlide=!1,r.notify("slider-ui-slidechange")},this.animationTime)},selectNoLoop:function(t){var e="translate3d(";if(this.isLon){var i=0-t*this.height;e+="0, "+i+"px, 0)"}else{var i=0-t*this.width;e+=i+"px, 0, 0)"}this.updateTranslateValue(i),this.viewDiv.style.webkitTransform=e},selectLoop:function(e){var i,n=this.current.index,s=this.length-2,o=i="translate3d(";if(0==e&&n==s-1||0==n&&e==s-1){var r=this,a=arguments[1];if(2==s&&a&&(0==e&&n==s-1&&"pre"==a||e==s-1&&0==n&&"next"==a))return this.selectNoLoop(e),undefined;this.isTimer=!0;var l=function(){t.event.un(r.viewDiv,"webkitTransitionEnd",l,!1),r.isTimer&&(r.eventTimer&&(window.clearTimeout(r.eventTimer),r.eventTimer=null),r.viewDiv.style.webkitTransitionDuration="0ms",r.viewDiv.style.webkitTransform=o)};t.event.on(this.viewDiv,"webkitTransitionEnd",l,!1),0==e&&n==s-1?(o+="0, 0, 0)",this.updateTranslateValue(0),i+=this.isLon?"0, "+(0-this.height*s)+"px, 0)":0-this.width*s+"px, 0, 0)"):e==s-1&&0==n&&(this.isLon?(i+="0, "+this.height+"px, 0)",o+="0, "+(0-this.height*(s-1))+"px, 0)",this.updateTranslateValue(0-this.height*(s-1))):(i+=this.width+"px, 0, 0)",o+=0-this.width*(s-1)+"px, 0, 0)",this.updateTranslateValue(0-this.width*(s-1)))),this.viewDiv.style.webkitTransform=i,this.eventTimer=window.setTimeout(function(){t.event.un(r.viewDiv,"webkitTransitionEnd",l,!1),r.viewDiv.style.webkitTransitionDuration="0ms",r.viewDiv.style.webkitTransform=o,r.eventTimer=null,r.isTimer=!1},0>this.animationTime-5?0:this.animationTime-5)}else this.selectNoLoop(e)},_selectPre:function(){if(!this.isSlide){var t=this.loop?this.length-2:this.length,e=0>this.current.index-1?t-1:this.current.index-1;this.pageDragDirection=!0,this.select(e,"pre")}},_selectNext:function(){if(!this.isSlide){var t=this.loop?this.length-2:this.length,e=this.current.index+1>t-1?0:this.current.index+1;this.pageDragDirection=!1,this.select(e,"next")}},CLASS_NAME:"octopus.Widget.Slider"}),t.Widget.slider=function(e){return new t.Widget.HtmlSlider({el:e})},t.Widget.HtmlSlider=t.define(t.Widget.Slider,{fragment:null,adaptive:null,initialize:function(){t.Widget.prototype.initialize.apply(this,arguments),this.dataField={title:"title",url:"url"},this.container=this.el.parentNode,this.fragment=document.createDocumentFragment(),this.unloadImage=[],this.loop=t.dom.data(this.el,"octopusui-slider-loop"),this.hasButton=!t.dom.data(this.el,"octopusui-slider-nobutton"),this.hasGizmos=!t.dom.data(this.el,"octopusui-slider-nogizmos"),this.disableAll=t.dom.data(this.el,"octopusui-slider-disable"),this.autoPlay=!t.dom.data(this.el,"octopusui-slider-notauto"),this.adaptive=t.dom.data(this.el,"octopusui-slider-adaptive"),this.hasTitle=!t.dom.data(this.el,"octopusui-slider-notitle"),this.disScroll=t.dom.data(this.el,"octopusui-slider-disscroll"),this.buildSelf(),this.isShow||this.show(),this.active||this.activate(),this.autoPlay&&this.length>1&&this.start(),this.notify("slider-ui-afterrender")},buildSelf:function(){var t=this.el.children,e=t.length;if(!(2>e)){this.length=e,this.data=[],this.doms=[],this.fragment=document.createDocumentFragment();var i=this.el.cloneNode(!1);this.buildDoms(i),this.buildSlider(t),i.appendChild(this.viewDiv),this.el.parentNode.replaceChild(i,this.el),this.el=i,this.el.style.cssText="overflow: hidden; position: relative;"}},buildSlider:function(e){if(t.util.each(e,t.util.bind(this.buildItem,this)),this.loop&&this.length>1){var i=this.doms[0].cloneNode(!0),n=this.doms[this.length-1].cloneNode(!0);this.doms.push(i),this.doms.push(n),this.fragment.appendChild(i),this.fragment.appendChild(n),this.length+=2}this.setCurrent({dom:this.doms[0],index:0}),this.viewDiv.appendChild(this.fragment)},render:function(){throw Error("this class can't render! :)")},buildItem:function(e,i){if(t.util.isNode(e)){this.data.push({url:t.dom.data(e,"octopusui-slider-url"),title:t.dom.data(e,"octopusui-slider-title")});var n=t.dom.createDom("div",{"class":"octopusui-slider-children",style:"-webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); position: relative;"}),s=e.cloneNode(!0),o="width: 100%;";!this.adaptive&&(o+=" position: absolute; left: 0; right: 0; top: 0; bottom: 0; margin: auto;",!0),s.style.cssText=o,n.appendChild(s);var r=this.getDataBy(i,"title");if(this.hasTitle&&r){var a=t.dom.createDom("div",{"class":"octopusui-slider-imgTitle"}),l=t.dom.createDom("div",{"class":"octopusui-slider-imgTitleContent octopusui-text-limit"});l.innerHTML=t.util.encodeHtml(r),a.appendChild(l),n.appendChild(a)}var u=this;this.gesture(n,{tap_max_touchtime:150}).on("tap",function(e){t.event.stop(e),u.notify("slider-item-ontap",u.data[i])}),this.fragment.appendChild(n),this.doms.push(n)}},CLASS_NAME:"octopus.Widget.HtmlSlider"})}(octopus),function(t){"use strict";t.Widget.Refresh=t.define(t.Widget,{direction:"up",dragDirection:null,timer:null,isDrag:!1,pageDragStartC:0,pageDragEndC:0,pageDragTempC:0,height:null,maxTranslate:100,halfTranslate:30,arrow:null,pullTextDom:null,pullText:null,changePullText:null,statusTextDom:null,loadingDom:null,statusText:null,loadText:null,changeStatusText:null,translateV:0,isLocked:!1,initialize:function(){t.Widget.prototype.initialize.apply(this,arguments),t.dom.attr(this.el,{"class":"octopusui-refresh octopusui-refresh"+t.util.camelize(this.direction)}),this.buildSelf()},updateTranslateV:function(t){this.translateV!=t&&(this.translateV=t)},buildSelf:function(){var e=this.direction,i=t.Widget.Refresh.config;this.arrow=t.dom.createDom("div",{"class":i[e].arrowC});var n=t.dom.createDom("div",{"class":"octopusui-refresh-textcontainer"}),s=t.dom.createDom("div",{"class":"octopusui-refresh-refreshcontainer"});this.pullTextDom=t.dom.createDom("div",{"class":"octopusui-refresh-pulltext octopusui-text-limit"}),this.statusTextDom=t.dom.createDom("div",{"class":"octopusui-refresh-statustext octopusui-text-limit"}),this.loadingDom=t.dom.createDom("div",{"class":"octopusui-refresh-loading"}),this.updateText("pullText","statusText"),n.appendChild(this.pullTextDom),n.appendChild(this.statusTextDom),s.appendChild(this.arrow),s.appendChild(this.loadingDom),s.appendChild(n),this.el.appendChild(s)},toggleLoading:function(t){t||"none"==this.loadingDom.style.display?t&&"block"!=this.loadingDom.style.display&&(this.loadingDom.style.display="block"):this.loadingDom.style.display="none"},render:function(){t.Widget.prototype.render.apply(this,arguments),null==this.height&&(this.height=t.dom.getHeight(this.el)),this.addEvent(),t.dom.scrollLite(this.container.parentNode,!1)},appendChild:function(e,i){"up"==this.direction?i.appendChild(e):t.dom.insertFirst(e,i)},addEvent:function(){t.event.on(document,"touchstart",t.util.bindAsEventListener(this.onTouchStart,this),!1),t.event.on(document,"touchend",t.util.bindAsEventListener(this.onTouchEnd,this),!1),t.event.on(document,"touchcancel",t.util.bindAsEventListener(this.onTouchEnd,this),!1),t.event.on(document,"touchmove",t.util.bindAsEventListener(this.onTouchMove,this),!1)},onTouchStart:function(e){t.event.stop(e,!0);var i=this,n=e.touches;if(n&&!(n.length>1)){this.isDrag=!0;var s=n[0],o=s.pageY;this.pageDragStartC=this.pageDragTempC=o,this.timer=function(){if(i.timer){if(i.pageDragTempC>i.pageDragStartC?i.dragDirection="down":i.pageDragTempC<i.pageDragStartC&&(i.dragDirection="up"),i.pageDragTempC==i.pageDragStartC||!i.adjustScrollBar())return i.pageDragStartC=i.pageDragTempC,t.util.requestAnimation(i.timer),undefined;i.pageDragEndC=i.pageDragTempC;var e=i.pageDragTempC-i.pageDragStartC;i.pageDragStartC=i.pageDragTempC;var n,s=i.translateV,o=s+e;if("up"==i.direction){if("up"==i.dragDirection&&i.isLocked)return t.util.requestAnimation(i.timer),undefined;n=0-i.maxTranslate>o?0-i.maxTranslate:o>0?0:o,0-i.halfTranslate>n?i.toggleStyle(!0):i.toggleStyle(!1)}else{if("down"==i.dragDirection&&i.isLocked)return t.util.requestAnimation(i.timer),undefined;n=o>i.maxTranslate?i.maxTranslate:0>o?0:o,n>i.halfTranslate+i.height?i.toggleStyle(!0):i.toggleStyle(!1)}i.updateTranslateV(n);var r="translate3d(0, "+n+"px"+", 0)";i.container.style.webkitTransform=r,t.util.requestAnimation(i.timer)}},t.util.requestAnimation(this.timer)}},toggleStyle:function(e){e&&!t.dom.hasClass(this.el,"octopusui-refresh-changed")?(t.dom.addClass(this.el,"octopusui-refresh-changed"),this.updateText("changePullText","changeStatusText")):!e&&t.dom.hasClass(this.el,"octopusui-refresh-changed")&&(t.dom.removeClass(this.el,"octopusui-refresh-changed"),this.updateText("pullText","statusText"),"none"==this.arrow.style.display&&(this.arrow.style.display="block"))},onTouchMove:function(t){var e=t.touches;if(this.isDrag&&e&&!(e.length>1)){var i=e[0];this.pageDragTempC!=i.pageY&&(this.pageDragTempC=i.pageY)}},onTouchEnd:function(){this.isDrag=!1,this.timer&&(this.timer=null),"up"==this.direction?this.translateV<0-this.halfTranslate?this.loadMore():this.isLocked||this.rePosition():this.translateV>this.halfTranslate+this.height?this.loadMore():this.isLocked||this.rePosition()},loadMore:function(){this.isLocked=!0;var e,i,n="translate3d(0, "+this.translateV+"px, 0)";if("up"==this.direction)e="translate3d(0, 0px, 0)",i=0;else{e="translate3d(0, "+this.height+"px, 0)",i=this.height;var s=document.createElement("div");document.body.appendChild(s)}if(n!=e){var o=this;new t.Tween(this.container,"-webkit-transform",n,e,.3,function(){o.updateTranslateV(i),o.updateText("loadText"),o.arrow.style.display="none",o.toggleLoading(!0),o.notify("refresh-ui-loadmore"),s&&document.body.removeChild(s)},{ease:"ease-in-out"})}},updateText:function(e,i){var n=this.direction,s=t.Widget.Refresh.config;this.pullTextDom.innerHTML=t.util.encodeHtml(this[e]||s[n][e]||s[e]),this.statusTextDom.innerHTML=i?t.util.encodeHtml(this[i]||s[i]):""},rePosition:function(){this.isLocked=!1;var e="translate3d(0, "+this.translateV+"px, 0)",i="translate3d(0, 0px, 0)",n=0;if(this.updateTranslateV(n),this.updateText("pullText","statusText"),this.toggleStyle(!1),this.toggleLoading(!1),e!=i){var s=t.util.empty;if("down"==this.direction){var o=document.createElement("div");document.body.appendChild(o),s=function(){document.body.removeChild(o)}}new t.Tween(this.container,"-webkit-transform",e,i,.3,s,{ease:"ease-in-out"})}},adjustScrollBar:function(){var t=this.translateV,e=document.body,i=e.scrollHeight,n=e.offsetHeight,s=e.scrollTop,o=n+s;return Math.abs(t)<=this.maxTranslate&&"up"==this.direction&&o+5>=i||"down"==this.direction&&0==s},CLASS_NAME:"octopus.Widget.Refresh"}),octopus.Widget.Refresh.config={up:{arrowC:"octopusui-refresh-arrowup",pullText:"上拉可以加载更多"},down:{arrowC:"octopusui-refresh-arrowdown",pullText:"下拉可以加载更多"},statusText:"上次更新时间:",changePullText:"松手可以加载更多",changeStatusText:"",loadText:"加载中..."}}(octopus),function(t){"use strict";t.Widget.Mask=t.define(t.Widget,{isScroll:!1,isResize:!1,animation:null,origin:null,initialize:function(){t.Widget.prototype.initialize.apply(this,arguments),t.dom.addClass(this.el,"octopusui-mask")},initEvent:function(){!this.isScroll&&t.event.on(document,"touchmove",t.util.bindAsEventListener(this.onTouchMove,this),!1),t.event.on(window,"ortchange",t.util.bind(this.calcSelfSize,this),!1)},calcSelfSize:function(){this.isResize||(t.util.requestAnimation(t.util.bind(this.refreshSize,this)),this.isResize=!0)},onTouchMove:function(e){this.isShow&&t.event.stop(e)},render:function(e,i,n){"scale"==this.animation&&n&&(this.origin=n),t.Widget.prototype.render.apply(this,arguments)},activate:function(){t.Widget.prototype.activate.apply(this,arguments),this.refreshSize(),this.initEvent()},refreshSize:function(){var e=t.dom.getStyle(this.container,"position");"static"==e&&(this.container.style.position="relative"),t.dom.setStyles(this.el,{width:"100%",left:"0px",height:Math.max(this.container.scrollHeight,this.container.clientHeight)+"px"},!1),this.isResize=!1},show:function(t){this.isShow||(t&&t!=this.origin&&(this.origin=t),this.origin&&(this.el.style.webkitTransformOrigin=this.origin.left+"px "+this.origin.top+"px"),this.isShow=!0,this.el.style.visibility="visible",this[this.animation]&&this[this.animation](!0))},hidden:function(){this.isShow&&(this.isShow=!1,this[this.animation]?this[this.animation](!1):this._hidden())},_hidden:function(){this.el.style.visibility="hidden",this.el.style.webkitTransformOrigin="",this.origin&&(this.origin=null)},fade:function(e){e?new t.Tween(this.el,"opacity",0,1,.3,t.util.empty,{ease:"ease-out"}):new t.Tween(this.el,"opacity",1,0,.3,t.util.bind(this._hidden,this),{ease:"ease-out"})},scale:function(e){e?new t.Tween(this.el,["opacity","-webkit-transform"],[0,"scale(0)"],[1,"scale(1)"],.3):new t.Tween(this.el,["opacity","-webkit-transform"],[1,"scale(1)"],[0,"scale(0)"],.3,t.util.bind(this._hidden,this))},rotate:function(e){this.el.style.webkitTransformOrigin="left bottom";var i=this;e?new t.Tween(this.el,["opacity","-webkit-transform"],[0,"rotate(-90deg)"],[1,"rotate(0deg)"],.3):new t.Tween(this.el,["opacity","-webkit-transform"],[1,"rotate(0deg)"],[0,"rotate(90deg)"],.3,function(){i._hidden()})},slideLeft:function(t){this.animate("slide","left",t)},slideRight:function(t){this.animate("slide","right",t)},slideUp:function(t){this.animate("slide","up",t)},slideDown:function(t){this.animate("slide","down",t)},animate:function(e,i,n){var s=n?t.util.empty:t.util.bind(this._hidden,this);t.animate({el:this.el,type:e,func:s,config:{direction:i,out:!n,isFade:!0}})},CLASS_NAME:"octopus.Widget.Mask"})}(octopus),function(t){"use strict";t.Widget.Back2Top=t.define(t.Widget,{bottom:10,direction:"right",offsetV:10,isAbsolute:!1,isFast:!1,scrollTimer:null,isScroll:!1,customize:!1,animation:!1,loop:null,count:0,testFixed:!1,testFixableDom:null,initialize:function(){t.Widget.prototype.initialize.apply(this,arguments),t.dom.addClass(this.el,"octopusui-back2top"),this.loop={},this.initFixed(),this.initEvent(),this.testFixableDom=t.dom.createDom("div",null,{top:"5px",position:"fixed"})},initFixed:function(){if(/M031/.test(navigator.userAgent))this.setAbsolute();else{var e=this.direction;t.dom.setStyles(this.el,{position:"fixed",bottom:this.bottom+"px"}),this.el.style[e]=this.offsetV+"px"}},setAbsolute:function(){this.el.style.position="absolute",this.isAbsolute=!0,t.event.on(window,"ortchange",t.util.bind(this.onOrientationChanged,this))},onOrientationChanged:function(){this.startFixed()},initEvent:function(){this.isFast&&t.event.on(document,"touchmove",t.util.bindAsEventListener(this.onTouchMove,this),!1),t.event.on(document,"scroll",t.util.bindAsEventListener(this.onJudgeScroll,this),!1),t.event.on(document,"touchend",t.util.bindAsEventListener(this.onTouchEnd,this),!1),t.event.on(document,"touchcancel",t.util.bindAsEventListener(this.onTouchEnd,this),!1),this.on("tap",t.util.bindAsEventListener(this.onTap,this))},onTap:function(t){this.notify("back2top-ontap",t),!this.customize&&this.goTo(1,this.animation)},goTo:function(e,i){if(i){var n=window.pageYOffset;this.count=0;var s=this;++this.count,this.loop[this.count]=function(){s.loop[s.count]?n>e-1?(window.scrollBy(0,-Math.min(150,n-e+1)),n-=150,t.util.requestAnimation(s.loop[s.count])):s.loop[s.count]=null:s.loop[s.count]=null},t.util.requestAnimation(this.loop[this.count])}else window.scrollTo(0,e)},onTouchEnd:function(){this.checkIfVisible()},onJudgeScroll:function(){this.isScroll||(t.util.requestAnimation(t.util.bind(this.onScroll,this)),this.isScroll=!0)},onScroll:function(){this.clearTimer(),this.isFast&&this.hidden(),this.isAbsolute&&this.startFixed(),this.scrollTimer=window.setTimeout(t.util.bind(this.onScrollStop,this),300),this.isScroll=!1},onScrollStop:function(){this.isAbsolute&&this.startFixed(),!this.testFixed&&this.testFixable(),this.checkIfVisible()},testFixable:function(){this.testFixed=!0,5!=this.testFixableDom.offsetTop&&this.setAbsolute(),document.body.removeChild(this.testFixableDom),this.testFixableDom=null},checkIfVisible:function(){window.pageYOffset>document.documentElement.clientHeight?this.show():this.hidden()},onTouchMove:function(){this.hidden()},clearTimer:function(){this.scrollTimer&&(window.clearTimeout(this.scrollTimer),this.scrollTimer=null)},startFixed:function(){if(this.active){var e="right"==this.direction?"left":"right";t.dom.setStyles(this.el,{top:window.pageYOffset+window.innerHeight-parseInt(this.getHeight())-this.bottom+"px"}),this.el.style[e]=document.body.offsetWidth-parseInt(this.getWidth())-this.offsetV+"px"}},render:function(){var t=document.body,e=document.createDocumentFragment();this.container=t,e.appendChild(this.el),e.appendChild(this.testFixableDom),this.appendChild(e,this.container),this.isShow&&(this.isShow=!1,this.show()),this.active||this.activate()},CLASS_NAME:"octopus.Widget.Back2Top"}),t.Widget.back2top=function(e){return new t.Widget.HtmlBack2Top({el:e})},t.Widget.HtmlBack2Top=t.define(t.Widget.Back2Top,{initialize:function(){t.Widget.prototype.initialize.apply(this,arguments),this.loop={},this.direction=t.dom.data(this.el,"octopusui-back2top-direction")||this.direction,this.isFast=t.dom.data(this.el,"octopusui-back2top-fast"),this.animation=t.dom.data(this.el,"octopusui-back2top-animate"),this.bottom=t.dom.data(this.el,"octopusui-back2top-bottom")||this.bottom,this.offsetV=t.dom.data(this.el,"octopusui-back2top-offset")||this.offsetV,this.customize=t.dom.data(this.el,"octopusui-back2top-customize"),this.testFixableDom=t.dom.createDom("div",null,{top:"5px",position:"fixed"}),this.isShow&&(this.isShow=!1,this.show()),this.active||this.activate(),this.checkDom(),this.initEvent()},render:function(){throw Error("this class can't render! :)")},checkDom:function(){this.el.style.display="none",this.isShow=!1,t.dom.addClass(this.el,"octopusui-back2top"),this.initFixed();var e=this.el.parentNode,i=document.body;this.container=i,e!=i&&(e.removeChild(this.el),i.appendChild(this.el)),i.appendChild(this.testFixableDom)},CLASS_NAME:"octopus.Widget.HtmlBack2Top"})}(octopus),function(t){"use strict";t.Widget.Menu=t.define(t.Widget,{data:null,animateType:"slide",direction:"left",showAnimateType:null,currentMenuUl:null,rootUl:null,openLi:null,backContent:"返回上一级",DIRECTION:null,initialize:function(){if(t.Widget.prototype.initialize.apply(this,arguments),!this.data)throw Error("require the property of data!");var e=this.buildMenu(this.data);this.DIRECTION={left:"right",right:"left",up:"down",down:"up"},t.dom.setStyles(this.el,{position:"absolute",width:"100%","-webkit-backface-visibility":"hidden"},!0),t.dom.addClass(this.el,"octopusui-menu"),this.el.appendChild(e),this.gesture(e).on("tap",t.util.bindAsEventListener(this.onTap,this))},buildMenu:function(e,i){i=i||!1;var n=document.createElement("ul"),s=document.createDocumentFragment(),o=e.length,r=0;if(i){var a=t.dom.createDom("li",{"class":"octopusui-menu-returnparent"}),l=document.createElement("a");l.innerHTML=this.backContent,a.appendChild(l),s.appendChild(a),t.dom.addClass(n,"octopusui-menu-childmenu")}else t.dom.addClass(n,"octopusui-menu-ul"),this.rootUl=n;for(;o>r;r++){var u=e[r],h=t.dom.createDom("li",{id:u.id||u.name}),c=document.createElement("a");if(u.children&&u.children.length>0){t.dom.addClass(h,"octopusui-menu-haschild");var d=this.buildMenu(u.children,!0)}u.href&&t.dom.data(h,{href:u.href}),c.innerHTML=t.util.encodeHtml(u.name),h.appendChild(c),d&&h.appendChild(d),s.appendChild(h)}return n.appendChild(s),n},onTap:function(e){t.event.stop(e,!0);var i=e.target,n=i.tagName.toUpperCase();"A"==n&&(i=i.parentNode),t.dom.hasClass(i,"octopusui-menu-disable")||(this.notify("menu-item-ontap",i),t.dom.hasClass(i,"octopusui-menu-haschild")&&this.expendMenu(i),t.dom.hasClass(i,"octopusui-menu-returnparent")&&this.returnParent(i))},returnParent:function(){if(t.dom.removeClass(this.openLi,"octopusui-menu-openmenu"),this.currentMenuUl==this.rootUl)t.dom.removeClass(this.rootUl,"octopusui-menu-childview");else{var e=this.currentMenuUl.parentNode;t.dom.removeClass(e,"octopusui-menu-childview"),t.dom.addClass(e,"octopusui-menu-openmenu"),this.openLi=e,this.currentMenuUl=this.openLi.parentNode}var i=this.DIRECTION[this.direction]||"left";this.animateType&&this[this.animateType](this.openLi,i)},changedExpendItem:function(e,i){var n="octopusui-menu-childview";this.currentMenuUl=e,i==this.rootUl?t.dom.removeClass(this.rootUl,n):t.dom.addClass(this.rootUl,n)},expendMenu:function(e){var i=e.children[1],n=e.parentNode,s="octopusui-menu-openmenu";this.openLi&&(t.dom.removeClass(this.openLi,s),t.dom.addClass(this.openLi,"octopusui-menu-childview")),this.openLi=e,t.dom.addClass(this.openLi,"octopusui-menu-openmenu"),this.changedExpendItem(n,i),this.animateType&&this[this.animateType](i,this.direction)},animate:function(e,i,n,s,o){var o=o||t.util.empty;t.animate({el:this.el,type:i,func:o,config:{direction:n,out:!s,isFade:!0,duration:.3}})},show:function(){t.Widget.prototype.show.apply(this,arguments),this.showAnimateType&&this[this.showAnimateType](this.el,!0)},hidden:function(){var e=t.Widget.prototype.hidden;if(this.showAnimateType){var i=this;this[this.showAnimateType](this.el,!1,function(){e.apply(i,arguments),i.resetMenu()})}else e.apply(this,arguments),this.resetMenu()},slide:function(t,e,i){this.animate(t,"slide",e,!0,i)},fold:function(t,e,i){this.animate(t,"fold",e,!0,i)},fade:function(t,e,i){this.animate(t,"fade",null,e,i)},flip:function(t,e,i){this.animate(t,"flip",e,!0,i)},pop:function(t,e,i){this.animate(t,"pop",null,e,i)},rotate:function(t,e,i){this.animate(t,"rotate",null,e,i)},resetMenu:function(){this.rootUl&&t.dom.removeClass(this.rootUl,"octopusui-menu-childview"),this.openLi&&t.dom.removeClass(this.openLi,"octopusui-menu-openmenu"),this.openLi=null,this.currentMenuUl=null},CLASS_NAME:"octopus.Widget.Menu"})}(octopus),function(t){"use strict";t.Widget.PicReader=t.define(t.Widget.Mask,{imgEl:null,sliderEl:null,imgCEl:null,isResize:!1,maxW:null,maxH:null,imgs:null,datas:null,slider:null,hasButton:!1,hasGizmos:!1,hasTitle:!1,initialize:function(){t.Widget.Mask.prototype.initialize.apply(this,arguments),this.imgs=this.imgs||[],this.datas=this.datas||[],this.imgEl&&this.initImgEvent(),this.animation="fade";var e=this;t.event.on(window,"ortchange",function(){e.isResize||(t.util.requestAnimation(t.util.bind(e.checkSize,e)),e.isResize=!0)},!1),this.buildSlider()},checkSize:function(){this.maxW=t.dom.getScreenWidth(),this.maxH=t.dom.getScreenHeight()-60,this.slider.el.style.height=this.maxH+"px",this.calcRect(t.one("img",this.imgCEl)),this.isResize=!1},buildSlider:function(){this.sliderEl=t.dom.createDom("div",{"class":"octopusui-reader-slidercontainer"}),this.imgCEl=t.dom.createDom("div",{"class":"octopusui-reader-imgcontainer"});var e=document.createDocumentFragment(),i=t.dom.createDom("img",{"class":"octopusui-reader-img"}),n=t.dom.createDom("div",{"class":"octopusui-reader-close"});this.imgCEl.appendChild(i),e.appendChild(this.imgCEl),e.appendChild(n),this.sliderEl.appendChild(e),this.el.appendChild(this.sliderEl)},initImgEvent:function(){var e=t.$("img",this.imgEl);e&&(t.util.each(this.imgs,t.util.bind(this.addImgEvent,this)),t.util.each(e,t.util.bind(this.addImgEvent,this)),this.slider=new t.Widget.Slider({data:this.datas,hasButton:this.hasButton,autoPlay:!1,loop:!1,hasGizmos:this.hasGizmos,hasTitle:this.hasTitle,loadImageNumber:1,isDisableA:!0,disScroll:!0,id:"octopusui-reader-slider"}))},addImgEvent:function(e,i){if(t.util.isNode(e)&&e.src){this.imgs.push(e);var n=this,s=e.src;t.util.loadImage(s,function(){t.dom.data(e,{"octopusui-reader-width":this.width,"octopusui-reader-height":this.height,"octopusui-reader-index":i})},function(){n.gesture(e).on("tap",t.util.bind(n.itemOnTap,n))},t.util.empty);var o={title:t.dom.data(e,"octopusui-reader-title")||"",url:t.dom.data(e,"octopusui-reader-url")||"",image_url:t.dom.data(e,"octopusui-reader-src")||s};this.datas.push(o)}},itemOnTap:function(e){t.event.stop(e);var i=e.target;this.active?this.show(i):this.render(this.container||document.body,!1,i)},render:function(e,i,n){this.slider.container=this.sliderEl,this.slider.el.style.visibility="hidden",this.slider.isShow=!1,this.sliderEl.appendChild(this.slider.el),t.Widget.prototype.render.apply(this,arguments),this.maxW=this.maxW||t.dom.getScreenWidth(),this.maxH=this.maxH||t.dom.getScreenHeight()-60,this.slider.activate(),this.slider.el.style.cssText="height: "+this.maxH+"px; width: 100%; overflow: hidden; "+"display: none; left: 0; top: 0; bottom: 0; right: 0; margin: auto; position: absolute;",this.domEmerged(n)},show:function(e){t.Widget.Mask.prototype.show.apply(this,arguments),e&&this.domEmerged(e)},_hidden:function(){t.Widget.Mask.prototype._hidden.apply(this,arguments),this.imgCEl.style.display="block",this.slider.hidden()},domEmerged:function(e){var i=e.cloneNode(),n=t.dom.cloneNode(this.imgCEl,!0,!0);n.appendChild(i),this.sliderEl.replaceChild(n,this.imgCEl),this.imgCEl=n,this.calcRect(e)},loadLargeImg:function(e){var i=t.dom.data(e,"octopusui-reader-src"),n=this;!i||t.dom.data(e,"octopusui-reader-loaded")?this.changedVisible():(t.dom.hasClass(this.imgCEl,"octopusui-reader-loading")||t.dom.addClass(this.imgCEl,"octopusui-reader-loading"),t.util.loadImage(t.dom.data(e,"octopusui-reader-src"),t.util.empty,function(){n.changedVisible(e)},function(){n.changedVisible(e)}))},changedVisible:function(){t.dom.hasClass(this.imgCEl,"octopusui-reader-loading")&&t.dom.removeClass(this.imgCEl,"octopusui-reader-loading"),arguments[0]&&t.dom.data(arguments[0],{"octopusui-reader-loaded":"true"}),this.slider.show(),this.imgCEl.style.display="none"},calcRect:function(){var e,i,n,s,o=arguments[0],r=o.getBoundingClientRect(),a=r.width,l=r.height,u=t.dom.data(o,"octopusui-reader-width")||a,h=t.dom.data(o,"octopusui-reader-height")||l,c=r.top,d=r.left,p=this.maxW,g=this.maxH;
p>=u&&g>=h?(n=(g-h)/2+30,s=(p-u)/2,e=u,i=h):u>h?(e=p,s=0,i=h*e/u,n=(g-i)/2+30):(i=g,n=30,e=u*i/h,s=(p-e)/2),this.slider.select(t.dom.data(o,"octopusui-reader-index")-0),this.sliderAnimate(["left","top","width","height"],[d,c,a,l],[s,n,e,i],o)},sliderAnimate:function(e,i,n,s){var o=this;return new t.Tween(this.imgCEl,e,i,n,.4,function(){o.loadLargeImg(s)},{ease:"ease-out",delay:.4})},CLASS_NAME:"octopus.Widget.PicReader"})}(octopus),function(t,e){"use strict";t.Widget.Sidebar=t.define(t.Widget,{type:"cover",nextDom:null,position:"left",width:"100%",height:"100%",styles:null,innerHTML:null,isResize:!1,locked:!1,initialize:function(){t.Widget.prototype.initialize.apply(this,arguments),this.innerHTML&&(this.el.innerHTML=this.innerHTML),this.styles={cssText:{left:"left: 0px; top: 0px;",right:"right: 0px; top: 0px;",top:"left: 0px; top: 0px;",bottom:"left: 0px; bottom: 0px;"},transform:{left:"translate3d(-100%, 0, 0)",right:"translate3d(100%, 0, 0)",top:"translate3d(0, -100%, 0)",bottom:"translate3d(0, 100%, 0)"}},t.util.isNumeric(this.width)&&(this.width+="px"),t.util.isNumeric(this.height)&&(this.height+="px"),this.el.style.cssText=this.styles.cssText[this.position]+" width: "+this.width+"; height: "+this.height+"; -webkit-transform-style: preserve-3d; transform-style: preserve-3d;",t.dom.addClass(this.el,"octopusui-sidebar");var e=this;t.event.on(window,"ortchange",function(){e.isResize||(t.util.requestAnimation(t.util.bind(e.checkSize,e)),e.isResize=!0)},!1)},checkSize:function(){this.calcSelfSize(),this.isResize=!1},show:function(t){this.isShow||(this.type!=t&&(this.type=t,this.serialCSS()),this.el.style.display="block",this.calcSelfSize(),this["animate"+this.type.charAt(0).toUpperCase()+this.type.substring(1)](!0))},hidden:function(){this.isShow&&this["animate"+this.type.charAt(0).toUpperCase()+this.type.substring(1)](!1)},animate:function(e,i,n,s){var o=this,r=this.container.parentNode||this.container;return r.style.overflow="hidden",this.locked=!0,new t.Tween(s,["-webkit-transform"],[e],[i],.3,function(){if(o.isShow=n,!n||"right"!=o.position&&"bottom"!=o.position)n||(o.el.style.display="none");else{var e=t.dom.createDom("div");o.container.appendChild(e);var i=o;setTimeout(function(){i.container.removeChild(e),e=null},0)}r.style.overflow="",o.locked=!1})},animateRotate:function(t){var e={left:"translate3d(-100%, 0, 0) rotateY(-90deg)",right:"translate3d(100%, 0, 0) rotateY(90deg)",top:"translate3d(0, -100%, 0) rotateX(120deg)",bottom:"translate3d(0, 100%, 0) rotateX(-120deg)"},i="translate3d(0, 0, 0) rotateY(0deg) rotateX(0deg)",n=t?e[this.position]:i;t||(i=e[this.position]);var s={left:"100% 50%",right:"0% 50%",top:"50% 100%",bottom:"50% 0%"};this.el.style.webkitTransformOrigin=s[this.position],this.animateReveal(t),this.animate(n,i,t,this.el)},animateCover:function(t){var e={left:"translate3d(-100%, 0, 0)",right:"translate3d(100%, 0, 0)",top:"translate3d(0, -100%, 0)",bottom:"translate3d(0, 100%, 0)"},i="translate3d(0, 0, 0)",n=t?e[this.position]:i;t||(i=e[this.position]),this.animate(n,i,t,this.el)},animatePush:function(t){var e={left:"translate3d("+this.width+", 0, 0)",right:"translate3d(-"+this.width+", 0, 0)",top:"translate3d(0, "+this.height+", 0)",bottom:"translate3d(0, -"+this.height+", 0)"},i="translate3d(0, 0, 0)",n=t?e[this.position]:i;t||(i=e[this.position]),this.animate(i,n,t,this.container)},animateReveal:function(e){if(this.nextDom=t.g(this.nextDom),!this.nextDom)throw Error("require nextDom to reveal!");var i={left:"translate3d("+this.width+", 0, 0)",right:"translate3d(-"+this.width+", 0, 0)",top:"translate3d(0, "+this.height+", 0)",bottom:"translate3d(0, -"+this.height+", 0)"},n="translate3d(0, 0, 0)",s=e?i[this.position]:n;e||(n=i[this.position]),this.animate(n,s,e,this.nextDom)},serialCSS:function(){"cover"==this.type||"push"==this.type?(this.el.style.webkitTransform=this.styles.transform[this.position],this.el.style.zIndex=9999):(this.el.style.webkitTransform="",this.el.style.zIndex=-1)},activate:function(e){t.Widget.prototype.activate.apply(this,arguments);var i=t.dom.getStyle(this.container,"position");"static"==i&&(this.container.style.position="relative"),this.type=e||this.type,this.serialCSS()},render:function(){var i=arguments.length;if(this.container=0==i?this.container||document.body:t.g(arguments[0]),t.dom.addClass(this.container,"octopusui-sidebar-container"),this.container.appendChild===e)throw Error("Illegal Dom!");if(arguments[1]){var n=t.dom.cloneNode(this.container,!0);this.appendChild(this.el,n),this.container.parentNode.replaceChild(n,this.container),this.container=n}else this.appendChild(this.el,this.container);this.active||this.activate(arguments[2]),this.isShow||this.show(arguments[2])},calcSelfSize:function(){var e=this.position,i="left"==e||"right"==e?"width":"height";this[i]=t.dom["get"+i.charAt(0).toLocaleUpperCase()+i.substring(1)](this.el)+"px"},CLASS_NAME:"octopus.Widget.Sidebar"})}(octopus),function(t){"use strict";t.Widget.Progress=t.define(t.Widget,{value:100,speed:.49,minV:.60009,duration:2,timer:null,tricker:100,isStop:!0,trickeTimer:null,initialize:function(){t.Widget.prototype.initialize.apply(this,arguments),t.dom.addClass(this.el,"octopusui-progress")},activate:function(){t.Widget.prototype.activate.apply(this,arguments),"static"==t.dom.getStyle(this.container,"position")&&(this.container.style.position="relative")},goTo:function(t){this.isStop||this.stop(),this._goTo(t)},_goTo:function(t){var e=Math.max(Math.min(100-Math.abs(t.value),100),0),i=t.duration||this.duration,n=t.type||"auto",s="translate3d(-"+(e+"")+"%, 0, 0)",o=t.func;if("auto"==n)this.setStyle(s),o&&o();else{var n=" "+i+"s linear",r=this;this.el.style.webkitTransition="-webkit-transform"+n,this.el.style.transition="transform"+n,window.setTimeout(function(){r.setStyle(s),r.timer&&(window.clearTimeout(r.timer),r.timer=null);var t=r;r.timer=window.setTimeout(function(){t.el.style.webkitTransition="",t.el.style.transition="",o&&o()},1e3*i+150)},100)}this.setV(e)},setStyle:function(e){t.dom.setStyles(this.el,{"-webkit-transform":e,transform:e})},stop:function(){this.trickeTimer&&(window.clearTimeout(this.trickeTimer),this.trickeTimer=null)},setV:function(t){this.value!=t&&(this.value=t)},passTrick:function(){if(this.isStop=!1,!arguments[0]){this.tricker=100*this.speed,this.value=100,this.el.style.webkitTransition="",this.el.style.transition="",this.setStyle("translate3d(-100%, 0, 0)");var e=this;window.setTimeout(function(){e._goTo({value:e.tricker,type:"animation"})},0)}this.stop(),this.trickeTimer=window.setTimeout(t.util.bind(this.executeTricker,this),1e3*this.duration+100)},executeTricker:function(){return this.tricker=this.tricker*this.speed,this.tricker<this.minV?(this.isStop=!0,this.stop(),undefined):(this._goTo({value:100-this.value+this.tricker,type:"animation"}),this.passTrick(!0),undefined)},CLASS_NAME:"octopus.Widget.Progress"})}(octopus),function(t,e){"use strict";t.app=function(){function i(t,i,s){n(e).registerModule(t,i,s)}function n(e){return s?e?(console.warn("The app has already exist! Failure to set up the config"),s):s:s=new t.App(e)}var s=null;return{registerModule:i,initialize:n}}(),t.App=t.define({id:null,el:null,viewEl:null,layers:null,currentLayer:null,cmds:null,moduleCreator:null,events:null,eventListeners:null,cmdManager:null,eventCaches:null,isLoad:!1,config:null,isResize:!1,widgets:null,isInitDom:!1,initialize:function(e){var i=this.config=t.extend({},e);this.moduleCreator={},this.eventCaches=[],this.id=i.id||t.util.createUniqueID(this.CLASS_NAME+"_"),t.event.on(window,"ready",t.util.bind(this.onWindowLoad,this),!1),t.event.on(window,"resize",t.util.bind(this.onWindowResize,this),!1),"orientationchange"in window&&t.event.on(window,"orientationchange",t.util.bind(this.onOrientationChanged,this),!1),this.events=new t.Events(this),i.eventListeners&&t.util.isObject(i.eventListeners)&&(this.eventListeners=i.eventListeners,this.events.register(this.eventListeners)),this.cmdManager=new t.CmdManager({app:this}),i.cmds&&(this.cmds=i.cmds,t.util.each(this.cmds,t.util.bind(this.registerCmd,this)),this.cmds.length=0)},registerCmd:function(t){this.cmdManager.register(t)},executeCmd:function(t,e){this.cmdManager.executeCommand(t,e)},unregisterCmd:function(t){this.cmdManager.unregister(t)},registerModule:function(t,e,i){return this.register2ModuleCreator(t,e),this.isLoad||i?(this.startModule(t),!0):!1},register2ModuleCreator:function(t,e){return this.moduleCreator[t]={creator:e,instance:null}},startModule:function(t){var e=this.moduleCreator[t];e.instance||(e.instance=e.creator(this),e.instance?e.instance.initialize||console.error("Module "+t+" didn't work for its invalid returns! It should has the method 'initialize'!"):console.error("Module "+t+" didn't work for its invalid returns! It should be an object!"),e.instance.initialize&&e.instance.initialize())},getModule:function(t){return this.moduleCreator[t].instance},on:function(t,e){this.events.on(t,e)},un:function(t,e){this.events.un(t,e)},notify:function(t,i){return this.isLoad?(this.events.triggerEvent(t,i),e):(this.eventCaches.push([t,i]),e)},onWindowLoad:function(){var e=this;if(t.util.each(this.moduleCreator,function(t,i){e.startModule(i)}),this.isLoad=!0,this.eventCaches)for(var i;i=this.eventCaches.shift();)this.notify(i[0],i[1]);this.notify("Global-OctopusApp-ModuleCompleted",{})},render:function(e){this.isLoad||console.error("The page hasn't loaded!"),e=t.g(e),e||console.error("Invalid node to render!"),this.initDomMode(e)},initDomMode:function(e){this.isInitDom=!0;var i=this.config,n=e,s=this.id+"_Octopus_ViewPort";this.el=t.dom.cloneNode(n,!0),this.viewEl=t.dom.createDom("div",{id:s,"class":"octopus-viewport",style:"width: 100%; height: 100%; position: relative; z-index: 300; overflow: hidden"}),this.el.appendChild(this.viewEl),i.layers&&t.util.each(i.layers,t.util.bind(this.addLayer,this)),i.widgets&&t.util.each(i.widgets,t.util.bind(this.addWidget,this)),this.notify("Global-OctopusApp-BeforeAppCompleted"),n&&(n.parentNode.replaceChild(this.el,n),this.notify("Global-OctopusApp-AppCompleted"))},onOrientationChanged:function(){this.notify("Global-OctopusApp-OnOrientationChanged")},onWindowResize:function(){this.isResize||(t.util.requestAnimation(t.util.bind(this.checkSize,this)),this.isResize=!0)},checkSize:function(){this.isResize=!1,this.notify("Global-OctopusApp-OnWindowResize")},addLayer:function(e){if(this.layers||(this.layers=[]),-1==this.layers.indexOf(e)){var i=e.getEl();t.dom.addClass(i,"octopus-app-layer"),this.setLayerZIndex(e,this.layers.length),e.isBaseLayer?this.el.appendChild(i):this.viewEl.appendChild(i),e.isCurrent&&this.setCurrentLayer(e),this.layers.push(e),e.setApp(this),this.notify("Global-OctopusApp-LayerAdd",{layer:e}),e.afterAdd()}},setCurrentLayer:function(t){this.currentLayer&&this.currentLayer.setCurrent(!1),this.currentLayer=t,this.topLayer(t),t.setCurrent(!0),this.notify("Global-OctopusApp-CurrentLayerChanged",{layer:t})},setLayerZIndex:function(t,e){t.setZIndex(this.Z_INDEX_BASE[t.isBaseLayer?"BaseLayer":"Layer"]+5*e)},resetLayersZIndex:function(){var e=this;t.util.each(this.layers,function(t,i){e.setLayerZIndex(t,i)})},getTopZIndex:function(){var e={zindex:0,index:0};return t.util.each(this.layers,function(t,i){var n=t.getEl().style.zIndex||0;n>e.zindex&&(e={zindex:n,index:i})}),e},topLayer:function(t){var e=this.getTopZIndex(),i=t.el.style.zIndex;e!=i&&(t.el.style.zIndex=e.zindex,this.layers[e.index].el.style.zIndex=i)},getLayer:function(i){var n=null;return t.util.each(this.layers,function(t){return i==t.id?(n=t,!0):e}),n},removeLayer:function(e){e.getEl().parentNode.removeChild(e.getEl()),t.util.removeItem(this.layers,e),e.removeApp(this),e.app=null,this.resetLayersZIndex(),this.notify("Global-OctopusApp-LayerRemove",{layer:e})},addWidget:function(t,i){this.widgets||(this.widgets=[]);var n=this.widgets.indexOf(t);return n>-1?!1:(this.widgets.push(t),i||(t.container=t.outsideViewport?this.el:this.viewEl,t.render()),t.setZIndex(this.Z_INDEX_BASE.Widget+5*this.widgets.length),e)},getWidget:function(i){var n=null;return this.widgets.length,t.util.each(this.widgets,function(t){return t.id==i?(n=t,!0):e}),n},removeWidget:function(e){e&&e==this.getWidget(e.id)&&(e.el.parentNode.removeChild(e.el),t.util.removeItem(this.widgets,e))},Z_INDEX_BASE:{BaseLayer:0,Layer:350,Widget:750,Mask:1e3,Popup:1500},CLASS_NAME:"octopus.App"})}(octopus),function(t){"use strict";t.Layer=t.define({id:null,config:null,isCurrent:!1,event:null,el:null,isBaseLayer:!1,widgets:null,app:null,initialize:function(e){var i=this.config=t.extend({},e);this.id=i.id||t.util.createUniqueID(this.CLASS_NAME+"_"),this.el=t.dom.createDom("div",{id:this.id}),this.isCurrent=i.isCurrent||this.isCurrent,this.isBaseLayer=i.isBaseLayer||this.isBaseLayer,(this.isCurrent||this.isBaseLayer)&&t.dom.addClass(this.el,"octopus-layer-base"),this.event=new t.Events(this)},getEl:function(){return this.el},on:function(t,e){this.events.on(t,e)},un:function(t,e){this.events.un(t,e)},setApp:function(t){return t==this.app?!1:(this.app=t,!0)},afterAdd:function(){},setCurrent:function(e){e&&this.isCurrent||!e&&!this.isCurrent||(this.isCurrent=e,e?t.dom.addClass(this.el,"octopus-layer-show"):t.dom.removeClass(this.el,"octopus-layer-show"))},setZIndex:function(t){this.el.style.zIndex=t},activate:function(){},deactivate:function(){},removeApp:function(){},CLASS_NAME:"octopus.Layer"})}(octopus),function(t){"use strict";t.Cmd=t.define({name:null,active:!1,app:null,initialize:function(e,i){this.name=this.name||this.CLASS_NAME,t.extend(this,i)},activate:function(){this.active||(this.active=!0)},deactivate:function(){this.active&&(this.active=!1)},execute:function(){return this.active?undefined:!1},unexecute:function(){return this.active?undefined:!1},setApp:function(t){this.app!=t&&(this.app=t)},CLASS_NAME:"octopus.Cmd"})}(octopus),function(t){"use strict";t.CmdManager=t.define({app:null,commands:null,executeCmds:null,name:null,initialize:function(e){t.extend(this,e),this.app?(this.setApp(this.app),!0):!1,this.name=this.name||t.util.createUniqueID(this.CLASS_NAME+"_"),this.commands=this.commands||[],this.executeCmds=this.executeCmds||[]},setApp:function(t){this.app==t?!1:(this.app=t,!0)},register:function(t){var e=this.commands.indexOf(t);return-1!=e?!1:(this.commands.push(t),t.setApp(this.app),!0)},unregister:function(t){var e=this.getCommandIndexByName(t);return-1==e?!1:(this.commands.splice(e,1),!0)},getCommandIndexByName:function(t){for(var e=this.commands.length,i=e;i--;)if(t==this.commands[i].name)return i;return-1},executeCommand:function(t,e){var i=this.getCommandIndexByName(t);-1!=i&&this.commands[i].execute(e)},destroy:function(){this.app=null},CLASS_NAME:"octopus.CmdManager"})}(octopus),function(t){"use strict";t.Cmd.GetDataCmd=t.define(t.Cmd,{url:"",initialize:function(){t.Cmd.prototype.initialize.apply(this,arguments)},getData:function(e){var e=e[0],i=e.type||"get";this.url=e.url&&e.url!=this.url?e.url:this.url,t.ajax[i]({url:this.url,timeout:e.timeout||0,data:e.data||{},complete:e.complete,error:e.error,success:e.success})},execute:function(){t.Cmd.prototype.execute.apply(this,arguments),arguments[0]||""!=this.url||console.error("Cmd "+this.CLASS_NAME+" need the options to execute!"),this.getData(arguments)},CLASS_NAME:"octopus.Cmd.GetDataCmd"})}(octopus);