//     Zepto.js
//     (c) 2010, 2011 Thomas Fuchs
//     Zepto.js may be freely distributed under the MIT 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(e<d)e in c&&(f=b.call(a,f,c[e],e,c)),e++;return f})})();var Zepto=function(){function a(a){return{}.toString.call(a)=="[object Function]"}function b(a){return a instanceof Object}function c(a){return a instanceof Array}function d(a){return typeof a.length=="number"}function e(a){return a.filter(function(a){return a!==t&&a!==null})}function f(a){return a.length>0?[].concat.apply([],a):a}function g(a){return a.replace(/-+(.)?/g,function(a,b){return b?b.toUpperCase():""})}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.filter(function(a,b,c){return c.indexOf(a)==b})}function j(a){return a in B?B[a]:B[a]=new RegExp("(^|\\s)"+a+"(\\s|$)")}function k(a,b){return typeof b=="number"&&!D[h(a)]?b+"px":b}function l(a){var b,c;return A[a]||(b=z.createElement(a),z.body.appendChild(b),c=C(b,"").getPropertyValue("display"),b.parentNode.removeChild(b),c=="none"&&(c="block"),A[a]=c),A[a]}function m(a,b){b===t&&E.test(a)&&RegExp.$1,b in J||(b="*");var c=J[b];return c.innerHTML=""+a,y.call(c.childNodes)}function n(a,b){return a=a||x,a.__proto__=n.prototype,a.selector=b||"",a}function o(b,d){if(!b)return n();if(d!==t)return o(d).find(b);if(a(b))return o(z).ready(b);if(b instanceof n)return b;var f;return c(b)?f=e(b):F.indexOf(b.nodeType)>=0||b===window?(f=[b],b=null):E.test(b)?(f=m(b.trim(),RegExp.$1),b=null):b.nodeType&&b.nodeType==3?f=[b]:f=v(z,b),n(f,b)}function p(a,b){return b===t?o(a):o(a).filter(b)}function q(b,c,d,e){return a(c)?c.call(b,d,e):c}function r(a,b,c){var d=a%2?b:b.parentNode;d&&d.insertBefore(c,a?a==1?d.firstChild:a==2?b:null:b.nextSibling)}function s(a,b){b(a);for(var c in a.childNodes)s(a.childNodes[c],b)}var t,u,v,w,x=[],y=x.slice,z=window.document,A={},B={},C=z.defaultView.getComputedStyle,D={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},E=/^\s*<(\w+)[^>]*>/,F=[1,9,11],G=["after","prepend","before","append"],H=z.createElement("table"),I=z.createElement("tr"),J={tr:z.createElement("tbody"),tbody:H,thead:H,tfoot:H,td:I,th:I,"*":z.createElement("div")},K=/complete|loaded|interactive/,L=/^\.([\w-]+)$/,M=/^#([\w-]+)$/,N=/^[\w-]+$/;return o.extend=function(a){return y.call(arguments,1).forEach(function(b){for(u in b)a[u]=b[u]}),a},o.qsa=v=function(a,b){var c;return a===z&&M.test(b)?(c=a.getElementById(RegExp.$1))?[c]:x:y.call(L.test(b)?a.getElementsByClassName(RegExp.$1):N.test(b)?a.getElementsByTagName(b):a.querySelectorAll(b))},o.isFunction=a,o.isObject=b,o.isArray=c,o.map=function(a,b){var c,e=[],g,h;if(d(a))for(g=0;g<a.length;g++)c=b(a[g],g),c!=null&&e.push(c);else for(h in a)c=b(a[h],h),c!=null&&e.push(c);return f(e)},o.each=function(a,b){var c,e;if(d(a)){for(c=0;c<a.length;c++)if(b(c,a[c])===!1)return a}else for(e in a)if(b(e,a[e])===!1)return a;return a},o.fn={forEach:x.forEach,reduce:x.reduce,push:x.push,indexOf:x.indexOf,concat:x.concat,map:function(a){return o.map(this,function(b,c){return a.call(b,c,b)})},slice:function(){return o(y.apply(this,arguments))},ready:function(a){return K.test(z.readyState)?a(o):z.addEventListener("DOMContentLoaded",function(){a(o)},!1),this},get:function(a){return a===t?this:this[a]},size:function(){return this.length},remove:function(){return this.each(function(){this.parentNode!=null&&this.parentNode.removeChild(this)})},each:function(a){return this.forEach(function(b,c){a.call(b,c,b)}),this},filter:function(a){return o([].filter.call(this,function(b){return b.parentNode&&v(b.parentNode,a).indexOf(b)>=0}))},end:function(){return this.prevObject||o()},andSelf:function(){return this.add(this.prevObject||o())},add:function(a,b){return o(i(this.concat(o(a,b))))},is:function(a){return this.length>0&&o(this[0]).filter(a).length>0},not:function(b){var c=[];if(a(b)&&b.call!==t)this.each(function(a){b.call(this,a)||c.push(this)});else{var e=typeof b=="string"?this.filter(b):d(b)&&a(b.item)?y.call(b):o(b);this.forEach(function(a){e.indexOf(a)<0&&c.push(a)})}return o(c)},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:o(a)},last:function(){var a=this[this.length-1];return a&&!b(a)?a:o(a)},find:function(a){var b;return this.length==1?b=v(this[0],a):b=this.map(function(){return v(this,a)}),o(b)},closest:function(a,b){var c=this[0],d=v(b||z,a);d.length||(c=null);while(c&&d.indexOf(c)<0)c=c!==b&&c!==z&&c.parentNode;return o(c)},parents:function(a){var b=[],c=this;while(c.length>0)c=o.map(c,function(a){if((a=a.parentNode)&&a!==z&&b.indexOf(a)<0)return b.push(a),a});return p(b,a)},parent:function(a){return p(i(this.pluck("parentNode")),a)},children:function(a){return p(this.map(function(){return y.call(this.children)}),a)},siblings:function(a){return p(this.map(function(a,b){return y.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),C(this,"").getPropertyValue("display")=="none"&&(this.style.display=l(this.nodeName))})},replaceWith:function(a){return this.each(function(){o(this).before(a).remove()})},wrap:function(a){return this.each(function(){o(this).wrapAll(o(a)[0].cloneNode(!1))})},wrapAll:function(a){return this[0]&&(o(this[0]).before(a=o(a)),a.append(this)),this},unwrap:function(){return this.parent().each(function(){o(this).replaceWith(o(this).children())}),this},hide:function(){return this.css("display","none")},toggle:function(a){return(a===t?this.css("display")=="none":a)?this.show():this.hide()},prev:function(){return o(this.pluck("previousElementSibling"))},next:function(){return o(this.pluck("nextElementSibling"))},html:function(a){return a===t?this.length>0?this[0].innerHTML:null:this.each(function(b){var c=this.innerHTML;o(this).empty().append(q(this,a,b,c))})},text:function(a){return a===t?this.length>0?this[0].textContent:null:this.each(function(){this.textContent=a})},attr:function(a,c){var d;return typeof a=="string"&&c===t?this.length==0?t:a=="value"&&this[0].nodeName=="INPUT"?this.val():!(d=this[0].getAttribute(a))&&a in this[0]?this[0][a]:d:this.each(function(d){if(b(a))for(u in a)this.setAttribute(u,a[u]);else this.setAttribute(a,q(this,c,d,this.getAttribute(a)))})},removeAttr:function(a){return this.each(function(){this.removeAttribute(a)})},data:function(a,b){return this.attr("data-"+a,b)},val:function(a){return a===t?this.length>0?this[0].value:null:this.each(function(b){this.value=q(this,a,b,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(a,b){if(b===t&&typeof a=="string")return this.length==0?t:this[0].style[g(a)]||C(this[0],"").getPropertyValue(a);var c="";for(u in a)c+=h(u)+":"+k(u,a[u])+";";return typeof a=="string"&&(c=h(a)+":"+k(a,b)),this.each(function(){this.style.cssText+=";"+c})},index:function(a){return a?this.indexOf(o(a)[0]):this.parent().children().indexOf(this[0])},hasClass:function(a){return this.length<1?!1:j(a).test(this[0].className)},addClass:function(a){return this.each(function(b){w=[];var c=this.className,d=q(this,a,b,c);d.split(/\s+/g).forEach(function(a){o(this).hasClass(a)||w.push(a)},this),w.length&&(this.className+=(c?" ":"")+w.join(" "))})},removeClass:function(a){return this.each(function(b){if(a===t)return this.className="";w=this.className,q(this,a,b,w).split(/\s+/g).forEach(function(a){w=w.replace(j(a)," ")}),this.className=w.trim()})},toggleClass:function(a,b){return this.each(function(c){var d=q(this,a,c,this.className);(b===t?!o(this).hasClass(d):b)?o(this).addClass(d):o(this).removeClass(d)})}},"filter,add,not,eq,first,last,find,closest,parents,parent,children,siblings".split(",").forEach(function(a){var b=o.fn[a];o.fn[a]=function(){var a=b.apply(this,arguments);return a.prevObject=this,a}}),["width","height"].forEach(function(a){o.fn[a]=function(b){var c,d=a.replace(/./,function(a){return a[0].toUpperCase()});return b===t?this[0]==window?window["inner"+d]:this[0]==z?z.documentElement["offset"+d]:(c=this.offset())&&c[a]:this.each(function(c){var d=o(this);d.css(a,q(this,b,c,d[a]()))})}}),G.forEach(function(a,c){o.fn[a]=function(a){var d=b(a)?a:m(a);if(!("length"in d)||d.nodeType)d=[d];if(d.length<1)return this;var e=this.length,f=e>1,g=c<2;return this.each(function(a,b){for(var h=0;h<d.length;h++){var i=d[g?d.length-h-1:h];s(i,function(a){a.nodeName!=null&&a.nodeName.toUpperCase()==="SCRIPT"&&(!a.type||a.type==="text/javascript")&&window.eval.call(window,a.innerHTML)}),f&&a<e-1&&(i=i.cloneNode(!0)),r(c,b,i)}})};var d=c%2?a+"To":"insert"+(c?"Before":"After");o.fn[d]=function(b){return o(b)[a](this),this}}),n.prototype=o.fn,o}();window.Zepto=Zepto,"$"in window||(window.$=Zepto),function(a){function b(a){return a._zid||(a._zid=m++)}function c(a,c,f,g){c=d(c);if(c.ns)var h=e(c.ns);return(l[b(a)]||[]).filter(function(a){return a&&(!c.e||a.e==c.e)&&(!c.ns||h.test(a.ns))&&(!f||a.fn==f)&&(!g||a.sel==g)})}function d(a){var b=(""+a).split(".");return{e:b[0],ns:b.slice(1).sort().join(" ")}}function e(a){return new RegExp("(?:^| )"+a.replace(" "," .* ?")+"(?: |$)")}function f(b,c,d){a.isObject(b)?a.each(b,d):b.split(/\s/).forEach(function(a){d(a,c)})}function g(c,e,g,h,i){var j=b(c),k=l[j]||(l[j]=[]);f(e,g,function(b,e){var f=i&&i(e,b),g=f||e,j=function(a){var b=g.apply(c,[a].concat(a.data));return b===!1&&a.preventDefault(),b},l=a.extend(d(b),{fn:e,proxy:j,sel:h,del:f,i:k.length});k.push(l),c.addEventListener(l.e,j,!1)})}function h(a,d,e,g){var h=b(a);f(d||"",e,function(b,d){c(a,b,d,g).forEach(function(b){delete l[h][b.i],a.removeEventListener(b.e,b.proxy,!1)})})}function i(b){var c=a.extend({originalEvent:b},b);return a.each(q,function(a,d){c[a]=function(){return this[d]=o,b[a].apply(b,arguments)},c[d]=p}),c}function j(a){if(!("defaultPrevented"in a)){a.defaultPrevented=!1;var b=a.preventDefault;a.preventDefault=function(){this.defaultPrevented=!0,b.call(this)}}}var k=a.qsa,l={},m=1,n={};n.click=n.mousedown=n.mouseup=n.mousemove="MouseEvents",a.event={add:g,remove:h},a.fn.bind=function(a,b){return this.each(function(){g(this,a,b)})},a.fn.unbind=function(a,b){return this.each(function(){h(this,a,b)})},a.fn.one=function(a,b){return this.each(function(c,d){g(this,a,b,null,function(a,b){return function(){var c=a.apply(d,arguments);return h(d,b,a),c}})})};var o=function(){return!0},p=function(){return!1},q={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"};a.fn.delegate=function(b,c,d){return this.each(function(e,f){g(f,c,d,b,function(c){return function(d){var e,g=a(d.target).closest(b,f).get(0);if(g)return e=a.extend(i(d),{currentTarget:g,liveFired:f}),c.apply(g,[e].concat([].slice.call(arguments,1)))}})})},a.fn.undelegate=function(a,b,c){return this.each(function(){h(this,b,c,a)})},a.fn.live=function(b,c){return a(document.body).delegate(this.selector,b,c),this},a.fn.die=function(b,c){return a(document.body).undelegate(this.selector,b,c),this},a.fn.on=function(b,c,d){return c===undefined||a.isFunction(c)?this.bind(b,c):this.delegate(c,b,d)},a.fn.off=function(b,c,d){return c===undefined||a.isFunction(c)?this.unbind(b,c):this.undelegate(c,b,d)},a.fn.trigger=function(b,c){return typeof b=="string"&&(b=a.Event(b)),j(b),b.data=c,this.each(function(){this.dispatchEvent(b)})},a.fn.triggerHandler=function(b,d){var e,f;return this.each(function(g,h){e=i(typeof b=="string"?a.Event(b):b),e.data=d,e.target=h,a.each(c(h,b.type||b),function(a,b){f=b.proxy(e);if(e.isImmediatePropagationStopped())return!1})}),f},"focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout change select keydown keypress keyup error".split(" ").forEach(function(b){a.fn[b]=function(a){return this.bind(b,a)}}),["focus","blur"].forEach(function(b){a.fn[b]=function(a){if(a)this.bind(b,a);else if(this.length)try{this.get(0)[b]()}catch(c){}return this}}),a.Event=function(a,b){var c=document.createEvent(n[a]||"Events"),d=!0;if(b)for(var e in b)e=="bubbles"?d=!!b[e]:c[e]=b[e];return c.initEvent(a,d,!0,null,null,null,null,null,null,null,null,null,null,null,null),c}}(Zepto),function(a){function b(a){var b=this.os={},c=this.browser={},d=a.match(/WebKit\/([\d.]+)/),e=a.match(/(Android)\s+([\d.]+)/),f=a.match(/(iPad).*OS\s([\d_]+)/),g=!f&&a.match(/(iPhone\sOS)\s([\d_]+)/),h=a.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),i=h&&a.match(/TouchPad/),j=a.match(/(BlackBerry).*Version\/([\d.]+)/);d&&(c.version=d[1]),c.webkit=!!d,e&&(b.android=!0,b.version=e[2]),g&&(b.ios=!0,b.version=g[2].replace(/_/g,"."),b.iphone=!0),f&&(b.ios=!0,b.version=f[2].replace(/_/g,"."),b.ipad=!0),h&&(b.webos=!0,b.version=h[2]),i&&(b.touchpad=!0),j&&(b.blackberry=!0,b.version=j[2])}b.call(a,navigator.userAgent),a.__detect=b}(Zepto),function(a,b){function c(a){return a.toLowerCase()}function d(a){return f?f+a:c(a)}var e="",f,g,h,i={Webkit:"webkit",Moz:"",O:"o",ms:"MS"},j=window.document,k=j.createElement("div"),l=/^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i;a.each(i,function(a,d){if(k.style[a+"TransitionProperty"]!==b)return e="-"+c(a)+"-",f=d,!1}),a.fx={off:f===b&&k.style.transitionProperty===b,cssPrefix:e,transitionEnd:d("TransitionEnd"),animationEnd:d("AnimationEnd")},a.fn.animate=function(b,c,d,e){return a.isObject(c)&&(d=c.easing,e=c.complete,c=c.duration),c&&(c/=1e3),this.anim(b,c,d,e)},a.fn.anim=function(c,d,f,g){var h,i={},j,k=this,m,n=a.fx.transitionEnd;d===b&&(d=.4),a.fx.off&&(d=0);if(typeof c=="string")i[e+"animation-name"]=c,i[e+"animation-duration"]=d+"s",n=a.fx.animationEnd;else{for(j in c)l.test(j)?(h||(h=[]),h.push(j+"("+c[j]+")")):i[j]=c[j];h&&(i[e+"transform"]=h.join(" ")),a.fx.off||(i[e+"transition"]="all "+d+"s "+(f||""))}return m=function(){var b={};b[e+"transition"]=b[e+"animation-name"]="none",a(this).css(b),g&&g.call(this)},d>0&&this.one(n,m),setTimeout(function(){k.css(i),d<=0&&setTimeout(function(){k.each(function(){m.call(this)})},0)},0),this},k=null}(Zepto),function(a){function b(b,c,d){var e=a.Event(c);return a(b).trigger(e,d),!e.defaultPrevented}function c(a,c,d,e){if(a.global)return b(c||n,d,e)}function d(b){b.global&&a.active++===0&&c(b,null,"ajaxStart")}function e(b){b.global&&!--a.active&&c(b,null,"ajaxStop")}function f(a,b){var d=b.context;if(b.beforeSend.call(d,a,b)===!1||c(b,d,"ajaxBeforeSend",[a,b])===!1)return!1;c(b,d,"ajaxSend",[a,b])}function g(a,b,d){var e=d.context,f="success";d.success.call(e,a,f,b),c(d,e,"ajaxSuccess",[b,d,a]),i(f,b,d)}function h(a,b,d,e){var f=e.context;e.error.call(f,d,b,a),c(e,f,"ajaxError",[d,e,a]),i(b,d,e)}function i(a,b,d){var f=d.context;d.complete.call(f,b,a),c(d,f,"ajaxComplete",[b,d]),e(d)}function j(){}function k(b,c,d,e){var f=a.isArray(c);a.each(c,function(c,g){e&&(c=d?e:e+"["+(f?"":c)+"]"),!e&&f?b.add(g.name,g.value):(d?a.isArray(g):m(g))?k(b,g,d,c):b.add(c,g)})}var l=0,m=a.isObject,n=window.document,o,p;a.active=0,a.ajaxJSONP=function(b){var c="jsonp"+ ++l,d=n.createElement("script"),e=function(){a(d).remove(),c in window&&(window[c]=j),i(f,b,"abort")},f={abort:e},h;return window[c]=function(e){clearTimeout(h),a(d).remove(),delete window[c],g(e,f,b)},d.src=b.url.replace(/=\?/,"="+c),a("head").append(d),b.timeout>0&&(h=setTimeout(function(){f.abort(),i(f,b,"timeout")},b.timeout)),f},a.ajaxSettings={type:"GET",beforeSend:j,success:j,error:j,complete:j,context:null,global:!0,xhr:function(){return new window.XMLHttpRequest},accepts:{script:"text/javascript, application/javascript",json:"application/json",xml:"application/xml, text/xml",html:"text/html",text:"text/plain"},crossDomain:!1,timeout:0},a.ajax=function(b){var c=a.extend({},b||{});for(o in a.ajaxSettings)c[o]===undefined&&(c[o]=a.ajaxSettings[o]);d(c),c.crossDomain||(c.crossDomain=/^([\w-]+:)?\/\/([^\/]+)/.test(c.url)&&RegExp.$2!=window.location.host);if(/=\?/.test(c.url))return a.ajaxJSONP(c);c.url||(c.url=window.location.toString()),c.data&&!c.contentType&&(c.contentType="application/x-www-form-urlencoded"),m(c.data)&&(c.data=a.param(c.data));if(c.type.match(/get/i)&&c.data){var e=c.data;c.url.match(/\?.*=/)?e="&"+e:e[0]!="?"&&(e="?"+e),c.url+=e}var i=c.accepts[c.dataType],k={},l=/^([\w-]+:)\/\//.test(c.url)?RegExp.$1:window.location.protocol,n=a.ajaxSettings.xhr(),q;c.crossDomain||(k["X-Requested-With"]="XMLHttpRequest"),i&&(k.Accept=i),c.headers=a.extend(k,c.headers||{}),n.onreadystatechange=function(){if(n.readyState==4){clearTimeout(q);var a,b=!1;if(n.status>=200&&n.status<300||n.status==0&&l=="file:"){if(i=="application/json"&&!/^\s*$/.test(n.responseText))try{a=JSON.parse(n.responseText)}catch(d){b=d}else a=n.responseText;b?h(b,"parsererror",n,c):g(a,n,c)}else h(null,"error",n,c)}},n.open(c.type,c.url,!0),c.contentType&&(c.headers["Content-Type"]=c.contentType);for(p in c.headers)n.setRequestHeader(p,c.headers[p]);return f(n,c)===!1?(n.abort(),!1):(c.timeout>0&&(q=setTimeout(function(){n.onreadystatechange=j,n.abort(),h(null,"timeout",n,c)},c.timeout)),n.send(c.data),n)},a.get=function(b,c){return a.ajax({url:b,success:c})},a.post=function(b,c,d,e){return a.isFunction(c)&&(e=e||d,d=c,c=null),a.ajax({type:"POST",url:b,data:c,success:d,dataType:e})},a.getJSON=function(b,c){return a.ajax({url:b,success:c,dataType:"json"})},a.fn.load=function(b,c){if(!this.length)return this;var d=this,e=b.split(/\s/),f;return e.length>1&&(b=e[0],f=e[1]),a.get(b,function(b){d.html(f?a(n.createElement("div")).html(b).find(f).html():b),c&&c.call(d)}),this};var q=encodeURIComponent;a.param=function(a,b){var c=[];return c.add=function(a,b){this.push(q(a)+"="+q(b))},k(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.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 b(a){return"tagName"in a?a:a.parentNode}function c(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 d(){e.last&&Date.now()-e.last>=g&&(a(e.target).trigger("longTap"),e={})}var e={},f,g=750;a(document).ready(function(){a(document.body).bind("touchstart",function(a){var c=Date.now(),h=c-(e.last||c);e.target=b(a.touches[0].target),f&&clearTimeout(f),e.x1=a.touches[0].pageX,e.y1=a.touches[0].pageY,h>0&&h<=250&&(e.isDoubleTap=!0),e.last=c,setTimeout(d,g)}).bind("touchmove",function(a){e.x2=a.touches[0].pageX,e.y2=a.touches[0].pageY}).bind("touchend",function(b){e.isDoubleTap?(a(e.target).trigger("doubleTap"),e={}):e.x2>0||e.y2>0?((Math.abs(e.x1-e.x2)>30||Math.abs(e.y1-e.y2)>30)&&a(e.target).trigger("swipe")&&a(e.target).trigger("swipe"+c(e.x1,e.x2,e.y1,e.y2)),e.x1=e.x2=e.y1=e.y2=e.last=0):"last"in e&&(f=setTimeout(function(){f=null,a(e.target).trigger("tap"),e={}},250))}).bind("touchcancel",function(){e={}})}),["swipe","swipeLeft","swipeRight","swipeUp","swipeDown","doubleTap","tap","longTap"].forEach(function(b){a.fn[b]=function(a){return this.bind(b,a)}})}(Zepto),$.ajaxSetup&&$.ajaxSetup({beforeSend:function(a,b){var c,d;if(!b.global)return;return c=b.context||document,d=$.Event("ajaxBeforeSend"),$(c).trigger(d,[a,b]),d.result}}),$(document).bind("ajaxBeforeSend",function(a,b,c){if(!c.dataType)return b.setRequestHeader("Accept","*/*;q=0.5, "+c.accepts.script)}),$(document).delegate("a[data-confirm]","click",function(a){var b;if(b=$(this).attr("data-confirm"))if(!confirm(b))return a.stopImmediatePropagation(),!1}),function(){var a;$(document).bind("ajaxBeforeSend",function(a,b,c){var d;if(c.crossDomain)return;if(c.type==="GET")return;if(d=$('meta[name="csrf-token"]').attr("content"))return b.setRequestHeader("X-CSRF-Token",d)}),$(document).delegate("form","submit",function(b){var c,d,e,f;c=$(this);if(c.is("form[data-remote]"))return;if(c.attr("method").toUpperCase()==="GET")return;if(!a(c.attr("action")))return;e=$('meta[name="csrf-param"]').attr("content"),f=$('meta[name="csrf-token"]').attr("content"),e!=null&&f!=null&&(c.find("input[name="+e+"]")[0]||(d=document.createElement("input"),d.setAttribute("type","hidden"),d.setAttribute("name",e),d.setAttribute("value",f),c.prepend(d)))}),a=function(a){var b;return b=document.createElement("a"),b.href=a,location.protocol===b.protocol&&location.host===b.host}}.call(this),$(document).delegate("form","submit",function(){var a,b,c,d,e,f,g,h,i;h=$(this).find("input[type=submit][data-disable-with]");for(d=0,f=h.length;d<f;d++)b=h[d],b=$(b),b.attr("data-enable-with",b.val()||"Submit"),(c=b.attr("data-disable-with"))&&b.val(c),b[0].disabled=!0;i=$(this).find("button[type=submit][data-disable-with]");for(e=0,g=i.length;e<g;e++)a=i[e],a=$(a),a.attr("data-enable-with",a.html()||""),(c=a.attr("data-disable-with"))&&a.html(c),a[0].disabled=!0}),$(document).delegate("form","ajaxComplete",function(){var a,b,c,d,e,f,g,h;g=$(this).find("input[type=submit][data-enable-with]");for(c=0,e=g.length;c<e;c++)b=g[c],$(b).val($(b).attr("data-enable-with")),b.disabled=!1;h=$(this).find("button[type=submit][data-enable-with]");for(d=0,f=h.length;d<f;d++)a=h[d],$(a).html($(a).attr("data-enable-with")),a.disabled=!1}),$(document).delegate("a[data-method]","click",function(a){var b,c,d,e;b=$(this);if(b.is("a[data-remote]"))return;e=b.attr("data-method").toLowerCase();if(e==="get")return;return c=document.createElement("form"),c.method="POST",c.action=b.attr("href"),c.style.display="none",e!=="post"&&(d=document.createElement("input"),d.setAttribute("type","hidden"),d.setAttribute("name","_method"),d.setAttribute("value",e),c.appendChild(d)),document.body.appendChild(c),$(c).submit(),a.preventDefault(),!1}),$(document).delegate("a[data-remote]","click",function(a){var b,c,d,e,f;c=$(this),d={},d.context=this;if(e=c.attr("data-method"))d.type=e;if(f=c.attr("href"))d.url=f;if(b=c.attr("data-type"))d.dataType=b;return $.ajax(d),a.preventDefault(),!1}),$(document).delegate("form[data-remote]","submit",function(a){var b,c,d,e,f,g;d=$(this),e={},e.context=this;if(f=d.attr("method"))e.type=f;if(g=d.attr("action"))e.url=g;if(b=d.serializeArray())e.data=b;if(c=d.attr("data-type"))e.dataType=c;return $.ajax(e),a.preventDefault(),!1}),function(){var a;a="form[data-remote] input[type=submit],\nform[data-remote] button[type=submit],\nform[data-remote] button:not([type])",$(document).delegate(a,"click",function(){var a,b,c,d,e,f;e=$(this),b=e.closest("form"),c=b.find(".js-submit-button-value"),(d=e.attr("name"))?(a=e.is("input[type=submit]")?"Submit":"",f=e.val()||a,c[0]?(c.attr("name",d),c.attr("value",f)):(c=document.createElement("input"),c.setAttribute("type","hidden"),c.setAttribute("name",d),c.setAttribute("value",f),c.setAttribute("class","js-submit-button-value"),b.prepend(c))):c.remove()})}.call(this),window.console||(window.console={log:function(){}}),$.ios&&$(window).on("load",function(a){setTimeout(function(){window.scrollTo(0,1)},.1.seconds())}),String.prototype.startsWith=function(a){return this.indexOf(a)===0},String.prototype.endsWith=function(a){var b=this.length-a.length;return b>=0&&this.lastIndexOf(a)===b},Function.prototype.recur=function(a){var b={},c=Time(),d=window.setInterval(this,a*1..second());return b.duration=function(){return Time()-c},b.stop=function(){window.clearInterval(d);var a=this.duration();return(this.stop=this.duration=function(){return a})()},b},$(document).ready(function(a){var b=$("body").get(0);octranspo.measure_viewport_and_mark(b),octranspo.extend(document),$(b).removeClass("loading"),octranspo.run_google_analytics()}),$(document).ready(function(a){$("#new_suggestion").forEach(function(a){new NewSuggestionView({el:a})})}),window.octranspo=function(a,b){octranspo.extensions[a]=b},octranspo.measure_viewport_and_mark=function(a){var b=function(){$(window).width()<460?$(a).removeClass("wide").addClass("thin"):$(a).removeClass("thin").addClass("wide")};"orientation"in window?window.onorientationchange=b:$(window).on("resize",b),b()},octranspo.extend=function(a){for(var b in octranspo.extensions){var c=octranspo.extensions[b];$(a).find(b).forEach(function(a){c.call(undefined,a)})}return a},octranspo.run_google_analytics=function(){try{_gat._getTracker("UA-6280837-1")._trackPageview()}catch(a){}},octranspo.extensions={},octranspo.tmp_doc=$("<div>").get(0),octranspo.append_to=function(a,b){var c=$(a),d=$(octranspo.tmp_doc).html(b),e=octranspo.extend(d).childElements();c.hide(),e.each(function(a){c.insert({bottom:a})}),c.show()},octranspo.replace=function(a,b){var c=$(a),d=$(octranspo.tmp_doc).html(b);$(c).replaceWith(d),$(d).replaceWith(d.find("*:first"))},octranspo("a",function(a){$(a).on("click",function(b){octranspo.activatedLink&&$(octranspo.activated_link).removeClass("activated"),octranspo.activatedLink=$(a).addClass("activated")})}),octranspo("body[data-time]",function(a){var b=a.clock={};b.initialize=function(){b.initial_time=Time($(a).data("time")),b.timezone={utc_offset:Number($(a).data("utc-offset"))},b.current.hour=b.initial_time.hour(),b.current.minute=b.initial_time.minute(),b.current.second=b.initial_time.second();var c="local_time_at_"+b.initial_time,d=Cookie.read(c);d?(b.initial_local_time=Time(d),b.advance()):(b.initial_local_time=Time(),Cookie.write(c,b.initial_local_time.miliseconds())),b.recurrance=b.advance.recur(1)},b.advance=function(){var a=b.current();b.advance_hour_to(a),b.advance_minute_to(a),b.advance_second_to(a)},b.current=function(){return Time(b.initial_time+b.elapsed_time(),b.timezone)},b.elapsed_time=function(){return Time()-b.initial_local_time},b.advance_hour_to=function(a){var c=a.hour();c!=b.current.hour&&(b.current.hour=c,$(document.body).trigger("advance:hour",[a]))},b.advance_minute_to=function(a){var c=a.minute();c!=b.current.minute&&(b.current.minute=c,$(document.body).trigger("advance:minute",[a]))},b.advance_second_to=function(a){var c=a.second();c!=b.current.second&&(b.current.second=c,$(document.body).trigger("advance:second",[a]))},b.initialize()}),octranspo("#clock_at_current_time.running",function(a){$(document.body).on("advance:hour",function(b,c){var d=c.hour();d>12&&(d-=12),$(a).find(".hour.digit").html(d)}),$(document.body).on("advance:minute",function(b,c){var d=c.minute();d<10&&(d="0"+d),$(a).find(".minute.digit").html(d)})}),octranspo("#search_landmarks.activated input[type=text]",function(a){a.focus()});var Cookie={};Cookie.read=function(a){var b=document.cookie.match("(^|;) ?"+a+"=([^;]*)(;|$)");if(b)return unescape(b[2])},Cookie.write=function(a,b,c){c||(c={});var d=a+"="+escape(b);return c.expires&&(d+="; expires="+c.expires.date.toGMTString()),document.cookie=d,Cookie.read(a)},Cookie.remove=function(a){var b=Cookie.read(a);return Cookie.write(a,null,{expires:Time(Time()-1..hour())}),b};var Time=function(a,b){var c=new Number(a||(new Date).getTime());return c.zone=b||Time.zone,c.date=new Date(c-Time.zone.utc_offset+c.zone.utc_offset),$.extend(c,Time.prototype)};Time.prototype=new function(){this.utc=function(){return Time(this,{utc_offset:0})},this.hour=function(){return this.date.getHours()},this.minute=function(){return this.date.getMinutes()},this.second=function(){return this.date.getSeconds()},this.toString=function(){var a=Math.abs(this.zone.utc_offset),b=this.zone.utc_offset>0?"+":"-",c=(a/1..hour()).floor().toPaddedString(2),d=(a%1..hour()/1..minute()).floor().toPaddedString(2),e="UTC"+b+c+d;return this.date.toString().replace(/GMT-\d\d\d\d \([A-Z]+\)/,e)}},Time.Numeric=new function(){this.hour=this.hours=function(){return this.minutes()*60},this.minute=this.minutes=function(){return this.seconds()*60},this.second=this.seconds=function(){return this.miliseconds()*1e3},this.milisecond=this.miliseconds=function(){return this.valueOf()}},$.extend(Number.prototype,Time.Numeric),Time.zone={utc_offset:-1*(new Date).getTimezoneOffset()*1..minute()},Time.duration_in_words=function(a,b){var c=Math.abs(a-b),d=Math.round(c/1..minute());switch(d){case 0:return"a moment";case 1:return"1 minute";default:return d+" minutes"}},Time.describe_duration_in_words=function(a,b){var c=Math.abs(a-b),d=Math.round(c/1..minute());return d===0?"right now":a>b?Time.duration_in_words(a,b)+" ago":"in "+Time.duration_in_words(a,b)},octranspo("div.ride",function(a){a.departure=Time($(a).data("departure-time")),$(document.body).on("advance:minute",function(b,c){var d=Time.describe_duration_in_words(c,a.departure);d.endsWith("now")&&a.arrive(),d.endsWith("ago")&&a.expire(),$(a).find(".wait.time").html(d)}),a.arrive=function(){$(a).find(".departure.phrasing").html("should be arriving")},a.expire=function(){$(a).is(":not(.expired)")&&($(a).addClass("expired"),$(a).find(".departure.phrasing").html("should have departed"))}}),octranspo("#ride_list",function(a){$(document.body).on("advance:minute",function(b,c){var d=Time(c-1..minute()),e=Time(c-3..minutes()),f=$(a).is(".compact"),g=$(a).is(".current"),h=$(a).find("li").forEach(function(a){a.departure=a.departure||Time($(a).data("time")),a.departure<e&&$(a).addClass("long_gone"),a.departure<d&&$(a).addClass("expired"),g&&$(a).find(".wait").html(Time.describe_duration_in_words(c,a.departure))});f&&setTimeout(a.compress,2..seconds()),g&&a.refresh_if_stale_after($(a).find("li:last-child").departure-c)}),a.compress=function(){return $(a).find("li.long_gone").forEach(function(a){$(a).remove()}),a},a.refresh_if_stale_after=function(a){a<20..minutes()&&$("link_to_more_rides").activate()}}),$(document).ready(function(){$("body").on("click","#link_to_more_rides",function(a){a.preventDefault();var b=$("#more_rides"),c=b.find(".activity");return c.html(c.html()+c.data("content")),b.removeClass("inviting").addClass("searching"),$.getJSON(link_to_more_rides.href,function(){$("#ride_list").append(arguments[0].ride_list),b.replaceWith(arguments[0].more_rides)}),link_to_more_rides})}),octranspo("#stop_list",function(a){$(document.body).on("advance:minute",function(b,c){$(a).find("li").forEach(function(a){a.arrival=a.arrival||Time($(a).data("time"));var b=a.arrival+1..minute()-c;b<0&&$(a).addClass("expired")})})}),octranspo("div.signage div.refinement div.invitation a.all",function(a){$(a).on("click",function(b){b.preventDefault();var c=$(a).closest("div.refinement"),d=c.find("div.receiver"),e=$($(a).attr("href"));d.html(e),c.removeClass("inviting")})}),function(){function A(a,b,c){if(a===b)return a!==0||1/a==1/b;if(a==null||b==null)return a===b;a._chain&&(a=a._wrapped),b._chain&&(b=b._wrapped);if(a.isEqual&&w.isFunction(a.isEqual))return a.isEqual(b);if(b.isEqual&&w.isFunction(b.isEqual))return b.isEqual(a);var d=i.call(a);if(d!=i.call(b))return!1;switch(d){case"[object String]":return a==String(b);case"[object Number]":return a!=+a?b!=+b:a==0?1/a==1/b:a==+b;case"[object Date]":case"[object Boolean]":return+a==+b;case"[object RegExp]":return a.source==b.source&&a.global==b.global&&a.multiline==b.multiline&&a.ignoreCase==b.ignoreCase}if(typeof a!="object"||typeof b!="object")return!1;var e=c.length;while(e--)if(c[e]==a)return!0;c.push(a);var f=0,g=!0;if(d=="[object Array]"){f=a.length,g=f==b.length;if(g)while(f--)if(!(g=f in a==f in b&&A(a[f],b[f],c)))break}else{if("constructor"in a!="constructor"in b||a.constructor!=b.constructor)return!1;for(var h in a)if(j.call(a,h)){f++;if(!(g=j.call(b,h)&&A(a[h],b[h],c)))break}if(g){for(h in b)if(j.call(b,h)&&!(f--))break;g=!f}}return c.pop(),g}var a=this,b=a._,c={},d=Array.prototype,e=Object.prototype,f=Function.prototype,g=d.slice,h=d.unshift,i=e.toString,j=e.hasOwnProperty,k=d.forEach,l=d.map,m=d.reduce,n=d.reduceRight,o=d.filter,p=d.every,q=d.some,r=d.indexOf,s=d.lastIndexOf,t=Array.isArray
,u=Object.keys,v=f.bind,w=function(a){return new D(a)};typeof exports!="undefined"?(typeof module!="undefined"&&module.exports&&(exports=module.exports=w),exports._=w):a._=w,w.VERSION="1.3.0";var x=w.each=w.forEach=function(a,b,d){if(a==null)return;if(k&&a.forEach===k)a.forEach(b,d);else if(a.length===+a.length){for(var e=0,f=a.length;e<f;e++)if(e in a&&b.call(d,a[e],e,a)===c)return}else for(var g in a)if(j.call(a,g)&&b.call(d,a[g],g,a)===c)return};w.map=function(a,b,c){var d=[];return a==null?d:l&&a.map===l?a.map(b,c):(x(a,function(a,e,f){d[d.length]=b.call(c,a,e,f)}),a.length===+a.length&&(d.length=a.length),d)},w.reduce=w.foldl=w.inject=function(a,b,c,d){var e=arguments.length>2;a==null&&(a=[]);if(m&&a.reduce===m)return d&&(b=w.bind(b,d)),e?a.reduce(b,c):a.reduce(b);x(a,function(a,f,g){e?c=b.call(d,c,a,f,g):(c=a,e=!0)});if(!e)throw new TypeError("Reduce of empty array with no initial value");return c},w.reduceRight=w.foldr=function(a,b,c,d){var e=arguments.length>2;a==null&&(a=[]);if(n&&a.reduceRight===n)return d&&(b=w.bind(b,d)),e?a.reduceRight(b,c):a.reduceRight(b);var f=w.toArray(a).reverse();return d&&!e&&(b=w.bind(b,d)),e?w.reduce(f,b,c,d):w.reduce(f,b)},w.find=w.detect=function(a,b,c){var d;return y(a,function(a,e,f){if(b.call(c,a,e,f))return d=a,!0}),d},w.filter=w.select=function(a,b,c){var d=[];return a==null?d:o&&a.filter===o?a.filter(b,c):(x(a,function(a,e,f){b.call(c,a,e,f)&&(d[d.length]=a)}),d)},w.reject=function(a,b,c){var d=[];return a==null?d:(x(a,function(a,e,f){b.call(c,a,e,f)||(d[d.length]=a)}),d)},w.every=w.all=function(a,b,d){var e=!0;return a==null?e:p&&a.every===p?a.every(b,d):(x(a,function(a,f,g){if(!(e=e&&b.call(d,a,f,g)))return c}),e)};var y=w.some=w.any=function(a,b,d){b||(b=w.identity);var e=!1;return a==null?e:q&&a.some===q?a.some(b,d):(x(a,function(a,f,g){if(e||(e=b.call(d,a,f,g)))return c}),!!e)};w.include=w.contains=function(a,b){var c=!1;return a==null?c:r&&a.indexOf===r?a.indexOf(b)!=-1:(c=y(a,function(a){return a===b}),c)},w.invoke=function(a,b){var c=g.call(arguments,2);return w.map(a,function(a){return(w.isFunction(b)?b||a:a[b]).apply(a,c)})},w.pluck=function(a,b){return w.map(a,function(a){return a[b]})},w.max=function(a,b,c){if(!b&&w.isArray(a))return Math.max.apply(Math,a);if(!b&&w.isEmpty(a))return-Infinity;var d={computed:-Infinity};return x(a,function(a,e,f){var g=b?b.call(c,a,e,f):a;g>=d.computed&&(d={value:a,computed:g})}),d.value},w.min=function(a,b,c){if(!b&&w.isArray(a))return Math.min.apply(Math,a);if(!b&&w.isEmpty(a))return Infinity;var d={computed:Infinity};return x(a,function(a,e,f){var g=b?b.call(c,a,e,f):a;g<d.computed&&(d={value:a,computed:g})}),d.value},w.shuffle=function(a){var b=[],c;return x(a,function(a,d,e){d==0?b[0]=a:(c=Math.floor(Math.random()*(d+1)),b[d]=b[c],b[c]=a)}),b},w.sortBy=function(a,b,c){return w.pluck(w.map(a,function(a,d,e){return{value:a,criteria:b.call(c,a,d,e)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;return c<d?-1:c>d?1:0}),"value")},w.groupBy=function(a,b){var c={},d=w.isFunction(b)?b:function(a){return a[b]};return x(a,function(a,b){var e=d(a,b);(c[e]||(c[e]=[])).push(a)}),c},w.sortedIndex=function(a,b,c){c||(c=w.identity);var d=0,e=a.length;while(d<e){var f=d+e>>1;c(a[f])<c(b)?d=f+1:e=f}return d},w.toArray=function(a){return a?a.toArray?a.toArray():w.isArray(a)?g.call(a):w.isArguments(a)?g.call(a):w.values(a):[]},w.size=function(a){return w.toArray(a).length},w.first=w.head=function(a,b,c){return b!=null&&!c?g.call(a,0,b):a[0]},w.initial=function(a,b,c){return g.call(a,0,a.length-(b==null||c?1:b))},w.last=function(a,b,c){return b!=null&&!c?g.call(a,Math.max(a.length-b,0)):a[a.length-1]},w.rest=w.tail=function(a,b,c){return g.call(a,b==null||c?1:b)},w.compact=function(a){return w.filter(a,function(a){return!!a})},w.flatten=function(a,b){return w.reduce(a,function(a,c){return w.isArray(c)?a.concat(b?c:w.flatten(c)):(a[a.length]=c,a)},[])},w.without=function(a){return w.difference(a,g.call(arguments,1))},w.uniq=w.unique=function(a,b,c){var d=c?w.map(a,c):a,e=[];return w.reduce(d,function(c,d,f){if(0==f||(b===!0?w.last(c)!=d:!w.include(c,d)))c[c.length]=d,e[e.length]=a[f];return c},[]),e},w.union=function(){return w.uniq(w.flatten(arguments,!0))},w.intersection=w.intersect=function(a){var b=g.call(arguments,1);return w.filter(w.uniq(a),function(a){return w.every(b,function(b){return w.indexOf(b,a)>=0})})},w.difference=function(a){var b=w.flatten(g.call(arguments,1));return w.filter(a,function(a){return!w.include(b,a)})},w.zip=function(){var a=g.call(arguments),b=w.max(w.pluck(a,"length")),c=new Array(b);for(var d=0;d<b;d++)c[d]=w.pluck(a,""+d);return c},w.indexOf=function(a,b,c){if(a==null)return-1;var d,e;if(c)return d=w.sortedIndex(a,b),a[d]===b?d:-1;if(r&&a.indexOf===r)return a.indexOf(b);for(d=0,e=a.length;d<e;d++)if(d in a&&a[d]===b)return d;return-1},w.lastIndexOf=function(a,b){if(a==null)return-1;if(s&&a.lastIndexOf===s)return a.lastIndexOf(b);var c=a.length;while(c--)if(c in a&&a[c]===b)return c;return-1},w.range=function(a,b,c){arguments.length<=1&&(b=a||0,a=0),c=arguments[2]||1;var d=Math.max(Math.ceil((b-a)/c),0),e=0,f=new Array(d);while(e<d)f[e++]=a,a+=c;return f};var z=function(){};w.bind=function(b,c){var d,e;if(b.bind===v&&v)return v.apply(b,g.call(arguments,1));if(!w.isFunction(b))throw new TypeError;return e=g.call(arguments,2),d=function(){if(this instanceof d){z.prototype=b.prototype;var a=new z,f=b.apply(a,e.concat(g.call(arguments)));return Object(f)===f?f:a}return b.apply(c,e.concat(g.call(arguments)))}},w.bindAll=function(a){var b=g.call(arguments,1);return b.length==0&&(b=w.functions(a)),x(b,function(b){a[b]=w.bind(a[b],a)}),a},w.memoize=function(a,b){var c={};return b||(b=w.identity),function(){var d=b.apply(this,arguments);return j.call(c,d)?c[d]:c[d]=a.apply(this,arguments)}},w.delay=function(a,b){var c=g.call(arguments,2);return setTimeout(function(){return a.apply(a,c)},b)},w.defer=function(a){return w.delay.apply(w,[a,1].concat(g.call(arguments,1)))},w.throttle=function(a,b){var c,d,e,f,g,h=w.debounce(function(){g=f=!1},b);return function(){c=this,d=arguments;var i=function(){e=null,g&&a.apply(c,d),h()};e||(e=setTimeout(i,b)),f?g=!0:a.apply(c,d),h(),f=!0}},w.debounce=function(a,b){var c;return function(){var d=this,e=arguments,f=function(){c=null,a.apply(d,e)};clearTimeout(c),c=setTimeout(f,b)}},w.once=function(a){var b=!1,c;return function(){return b?c:(b=!0,c=a.apply(this,arguments))}},w.wrap=function(a,b){return function(){var c=[a].concat(g.call(arguments,0));return b.apply(this,c)}},w.compose=function(){var a=arguments;return function(){var b=arguments;for(var c=a.length-1;c>=0;c--)b=[a[c].apply(this,b)];return b[0]}},w.after=function(a,b){return a<=0?b():function(){if(--a<1)return b.apply(this,arguments)}},w.keys=u||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var b=[];for(var c in a)j.call(a,c)&&(b[b.length]=c);return b},w.values=function(a){return w.map(a,w.identity)},w.functions=w.methods=function(a){var b=[];for(var c in a)w.isFunction(a[c])&&b.push(c);return b.sort()},w.extend=function(a){return x(g.call(arguments,1),function(b){for(var c in b)b[c]!==void 0&&(a[c]=b[c])}),a},w.defaults=function(a){return x(g.call(arguments,1),function(b){for(var c in b)a[c]==null&&(a[c]=b[c])}),a},w.clone=function(a){return w.isObject(a)?w.isArray(a)?a.slice():w.extend({},a):a},w.tap=function(a,b){return b(a),a},w.isEqual=function(a,b){return A(a,b,[])},w.isEmpty=function(a){if(w.isArray(a)||w.isString(a))return a.length===0;for(var b in a)if(j.call(a,b))return!1;return!0},w.isElement=function(a){return!!a&&a.nodeType==1},w.isArray=t||function(a){return i.call(a)=="[object Array]"},w.isObject=function(a){return a===Object(a)},w.isArguments=function(a){return i.call(a)=="[object Arguments]"},w.isArguments(arguments)||(w.isArguments=function(a){return!!a&&!!j.call(a,"callee")}),w.isFunction=function(a){return i.call(a)=="[object Function]"},w.isString=function(a){return i.call(a)=="[object String]"},w.isNumber=function(a){return i.call(a)=="[object Number]"},w.isNaN=function(a){return a!==a},w.isBoolean=function(a){return a===!0||a===!1||i.call(a)=="[object Boolean]"},w.isDate=function(a){return i.call(a)=="[object Date]"},w.isRegExp=function(a){return i.call(a)=="[object RegExp]"},w.isNull=function(a){return a===null},w.isUndefined=function(a){return a===void 0},w.noConflict=function(){return a._=b,this},w.identity=function(a){return a},w.times=function(a,b,c){for(var d=0;d<a;d++)b.call(c,d)},w.escape=function(a){return(""+a).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;").replace(/\//g,"&#x2F;")},w.mixin=function(a){x(w.functions(a),function(b){F(b,w[b]=a[b])})};var B=0;w.uniqueId=function(a){var b=B++;return a?a+b:b},w.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var C=/.^/;w.template=function(a,b){var c=w.templateSettings,d="var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('"+a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(c.escape||C,function(a,b){return"',_.escape("+b.replace(/\\'/g,"'")+"),'"}).replace(c.interpolate||C,function(a,b){return"',"+b.replace(/\\'/g,"'")+",'"}).replace(c.evaluate||C,function(a,b){return"');"+b.replace(/\\'/g,"'").replace(/[\r\n\t]/g," ").replace(/\\\\/g,"\\")+";__p.push('"}).replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t")+"');}return __p.join('');",e=new Function("obj","_",d);return b?e(b,w):function(a){return e.call(this,a,w)}},w.chain=function(a){return w(a).chain()};var D=function(a){this._wrapped=a};w.prototype=D.prototype;var E=function(a,b){return b?w(a).chain():a},F=function(a,b){D.prototype[a]=function(){var a=g.call(arguments);return h.call(a,this._wrapped),E(b.apply(w,a),this._chain)}};w.mixin(w),x(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=d[a];D.prototype[a]=function(){var c=this._wrapped;b.apply(c,arguments);var d=c.length;return(a=="shift"||a=="splice")&&d===0&&delete c[0],E(c,this._chain)}}),x(["concat","join","slice"],function(a){var b=d[a];D.prototype[a]=function(){return E(b.apply(this._wrapped,arguments),this._chain)}}),D.prototype.chain=function(){return this._chain=!0,this},D.prototype.value=function(){return this._wrapped}}.call(this),function(){var a=this,b=a.Backbone,c;typeof exports!="undefined"?c=exports:c=a.Backbone={},c.VERSION="0.5.3";var d=a._;!d&&typeof require!="undefined"&&(d=require("underscore")._);var e=a.jQuery||a.Zepto;c.noConflict=function(){return a.Backbone=b,this},c.emulateHTTP=!1,c.emulateJSON=!1,c.Events={bind:function(a,b,c){var d=this._callbacks||(this._callbacks={}),e=d[a]||(d[a]=[]);return e.push([b,c]),this},unbind:function(a,b){var c;if(!a)this._callbacks={};else if(c=this._callbacks)if(!b)c[a]=[];else{var d=c[a];if(!d)return this;for(var e=0,f=d.length;e<f;e++)if(d[e]&&b===d[e][0]){d[e]=null;break}}return this},trigger:function(a){var b,c,d,e,f,g=2;if(!(c=this._callbacks))return this;while(g--){d=g?a:"all";if(b=c[d])for(var h=0,i=b.length;h<i;h++)(e=b[h])?(f=g?Array.prototype.slice.call(arguments,1):arguments,e[0].apply(e[1]||this,f)):(b.splice(h,1),h--,i--)}return this}},c.Model=function(a,b){var c;a||(a={});if(c=this.defaults)d.isFunction(c)&&(c=c.call(this)),a=d.extend({},c,a);this.attributes={},this._escapedAttributes={},this.cid=d.uniqueId("c"),this.set(a,{silent:!0}),this._changed=!1,this._previousAttributes=d.clone(this.attributes),b&&b.collection&&(this.collection=b.collection),this.initialize(a,b)},d.extend(c.Model.prototype,c.Events,{_previousAttributes:null,_changed:!1,idAttribute:"id",initialize:function(){},toJSON:function(){return d.clone(this.attributes)},get:function(a){return this.attributes[a]},escape:function(a){var b;if(b=this._escapedAttributes[a])return b;var c=this.attributes[a];return this._escapedAttributes[a]=w(c==null?"":""+c)},has:function(a){return this.attributes[a]!=null},set:function(a,b){b||(b={});if(!a)return this;a.attributes&&(a=a.attributes);var c=this.attributes,e=this._escapedAttributes;if(!b.silent&&this.validate&&!this._performValidation(a,b))return!1;this.idAttribute in a&&(this.id=a[this.idAttribute]);var f=this._changing;this._changing=!0;for(var g in a){var h=a[g];d.isEqual(c[g],h)||(c[g]=h,delete e[g],this._changed=!0,b.silent||this.trigger("change:"+g,this,h,b))}return!f&&!b.silent&&this._changed&&this.change(b),this._changing=!1,this},unset:function(a,b){if(a in this.attributes){b||(b={});var c=this.attributes[a],d={};return d[a]=void 0,!b.silent&&this.validate&&!this._performValidation(d,b)?!1:(delete this.attributes[a],delete this._escapedAttributes[a],a==this.idAttribute&&delete this.id,this._changed=!0,b.silent||(this.trigger("change:"+a,this,void 0,b),this.change(b)),this)}return this},clear:function(a){a||(a={});var b,c=this.attributes,d={};for(b in c)d[b]=void 0;if(!a.silent&&this.validate&&!this._performValidation(d,a))return!1;this.attributes={},this._escapedAttributes={},this._changed=!0;if(!a.silent){for(b in c)this.trigger("change:"+b,this,void 0,a);this.change(a)}return this},fetch:function(a){a||(a={});var b=this,d=a.success;return a.success=function(c,e,f){if(!b.set(b.parse(c,f),a))return!1;d&&d(b,c)},a.error=v(a.error,b,a),(this.sync||c.sync).call(this,"read",this,a)},save:function(a,b){b||(b={});if(a&&!this.set(a,b))return!1;var d=this,e=b.success;b.success=function(a,c,f){if(!d.set(d.parse(a,f),b))return!1;e&&e(d,a,f)},b.error=v(b.error,d,b);var f=this.isNew()?"create":"update";return(this.sync||c.sync).call(this,f,this,b)},destroy:function(a){a||(a={});if(this.isNew())return this.trigger("destroy",this,this.collection,a);var b=this,d=a.success;return a.success=function(c){b.trigger("destroy",b,b.collection,a),d&&d(b,c)},a.error=v(a.error,b,a),(this.sync||c.sync).call(this,"delete",this,a)},url:function(){var a=t(this.collection)||this.urlRoot||u();return this.isNew()?a:a+(a.charAt(a.length-1)=="/"?"":"/")+encodeURIComponent(this.id)},parse:function(a,b){return a},clone:function(){return new this.constructor(this)},isNew:function(){return this.id==null},change:function(a){this.trigger("change",this,a),this._previousAttributes=d.clone(this.attributes),this._changed=!1},hasChanged:function(a){return a?this._previousAttributes[a]!=this.attributes[a]:this._changed},changedAttributes:function(a){a||(a=this.attributes);var b=this._previousAttributes,c=!1;for(var e in a)d.isEqual(b[e],a[e])||(c=c||{},c[e]=a[e]);return c},previous:function(a){return!a||!this._previousAttributes?null:this._previousAttributes[a]},previousAttributes:function(){return d.clone(this._previousAttributes)},_performValidation:function(a,b){var c=this.validate(a);return c?(b.error?b.error(this,c,b):this.trigger("error",this,c,b),!1):!0}}),c.Collection=function(a,b){b||(b={}),b.comparator&&(this.comparator=b.comparator),d.bindAll(this,"_onModelEvent","_removeReference"),this._reset(),a&&this.reset(a,{silent:!0}),this.initialize.apply(this,arguments)},d.extend(c.Collection.prototype,c.Events,{model:c.Model,initialize:function(){},toJSON:function(){return this.map(function(a){return a.toJSON()})},add:function(a,b){if(d.isArray(a))for(var c=0,e=a.length;c<e;c++)this._add(a[c],b);else this._add(a,b);return this},remove:function(a,b){if(d.isArray(a))for(var c=0,e=a.length;c<e;c++)this._remove(a[c],b);else this._remove(a,b);return this},get:function(a){return a==null?null:this._byId[a.id!=null?a.id:a]},getByCid:function(a){return a&&this._byCid[a.cid||a]},at:function(a){return this.models[a]},sort:function(a){a||(a={});if(!this.comparator)throw new Error("Cannot sort a set without a comparator");return this.models=this.sortBy(this.comparator),a.silent||this.trigger("reset",this,a),this},pluck:function(a){return d.map(this.models,function(b){return b.get(a)})},reset:function(a,b){return a||(a=[]),b||(b={}),this.each(this._removeReference),this._reset(),this.add(a,{silent:!0}),b.silent||this.trigger("reset",this,b),this},fetch:function(a){a||(a={});var b=this,d=a.success;return a.success=function(c,e,f){b[a.add?"add":"reset"](b.parse(c,f),a),d&&d(b,c)},a.error=v(a.error,b,a),(this.sync||c.sync).call(this,"read",this,a)},create:function(a,b){var c=this;b||(b={}),a=this._prepareModel(a,b);if(!a)return!1;var d=b.success;return b.success=function(a,e,f){c.add(a,b),d&&d(a,e,f)},a.save(null,b),a},parse:function(a,b){return a},chain:function(){return d(this.models).chain()},_reset:function(a){this.length=0,this.models=[],this._byId={},this._byCid={}},_prepareModel:function(a,b){if(a instanceof c.Model)a.collection||(a.collection=this);else{var d=a;a=new this.model(d,{collection:this}),a.validate&&!a._performValidation(d,b)&&(a=!1)}return a},_add:function(a,b){b||(b={}),a=this._prepareModel(a,b);if(!a)return!1;var c=this.getByCid(a);if(c)throw new Error(["Can't add the same model to a set twice",c.id]);this._byId[a.id]=a,this._byCid[a.cid]=a;var d=b.at!=null?b.at:this.comparator?this.sortedIndex(a,this.comparator):this.length;return this.models.splice(d,0,a),a.bind("all",this._onModelEvent),this.length++,b.silent||a.trigger("add",a,this,b),a},_remove:function(a,b){return b||(b={}),a=this.getByCid(a)||this.get(a),a?(delete this._byId[a.id],delete this._byCid[a.cid],this.models.splice(this.indexOf(a),1),this.length--,b.silent||a.trigger("remove",a,this,b),this._removeReference(a),a):null},_removeReference:function(a){this==a.collection&&delete a.collection,a.unbind("all",this._onModelEvent)},_onModelEvent:function(a,b,c,d){if((a=="add"||a=="remove")&&c!=this)return;a=="destroy"&&this._remove(b,d),b&&a==="change:"+b.idAttribute&&(delete this._byId[b.previous(b.idAttribute)],this._byId[b.id]=b),this.trigger.apply(this,arguments)}});var f=["forEach","each","map","reduce","reduceRight","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","max","min","sortBy","sortedIndex","toArray","size","first","rest","last","without","indexOf","lastIndexOf","isEmpty","groupBy"];d.each(f,function(a){c.Collection.prototype[a]=function(){return d[a].apply(d,[this.models].concat(d.toArray(arguments)))}}),c.Router=function(a){a||(a={}),a.routes&&(this.routes=a.routes),this._bindRoutes(),this.initialize.apply(this,arguments)};var g=/:([\w\d]+)/g,h=/\*([\w\d]+)/g,i=/[-[\]{}()+?.,\\^$|#\s]/g;d.extend(c.Router.prototype,c.Events,{initialize:function(){},route:function(a,b,e){c.history||(c.history=new c.History),d.isRegExp(a)||(a=this._routeToRegExp(a)),c.history.route(a,d.bind(function(c){var d=this._extractParameters(a,c);e.apply(this,d),this.trigger.apply(this,["route:"+b].concat(d))},this))},navigate:function(a,b){c.history.navigate(a,b)},_bindRoutes:function(){if(!this.routes)return;var a=[];for(var b in this.routes)a.unshift([b,this.routes[b]]);for(var c=0,d=a.length;c<d;c++)this.route(a[c][0],a[c][1],this[a[c][1]])},_routeToRegExp:function(a){return a=a.replace(i,"\\$&").replace(g,"([^/]*)").replace(h,"(.*?)"),new RegExp("^"+a+"$")},_extractParameters:function(a,b){return a.exec(b).slice(1)}}),c.History=function(){this.handlers=[],d.bindAll(this,"checkUrl")};var j=/^#*/,k=/msie [\w.]+/,l=!1;d.extend(c.History.prototype,{interval:50,getFragment:function(a,b){if(a==null)if(this._hasPushState||b){a=window.location.pathname;var c=window.location.search;c&&(a+=c),a.indexOf(this.options.root)==0&&(a=a.substr(this.options.root.length))}else a=window.location.hash;return decodeURIComponent(a.replace(j,""))},start:function(a){if(l)throw new Error("Backbone.history has already been started");this.options=d.extend({},{root:"/"},this.options,a),this._wantsPushState=!!this.options.pushState,this._hasPushState=!!(this.options.pushState&&window.history&&window.history.pushState);var b=this.getFragment(),c=document.documentMode,f=k.exec(navigator.userAgent.toLowerCase())&&(!c||c<=7);f&&(this.iframe=e('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo("body")[0].contentWindow,this.navigate(b)),this._hasPushState?e(window).bind("popstate",this.checkUrl):"onhashchange"in window&&!f?e(window).bind("hashchange",this.checkUrl):setInterval(this.checkUrl,this.interval),this.fragment=b,l=!0;var g=window.location,h=g.pathname==this.options.root;if(this._wantsPushState&&!this._hasPushState&&!h)return this.fragment=this.getFragment(null,!0),window.location.replace(this.options.root+"#"+this.fragment),!0;this._wantsPushState&&this._hasPushState&&h&&g.hash&&(this.fragment=g.hash.replace(j,""),window.history.replaceState({},document.title,g.protocol+"//"+g.host+this.options.root+this.fragment));if(!this.options.silent)return this.loadUrl()},route:function(a,b){this.handlers.unshift({route:a,callback:b})},checkUrl:function(a){var b=this.getFragment();b==this.fragment&&this.iframe&&(b=this.getFragment(this.iframe.location.hash));if(b==this.fragment||b==decodeURIComponent(this.fragment))return!1;this.iframe&&this.navigate(b),this.loadUrl()||this.loadUrl(window.location.hash)},loadUrl:function(a){var b=this.fragment=this.getFragment(a),c=d.any(this.handlers,function(a){if(a.route.test(b))return a.callback(b),!0});return c},navigate:function(a,b){var c=(a||"").replace(j,"");if(this.fragment==c||this.fragment==decodeURIComponent(c))return;if(this._hasPushState){var d=window.location;c.indexOf(this.options.root)!=0&&(c=this.options.root+c),this.fragment=c,window.history.pushState({},document.title,d.protocol+"//"+d.host+c)}else window.location.hash=this.fragment=c,this.iframe&&c!=this.getFragment(this.iframe.location.hash)&&(this.iframe.document.open().close(),this.iframe.location.hash=c);b&&this.loadUrl(a)}}),c.View=function(a){this.cid=d.uniqueId("view"),this._configure(a||{}),this._ensureElement(),this.delegateEvents(),this.initialize.apply(this,arguments)};var m=function(a){return e(a,this.el)},n=/^(\S+)\s*(.*)$/,o=["model","collection","el","id","attributes","className","tagName"];d.extend(c.View.prototype,c.Events,{tagName:"div",$:m,initialize:function(){},render:function(){return this},remove:function(){return e(this.el).remove(),this},make:function(a,b,c){var d=document.createElement(a);return b&&e(d).attr(b),c&&e(d).html(c),d},delegateEvents:function(a){if(!a&&!(a=this.events))return;d.isFunction(a)&&(a=a.call(this)),e(this.el).unbind(".delegateEvents"+this.cid);for(var b in a){var c=this[a[b]];if(!c)throw new Error('Event "'+a[b]+'" does not exist');var f=b.match(n),g=f[1],h=f[2];c=d.bind(c,this),g+=".delegateEvents"+this.cid,h===""?e(this.el).bind(g,c):e(this.el).delegate(h,g,c)}},_configure:function(a){this.options&&(a=d.extend({},this.options,a));for(var b=0,c=o.length;b<c;b++){var e=o[b];a[e]&&(this[e]=a[e])}this.options=a},_ensureElement:function(){if(!this.el){var a=this.attributes||{};this.id&&(a.id=this.id),this.className&&(a["class"]=this.className),this.el=this.make(this.tagName,a)}else d.isString(this.el)&&(this.el=e(this.el).get(0))}});var p=function(a,b){var c=s(this,a,b);return c.extend=this.extend,c};c.Model.extend=c.Collection.extend=c.Router.extend=c.View.extend=p;var q={create:"POST",update:"PUT","delete":"DELETE",read:"GET"};c.sync=function(a,b,f){var g=q[a],h=d.extend({type:g,dataType:"json"},f);return h.url||(h.url=t(b)||u()),!h.data&&b&&(a=="create"||a=="update")&&(h.contentType="application/json",h.data=JSON.stringify(b.toJSON())),c.emulateJSON&&(h.contentType="application/x-www-form-urlencoded",h.data=h.data?{model:h.data}:{}),c.emulateHTTP&&(g==="PUT"||g==="DELETE")&&(c.emulateJSON&&(h.data._method=g),h.type="POST",h.beforeSend=function(a){a.setRequestHeader("X-HTTP-Method-Override",g)}),h.type!=="GET"&&!c.emulateJSON&&(h.processData=!1),e.ajax(h)};var r=function(){},s=function(a,b,c){var e;return b&&b.hasOwnProperty("constructor")?e=b.constructor:e=function(){return a.apply(this,arguments)},d.extend(e,a),r.prototype=a.prototype,e.prototype=new r,b&&d.extend(e.prototype,b),c&&d.extend(e,c),e.prototype.constructor=e,e.__super__=a.prototype,e},t=function(a){return!a||!a.url?null:d.isFunction(a.url)?a.url():a.url},u=function(){throw new Error('A "url" property or function must be specified')},v=function(a,b,c){return function(d){a?a(b,d,c):b.trigger("error",b,d,c)}},w=function(a){return a.replace(/&(?!\w+;|#\d+;|#x[\da-f]+;)/gi,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;").replace(/\//g,"&#x2F;")}}.call(this),function(){var a=Object.prototype.hasOwnProperty,b=function(b,c){function e(){this.constructor=b}for(var d in c)a.call(c,d)&&(b[d]=c[d]);return e.prototype=c.prototype,b.prototype=new e,b.__super__=c.prototype,b};window.NewSuggestionView=function(a){function c(){c.__super__.constructor.apply(this,arguments)}return b(c,a),c.prototype.events={"click div.invitation a":"startLinkClicked"},c.prototype.activate=function(){return $(this.el).addClass("activated"),$(this.el).removeClass("inviting"),$(this.el).find("textarea").focus()},c.prototype.startLinkClicked=function(a){return a.preventDefault(),this.activate()},c}(Backbone.View)}.call(this)
