/* zepto v1.0rc1 - polyfill zepto event detect fx ajax form touch - zeptojs.com/license */ (function(a){string.prototype.trim===a&&(string.prototype.trim=function(){return this.replace(/^\s+/,"").replace(/\s+$/,"")}),array.prototype.reduce===a&&(array.prototype.reduce=function(b){if(this===void 0||this===null)throw new typeerror;var c=object(this),d=c.length>>>0,e=0,f;if(typeof b!="function")throw new typeerror;if(d==0&&arguments.length==1)throw new typeerror;if(arguments.length>=2)f=arguments[1];else do{if(e in c){f=c[e++];break}if(++e>=d)throw new typeerror}while(!0);while(e0?[].concat.apply([],a):a}function h(a){return a.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 i(a){return a in i?i[a]:i[a]=new regexp("(^|\\s)"+a+"(\\s|$)")}function j(a,b){return typeof b=="number"&&!k[h(a)]?b+"px":b}function k(a){var b,c;return h[a]||(b=g.createelement(a),g.body.appendchild(b),c=j(b,"").getpropertyvalue("display"),b.parentnode.removechild(b),c=="none"&&(c="block"),h[a]=c),h[a]}function l(b,d){return d===a?c(b):c(b).filter(d)}function m(a,b,c,d){return a(b)?b.call(a,c,d):b}function n(a,b,d){var e=a%2?b:b.parentnode;e?e.insertbefore(d,a?a==1?e.firstchild:a==2?b:null:b.nextsibling):c(d).remove()}function o(a,b){b(a);for(var c in a.childnodes)o(a.childnodes[c],b)}var a,b,c,d,e=[],f=e.slice,g=window.document,h={},i={},j=g.defaultview.getcomputedstyle,k={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},l=/^\s*<(\w+|!)[^>]*>/,m=[1,3,8,9,11],n=["after","prepend","before","append"],o=g.createelement("table"),p=g.createelement("tr"),q={tr:g.createelement("tbody"),tbody:o,thead:o,tfoot:o,td:p,th:p,"*":g.createelement("div")},r=/complete|loaded|interactive/,s=/^\.([\w-]+)$/,t=/^#([\w-]+)$/,u=/^[\w-]+$/,v={}.tostring,w={},x,y,z=g.createelement("div");return w.matches=function(a,b){if(!a||a.nodetype!==1)return!1;var c=a.webkitmatchesselector||a.mozmatchesselector||a.omatchesselector||a.matchesselector;if(c)return c.call(a,b);var d,e=a.parentnode,f=!e;return f&&(e=z).appendchild(a),d=~w.qsa(e,b).indexof(a),f&&z.removechild(a),d},x=function(a){return a.replace(/-+(.)?/g,function(a,b){return b?b.touppercase():""})},y=function(a){return a.filter(function(b,c){return a.indexof(b)==c})},w.fragment=function(b,d){d===a&&(d=l.test(b)&®exp.$1),d in q||(d="*");var e=q[d];return e.innerhtml=""+b,c.each(f.call(e.childnodes),function(){e.removechild(this)})},w.z=function(a,b){return a=a||[],a.__proto__=arguments.callee.prototype,a.selector=b||"",a},w.isz=function(a){return a instanceof w.z},w.init=function(b,d){if(!b)return w.z();if(a(b))return c(g).ready(b);if(w.isz(b))return b;var e;if(d(b))e=f(b);else if(c(b))e=[c.extend({},b)],b=null;else if(m.indexof(b.nodetype)>=0||b===window)e=[b],b=null;else if(l.test(b))e=w.fragment(b.trim(),regexp.$1),b=null;else{if(d!==a)return c(d).find(b);e=w.qsa(g,b)}return w.z(e,b)},c=function(a,b){return w.init(a,b)},c.extend=function(c){return f.call(arguments,1).foreach(function(d){for(b in d)d[b]!==a&&(c[b]=d[b])}),c},w.qsa=function(a,b){var c;return a===g&&t.test(b)?(c=a.getelementbyid(regexp.$1))?[c]:e:a.nodetype!==1&&a.nodetype!==9?e:f.call(s.test(b)?a.getelementsbyclassname(regexp.$1):u.test(b)?a.getelementsbytagname(b):a.queryselectorall(b))},c.isfunction=a,c.isobject=b,c.isarray=d,c.isplainobject=c,c.inarray=function(a,b,c){return e.indexof.call(b,a,c)},c.trim=function(a){return a.trim()},c.uuid=0,c.map=function(a,b){var c,d=[],e,f;if(e(a))for(e=0;e0&&w.matches(this[0],a)},not:function(b){var d=[];if(a(b)&&b.call!==a)this.each(function(a){b.call(this,a)||d.push(this)});else{var e=typeof b=="string"?this.filter(b):e(b)&&a(b.item)?f.call(b):c(b);this.foreach(function(a){e.indexof(a)<0&&d.push(a)})}return c(d)},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){var a=this[0];return a&&!b(a)?a:c(a)},last:function(){var a=this[this.length-1];return a&&!b(a)?a:c(a)},find:function(a){var b;return this.length==1?b=w.qsa(this[0],a):b=this.map(function(){return w.qsa(this,a)}),c(b)},closest:function(a,b){var d=this[0];while(d&&!w.matches(d,a))d=d!==b&&d!==g&&d.parentnode;return c(d)},parents:function(a){var b=[],d=this;while(d.length>0)d=c.map(d,function(a){if((a=a.parentnode)&&a!==g&&b.indexof(a)<0)return b.push(a),a});return l(b,a)},parent:function(a){return l(y(this.pluck("parentnode")),a)},children:function(a){return l(this.map(function(){return f.call(this.children)}),a)},siblings:function(a){return l(this.map(function(a,b){return f.call(b.parentnode.children).filter(function(a){return a!==b})}),a)},empty:function(){return this.each(function(){this.innerhtml=""})},pluck:function(a){return this.map(function(){return this[a]})},show:function(){return this.each(function(){this.style.display=="none"&&(this.style.display=null),j(this,"").getpropertyvalue("display")=="none"&&(this.style.display=k(this.nodename))})},replacewith:function(a){return this.before(a).remove()},wrap:function(a){return this.each(function(){c(this).wrapall(c(a)[0].clonenode(!1))})},wrapall:function(a){return this[0]&&(c(this[0]).before(a=c(a)),a.append(this)),this},unwrap:function(){return this.parent().each(function(){c(this).replacewith(c(this).children())}),this},clone:function(){return c(this.map(function(){return this.clonenode(!0)}))},hide:function(){return this.css("display","none")},toggle:function(b){return(b===a?this.css("display")=="none":b)?this.show():this.hide()},prev:function(){return c(this.pluck("previouselementsibling"))},next:function(){return c(this.pluck("nextelementsibling"))},html:function(b){return b===a?this.length>0?this[0].innerhtml:null:this.each(function(a){var d=this.innerhtml;c(this).empty().append(m(this,b,a,d))})},text:function(b){return b===a?this.length>0?this[0].textcontent:null:this.each(function(){this.textcontent=b})},attr:function(c,d){var e;return typeof c=="string"&&d===a?this.length==0||this[0].nodetype!==1?a:c=="value"&&this[0].nodename=="input"?this.val():!(e=this[0].getattribute(c))&&c in this[0]?this[0][c]:e:this.each(function(a){if(this.nodetype!==1)return;if(b(c))for(b in c)this.setattribute(b,c[b]);else this.setattribute(c,m(this,d,a,this.getattribute(c)))})},removeattr:function(a){return this.each(function(){this.nodetype===1&&this.removeattribute(a)})},prop:function(b,c){return c===a?this[0]?this[0][b]:a:this.each(function(a){this[b]=m(this,c,a,this[b])})},data:function(b,c){var d=this.attr("data-"+h(b),c);return d!==null?d:a},val:function(b){return b===a?this.length>0?this[0].value:a:this.each(function(a){this.value=m(this,b,a,this.value)})},offset:function(){if(this.length==0)return null;var a=this[0].getboundingclientrect();return{left:a.left+window.pagexoffset,top:a.top+window.pageyoffset,width:a.width,height:a.height}},css:function(c,d){if(d===a&&typeof c=="string")return this.length==0?a:this[0].style[x(c)]||j(this[0],"").getpropertyvalue(c);var e="";for(b in c)typeof c[b]=="string"&&c[b]==""?this.each(function(){this.style.removeproperty(h(b))}):e+=h(b)+":"+j(b,c[b])+";";return typeof c=="string"&&(d==""?this.each(function(){this.style.removeproperty(h(c))}):e=h(c)+":"+j(c,d)),this.each(function(){this.style.csstext+=";"+e})},index:function(a){return a?this.indexof(c(a)[0]):this.parent().children().indexof(this[0])},hasclass:function(a){return this.length<1?!1:i(a).test(this[0].classname)},addclass:function(a){return this.each(function(b){d=[];var e=this.classname,f=m(this,a,b,e);f.split(/\s+/g).foreach(function(a){c(this).hasclass(a)||d.push(a)},this),d.length&&(this.classname+=(e?" ":"")+d.join(" "))})},removeclass:function(b){return this.each(function(c){if(b===a)return this.classname="";d=this.classname,m(this,b,c,d).split(/\s+/g).foreach(function(a){d=d.replace(i(a)," ")}),this.classname=d.trim()})},toggleclass:function(b,d){return this.each(function(e){var f=m(this,b,e,this.classname);(d===a?!c(this).hasclass(f):d)?c(this).addclass(f):c(this).removeclass(f)})}},["width","height"].foreach(function(b){c.fn[b]=function(d){var e,f=b.replace(/./,function(a){return a[0].touppercase()});return d===a?this[0]==window?window["inner"+f]:this[0]==g?g.documentelement["offset"+f]:(e=this.offset())&&e[b]:this.each(function(a){var e=c(this);e.css(b,m(this,d,a,e[b]()))})}}),n.foreach(function(a,b){c.fn[a]=function(){var a=c.map(arguments,function(a){return b(a)?a:w.fragment(a)});if(a.length<1)return this;var d=this.length,e=d>1,f=b<2;return this.each(function(c,g){for(var h=0;h0&&this.bind(o,n),settimeout(function(){m.css(i),e<=0&&settimeout(function(){m.each(function(){n.call(this)})},0)},0),this},i=null}(zepto),function($){function triggerandreturn(a,b,c){var d=$.event(b);return $(a).trigger(d,c),!d.defaultprevented}function triggerglobal(a,b,c,d){if(a.global)return triggerandreturn(b||document,c,d)}function ajaxstart(a){a.global&&$.active++===0&&triggerglobal(a,null,"ajaxstart")}function ajaxstop(a){a.global&&!--$.active&&triggerglobal(a,null,"ajaxstop")}function ajaxbeforesend(a,b){var c=b.context;if(b.beforesend.call(c,a,b)===!1||triggerglobal(b,c,"ajaxbeforesend",[a,b])===!1)return!1;triggerglobal(b,c,"ajaxsend",[a,b])}function ajaxsuccess(a,b,c){var d=c.context,e="success";c.success.call(d,a,e,b),triggerglobal(c,d,"ajaxsuccess",[b,c,a]),ajaxcomplete(e,b,c)}function ajaxerror(a,b,c,d){var e=d.context;d.error.call(e,c,b,a),triggerglobal(d,e,"ajaxerror",[c,d,a]),ajaxcomplete(b,c,d)}function ajaxcomplete(a,b,c){var d=c.context;c.complete.call(d,b,a),triggerglobal(c,d,"ajaxcomplete",[b,c]),ajaxstop(c)}function empty(){}function mimetodatatype(a){return a&&(a==htmltype?"html":a==jsontype?"json":scripttypere.test(a)?"script":xmltypere.test(a)&&"xml")||"text"}function appendquery(a,b){return(a+"&"+b).replace(/[&?]{1,2}/,"?")}function serializedata(a){isobject(a.data)&&(a.data=$.param(a.data)),a.data&&(!a.type||a.type.touppercase()=="get")&&(a.url=appendquery(a.url,a.data))}function serialize(a,b,c,d){var e=$.isarray(b);$.each(b,function(b,f){d&&(b=c?d:d+"["+(e?"":b)+"]"),!d&&e?a.add(f.name,f.value):(c?$.isarray(f):isobject(f))?serialize(a,f,c,b):a.add(b,f)})}var jsonpid=0,isobject=$.isobject,document=window.document,key,name,rscript=/)<[^<]*)*<\/script>/gi,scripttypere=/^(?:text|application)\/javascript/i,xmltypere=/^(?:text|application)\/xml/i,jsontype="application/json",htmltype="text/html",blankre=/^\s*$/;$.active=0,$.ajaxjsonp=function(a){var b="jsonp"+ ++jsonpid,c=document.createelement("script"),d=function(){$(c).remove(),b in window&&(window[b]=empty),ajaxcomplete("abort",e,a)},e={abort:d},f;return a.error&&(c.onerror=function(){e.abort(),a.error()}),window[b]=function(d){cleartimeout(f),$(c).remove(),delete window[b],ajaxsuccess(d,e,a)},serializedata(a),c.src=a.url.replace(/=\?/,"="+b),$("head").append(c),a.timeout>0&&(f=settimeout(function(){e.abort(),ajaxcomplete("timeout",e,a)},a.timeout)),e},$.ajaxsettings={type:"get",beforesend:empty,success:empty,error:empty,complete:empty,context:null,global:!0,xhr:function(){return new window.xmlhttprequest},accepts:{script:"text/javascript, application/javascript",json:jsontype,xml:"application/xml, text/xml",html:htmltype,text:"text/plain"},crossdomain:!1,timeout:0},$.ajax=function(options){var settings=$.extend({},options||{});for(key in $.ajaxsettings)settings[key]===undefined&&(settings[key]=$.ajaxsettings[key]);ajaxstart(settings),settings.crossdomain||(settings.crossdomain=/^([\w-]+:)?\/\/([^\/]+)/.test(settings.url)&®exp.$2!=window.location.host);var datatype=settings.datatype,hasplaceholder=/=\?/.test(settings.url);if(datatype=="jsonp"||hasplaceholder)return hasplaceholder||(settings.url=appendquery(settings.url,"callback=?")),$.ajaxjsonp(settings);settings.url||(settings.url=window.location.tostring()),serializedata(settings);var mime=settings.accepts[datatype],baseheaders={},protocol=/^([\w-]+:)\/\//.test(settings.url)?regexp.$1:window.location.protocol,xhr=$.ajaxsettings.xhr(),aborttimeout;settings.crossdomain||(baseheaders["x-requested-with"]="xmlhttprequest"),mime&&(baseheaders.accept=mime,mime.indexof(",")>-1&&(mime=mime.split(",",2)[0]),xhr.overridemimetype&&xhr.overridemimetype(mime));if(settings.contenttype||settings.data&&settings.type.touppercase()!="get")baseheaders["content-type"]=settings.contenttype||"application/x-www-form-urlencoded";settings.headers=$.extend(baseheaders,settings.headers||{}),xhr.onreadystatechange=function(){if(xhr.readystate==4){cleartimeout(aborttimeout);var result,error=!1;if(xhr.status>=200&&xhr.status<300||xhr.status==304||xhr.status==0&&protocol=="file:"){datatype=datatype||mimetodatatype(xhr.getresponseheader("content-type")),result=xhr.responsetext;try{datatype=="script"?(1,eval)(result):datatype=="xml"?result=xhr.responsexml:datatype=="json"&&(result=blankre.test(result)?null:json.parse(result))}catch(e){error=e}error?ajaxerror(error,"parsererror",xhr,settings):ajaxsuccess(result,xhr,settings)}else ajaxerror(null,"error",xhr,settings)}};var async="async"in settings?settings.async:!0;xhr.open(settings.type,settings.url,async);for(name in settings.headers)xhr.setrequestheader(name,settings.headers[name]);return ajaxbeforesend(xhr,settings)===!1?(xhr.abort(),!1):(settings.timeout>0&&(aborttimeout=settimeout(function(){xhr.onreadystatechange=empty,xhr.abort(),ajaxerror(null,"timeout",xhr,settings)},settings.timeout)),xhr.send(settings.data?settings.data:null),xhr)},$.get=function(a,b){return $.ajax({url:a,success:b})},$.post=function(a,b,c,d){return $.isfunction(b)&&(d=d||c,c=b,b=null),$.ajax({type:"post",url:a,data:b,success:c,datatype:d})},$.getjson=function(a,b){return $.ajax({url:a,success:b,datatype:"json"})},$.fn.load=function(a,b){if(!this.length)return this;var c=this,d=a.split(/\s/),e;return d.length>1&&(a=d[0],e=d[1]),$.get(a,function(a){c.html(e?$(document.createelement("div")).html(a.replace(rscript,"")).find(e).html():a),b&&b.call(c)}),this};var escape=encodeuricomponent;$.param=function(a,b){var c=[];return c.add=function(a,b){this.push(escape(a)+"="+escape(b))},serialize(c,a,b),c.join("&").replace("%20","+")}}(zepto),function(a){a.fn.serializearray=function(){var b=[],c;return a(array.prototype.slice.call(this.get(0).elements)).each(function(){c=a(this);var d=c.attr("type");this.nodename.tolowercase()!="fieldset"&&!this.disabled&&d!="submit"&&d!="reset"&&d!="button"&&(d!="radio"&&d!="checkbox"||this.checked)&&b.push({name:c.attr("name"),value:c.val()})}),b},a.fn.serialize=function(){var a=[];return this.serializearray().foreach(function(b){a.push(encodeuricomponent(b.name)+"="+encodeuricomponent(b.value))}),a.join("&")},a.fn.submit=function(b){if(b)this.bind("submit",b);else if(this.length){var c=a.event("submit");this.eq(0).trigger(c),c.defaultprevented||this.get(0).submit()}return this}}(zepto),function(a){function d(a){return"tagname"in a?a:a.parentnode}function e(a,b,c,d){var e=math.abs(a-b),f=math.abs(c-d);return e>=f?a-b>0?"left":"right":c-d>0?"up":"down"}function h(){g=null,b.last&&(b.el.trigger("longtap"),b={})}function i(){g&&cleartimeout(g),g=null}var b={},c,f=750,g;a(document).ready(function(){var j,k;a(document.body).bind("touchstart",function(e){j=date.now(),k=j-(b.last||j),b.el=a(d(e.touches[0].target)),c&&cleartimeout(c),b.x1=e.touches[0].pagex,b.y1=e.touches[0].pagey,k>0&&k<=250&&(b.isdoubletap=!0),b.last=j,g=settimeout(h,f)}).bind("touchmove",function(a){i(),b.x2=a.touches[0].pagex,b.y2=a.touches[0].pagey}).bind("touchend",function(a){i(),b.isdoubletap?(b.el.trigger("doubletap"),b={}):b.x2&&math.abs(b.x1-b.x2)>30||b.y2&&math.abs(b.y1-b.y2)>30?(b.el.trigger("swipe")&&b.el.trigger("swipe"+e(b.x1,b.x2,b.y1,b.y2)),b={}):"last"in b&&(b.el.trigger("tap"),c=settimeout(function(){c=null,b.el.trigger("singletap"),b={}},250))}).bind("touchcancel",function(){c&&cleartimeout(c),g&&cleartimeout(g),g=c=null,b={}})}),["swipe","swipeleft","swiperight","swipeup","swipedown","doubletap","tap","singletap","longtap"].foreach(function(b){a.fn[b]=function(a){return this.bind(b,a)}})}(zepto);