var Zepto=function(){function f(a){return a.filter(function(c){return c!==i&&c!==null})}function h(a){return a.reduce(function(c,d){return c.concat(d)},[])}function n(a){return a.replace(/-+(.)?/g,function(c,d){return d?d.toUpperCase():""})}function j(a,c){this.dom=a||[];this.length=this.dom.length;this.selector=c||""}function b(a,c){if(a==g)return new j;else if(c!==i)return b(c).find(a);else if(typeof a==="function")return b(g).ready(a);else{var d;if(a instanceof j)d=a.dom;else{if(a instanceof Array)d= f(a);else{if(a instanceof Element||a===window)d=[a];else{if(q.test(a)){e.innerHTML=(""+a).trim();d=l.call(e.childNodes);e.innerHTML="";d=d}else d=o(g,a);d=d}d=d}d=d}return new j(d,a)}}var l=[].slice,k,m,o,q,e,g=window.document,i;if(String.prototype.trim===i)String.prototype.trim=function(){return this.replace(/^\s+/,"").replace(/\s+$/,"")};q=/^\s*<.+>/;e=g.createElement("div");b.extend=function(a,c){for(k in c)a[k]=c[k];return a};b.qsa=o=function(a,c){return l.call(a.querySelectorAll(c))};b.fn={ready:function(a){g.addEventListener("DOMContentLoaded", a,false);return this},get:function(a){return a===i?this.dom:this.dom[a]},size:function(){return this.length},remove:function(){return this.each(function(){this.parentNode.removeChild(this)})},each:function(a){this.dom.forEach(function(c,d){a.call(c,d,c)});return this},filter:function(a){return b(this.dom.filter(function(c){return o(c.parentNode,a).indexOf(c)>=0}))},is:function(a){return this.length>0&&b(this.dom[0]).filter(a).length>0},eq:function(a){return b(this.get(a))},first:function(){return b(this.get(0))}, last:function(){return b(this.get(this.length-1))},find:function(a){var c;c=this.length==1?o(this.get(0),a):h(this.dom.map(function(d){return o(d,a)}));return b(c)},closest:function(a,c){var d=this.dom[0],p=o(c!==i?c:g,a);if(p.length===0)d=null;for(;d&&d!==g&&p.indexOf(d)<0;)d=d.parentNode;return b(d)},parents:function(a){for(var c=[],d=this.get();d.length>0;)d=f(d.map(function(p){if((p=p.parentNode)&&p!==g&&c.indexOf(p)<0){c.push(p);return p}}));c=b(c);return a===i?c:c.filter(a)},parent:function(a){var c, d=[];this.each(function(){if((c=this.parentNode)&&d.indexOf(c)<0)d.push(c)});d=b(d);return a===i?d:d.filter(a)},pluck:function(a){return this.dom.map(function(c){return c[a]})},show:function(){return this.css("display","block")},hide:function(){return this.css("display","none")},prev:function(){return b(this.pluck("previousElementSibling"))},next:function(){return b(this.pluck("nextElementSibling"))},html:function(a){return a===i?this.length>0?this.dom[0].innerHTML:null:this.each(function(c){this.innerHTML= typeof a=="function"?a(c,this.innerHTML):a})},text:function(a){return a===i?this.length>0?this.dom[0].innerText:null:this.each(function(){this.innerText=a})},attr:function(a,c){return typeof a=="string"&&c===i?this.length>0&&this.dom[0].nodeName==="INPUT"&&this.dom[0].type==="text"&&a==="value"?this.val():this.length>0?this.dom[0].getAttribute(a)||i:null:this.each(function(d){if(typeof a=="object")for(k in a)this.setAttribute(k,a[k]);else this.setAttribute(a,typeof c=="function"?c(d,this.getAttribute(a)): c)})},removeAttr:function(a){return this.each(function(){this.removeAttribute(a)})},val:function(a){return a===i?this.length>0?this.dom[0].value:null:this.each(function(){this.value=a})},offset:function(){var a=this.dom[0].getBoundingClientRect();return{left:a.left+g.body.scrollLeft,top:a.top+g.body.scrollTop,width:a.width,height:a.height}},css:function(a,c){if(c===i&&typeof a=="string")return this.dom[0].style[n(a)];m="";for(k in a)m+=k+":"+a[k]+";";if(typeof a=="string")m=a+":"+c;return this.each(function(){this.style.cssText+= ";"+m})},index:function(a){return this.dom.indexOf(b(a).get(0))},hasClass:function(a){return RegExp("(^|\\s)"+a+"(\\s|$)").test(this.dom[0].className)},addClass:function(a){return this.each(function(){!b(this).hasClass(a)&&(this.className+=(this.className?" ":"")+a)})},removeClass:function(a){return this.each(function(){this.className=this.className.replace(RegExp("(^|\\s)"+a+"(\\s|$)")," ").trim()})},toggleClass:function(a,c){return this.each(function(){c!==i&&!c||b(this).hasClass(a)?b(this).removeClass(a): b(this).addClass(a)})}};["width","height"].forEach(function(a){b.fn[a]=function(){return this.offset()[a]}});var r={append:"beforeEnd",prepend:"afterBegin",before:"beforeBegin",after:"afterEnd"};for(k in r)b.fn[k]=function(a){return function(c){return this.each(function(d,p){if(c instanceof j){dom=c.dom;if(a=="afterBegin"||a=="afterEnd")for(var s=0;s0&&l<=250)h.isDoubleTap=true;h.last=b}).bind("touchmove",function(j){h.x2=j.touches[0].pageX}).bind("touchend",function(){if(h.isDoubleTap){f(h.target).trigger("doubleTap");h={}}else if(h.x2>0){Math.abs(h.x1-h.x2)>30&&f(h.target).trigger("swipe")&& f(h.target).trigger("swipe"+(h.x1-h.x2>0?"Left":"Right"));h.x1=h.x2=h.last=0}else if("last"in h)n=setTimeout(function(){n=null;f(h.target).trigger("tap");h={}},250)}).bind("touchcancel",function(){h={}})});["swipe","swipeLeft","swipeRight","doubleTap","tap"].forEach(function(j){f.fn[j]=function(b){return this.bind(j,b)}})})(Zepto); (function(f){function h(){}var n=0;f.ajaxJSONP=function(b){var l;l="jsonp"+ ++n;window[l]=b.success;var k=document.createElement("script");f(k).attr({src:b.url.replace(/callback=\?/,"callback="+l)});f("head").append(k)};f.ajax=function(b){b=b||{};if(b.url&&/callback=\?/.test(b.url))return f.ajaxJSONP(b);var l=b.data,k=b.success||h,m=b.error||h,o=j[b.dataType],q=b.contentType,e=new XMLHttpRequest;e.onreadystatechange=function(){if(e.readyState==4)if(e.status>=200&&e.status<300||e.status==0)if(o=="application/json"){var g, i=false;try{g=JSON.parse(e.responseText)}catch(r){i=r}i?m(e,"parsererror",i):k(g,"success",e)}else k(e.responseText,"success",e);else m(e,"error")};e.open(b.type||"GET",b.url||window.location,true);o&&e.setRequestHeader("Accept",o);if(l instanceof Object){l=JSON.stringify(l);q=q||"application/json"}q&&e.setRequestHeader("Content-Type",q);e.setRequestHeader("X-Requested-With","XMLHttpRequest");e.send(l)};var j=f.ajax.mimeTypes={json:"application/json",xml:"application/xml",html:"text/html",text:"text/plain"}; f.get=function(b,l){f.ajax({url:b,success:l})};f.post=function(b,l,k,m){if(l instanceof Function){m=m||k;k=l;l=null}f.ajax({type:"POST",url:b,data:l,success:k,dataType:m})};f.getJSON=function(b,l){f.ajax({url:b,success:l,dataType:"json"})};f.fn.load=function(b,l){if(!this.dom.length)return this;var k=this,m=b.split(/\s/),o;if(m.length>1){b=m[0];o=m[1]}f.get(b,function(q){k.html(o?f(document.createElement("div")).html(q).find(o).html():q);l&&l()});return this}})(Zepto); (function(f){var h=[],n;f.fn.remove=function(){return this.each(function(j){if(j.tagName=="IMG"){h.push(j);j.src="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";n&&clearTimeout(n);n=setTimeout(function(){h=[]},6E4)}j.parentNode.removeChild(j)})}})(Zepto);