text: function get_line_with_2points(t,e){var n={};return t.x-e.x==0?null:(n.k=(e.y-t.y)/(e.x-t.x),n.b=t.y-n.k*t.x,n)}function get_line_with_point_and_gradient(t,e){var n={};n.k=e,n.b=t.y-n.k*t.x}function get_distance_between_2points(t,e){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function get_intersect_between_line_and_circle(t,e){var n,i,r,a,o=[],s=t.k,c=t.b,u=e.a,l=e.c,d=e.r,h=1+s*s,f=2*(c*s-l*s-u),p=u*u+c*c+l*l-2*c*l-d*d,g=f*f-4*h*p,m=Math.sqrt;if(Math.pow,g>0)n=(-f-m(g))/(2*h),i=s*n+c,r=(-f+m(g))/(2*h),a=s*r+c,o.push({x:n,y:i}),o.push({x:r,y:a});
  else{if(0!=g)return null;n=-f/(2*h),i=s*n+c,o.push({x:n,y:i})}return o}function get_data_range(t){for(var e,n,i={},r=0;r<t.length;r++)0==r?e=n=t[r]:(t[r]<e&&(e=t[r]),t[r]>n&&(n=t[r]));if(!t.length)throw new Error("get_data_range: data can not be empty");return i.min=e,i.span=n-e,0==i.span&&(i.min-=50,i.max+=50,i.span=100),i}!function(t){String.prototype.trim===t&&(String.prototype.trim=function(){return this.replace(/^\s+/,"").replace(/\s+$/,"")}),Array.prototype.reduce===t&&(Array.prototype.reduce=function(e){if(void 0===this||null===this)throw new TypeError;
  var n,i=Object(this),r=i.length>>>0,a=0;if("function"!=typeof e)throw new TypeError;if(0==r&&1==arguments.length)throw new TypeError;if(arguments.length>=2)n=arguments[1];else for(;;){if(a in i){n=i[a++];break}if(++a>=r)throw new TypeError}for(;r>a;)a in i&&(n=e.call(t,n,i[a],a,i)),a++;return n})}();var Zepto=function(){function t(t){return"[object Function]"==H.call(t)}function e(t){return t instanceof Object}function n(e){var n,i;if("[object Object]"!==H.call(e))return!1;if(i=t(e.constructor)&&e.constructor.prototype,!i||!hasOwnProperty.call(i,"isPrototypeOf"))return!1;
  for(n in e);return n===g||hasOwnProperty.call(e,n)}function i(t){return t instanceof Array}function r(t){return"number"==typeof t.length}function a(t){return t.filter(function(t){return t!==g&&null!==t})}function o(t){return t.length>0?[].concat.apply([],t):t}function s(t){return t.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function c(t){return t in k?k[t]:k[t]=new RegExp("(^|\\s)"+t+"(\\s|$)")}function u(t,e){return"number"!=typeof e||C[s(t)]?e:e+"px"
  }function l(t){var e,n;return S[t]||(e=T.createElement(t),T.body.appendChild(e),n=E(e,"").getPropertyValue("display"),e.parentNode.removeChild(e),"none"==n&&(n="block"),S[t]=n),S[t]}function d(t,e){return e===g?v(t):v(t).filter(e)}function h(e,n,i,r){return t(n)?n.call(e,i,r):n}function f(t,e,n){var i=t%2?e:e.parentNode;i?i.insertBefore(n,t?1==t?i.firstChild:2==t?e:null:e.nextSibling):v(n).remove()}function p(t,e){e(t);for(var n in t.childNodes)p(t.childNodes[n],e)}var g,m,v,w,b,y,_=[],x=_.slice,T=window.document,S={},k={},E=T.defaultView.getComputedStyle,C={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},A=/^\s*<(\w+|!)[^>]*>/,L=[1,3,8,9,11],I=["after","prepend","before","append"],O=T.createElement("table"),P=T.createElement("tr"),R={tr:T.createElement("tbody"),tbody:O,thead:O,tfoot:O,td:P,th:P,"*":T.createElement("div")},M=/complete|loaded|interactive/,N=/^\.([\w-]+)$/,D=/^#([\w-]+)$/,W=/^[\w-]+$/,H={}.toString,X={},j=T.createElement("div");
  return X.matches=function(t,e){if(!t||1!==t.nodeType)return!1;var n=t.webkitMatchesSelector||t.mozMatchesSelector||t.oMatchesSelector||t.matchesSelector;if(n)return n.call(t,e);var i,r=t.parentNode,a=!r;return a&&(r=j).appendChild(t),i=~X.qsa(r,e).indexOf(t),a&&j.removeChild(t),i},b=function(t){return t.replace(/-+(.)?/g,function(t,e){return e?e.toUpperCase():""})},y=function(t){return t.filter(function(e,n){return t.indexOf(e)==n})},X.fragment=function(t,e){e===g&&(e=A.test(t)&&RegExp.$1),e in R||(e="*");
  var n=R[e];return n.innerHTML=""+t,v.each(x.call(n.childNodes),function(){n.removeChild(this)})},X.Z=function(t,e){return t=t||[],t.__proto__=arguments.callee.prototype,t.selector=e||"",t},X.isZ=function(t){return t instanceof X.Z},X.init=function(e,r){if(e){if(t(e))return v(T).ready(e);if(X.isZ(e))return e;var o;if(i(e))o=a(e);else if(n(e))o=[v.extend({},e)],e=null;else if(L.indexOf(e.nodeType)>=0||e===window)o=[e],e=null;else if(A.test(e))o=X.fragment(e.trim(),RegExp.$1),e=null;else{if(r!==g)return v(r).find(e);
  o=X.qsa(T,e)}return X.Z(o,e)}return X.Z()},v=function(t,e){return X.init(t,e)},v.extend=function(t){return x.call(arguments,1).forEach(function(e){for(m in e)e[m]!==g&&(t[m]=e[m])}),t},X.qsa=function(t,e){var n;return t===T&&D.test(e)?(n=t.getElementById(RegExp.$1))?[n]:_:1!==t.nodeType&&9!==t.nodeType?_:x.call(N.test(e)?t.getElementsByClassName(RegExp.$1):W.test(e)?t.getElementsByTagName(e):t.querySelectorAll(e))},v.isFunction=t,v.isObject=e,v.isArray=i,v.isPlainObject=n,v.inArray=function(t,e,n){return _.indexOf.call(e,t,n)
  },v.trim=function(t){return t.trim()},v.uuid=0,v.map=function(t,e){var n,i,a,s=[];if(r(t))for(i=0;i<t.length;i++)n=e(t[i],i),null!=n&&s.push(n);else for(a in t)n=e(t[a],a),null!=n&&s.push(n);return o(s)},v.each=function(t,e){var n,i;if(r(t)){for(n=0;n<t.length;n++)if(e.call(t[n],n,t[n])===!1)return t}else for(i in t)if(e.call(t[i],i,t[i])===!1)return t;return t},v.fn={forEach:_.forEach,reduce:_.reduce,push:_.push,indexOf:_.indexOf,concat:_.concat,map:function(t){return v.map(this,function(e,n){return t.call(e,n,e)
  })},slice:function(){return v(x.apply(this,arguments))},ready:function(t){return M.test(T.readyState)?t(v):T.addEventListener("DOMContentLoaded",function(){t(v)},!1),this},get:function(t){return t===g?x.call(this):this[t]},toArray:function(){return this.get()},size:function(){return this.length},remove:function(){return this.each(function(){null!=this.parentNode&&this.parentNode.removeChild(this)})},each:function(t){return this.forEach(function(e,n){t.call(e,n,e)}),this},filter:function(t){return v([].filter.call(this,function(e){return X.matches(e,t)
  }))},add:function(t,e){return v(y(this.concat(v(t,e))))},is:function(t){return this.length>0&&X.matches(this[0],t)},not:function(e){var n=[];if(t(e)&&e.call!==g)this.each(function(t){e.call(this,t)||n.push(this)});else{var i="string"==typeof e?this.filter(e):r(e)&&t(e.item)?x.call(e):v(e);this.forEach(function(t){i.indexOf(t)<0&&n.push(t)})}return v(n)},eq:function(t){return-1===t?this.slice(t):this.slice(t,+t+1)},first:function(){var t=this[0];return t&&!e(t)?t:v(t)},last:function(){var t=this[this.length-1];
  return t&&!e(t)?t:v(t)},find:function(t){var e;return e=1==this.length?X.qsa(this[0],t):this.map(function(){return X.qsa(this,t)}),v(e)},closest:function(t,e){for(var n=this[0];n&&!X.matches(n,t);)n=n!==e&&n!==T&&n.parentNode;return v(n)},parents:function(t){for(var e=[],n=this;n.length>0;)n=v.map(n,function(t){return(t=t.parentNode)&&t!==T&&e.indexOf(t)<0?(e.push(t),t):void 0});return d(e,t)},parent:function(t){return d(y(this.pluck("parentNode")),t)},children:function(t){return d(this.map(function(){return x.call(this.children)
  }),t)},siblings:function(t){return d(this.map(function(t,e){return x.call(e.parentNode.children).filter(function(t){return t!==e})}),t)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(t){return this.map(function(){return this[t]})},show:function(){return this.each(function(){"none"==this.style.display&&(this.style.display=null),"none"==E(this,"").getPropertyValue("display")&&(this.style.display=l(this.nodeName))})},replaceWith:function(t){return this.before(t).remove()
  },wrap:function(t){return this.each(function(){v(this).wrapAll(v(t)[0].cloneNode(!1))})},wrapAll:function(t){return this[0]&&(v(this[0]).before(t=v(t)),t.append(this)),this},unwrap:function(){return this.parent().each(function(){v(this).replaceWith(v(this).children())}),this},clone:function(){return v(this.map(function(){return this.cloneNode(!0)}))},hide:function(){return this.css("display","none")},toggle:function(t){return(t===g?"none"==this.css("display"):t)?this.show():this.hide()},prev:function(){return v(this.pluck("previousElementSibling"))
  },next:function(){return v(this.pluck("nextElementSibling"))},html:function(t){return t===g?this.length>0?this[0].innerHTML:null:this.each(function(e){var n=this.innerHTML;v(this).empty().append(h(this,t,e,n))})},text:function(t){return t===g?this.length>0?this[0].textContent:null:this.each(function(){this.textContent=t})},attr:function(t,n){var i;return"string"==typeof t&&n===g?0==this.length||1!==this[0].nodeType?g:"value"==t&&"INPUT"==this[0].nodeName?this.val():!(i=this[0].getAttribute(t))&&t in this[0]?this[0][t]:i:this.each(function(i){if(1===this.nodeType)if(e(t))for(m in t)this.setAttribute(m,t[m]);
  else this.setAttribute(t,h(this,n,i,this.getAttribute(t)))})},removeAttr:function(t){return this.each(function(){1===this.nodeType&&this.removeAttribute(t)})},prop:function(t,e){return e===g?this[0]?this[0][t]:g:this.each(function(n){this[t]=h(this,e,n,this[t])})},data:function(t,e){var n=this.attr("data-"+s(t),e);return null!==n?n:g},val:function(t){return t===g?this.length>0?this[0].value:g:this.each(function(e){this.value=h(this,t,e,this.value)})},offset:function(){if(0==this.length)return null;
  var t=this[0].getBoundingClientRect();return{left:t.left+window.pageXOffset,top:t.top+window.pageYOffset,width:t.width,height:t.height}},css:function(t,e){if(e===g&&"string"==typeof t)return 0==this.length?g:this[0].style[b(t)]||E(this[0],"").getPropertyValue(t);var n="";for(m in t)"string"==typeof t[m]&&""==t[m]?this.each(function(){this.style.removeProperty(s(m))}):n+=s(m)+":"+u(m,t[m])+";";return"string"==typeof t&&(""==e?this.each(function(){this.style.removeProperty(s(t))}):n=s(t)+":"+u(t,e)),this.each(function(){this.style.cssText+=";"+n
  })},index:function(t){return t?this.indexOf(v(t)[0]):this.parent().children().indexOf(this[0])},hasClass:function(t){return this.length<1?!1:c(t).test(this[0].className)},addClass:function(t){return this.each(function(e){w=[];var n=this.className,i=h(this,t,e,n);i.split(/\s+/g).forEach(function(t){v(this).hasClass(t)||w.push(t)},this),w.length&&(this.className+=(n?" ":"")+w.join(" "))})},removeClass:function(t){return this.each(function(e){return t===g?this.className="":(w=this.className,h(this,t,e,w).split(/\s+/g).forEach(function(t){w=w.replace(c(t)," ")
  }),void(this.className=w.trim()))})},toggleClass:function(t,e){return this.each(function(n){var i=h(this,t,n,this.className);(e===g?!v(this).hasClass(i):e)?v(this).addClass(i):v(this).removeClass(i)})}},["width","height"].forEach(function(t){v.fn[t]=function(e){var n,i=t.replace(/./,function(t){return t[0].toUpperCase()});return e===g?this[0]==window?window["inner"+i]:this[0]==T?T.documentElement["offset"+i]:(n=this.offset())&&n[t]:this.each(function(n){var i=v(this);i.css(t,h(this,e,n,i[t]()))})
  }}),I.forEach(function(t,n){v.fn[t]=function(){var t=v.map(arguments,function(t){return e(t)?t:X.fragment(t)});if(t.length<1)return this;var i=this.length,r=i>1,a=2>n;return this.each(function(e,o){for(var s=0;s<t.length;s++){var c=t[a?t.length-s-1:s];p(c,function(t){null==t.nodeName||"SCRIPT"!==t.nodeName.toUpperCase()||t.type&&"text/javascript"!==t.type||window.eval.call(window,t.innerHTML)}),r&&i-1>e&&(c=c.cloneNode(!0)),f(n,o,c)}})},v.fn[n%2?t+"To":"insert"+(n?"Before":"After")]=function(e){return v(e)[t](this),this
  }}),X.Z.prototype=v.fn,X.camelize=b,X.uniq=y,v.zepto=X,v}();window.Zepto=Zepto,"$"in window||(window.$=Zepto),function(t){function e(t){return t._zid||(t._zid=d++)}function n(t,n,a,o){if(n=i(n),n.ns)var s=r(n.ns);return(l[e(t)]||[]).filter(function(t){return!(!t||n.e&&t.e!=n.e||n.ns&&!s.test(t.ns)||a&&e(t.fn)!==e(a)||o&&t.sel!=o)})}function i(t){var e=(""+t).split(".");return{e:e[0],ns:e.slice(1).sort().join(" ")}}function r(t){return new RegExp("(?:^| )"+t.replace(" "," .* ?")+"(?: |$)")}function a(e,n,i){t.isObject(e)?t.each(e,i):e.split(/\s/).forEach(function(t){i(t,n)
  })}function o(n,r,o,s,c,u){u=!!u;var d=e(n),h=l[d]||(l[d]=[]);a(r,o,function(e,r){var a=c&&c(r,e),o=a||r,l=function(t){var e=o.apply(n,[t].concat(t.data));return e===!1&&t.preventDefault(),e},d=t.extend(i(e),{fn:r,proxy:l,sel:s,del:a,i:h.length});h.push(d),n.addEventListener(d.e,l,u)})}function s(t,i,r,o){var s=e(t);a(i||"",r,function(e,i){n(t,e,i,o).forEach(function(e){delete l[s][e.i],t.removeEventListener(e.e,e.proxy,!1)})})}function c(e){var n=t.extend({originalEvent:e},e);return t.each(g,function(t,i){n[t]=function(){return this[i]=f,e[t].apply(e,arguments)
  },n[i]=p}),n}function u(t){if(!("defaultPrevented"in t)){t.defaultPrevented=!1;var e=t.preventDefault;t.preventDefault=function(){this.defaultPrevented=!0,e.call(this)}}}var l=(t.zepto.qsa,{}),d=1,h={};h.click=h.mousedown=h.mouseup=h.mousemove="MouseEvents",t.event={add:o,remove:s},t.proxy=function(n,i){if(t.isFunction(n)){var r=function(){return n.apply(i,arguments)};return r._zid=e(n),r}if("string"==typeof i)return t.proxy(n[i],n);throw new TypeError("expected function")},t.fn.bind=function(t,e){return this.each(function(){o(this,t,e)
  })},t.fn.unbind=function(t,e){return this.each(function(){s(this,t,e)})},t.fn.one=function(t,e){return this.each(function(n,i){o(this,t,e,null,function(t,e){return function(){var n=t.apply(i,arguments);return s(i,e,t),n}})})};var f=function(){return!0},p=function(){return!1},g={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"};t.fn.delegate=function(e,n,i){var r=!1;return("blur"==n||"focus"==n)&&(t.iswebkit?n="blur"==n?"focusout":"focus"==n?"focusin":n:r=!0),this.each(function(a,s){o(s,n,i,e,function(n){return function(i){var r,a=t(i.target).closest(e,s).get(0);
  return a?(r=t.extend(c(i),{currentTarget:a,liveFired:s}),n.apply(a,[r].concat([].slice.call(arguments,1)))):void 0}},r)})},t.fn.undelegate=function(t,e,n){return this.each(function(){s(this,e,n,t)})},t.fn.live=function(e,n){return t(document.body).delegate(this.selector,e,n),this},t.fn.die=function(e,n){return t(document.body).undelegate(this.selector,e,n),this},t.fn.on=function(e,n,i){return void 0==n||t.isFunction(n)?this.bind(e,n):this.delegate(n,e,i)},t.fn.off=function(e,n,i){return void 0==n||t.isFunction(n)?this.unbind(e,n):this.undelegate(n,e,i)
  },t.fn.trigger=function(e,n){return"string"==typeof e&&(e=t.Event(e)),u(e),e.data=n,this.each(function(){"dispatchEvent"in this&&this.dispatchEvent(e)})},t.fn.triggerHandler=function(e,i){var r,a;return this.each(function(o,s){r=c("string"==typeof e?t.Event(e):e),r.data=i,r.target=s,t.each(n(s,e.type||e),function(t,e){return a=e.proxy(r),r.isImmediatePropagationStopped()?!1:void 0})}),a},"focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout change select keydown keypress keyup error".split(" ").forEach(function(e){t.fn[e]=function(t){return this.bind(e,t)
  }}),["focus","blur"].forEach(function(e){t.fn[e]=function(t){if(t)this.bind(e,t);else if(this.length)try{this.get(0)[e]()}catch(n){}return this}}),t.Event=function(t,e){var n=document.createEvent(h[t]||"Events"),i=!0;if(e)for(var r in e)"bubbles"==r?i=!!e[r]:n[r]=e[r];return n.initEvent(t,i,!0,null,null,null,null,null,null,null,null,null,null,null,null),n}}(Zepto),function(t){function e(t){var e=this.os={},n=this.browser={},i=t.match(/WebKit\/([\d.]+)/),r=t.match(/(Android)\s+([\d.]+)/),a=t.match(/(iPad).*OS\s([\d_]+)/),o=!a&&t.match(/(iPhone\sOS)\s([\d_]+)/),s=t.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),c=s&&t.match(/TouchPad/),u=t.match(/Kindle\/([\d.]+)/),l=t.match(/Silk\/([\d._]+)/),d=t.match(/(BlackBerry).*Version\/([\d.]+)/);
  (n.webkit=!!i)&&(n.version=i[1]),r&&(e.android=!0,e.version=r[2]),o&&(e.ios=e.iphone=!0,e.version=o[2].replace(/_/g,".")),a&&(e.ios=e.ipad=!0,e.version=a[2].replace(/_/g,".")),s&&(e.webos=!0,e.version=s[2]),c&&(e.touchpad=!0),d&&(e.blackberry=!0,e.version=d[2]),u&&(e.kindle=!0,e.version=u[1]),l&&(n.silk=!0,n.version=l[1]),!l&&e.android&&t.match(/Kindle Fire/)&&(n.silk=!0)}e.call(t,navigator.userAgent),t.__detect=e}(Zepto),function(t,e){function n(t){return t.toLowerCase()}function i(t){return r?r+t:n(t)
  }var r,a="",o={Webkit:"webkit",Moz:"",O:"o",ms:"MS"},s=window.document,c=s.createElement("div"),u=/^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i,l={};t.each(o,function(t,i){return c.style[t+"TransitionProperty"]!==e?(a="-"+n(t)+"-",r=i,!1):void 0}),l[a+"transition-property"]=l[a+"transition-duration"]=l[a+"transition-timing-function"]=l[a+"animation-name"]=l[a+"animation-duration"]="",t.fx={off:r===e&&c.style.transitionProperty===e,cssPrefix:a,transitionEnd:i("TransitionEnd"),animationEnd:i("AnimationEnd")},t.fn.animate=function(e,n,i,r){return t.isObject(n)&&(i=n.easing,r=n.complete,n=n.duration),n&&(n/=1e3),this.anim(e,n,i,r)
  },t.fn.anim=function(n,i,r,o){var s,c,d,h={},f=this,p=t.fx.transitionEnd;if(i===e&&(i=.4),t.fx.off&&(i=0),"string"==typeof n)h[a+"animation-name"]=n,h[a+"animation-duration"]=i+"s",p=t.fx.animationEnd;else{for(c in n)u.test(c)?(s||(s=[]),s.push(c+"("+n[c]+")")):h[c]=n[c];s&&(h[a+"transform"]=s.join(" ")),t.fx.off||"object"!=typeof n||(h[a+"transition-property"]=Object.keys(n).join(", "),h[a+"transition-duration"]=i+"s",h[a+"transition-timing-function"]=r||"linear")}return d=function(e){if("undefined"!=typeof e){if(e.target!==e.currentTarget)return;
  t(e.target).unbind(p,arguments.callee)}t(this).css(l),o&&o.call(this)},i>0&&this.bind(p,d),setTimeout(function(){f.css(h),0>=i&&setTimeout(function(){f.each(function(){d.call(this)})},0)},0),this},c=null}(Zepto),function(t){function e(e,n,i){var r=t.Event(n);return t(e).trigger(r,i),!r.defaultPrevented}function n(t,n,i,r){return t.global?e(n||w,i,r):void 0}function i(e){e.global&&0===t.active++&&n(e,null,"ajaxStart")}function r(e){e.global&&!--t.active&&n(e,null,"ajaxStop")}function a(t,e){var i=e.context;
  return e.beforeSend.call(i,t,e)===!1||n(e,i,"ajaxBeforeSend",[t,e])===!1?!1:void n(e,i,"ajaxSend",[t,e])}function o(t,e,i){var r=i.context,a="success";i.success.call(r,t,a,e),n(i,r,"ajaxSuccess",[e,i,t]),c(a,e,i)}function s(t,e,i,r){var a=r.context;r.error.call(a,i,e,t),n(r,a,"ajaxError",[i,r,t]),c(e,i,r)}function c(t,e,i){var a=i.context;i.complete.call(a,e,t),n(i,a,"ajaxComplete",[e,i]),r(i)}function u(){}function l(t){return t&&(t==T?"html":t==x?"json":y.test(t)?"script":_.test(t)&&"xml")||"text"
  }function d(t,e){return(t+"&"+e).replace(/[&?]{1,2}/,"?")}function h(e){v(e.data)&&(e.data=t.param(e.data)),!e.data||e.type&&"GET"!=e.type.toUpperCase()||(e.url=d(e.url,e.data))}function f(e,n,i,r){var a=t.isArray(n);t.each(n,function(n,o){r&&(n=i?r:r+"["+(a?"":n)+"]"),!r&&a?e.add(o.name,o.value):(i?t.isArray(o):v(o))?f(e,o,i,n):e.add(n,o)})}var p,g,m=0,v=t.isObject,w=window.document,b=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,y=/^(?:text|application)\/javascript/i,_=/^(?:text|application)\/xml/i,x="application/json",T="text/html",S=/^\s*$/;
  t.active=0,t.ajaxJSONP=function(e){var n,i=e.callback||"jsonp"+ ++m,r=w.createElement("script"),a=function(){t(r).remove(),i in window&&(window[i]=u),c("abort",s,e)},s={abort:a};return e.error&&(r.onerror=function(){s.abort(),e.error()}),window[i]=function(a){clearTimeout(n),t(r).remove(),delete window[i],o(a,s,e)},h(e),r.src=e.url.replace(/=\?/,"="+i),t("head").append(r),e.timeout>0&&(n=setTimeout(function(){s.abort(),c("timeout",s,e)},e.timeout)),s},t.ajaxSettings={type:"GET",beforeSend:u,success:u,error:u,complete:u,context:null,global:!0,xhr:function(){return new window.XMLHttpRequest
  },accepts:{script:"text/javascript, application/javascript",json:x,xml:"application/xml, text/xml",html:T,text:"text/plain"},crossDomain:!1,timeout:0},t.ajax=function(e){var n=t.extend({},e||{});for(p in t.ajaxSettings)void 0===n[p]&&(n[p]=t.ajaxSettings[p]);i(n),n.crossDomain||(n.crossDomain=/^([\w-]+:)?\/\/([^\/]+)/.test(n.url)&&RegExp.$2!=window.location.host);var r=n.dataType,c=/=\?/.test(n.url);if("jsonp"==r||c)return c||(n.url=d(n.url,"callback=?")),t.ajaxJSONP(n);n.url||(n.url=window.location.toString()),h(n);
  var f,m=n.accepts[r],v={},w=/^([\w-]+:)\/\//.test(n.url)?RegExp.$1:window.location.protocol,b=t.ajaxSettings.xhr();n.crossDomain||(v["X-Requested-With"]="XMLHttpRequest"),m&&(v.Accept=m,m.indexOf(",")>-1&&(m=m.split(",",2)[0]),b.overrideMimeType&&b.overrideMimeType(m)),(n.contentType||n.data&&"GET"!=n.type.toUpperCase())&&(v["Content-Type"]=n.contentType||"application/x-www-form-urlencoded"),n.headers=t.extend(v,n.headers||{}),b.onreadystatechange=function(){if(4==b.readyState){clearTimeout(f);var t,e=!1;
  if(b.status>=200&&b.status<300||304==b.status||0==b.status&&"file:"==w){r=r||l(b.getResponseHeader("content-type")),t=b.responseText;try{"script"==r?(1,eval)(t):"xml"==r?t=b.responseXML:"json"==r&&(t=S.test(t)?null:JSON.parse(t))}catch(i){e=i}e?s(e,"parsererror",b,n):o(t,b,n)}else s(null,"error",b,n)}};var y="async"in n?n.async:!0;b.open(n.type,n.url,y);for(g in n.headers)b.setRequestHeader(g,n.headers[g]);return a(b,n)===!1?(b.abort(),!1):(n.timeout>0&&(f=setTimeout(function(){b.onreadystatechange=u,b.abort(),s(null,"timeout",b,n)
  },n.timeout)),b.send(n.data?n.data:null),b)},t.get=function(e,n){return t.ajax({url:e,success:n})},t.post=function(e,n,i,r){return t.isFunction(n)&&(r=r||i,i=n,n=null),t.ajax({type:"POST",url:e,data:n,success:i,dataType:r})},t.getJSON=function(e,n){return t.ajax({url:e,success:n,dataType:"json"})},t.fn.load=function(e,n){if(!this.length)return this;var i,r=this,a=e.split(/\s/);return a.length>1&&(e=a[0],i=a[1]),t.get(e,function(e){r.html(i?t(w.createElement("div")).html(e.replace(b,"")).find(i).html():e),n&&n.call(r)
  }),this};var k=encodeURIComponent;t.param=function(t,e){var n=[];return n.add=function(t,e){this.push(k(t)+"="+k(e))},f(n,t,e),n.join("&").replace("%20","+")}}(Zepto),function(t){t.fn.serializeArray=function(){var e,n=[];return t(Array.prototype.slice.call(this.get(0).elements)).each(function(){e=t(this);var i=e.attr("type");"fieldset"!=this.nodeName.toLowerCase()&&!this.disabled&&"submit"!=i&&"reset"!=i&&"button"!=i&&("radio"!=i&&"checkbox"!=i||this.checked)&&n.push({name:e.attr("name"),value:e.val()})
  }),n},t.fn.serialize=function(){var t=[];return this.serializeArray().forEach(function(e){t.push(encodeURIComponent(e.name)+"="+encodeURIComponent(e.value))}),t.join("&")},t.fn.submit=function(e){if(e)this.bind("submit",e);else if(this.length){var n=t.Event("submit");this.eq(0).trigger(n),n.defaultPrevented||this.get(0).submit()}return this}}(Zepto),function(t){function e(t){return"tagName"in t?t:t.parentNode}function n(t,e,n,i){var r=Math.abs(t-e),a=Math.abs(n-i);return r>=a?t-e>0?"Left":"Right":n-i>0?"Up":"Down"
  }function i(){o=null,s.last&&(s.el.trigger("longTap"),s={})}function r(){o&&clearTimeout(o),o=null}var a,o,s={},c=750;t(document).ready(function(){var u,l;t(document.body).bind("touchstart",function(n){u=Date.now(),l=u-(s.last||u),s.el=t(e(n.touches[0].target)),a&&clearTimeout(a),s.x1=n.touches[0].pageX,s.y1=n.touches[0].pageY,l>0&&250>=l&&(s.isDoubleTap=!0),s.last=u,o=setTimeout(i,c)}).bind("touchmove",function(t){r(),s.x2=t.touches[0].pageX,s.y2=t.touches[0].pageY}).bind("touchend",function(){r(),s.isDoubleTap?(s.el.trigger("doubleTap"),s={}):s.x2&&Math.abs(s.x1-s.x2)>30||s.y2&&Math.abs(s.y1-s.y2)>30?(s.el.trigger("swipe")&&s.el.trigger("swipe"+n(s.x1,s.x2,s.y1,s.y2)),s={}):"last"in s&&(s.el.trigger("tap"),a=setTimeout(function(){a=null,s.el.trigger("singleTap"),s={}
  },250))}).bind("touchcancel",function(){a&&clearTimeout(a),o&&clearTimeout(o),o=a=null,s={}})}),["swipe","swipeLeft","swipeRight","swipeUp","swipeDown","doubleTap","tap","singleTap","longTap"].forEach(function(e){t.fn[e]=function(t){return this.bind(e,t)}})}(Zepto),function(){var t=this,e=t._,n={},i=Array.prototype,r=Object.prototype,a=Function.prototype,o=i.push,s=i.slice,c=i.concat,u=r.toString,l=r.hasOwnProperty,d=i.forEach,h=i.map,f=i.reduce,p=i.reduceRight,g=i.filter,m=i.every,v=i.some,w=i.indexOf,b=i.lastIndexOf,y=Array.isArray,_=Object.keys,x=a.bind,T=function(t){return t instanceof T?t:this instanceof T?void(this._wrapped=t):new T(t)
  };"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=T),exports._=T):t._=T,T.VERSION="1.4.4";var S=T.each=T.forEach=function(t,e,i){if(null!=t)if(d&&t.forEach===d)t.forEach(e,i);else if(t.length===+t.length){for(var r=0,a=t.length;a>r;r++)if(e.call(i,t[r],r,t)===n)return}else for(var o in t)if(T.has(t,o)&&e.call(i,t[o],o,t)===n)return};T.map=T.collect=function(t,e,n){var i=[];return null==t?i:h&&t.map===h?t.map(e,n):(S(t,function(t,r,a){i[i.length]=e.call(n,t,r,a)
  }),i)};var k="Reduce of empty array with no initial value";T.reduce=T.foldl=T.inject=function(t,e,n,i){var r=arguments.length>2;if(null==t&&(t=[]),f&&t.reduce===f)return i&&(e=T.bind(e,i)),r?t.reduce(e,n):t.reduce(e);if(S(t,function(t,a,o){r?n=e.call(i,n,t,a,o):(n=t,r=!0)}),!r)throw new TypeError(k);return n},T.reduceRight=T.foldr=function(t,e,n,i){var r=arguments.length>2;if(null==t&&(t=[]),p&&t.reduceRight===p)return i&&(e=T.bind(e,i)),r?t.reduceRight(e,n):t.reduceRight(e);var a=t.length;if(a!==+a){var o=T.keys(t);
  a=o.length}if(S(t,function(s,c,u){c=o?o[--a]:--a,r?n=e.call(i,n,t[c],c,u):(n=t[c],r=!0)}),!r)throw new TypeError(k);return n},T.find=T.detect=function(t,e,n){var i;return E(t,function(t,r,a){return e.call(n,t,r,a)?(i=t,!0):void 0}),i},T.filter=T.select=function(t,e,n){var i=[];return null==t?i:g&&t.filter===g?t.filter(e,n):(S(t,function(t,r,a){e.call(n,t,r,a)&&(i[i.length]=t)}),i)},T.reject=function(t,e,n){return T.filter(t,function(t,i,r){return!e.call(n,t,i,r)},n)},T.every=T.all=function(t,e,i){e||(e=T.identity);
  var r=!0;return null==t?r:m&&t.every===m?t.every(e,i):(S(t,function(t,a,o){return(r=r&&e.call(i,t,a,o))?void 0:n}),!!r)};var E=T.some=T.any=function(t,e,i){e||(e=T.identity);var r=!1;return null==t?r:v&&t.some===v?t.some(e,i):(S(t,function(t,a,o){return r||(r=e.call(i,t,a,o))?n:void 0}),!!r)};T.contains=T.include=function(t,e){return null==t?!1:w&&t.indexOf===w?-1!=t.indexOf(e):E(t,function(t){return t===e})},T.invoke=function(t,e){var n=s.call(arguments,2),i=T.isFunction(e);return T.map(t,function(t){return(i?e:t[e]).apply(t,n)
  })},T.pluck=function(t,e){return T.map(t,function(t){return t[e]})},T.where=function(t,e,n){return T.isEmpty(e)?n?null:[]:T[n?"find":"filter"](t,function(t){for(var n in e)if(e[n]!==t[n])return!1;return!0})},T.findWhere=function(t,e){return T.where(t,e,!0)},T.max=function(t,e,n){if(!e&&T.isArray(t)&&t[0]===+t[0]&&t.length<65535)return Math.max.apply(Math,t);if(!e&&T.isEmpty(t))return-1/0;var i={computed:-1/0,value:-1/0};return S(t,function(t,r,a){var o=e?e.call(n,t,r,a):t;o>=i.computed&&(i={value:t,computed:o})
  }),i.value},T.min=function(t,e,n){if(!e&&T.isArray(t)&&t[0]===+t[0]&&t.length<65535)return Math.min.apply(Math,t);if(!e&&T.isEmpty(t))return 1/0;var i={computed:1/0,value:1/0};return S(t,function(t,r,a){var o=e?e.call(n,t,r,a):t;o<i.computed&&(i={value:t,computed:o})}),i.value},T.shuffle=function(t){var e,n=0,i=[];return S(t,function(t){e=T.random(n++),i[n-1]=i[e],i[e]=t}),i};var C=function(t){return T.isFunction(t)?t:function(e){return e[t]}};T.sortBy=function(t,e,n){var i=C(e);return T.pluck(T.map(t,function(t,e,r){return{value:t,index:e,criteria:i.call(n,t,e,r)}
  }).sort(function(t,e){var n=t.criteria,i=e.criteria;if(n!==i){if(n>i||void 0===n)return 1;if(i>n||void 0===i)return-1}return t.index<e.index?-1:1}),"value")};var A=function(t,e,n,i){var r={},a=C(e||T.identity);return S(t,function(e,o){var s=a.call(n,e,o,t);i(r,s,e)}),r};T.groupBy=function(t,e,n){return A(t,e,n,function(t,e,n){(T.has(t,e)?t[e]:t[e]=[]).push(n)})},T.countBy=function(t,e,n){return A(t,e,n,function(t,e){T.has(t,e)||(t[e]=0),t[e]++})},T.sortedIndex=function(t,e,n,i){n=null==n?T.identity:C(n);
  for(var r=n.call(i,e),a=0,o=t.length;o>a;){var s=a+o>>>1;n.call(i,t[s])<r?a=s+1:o=s}return a},T.toArray=function(t){return t?T.isArray(t)?s.call(t):t.length===+t.length?T.map(t,T.identity):T.values(t):[]},T.size=function(t){return null==t?0:t.length===+t.length?t.length:T.keys(t).length},T.first=T.head=T.take=function(t,e,n){return null==t?void 0:null==e||n?t[0]:s.call(t,0,e)},T.initial=function(t,e,n){return s.call(t,0,t.length-(null==e||n?1:e))},T.last=function(t,e,n){return null==t?void 0:null==e||n?t[t.length-1]:s.call(t,Math.max(t.length-e,0))
  },T.rest=T.tail=T.drop=function(t,e,n){return s.call(t,null==e||n?1:e)},T.compact=function(t){return T.filter(t,T.identity)};var L=function(t,e,n){return S(t,function(t){T.isArray(t)?e?o.apply(n,t):L(t,e,n):n.push(t)}),n};T.flatten=function(t,e){return L(t,e,[])},T.without=function(t){return T.difference(t,s.call(arguments,1))},T.uniq=T.unique=function(t,e,n,i){T.isFunction(e)&&(i=n,n=e,e=!1);var r=n?T.map(t,n,i):t,a=[],o=[];return S(r,function(n,i){(e?i&&o[o.length-1]===n:T.contains(o,n))||(o.push(n),a.push(t[i]))
  }),a},T.union=function(){return T.uniq(c.apply(i,arguments))},T.intersection=function(t){var e=s.call(arguments,1);return T.filter(T.uniq(t),function(t){return T.every(e,function(e){return T.indexOf(e,t)>=0})})},T.difference=function(t){var e=c.apply(i,s.call(arguments,1));return T.filter(t,function(t){return!T.contains(e,t)})},T.zip=function(){for(var t=s.call(arguments),e=T.max(T.pluck(t,"length")),n=new Array(e),i=0;e>i;i++)n[i]=T.pluck(t,""+i);return n},T.object=function(t,e){if(null==t)return{};
  for(var n={},i=0,r=t.length;r>i;i++)e?n[t[i]]=e[i]:n[t[i][0]]=t[i][1];return n},T.indexOf=function(t,e,n){if(null==t)return-1;var i=0,r=t.length;if(n){if("number"!=typeof n)return i=T.sortedIndex(t,e),t[i]===e?i:-1;i=0>n?Math.max(0,r+n):n}if(w&&t.indexOf===w)return t.indexOf(e,n);for(;r>i;i++)if(t[i]===e)return i;return-1},T.lastIndexOf=function(t,e,n){if(null==t)return-1;var i=null!=n;if(b&&t.lastIndexOf===b)return i?t.lastIndexOf(e,n):t.lastIndexOf(e);for(var r=i?n:t.length;r--;)if(t[r]===e)return r;
  return-1},T.range=function(t,e,n){arguments.length<=1&&(e=t||0,t=0),n=arguments[2]||1;for(var i=Math.max(Math.ceil((e-t)/n),0),r=0,a=new Array(i);i>r;)a[r++]=t,t+=n;return a},T.bind=function(t,e){if(t.bind===x&&x)return x.apply(t,s.call(arguments,1));var n=s.call(arguments,2);return function(){return t.apply(e,n.concat(s.call(arguments)))}},T.partial=function(t){var e=s.call(arguments,1);return function(){return t.apply(this,e.concat(s.call(arguments)))}},T.bindAll=function(t){var e=s.call(arguments,1);
  return 0===e.length&&(e=T.functions(t)),S(e,function(e){t[e]=T.bind(t[e],t)}),t},T.memoize=function(t,e){var n={};return e||(e=T.identity),function(){var i=e.apply(this,arguments);return T.has(n,i)?n[i]:n[i]=t.apply(this,arguments)}},T.delay=function(t,e){var n=s.call(arguments,2);return setTimeout(function(){return t.apply(null,n)},e)},T.defer=function(t){return T.delay.apply(T,[t,1].concat(s.call(arguments,1)))},T.throttle=function(t,e){var n,i,r,a,o=0,s=function(){o=new Date,r=null,a=t.apply(n,i)
  };return function(){var c=new Date,u=e-(c-o);return n=this,i=arguments,0>=u?(clearTimeout(r),r=null,o=c,a=t.apply(n,i)):r||(r=setTimeout(s,u)),a}},T.debounce=function(t,e,n){var i,r;return function(){var a=this,o=arguments,s=function(){i=null,n||(r=t.apply(a,o))},c=n&&!i;return clearTimeout(i),i=setTimeout(s,e),c&&(r=t.apply(a,o)),r}},T.once=function(t){var e,n=!1;return function(){return n?e:(n=!0,e=t.apply(this,arguments),t=null,e)}},T.wrap=function(t,e){return function(){var n=[t];return o.apply(n,arguments),e.apply(this,n)
  }},T.compose=function(){var t=arguments;return function(){for(var e=arguments,n=t.length-1;n>=0;n--)e=[t[n].apply(this,e)];return e[0]}},T.after=function(t,e){return 0>=t?e():function(){return--t<1?e.apply(this,arguments):void 0}},T.keys=_||function(t){if(t!==Object(t))throw new TypeError("Invalid object");var e=[];for(var n in t)T.has(t,n)&&(e[e.length]=n);return e},T.values=function(t){var e=[];for(var n in t)T.has(t,n)&&e.push(t[n]);return e},T.pairs=function(t){var e=[];for(var n in t)T.has(t,n)&&e.push([n,t[n]]);
  return e},T.invert=function(t){var e={};for(var n in t)T.has(t,n)&&(e[t[n]]=n);return e},T.functions=T.methods=function(t){var e=[];for(var n in t)T.isFunction(t[n])&&e.push(n);return e.sort()},T.extend=function(t){return S(s.call(arguments,1),function(e){if(e)for(var n in e)t[n]=e[n]}),t},T.pick=function(t){var e={},n=c.apply(i,s.call(arguments,1));return S(n,function(n){n in t&&(e[n]=t[n])}),e},T.omit=function(t){var e={},n=c.apply(i,s.call(arguments,1));for(var r in t)T.contains(n,r)||(e[r]=t[r]);
  return e},T.defaults=function(t){return S(s.call(arguments,1),function(e){if(e)for(var n in e)null==t[n]&&(t[n]=e[n])}),t},T.clone=function(t){return T.isObject(t)?T.isArray(t)?t.slice():T.extend({},t):t},T.tap=function(t,e){return e(t),t};var I=function(t,e,n,i){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return t===e;t instanceof T&&(t=t._wrapped),e instanceof T&&(e=e._wrapped);var r=u.call(t);if(r!=u.call(e))return!1;switch(r){case"[object String]":return t==String(e);case"[object Number]":return t!=+t?e!=+e:0==t?1/t==1/e:t==+e;
  case"[object Date]":case"[object Boolean]":return+t==+e;case"[object RegExp]":return t.source==e.source&&t.global==e.global&&t.multiline==e.multiline&&t.ignoreCase==e.ignoreCase}if("object"!=typeof t||"object"!=typeof e)return!1;for(var a=n.length;a--;)if(n[a]==t)return i[a]==e;n.push(t),i.push(e);var o=0,s=!0;if("[object Array]"==r){if(o=t.length,s=o==e.length)for(;o--&&(s=I(t[o],e[o],n,i)););}else{var c=t.constructor,l=e.constructor;if(c!==l&&!(T.isFunction(c)&&c instanceof c&&T.isFunction(l)&&l instanceof l))return!1;
  for(var d in t)if(T.has(t,d)&&(o++,!(s=T.has(e,d)&&I(t[d],e[d],n,i))))break;if(s){for(d in e)if(T.has(e,d)&&!o--)break;s=!o}}return n.pop(),i.pop(),s};T.isEqual=function(t,e){return I(t,e,[],[])},T.isEmpty=function(t){if(null==t)return!0;if(T.isArray(t)||T.isString(t))return 0===t.length;for(var e in t)if(T.has(t,e))return!1;return!0},T.isElement=function(t){return!(!t||1!==t.nodeType)},T.isArray=y||function(t){return"[object Array]"==u.call(t)},T.isObject=function(t){return t===Object(t)},S(["Arguments","Function","String","Number","Date","RegExp"],function(t){T["is"+t]=function(e){return u.call(e)=="[object "+t+"]"
  }}),T.isArguments(arguments)||(T.isArguments=function(t){return!(!t||!T.has(t,"callee"))}),"function"!=typeof/./&&(T.isFunction=function(t){return"function"==typeof t}),T.isFinite=function(t){return isFinite(t)&&!isNaN(parseFloat(t))},T.isNaN=function(t){return T.isNumber(t)&&t!=+t},T.isBoolean=function(t){return t===!0||t===!1||"[object Boolean]"==u.call(t)},T.isNull=function(t){return null===t},T.isUndefined=function(t){return void 0===t},T.has=function(t,e){return l.call(t,e)},T.noConflict=function(){return t._=e,this
  },T.identity=function(t){return t},T.times=function(t,e,n){for(var i=Array(t),r=0;t>r;r++)i[r]=e.call(n,r);return i},T.random=function(t,e){return null==e&&(e=t,t=0),t+Math.floor(Math.random()*(e-t+1))};var O={escape:{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","/":"&#x2F;"}};O.unescape=T.invert(O.escape);var P={escape:new RegExp("["+T.keys(O.escape).join("")+"]","g"),unescape:new RegExp("("+T.keys(O.unescape).join("|")+")","g")};T.each(["escape","unescape"],function(t){T[t]=function(e){return null==e?"":(""+e).replace(P[t],function(e){return O[t][e]
  })}}),T.result=function(t,e){if(null==t)return null;var n=t[e];return T.isFunction(n)?n.call(t):n},T.mixin=function(t){S(T.functions(t),function(e){var n=T[e]=t[e];T.prototype[e]=function(){var t=[this._wrapped];return o.apply(t,arguments),W.call(this,n.apply(T,t))}})};var R=0;T.uniqueId=function(t){var e=++R+"";return t?t+e:e},T.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var M=/(.)^/,N={"'":"'","\\":"\\","\r":"r","\n":"n","	":"t","\u2028":"u2028","\u2029":"u2029"},D=/\\|'|\r|\n|\t|\u2028|\u2029/g;
  T.template=function(t,e,n){var i;n=T.defaults({},n,T.templateSettings);var r=new RegExp([(n.escape||M).source,(n.interpolate||M).source,(n.evaluate||M).source].join("|")+"|$","g"),a=0,o="__p+='";t.replace(r,function(e,n,i,r,s){return o+=t.slice(a,s).replace(D,function(t){return"\\"+N[t]}),n&&(o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'"),i&&(o+="'+\n((__t=("+i+"))==null?'':__t)+\n'"),r&&(o+="';\n"+r+"\n__p+='"),a=s+e.length,e}),o+="';\n",n.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";
  try{i=new Function(n.variable||"obj","_",o)}catch(s){throw s.source=o,s}if(e)return i(e,T);var c=function(t){return i.call(this,t,T)};return c.source="function("+(n.variable||"obj")+"){\n"+o+"}",c},T.chain=function(t){return T(t).chain()};var W=function(t){return this._chain?T(t).chain():t};T.mixin(T),S(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=i[t];T.prototype[t]=function(){var n=this._wrapped;return e.apply(n,arguments),"shift"!=t&&"splice"!=t||0!==n.length||delete n[0],W.call(this,n)
  }}),S(["concat","join","slice"],function(t){var e=i[t];T.prototype[t]=function(){return W.call(this,e.apply(this._wrapped,arguments))}}),T.extend(T.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}.call(this),function(){var t,e=this,n=e.Backbone,i=[],r=i.push,a=i.slice,o=i.splice;t="undefined"!=typeof exports?exports:e.Backbone={},t.VERSION="1.0.0";var s=e._;s||"undefined"==typeof require||(s=require("underscore")),t.$=e.jQuery||e.Zepto||e.ender||e.$,t.noConflict=function(){return e.Backbone=n,this
  },t.emulateHTTP=!1,t.emulateJSON=!1;var c=t.Events={on:function(t,e,n){if(!l(this,"on",t,[e,n])||!e)return this;this._events||(this._events={});var i=this._events[t]||(this._events[t]=[]);return i.push({callback:e,context:n,ctx:n||this}),this},once:function(t,e,n){if(!l(this,"once",t,[e,n])||!e)return this;var i=this,r=s.once(function(){i.off(t,r),e.apply(this,arguments)});return r._callback=e,this.on(t,r,n)},off:function(t,e,n){var i,r,a,o,c,u,d,h;if(!this._events||!l(this,"off",t,[e,n]))return this;
  if(!t&&!e&&!n)return this._events={},this;for(o=t?[t]:s.keys(this._events),c=0,u=o.length;u>c;c++)if(t=o[c],a=this._events[t]){if(this._events[t]=i=[],e||n)for(d=0,h=a.length;h>d;d++)r=a[d],(e&&e!==r.callback&&e!==r.callback._callback||n&&n!==r.context)&&i.push(r);i.length||delete this._events[t]}return this},trigger:function(t){if(!this._events)return this;var e=a.call(arguments,1);if(!l(this,"trigger",t,e))return this;var n=this._events[t],i=this._events.all;return n&&d(n,e),i&&d(i,arguments),this
  },stopListening:function(t,e,n){var i=this._listeners;if(!i)return this;var r=!e&&!n;"object"==typeof e&&(n=this),t&&((i={})[t._listenerId]=t);for(var a in i)i[a].off(e,n,this),r&&delete this._listeners[a];return this}},u=/\s+/,l=function(t,e,n,i){if(!n)return!0;if("object"==typeof n){for(var r in n)t[e].apply(t,[r,n[r]].concat(i));return!1}if(u.test(n)){for(var a=n.split(u),o=0,s=a.length;s>o;o++)t[e].apply(t,[a[o]].concat(i));return!1}return!0},d=function(t,e){var n,i=-1,r=t.length,a=e[0],o=e[1],s=e[2];
  switch(e.length){case 0:for(;++i<r;)(n=t[i]).callback.call(n.ctx);return;case 1:for(;++i<r;)(n=t[i]).callback.call(n.ctx,a);return;case 2:for(;++i<r;)(n=t[i]).callback.call(n.ctx,a,o);return;case 3:for(;++i<r;)(n=t[i]).callback.call(n.ctx,a,o,s);return;default:for(;++i<r;)(n=t[i]).callback.apply(n.ctx,e)}},h={listenTo:"on",listenToOnce:"once"};s.each(h,function(t,e){c[e]=function(e,n,i){var r=this._listeners||(this._listeners={}),a=e._listenerId||(e._listenerId=s.uniqueId("l"));return r[a]=e,"object"==typeof n&&(i=this),e[t](n,i,this),this
  }}),c.bind=c.on,c.unbind=c.off,s.extend(t,c);var f=t.Model=function(t,e){var n,i=t||{};e||(e={}),this.cid=s.uniqueId("c"),this.attributes={},s.extend(this,s.pick(e,p)),e.parse&&(i=this.parse(i,e)||{}),(n=s.result(this,"defaults"))&&(i=s.defaults({},i,n)),this.set(i,e),this.changed={},this.initialize.apply(this,arguments)},p=["url","urlRoot","collection"];s.extend(f.prototype,c,{changed:null,validationError:null,idAttribute:"id",initialize:function(){},toJSON:function(){return s.clone(this.attributes)
  },sync:function(){return t.sync.apply(this,arguments)},get:function(t){return this.attributes[t]},escape:function(t){return s.escape(this.get(t))},has:function(t){return null!=this.get(t)},set:function(t,e,n){var i,r,a,o,c,u,l,d;if(null==t)return this;if("object"==typeof t?(r=t,n=e):(r={})[t]=e,n||(n={}),!this._validate(r,n))return!1;a=n.unset,c=n.silent,o=[],u=this._changing,this._changing=!0,u||(this._previousAttributes=s.clone(this.attributes),this.changed={}),d=this.attributes,l=this._previousAttributes,this.idAttribute in r&&(this.id=r[this.idAttribute]);
  for(i in r)e=r[i],s.isEqual(d[i],e)||o.push(i),s.isEqual(l[i],e)?delete this.changed[i]:this.changed[i]=e,a?delete d[i]:d[i]=e;if(!c){o.length&&(this._pending=!0);for(var h=0,f=o.length;f>h;h++)this.trigger("change:"+o[h],this,d[o[h]],n)}if(u)return this;if(!c)for(;this._pending;)this._pending=!1,this.trigger("change",this,n);return this._pending=!1,this._changing=!1,this},unset:function(t,e){return this.set(t,void 0,s.extend({},e,{unset:!0}))},clear:function(t){var e={};for(var n in this.attributes)e[n]=void 0;
  return this.set(e,s.extend({},t,{unset:!0}))},hasChanged:function(t){return null==t?!s.isEmpty(this.changed):s.has(this.changed,t)},changedAttributes:function(t){if(!t)return this.hasChanged()?s.clone(this.changed):!1;var e,n=!1,i=this._changing?this._previousAttributes:this.attributes;for(var r in t)s.isEqual(i[r],e=t[r])||((n||(n={}))[r]=e);return n},previous:function(t){return null!=t&&this._previousAttributes?this._previousAttributes[t]:null},previousAttributes:function(){return s.clone(this._previousAttributes)
  },fetch:function(t){t=t?s.clone(t):{},void 0===t.parse&&(t.parse=!0);var e=this,n=t.success;return t.success=function(i){return e.set(e.parse(i,t),t)?(n&&n(e,i,t),void e.trigger("sync",e,i,t)):!1},W(this,t),this.sync("read",this,t)},save:function(t,e,n){var i,r,a,o=this.attributes;if(null==t||"object"==typeof t?(i=t,n=e):(i={})[t]=e,!(!i||n&&n.wait||this.set(i,n)))return!1;if(n=s.extend({validate:!0},n),!this._validate(i,n))return!1;i&&n.wait&&(this.attributes=s.extend({},o,i)),void 0===n.parse&&(n.parse=!0);
  var c=this,u=n.success;return n.success=function(t){c.attributes=o;var e=c.parse(t,n);return n.wait&&(e=s.extend(i||{},e)),s.isObject(e)&&!c.set(e,n)?!1:(u&&u(c,t,n),void c.trigger("sync",c,t,n))},W(this,n),r=this.isNew()?"create":n.patch?"patch":"update","patch"===r&&(n.attrs=i),a=this.sync(r,this,n),i&&n.wait&&(this.attributes=o),a},destroy:function(t){t=t?s.clone(t):{};var e=this,n=t.success,i=function(){e.trigger("destroy",e,e.collection,t)};if(t.success=function(r){(t.wait||e.isNew())&&i(),n&&n(e,r,t),e.isNew()||e.trigger("sync",e,r,t)
  },this.isNew())return t.success(),!1;W(this,t);var r=this.sync("delete",this,t);return t.wait||i(),r},url:function(){var t=s.result(this,"urlRoot")||s.result(this.collection,"url")||D();return this.isNew()?t:t+("/"===t.charAt(t.length-1)?"":"/")+encodeURIComponent(this.id)},parse:function(t){return t},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return null==this.id},isValid:function(t){return this._validate({},s.extend(t||{},{validate:!0}))},_validate:function(t,e){if(!e.validate||!this.validate)return!0;
  t=s.extend({},this.attributes,t);var n=this.validationError=this.validate(t,e)||null;return n?(this.trigger("invalid",this,n,s.extend(e||{},{validationError:n})),!1):!0}});var g=["keys","values","pairs","invert","pick","omit"];s.each(g,function(t){f.prototype[t]=function(){var e=a.call(arguments);return e.unshift(this.attributes),s[t].apply(s,e)}});var m=t.Collection=function(t,e){e||(e={}),e.url&&(this.url=e.url),e.model&&(this.model=e.model),void 0!==e.comparator&&(this.comparator=e.comparator),this._reset(),this.initialize.apply(this,arguments),t&&this.reset(t,s.extend({silent:!0},e))
  },v={add:!0,remove:!0,merge:!0},w={add:!0,merge:!1,remove:!1};s.extend(m.prototype,c,{model:f,initialize:function(){},toJSON:function(t){return this.map(function(e){return e.toJSON(t)})},sync:function(){return t.sync.apply(this,arguments)},add:function(t,e){return this.set(t,s.defaults(e||{},w))},remove:function(t,e){t=s.isArray(t)?t.slice():[t],e||(e={});var n,i,r,a;for(n=0,i=t.length;i>n;n++)a=this.get(t[n]),a&&(delete this._byId[a.id],delete this._byId[a.cid],r=this.indexOf(a),this.models.splice(r,1),this.length--,e.silent||(e.index=r,a.trigger("remove",a,this,e)),this._removeReference(a));
  return this},set:function(t,e){e=s.defaults(e||{},v),e.parse&&(t=this.parse(t,e)),s.isArray(t)||(t=t?[t]:[]);var n,i,a,c,u,l=e.at,d=this.comparator&&null==l&&e.sort!==!1,h=s.isString(this.comparator)?this.comparator:null,f=[],p=[],g={};for(n=0,i=t.length;i>n;n++)(a=this._prepareModel(t[n],e))&&((c=this.get(a))?(e.remove&&(g[c.cid]=!0),e.merge&&(c.set(a.attributes,e),d&&!u&&c.hasChanged(h)&&(u=!0))):e.add&&(f.push(a),a.on("all",this._onModelEvent,this),this._byId[a.cid]=a,null!=a.id&&(this._byId[a.id]=a)));
  if(e.remove){for(n=0,i=this.length;i>n;++n)g[(a=this.models[n]).cid]||p.push(a);p.length&&this.remove(p,e)}if(f.length&&(d&&(u=!0),this.length+=f.length,null!=l?o.apply(this.models,[l,0].concat(f)):r.apply(this.models,f)),u&&this.sort({silent:!0}),e.silent)return this;for(n=0,i=f.length;i>n;n++)(a=f[n]).trigger("add",a,this,e);return u&&this.trigger("sort",this,e),this},reset:function(t,e){e||(e={});for(var n=0,i=this.models.length;i>n;n++)this._removeReference(this.models[n]);return e.previousModels=this.models,this._reset(),this.add(t,s.extend({silent:!0},e)),e.silent||this.trigger("reset",this,e),this
  },push:function(t,e){return t=this._prepareModel(t,e),this.add(t,s.extend({at:this.length},e)),t},pop:function(t){var e=this.at(this.length-1);return this.remove(e,t),e},unshift:function(t,e){return t=this._prepareModel(t,e),this.add(t,s.extend({at:0},e)),t},shift:function(t){var e=this.at(0);return this.remove(e,t),e},slice:function(t,e){return this.models.slice(t,e)},get:function(t){return null==t?void 0:this._byId[null!=t.id?t.id:t.cid||t]},at:function(t){return this.models[t]},where:function(t,e){return s.isEmpty(t)?e?void 0:[]:this[e?"find":"filter"](function(e){for(var n in t)if(t[n]!==e.get(n))return!1;
  return!0})},findWhere:function(t){return this.where(t,!0)},sort:function(t){if(!this.comparator)throw new Error("Cannot sort a set without a comparator");return t||(t={}),s.isString(this.comparator)||1===this.comparator.length?this.models=this.sortBy(this.comparator,this):this.models.sort(s.bind(this.comparator,this)),t.silent||this.trigger("sort",this,t),this},sortedIndex:function(t,e,n){e||(e=this.comparator);var i=s.isFunction(e)?e:function(t){return t.get(e)};return s.sortedIndex(this.models,t,i,n)
  },pluck:function(t){return s.invoke(this.models,"get",t)},fetch:function(t){t=t?s.clone(t):{},void 0===t.parse&&(t.parse=!0);var e=t.success,n=this;return t.success=function(i){var r=t.reset?"reset":"set";n[r](i,t),e&&e(n,i,t),n.trigger("sync",n,i,t)},W(this,t),this.sync("read",this,t)},create:function(t,e){if(e=e?s.clone(e):{},!(t=this._prepareModel(t,e)))return!1;e.wait||this.add(t,e);var n=this,i=e.success;return e.success=function(r){e.wait&&n.add(t,e),i&&i(t,r,e)},t.save(null,e),t},parse:function(t){return t
  },clone:function(){return new this.constructor(this.models)},_reset:function(){this.length=0,this.models=[],this._byId={}},_prepareModel:function(t,e){if(t instanceof f)return t.collection||(t.collection=this),t;e||(e={}),e.collection=this;var n=new this.model(t,e);return n._validate(t,e)?n:(this.trigger("invalid",this,t,e),!1)},_removeReference:function(t){this===t.collection&&delete t.collection,t.off("all",this._onModelEvent,this)},_onModelEvent:function(t,e,n,i){("add"!==t&&"remove"!==t||n===this)&&("destroy"===t&&this.remove(e,i),e&&t==="change:"+e.idAttribute&&(delete this._byId[e.previous(e.idAttribute)],null!=e.id&&(this._byId[e.id]=e)),this.trigger.apply(this,arguments))
  }});var b=["forEach","each","map","collect","reduce","foldl","inject","reduceRight","foldr","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","max","min","toArray","size","first","head","take","initial","rest","tail","drop","last","without","indexOf","shuffle","lastIndexOf","isEmpty","chain"];s.each(b,function(t){m.prototype[t]=function(){var e=a.call(arguments);return e.unshift(this.models),s[t].apply(s,e)}});var y=["groupBy","countBy","sortBy"];
  s.each(y,function(t){m.prototype[t]=function(e,n){var i=s.isFunction(e)?e:function(t){return t.get(e)};return s[t](this.models,i,n)}});var _=t.View=function(t){this.cid=s.uniqueId("view"),this._configure(t||{}),this._ensureElement(),this.initialize.apply(this,arguments),this.delegateEvents()},x=/^(\S+)\s*(.*)$/,T=["model","collection","el","id","attributes","className","tagName","events"];s.extend(_.prototype,c,{tagName:"div",$:function(t){return this.$el.find(t)},initialize:function(){},render:function(){return this
  },remove:function(){return this.$el.remove(),this.stopListening(),this},setElement:function(e,n){return this.$el&&this.undelegateEvents(),this.$el=e instanceof t.$?e:t.$(e),this.el=this.$el[0],n!==!1&&this.delegateEvents(),this},delegateEvents:function(t){if(!t&&!(t=s.result(this,"events")))return this;this.undelegateEvents();for(var e in t){var n=t[e];if(s.isFunction(n)||(n=this[t[e]]),n){var i=e.match(x),r=i[1],a=i[2];n=s.bind(n,this),r+=".delegateEvents"+this.cid,""===a?this.$el.on(r,n):this.$el.on(r,a,n)
  }}return this},undelegateEvents:function(){return this.$el.off(".delegateEvents"+this.cid),this},_configure:function(t){this.options&&(t=s.extend({},s.result(this,"options"),t)),s.extend(this,s.pick(t,T)),this.options=t},_ensureElement:function(){if(this.el)this.setElement(s.result(this,"el"),!1);else{var e=s.extend({},s.result(this,"attributes"));this.id&&(e.id=s.result(this,"id")),this.className&&(e["class"]=s.result(this,"className"));var n=t.$("<"+s.result(this,"tagName")+">").attr(e);this.setElement(n,!1)
  }}}),t.sync=function(e,n,i){var r=S[e];s.defaults(i||(i={}),{emulateHTTP:t.emulateHTTP,emulateJSON:t.emulateJSON});var a={type:r,dataType:"json"};if(i.url||(a.url=s.result(n,"url")||D()),null!=i.data||!n||"create"!==e&&"update"!==e&&"patch"!==e||(a.contentType="application/json",a.data=JSON.stringify(i.attrs||n.toJSON(i))),i.emulateJSON&&(a.contentType="application/x-www-form-urlencoded",a.data=a.data?{model:a.data}:{}),i.emulateHTTP&&("PUT"===r||"DELETE"===r||"PATCH"===r)){a.type="POST",i.emulateJSON&&(a.data._method=r);
  var o=i.beforeSend;i.beforeSend=function(t){return t.setRequestHeader("X-HTTP-Method-Override",r),o?o.apply(this,arguments):void 0}}"GET"===a.type||i.emulateJSON||(a.processData=!1),"PATCH"!==a.type||!window.ActiveXObject||window.external&&window.external.msActiveXFilteringEnabled||(a.xhr=function(){return new ActiveXObject("Microsoft.XMLHTTP")});var c=i.xhr=t.ajax(s.extend(a,i));return n.trigger("request",n,c,i),c};var S={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"};t.ajax=function(){return t.$.ajax.apply(t.$,arguments)
  };var k=t.Router=function(t){t||(t={}),t.routes&&(this.routes=t.routes),this._bindRoutes(),this.initialize.apply(this,arguments)},E=/\((.*?)\)/g,C=/(\(\?)?:\w+/g,A=/\*\w+/g,L=/[\-{}\[\]+?.,\\\^$|#\s]/g;s.extend(k.prototype,c,{initialize:function(){},route:function(e,n,i){s.isRegExp(e)||(e=this._routeToRegExp(e)),s.isFunction(n)&&(i=n,n=""),i||(i=this[n]);var r=this;return t.history.route(e,function(a){var o=r._extractParameters(e,a);i&&i.apply(r,o),r.trigger.apply(r,["route:"+n].concat(o)),r.trigger("route",n,o),t.history.trigger("route",r,n,o)
  }),this},navigate:function(e,n){return t.history.navigate(e,n),this},_bindRoutes:function(){if(this.routes){this.routes=s.result(this,"routes");for(var t,e=s.keys(this.routes);null!=(t=e.pop());)this.route(t,this.routes[t])}},_routeToRegExp:function(t){return t=t.replace(L,"\\$&").replace(E,"(?:$1)?").replace(C,function(t,e){return e?t:"([^/]+)"}).replace(A,"(.*?)"),new RegExp("^"+t+"$")},_extractParameters:function(t,e){var n=t.exec(e).slice(1);return s.map(n,function(t){return t?decodeURIComponent(t):null
  })}});var I=t.History=function(){this.handlers=[],s.bindAll(this,"checkUrl"),"undefined"!=typeof window&&(this.location=window.location,this.history=window.history)},O=/^[#\/]|\s+$/g,P=/^\/+|\/+$/g,R=/msie [\w.]+/,M=/\/$/;I.started=!1,s.extend(I.prototype,c,{interval:50,getHash:function(t){var e=(t||this).location.href.match(/#(.*)$/);return e?e[1]:""},getFragment:function(t,e){if(null==t)if(this._hasPushState||!this._wantsHashChange||e){t=this.location.pathname;var n=this.root.replace(M,"");t.indexOf(n)||(t=t.substr(n.length))
  }else t=this.getHash();return t.replace(O,"")},start:function(e){if(I.started)throw new Error("Backbone.history has already been started");I.started=!0,this.options=s.extend({},{root:"/"},this.options,e),this.root=this.options.root,this._wantsHashChange=this.options.hashChange!==!1,this._wantsPushState=!!this.options.pushState,this._hasPushState=!!(this.options.pushState&&this.history&&this.history.pushState);var n=this.getFragment(),i=document.documentMode,r=R.exec(navigator.userAgent.toLowerCase())&&(!i||7>=i);
  this.root=("/"+this.root+"/").replace(P,"/"),r&&this._wantsHashChange&&(this.iframe=t.$('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo("body")[0].contentWindow,this.navigate(n)),this._hasPushState?t.$(window).on("popstate",this.checkUrl):this._wantsHashChange&&"onhashchange"in window&&!r?t.$(window).on("hashchange",this.checkUrl):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),this.fragment=n;var a=this.location,o=a.pathname.replace(/[^\/]$/,"$&/")===this.root;
  return this._wantsHashChange&&this._wantsPushState&&!this._hasPushState&&!o?(this.fragment=this.getFragment(null,!0),this.location.replace(this.root+this.location.search+"#"+this.fragment),!0):(this._wantsPushState&&this._hasPushState&&o&&a.hash&&(this.fragment=this.getHash().replace(O,""),this.history.replaceState({},document.title,this.root+this.fragment+a.search)),this.options.silent?void 0:this.loadUrl())},stop:function(){t.$(window).off("popstate",this.checkUrl).off("hashchange",this.checkUrl),clearInterval(this._checkUrlInterval),I.started=!1
  },route:function(t,e){this.handlers.unshift({route:t,callback:e})},checkUrl:function(){var t=this.getFragment();return t===this.fragment&&this.iframe&&(t=this.getFragment(this.getHash(this.iframe))),t===this.fragment?!1:(this.iframe&&this.navigate(t),void(this.loadUrl()||this.loadUrl(this.getHash())))},loadUrl:function(t){var e=this.fragment=this.getFragment(t),n=s.any(this.handlers,function(t){return t.route.test(e)?(t.callback(e),!0):void 0});return n},navigate:function(t,e){if(!I.started)return!1;
  if(e&&e!==!0||(e={trigger:e}),t=this.getFragment(t||""),this.fragment!==t){this.fragment=t;var n=this.root+t;if(this._hasPushState)this.history[e.replace?"replaceState":"pushState"]({},document.title,n);else{if(!this._wantsHashChange)return this.location.assign(n);this._updateHash(this.location,t,e.replace),this.iframe&&t!==this.getFragment(this.getHash(this.iframe))&&(e.replace||this.iframe.document.open().close(),this._updateHash(this.iframe.location,t,e.replace))}e.trigger&&this.loadUrl(t)}},_updateHash:function(t,e,n){if(n){var i=t.href.replace(/(javascript:|#).*$/,"");
  t.replace(i+"#"+e)}else t.hash="#"+e}}),t.history=new I;var N=function(t,e){var n,i=this;n=t&&s.has(t,"constructor")?t.constructor:function(){return i.apply(this,arguments)},s.extend(n,i,e);var r=function(){this.constructor=n};return r.prototype=i.prototype,n.prototype=new r,t&&s.extend(n.prototype,t),n.__super__=i.prototype,n};f.extend=m.extend=k.extend=_.extend=I.extend=N;var D=function(){throw new Error('A "url" property or function must be specified')},W=function(t,e){var n=e.error;e.error=function(i){n&&n(t,i,e),t.trigger("error",t,i,e)
  }}}.call(this),!function(){window.rocket=window.rocket||{}}(Zepto),function(t){var e,n,i=rocket.utils=rocket.utils||{};t.extend(i,{tip:function(i,r,a,o){var s=t(".global-tip"),c=t(window).height();switch(o=o||1500,0==s.length&&(s=t('<div class="global-tip"><span></span></div>'),t("body").prepend(s)),n&&e&&clearTimeout(e),n=!0,s.find("span").text(i),r){case 0:s.css("text-align","center");break;case 1:s.css("text-align","left");break;case 2:s.css("text-align","right")}switch(a){case 0:s.css("top",c/2+"px");
  break;case 1:s.css("top","10px");break;case 2:s.css("bottom","10px")}s.css({"-webkit-transition":"none",opacity:1}),s.show(),e=setTimeout(function(){s.animate({opacity:0},300,"",function(){s.hide(),s.css({"-webkit-transition":"none",opacity:1}),n=!1})},o)}})}(Zepto),function(t){rocket.baseview=Backbone.View.extend({events:{},init:function(){},initialize:function(t,e){var n=this;n.options=t||{__empty:!0},n.parent=e||null,n.children={},n.length=0,n.ec=n.getRoot(),n.subec=n.getSubEC(),n.featureString=n.getFeatureString(),n.$globalLoading=rocket.$globalLoading,n.$pageLoading=rocket.$pageLoading,n.pageOrientation=n.pageOrientationToBe=window.orientation,n.init(n.options),n._registerEvents(),n.registerEvents()
  },getRoot:function(){var t,e,n=this;for(t=e=n;t;)e=t,t=t.parent;return e},getSubEC:function(){var t,e,n=this;for(t=e=n;t;){if(t instanceof rocket.subpageview)return t;e=t,t=t.parent}return e},getFeatureString:function(e){var n=this,i=e||n.options,r="";return r=t.param(i,!0),e||(n.featureString=r),r},showLoading:function(e){var n=this;e&&t(e).append(n.$pageLoading),n.$pageLoading.show(),n.$globalLoading.hide()},hideLoading:function(t){var e=this;return 0>t?(e.$globalLoading.hide(),void e.$pageLoading.remove()):void setTimeout(function(){e.$pageLoading.remove()
  },void 0===t?300:t)},append:function(t){this._addSubview(t)},appendTo:function(t,e){this._addSubview(t,"APPENDTO",e)},prepend:function(t){this._addSubview(t,"PREPEND")},setup:function(t){this._addSubview(t,"SETUP")},_addSubview:function(e,n,i){var r=this;if(!(e instanceof rocket.baseview))throw new Error("rocket.view.append arguments must be an instance of rocket.view");switch(r.children[e.cid]=e,r.length++,e.parent=r,n){case"SETUP":break;case"PREPEND":r.$el.prepend(e.$el);break;case"APPENDTO":t(i).append(e.$el);
  break;default:r.$el.append(e.$el)}e.$el.hide()},remove:function(t){var e=this;t instanceof rocket.baseview?(delete e.children[t.cid],e.length--,t.parent=null,t.$el.remove()):e.parent&&e.parent.remove(e)},firstChild:function(){var t=this;for(var e in t.children)return t.children[e];return null},nextSibling:function(){var t=this,e=t.parent,n=null,i=null;if(!e)return null;for(var r in e.children)if(n=i,i=e.children[r],n==t)return i;return null},prevSibling:function(){var t=this,e=t.parent,n=null,i=null;
  if(!e)return null;for(var r in e.children)if(n=i,i=e.children[r],i==t)return n;return null},destroy:function(){var t=this;for(var e in t.children)t.children[e].destroy();t._unregisterEvents(),t.unregisterEvents(),t.undelegateEvents(),this.$el.remove(),t.el=t.$el=null,t.parent&&delete t.parent.children[t.cid]},registerEvents:function(){},unregisterEvents:function(){},onorientationchange:function(){},_registerEvents:function(){var e=this,n=e.ec;e._onorientationchange=function(){e.pageOrientationToBe=window.orientation,n.isActivePage()&&e.pageOrientation!=e.pageOrientationToBe&&(e.onorientationchange(e.pageOrientation,e.pageOrientationToBe),e.pageOrientation=e.pageOrientationToBe)
  },t(window).on("orientationchange",e._onorientationchange),n.on("pagebeforechange",e._onpagebeforechange,e),n.on("pageafterchange",e._onpageafterchange,e)},_unregisterEvents:function(){var e=this,n=e.ec;t(window).off("orientationchange",e._onorientationchange),e.onorientationchange=e.onsubpagebeforechange=e.onsubpageafterchange=function(){},n.off("pagebeforechange",e._onpagebeforechange,e),n.off("pageafterchange",e._onpageafterchange,e)},_onpagebeforechange:function(t){var e=this,n=t.from,i=t.to,r=t.params,a=e.getFeatureString(r),o=e.subpageManager;
  e.pageOrientation!=e.pageOrientationToBe&&(e.onorientationchange(e.pageOrientation,e.pageOrientationToBe),e.pageOrientation=e.pageOrientationToBe),o&&o._subpages.length&&i==e.ec&&n!=i&&o._currentSubpage&&o._currentSubpage.featureString!=a&&o._currentSubpage.$el.hide()},_onpageafterchange:function(e){var n,i,r=this,a=e.from,o=e.to,s=e.params,c=r.getFeatureString(s),u=r.subpageManager;if(o==r.ec&&u&&u._subpages.length){if(!u.getSubpage(c)){var l=new u._subpageClass(t.extend({},s),r);r.append(l),u.registerSubpage(c,l)
  }u.setCurrentSubpage(u.getSubpage(c)),n=u._previousSubpage,i=u._currentSubpage,a==o?u.switchSubpage(n,i,e):o==r.ec&&(t.each(n==i?[n]:[n,i],function(t,n){n&&n.onsubpagebeforechange&&n.onsubpagebeforechange(e),n&&n.onsubpageafterchange&&n.onsubpageafterchange(e)}),u.recycleSubpage())}},getSubpageManager:function(t){var e,n=this;return(e=n.subpageManager)?e:e=n.subpageManager=new rocket.subpagemanager(t,n)},refreshViewHeight:function(){var t,e=this,n=(new Date).getTime();return rocket.isLoaded?(e.refreshRequestStack=e.refreshRequestStack||[],e.lastRefreshTime=e.lastRefreshTime||n,t=e.refreshRequestStack,n-e.lastRefreshTime<1e3&&e.isNotFirstRefresh?void t.push(1):(t.length=0,setTimeout(function(){e.refreshHeight&&e.refreshHeight(),e.lastRefreshTime=(new Date).getTime(),setTimeout(function(){t.length>0&&(t.length=0,e.refreshHeight&&e.refreshHeight())
  },1e3)},0),void(e.isNotFirstRefresh=!0))):void setTimeout(function(){e.refreshViewHeight()},200)},tip:function(){rocket.utils.tip.apply(window,arguments)},show:function(){var t=this;setTimeout(function(){t.$el&&t.$el.show(),t.onsubviewshow&&t.onsubviewshow()},0)},hide:function(){this.$el.hide()},navigate:function(t){Backbone.history.navigate(t,{trigger:!0})}})}(Zepto),function(){rocket.collection=Backbone.Collection.extend({initialize:function(){}})}(Zepto),function(){rocket.model=Backbone.Model.extend({initialize:function(){}})
  }(Zepto),function(t){rocket.pageview=rocket.baseview.extend({initialize:function(t,e){var n=this;if(!e)throw Error("pageview creation: must supply non-empty action parameter");n.action=e,n._tops={},n._currentLogicString=n._getLogicString(t),rocket.baseview.prototype.initialize.call(n,t,null)},isActivePage:function(){var t=this;return"block"==t.$el.css("display")},_getLogicString:function(e){return t.param(e||{},!0)||"__empty_logic_string__"},savePos:function(){var t=this;t._tops[t._currentLogicString]=window.scrollY
  },restorePos:function(t,e){var n=this,i=n._currentLogicString=n._getLogicString(t);setTimeout(function(){window.scrollTo(0,n._tops[i]||e||0)},0)}})}(Zepto),function(){rocket.subpageview=rocket.baseview.extend({initialize:function(t,e){if(!(e instanceof rocket.baseview))throw Error("rocket.subpageview creation: must supply parentView, which is an instance of rocket.baseview");rocket.baseview.prototype.initialize.call(this,t,e)},isActiveSubpage:function(){var t=this;return"block"==t.$el.css("display")
  }})}(Zepto),function(t){rocket.router=Backbone.Router.extend({initialize:function(){this.views={},this.currentView=null,this.previousView=null,this.loadingModules={},this.actionCallbacks={},this.init&&this.init()},routes:{},pageOrder:[],defaultPageTransition:"simple",pageTransition:{},doAction:function(t,e){function n(){a=r.views[t]=new rocket.pageview[t](e,t)}function i(){r.previousView=r.currentView,r.currentView=a,r.trigger("routechange",{from:r.previousView,to:r.currentView}),r.switchPage(r.previousView,r.currentView,e)
  }var r=this,a=r.views[t],o=r.loadingModules,s=r.actionCallbacks;if(s[t]={da:i,gp:n},!a){if(!rocket.pageview[t])return void(o[t]||(o[t]=1,include(t,function(){setTimeout(function(){s[t].gp(),s[t].da(),o[t]=0},100)})));if(o[t])return;s[t].gp()}s[t].da()},switchPage:function(e,n,i){var r,a,o=this,s=0,c=o.pageOrder,u=e&&e.action||null,l=n&&n.action||null;null!==u&&null!==l&&u!==l&&-1!=(r=c.indexOf(u))&&-1!=(a=c.indexOf(l))&&(s=r>a?2:1),o.enablePositionRestore&&e&&e.savePos(),t.each(e==n?[e]:[e,n],function(t,e){e&&e.trigger("pagebeforechange",{from:o.previousView,to:o.currentView,params:i})
  }),o.doAnimation(e,n,s,function(){o.enablePositionRestore&&n&&n.restorePos(i),t.each(e==n?[e]:[e,n],function(t,e){e&&e.trigger("pageafterchange",{from:o.previousView,to:o.currentView,params:i})})})},doAnimation:function(t,e,n,i){var r,a=this;(r=a._selectAnimation(t&&t.action||null,e&&e.action||null)||rocket["pageanimation_"+a.defaultPageTransition].animate)(t&&t.el,e&&e.el,n,i)},_selectAnimation:function(t,e){if(null!=t&&null!=e){var n,i=this;return n=i.pageTransition[t+"-"+e]||i.pageTransition[e+"-"+t],rocket["pageanimation_"+n]&&rocket["pageanimation_"+n].animate
  }}})}(Zepto),function(){rocket.subview=rocket.baseview.extend({initialize:function(t,e){if(!(e instanceof rocket.baseview))throw Error("rocket.subview creation: must supply parentView, which is an instance of rocket.baseview");rocket.baseview.prototype.initialize.call(this,t,e)}})}(Zepto),function(t){rocket.globalview=rocket.baseview.extend({initialize:function(t,e){var n=this;if(!e||!e instanceof rocket.router)throw Error("globalview creation: must supply an instance of rocket.router");n.router=e,n.router.on("routechange",n._onroutechange,n),rocket.baseview.prototype.initialize.call(n,t,null)
  },isActivePage:function(){return!1},_onroutechange:function(e){var n=this;e.from,e.to,e.pageviews,n.trigger("routechange",t.extend({},e))},triggerPageEvent:function(e,n,i){var r,a=this,o=e.split(/\s*,\s*/);t.each(o,function(t,e){r=a.router.views[e],r&&r.trigger(n,i)})},getCurrentAction:function(){return this.router&&this.router.currentView.action||""}})}(Zepto),function(t){rocket.subpagemanager=function(t,e){var n=this,i=t||{};n._subpageClass=i.subpageClass||null,n.MAX_SUBPAGES=i.maxSubpages||3,n.subpageTransition=i.subpageTransition||"slide",n.subpageManagerView=e,n._subpages=[],n._currentSubpage=null,n._previousSubpage=null,n.defaultSubpageTransition="slide"
  },rocket.subpagemanager.prototype={switchSubpage:function(e,n,i){var r=this,a=0;a=r.subpageManagerView.getSubpageSwitchDir?r.subpageManagerView.getSubpageSwitchDir(e,n):r.getSubpageSwitchDir(e,n),t.each(e==n?[e]:[e,n],function(t,e){e&&e.onsubpagebeforechange&&e.onsubpagebeforechange(i)}),r.doSubpageAnimation(e,n,a,function(){t.each(e==n?[e]:[e,n],function(t,e){e&&e.onsubpageafterchange&&e.onsubpageafterchange(i)}),r.recycleSubpage()})},getSubpageSwitchDir:function(t,e){for(var n=this,i=0,r=n._subpages,a=t&&t.getFeatureString()||null,o=e&&e.getFeatureString()||null,s=-1,c=-1,u=0;u<r.length;u++)r[u].name==a&&(s=u),r[u].name==o&&(c=u);
  return null!==a&&null!==o&&a!==o&&-1!=s&&-1!=c&&(i=s>c?2:1),i},doSubpageAnimation:function(t,e,n,i){var r,a=this;(r=rocket["pageanimation_"+a.subpageTransition].animate)(t&&t.el,e&&e.el,n,i)},registerSubpage:function(t,e){var n=this;n.getSubpage(t)||n._subpages.push({name:t,subpage:e})},getSubpage:function(t){for(var e=this,n=e._subpages,i=0,r=n.length;r>i;i++)if(n[i].name==t)return n[i].subpage},setCurrentSubpage:function(t){var e=this;if(!(t instanceof rocket.baseview))throw Error("error in method setCurrentSubpage: subpage is not an instance of rocket.baseview");
  t!=e._currentSubpage&&(e._previousSubpage=e._currentSubpage,e._currentSubpage=t)},recycleSubpage:function(){for(var t,e=this,n=e._subpages;n.length>e.MAX_SUBPAGES;)t=n.shift(),t.subpage==e._currentSubpage?e._subpages.push(t):t.subpage.destroy()}}}(Zepto),function(t){function e(t,e,n){return"translate"+(rocket.has3d?"3d":"")+"("+t+"px, "+e+"px"+(rocket.has3d?", "+n+"px)":")")}rocket.pageanimation_dropdown={},rocket.pageanimation_dropdown.animate=function(n,i,r,a,o){if(0===r)return n!=i&&(n&&t(n).hide(),setTimeout(function(){i&&t(i).show()
  },0)),void(a&&a());o=!0,i=t(i),n=t(n);var s=document.documentElement.clientHeight,s=t(window).height();1==r?(n.css("z-index",1e3),i.css("z-index",999)):(n.css("z-index",999),i.css("z-index",1e3)),n.css({"-webkit-transition-property":"-webkit-transform","-webkit-transform":e(0,0,0),"-webkit-transition-duration":"0ms","-webkit-transition-timing-function":"ease-out","-webkit-transition-delay":"initial"}),i.css({"-webkit-transition-property":"-webkit-transform","-webkit-transform":e(0,1===r?"0":"-"+s,0),"-webkit-transition-duration":"0ms","-webkit-transition-timing-function":"ease-out","-webkit-transition-delay":"initial",display:"block"}),setTimeout(function(){function t(){o?(n.css({display:"none","-webkit-transform":e(0,0,0),"-webkit-transition-duration":"0ms"}),i.css({display:"block","-webkit-transform":e(0,0,0),"-webkit-transition-duration":"0ms"})):(n.css({display:"none"}),i.css({display:"block"}))
  }1==r?n.css({"-webkit-transform":e(0,-s,0),"-webkit-transition-duration":"450ms"}):i.css({"-webkit-transform":e(0,0,0),"-webkit-transition-duration":"450ms"}),setTimeout(function(){setTimeout(function(){t(),a&&a()},0)},500)},0)}}(Zepto),function(t){rocket.pageanimation_fade={},rocket.pageanimation_fade.animate=function(e,n,i,r){var a=e&&t(e),o=n&&t(n);n&&(e&&e!=n?(a.hide(),o.show(),o.css({opacity:.05}),o.animate({opacity:1},600,"ease-in",r)):(o.show(),r&&r()))}}(Zepto),function(){rocket.pageanimation_simple={},rocket.pageanimation_simple.animate=function(t,e,n,i){t!=e&&(t&&(t.style.display="none"),setTimeout(function(){e&&(e.style.display="block")
  },0)),i&&i()}}(Zepto),function(t){function e(t,e,n){return"translate"+(rocket.has3d?"3d":"")+"("+t+"px, "+e+"px"+(rocket.has3d?", "+n+"px)":")")}rocket.pageanimation_slide={},rocket.pageanimation_slide.animate=function(n,i,r,a,o){if(0===r)return n!=i&&(n&&t(n).hide(),setTimeout(function(){i&&t(i).show()},0)),void(a&&a());o=!0,i=t(i),n=t(n);var s=document.documentElement.clientWidth;n.css({"-webkit-transition-property":"-webkit-transform","-webkit-transform":e(0,0,0),"-webkit-transition-duration":"0ms","-webkit-transition-timing-function":"ease-out","-webkit-transition-delay":"initial"}),i.css({"-webkit-transition-property":"-webkit-transform","-webkit-transform":e((1===r?"":"-")+s,0,0),"-webkit-transition-duration":"0ms","-webkit-transition-timing-function":"ease-out","-webkit-transition-delay":"initial",display:"block"}),setTimeout(function(){function t(){o?(n.css({display:"none","-webkit-transform":e(0,0,0),"-webkit-transition-duration":"0ms"}),i.css({display:"block","-webkit-transform":e(0,0,0),"-webkit-transition-duration":"0ms"})):(n.css({display:"none"}),i.css({display:"block"}))
  }i.css({"-webkit-transform":e(0,0,0),"-webkit-transition-duration":"350ms"}),n.css({"-webkit-transform":e((1===r?"-":"")+s,0,0),"-webkit-transition-duration":"350ms"}),setTimeout(function(){setTimeout(function(){t(),a&&a()},0)},400)},0)}}(Zepto);var Canvas=function(t){var e=function(e){if("string"==typeof e&&(e=t(e)),e=t(e)[0],!e||!e.tagName||"canvas"!=e.tagName.toLowerCase())throw new Error("there not a canvas element");this.canvas=e,this.ctx=this.canvas.getContext("2d")};return e.prototype={getContext:function(){return this.ctx
  },getTextWidth:function(t){return this.ctx.measureText(t).width},getWidth:function(){return this.canvas.width},getHeight:function(){return this.canvas.height},strokeStyle:function(t){return t&&(this.ctx.strokeStyle=t),this},fillStyle:function(t){return t&&(this.ctx.fillStyle=t),this},lineCap:function(t){return t&&(this.ctx.lineCap=t),this},lineJoin:function(t){return t&&(this.ctx.lineJoin=t),this},lineWidth:function(t){return"number"==typeof t&&(this.ctx.lineWidth=t),this},rect:function(t,e,n,i){return this.ctx.rect(t,e,n,i),this
  },fillRect:function(t,e,n,i){return this.ctx.fillRect(t,e,n,i),this},strokeRect:function(t,e,n,i){return this.ctx.strokeRect(t,e,n,i),this},clearRect:function(t,e,n,i){return this.ctx.clearRect(t,e,n,i),this},fill:function(){return this.ctx.fill(),this},stroke:function(){return this.ctx.stroke(),this},beginPath:function(){return this.ctx.beginPath(),this},closePath:function(){return this.ctx.closePath(),this},moveTo:function(t,e){return this.ctx.moveTo(t,e),this},lineTo:function(t,e){return this.ctx.lineTo(t,e),this
  },clip:function(){return this.ctx.clip(),this},arc:function(t,e,n,i,r,a){return this.ctx.arc(t,e,n,i,r,a),this},quadraticCurveTo:function(t,e,n,i){return this.ctx.quadraticCurveTo(t,e,n,i),this},bezierCurveTo:function(t,e,n,i,r,a){return this.ctx.bezierCurveTo(t,e,n,i,r,a),this},arcTo:function(t,e,n,i,r){return this.ctx.arcTo(t,e,n,i,r),this},isPointInPath:function(t,e){return this.ctx.isPointInPath(t,e),this},scale:function(t,e){return this.ctx.scale(t,e),this},rotate:function(t){return this.ctx.rotate(t),this
  },translate:function(t,e){return this.ctx.translate(t,e),this},transform:function(t,e,n,i,r,a){return this.ctx.transform(t,e,n,i,r,a),this},setTransform:function(t,e,n,i,r,a){return this.ctx.setTransform(t,e,n,i,r,a),this},font:function(t){return this.ctx.font=t,this},textAlign:function(t){return this.ctx.textAlign=t,this},textBaseline:function(t){return this.ctx.textBaseline=t,this},fillText:function(t,e,n,i){return this.ctx.fillText(t,e,n,i||this.getTextWidth(t)),this},strokeText:function(t,e,n,i){return this.ctx.strokeText(t,e,n,i),this
  },globalAlpha:function(t){return this.ctx.globalAlpha=t,this},globalCompositeOperation:function(t){return this.ctx.globalCompositeOperation=t,this},save:function(){return this.ctx.save(),this},restore:function(){return this.ctx.restore(),this},width:function(t){return t&&(this.canvas.width=t),this},height:function(t){return t&&(this.canvas.height=t),this},css:function(){return t.fn.css.apply(t(this.canvas),arguments),this}},e}(Zepto);!function(t){t.extend(Canvas.prototype,{on:function(e,n){return t(this.canvas).on(e,n),this
  },off:function(e,n){return t(this.canvas).off(e,n),this}})}(Zepto);var LineChart=function(t){function e(t){this.init(t)}var n=e.fn=e.prototype;return t.extend(n,{init:function(e){var n,i=this;if(i.opt={enableGrids:!0,enableAxis:!0,enableBackground:!0,enableLines:!0,enableIntersect:!0,enableLabels:!0,enableLastGrid:!0,enableCurrentValue:!0,enableLastValue:!0,enableFPS:!0,enableShowTail:!1,enableTrendDetect:!1,enableDrag:!0,enableTouchTrace:!0,dragAccelerate:3,canvasWidth:640,canvasHeight:480,step:100,marginTop:20,marginRight:20,marginBottom:20,marginLeft:20,paddingTop:20,paddingRight:20,paddingBottom:20,paddingLeft:20,rangeExpand:.2,backgroundOpacity:.5,backgroundColor:"#7ea4b8",axisOpacity:1,axisLineWidth:2,axisStrokeStyle:"#7591ac",gridOpacity:.4,gridLineWidth:2,gridStrokeStyle:"#f8f8f8",lastGridOpacity:1,lastGridLineWidth:2,lastGridStrokeStyle:"#b2c4d5",lastGridFootSize:10,intersectRadius:8,intersectOpacity:1,intersectLineWidth:2,intersectStrokeStyle:"#ffffff",currentPointOpacity:.5,currentPointtLineWidth:6,currentPointStrokeStyle:"#ffffff",currentPointRadius:10,currentLabelOffsetY:-10,linesOpacity:1,linesLineWidth:2,linesStrokeStyle:"#ffffff",labelFont:"normal normal 28px Serif",labelOpacity:.4,labelLastLableOpacity:1,labelTextAlign:"center",labelTextBaseline:"top",labelFillStyle:"#fffff",labelPaddingTop:8,currentValueFont:"normal normal 28px Arial",currentValueTextAlign:"center",currentValueFillStyle:"#ffffff",currentValueOffsetY:-20,currentValueThreshold:48,lastValueFont:"normal normal 28px Arial",lastValueTextAlign:"center",lastValueBackgroundColor:"#ffffff",lastValueFillStyle:"rgba(0,0,0,0.4)",lastValueOffsetY:-30,lastValueThreshold:58,lastValuePaddingHorizontal:6,lastValuePaddingVertical:6,lastValueHeight:40,lastValueMinWidth:60,data:[],labels:[],canvas:null,initOffsetX:0,noDrawHiddenArea:!0},n=i.opt,t.extend(n,e),!n.data||!n.data.length)throw new Error("opt.data should be supplied");
  if(n.canvas){if(!n.canvas instanceof Canvas)throw new Error("opt.canvas should be an instance of Canvas")}else n.canvas=new Canvas(t("<canvas/>").appendTo("body"));n.drawArea={x:n.marginLeft,y:n.marginTop,w:n.canvasWidth-n.marginLeft-n.marginRight,h:n.canvasHeight-n.marginTop-n.marginBottom},n.enableShowTail&&n.data.length>1?(n._offsetX=n.drawArea.w-n.paddingLeft-n.paddingRight-n.step*(n.data.length-1)-n.step/2,n._currentPoint=1+Math.abs(parseInt((n._offsetX-n.initOffsetX)/n.step))):(n._offsetX=n.initOffsetX,n._currentPoint=0),n._currentPointThreshold=parseInt(n.step/2),n.range=get_data_range(n.data),i.fixRange(),n.ratio=n.range.span/(n.drawArea.h-n.paddingTop-n.paddingBottom),i.initCanvas()
  },fixRange:function(){var t=this,e=t.opt,n=e.range.span;e.range.span+=n*e.rangeExpand,e.range.min-=n*e.rangeExpand/2}}),e}(Zepto);LineChart.fn.initCanvas=function(){var t=this,e=t.opt;e.canvas.width(e.canvasWidth).height(e.canvasHeight).css({width:e.canvasWidth/2+"px",height:e.canvasHeight/2+"px"})},LineChart.fn.initCoordinates=function(){for(var t=this,e=t.opt,n=e.X=[],i=e.Y=[],r=0,a=0;a<e.data.length;r+=e.step,a++)n.push(e.drawArea.x+e.paddingLeft+r),i.push(e.drawArea.y+e.drawArea.h-e.paddingBottom-(e.data[a]-e.range.min)/e.ratio);
  for(var r=0;r<n.length;r++)n[r]+=e._offsetX;return t},LineChart.fn.draw=function(){var t=this,e=t.opt;return t.isFakeDraw||$.os.ios?(t.checkTime(),t.isRedraw&&e.canvas.clearRect(0,0,e.canvasWidth,e.canvasHeight),void t.initCoordinates().drawBackground().drawAxis().drawGrids().drawLastGrid().drawLines().drawIntersections().drawLabels().drawCurrentValue().drawLastValue().showFPS().setupDrag()):(t.isFakeDraw=!0,t.fakeDraw(),void setTimeout(function(){t.draw()},10))},LineChart.fn.fakeDraw=function(){var t=this,e=t.opt;
  e.canvas.clearRect(0,0,e.canvasWidth,e.canvasHeight)},LineChart.fn.redraw=function(t){var e=this,n=e.opt;$.extend(n,t),e.isFakeDraw=!1,e.draw()},LineChart.fn.drawAxis=function(){var t=this,e=t.opt,n=e.canvas;return e.X,e.Y,e.enableAxis?(n.save().globalAlpha(e.axisOpacity).lineWidth(e.axisLineWidth).strokeStyle(e.axisStrokeStyle).beginPath().moveTo(e.drawArea.x+e.paddingLeft+.5,e.drawArea.y+e.paddingTop+.5).lineTo(e.drawArea.x+e.paddingLeft+.5,e.drawArea.y+e.drawArea.h-e.paddingBottom+.5).lineTo(e.drawArea.x+e.drawArea.w-e.paddingRight-.5,e.drawArea.y+e.drawArea.h-e.paddingBottom+.5).stroke().restore(),this):this
  },LineChart.fn.drawBackground=function(){var t=this,e=t.opt;return e.enableBackground?(e.canvas.save().globalAlpha(e.backgroundOpacity).fillStyle(e.backgroundColor).fillRect(e.drawArea.x,e.drawArea.y,e.drawArea.w,e.drawArea.h).restore(),this):this},LineChart.fn.drawCurrentValue=function(){var t,e,n,i=this,r=i.opt,a=r.canvas,o=r.X,s=r.Y,c=r.T,u=r._currentPoint,l="bottom",d=r.currentValueOffsetY;return r.enableCurrentValue&&u!=r.data.length-1?(t=o[u],e=s[u],c&&(n=c[u]),r.enableTrendDetect?"inc"==n&&(l="top",d*=-1):e-r.drawArea.y-r.paddingTop<r.currentValueThreshold&&(l="top",d*=-1),a.save().beginPath().rect(r.drawArea.x+r.paddingLeft,r.drawArea.y+r.paddingTop,r.drawArea.w-r.paddingLeft-r.paddingRight,r.drawArea.h-r.paddingTop-r.paddingBottom).clip().font(r.currentValueFont).textAlign(r.currentValueTextAlign).textBaseline(l).fillStyle(r.currentValueFillStyle).fillText(parseInt(r.data[u]),t,e+d).restore(),i):i
  },LineChart.fn.drawGrids=function(){var t=this,e=t.opt,n=e.canvas,i=e.X,r=e.Y;if(!e.enableGrids)return this;n.save().beginPath().rect(e.drawArea.x+e.paddingLeft,e.drawArea.y+e.paddingTop,e.drawArea.w-e.paddingLeft-e.paddingRight,e.drawArea.h-e.paddingTop-e.paddingBottom).clip().globalAlpha(e.gridOpacity).lineWidth(e.gridLineWidth).strokeStyle(e.gridStrokeStyle);for(var a=0;a<i.length;a++)e.noDrawHiddenArea&&(i[a]<0&&i[a]+e.step<0||i[a]>e.canvasWidth&&i[a]-e.canvasWidth>e.step)||n.beginPath().moveTo(i[a]+.5,r[a]+e.intersectRadius+.5).lineTo(i[a]+.5,e.drawArea.y+e.drawArea.h-e.paddingBottom+.5).stroke();
  return n.restore(),this},LineChart.fn.drawIntersections=function(){var t=this,e=t.opt,n=e.canvas,i=e.X,r=e.Y;if(!e.enableIntersect)return this;n.save().beginPath().rect(e.drawArea.x+e.paddingLeft,e.drawArea.y+e.paddingTop,e.drawArea.w-e.paddingLeft-e.paddingRight,e.drawArea.h-e.paddingTop-e.paddingBottom).clip().globalAlpha(e.intersectOpacity).lineWidth(e.intersectLineWidth).strokeStyle(e.intersectStrokeStyle).fillStyle(e.intersectStrokeStyle);for(var a=0;a<i.length;a++)e.noDrawHiddenArea&&(i[a]<0&&i[a]+e.step<0||i[a]>e.canvasWidth&&i[a]-e.canvasWidth>e.step)||(n.beginPath().moveTo(i[a]+e.intersectRadius,r[a]).arc(i[a],r[a],e.intersectRadius,0,2*Math.PI,!1).closePath().stroke(),a==i.length-1&&n.fill());
  return a=e._currentPoint,n.globalAlpha(e.currentPointOpacity).lineWidth(e.currentPointtLineWidth).strokeStyle(e.currentPointStrokeStyle).beginPath().moveTo(i[a]+e.currentPointRadius,r[a]).arc(i[a],r[a],e.currentPointRadius,0,2*Math.PI,!1).closePath().stroke(),n.restore(),this},LineChart.fn.drawLabels=function(){var t,e,n=this,i=n.opt,r=i.canvas,a=i.labels,o=i.drawArea.y+i.drawArea.h-i.paddingBottom;if(!i.enableLabels)return this;t=i.step*(i.data.length-1)/(a.length-1),r.save().beginPath().rect(i.drawArea.x+i.paddingLeft,i.drawArea.y+i.drawArea.h-i.paddingBottom,i.drawArea.w-i.paddingLeft-i.paddingRight,i.paddingBottom).clip().globalAlpha(i.labelOpacity).font(i.labelFont).textAlign(i.labelTextAlign).textBaseline(i.labelTextBaseline).fillStyle(i.labelFillStyle);
  for(var s=0,e=i.drawArea.x+i.paddingLeft+i._offsetX;s<a.length-1;s++,e+=t)i.noDrawHiddenArea&&(0>e&&0>e+t||e>i.canvasWidth&&e-i.canvasWidth>t)||r.fillText(a[s],e,o+i.labelPaddingTop);return i.noDrawHiddenArea&&(0>e&&0>e+t||e>i.canvasWidth&&e-i.canvasWidth>t)||r.globalAlpha(i.labelLastLabelOpacity).fillText(a[s],e,o+i.labelPaddingTop),r.restore(),this},LineChart.fn.drawLastGrid=function(){var t=this,e=t.opt,n=e.canvas,i=e.X,r=e.Y,a=i.length-1;return!e.enableLastGrid||0>a?t:e.noDrawHiddenArea&&(i[a]<0&&i[a]+e.step<0||i[a]>e.canvasWidth&&i[a]-e.canvasWidth>e.step)?t:(n.save().beginPath().rect(e.drawArea.x+e.paddingLeft,e.drawArea.y+e.paddingTop,e.drawArea.w-e.paddingLeft-e.paddingRight,e.drawArea.h-e.paddingTop-e.paddingBottom+e.lastGridLineWidth).clip().globalAlpha(e.lastGridOpacity).lineWidth(e.lastGridLineWidth).strokeStyle(e.lastGridStrokeStyle).beginPath().moveTo(i[a]+.5,r[a]+e.intersectRadius+.5).lineTo(i[a]+.5,e.drawArea.y+e.drawArea.h-e.paddingBottom+.5).moveTo(i[a]+.5-e.lastGridFootSize,e.drawArea.y+e.drawArea.h-e.paddingBottom+.5).lineTo(i[a]+.5+e.lastGridFootSize,e.drawArea.y+e.drawArea.h-e.paddingBottom+.5).stroke().restore(),this)
  },LineChart.fn.drawLastValue=function(){var t,e,n,i,r,a,o,s=this,c=s.opt,u=c.canvas,l=c.X,d=c.Y,h=c.data.length-1,f="top",p=c.lastValueOffsetY,g=c.lastValueHeight,m=parseInt(c.data[h]);return c.enableLastValue?(t=l[h],e=d[h],n=p-g,i=n+g,r=n+g+7,e-c.drawArea.y-c.paddingTop<c.lastValueThreshold&&(n=-p,i=n,r=n-7),u.save().beginPath().rect(c.drawArea.x+c.paddingLeft,c.drawArea.y+c.paddingTop,c.drawArea.w-c.paddingLeft-c.paddingRight,c.drawArea.h-c.paddingTop-c.paddingBottom).clip().font(c.lastValueFont).textAlign(c.lastValueTextAlign).textBaseline(f).fillStyle(c.lastValueBackgroundColor).strokeStyle(c.lastValueBackgroundColor),a=u.getTextWidth(m),o=a+2*c.lastValuePaddingHorizontal,o<c.lastValueMinWidth&&(o=c.lastValueMinWidth),u.beginPath().rect(t-o/2,e+n,o,g).fill().beginPath().moveTo(t-5,e+i).lineTo(t,e+r).lineTo(t+5,e+i).closePath().fill().fillStyle(c.lastValueFillStyle).fillText(m,t,e+n+c.lastValuePaddingVertical).restore(),s):s
  },LineChart.fn.drawLines=function(){var t=this,e=t.opt,n=e.canvas,i=e.X,r=e.Y,a=e.T=[];if(!e.enableLines)return this;n.save().beginPath().rect(e.drawArea.x+e.paddingLeft,e.drawArea.y+e.paddingTop,e.drawArea.w-e.paddingLeft-e.paddingRight,e.drawArea.h-e.paddingTop-e.paddingBottom).clip().globalAlpha(e.linesOpacity).lineWidth(e.linesLineWidth).strokeStyle(e.linesStrokeStyle);for(var o,s,c,u,l={x:0,y:0},d={x:0,y:0},h=1;h<i.length;h++)e.noDrawHiddenArea&&(i[h-1]<0&&i[h-1]+e.step<0||i[h]>e.canvasWidth&&i[h]-e.canvasWidth>e.step)||(o={a:i[h-1],c:r[h-1],r:e.intersectRadius},s={a:i[h],c:r[h],r:e.intersectRadius},c=get_line_with_2points({x:i[h-1],y:r[h-1]},{x:i[h],y:r[h]}),a[h-1]=r[h]-r[h-1]>=0?"dec":"inc",u=get_intersect_between_line_and_circle(c,o),u&&(l=2==u.length?u[1]:u[0]),u=get_intersect_between_line_and_circle(c,s),u&&(d=u[0]),n.beginPath().moveTo(l.x,l.y).lineTo(d.x,d.y).stroke());
  return a[h-1]="inc",n.restore(),t},LineChart.fn.checkTime=function(){var t=this;return t.timeRenderStart=(new Date).getTime(),t},LineChart.fn.showFPS=function(){var t,e=this,n=e.opt,i=(new Date).getTime(),r=1/(i+1-e.timeRenderStart)*1e3;return n.enableFPS?(t=e.fpsArr=e.fpsArr||[],t.push(r),e.$info=e.$info||$('<div class="__line-chart-fps"></div>').appendTo("body").css({position:"absolute",display:"none",top:"5px",right:"10px",padding:"0 5px","background-color":"rgba(0,0,0,0.3)",height:"28px",color:"#fff",font:"normal normal 14px/28px Arial"}),setTimeout(function(){for(var n=0,i=0,r=0;r<t.length;r++)n+=t[r];
  t.length&&(i=n/t.length),e.$info.show().html("fps: "+parseInt(i))},1e3),e):e},LineChart.fn.setupDrag=function(){var t,e,n,i=this,r=i.opt,a=r.canvas;return!r.enableDrag||i.isRedraw||r.data.length<=1?void 0:(i.isRedraw=!0,a.on("touchstart",function(e){t=e.targetTouches[0].clientX,n=!1}).on("touchmove",function(a){var o,s,c,u=a.targetTouches[0],l=0;a.preventDefault(),r.enableTouchTrace&&(o=u.clientX-t,t=u.clientX,i.isBusy||(i.isBusy=!0,setTimeout(function(){i.isBusy=!1},40),s=r._offsetX+r.dragAccelerate*o,c=r.step*(r.data.length-1),e=r._offsetX,r._offsetX=s<r.initOffsetX&&s+c<=r.step+r.initOffsetX?-c+r.step+r.initOffsetX:s>=r.initOffsetX?r.initOffsetX:s,Math.abs((r._offsetX-r.initOffsetX)%r.step)<r._currentPointThreshold&&(l=Math.abs(parseInt((r._offsetX-r.initOffsetX)/r.step)),r._currentPoint=0>o?l+1:l,r._currentPoint==r.data.length-1&&r._currentPoint>=0&&r._currentPoint--),e!=r._offsetX&&(i.draw(),n=!0)))
  }).on("touchend",function(e){var n,a=e.changedTouches[0];"function"==typeof r.onafterdrag&&setTimeout(function(){r.onafterdrag()},0),r.enableTouchTrace||(n=a.clientX-t,r._offsetX+=n,i.draw())}),this)},!function(t,e){"function"==typeof define&&(define.amd||define.cmd)?define(function(){return e(t)}):e(t,!0)}(this,function(t,e){function n(e,n,i){t.WeixinJSBridge?WeixinJSBridge.invoke(e,r(n),function(t){o(e,t,i)}):u(e,i)}function i(e,n,i){t.WeixinJSBridge?WeixinJSBridge.on(e,function(t){i&&i.trigger&&i.trigger(t),o(e,t,n)
  }):i?u(e,i):u(e,n)}function r(t){return t=t||{},t.appId=k.appId,t.verifyAppId=k.appId,t.verifySignType="sha1",t.verifyTimestamp=k.timestamp+"",t.verifyNonceStr=k.nonceStr,t.verifySignature=k.signature,t}function a(t){return{timeStamp:t.timestamp+"",nonceStr:t.nonceStr,"package":t.package,paySign:t.paySign,signType:t.signType||"SHA1"}}function o(t,e,n){var i,r,a;switch(delete e.err_code,delete e.err_desc,delete e.err_detail,i=e.errMsg,i||(i=e.err_msg,delete e.err_msg,i=s(t,i,n),e.errMsg=i),n=n||{},n._complete&&(n._complete(e),delete n._complete),i=e.errMsg||"",k.debug&&!n.isInnerInvoke&&alert(JSON.stringify(e)),r=i.indexOf(":"),a=i.substring(r+1)){case"ok":n.success&&n.success(e);
  break;case"cancel":n.cancel&&n.cancel(e);break;default:n.fail&&n.fail(e)}n.complete&&n.complete(e)}function s(t,e){var n,i,r,a;if(e){switch(n=e.indexOf(":"),t){case p.config:i="config";break;case p.openProductSpecificView:i="openProductSpecificView";break;default:i=e.substring(0,n),i=i.replace(/_/g," "),i=i.replace(/\b\w+\b/g,function(t){return t.substring(0,1).toUpperCase()+t.substring(1)}),i=i.substring(0,1).toLowerCase()+i.substring(1),i=i.replace(/ /g,""),-1!=i.indexOf("Wcpay")&&(i=i.replace("Wcpay","WCPay")),r=g[i],r&&(i=r)
  }a=e.substring(n+1),"confirm"==a&&(a="ok"),"failed"==a&&(a="fail"),-1!=a.indexOf("failed_")&&(a=a.substring(7)),-1!=a.indexOf("fail_")&&(a=a.substring(5)),a=a.replace(/_/g," "),a=a.toLowerCase(),("access denied"==a||"no permission to execute"==a)&&(a="permission denied"),"config"==i&&"function not exist"==a&&(a="ok"),e=i+":"+a}return e}function c(t){var e,n,i,r;if(t){for(e=0,n=t.length;n>e;++e)i=t[e],r=p[i],r&&(t[e]=r);return t}}function u(t,e){if(k.debug&&!e.isInnerInvoke){var n=g[t];n&&(t=n),e&&e._complete&&delete e._complete,console.log('"'+t+'",',e||"")
  }}function l(){if(!("6.0.2">x||S.systemType<0)){var t=new Image;S.appId=k.appId,S.initTime=T.initEndTime-T.initStartTime,S.preVerifyTime=T.preVerifyEndTime-T.preVerifyStartTime,A.getNetworkType({isInnerInvoke:!0,success:function(e){S.networkType=e.networkType;var n="https://open.weixin.qq.com/sdk/report?v="+S.version+"&o="+S.isPreVerifyOk+"&s="+S.systemType+"&c="+S.clientVersion+"&a="+S.appId+"&n="+S.networkType+"&i="+S.initTime+"&p="+S.preVerifyTime+"&u="+S.url;t.src=n}})}}function d(){return(new Date).getTime()
  }function h(e){b&&(t.WeixinJSBridge?e():m.addEventListener&&m.addEventListener("WeixinJSBridgeReady",e,!1))}function f(){A.invoke||(A.invoke=function(e,n,i){t.WeixinJSBridge&&WeixinJSBridge.invoke(e,r(n),i)},A.on=function(e,n){t.WeixinJSBridge&&WeixinJSBridge.on(e,n)})}var p,g,m,v,w,b,y,_,x,T,S,k,E,C,A;return t.jWeixin?void 0:(p={config:"preVerifyJSAPI",onMenuShareTimeline:"menu:share:timeline",onMenuShareAppMessage:"menu:share:appmessage",onMenuShareQQ:"menu:share:qq",onMenuShareWeibo:"menu:share:weiboApp",previewImage:"imagePreview",getLocation:"geoLocation",openProductSpecificView:"openProductViewWithPid",addCard:"batchAddCard",openCard:"batchViewCard",chooseWXPay:"getBrandWCPayRequest"},g=function(){var t,e={};
  for(t in p)e[p[t]]=t;return e}(),m=t.document,v=m.title,w=navigator.userAgent.toLowerCase(),b=-1!=w.indexOf("micromessenger"),y=-1!=w.indexOf("android"),_=-1!=w.indexOf("iphone")||-1!=w.indexOf("ipad"),x=function(){var t=w.match(/micromessenger\/(\d+\.\d+\.\d+)/)||w.match(/micromessenger\/(\d+\.\d+)/);return t?t[1]:""}(),T={initStartTime:d(),initEndTime:0,preVerifyStartTime:0,preVerifyEndTime:0},S={version:1,appId:"",initTime:0,preVerifyTime:0,networkType:"",isPreVerifyOk:1,systemType:_?1:y?2:-1,clientVersion:x,url:encodeURIComponent(location.href)},k={},E={_completes:[]},C={state:0,res:{}},h(function(){T.initEndTime=d()
  }),A={config:function(t){k=t,u("config",t);var e=k.check===!1?!1:!0;h(function(){var t,i,r;if(e)n(p.config,{verifyJsApiList:c(k.jsApiList)},function(){E._complete=function(t){T.preVerifyEndTime=d(),C.state=1,C.res=t},E.success=function(){S.isPreVerifyOk=0},E.fail=function(t){E._fail?E._fail(t):C.state=-1};var t=E._completes;return t.push(function(){k.debug||l()}),E.complete=function(){for(var e=0,n=t.length;n>e;++e)t[e]();E._completes=[]},E}()),T.preVerifyStartTime=d();else{for(C.state=1,t=E._completes,i=0,r=t.length;r>i;++i)t[i]();
  E._completes=[]}}),k.beta&&f()},ready:function(t){0!=C.state?t():(E._completes.push(t),!b&&k.debug&&t())},error:function(t){"6.0.2">x||(-1==C.state?t(C.res):E._fail=t)},checkJsApi:function(t){var e=function(t){var e,n,i=t.checkResult;for(e in i)n=g[e],n&&(i[n]=i[e],delete i[e]);return t};n("checkJsApi",{jsApiList:c(t.jsApiList)},function(){return t._complete=function(t){if(y){var n=t.checkResult;n&&(t.checkResult=JSON.parse(n))}t=e(t)},t}())},onMenuShareTimeline:function(t){i(p.onMenuShareTimeline,{complete:function(){n("shareTimeline",{title:t.title||v,desc:t.title||v,img_url:t.imgUrl,link:t.link||location.href},t)
  }},t)},onMenuShareAppMessage:function(t){i(p.onMenuShareAppMessage,{complete:function(){n("sendAppMessage",{title:t.title||v,desc:t.desc||"",link:t.link||location.href,img_url:t.imgUrl,type:t.type||"link",data_url:t.dataUrl||""},t)}},t)},onMenuShareQQ:function(t){i(p.onMenuShareQQ,{complete:function(){n("shareQQ",{title:t.title||v,desc:t.desc||"",img_url:t.imgUrl,link:t.link||location.href},t)}},t)},onMenuShareWeibo:function(t){i(p.onMenuShareWeibo,{complete:function(){n("shareWeiboApp",{title:t.title||v,desc:t.desc||"",img_url:t.imgUrl,link:t.link||location.href},t)
  }},t)},startRecord:function(t){n("startRecord",{},t)},stopRecord:function(t){n("stopRecord",{},t)},onVoiceRecordEnd:function(t){i("onVoiceRecordEnd",t)},playVoice:function(t){n("playVoice",{localId:t.localId},t)},pauseVoice:function(t){n("pauseVoice",{localId:t.localId},t)},stopVoice:function(t){n("stopVoice",{localId:t.localId},t)},onVoicePlayEnd:function(t){i("onVoicePlayEnd",t)},uploadVoice:function(t){n("uploadVoice",{localId:t.localId,isShowProgressTips:0==t.isShowProgressTips?0:1},t)},downloadVoice:function(t){n("downloadVoice",{serverId:t.serverId,isShowProgressTips:0==t.isShowProgressTips?0:1},t)
  },translateVoice:function(t){n("translateVoice",{localId:t.localId,isShowProgressTips:0==t.isShowProgressTips?0:1},t)},chooseImage:function(t){n("chooseImage",{scene:"1|2",count:t.count||9,sizeType:t.sizeType||["original","compressed"]},function(){return t._complete=function(t){if(y){var e=t.localIds;e&&(t.localIds=JSON.parse(e))}},t}())},previewImage:function(t){n(p.previewImage,{current:t.current,urls:t.urls},t)},uploadImage:function(t){n("uploadImage",{localId:t.localId,isShowProgressTips:0==t.isShowProgressTips?0:1},t)
  },downloadImage:function(t){n("downloadImage",{serverId:t.serverId,isShowProgressTips:0==t.isShowProgressTips?0:1},t)},getNetworkType:function(t){var e=function(t){var e,n,i,r=t.errMsg;if(t.errMsg="getNetworkType:ok",e=t.subtype,delete t.subtype,e)t.networkType=e;else switch(n=r.indexOf(":"),i=r.substring(n+1)){case"wifi":case"edge":case"wwan":t.networkType=i;break;default:t.errMsg="getNetworkType:fail"}return t};n("getNetworkType",{},function(){return t._complete=function(t){t=e(t)},t}())},openLocation:function(t){n("openLocation",{latitude:t.latitude,longitude:t.longitude,name:t.name||"",address:t.address||"",scale:t.scale||28,infoUrl:t.infoUrl||""},t)
  },getLocation:function(t){t=t||{},n(p.getLocation,{type:t.type||"wgs84"},function(){return t._complete=function(t){delete t.type},t}())},hideOptionMenu:function(t){n("hideOptionMenu",{},t)},showOptionMenu:function(t){n("showOptionMenu",{},t)},closeWindow:function(t){t=t||{},n("closeWindow",{immediate_close:t.immediateClose||0},t)},hideMenuItems:function(t){n("hideMenuItems",{menuList:t.menuList},t)},showMenuItems:function(t){n("showMenuItems",{menuList:t.menuList},t)},hideAllNonBaseMenuItem:function(t){n("hideAllNonBaseMenuItem",{},t)
  },showAllNonBaseMenuItem:function(t){n("showAllNonBaseMenuItem",{},t)},scanQRCode:function(t){t=t||{},n("scanQRCode",{needResult:t.needResult||0,scanType:t.scanType||["qrCode","barCode"]},function(){return t._complete=function(t){var e,n;_&&(e=t.resultStr,e&&(n=JSON.parse(e),t.resultStr=n&&n.scan_code&&n.scan_code.scan_result))},t}())},openProductSpecificView:function(t){n(p.openProductSpecificView,{pid:t.productId,view_type:t.viewType||0},t)},addCard:function(t){var e,i,r,a,o=t.cardList,s=[];for(e=0,i=o.length;i>e;++e)r=o[e],a={card_id:r.cardId,card_ext:r.cardExt},s.push(a);
  n(p.addCard,{card_list:s},function(){return t._complete=function(t){var e,n,i,r=t.card_list;if(r){for(r=JSON.parse(r),e=0,n=r.length;n>e;++e)i=r[e],i.cardId=i.card_id,i.cardExt=i.card_ext,i.isSuccess=i.is_succ?!0:!1,delete i.card_id,delete i.card_ext,delete i.is_succ;t.cardList=r,delete t.card_list}},t}())},chooseCard:function(t){n("chooseCard",{app_id:k.appId,location_id:t.shopId||"",sign_type:t.signType||"SHA1",card_id:t.cardId||"",card_type:t.cardType||"",card_sign:t.cardSign,time_stamp:t.timestamp+"",nonce_str:t.nonceStr},function(){return t._complete=function(t){t.cardList=t.choose_card_info,delete t.choose_card_info
  },t}())},openCard:function(t){var e,i,r,a,o=t.cardList,s=[];for(e=0,i=o.length;i>e;++e)r=o[e],a={card_id:r.cardId,code:r.code},s.push(a);n(p.openCard,{card_list:s},t)},chooseWXPay:function(t){n(p.chooseWXPay,a(t),t)}},e&&(t.wx=t.jWeixin=A),A)}),!function(t){t.bdNativeShare=function(e){var n={lower:"http://news.baidu.com/resource/js/3gimg.qq.com_html5_js_qb.js",higher:"http://jsapi.qq.com/get?api=app.share"},i={qq:{forbid:0,lower:1,higher:2},uc:{forbid:0,allow:1}},r=navigator.appVersion,a=r.split("MQQBrowser/").length>1?i.qq.higher:i.qq.forbid,o=r.split("UCBrowser/").length>1?i.uc.allow:i.uc.forbid,s={uc:"",qq:""},c=!1;
  return e=e||{},this.url=e.url||document.location.href||"",this.title=e.title||document.title||"",this.desc=e.desc||this.title,this.img=e.img||document.getElementsByTagName("img").length>0&&document.getElementsByTagName("img")[0].src||"",this.img_title=e.img_title||this.title,this.from=e.from||t.location.host||"",this.ucAppList={sinaWeibo:["kSinaWeibo","SinaWeibo",11,"新浪微博"],weixin:["kWeixin","WechatFriends",1,"微信好友"],weixinFriend:["kWeixinFriend","WechatTimeline","8","微信朋友圈"],QQ:["kQQ","QQ","4","QQ好友"],QZone:["kQZone","QZone","3","QQ空间"]},this.share=function(e,n,r){if(this.isQQUC){e.preventDefault(),r=r||{};
  var s=r.url||this.url,u=r.title||this.title,l=r.desc||u,d=r.img||this.img,h=r.img_title||u,f=r.from||this.from;if(o)n=""==n?"":"iPhone"==platform_os?this.ucAppList[n][0]:this.ucAppList[n][1],"QZone"==n&&(B="mqqapi://share/to_qzone?src_type=web&version=1&file_type=news&req_type=1&image_url="+d+"&title="+u+"&description="+l+"&url="+s+"&app_name="+f,k=document.createElement("div"),k.style.visibility="hidden",k.innerHTML='<iframe src="'+B+'" scrolling="no" width="1" height="1"></iframe>',document.body.appendChild(k),setTimeout(function(){k&&k.parentNode&&k.parentNode.removeChild(k)
  },5e3)),"undefined"!=typeof ucweb?ucweb.startRequest("shell.page_share",[u,u,s,n,"","@"+f,""]):"undefined"!=typeof ucbrowser&&ucbrowser.web_share(u,u,s,n,"","@"+f,"");else if(a&&!c){n=""==n?"":this.ucAppList[n][2];var p={url:s,title:u,description:l,img_url:d,img_title:h,to_app:n,cus_txt:"请输入此时此刻想要分享的内容"};p=""==n?"":p,"undefined"!=typeof browser?"undefined"!=typeof browser.app&&a==i.qq.higher&&browser.app.share(p):"undefined"!=typeof t.qb&&a==i.qq.lower&&t.qb.share(p)}}},this.isloadqqApi=function(){if(a){var t=s.qq<5.4?n.lower:n.higher,e=document.createElement("script"),i=document.getElementsByTagName("body")[0];
  e.setAttribute("src",t),i.appendChild(e)}},this.getPlantform=function(){return ua=navigator.userAgent,ua.indexOf("iPhone")>-1||ua.indexOf("iPod")>-1?"iPhone":"Android"},this.is_weixin=function(){var t=r.toLowerCase();return"micromessenger"==t.match(/MicroMessenger/i)?!0:!1},this.getVersion=function(t){var e=t.split("."),n=parseFloat(e[0]+"."+e[1]);return n},this.isQQUC=!1,this.init=function(){platform_os=this.getPlantform(),s.qq=a?this.getVersion(r.split("MQQBrowser/")[1]):0,s.uc=o?this.getVersion(r.split("UCBrowser/")[1]):0,c=this.is_weixin(),a&&s.qq<5.4&&"iPhone"==platform_os||a&&s.qq<5.3&&"Android"==platform_os?a=i.qq.forbid:a&&s.qq<5.4&&"Android"==platform_os?a=i.qq.lower:o&&(s.uc<10.2&&"iPhone"==platform_os||s.uc<9.7&&"Android"==platform_os)&&(o=i.uc.forbid),this.isloadqqApi(),(a||o)&&(this.isQQUC=!0)
  },this.init(),this}}(window),!function(t,e){function n(t){return""===o?t:(t=t.charAt(0).toUpperCase()+t.substr(1),o+t)}var i=Math,r=[],a=e.createElement("div").style,o=function(){for(var t,e="webkitT,MozT,msT,OT,t".split(","),n=0,i=e.length;i>n;n++)if(t=e[n]+"ransform",t in a)return"t"==e[n]?"webkit":e[n].substr(0,e[n].length-1);return!1}(),s=o?"-"+o.toLowerCase()+"-":"",c=n("transform"),u=n("transitionProperty"),l=n("transitionDuration"),d=n("transformOrigin"),h=n("transitionTimingFunction"),f=(n("transitionDelay"),/android/gi.test(navigator.appVersion)),p=/hp-tablet/gi.test(navigator.appVersion),g=n("perspective")in a,m="ontouchstart"in t&&!p,v=!!o,w=n("transition")in a,b="onorientationchange"in t?"orientationchange":"resize",y=m?"touchstart":"mousedown",_=m?"touchmove":"mousemove",x=m?"touchend":"mouseup",T=m?"touchcancel":"mouseup",S=function(){if(o===!1)return!1;
  var t={"":"transitionend",webkit:"webkitTransitionEnd",Moz:"transitionend",O:"otransitionend",ms:"MSTransitionEnd"};return t[o]}(),k=function(){return t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame||function(t){return setTimeout(t,1)}}(),E=function(){return t.cancelRequestAnimationFrame||t.webkitCancelAnimationFrame||t.webkitCancelRequestAnimationFrame||t.mozCancelRequestAnimationFrame||t.oCancelRequestAnimationFrame||t.msCancelRequestAnimationFrame||clearTimeout
  }(),C=g?" translateZ(0)":"",A=function(n,i){var r,a=this;a.wrapper="object"==typeof n?n:e.getElementById(n),a.wrapper.style.overflow="hidden",a.scroller=a.wrapper.children[0],a.translateZ=C,a.options={hScroll:!0,vScroll:!0,x:0,y:0,bounce:!0,bounceLock:!1,momentum:!0,lockDirection:!0,useTransform:!0,useTransition:!1,topOffset:0,checkDOMChanges:!1,handleClick:!0,onRefresh:null,onBeforeScrollStart:function(t){t.preventDefault()},onScrollStart:null,onBeforeScrollMove:null,onScrollMove:null,onBeforeScrollEnd:null,onScrollEnd:null,onTouchEnd:null,onDestroy:null};
  for(r in i)a.options[r]=i[r];a.x=a.options.x,a.y=a.options.y,a.options.useTransform=v&&a.options.useTransform,a.options.useTransition=w&&a.options.useTransition,a.scroller.style[u]=a.options.useTransform?s+"transform":"top left",a.scroller.style[l]="0",a.scroller.style[d]="0 0",a.options.useTransition&&(a.scroller.style[h]="cubic-bezier(0.33,0.66,0.66,1)"),a.options.useTransform?a.scroller.style[c]="translate("+a.x+"px,"+a.y+"px)"+C:a.scroller.style.cssText+=";position:absolute;top:"+a.y+"px;left:"+a.x+"px",a.refresh(),a._bind(b,t),a._bind(y),a.options.checkDOMChanges&&(a.checkDOMTime=setInterval(function(){a._checkDOMChanges()
  },500))};A.prototype={enabled:!0,x:0,y:0,steps:[],scale:1,currPageX:0,currPageY:0,pagesX:[],pagesY:[],aniTime:null,isStopScrollAction:!1,handleEvent:function(t){var e=this;switch(t.type){case y:if(!m&&0!==t.button)return;e._start(t);break;case _:e._move(t);break;case x:case T:e._end(t);break;case b:e._resize();break;case S:e._transitionEnd(t)}},_checkDOMChanges:function(){this.moved||this.animating||this.scrollerW==this.scroller.offsetWidth*this.scale&&this.scrollerH==this.scroller.offsetHeight*this.scale||this.refresh()
  },_resize:function(){var t=this;setTimeout(function(){t.refresh()},f?200:0)},_pos:function(t,e){t=this.hScroll?t:0,e=this.vScroll?e:0,this.options.useTransform?this.scroller.style[c]="translate("+t+"px,"+e+"px) scale("+this.scale+")"+C:(t=i.round(t),e=i.round(e),this.scroller.style.left=t+"px",this.scroller.style.top=e+"px"),this.x=t,this.y=e},_start:function(e){var n,i,r,a=this,o=m?e.touches[0]:e;a.enabled&&(a.options.onBeforeScrollStart&&a.options.onBeforeScrollStart.call(a,e),a.options.useTransition&&a._transitionTime(0),a.moved=!1,a.animating=!1,a.distX=0,a.distY=0,a.absDistX=0,a.absDistY=0,a.dirX=0,a.dirY=0,a.isStopScrollAction=!1,a.options.momentum&&(a.options.useTransform?(n=getComputedStyle(a.scroller,null)[c].replace(/[^0-9\-.,]/g,"").split(","),i=+n[4],r=+n[5]):(i=+getComputedStyle(a.scroller,null).left.replace(/[^0-9-]/g,""),r=+getComputedStyle(a.scroller,null).top.replace(/[^0-9-]/g,"")),(i!=a.x||r!=a.y)&&(a.isStopScrollAction=!0,a.options.useTransition?a._unbind(S):E(a.aniTime),a.steps=[],a._pos(i,r),a.options.onScrollEnd&&a.options.onScrollEnd.call(a))),a.startX=a.x,a.startY=a.y,a.pointX=o.pageX,a.pointY=o.pageY,a.startTime=e.timeStamp||Date.now(),a.options.onScrollStart&&a.options.onScrollStart.call(a,e),a._bind(_,t),a._bind(x,t),a._bind(T,t))
  },_move:function(t){var e=this,n=m?t.touches[0]:t,r=n.pageX-e.pointX,a=n.pageY-e.pointY,o=e.x+r,s=e.y+a,c=t.timeStamp||Date.now();e.options.onBeforeScrollMove&&e.options.onBeforeScrollMove.call(e,t),e.pointX=n.pageX,e.pointY=n.pageY,(o>0||o<e.maxScrollX)&&(o=e.options.bounce?e.x+r/2:o>=0||e.maxScrollX>=0?0:e.maxScrollX),(s>e.minScrollY||s<e.maxScrollY)&&(s=e.options.bounce?e.y+a/2:s>=e.minScrollY||e.maxScrollY>=0?e.minScrollY:e.maxScrollY),e.distX+=r,e.distY+=a,e.absDistX=i.abs(e.distX),e.absDistY=i.abs(e.distY),e.absDistX<6&&e.absDistY<6||(e.options.lockDirection&&(e.absDistX>e.absDistY+5?(s=e.y,a=0):e.absDistY>e.absDistX+5&&(o=e.x,r=0)),e.moved=!0,e._beforePos?e._beforePos(s,a)&&e._pos(o,s):e._pos(o,s),e.dirX=r>0?-1:0>r?1:0,e.dirY=a>0?-1:0>a?1:0,c-e.startTime>300&&(e.startTime=c,e.startX=e.x,e.startY=e.y),e.options.onScrollMove&&e.options.onScrollMove.call(e,t))
  },_end:function(n){if(!m||0===n.touches.length){var r,a,o,s=this,c=m?n.changedTouches[0]:n,u={dist:0,time:0},l={dist:0,time:0},d=(n.timeStamp||Date.now())-s.startTime,h=s.x,f=s.y;if(s._unbind(_,t),s._unbind(x,t),s._unbind(T,t),s.options.onBeforeScrollEnd&&s.options.onBeforeScrollEnd.call(s,n),!s.moved)return m&&this.options.handleClick&&!s.isStopScrollAction&&(s.doubleTapTimer=setTimeout(function(){for(s.doubleTapTimer=null,r=c.target;1!=r.nodeType;)r=r.parentNode;"SELECT"!=r.tagName&&"INPUT"!=r.tagName&&"TEXTAREA"!=r.tagName&&(a=e.createEvent("MouseEvents"),a.initMouseEvent("click",!0,!0,n.view,1,c.screenX,c.screenY,c.clientX,c.clientY,n.ctrlKey,n.altKey,n.shiftKey,n.metaKey,0,null),a._fake=!0,r.dispatchEvent(a))
  },0)),s._resetPos(400),void(s.options.onTouchEnd&&s.options.onTouchEnd.call(s,n));if(300>d&&s.options.momentum&&(u=h?s._momentum(h-s.startX,d,-s.x,s.scrollerW-s.wrapperW+s.x,s.options.bounce?s.wrapperW:0):u,l=f?s._momentum(f-s.startY,d,-s.y,s.maxScrollY<0?s.scrollerH-s.wrapperH+s.y-s.minScrollY:0,s.options.bounce?s.wrapperH:0):l,h=s.x+u.dist,f=s.y+l.dist,(s.x>0&&h>0||s.x<s.maxScrollX&&h<s.maxScrollX)&&(u={dist:0,time:0}),(s.y>s.minScrollY&&f>s.minScrollY||s.y<s.maxScrollY&&f<s.maxScrollY)&&(l={dist:0,time:0})),u.dist||l.dist)return o=i.max(i.max(u.time,l.time),10),s.scrollTo(i.round(h),i.round(f),o),void(s.options.onTouchEnd&&s.options.onTouchEnd.call(s,n));
  s._resetPos(200),s.options.onTouchEnd&&s.options.onTouchEnd.call(s,n)}},_resetPos:function(t){var e=this,n=e.x>=0?0:e.x<e.maxScrollX?e.maxScrollX:e.x,i=e.y>=e.minScrollY||e.maxScrollY>0?e.minScrollY:e.y<e.maxScrollY?e.maxScrollY:e.y;return n==e.x&&i==e.y?void(e.moved&&(e.moved=!1,e.options.onScrollEnd&&e.options.onScrollEnd.call(e),e._afterPos&&e._afterPos())):void e.scrollTo(n,i,t||0)},_transitionEnd:function(t){var e=this;t.target==e.scroller&&(e._unbind(S),e._startAni())},_startAni:function(){var t,e,n,r=this,a=r.x,o=r.y,s=Date.now();
  if(!r.animating){if(!r.steps.length)return void r._resetPos(400);if(t=r.steps.shift(),t.x==a&&t.y==o&&(t.time=0),r.animating=!0,r.moved=!0,r.options.useTransition)return r._transitionTime(t.time),r._pos(t.x,t.y),r.animating=!1,void(t.time?r._bind(S):r._resetPos(0));(n=function(){var c,u,l=Date.now();return l>=s+t.time?(r._pos(t.x,t.y),r.animating=!1,r.options.onAnimationEnd&&r.options.onAnimationEnd.call(r),void r._startAni()):(l=(l-s)/t.time-1,e=i.sqrt(1-l*l),c=(t.x-a)*e+a,u=(t.y-o)*e+o,r._pos(c,u),void(r.animating&&(r.aniTime=k(n))))
  })()}},_transitionTime:function(t){t+="ms",this.scroller.style[l]=t},_momentum:function(t,e,n,r,a){var o=6e-4,s=i.abs(t)*(this.options.speedScale||1)/e,c=s*s/(2*o),u=0,l=0;return t>0&&c>n?(l=a/(6/(c/s*o)),n+=l,s=s*n/c,c=n):0>t&&c>r&&(l=a/(6/(c/s*o)),r+=l,s=s*r/c,c=r),c*=0>t?-1:1,u=s/o,{dist:c,time:i.round(u)}},_offset:function(t){for(var e=-t.offsetLeft,n=-t.offsetTop;t=t.offsetParent;)e-=t.offsetLeft,n-=t.offsetTop;return t!=this.wrapper&&(e*=this.scale,n*=this.scale),{left:e,top:n}},_bind:function(t,e,n){r.concat([e||this.scroller,t,this]),(e||this.scroller).addEventListener(t,this,!!n)
  },_unbind:function(t,e,n){(e||this.scroller).removeEventListener(t,this,!!n)},destroy:function(){var n=this;n.scroller.style[c]="",n._unbind(b,t),n._unbind(y),n._unbind(_,t),n._unbind(x,t),n._unbind(T,t),n.options.useTransition&&n._unbind(S),n.options.checkDOMChanges&&clearInterval(n.checkDOMTime),n.options.onDestroy&&n.options.onDestroy.call(n);for(var i=0,a=r.length;a>i;)r[i].removeEventListener(r[i+1],r[i+2]),r[i]=null,i+=3;r=[];var o=e.createElement("div");o.appendChild(this.wrapper),o.innerHTML="",n.wrapper=n.scroller=o=null
  },refresh:function(){var t,e=this;e.wrapperW=e.wrapper.clientWidth||1,e.wrapperH=e.wrapper.clientHeight||1,e.minScrollY=-e.options.topOffset||0,e.scrollerW=i.round(e.scroller.offsetWidth*e.scale),e.scrollerH=i.round((e.scroller.offsetHeight+e.minScrollY)*e.scale),e.maxScrollX=e.wrapperW-e.scrollerW,e.maxScrollY=e.wrapperH-e.scrollerH+e.minScrollY,e.dirX=0,e.dirY=0,e.options.onRefresh&&e.options.onRefresh.call(e),e.hScroll=e.options.hScroll&&e.maxScrollX<0,e.vScroll=e.options.vScroll&&(!e.options.bounceLock&&!e.hScroll||e.scrollerH>e.wrapperH),t=e._offset(e.wrapper),e.wrapperOffsetLeft=-t.left,e.wrapperOffsetTop=-t.top,e.scroller.style[l]="0",e._resetPos(400)
  },scrollTo:function(t,e,n,i){var r,a,o=this,s=t;for(o.stop(),s.length||(s=[{x:t,y:e,time:n,relative:i}]),r=0,a=s.length;a>r;r++)s[r].relative&&(s[r].x=o.x-s[r].x,s[r].y=o.y-s[r].y),o.steps.push({x:s[r].x,y:s[r].y,time:s[r].time||0});o._startAni()},scrollToElement:function(t,e){var n,r=this;t=t.nodeType?t:r.scroller.querySelector(t),t&&(n=r._offset(t),n.left+=r.wrapperOffsetLeft,n.top+=r.wrapperOffsetTop,n.left=n.left>0?0:n.left<r.maxScrollX?r.maxScrollX:n.left,n.top=n.top>r.minScrollY?r.minScrollY:n.top<r.maxScrollY?r.maxScrollY:n.top,e=void 0===e?i.max(2*i.abs(n.left),2*i.abs(n.top)):e,r.scrollTo(n.left,n.top,e))
  },scrollToPage:function(t,e,n){var i,r,a=this;n=void 0===n?400:n,a.options.onScrollStart&&a.options.onScrollStart.call(a),i=-a.wrapperW*t,r=-a.wrapperH*e,i<a.maxScrollX&&(i=a.maxScrollX),r<a.maxScrollY&&(r=a.maxScrollY),a.scrollTo(i,r,n)},disable:function(){this.stop(),this._resetPos(0),this.enabled=!1,this._unbind(_,t),this._unbind(x,t),this._unbind(T,t)},enable:function(){this.enabled=!0},stop:function(){this.options.useTransition?this._unbind(S):E(this.aniTime),this.steps=[],this.moved=!1,this.animating=!1
  },isReady:function(){return!this.moved&&!this.animating}},a=null,"undefined"!=typeof exports?exports.iScroll=A:t.iScroll=A,function(e){function n(t,e){var n="iscroll"+r++;return t.data("_iscroll_",n),a[n]=new i(t[0],e)}if(e){var i=A,r=0,a={};t.iScroll=function(t,i){return n(e("string"==typeof t?"#"+t:t),i)},e.fn.iScroll=function(t){var i=[];return this.each(function(r,o){if("string"==typeof t){var s,c=a[e(o).data("_iscroll_")];if(c&&(s=c[t])){var u=e.isFunction(s)?s.apply(c,Array.prototype.slice.call(arguments,1)):s;
  u!==c&&void 0!==u&&i.push(u)}}else e(o).data("_iscroll_")||n(e(o),t)}),i.length?i:this}}}(t.Zepto||null)}(window,document),!function(t){function e(e,n,i){switch(i){case"attach":t.extend(e,n);break;case"delegate":t.each(n,function(n,i){void 0===e[n]&&(e[n]=function(){var e=t.slice(arguments);e.unshift(this.widget()),i.apply(this,e)})})}}function n(e){for(var n,i=t.ui[e]||{},r=t.slice(arguments,1),a=0;n=i[r[a]];)i=n,a++;return r[a]?n:i}function i(e){var i,r,a,o=/require\(\s*['"]?([^'")]*)/g,s=[];if(t.isPlainObject(e))return e;
  if(t.isFunction(e)){for(i=e.toString();r=o.exec(i);)(a=r[1])&&!t.ui[a]&&s.push("$.ui."+a);if(s.length)throw"undefined modules: "+s.join(", ");return e(n)}throw"type error: factory should be function or object"}var r=[];t.ui=t.ui||{version:"1.0.4",defineProperty:Object.defineProperty,create:function(n,i,a){a||(a=i,i=t.ui.widget);var o=[],s=new i,c=/\b_super\b/,u=s.__proto__,l=function(n){if(n){var i=this,a=t.slice(arguments);t.each(o,function(n,a){var o,s=a.split("."),a=r[s.shift()]||{},c={};t.each(s,function(t,e){o=e,a=a[o]
  }),a&&(o?c[o]=a:c=a),e(i,c,"delegate")}),i._createWidget.apply(i,a)}};return t.ui[n]=function(t,e){return new l(t,e)},l.prototype=t.extend(s,{widgetName:n,widgetBaseClass:s.widgetName||i},t.each(a,function(e,n){t.isFunction(n)&&t.isFunction(u[e])&&c.test(n.toString())&&(a[e]=function(){this._super=u[e];var t=n.apply(this,arguments);return delete this._super,t})})),{attach:function(e){o=o.concat(t.isArray(e)?e:e.split(","))}}},define:function(e,n){try{n||(n=e,e="_privateModule");var a=t.ui[e]||(t.ui[e]={}),o=i(n);
  r[e]=t.extend(a,o)}catch(s){throw new Error(s)}}}}(Zepto),!function(t,e){t.ui.define("ex",function(){var n={},i=Object.prototype.toString;t.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(t,e){n["[object "+e+"]"]=e.toLowerCase()}),t.implement=function(n,i,r){var a=t.isObject(i)?i:i?t:t.fn;return t.each(n,function(t,n){var i=a[t];(i==e||!i.$ex||r)&&(n.$ex=!0,a[t]=n)}),t};var r=navigator.userAgent,a=navigator.appVersion,o=t.browser;t.implement({android:t.os.android||/HTC/.test(r)},t.os,!0),t.implement({qq:/qq/i.test(r),chrome:/chrome/i.test(r)||/CriOS/i.test(r),uc:/UC/i.test(r)||/UC/i.test(a)},t.browser,!0),t.browser.uc=t.browser.uc||!t.browser.qq&&!t.browser.chrome&&!/safari/i.test(r);
  try{t.browser.version=o.uc?a.match(/UC(?:Browser)?\/([\d.]+)/)[1]:o.qq?r.match(/MQQBrowser\/([\d.]+)/)[1]:o.chrome?r.match(/(?:CriOS|Chrome)\/([\d.]+)/)[1]:o.version}catch(s){}t.support=t.support||{},t.extend(t.support,{orientation:!t.browser.uc&&"orientation"in window&&"onorientationchange"in window,touch:"ontouchend"in document,cssTransitions:"WebKitTransitionEvent"in window,has3d:"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix}),t.implement({_guid:0,emptyFn:function(){},type:function(t){return null==t?String(t):n[i.call(t)]||"object"
  },isNull:function(t){return null===t},isUndefined:function(t){return t===e},slice:function(t,e){return Array.prototype.slice.call(t,e||0)},bind:function(e,n,i){return function(){e.apply(n,(i||[]).concat(t.slice(arguments)))}},guid:function(){return this._guid++},later:function(t,e,n,i,r){var e=e||0,a=function(){t.apply(i,r)};return n?setInterval(a,e):setTimeout(a,e)},alert:function(){var t=!1;return function(e,n){t||(window.alert(e),n&&(t=!0))}}(),parseTpl:function(t,e){var n="var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('"+t.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/<%=([\s\S]+?)%>/g,function(t,e){return"',"+e.replace(/\\'/g,"'")+",'"
  }).replace(/<%([\s\S]+?)%>/g,function(t,e){return"');"+e.replace(/\\'/g,"'").replace(/[\r\n\t]/g," ")+"__p.push('"}).replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t")+"');}return __p.join('');",i=new Function("obj",n);return e?i(e):i},loadFile:function(e,n,i){var r,a,o=/\.css(?:\?|$)/i.test(e),s=document.head||document.getElementsByTagName("head")[0],c=document.createElement(o?"link":"script"),n=n||t.emptyFn;o?(c.rel="stylesheet",c.href=e,s.appendChild(c)):(a=function(){n(),clearTimeout(r)
  },r=setTimeout(function(){throw a(),new Error("failed to load js file:"+e)},i||50),c.addEventListener("load",a,!1),c.async=!0,c.src=e,s.insertBefore(c,s.firstChild))},throttle:function(n,i,r){function a(){function t(){s=Date.now(),i.apply(c,l)}function a(){o=e}var c=this,u=Date.now()-s,l=arguments;r&&!o&&t(),o&&clearTimeout(o),r===e&&u>n?t():o=setTimeout(r?a:t,r===e?n-u:n)}var o,s=0;return"function"!=typeof i&&(r=i,i=n,n=250),a._zid=i._zid=i._zid||t.proxy(i)._zid,a},debounce:function(n,i,r){return i===e?t.throttle(250,n,!1):t.throttle(n,i,r!==!1)
  }},!0);var c=t.fn.on,u=t.fn.off,l=t.fn.trigger,d={touchstart:"mousedown",touchend:"mouseup",touchmove:"mousemove",tap:"click"},h=function(t){var e=[];return(t||"").split(" ").forEach(function(t){e.push("ontouchstart"in window?t:d[t]?d[t]:t)}),e.join(" ")};t.implement({on:function(t,e,n){return c.call(this,h(t),e,n)},off:function(t,e,n){return u.call(this,h(t),e,n)},offset:function(t){if(0==this.length)return null;var e="getBoundingClientRect"in this[0]?this[0].getBoundingClientRect():function(t){for(var e=t.offsetTop,n=t.offsetLeft,i=t.offsetWidth,r=t.offsetHeight;t.offsetParent;)t=t.offsetParent,e+=t.offsetTop,n+=t.offsetLeft;
  return e-=window.pageYOffset,n-=window.pageXOffset,{top:e,left:n,right:n+i,bottom:e+r,width:i,height:r}}(this[0]);return{left:e.left+(t?0:window.pageXOffset),top:e.top+(t?0:window.pageYOffset),width:e.width,height:e.height,right:e.right+(t?0:window.pageXOffset),bottom:e.bottom+(t?0:window.pageYOffset)}},trigger:function(e){var n=t.slice(arguments);if(t.fn.trigger.caller){var r,a=t.fn.trigger.caller.arguments;"string"==t.type(e)&&(n[0]=t.Event(e)),a&&(r=a[0])&&/Event\]$/i.test(i.call(r))&&t.inArray(n[0].type,["tap","singleTap","doubleTap","swipe","swipeLeft","swipeRight","swipeUp","swipeDown "])>-1&&(n[0].originalEvent=r)
  }return l.apply(this,n)}},!1,!0),t(document).ready(function(){var e,n=function(){var t=document.documentElement;return t.clientWidth/t.clientHeight<1.1?"portrait":"landscape"},i=n(),r=function(){clearInterval(e),e=t.later(function(){var r=n();i!==r&&(i=r,clearInterval(e),t(window).trigger("ortchange"))},50,!0)};t.support.orientation?t(window).bind("orientationchange",t.debounce(r)):t(window).bind("resize",t.debounce(r))})})}(Zepto),function(t){t.implement({highlight:function(e){return this.each(function(){var n,i=t(this);
  i.css("-webkit-tap-highlight-color","rgba(255,255,255,0)").on("touchstart touchend touchmove",function(r){if(i[0].contains(r.target))switch(r.type){case"mousedown":case"touchstart":n=t.later(function(){i.addClass(e)},100);break;case"touchend":case"mouseup":case"touchmove":case"mousemove":clearTimeout(n),i.removeClass(e)}})})},behavior:function(){return this.highlight.apply(this,arguments)}},!1,!0),t(window).on("scroll",t.debounce(0,function(){t(document).trigger("scrollStop")},!1))}(Zepto),!function(t){t.ui.define("control",function(){var e=t.os,n=parseFloat(e.version),i=!n,r=e.ios,a=(e.android,/htc_sensation_z710e/i.test(navigator.userAgent)),o={};
  return o.fix=function(e,o){var s=t(e),e=s.get(0),c=navigator.userAgent,u=/Linux/i.test(c)||t.os.ios&&!/safari/i.test(c)&&!/qq/i.test(c),l=t.extend({zIndex:999},o||{}),d=o.bottom?-1*o.bottom:o.top||0;return!(i||r&&n>=5)||a||u?(l.position="absolute",s.css(l),void(e.isFixed||(e.isFixed=!0,t(document).on("scrollStop",function(){s.css("top",window.pageYOffset+(o.bottom?window.innerHeight-s.height():0)+d+"px")})))):(s.css("position","fixed").css(l),!e.isFixed&&t.browser.qq&&t(document).on("scrollStop",function(){s.css("top",Math.max(-45,-window.pageYOffset)+"px")
  }),void(e.isFixed=!0))},o.setFloat=function(e){var n=t(e),i=n.clone().css({opacity:0,display:"none"}).attr("id",""),r=!1,a={},s=n.css("position")||"static",c=function(){o.fix(n,{x:0,y:0}),i.css("display","block"),r=!0},u=function(){n.css("position",s),i.css("display","none"),r=!1},l=function(t){var e=i.get(0).getBoundingClientRect().top||n.get(0).getBoundingClientRect().top,t=t||0+e;0>t&&!r?c():t>0&&r&&u()};n.after(i),t(document).on("touchstart",function(t){a.y=t.touches[0].pageY}).on("touchmove",function(t){var e=t.touches[0].pageY-a.y;
  a.y=t.touches[0].pageY,l(e)}),t(window).on("scroll",function(){l()})},o})}(Zepto),!function(t,e){t.ui.create("widget",function(){},{_createWidget:function(n,i){var r=this;t.isPlainObject(n)&&(i=n||{},n=e),t.extend(r,{_element:n&&t(n),_data:t.extend({status:!0,plugins:{}},r._data,i)}),r._create(),r._init(),r.widget().on("touchstart touchend tap",function(t){(t.bubblesList||(t.bubblesList=[])).push(r)})},_create:function(){},_init:function(){},destroy:function(){var e,n=this;t.each(n.data("plugins"),function(t,e){e.destroy()
  }),e=n.trigger("destroy").off().widget(),e.find("*").off(),e.off().remove(),n.__proto__=null,t.each(Object.keys?Object.keys(n):n,function(t,e){delete n[e]})},data:function(n,i){var r=this._data;return t.isPlainObject(n)?t.extend(r,n):i!==e?r[n]=i:r[n]},widget:function(t){return this._element=t||this._element},component:function(n,i){var r=this,a=r.data("plugins");try{t.isFunction(i)?a[n]=i.apply(r):i!==e&&(a[n]&&a[n].destroy(),delete a[n])}catch(o){}return a[n]},on:function(t,e,n){var i=this,r=t.toLowerCase(),a=i._callbacks||(i._callbacks={}),o=a[r]||(a[r]=[]);
  return o.push([e,n]),i},off:function(t,e){var n,i=this;if(t){if(n=i._callbacks)if(t=t.toLowerCase(),e){var r=n[t];if(!r)return i;for(var a=0,o=r.length;o>a;a++)if(r[a]&&e===r[a][0]){r[a]=null;break}}else n[t]=[]}else i._callbacks={};return i},trigger:function(e){var n,i,r,a=this,e=e.toLowerCase(),o=a.data("on"+e),s=t.slice(arguments,1);if(o&&o.apply(a,s),!e||!(i=a._callbacks))return a;if(n=i[e])for(var c=0,u=n.length;u>c;c++)r=n[c],r[0].apply(r[1]||a,s);return a}}),t(document).ready(function(){t(document).trigger("pageInit")
  })}(Zepto),!function(t){t.ui.create("add2desktop",{_data:{icon:"../../add2desktop/icon.png"},_create:function(){var e=this,n=(e.widget()||e.widget(t("<div></div>"))).addClass("ui-add2desktop").css("display","none"),i=t(e.data("container")||document.body),r=(t.os.ios&&t.os.version.substr(0,3))>4.1?"ui-add2desktop-new":"ui-add2desktop-old",a='<div class="ui-add2desktop-shadowbox"></div><div class="ui-add2desktop-content"><div class="ui-add2desktop-type"><img src="'+e.data("icon")+'"/></div><div class="ui-add2desktop-text">先点击<span class="'+r+'"></span>，<br>再"添加至主屏幕"</div><a href="javascript:;" class="ui-add2desktop-close"><span class="ui-add2desktop-close-btn"></span></a>';
  n.html(a).parent().length||n.appendTo(i),e.trigger("create")},_init:function(){var e=this,n=t.os,i=parseFloat(n.version),r=!i,a=n.ios,o=n.android,s=navigator.userAgent,c=e.data("isUC",/Linux/i.test(s)||t.os.ios&&!/safari/i.test(s)&&!/qq/i.test(s)),u=e.data("rotateEV","ortchange");t(".ui-add2desktop-close").on("tap",function(t){e.hide(),(t.originalEvent||t).preventDefault()}),e.data("_winfun",function(){e._setpos()}),t(window).on(u+" scrollStop",e.data("_winfun")),e.widget().css("position",e.data("useFixed",r||a&&i>=5&&!c||o)?"fixed":"absolute"),t(function(){t.later(function(){e.data("available",!0),e._setpos().trigger("init")
  },200)})},_setpos:function(){var e=this,n=e.widget();return!e.data("useFixed")&&n.css("top",window.pageYOffset+t(window).height()-85),e.trigger("setpos")},hide:function(){var e=this;return t.later(function(){e.widget().css({display:"none",zIndex:-1,left:-9999}),e.trigger("close")},20),e},show:function(){var e=this;if(t.os.ios){if(!e.data("available"))return t.later(t.bind(e.show,e),20),e;e.widget().css({display:"block",opacity:0}).animate({opacity:1},{duration:100,ease:"ease-in",complete:function(){e.trigger("open")
  }})}return e},destroy:function(){var e=this;t(window).off(e.data("rotateEV")+" scrollStop",e.data("_winfun")),t(".ui-add2desktop-close",e.widget()).off().remove(),e.widget().html(""),e._super()}}).attach("control.fix")}(Zepto),!function(t,e){t.ui.create("dialog",{_data:{width:300,mask:!0,closeBtn:!0},_create:function(){var e=this,n=t(e.data("container")||document.body),i=(e.widget()||e.widget(t("<div></div>"))).css({width:e.data("width"),height:e.data("height")}).addClass("ui-dialog");e.data("cls")&&i.addClass(e.data("cls")),e.data("title")&&e.data("titleElem",t('<div class="ui-dialog-title"><div class="titleText">'+e.data("title")+"</div></div>")).appendTo(i),e.data("contentElem",t('<div class="ui-dialog-content"><div class="contentHtml">'+e.data("content")+"</div></div>")).appendTo(i),e.data("closeBtn")&&(e.data("titleElem")||e.data("contentElem")).append('<div class="ui-dialog-close">×</div>'),e.data("maskElem",t('<div class="ui-mask"></div>')).appendTo(n),i.appendTo(n),e.trigger("create")
  },_init:function(){var e=this,n=e.widget(),i=t.bind(e._eventHandler,e);n.on("touchmove click",i),t(window).on("ortchange",i),e.data("maskElem").on("touchmove tap",i),e.on("destroy",function(){e.data("maskElem").off(),t(window).off("ortchange",i)}).trigger("init")},_eventHandler:function(t){var e=this,n=t.target;if(e.data("status"))switch(t.type){case"touchmove":t.preventDefault();break;case"tap":case"click":"ui-dialog-close"==n.className||"×"==n.nodeValue?e.hide():"ui-mask"==n.className&&e.trigger("maskClick");
  break;case"ortchange":e._resize(t)}},_resize:function(){var e=this,n=e.data("maskElem"),i=document.body,r=t.browser.uc?1:0;"block"==n.css("display")&&n.css({width:i.clientWidth,height:Math.max(i.scrollHeight,i.clientHeight)-r}),e.trigger("resize")},title:function(t){var n=this.data("titleElem").find(".titleText");return t!=e&&(n.html(t),this.trigger("resize")),n.html()},content:function(t){var n=this.data("contentElem").find(".contentHtml");return t!=e&&(n.html(t),this.trigger("resize")),n.html()
  },_center:function(){var e=this,n=e.widget(),i=t(window);return n.css({left:i.width()/2,top:i.height()/2+window.pageYOffset,marginTop:-n.height()/2,marginLeft:-n.width()/2}),e.on("resize",function(){t.later(function(){n.css({left:i.width()/2,top:i.height()/2+window.pageYOffset})},10)}),e},show:function(t,n){var i=this,r=i.widget(),a=document.body,o={left:t||0,top:n||0};return r.css("display","block"),i.data("mask")&&i.data("maskElem").css({display:"block",width:a.clientWidth,height:Math.max(a.scrollHeight,a.clientHeight)}),t==e?i._center():r.css(o),i
  },hide:function(t){var e=this;return e.widget().css("display","none"),e.data("maskElem").css("display","none"),e.trigger("close"),t&&e.destroy(),e},close:function(){this.hide(!0)},destroy:function(){var t=this;t.data("maskElem").remove(),t._super()}}).attach("control.fix")}(Zepto),!function(t){t.ui.create("dropmenu",{_data:{content:[],container:"",mode:"default",offset:0,instanceId:"",hasArrow:!1,position:"default",callback:"",isScroll:!1},_create:function(){var e=this,n=e.data("instanceId"),i=t(e.data("container")||document.body),r=e.widget(),a=r||e.widget(t('<div class="ui-dropmenu"></div>')),o=e.data("arrow",t('<span class="ui-dropmenu-arrow"></span>')),s=e.data("title",t('<span class="ui-dropmenu-title">'+e.data("content")[0].text+"</span>")),c=e.data("button",t('<div class="ui-dropmenu-button"></div>')),u=e.data("menu",t('<div class="ui-dropmenu-content"></div>'));
  if(e.data("uiArrow",t('<span class="ui-dropmenu-content-arrow"></div>')).appendTo(u),!r&&n&&a.addClass(n),c.append(s),a.css("position","relative").append(c),a.append(u),u.css("visibility","hidden"),e._createmenu(),e.data("hasArrow")&&c.append(o),a.parent().get(0)||a.appendTo(i),"horizontal"==e.data("position")){var l=e.data("items"),d=l.children(),h=0;l.addClass("horizontal"),t.each(t(d),function(e,n){h+=t(n).offset().width}),l.css({"float":"left"}),l.parent().css("width",h+"px"),e.data("isScroll")&&t(".scrollBox",u).css("height",l.offset().height+"px")
  }e._setOffset(),u.css("visibility","visible"),u.hide(),e.trigger("create")},_init:function(){var e=this,n=e.data("button"),i=e.data("menu"),r=e.data("arrow"),a=(e.data("title"),e.data("content")),o=(a.length,e.data("items")),s=o.children();e.data("callback"),e.widget(),e.data("menuOffset",i.offset()),n.on("touchstart",function(){r&&r.toggleClass("ui-dropmenu-arrow-on"),e.setOffset(),i.toggle(),e._resetScroll()}),e.data("isScroll")||s.on("touchstart",function(t){setTimeout(function(){e._menuEvent(t)
  },100)});var c=t.bind(e._eventHandler,e);t(window).on("resize",c),t(document).on("touchstart",c),e.data("isScroll")&&t(document).on("DOMContentLoaded",c),e.on("destroy",function(){t(window).off("resize",c),t(document).off("touchstart",c),t(document).off("DOMContentLoaded",c)}),e.trigger("init")},_eventHandler:function(t){var e=this;switch(t.type){case"resize":setTimeout(function(t){e.setOffset(t)},300);break;case"click":case"touchstart":e._isClose(t);break;case"DOMContentLoaded":setTimeout(e.data("scroll"),200)
  }},_isClose:function(t){var e=this,n=t.bubblesList;n&&-1!=n.indexOf(e)||e.hide()},_menuEvent:function(e){var n=this,i=t(e.target),r=n.data("index"),a=n.data("title"),o=a.html(),s=n.data("callback"),c=n.data("mode"),u=n.data("content"),l=u.length,d=n.data("items"),h=n.data("arrow"),f=n.data("menu"),p=d.children();i=i.closest("li");var g=i.index();g=l-1>g?g:l-1,u[g].callback?u[g].callback(g,i,n):t.isFunction(s)&&s(g,i,n),"selected"==c&&(i.hide(),a.html(i.html()),0==r?p.first().html(o).show():t(p.get(r)).show(),h&&h.toggleClass("ui-dropmenu-arrow-on"),f.hide(),n.trigger("select")),n.data("index",i.index())
  },_createmenu:function(){var e=this,n=e.data("content"),i=e.data("menu"),r=[],a=e.data("items",t('<ul class="ui-dropmenu-items"></ul>'));t.each(n,function(t){var e=n[t].className?'class="'+n[t].className+'"':"";t>0&&r.push("<li "+e+">"+n[t].text+"</li>")}),e.data("index",0),e.data("length",r.length),e.data("isScroll")?(i.append('<div class="scrollBox"><div class="scroller"></div></div>'),t(".scroller",i).append(a)):i.append(a),a.html('<li style="display:none;"></li>'+r.join(""))},_scroll:function(){var e=this,n=t(".scrollBox",e.data("menu")).get(0),i="horizontal"==e.data("position")?!0:!1,r="horizontal"!=e.data("position")?!0:!1,a=new iScroll(n,{hScroll:i,vScroll:r,onTouchEnd:function(t){this.moved||this.absDistY||e._menuEvent(t)
  }});e.data("scroll",a)},show:function(){var t=this,e=t.data("arrow");return t.setOffset(),t.data("menu").show(),e&&e.addClass("ui-dropmenu-arrow-on"),t._resetScroll(),t.trigger("show"),t},hide:function(){var t=this,e=t.data("arrow");return t.data("menu").hide(),e&&e.removeClass("ui-dropmenu-arrow-on"),t.trigger("hide"),t},_setOffset:function(){var t=this,e=t.data("menu"),n=t.data("uiArrow"),i=document.body.clientWidth,r=document.documentElement.clientHeight,a=document.body.offsetHeight,o=r>a?r:a,s=t.data("offset"),c=s.x?s.x:0,u=s.y?s.y:s,s=t.data("button").offset(),l=e.offset();
  e.css("top",s.height-1+u+"px"),n.css({left:l.width/2-6+"px",top:"-7px"}).removeClass("ui-dropmenu-content-arrowbottom"),e.css("left",-(l.width-s.width)/2+c+"px"),s.left<l.width/2?(e.css("left",0+c+"px"),n.css("left",s.width/2-6+"px")):i-s.width-s.left<(l.width-s.width)/2&&(e.css("left",-(l.width-s.width)+c+"px"),n.css("left",l.width-s.width/2-6+"px")),o-s.height-s.top-u<l.height&&(e.css("top",-(l.height-1+u)+"px"),n.css("top",l.height-1+"px").addClass("ui-dropmenu-content-arrowbottom")),t._resetScroll()
  },_resetScroll:function(){var t=this;!t.data("scroll")&&t.data("isScroll")?t._scroll():t.data("scroll")&&t.data("scroll").refresh()},setOffset:function(){var t=this,e=!1,n=t.data("menu");return"none"==n.css("display")&&(n.css("visibility","hidden").show(),e=!0),t._setOffset(),e&&n.hide().css("visibility","visible"),t},destroy:function(){var t=this;t.widget().off(),t.data("scroll")&&t.data("scroll").destroy(),t._super()}})}(Zepto),!function(t,e){t.ui.create("gotop",{_data:{useAnim:!0,afterScroll:function(){},touchendHandler:function(){}},_create:function(){var n=this,i=n.widget(),r=t(n.data("container")||document.body);
  i==e&&(i=n.widget(t('<div class="ui-gotop"></div>'))),!i.hasClass("ui-gotop")&&i.addClass("ui-gotop"),i.html("<span>&nbsp;</span>"),(n.data("container")||!i.parent().length)&&i.appendTo(r),n.trigger("create").data("container",r)},_init:function(){var e=this,n=t.bind(e._eventHandler,e);e.data("_eventHandler",n),t.os.android&&2.1==parseFloat(t.os.version).toFixed(1)&&t(document).on("touchstart",n),t(document).on("touchmove mousewheel scrollStop",n),t(window).on("scroll",n),e.widget().on("click",n),e.on("destroy",function(){e.widget().off("click",n),t(document).off("touchmove touchend mousewheel scrollStop",n),t(window).off("scroll",n),t.os.android&&2.1==parseFloat(t.os.version).toFixed(1)&&t(document).off("touchstart",n)
  }).trigger("init")},_scrollTo:function(){var e,n=this,i=window.pageYOffset,r=n.data("node")?t(n.data("node")).offset().top:0;return n.data("useAnim")?n.hide().trigger("goTop",e=t.later(function(){if(i>r){i-=100;var t=100>i-r?r:i;window.scrollTo(0,t)}else clearInterval(e)},16,!0)):(window.scrollTo(0,r||1),n.hide().trigger("goTop"))},show:function(t){var e=this,n=e.widget();return e.data("isShow")!==!0&&(n.css({display:"block",visibility:"visible"}),e.data("isShow",!0)),n.css(t||{}),e},hide:function(){var t=this;
  return t.data("isShow")&&(t.widget().css("display","none"),t.data("isShow",!1)),t},_touchEndHandle:function(e){this.data("touchendHandler")&&this.data("touchendHandler").apply(this,[e])===!1||(window.pageYOffset>t(window).height()?this.show():this.hide())},_touchMoveHandle:function(e){var n=this;t.os.android&&2.1==parseFloat(t.os.version).toFixed(1)?(n.data("moveY",e.touches[0].pageY),Math.abs(n.data("moveY")-n.data("startY"))<30&&(t(e.target).hasClass("ui-gotop")||t(e.target).parent().hasClass("ui-gotop"))?t.later(function(){n._scrollTo().hide().data("afterScroll")&&n.data("afterScroll").apply(n)
  },400):n.hide()):n.hide()},_eventHandler:function(t){var e=this;switch(t.type){case"touchstart":e.data("startY",t.touches[0].pageY);break;case"touchmove":clearTimeout(e.data("_touchended")),e.data("_touchended",setTimeout(function(){e._touchEndHandle.call(e,t)},300)),e._touchMoveHandle(t);break;case"click":e._scrollTo().hide().data("afterScroll")&&e.data("afterScroll").apply(this);break;case"scroll":clearTimeout(e.data("_touchended"));break;case"mousewheel":case"scrollStop":e._touchEndHandle(t)}},destroy:function(){var e=this;
  e.widget().off("click",e.data("_eventHandler")),t(document).off("touchmove mousewheel scrollStop",e.data("_eventHandler")),t.os.android&&2.1==parseFloat(t.os.version).toFixed(1)&&t(document).off("touchstart",e.data("_eventHandler")),e._super()}}).attach("control.fix"),t(document).on("pageInit",function(){})}(Zepto),!function(t,e){t.ui.create("more",{_data:{container:"",content:[],count:5,isShow:!1},_create:function(){var n=this,i=n.widget(),r=[],a=[],o=[],s=t(n.data("container")||document.body)[0],c=n.data("content").concat(),u=n.data("count"),l=parseInt(100/u);
  if(t.isArray(c)&&!(c.length<1)){for(;c.length>u;)o.push(c.splice(0,u));c.length&&o.push(c),i==e&&(i=n.widget(t('<div class="ui-more"></div>'))),i.hasClass("ui-more")||i.addClass("ui-more"),a.push('<div class="ui-more-arrow"></div>'),o.forEach(function(t){r=['<div class="ui-more-links">'],t.forEach(function(t,e){var n="width:"+l+"%;"+(e==u-1?"-webkit-box-flex:1":""),i=t.key||"word";r.push('<a href="'+t.url+'" class="ui-more-link" data-key="'+i+'" style="'+n+'"><span>'+t.text+"</span></a>")}),r.push("</div>"),a.push(r.join(""))
  }),i.html(a.join("")),i.parent().length&&!n.data("container")||i.parent().length||i.appendTo(s),n.trigger("create")}},_init:function(){var t=this,e=t.widget();t.data("isShow")||e.hide(),t.trigger("init")},show:function(){var t=this,e=t.widget();return t.data("isShow",!0),e.show(),t.trigger("aftershow"),t},hide:function(){var t=this,e=t.widget();return t.data("isShow",""),e.hide(),t.trigger("afterhide"),t}})}(Zepto),!function(t,e){t.ui.create("refresh",{_data:{container:"",instanceId:"",pullUpText:"加载更多",pullReleaseText:"松开立即加载",loadingText:"加载中...",clickText:"点击加载更多",type:"click",direction:"up",isShow:!0,onReady:null},_create:function(){var t=this;
  t._createButtonUI(),t.trigger("create")},_init:function(){var e=this,n=e.data("type"),i=e.widget();-1!=t.inArray(e.data("type"),["click","pullup"])&&(e.data({range:150,_isOk:!0,refreshing:!1,list:i.parent().parent(),maxHeight:i.parent().parent().height()||200,maxTop:parseInt(i.parent().parent().get(0).getBoundingClientRect().top)}),"click"==n?e._clickAction():e._pullUpAction(),e.data("isShow")||i.hide(),e.trigger("init"))},_createButtonUI:function(){var e=this,n=e.widget(),i=[],r=e.data("direction"),a=t(e.data("container")||document.body)[0];
  -1==t.inArray(e.data("direction"),["up","down"])&&(r="up"),n||(n=e.widget(t("<div></div>")).appendTo(a)),i.push('<span class="ui-refresh-pullup-icon"></span>'),i.push('<span class="ui-refresh-pullup-label">'+e.data("pullup"==e.data("type")?"pullUpText":"clickText")+"</span>"),n.html(i.join("")),n.parent().length?a!==document.body&&("up"==r?n.appendTo(a):n.prependTo(a)):"up"==r?n.appendTo(a):n.prependTo(a),e.data({pullUpLabel:n.find(".ui-refresh-pullup-label"),pullUpIcon:n.find(".ui-refresh-pullup-icon"),dir:r}),e.data("pullUpIcon").hide(),n.addClass(e.data("instanceId")||"ui-refresh")
  },_clickAction:function(){var e=this,n=e.widget(),i=t.bind(e._eventHandler,e);n.on("click",i)},_pullUpAction:function(){var e=this,n=e.data("list"),i=t.bind(e._eventHandler,e);n.on("touchstart touchmove touchend",i),e.widget().on("click",i)},_tapHandler:function(){var t=this;if(t.data("_isOk")){var e=t.widget(),n=t.data("pullUpLabel"),i=t.data("pullUpIcon"),r=t.data("type");e.addClass("ui-refresh-loading"),i.show(),n.html(t.data("loadingText")),t.data("onReady").call(this,function(){e.removeClass("ui-refresh-loading"),i.hide(),n.html(t.data("click"==r?"clickText":"pullUpText"))
  }),t.data("_isOk",!1)}},_touchStartHandler:function(t){if(t.targetTouches[0]){var e=this,n=e.data("list"),i=e.data("dir"),r=e.data("maxTop"),a=e.data("range"),o=t.targetTouches[0].pageY;("up"==i&&o>n.height()+r-a||"down"==i&&o<r+e.widget().height()+a)&&e.data("startY",o)}},_touchMoveHandler:function(t){var e=this,n=t.targetTouches[0].pageY,i=e.data("startY"),r=e.data("dir"),a=n-i;if(!(!t.targetTouches[0]||!e.data("_isOk")||!i||"up"==r&&a>0||"down"==r&&0>a)){var o=e.data("pullUpLabel");e.data("range"),e.data("maxTop"),Math.abs(a)<e.data("maxHeight")&&!e.data("refreshing")&&(o.html(e.data("pullReleaseText")),e.data("refreshing",!0)),e.data("allMoveY",a)
  }},_touchEndHandler:function(){var t=this,e=t.widget(),n=t.data("pullUpIcon"),i=t.data("pullUpLabel");t.data("refreshing")&&(e.addClass("ui-refresh-loading"),n.show(),i.html(t.data("loadingText")),t.data("onReady").call(this,function(){n.hide(),e.removeClass("ui-refresh-loading"),i.html(t.data("pullUpText"))}),t.data({refreshing:!1,_isOk:!1})),t.data("startY",0)},setStatus:function(t){var e=this;return e.data("_isOk",t?!0:!1),e},hide:function(t){var e=this,n=e.widget(),i=t?!0:!1;return e.setStatus(i),e.data("isShow")&&(e.data("isShow",!1),n.hide()),e
  },show:function(t){var n=this,i=n.widget(),r=t||t==e?!0:!1;n.setStatus(r),n.data("isShow")||(n.data("isShow",!0),i.show())},setLoadEndText:function(t,e){var n=this,i=n.data("pullUpLabel"),r=n.data("pullUpIcon"),a=n.data("click"==n.data("type")?"clickText":"pullUpText"),o=t?t:a,s=e?!0:!1;i.html(o),r&&r.hide(),n.setStatus(s)},_eventHandler:function(e){var n=this;switch(e.type){case"click":n._tapHandler(e);break;case"touchstart":n._touchStartHandler(e);break;case"touchmove":n._touchMoveHandler(e),3==e.target.nodeType&&t.os.ios&&n._touchEndHandler(e),t.os.android&&n.data("touchMoveTimer",setTimeout(function(){n._touchEndHandler()
  },1e3));break;case"touchend":n.data("touchEndTimer",setTimeout(function(){n._touchEndHandler(e)},0))}},destroy:function(){var t=this,e=t.data("touchMoveTimer"),n=t.data("touchEndTimer");t.widget().off("click"),t.data("list").off("touchstart touchmove touchend"),e&&clearTimeout(e),n&&clearTimeout(n),t._super()}})}(Zepto),!function(t){t.ui.create("vs_toolbar",{_data:{titleText:"",isShow:!0},_create:function(){var t=this,e=t.widget(),n=e.find(".ui-toolbar-btn");t.data("buttons",n),t.trigger("create")
  },_init:function(){for(var e=this,n=e.data("buttons"),i=0,r=n.length;r>i;i++)!function(){var e=t(n[i]);e.on("touchend",function(){e.toggleClass("press"),t.later(function(){e.toggleClass("press")},300)})}();e.trigger("init")},show:function(){var t=this,e=t.widget();return t.data("isShow")||(t.trigger("beforeshow"),t.data("isShow",!0),e.show(),t.trigger("aftershow")),t},hide:function(){var t=this,e=t.widget();return t.data("isShow")&&(t.data("isShow",!1),t.trigger("beforehide"),e.hide(),t.trigger("afterhide")),t
  },toggle:function(){var t=this;return t.widget(),t.data("isShow")?t.hide():t.show(),t},destroy:function(){var t=this;t.widget().off(),t._super()}}).attach("control.fix")}(Zepto),!function(t){t.ui.create("quickdelete",{_data:{box:20,offset:{x:0,y:0}},_create:function(){var e=this,n=e.data("input",t(e.data("container"))),i=+new Date,r="ui-input-mask-"+i,a="ui-quickdelete-delete-"+i,o=n.parent(),s=t('<div id="'+a+'" class="ui-quickdelete-button"></div>').css({height:e.data("box"),width:e.data("box")});
  t.os.android&&t.os.android&&2.1==parseFloat(t.os.version).toFixed(1)&&s.css("-webkit-background-size","20px 20px"),"ui-input-mask"!=o.attr("class")&&(o=t('<div id="'+r+'" class="ui-input-mask"></div>').appendTo(n.parent())),e.widget(o.append(n).append(e.data("deleteElem",s)).css("height",n.height())),e._initButtonOffset().trigger("create")},_init:function(){var e=this,n=e.data("input"),i=t.bind(e._eventHandler,e);n.on("focus input blur",i),e.data("deleteElem").on("touchstart",i),e.on("destroy",function(){n.off("focus input blur",i),e.data("deleteElem").off("touchstart",i),i=t.fn.emptyFn
  }),e.trigger("init")},_show:function(){return this.data("deleteElem").css("visibility","visible"),this},_hide:function(){return this.data("deleteElem").css("visibility","hidden"),this},_eventHandler:function(e){var n=this,i=e.type,r=e.target,a=n.data("input");switch(i){case"focus":case"input":t.trim(a.val())?n._show():n._hide();break;case"mousedown":case"touchstart":r==n.data("deleteElem").get(0)&&(e.preventDefault(),e.formDelete=!0,a.val(""),n._hide().trigger("delete"),a.get(0).focus());break;case"blur":n._hide()
  }},_initButtonOffset:function(){var t=this,e=t.data("input"),n=t.data("box"),i=t.widget().offset(),r=t.data("offset"),a=(r.x||0,r.y||0);return Math.round((i.height-2*a-n)/2),t.data("deleteElem").css({top:8,right:90}),e.css({position:"absolute",top:0,left:4,width:"auto",right:n+20}),t}}),t(document).on("pageInit",function(){t("[data-widget=quickdelete]").each(function(e,n){var i=t(n),r=i.data("quickdelete-size"),a=i.data("quickdelete-offsetx"),o=i.data("quickdelete-offsety");t.ui.quickdelete({container:n,size:parseInt(r,10)||void 0,offset:{x:parseInt(a,10)||void 0,y:parseInt(o,10)||void 0}})
  })})}(Zepto),!function(t,e){t.ui.create("suggestion",{_data:{listCount:50,isCache:!0,isStorage:!0,minChars:0,maxChars:1e3,offset:{x:0,y:0,w:0},confirmClearHistory:!0},_create:function(){var e=this,n=+new Date,i="ui-input-mask-"+n,r=e.data("id","ui-suggestion-"+t.guid()),a=e.data("input",t(e.data("container"))).attr("autocomplete","off"),o=a.parent();e.data("inputWidth",a.get(0).offsetWidth),e.data("cacheData",{}),"ui-input-mask"!=o.attr("class")&&(o=t('<div id="'+i+'" class="ui-input-mask"></div>').appendTo(a.parent()).append(a)),e.data("maskElem",o),e.widget(t('<div id="'+r+'" class="ui-suggestion"><div class="ui-suggestion-content"><div class="ui-suggestion-scroller"></div></div><div class="ui-suggestion-button"></div></div>').appendTo(o)),e._initSuggestionOffset().trigger("create")
  },_init:function(){var e=this,n=e.data("input"),i=t.bind(e._eventHandler,e);e.widget().on("touchstart",i),n.on("focus input",i).parent().on("touchstart",i),t(window).on("ortchange",i),e.data("autoClose")&&t(document).on("tap",i),e.on("destroy",function(){t(document).off("tap",i),t(window).off("ortchange",i)}),e.trigger("init")},_initSuggestionOffset:function(){var t=this,e=t.widget(),n=t.data("input"),i=t.data("offset"),r=2*parseInt(e.css("border-left-width")||0);return t.data("pos",n.height()+(i.y||0)),t.data("realWidth",(t.data("width")||n.width())-r),e.css({position:"absolute",left:i.x||0}),t
  },_setSize:function(){var t=this;return t.data("realWidth"),t.data("input").parent().width()-t.data("inputWidth"),t},_posAdapt:function(e){var n=this;return e?n._setPos().data("timeId",t.later(function(){n._setPos()},200,!0)):clearInterval(n.data("timeId")),n},_setPos:function(){var e=this,n=e.widget(),i=e.data("input"),r=parseFloat(n.height()),a=e.data("offset"),o=parseFloat(e.data("pos")),s=i.offset(!0).top,c=t(window).height()-i.offset(!0).bottom;return e.data("posAdapt")&&s>c?n.css("top",-r-(a.y||0)+"px"):n.css("top",o),e
  },_change:function(t){var e=this,n=e._cacheData(t),i=e.data("isCache");return e.data("source"),n&&i?e._render(t,n):e._sendRequest(t)},_eventHandler:function(t){var e=this,n=t.type,i=t.target,r=e.data("maskElem").get(0);switch(n){case"focus":e._setSize()._showList()._setPos().trigger("open");break;case"touchstart":case"mousedown":if(!t.formDelete)break;t.preventDefault();case"input":e._showList();break;case"ortchange":e._setSize()._setPos();break;case"click":case"tap":16&r.compareDocumentPosition(i)||e.hide()
  }},_showList:function(){var t=this,e=t.getValue(),n=t._localStorage();return e.length<parseFloat(t.data("minChars"))||e.length>parseFloat(t.data("maxChars"))?t.hide():e?t._change(e):n?t._render(null,{s:n.split(",")}):t.hide()},_bindSuggestionListEvent:function(){var t=this;return t.widget().find(".ui-suggestion-result").on("click",function(){t._select(this)._submit()}).highlight("ui-suggestion-result-highlight"),t},_bindCloseEvent:function(){var e=this;return t(".ui-suggestion-button span:first-child").on("click",function(){t.later(function(){e.clearHistory()
  },t.os.android?200:0)}),t(".ui-suggestion-button span:last-child").on("click",function(){e.hide().leaveInput().trigger("close")}),e},_sendRequest:function(e){var n=this,i=n.data("source"),r=n.data("param"),a="suggestion_"+ +new Date,o=n.data("sendRequest");return t.isFunction(o)?o(e,function(t){n._render(e,t)._cacheData(e,t)}):e&&(i+=(-1===i.indexOf("?")?"?":"")+"&wd="+encodeURIComponent(e),-1===i.indexOf("&cb=")&&(i+="&cb="+a),r&&(i+="&"+r),window[a]=function(r){n._render(e,r)._cacheData(e,r),t('[src="'+i+'"]').remove(),delete window[a]
  },t.ajaxJSONP({url:i,dataType:"json"})),n},getValue:function(){return t.trim(this.data("input").val())},_render:function(t,e){var n,i=this,r=i.widget(),a=r.find(".ui-suggestion-content"),o=r.find(".ui-suggestion-button"),s=i.data("renderList"),c=i.data("renderEvent"),u='<span style="display:none;"></span><span>关闭</span>';if(null===t&&(u="<span>清除历史记录</span><span>关闭</span>"),n=s?s.apply(i,[t,e]):i._renderList(t,e)){a.find("*").off(),a.find(".ui-suggestion-scroller").html(n),o.find("*").off(),o.html(u),c?c.apply(i):i._bindSuggestionListEvent(),e.s.length>=2?a.css("height",i.data("height")||73):a.css("height",33),i._bindCloseEvent()._show();
  var l=i.data("iScroll")||i.data("iScroll",new iScroll(a.get(0),{topOffset:0,hScroll:!1}));l.scrollTo(0,0),l.refresh()}else i.hide();return i},_buildHTML:function(t){var e=t.join('</div></li><li><div class="ui-suggestion-result">');return'<ul><li><div class="ui-suggestion-result">'+e+"</div></li></ul>"},_renderList:function(e,n){var i=this,r=(i.widget(),i.data("listCount")),a=[],o=n.s;return n&&o&&o.length?(o=o.slice(0,r),t.each(o,function(n,i){t.trim(i)&&a.push(""!=e?i.replace(e,"<span>"+e+"</span>"):i)
  }),i._buildHTML(a)):void i.hide()},_submit:function(){var t=this,e=t.data("input").val();return t.trigger("submit"),t.data("onsubmit")||t._callbacks&&t._callbacks.submit||(window.location="http://www.baidu.com/s?wd="+encodeURIComponent(e)),t},_select:function(t){var e=this,n=t.textContent;return e.data("input").val(n),e.data("isStorage")&&e._localStorage(n),e.trigger("select",t).hide()},_cacheData:function(t,n){var i=this;return n!==e?i.data("cacheData")[t]=n:i.data("cacheData")[t]},_localStorage:function(n){var i=this,r=i.data("shareName"),a=i.data("isSharing")?r?r+"-SUG-Sharing-History":"SUG-Sharing-History":i.data("id");
  if(null===n)window.localStorage[a]="";else if(n!==e){var o=window.localStorage[a],s=o?o.split(","):[];if(-1!=t.inArray(n,s))return;s.unshift(n),window.localStorage[a]=s.join(",")}return window.localStorage[a]},_show:function(){var t=this;return t.data("hideTimer")&&(clearTimeout(t.data("hideTimer")),t.data("hideTimer",null)),t.widget().css("display","block"),t.data("posAdapt")&&t._posAdapt(1),t.trigger("show")},hide:function(){var e=this;return e.data("hideTimer",t.later(function(){e.widget().css("display","none"),e.data("hideTimer",null)
  },200)),e._posAdapt(0).trigger("hide")},clearHistory:function(){var t=this,e=function(){t._localStorage(null),t.hide()};t.data("confirmClearHistory")?window.confirm("清除全部查询历史记录？")&&e():e()},history:function(t){return this._localStorage(t)},focusInput:function(){return this.data("input").get(0).focus(),this},leaveInput:function(){return this.data("input").get(0).blur(),this},destroy:function(){var t=this,e=t.data("maskElem");clearTimeout(t.data("timeId")),clearTimeout(t.data("resId")),clearTimeout(t.data("hideTimer")),e.find("*").off(),t.data("iScroll")&&t.data("iScroll").destroy(),t._super(),e.off().remove()
  }}),t(document).on("pageInit",function(){t("[data-widget=suggestion]").each(function(e,n){var i=t(n),r=i.attr("data-source"),a=i.attr("data-listCount");t.ui.suggestion({container:n,source:r,listCount:a})})})}(Zepto),!function(t,e){t.ui.create("navigator",{_data:{container:"",defTab:0,isSwipe:!0,onverticalswipe:function(){},ontabselect:function(){}},_create:function(){var e=this,n=e.data("content"),i=e.data("fixContent");t.isArray(n)?(e._createNavUI(),i&&t.isArray(n)?e._createFixTab():e._createRenderFixTab()):(e._createRenderNavUI(),i&&t.isArray(n)?e._createFixTab():e._createRenderFixTab()),e.trigger("create")
  },_init:function(){var n=this,i=n.widget(),r=n.data("navList"),a=n.data("listWrap"),o=n.data("fixElem"),s=n.data("defTab"),c=n.data("tabNum"),u=[],l=t.bind(n._eventHandler,n),d="ortchange";n.data("fixNum")&&o&&o.each(function(t){this.index=t+c}),r.each(function(t){this.index=t,u[t]=t?u[t-1]+parseInt(this.offsetWidth):parseInt(this.offsetWidth)}),n.data("lastTabIndex",-1),n.data("tabWidthSumArr",u),a.css("width",u[c-1]+"px"),n._loaded(),n.data("wrapOffsetWidth",n.data("myScroll").scrollerW-u[c-1]),n.data("defTab")!=e&&(n.data("isDefTab",!0),n.switchTo(parseInt(s))),o&&o.on("tap",l),i.on("touchmove",l),t(window).on(d,l),n.on("destroy",function(){o&&o.off("click tap",l),i.off("touchmove",l),t(window).off(d,l)
  }),n.trigger("init")},_createNavUI:function(){for(var e,n,i,r=this,a=r.widget(),o=t(r.data("container")||document.body)[0],s=r.data("content"),c=s.length,u=r.data("instanceId"),l=[],d=[],h=0;c>h;h++)l[h]="<li><a href='javascript:;'>"+s[h].text+"</a></li>";i=t("<div class='ui-navigator-wrap'></div>"),n=t("<ul class='ui-navigator-list clearfix'></ul>"),e=t(l.join("")),i.append(n.prepend(e)),a?(a.append(i),a.parent().length?o!==document.body&&a.appendTo(o):a.appendTo(o)):a=r.widget(t("<div></div>").append(i)).appendTo(o),r.data({tabNum:c,screenWrap:i,listWrap:n,navList:e}),t.each(s,function(t,e){d.push(e.url)
  }),r.data("tabHref",d),a.addClass(u||"ui-navigator")},_createRenderNavUI:function(){var e=this,n=e.widget(),i=e.data("instanceId"),r=[];!n&&(n=e.widget(t(e.data("content")).parent())),e.data({screenWrap:n.find(".ui-navigator-wrap"),listWrap:n.find(".ui-navigator-list"),navList:n.find(".ui-navigator-list li")}),t.each(e.data("navList"),function(e,n){r.push(t(n).find("a")[0].href)}),e.data({tabNum:e.data("navList").length,tabHref:r}),n.addClass(i||"ui-navigator")},_createFixTab:function(){for(var e=this,n=e.widget(),i=e.data("fixContent"),r=[],a=0;a<i.length;a++){var o=t("<div class='ui-navigator-fix'><a href='"+i[a].url+"'>"+i[a].text+"</a></div>");
  "right"==i[a].pos?n.append(o):n.prepend(o)}t.each(i,function(t,e){r.push(e.url)}),e.data({fixTabHref:r,fixNum:i.length,fixElem:n.find(".ui-navigator-fix")})},_createRenderFixTab:function(){var e=this,n=e.widget(),i=n.find(e.data("fixContent")),r=[];t.each(i,function(e,n){r.push(t(n).find("a")[0].href)}),e.data({fixNum:i.length,fixElem:i,fixTabHref:r})},switchTo:function(e){var n,i=this,r=i.data("tabNum"),a=parseInt(e),o=i.data("fixElem"),s=i.data("navList"),c=i.data("myScroll"),u=i.data("lastTabIndex"),l=i.data("tabHref"),d=i.data("fixTabHref"),h="";
  if(a>=r){if(n=t(o[a-r]).children("a")[0],u==a)return n.href="javascript:;",i;h=d[a-r]}else{if(n=t(s[a]).children("a")[0],u==a)return n.href="javascript:;",i;h=l[a]}if(-1!=h.indexOf("#")||-1==u)n.href=h;else if(!/javascript/.test(h))return location.href=h,i;return a>=r?t(o[a-r]).addClass("fix-cur"):(t(s[a]).addClass("cur"),i.data("isSwipe")&&c.hScroll&&i._swipeNextPre(a,i._screenPos(a))),u>=r?t(o[u-r]).removeClass("fix-cur"):u>=0&&t(s[u]).removeClass("cur"),i.data("lastTabIndex",a),i.trigger("tabselect"),i
  },getCurTab:function(){var e=this,n=e.data("lastTabIndex"),i=e.data("content"),r=e.data("fixContent"),a=e.data("tabNum"),o=[],s=null;return t.isArray(i)?(o=n>=a?r[n-a]:i[n],s={text:o.text,url:o.url}):(o=n>=a?e.data("fixElem")[n-a]:e.data("navList")[n],s={text:t(o).find("a").html(),url:t(o).find("a")[0].href}),{index:n,info:s}},_switchEventHandle:function(n){var i=this,r="LI"==n.target.tagName?t(n.target)[0]:t(n.target).parents("li").get(0)||t(n.target).parents("div").get(0);r&&r.index!=e&&i.switchTo(r.index)
  },_loaded:function(){var e=this,n=e.data("screenWrap")[0],i=e.data("isSwipe")?!0:!1,r={};r=new iScroll(n,{hScroll:i,vScroll:!1,hScrollbar:!1,vScrollbar:!1,onScrollMove:function(){e.data("scrollTimer",setTimeout(t.bind(e._setShadow,e),1))},onScrollEnd:function(t){this.absDistY>this.absDistX&&e.trigger("verticalswipe",t)},onTouchEnd:function(t){this.moved||this.absDistY||this.isStopScrollAction||e._switchEventHandle(t)}}),e.data("myScroll",r)},_setShadow:function(){var t=this,e=t.data("screenWrap"),n=t.data("myScroll"),i=Math.abs(n.maxScrollX);
  n.x<0?(e.addClass("ui-navigator-shadowall"),Math.abs(n.x)>=i&&(e.removeClass("ui-navigator-shadowall"),e.addClass("ui-navigator-shadowleft"),e.removeClass("ui-navigator-shadowright"))):(e.removeClass("ui-navigator-shadowall"),e.removeClass("ui-navigator-shadowleft"),e.addClass("ui-navigator-shadowright"))},_touchMoveHandle:function(t){t.preventDefault()},_swipeNextPre:function(e,n){var i=this,r=0,a=i.data("tabNum"),o=i.data("navList"),s=i.data("myScroll"),c=i.data("isDefTab"),u=s.x||0;switch(n){case"defTab":r=i.data("defTabMoveX")||0,s.scrollTo(r,0,400),c&&(i.data("isDefTab",!1),i.data("defTabMoved",!0));
  break;case 0:r=0,s.scrollTo(r,0,400),c&&(i.data("isDefTab",!1),i.data("defTabMoved",!0));break;case a-1:r=s.wrapperW-s.scrollerW,s.scrollTo(r,0,400),c&&(i.data("isDefTab",!1),i.data("defTabMoved",!0));break;case"first":if(1==e&&!u)return;r=u+parseInt(o[e-1].offsetWidth),s.scrollTo(r,0,400);break;case"last":if(e==a-2&&Math.abs(u)==Math.abs(s.maxScrollX))return;r=u-parseInt(o[e-1].offsetWidth),s.scrollTo(r,0,400);break;case"middle":}i.data("isDefTab",!1),i.data("nextPreTimer",setTimeout(t.bind(i._setShadow,i),1))
  },_screenPos:function(t){var e=this,n=e.data("tabNum")-1;if(!t||t==n)return t;var i=e.data("navList"),r=e.data("tabWidthSumArr"),a=Math.abs(e.data("myScroll").x)||0,o=i[0].offsetLeft-e.data("screenWrap")[0].offsetLeft,s=r[t]+o-a,c=r[t-1]+o-a,u=r[t+1]+o-a,l=e.data("myScroll").wrapperW,d=parseInt(i[t].offsetWidth),h=parseInt(i[t-1].offsetWidth),f="middle";return e.data("isDefTab")?(f="defTab",e.data("defTabMoveX",l-s),f):f=h>c&&u>l?"middle":d>=s||h>c?"first":s>=l||u>l?"last":"middle"},_orientationEvent:function(){var t=this,e=t.data("myScroll"),n=t.data("wrapOffsetWidth"),i=t.data("defTab"),r=t.data("navList"),a=r[0].offsetLeft-t.data("screenWrap")[0].offsetLeft;
  e.refresh(),t.data("isSwipe")||t.data("listWrap").css("width",e.wrapperW-n+"px"),!t.data("isDefTab")&&t.data("defTabMoved")&&(e.scrollTo(e.wrapperW-t.data("tabWidthSumArr")[i]-a,0,400),t.data("defTabMoved",!1))},_eventHandler:function(t){var e=this;switch(t.type){case"click":case"tap":e._switchEventHandle(t);break;case"touchmove":e._touchMoveHandle(t);break;case"ortchange":e._orientationEvent(t)}},destroy:function(){var t=this,e=t.data("fixElem"),n=t.data("scrollTimer"),i=t.data("nextPreTimer"),r=t.data("orientTimer");
  e&&e.remove(),n&&clearTimeout(n),i&&clearTimeout(i),r&&clearTimeout(r),t.data("myScroll").destroy(),t._super()}}).attach("control.fix")}(Zepto),!function(t){var e=function(t){var e=arguments,n=t;try{n.setItem("cache","test"),n.removeItem("cache")}catch(i){try{n.clear(),n.setItem("cache","test"),n.removeItem("cache")}catch(i){n=e[1]?e.callee.apply(e,[].slice.call(e,1)):!1}}return delete e,n},n=function(){try{return e(localStorage,sessionStorage)}catch(t){return!1}}(),i=6e4,r=Date.now(),a=/^[\[{].+[\]}]$/,o=function(t){if(n){var e,a=60*i*24;
  if(t=t||0,(e=n.getItem("_expires"))&&e>r)return!1;for(var o,s,c,u=n.length,l=0;u>l;l++)s=n.key(l),o=n.getItem(s),o&&/_expires":\d+/.test(o)&&(c=o.match(/_expires":(\d+)/)[1],c>r||n.removeItem(s));return n.setItem("_expires",a*t+r)}};o(15),addEventListener("error",function(t){console.log(t,"错误事件"),/QUOTA_EXCEEDED_ERR/i.test(t.message)&&(n.clear(),alert("您的浏览器本地数据已经到达最大，已经帮您清空..."),location.reload())},!1),t.localStorage=function(e,o,s){if(!n)return!1;if(null===e&&n.clear(),"undefined"!=typeof o)return null===o?n.removeItem(e):(isNaN(+s)||(o={value:o,_expires:r+s*i}),n.setItem(e,t.isObject(o)?JSON.stringify(o):o),o.value||o);
  var c,u=null;return u=n.getItem(e),a.test(u)&&(u=JSON.parse(u),t.isObject(u)&&(c=u._expires)&&(r>c?(n.removeItem(e),u=null):u="string"==typeof(u=u.value)&&a.test(u)?JSON.parse(u):u)),u}}(Zepto),!function(t){t.ui.productlist=function(t){for(var e=[{id:"web",name:"网页",pos:{x:-1,y:0}},{id:"image",name:"图片",pos:{x:-104,y:0}},{id:"video",name:"视频",pos:{x:-154,y:0}},{id:"hao123",name:"上网导航",pos:{x:-104,y:-150}},{id:"tieba",name:"贴吧",pos:{x:-52,y:0}},{id:"zhidao",name:"知道",pos:{x:-1,y:-100}},{id:"wenku",name:"文库",pos:{x:-53,y:-100}},{id:"baike",name:"百科",pos:{x:-154,y:-50}},{id:"music",name:"音乐",pos:{x:-104,y:-50}},{id:"map",name:"地图",pos:{x:-1,y:-150}},{id:"app",name:"应用",pos:{x:-52,y:-50}},{id:"lvyou",name:"旅游",pos:{x:-103,y:-100}},{id:"fanyi",name:"翻译",pos:{x:-154,y:-150}},{id:"tuangou",name:"团购",pos:{x:-205,y:0}},{id:"tuiguang",name:"百度推广",pos:{x:-205,y:-50}}],n=["http://m.baidu.com/?bd_page_type=1&ssid=0&from=0&uid=&pu=sz%401320_2001&fr=","http://m.baidu.com/img?tn=bdidxiphone&itj=41&bd_page_type=1&ssid=0&from=0&uid=&pu=sz@1320_2001&fr=","http://m.baidu.com/video?fr=","http://m.hao123.com/?z=2&tn=baidunews","http://wapp.baidu.com/?lp=1065&amp;bd_page_type=1&amp;ssid=0&amp;from=0&amp;uid=&amp;pu=sz%401320_2001&amp;fr=","http://wapiknow.baidu.com/?st=3&amp;bd_page_type=1&amp;ssid=0&amp;from=0&amp;uid=&amp;pu=sz%401320_2001&amp;fr=","http://wk.baidu.com/?st=3&amp;bd_page_type=1&amp;ssid=0&amp;from=0&amp;uid=&amp;pu=sz%401320_2001&amp;fr=","http://wapbaike.baidu.com/?st=3&amp;bd_page_type=1&amp;ssid=0&amp;from=0&amp;uid=&amp;pu=sz%401320_2001&amp;fr=","http://mp3.baidu.com/mobile.html?bd_page_type=1&amp;ssid=0&amp;from=0&amp;uid=&amp;pu=sz%401320_2001&amp;fr=","http://map.baidu.com?bd_page_type=1&amp;ssid=0&amp;from=0&amp;uid=&amp;pu=sz%401320_2001&amp;fr=","http://m.baidu.com/app?bd_page_type=1&amp;ssid=0&amp;from=0&amp;uid=&amp;pu=sz%401320_2001&amp;fr=","http://lvyou.baidu.com?bd_page_type=1&amp;ssid=0&amp;from=0&amp;uid=&amp;pu=sz%401320_2001&amp;fr=","http://fanyi.baidu.com/?from=xinwen","http://mtuan.baidu.com/view?z=2&from=map_webapp","http://e.baidu.com/m2/?refer=707"],i=0;i<e.length;i++)e[i].url=n[i];
  for(i=0;i<e.length;i++)if(e[i].id==t){e.splice(i,1);break}return e}}(Zepto),!function(t){function e(e,i){var c=e[s],u=c&&r[c];if(void 0===i)return u||n(e);if(u){if(i in u)return u[i];var l=o(i);if(l in u)return u[l]}return a.call(t(e),i)}function n(e,n,a){var c=e[s]||(e[s]=++t.uuid),u=r[c]||(r[c]=i(e));return void 0!==n&&(u[o(n)]=a),u}function i(e){var n={};return t.each(e.attributes,function(t,e){0==e.name.indexOf("data-")&&(n[o(e.name.replace("data-",""))]=e.value)}),n}var r={},a=t.fn.data,o=t.zepto.camelize,s=t.expando="Zepto"+ +new Date;
  t.fn.data=function(i,r){return void 0===r?t.isPlainObject(i)?this.each(function(e,r){t.each(i,function(t,e){n(r,t,e)})}):0==this.length?void 0:e(this[0],i):this.each(function(){n(this,i,r)})},t.fn.removeData=function(e){return"string"==typeof e&&(e=e.split(/\s+/)),this.each(function(){var n=this[s],i=n&&r[n];i&&t.each(e,function(){delete i[o(this)]})})}}(Zepto),function(t){var e=/^(?:body|html)$/i;t.extend(t.fn,{offsetParent:function(){return t(t.map(this,function(n){for(var i=n.offsetParent||document.body;i&&!e.test(i.nodeName)&&"static"==t(i).css("position");)i=i.offsetParent;
  return i}))},scrollTop:function(){return this.length?"scrollTop"in this[0]?this[0].scrollTop:this[0].scrollY:void 0}}),t.extend(t,{contains:function(t,e){return t.compareDocumentPosition?!!(16&t.compareDocumentPosition(e)):t!==e&&t.contains(e)}})}(Zepto),function(t){t.extend(t,{toString:function(t){return Object.prototype.toString.call(t)},slice:function(t,e){return Array.prototype.slice.call(t,e||0)},later:function(t,e,n,i,r){return window["set"+(n?"Interval":"Timeout")](function(){t.apply(i,r)},e||0)
  },parseTpl:function(t,e){var n="var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('"+t.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/<%=([\s\S]+?)%>/g,function(t,e){return"',"+e.replace(/\\'/g,"'")+",'"}).replace(/<%([\s\S]+?)%>/g,function(t,e){return"');"+e.replace(/\\'/g,"'").replace(/[\r\n\t]/g," ")+"__p.push('"}).replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t")+"');}return __p.join('');",i=new Function("obj",n);return e?i(e):i},throttle:function(e,n,i){function r(){function t(){o=Date.now(),n.apply(s,u)
  }function r(){a=void 0}var s=this,c=Date.now()-o,u=arguments;i&&!a&&t(),a&&clearTimeout(a),void 0===i&&c>e?t():a=setTimeout(i?r:t,void 0===i?e-c:e)}var a,o=0;return"function"!=typeof n&&(i=n,n=e,e=250),r._zid=n._zid=n._zid||t.proxy(n)._zid,r},debounce:function(e,n,i){return void 0===n?t.throttle(250,e,!1):t.throttle(e,n,void 0===i?!1:i!==!1)}}),t.each("String Boolean RegExp Number Date Object Null Undefined".split(" "),function(e,n){var i="";switch(n){case"Null":i="obj === null";break;case"Undefined":i="obj === undefined";
  break;default:i="new RegExp('"+n+"]', 'i').test(Object.prototype.toString.call(obj))"}t["is"+n]=new Function("obj","return "+i)})}(Zepto),function(t){var e=navigator.userAgent,n=navigator.appVersion,i=t.browser;t.extend(t.browser,{qq:/qq/i.test(e),chrome:/chrome/i.test(e)||/CriOS/i.test(e),uc:/UC/i.test(e)||/UC/i.test(n)}),t.browser.uc=t.browser.uc||!t.browser.qq&&!t.browser.chrome&&!/safari/i.test(e);try{t.browser.version=i.uc?n.match(/UC(?:Browser)?\/([\d.]+)/)[1]:i.qq?e.match(/MQQBrowser\/([\d.]+)/)[1]:i.chrome?e.match(/(?:CriOS|Chrome)\/([\d.]+)/)[1]:i.version
  }catch(r){}t.support=t.extend(t.support||{},{orientation:!(t.browser.uc||parseFloat(t.os.version)<5&&(t.browser.qq||t.browser.chrome))&&"orientation"in window&&"onorientationchange"in window,touch:"ontouchend"in document,cssTransitions:"WebKitTransitionEvent"in window,has3d:"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix})}(Zepto),function(t){function e(){t(window).on("scroll",t.debounce(80,function(){t(document).trigger("scrollStop")},!1))}function n(){t(window).off("scroll"),e()}t(document).ready(function(){var e,n,i="matchMedia"in window?function(){return window.matchMedia("(orientation: portrait)").matches?"portrait":"landscape"
  }:function(){var t=document.documentElement;return t.clientWidth/Math.max(t.clientHeight,320)<1.1?"portrait":"landscape"},r=i(),a=function(a){return"orientationchange"==a.type?t(window).trigger("ortchange"):(n=20,clearInterval(e),void(e=t.later(function(){var a=i();r!==a?(r=a,clearInterval(e),t(window).trigger("ortchange")):--n&&clearInterval(e)},50,!0)))};t(window).bind(t.support.orientation?"orientationchange":"resize",t.debounce(a))}),e(),t(window).on("pageshow",function(e){e.persisted&&t(document).off("touchstart",n).one("touchstart",n)
  })}(Zepto),!function(t){var e;t.fn.imglazyload=function(n){function i(i){var r,a=t(i);t.isFunction(n.startload)&&n.startload.call(a),r=t("<img />").on("load",function(){a.trigger("loadcomplete",r).replaceWith(r),r.off("load")}).on("error",function(){var n=t.Event("error");a.trigger(n),n.defaultPrevented||e.push(i),r.off("error").remove()}).attr("src",a.attr(n.urlName))}function r(n){var r,o,s,c;for(r=e.length;r--;)o=t(c=e[r]),s=o.offset(),u[n||"default"](s.top,s.height)&&(a.call(e,r,1),i(c))}var a=Array.prototype.splice,n=t.extend({threshold:0,container:window,urlName:"data-url",placeHolder:"",eventName:"scrollStop",startload:null,refresh:!1},n),o=t(n.container),s=o.scrollTop(),c=o.height(),u={init:function(t,e){return s>=t-n.threshold-c&&t+e>=s
  },"default":function(t,e){var i=o.scrollTop(),r=o.height();return i>=t-n.threshold-r&&t+e>=i}};return e=t.slice(this).reverse(),n.refresh?this:(t(document).ready(function(){n.placeHolder&&t(e).append(n.placeHolder),r("init")}),(n.container===window?t(document):o).on(n.eventName+" ortchange",function(){r()}),this)}}(Zepto),+function(t){var e=function(e,n){this.element=t(e),this.params=t.extend({},this.getDefaults(),n||{}),this.selector=this.params._itemSelector,this._listSelector=this.params._listSelector,this._itemSelector=this.params._itemSelector,this._iconSelector=this.params._iconSelector,this._itemContainer=this.element.find(this._listSelector),this._iconContainer=this.element.find(this._iconSelector),this._startX=0,this._startY=0,this._lastX=0,this._isLoop=this.params.isLoop,this.isAutoPlay=this.params.isAutoPlay;
  var i=this.params.preWidth;this._listW=this.element.width()||(100>i?t("body").width()-10:i),this._curIndex=this.params.startIndex,this._items=this._itemContainer.children(this._itemSelector),this._len=Math.ceil(this._items.length/this.params.preCount),this.init("slider")};e.DEFAULTS={_listSelector:".g-list",_itemSelector:".g-item",_iconSelector:".g-icons",startIndex:0,iconCurClass:"cur",isLoop:!0,isAutoPlay:!0,isLazyLoad:!0,preCount:2,theme:"",preWidth:310,onItemClick:function(){},onAfterChange:function(){}},e.prototype.move=function(t){var e=this,n=this._iconContainer,i=e.params;
  setTimeout(function(){n.find("i").eq(t).addClass(i.iconCurClass).siblings("i").removeClass(i.iconCurClass),i.onAfterChange(t)},200)},e.prototype.getDefaults=function(){return e.DEFAULTS},e.prototype.init=function(){var e,n=this,i=n._itemContainer,r=n.selector,a=this._iconContainer,o=e=n._len,s=n.params.isLazyLoad,c=n.params.isLoop;for(n.domInit(),s&&(c?n.loopLazyLoad(n._curIndex):n.lazyLoad(n._curIndex));e--;)a.append("<i></i>");a.find("i").eq(n.params.startIndex).addClass(n.params.iconCurClass),o>1?i.on("touchstart",r,t.proxy(n.touchstart,n)).on("touchmove",r,t.proxy(n.touchmove,n)).on("touchend",r,t.proxy(n.touchend,n)).on("click",r,t.proxy(n.itemClick,n)):i.on("click",r,t.proxy(n.itemClick,n)),n.params.isAutoPlay&&(setInterval(function(){n.isAutoPlay&&n.autoPlay()
  },5e3),n._itemContainer.on("webkitTransitionEnd",t.proxy(n.resetPos,n),!1))},e.prototype.domInit=function(){var t=this;if(t.element.addClass(t.params.theme),t._items.each(function(e){t._items.eq(e).css({width:1/t.params.preCount*100+"%"})}),t.params.isLoop){for(var e=0;e<t.params.preCount;e++)t._itemContainer.append(t._items.eq(e).clone());for(var n=1;n<=t.params.preCount;n++)t._itemContainer.prepend(t._items.eq(t._items.length-n).clone());t._itemContainer.css({"-webkit-transform":"translateX("+-t._listW*(t._curIndex+1)+"px)"})
  }},e.prototype.touchstart=function(t){if(t.touches){var e=this;e._startX=e._lastX=t.touches[0].clientX,e._startY=e._lastY=t.touches[0].clientY,e.curX=-e._listW*(e.params.isLoop?e._curIndex+1:e._curIndex),e.isAutoPlay=!1,e.resetPos(e._curIndex)}},e.prototype.touchmove=function(t){if(t.touches){var e=this,n=t.changedTouches[0].clientX,i=t.changedTouches[0].clientY,r=n-e._lastX,a=(i-e._lastY,webappandroid.helper.getAngle(e._startX,e._startY,n,i));50>a||isNaN(a)||(e._lastX=n,e._lastY=i,e.curX+=r,e._itemContainer.css({"-webkit-transform":"translateX("+e.curX+"px)"}),t.preventDefault())
  }},e.prototype.touchend=function(t){if(t.touches){var e=this,n=e._curIndex,i=e.params.isLoop,r=e._len,a=t.changedTouches[0].clientX,o=t.changedTouches[0].clientY,s=webappandroid.helper.getAngle(e._startX,e._startY,e._lastX,e._lastY),c=a-e._startX,u=o-e._startY,l=i?-1:0,d=i?r:r-1;if((0!==c||0!==u)&&!(50>s||isNaN(s))){c>50&&n!==l&&(n-=1,e.move(n)),-50>c&&n!==d&&(n+=1,e.move(n));var c=-e._listW*(i?n+1:n);e.timeout=setTimeout(function(){e._itemContainer.css({"-webkit-transition":"-webkit-transform 350ms ease-out","-webkit-transform":"translateX("+c+"px)"}),clearTimeout(e.timeout)
  },0),e.params.isLazyLoad&&(i?e.loopLazyLoad(n):e.lazyLoad(n)),!i||n!=d&&n!=l||(n=n==d?r-d:n==l?r+l:n,e.move(n)),e._curIndex=n,t.preventDefault()}}},e.prototype.autoPlay=function(){var t=this,e=t._curIndex,n=t.params.isLoop,i=t._len,r=n?-1:0,a=n?i:i-1;e+=1,t.move(e);var o=-t._listW*(n?e+1:e);t.timeout=setTimeout(function(){t._itemContainer.css({"-webkit-transition":"-webkit-transform 350ms ease-out","-webkit-transform":"translateX("+o+"px)"}),clearTimeout(t.timeout)},0),t.params.isLazyLoad&&(n?t.loopLazyLoad(e):t.lazyLoad(e)),!n||e!=a&&e!=r||(e=e==a?i-a:e==r?i+r:e,t.move(e)),t._curIndex=e
  },e.prototype.resetPos=function(){var t=this,e=t._curIndex;t.loopLazyLoad(e),t._itemContainer.css({"-webkit-transform":"translateX("+-t._listW*(e+1)+"px)","-webkit-transition":"none"}),t.isAutoPlay||(t._timer&&clearTimeout(t._timer),t._timer=setTimeout(function(){t.isAutoPlay=!0},5e3))},e.prototype.loopLazyLoad=function(t){for(var e=this,n=0,i=e.params.preCount;i>n;n++)e.load(e._itemContainer.find(e._itemSelector).eq((t+1)*i+n).find("img.lazy-load"))},e.prototype.lazyLoad=function(t){for(var e=this,n=0,i=e.params.preCount;i>n;n++)e.load(e._items.eq(t*i+n).find("img.lazy-load"))
  },e.prototype.load=function(e){var n,i=t(e);n=t("<img />").on("load",function(){i.replaceWith(n),i.removeAttr("data-url"),n.off("load")}).on("error",function(){n.off("error").remove()}).attr("src",i.attr("data-url"))},e.prototype.itemClick=function(e){var n=this;n.params.onItemClick(t(e.target).closest(n.selector)),e.preventDefault()},e.prototype.reset=function(){var t,e=this;e._listW=e._itemContainer.width(),t=-e._listW*(e.params.isLoop?e._curIndex+1:e._curIndex),e._itemContainer.css({"-webkit-transform":"translateX("+t+"px)"})
  },e.prototype.destroy=function(){clearTimeout(this.timeout),this.hide().$element.off("."+this.type).removeData("bs."+this.type)};var n=t.fn.topicSlider;t.fn.topicSlider=function(n){return this.each(function(){var i=t(this),r=i.data("bs.slider"),a="object"==typeof n&&n;r||i.data("bs.slider",r=new e(this,a)),"string"==typeof n&&r[n]()})},t.fn.topicSlider.Constructor=e,t.fn.topicSlider.noConflict=function(){return t.fn.topicSlider=n,this}}(Zepto),+function(t){var e=function(e,n){this.element=t(e),this.params=t.extend({},this.getDefaults(),n||{}),this.selector=this.params._itemSelector,this._listSelector=this.params._listSelector,this._itemSelector=this.params._itemSelector,this._iconSelector=this.params._iconSelector,this._itemContainer=this.element.find(this._listSelector),this._iconContainer=this.element.find(this._iconSelector),this._startX=0,this._startY=0,this._lastX=0,this._curIndex=this.params.startIndex,this._items=this._itemContainer.children(this._itemSelector),this._len=Math.ceil(this._items.length/this.params.preCount),this.init()
  };e.DEFAULTS={_listSelector:".g-list",_itemSelector:".g-item",_iconSelector:".g-icons",startIndex:0,preCount:2,preWidth:310,weight:10,onItemClick:function(){},onAfterChange:function(){}},e.prototype.move=function(){var t=this;this._iconContainer,t.params},e.prototype.getDefaults=function(){return e.DEFAULTS},e.prototype.init=function(){var e,n=this,i=n._itemContainer,r=n.selector;this._iconContainer,e=n._len,n.touchMoveLock=!1,n.domInit(),i.on("touchstart",r,t.proxy(n.touchstart,n)).on("touchmove",r,t.proxy(n.touchmove,n)).on("touchend",r,t.proxy(n.touchend,n))
  },e.prototype.domInit=function(){for(var e=this,n='<li class="g-item">{num}</li>',i="",r=1;10>=r;r++)i+=n.replace("{num}",r);e._itemContainer.html(i),e._items=e._itemContainer.find(e._itemSelector),e._items.each(function(t){e._items.eq(t).css({width:1/e.params.preCount*100+"%"})}),e._singleWidth=(e._itemContainer.width()||t("body").width()-52)/e.params.preCount,e.curX=(3-e.params.weight)*e._singleWidth,e.setCurItem(e.params.weight-1),e.moveDistance(e.curX)},e.prototype.setCurItem=function(t){var e=this;
  e._items.filter(".cur-model").removeClass("cur-model"),e._items.eq(t).addClass("cur-model")},e.prototype.moveDistance=function(t){var e=this;e._itemContainer.css({"margin-left":t+"px"})},e.prototype.touchstart=function(t){if(t.touches){var e=this;e._startX=e._lastX=t.touches[0].clientX,e._startY=e._lastY=t.touches[0].clientY,e.curX=e.curX||0}},e.prototype.touchmove=function(t){if(t.touches){var e=this;if(e.touchMoveLock)return void t.preventDefault();e.touchMoveLock=!0,setTimeout(function(){e.touchMoveLock=!1
  },100);var n=t.changedTouches[0].clientX,i=t.changedTouches[0].clientY,r=n-e._lastX,a=(i-e._lastY,webappandroid.helper.getAngle(e._startX,e._startY,n,i));if(!(50>a||isNaN(a))){e._lastX=n,e._lastY=i,e.curX+=r,e._singleWidth<60&&(e._singleWidth=e._itemContainer.width()/e.params.preCount);var o=Math.round(e.curX/e._singleWidth),s=2-o;0>s?(o=2,s=0):s>9&&(o=-7,s=9),setTimeout(function(){e.params.onMoveAfter(s+1)},10),e.moveDistance(e.curX),t.preventDefault()}}},e.prototype.touchend=function(t){if(t.touches){var e,n=this,i=(n._curIndex,n.params.isLoop,n._len,t.changedTouches[0].clientX),r=t.changedTouches[0].clientY,a=webappandroid.helper.getAngle(n._startX,n._startY,n._lastX,n._lastY),o=i-n._startX,s=r-n._startY;
  if((0!==o||0!==s)&&!(50>a||isNaN(a))){n._singleWidth<60&&(n._singleWidth=n._itemContainer.width()/n.params.preCount),e=o>0?Math.ceil(n.curX/n._singleWidth):Math.floor(n.curX/n._singleWidth);var c=2-e;0>c?(e=2,c=0):c>9&&(e=-7,c=9);var u=e*n._singleWidth;n.curX=u,n.timeout=setTimeout(function(){n._itemContainer.css({"-webkit-transition":"margin-left 350ms cubic-bezier(0, 0, 0.25, 1)","margin-left":n.curX+"px"}),clearTimeout(n.timeout)},0),setTimeout(function(){n.setCurItem(c)},20),t.preventDefault()
  }}},e.prototype.destroy=function(){clearTimeout(this.timeout),this.hide().$element.off("."+this.type).removeData("bs."+this.type)};var n=t.fn.topicGauge;t.fn.topicGauge=function(n){return this.each(function(){var i=t(this),r=i.data("bs.gauge"),a="object"==typeof n&&n;r||i.data("bs.gauge",r=new e(this,a)),"string"==typeof n&&r[n]()})},t.fn.topicGauge.Constructor=e,t.fn.topicGauge.noConflict=function(){return t.fn.topicGauge=n,this}}(Zepto),+function(t){var e=function(e,n){this.element=t(e),this.params=t.extend({},this.getDefaults(),n||{}),this._startX=0,this._startY=0,this._lastX=0,this.curY=0,this.selector=this.params.selector,this.init("slider")
  };e.DEFAULTS={startIndex:0,preWidth:310,direction:"y",onItemClick:function(){},onAfterChange:function(){},onTouchStart:function(){},onTouchMove:function(){},onTouchEnd:function(){}},e.prototype.getDefaults=function(){return e.DEFAULTS},e.prototype.init=function(){var e=this;e.element.on("touchstart",e.selector,t.proxy(e.touchstart,e)).on("touchmove",e.selector,t.proxy(e.touchmove,e)).on("touchend",e.selector,t.proxy(e.touchend,e))},e.prototype.touchstart=function(t){if(t.touches){var e=this;e._startX=e._lastX=t.touches[0].clientX,e._startY=e._lastY=t.touches[0].clientY
  }},e.prototype.touchmove=function(t){if(t.touches){var e,n=this,i=t.changedTouches[0].clientX,r=t.changedTouches[0].clientY,a=(i-n._lastX,r-n._lastY),o=webappandroid.helper.getAngle(n._startX,n._startY,i,r);"y"==n.params.direction&&o>45||"x"==n.params.direction&&45>o||(n._lastX=i,n._lastY=r,e=n.curY+a,e>=n.params.limitRange.getMin()&&e<=n.params.limitRange.max&&(n.curY+=a,n.params.onTouchMove(n.curY)),t.preventDefault())}},e.prototype.touchend=function(t){if(t.touches){var e=this;e.params.onTouchEnd(e.curY)
  }},e.prototype.reset=function(){var t=this;t.curY=0};var n=t.fn.touch;t.fn.touch=function(n){return this.each(function(){var i=t(this),r=i.data("bs.slider"),a="object"==typeof n&&n;r||i.data("bs.slider",r=new e(this,a)),"string"==typeof n&&r[n]()})},t.fn.touch.Constructor=e,t.fn.touch.noConflict=function(){return t.fn.touch=n,this}}(Zepto),!function(t){function e(e){var n=this,i={isFollow:!1,animTime:500,curIndex:0,_wrapLeftIndex:0,loop:0,loopDir:1,pages:[],lazyLoad:!1,beforechange:function(){},afterchange:function(){}};
  return n.options=t.extend(i,e),n.init(),n}e.prototype={init:function(){var e=this;e.$el=t(e.options.$el),e.options._lazyLoad=!e.options.loop&&e.options.lazyLoad,e._wrapLeftIndex=e.options._wrapLeftIndex,e.curIndex=e.options.curIndex,e.options.beforechange(e.curIndex),e._initNodes(),e.options.afterchange(e.curIndex);var n=e.options.loop;e.touchEnabled=!!e.options.touchEnabled,e.touchEnabled&&(e.options.isFollow?e.initTouchFollow():e.initTouch());var i,r;if(e.$container[0].addEventListener("webkitTransitionEnd",e,!1),e._resizeListener=i=e.delay(function(){e.$el[0].offsetHeight&&t.later(function(){e.refreshPos(),n&&e.startAutoLoop()
  },500)},200),addEventListener("onorientationchange"in window?"orientationchange":"resize",i),e.options.loop){var a,o=e.options.loopDir<0?"toLeft":"toRight",s=e.touchEv;e._bodyEventListener=r=function(t){e[(s.START_EV===t.type?"stop":"start")+"AutoLoop"]()},t(window).on(s.START_EV+" "+s.END_EV,r),e.stopAutoLoop=function(){return a&&(clearTimeout(a),a=null),e},e.startAutoLoop=function(){return e.stopAutoLoop(),a=setTimeout(function(){a=null,e.$el[0].offsetHeight&&e[o]()},e.options.loop),e},e.startAutoLoop()
  }return e},_initNodes:function(){var e,n,i,r=this,a=0,o=r._contentWidth=r.options.width||r.$el[0].clientWidth||t(window).width(),s=r,c=/<\//g,u=s.options._lazyLoad,l=s.curIndex,d=r.$el.html();if(!d.trim())for(var h=0;h<r.options.pages.length;h++)d+="<div></div>";d=d.replace(c,function(t){return(u&&a!==l?"":s.getPage(a++))+t}),r.$el.html('<div  style="display: -webkit-box;-webkit-transform: translate3d('+l+"px, 0px, 0px);-webkit-user-select: none;-webkit-transition: -webkit-transform "+r.options.animTime+'ms cubic-bezier(0, 0, 0.25, 1)">'+d+"</div>"),r.$container=r.$el.children(),e=r.nodes=r.$container.children(),r.maxIndex=(n=r.nodesLength=e.length)-1;
  var f=Math.ceil(n/2),p=s._nodes=[];return e.forEach(function(t,e){i=f>e?e:-(n-e),p.push({node:t,left:i,index:e}),t.style.cssText+=";-webkit-transform: translate(-"+e+"00%, 0) translate3d("+i*o+"px, 0px, 0px);"}),p.sort(function(t,e){return t.left-e.left}),r.curIndex=0,r.move(l,0),r},refreshPos:function(){var t=this._contentWidth=this.$el[0].clientWidth,e=this;return this.setNodeLeft(this.$container[0],this._wrapLeftIndex*t),this._nodes.forEach(function(n){e.setNodeLeft(n.node,n.left*t)}),this},setNodeLeft:function(t,e){var n=t.style;
  return n.cssText=n.cssText.replace(/translate3d\(([-\d]+)px/g,"translate3d("+e+"px"),this},_setNodesTranslate:function(t){var e,n,i,r,a=this._nodes,o=this._contentWidth,s=this.nodesLength-1;return this.curIndex,0!=t?(0>t?(e="unshift",n="pop",i=a[0].left-1):(e="push",n="shift",i=a[s].left+1),r=a[n](),r.left=i,a[e](r),this.setNodeLeft(r.node,i*o),this):void 0},toLeft:function(){return this.move(this.curIndex-1)},toRight:function(){var t=this;return t.curIndex>=t.maxIndex&&t.options.onLast?(t.touchEnabled=!0,t.options.onLast(),t):this.move(this.curIndex+1)
  },toCurrent:function(){return this.move(this.curIndex)},getPage:function(e){var n=this.options.pages[e],i=t.isFunction(n)?n():n instanceof Element?n.outerHTML:n;return i},handleEvent:function(t){"webkitTransitionEnd"===t.type&&(this.options.afterchange(this.curIndex),this.touchEnabled=!0,this.options.loop&&this.startAutoLoop())},move:function(e,n){var i,r=this._wrapLeftIndex=this._wrapLeftIndex+(this.curIndex-e),a=this,i=0>e?this.maxIndex:e>this.maxIndex?0:e,o=this.curIndex-e,s=o>0?-1:1,a=this;if(e>this.maxIndex&&a.options.onLast)return a.options.onLast(),this;
  for(o&&(a.options._lazyLoad&&(curpage=a.nodes[i],!curpage.firstElementChild&&(curpage.innerHTML=a.getPage(i))),a.curIndex=i,a.options.beforechange(i));o;)o+=s,a._setNodesTranslate(s);return this.setAnimTime(n).setNodeLeft(this.$container[0],r*this._contentWidth),t.later(function(){a.setAnimTime(0)}),this},setAnimTime:function(t){return t=void 0===t?this.options.animTime:t,this.$container.css("-webkit-transition","-webkit-transform "+t+"ms cubic-bezier(0, 0, 0.25, 1)"),this},delay:function(t,e){var n,i,r=function(){clearTimeout(n),i?n=setTimeout(r,e):(i=!0,t(),setTimeout(function(){i=!1
  },e))};return r},touchEv:function(){var t=/hp-tablet/gi.test(navigator.appVersion),e="ontouchstart"in window&&!t;return{hasTouch:e,START_EV:e?"touchstart":"mousedown",MOVE_EV:e?"touchmove":"mousemove",END_EV:e?"touchend":"mouseup"}}(),initTouch:function(){var e,n,i={},r=this,a=this.touchEv;return this.$el.on(a.START_EV,function(t){r.touchEnabled&&t.touches&&1===t.touches.length&&(i.x1=t.touches[0].clientX,i.y1=t.touches[0].clientY,e=setTimeout(function(){e=null},800))}).on(a.MOVE_EV,function(t){!r.touchEnabled||!t.touches||r.maxIndex<=0||e&&(i.x2=t.touches[0].clientX,i.y2=t.touches[0].clientY,n=r.swipeDirection(i.x1,i.x2,i.y1,i.y2),("Left"==n||"Right"==n)&&t.preventDefault())
  }),r._touchEndListener=function(){r.touchEnabled&&(e&&i.x2&&Math.abs(i.x1-i.x2)>5&&(r.touchEnabled=!1,"Left"==n?r.toRight():"Right"==n?r.toLeft():r.touchEnabled=!0),i={})},t(window).on(a.END_EV,r._touchEndListener),this},initTouchFollow:function(){var e,n,i,r=this.touchEv,a=this,o=null,s=0,c=0,u=0,l=0,d=0,h=0,f=this.$container[0];return this.$el.on(r.START_EV,function(t){t.touches&&(a.touchEnabled||1==t.touches.length)&&(r.hasTouch||t.preventDefault(),a.setAnimTime(0),o=!0,moveRead=!1,s=t.touches[0].clientX,c=t.touches[0].clientY,d=s,n=a._wrapLeftIndex*a._contentWidth,h=0)
  }).on(r.MOVE_EV,function(t){if(t.touches&&o&&a.touchEnabled&&!(a.maxIndex<=0)){var i=t.touches[0].clientX,r=t.touches[0].clientY;if(moveRead)e=i-d,a.setNodeLeft(f,n+=e),h=e>0?1:-1,d=i;else{var u=Math.abs(i-s),l=Math.abs(r-c);u/l>1?(t.preventDefault(),t.stopPropagation(),r=null,moveRead=!0):l>5&&(o=!1,r=null)}}}),a._touchEndListener=function(){o&&a.touchEnabled&&(a.touchEnabled=!1,o=!1,i=d-s,i>50?a.toLeft():-50>i?a.toRight():(a.toCurrent(),a.touchEnabled=!0),o=s=c=u=l=d=e=n=h=i=null)},t(window).on(r.END_EV,a._touchEndListener),this
  },swipeDirection:function(t,e,n,i){var r=Math.abs(t-e),a=Math.abs(n-i);return r>=a?t-e>0?"Left":"Right":n-i>0?"Up":"Down"},destory:function(t){var e=this;e.stopAutoLoop&&e.stopAutoLoop(),removeEventListener("onorientationchange"in window?"orientationchange":"resize",e._resizeListener),e.$container[0].removeEventListener("",e,!1),e.$el.off(),t&&e.$el.empty(),e.options.$el=null,e.options=null}},t.fn.touchCarousel=function(t){t.$el=this;var n=new e(t);return n}}(Zepto),!function(t,e,n,i){function r(){function t(){return l.setState(s.PREBUFFER)
  }function e(t){var e,n;return e=t.loaded||0,n=t.total||1,l.setState(s.BUFFERING),l.trigger(o.PROGRESS,e&&1*(e/n).toFixed(2)||l.getBufferedTime())}function n(){return l.setState(s.PLAYING),l.trigger(o.PLAYING,l.getCurTime())}function i(){return l.setState(l.getCurTime()&&s.PAUSE||s.STOP,l.getCurTime())}function r(){return l.setState(s.END)}function a(){return l.setState(s.END),l.trigger(o.ERROR,ERRCODE.MEDIA_ERR_NETWORK)}function c(){return l.setState(s.WAITTING)}function u(){return l.trigger(o.POSITIONCHANGE,l.getCurTime())
  }var l=this;return this.audio.on=function(t,e){return l.audio.addEventListener(t,e,!1),l.audio},this.audio.off=function(t,e){return l.audio.removeEventListener(t,e,!1),l.audio},this.audio.on("loadstart",t).on("playing",n).on("pause",i).on("ended",r).on("error",a).on("waiting",c).on("timeupdate",u).on("progress",e),this}function a(t,n){if(this.opts=e.extend({},l,t),this.opts.oneinstance&&a.instance)return a.instance;var i,o,c,u;u=this.opts,c={"":0,maybe:1,probably:2},o=c[u.confidence],i=n||new Audio,a.instance=this,i.preload=u.preload,i.autoplay=u.autoplay,i.loop=!1,this.audio=i,r.call(this),this.setState(s.NOT_INIT)
  }var o={STATECHANGE:"audio:statechange",POSITIONCHANGE:"audio:postionchange",PROGRESS:"audio:progress",ERROR:"audio:error",LOADDATA:"audio:loadeddata",INIT:"audio:init",PLAYING:"audio:playing",INIT_FAIL:"audio:init_fail"},s={NOT_INIT:"noinit",PREBUFFER:"prebuffer",BUFFERING:"buffering",WAITTING:"waiting",PLAYING:"playing",PAUSE:"pause",STOP:"stop",END:"ended"};ERRCODE={MEDIA_ERR_ABORTED:"1",MEDIA_ERR_NETWORK:"2",MEDIA_ERR_DECODE:"3",MEDIA_ERR_SRC_NOT_SUPPORTED:"4"};var c=function(t){return t.toString().length<2?"0"+t:t
  },u=function(t){t=parseInt(t,10);var e=c(Math.floor(t/60)),n=c(Math.floor(t%60));return e+":"+n},l={confidence:"maybe",preload:!1,oneinstance:!0,autoplay:!1};a.isSupported=function(){try{var t=!!document.createElement("audio").canPlayType;return t}catch(e){return!1}},a.prototype.play=function(){return this.audio.play(),this},a.prototype.togglePlay=function(){return this.audio.paused?this.play():this.pause(),this},a.prototype.pause=function(){try{this.audio.pause()}catch(t){}finally{}return this},a.prototype.stop=function(){try{this.audio.currentTime=0
  }catch(t){}finally{this.pause()}return this},a.prototype.load=function(t){return null==t&&(t=""),this.audio.src=t,this.setState(s.NOT_INIT),this.audio.load(),this},a.prototype.getUrl=function(){return this.audio.src},a.prototype.canPlay=function(t){return this.audio.canPlayType(t)?!0:!1},a.prototype.canMP3=function(){return this.canPlay("audio/mpeg")},a.prototype.setState=function(t,e){var n;return t!==this._state?(n=this._state,this._state=t,this.trigger(o.STATECHANGE,{oldState:n,newState:t,context:e})):void 0
  },a.prototype.getState=function(){return this._state},a.prototype.setVolume=function(t){return this.audio.volume=t/100,this},a.prototype.setMute=function(t){return this.audio.muted=t,this},a.prototype.setCurTime=function(t){try{this.audio.currentTime=t}catch(e){}finally{}return this},a.prototype.setCurPosition=function(t){this.setCurTime(t*this.getTotalTime())},a.prototype.getCurTime=function(){return this.audio.currentTime},a.prototype.getTotalTime=function(){var t;return t=this.audio.duration,t&&t||0
  },a.prototype.getBufferedTime=function(){var t,e,n,i,r,a;for(t=this.audio,r=t.duration,i=t.buffered,n=i.length,e=0;n--;)if(i.start(n)<=(a=t.currentTime)&&a<=i.end(n)){e=i.end(n);break}return e=e>r?r:e},a.prototype.getSeekableTime=function(){var t=0,e=this.audio;return e.seekable.length>0&&(t=e.seekable.end(e.seekable.length-1)),t},a.prototype.getCanPlayPercent=function(){var t=this.getTotalTime(),e=this.getSeekableTime();return 0==e&&(e=this.getBufferedTime()),t&&1*(e/t).toFixed(2)||0},a.prototype.getCurTimeFormate=function(){return u(this.getCurTime())
  },a.prototype.getTotalTimeFormate=function(){return u(this.getTotalTime())},a.prototype.formateTime=function(t){return u(t)},n.extend(a.prototype,i),a.EVENTS=o,a.STATES=s,a.ERRCODE=ERRCODE,t.AudioEngine=a}(this,Zepto,_,Backbone.Events);