diff --git a/README.md b/README.md index 52560fd3..00dc3d9f 100755 --- a/README.md +++ b/README.md @@ -17,3 +17,10 @@ Designed for standalone use or as a library to integrate into your own app. Open demo/index.html in your favourite browser. +## Minifying dependencies + + npm install -g uglify + cd vendor + cat *.js | uglifyjs -o ../src/deps-min.js + +note: make sure underscore.js goes in at the top of the file as a few deps currently depend on it diff --git a/demo/index.html b/demo/index.html index e9203232..9190da32 100755 --- a/demo/index.html +++ b/demo/index.html @@ -1,21 +1,20 @@ - - CouchDB Data Explorer + + CouchDB Data Explorer - - - - - - - - + + + + + + + -
- +
+ -
- -
-
- Loading... -
+
+ +
+
+ Loading... +
+
+ + + + + + + {{#rows}} + + + + + {{/rows}} + +
+ before + + after +
+ {{before}} + + {{after}} +
+
+ diff --git a/src/deps-min.js b/src/deps-min.js index 61283b14..f927b0de 100644 --- a/src/deps-min.js +++ b/src/deps-min.js @@ -1,19 +1,13 @@ -/*! - * jQuery JavaScript Library v1.6.1 - * http://jquery.com/ - * - * Copyright 2011, John Resig - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * Includes Sizzle.js - * http://sizzlejs.com/ - * Copyright 2011, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * - * Date: Thu May 12 15:04:36 2011 -0400 - */(function(a,b){function F(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(N,"$1-$2").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:J.isNaN(d)?M.test(d)?J.parseJSON(d):d:parseFloat(d)}catch(f){}J.data(a,c,d)}else d=b}return d}function E(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function D(a,c,d){var e=c+"defer",f=c+"queue",g=c+"mark",h=J.data(a,e,b,!0);h&&(d==="queue"||!J.data(a,f,b,!0))&&(d==="mark"||!J.data(a,g,b,!0))&&setTimeout(function(){!J.data(a,f,b,!0)&&!J.data(a,g,b,!0)&&(J.removeData(a,e,!0),h.resolve())},0)}function C(){return!1}function B(){return!0}function A(a,c,d){var e=J.extend({},d[0]);e.type=a,e.originalEvent={},e.liveFired=b,J.event.handle.call(c,e),e.isDefaultPrevented()&&d[0].preventDefault()}function z(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o=[],p=[],q=J._data(this,"events");if(!(a.liveFired===this||!q||!q.live||a.target.disabled||a.button&&a.type==="click")){a.namespace&&(m=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var r=q.live.slice(0);for(h=0;hc)break;a.currentTarget=e.elem,a.data=e.handleObj.data,a.handleObj=e.handleObj,n=e.handleObj.origHandler.apply(e.elem,arguments);if(n===!1||a.isPropagationStopped()){c=e.level,n===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function y(a,b){return(a&&a!=="*"?a+".":"")+b.replace(_,"`").replace(ba,"&")}function x(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function w(a,b,c){b=b||0;if(J.isFunction(b))return J.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return J.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=J.grep(a,function(a){return a.nodeType===1});if(bm.test(b))return J.filter(b,d,!c);b=J.filter(b,d)}return J.grep(a,function(a,d){return J.inArray(a,b)>=0===c})}function v(a,b){return J.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function u(a,b){if(b.nodeType===1&&!!J.hasData(a)){var c=J.expando,d=J.data(a),e=J.data(b,d);if(d=d[c]){var f=d.events;e=e[c]=J.extend({},d);if(f){delete e.handle,e.events={};for(var g in f)for(var h=0,i=f[g].length;h").appendTo("body"),c=b.css("display");b.remove();if(c==="none"||c===""){cp||(cp=G.createElement("iframe"),cp.frameBorder=cp.width=cp.height=0),G.body.appendChild(cp);if(!cq||!cp.createElement)cq=(cp.contentWindow||cp.contentDocument).document,cq.write("");b=cq.createElement(a),cq.body.appendChild(b),c=J.css(b,"display"),G.body.removeChild(cp)}co[a]=c}return co[a]}function c(a){return J.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}var G=a.document,H=a.navigator,I=a.location,J=function(){function c(){if(!d.isReady){try{G.documentElement.doScroll("left")}catch(a){setTimeout(c,1);return}d.ready()}}var d=function(a,b){return new d.fn.init(a,b,g)},e=a.jQuery,f=a.$,g,h=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,i=/\S/,j=/^\s+/,k=/\s+$/,l=/\d/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=H.userAgent,w,x,y,z=Object.prototype.toString,A=Object.prototype.hasOwnProperty,B=Array.prototype.push,C=Array.prototype.slice,D=String.prototype.trim,E=Array.prototype.indexOf,F={};d.fn=d.prototype={constructor:d,init:function(a,c,e){var f,g,i,j;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!c&&G.body){this.context=G,this[0]=G.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?f=h.exec(a):f=[null,a,null];if(f&&(f[1]||!c)){if(f[1]){c=c instanceof d?c[0]:c,j=c?c.ownerDocument||c:G,i=m.exec(a),i?d.isPlainObject(c)?(a=[G.createElement(i[1])],d.fn.attr.call(a,c,!0)):a=[j.createElement(i[1])]:(i=d.buildFragment([f[1]],[j]),a=(i.cacheable?d.clone(i.fragment):i.fragment).childNodes);return d.merge(this,a)}g=G.getElementById(f[2]);if(g&&g.parentNode){if(g.id!==f[2])return e.find(a);this.length=1,this[0]=g}this.context=G,this.selector=a;return this}return!c||c.jquery?(c||e).find(a):this.constructor(c).find(a)}if(d.isFunction(a))return e.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return d.makeArray(a,this)},selector:"",jquery:"1.6.1",length:0,size:function(){return this.length},toArray:function(){return C.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var e=this.constructor();d.isArray(a)?B.apply(e,a):d.merge(e,a),e.prevObject=this,e.context=this.context,b==="find"?e.selector=this.selector+(this.selector?" ":"")+c:b&&(e.selector=this.selector+"."+b+"("+c+")");return e},each:function(a,b){return d.each(this,a,b)},ready:function(a){d.bindReady(),x.done(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(C.apply(this,arguments),"slice",C.call(arguments).join(","))},map:function(a){return this.pushStack(d.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:B,sort:[].sort,splice:[].splice},d.fn.init.prototype=d.fn,d.extend=d.fn.extend=function(){var a,c,e,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!d.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;x.resolveWith(G,[d]),d.fn.trigger&&d(G).trigger("ready").unbind("ready")}},bindReady:function(){if(!x){x=d._Deferred();if(G.readyState==="complete")return setTimeout(d.ready,1);if(G.addEventListener)G.addEventListener("DOMContentLoaded",y,!1),a.addEventListener("load",d.ready,!1);else if(G.attachEvent){G.attachEvent("onreadystatechange",y),a.attachEvent("onload",d.ready);var b=!1;try{b=a.frameElement==null}catch(e){}G.documentElement.doScroll&&b&&c()}}},isFunction:function(a){return d.type(a)==="function"},isArray:Array.isArray||function(a){return d.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNaN:function(a){return a==null||!l.test(a)||isNaN(a)},type:function(a){return a==null?String(a):F[z.call(a)]||"object"},isPlainObject:function(a){if(!a||d.type(a)!=="object"||a.nodeType||d.isWindow(a))return!1;if(a.constructor&&!A.call(a,"constructor")&&!A.call(a.constructor.prototype,"isPrototypeOf"))return!1;var c;for(c in a);return c===b||A.call(a,c)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=d.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();d.error("Invalid JSON: "+b)},parseXML:function(b,c,e){a.DOMParser?(e=new DOMParser,c=e.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b)),e=c.documentElement,(!e||!e.nodeName||e.nodeName==="parsererror")&&d.error("Invalid XML: "+b);return c},noop:function(){},globalEval:function(b){b&&i.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,e){var f,g=0,h=a.length,i=h===b||d.isFunction(a);if(e){if(i){for(f in a)if(c.apply(a[f],e)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||d.isArray(a));if(k)for(;i1?L.call(arguments,0):b,--f||g.resolveWith(g,L.call(c,0))}}var c=arguments,d=0,e=c.length,f=e,g=e<=1&&a&&J.isFunction(a.promise)?a:J.Deferred();if(e>1){for(;d
a",c=a.getElementsByTagName("*"),d=a.getElementsByTagName("a")[0];if(!c||!c.length||!d)return{};e=G.createElement("select"),f=e.appendChild(G.createElement("option")),g=a.getElementsByTagName("input")[0],i={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/top/.test(d.getAttribute("style")),hrefNormalized:d.getAttribute("href")==="/a",opacity:/^0.55$/.test(d.style.opacity),cssFloat:!!d.style.cssFloat,checkOn:g.value==="on",optSelected:f.selected,getSetAttribute:a.className!=="t",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},g.checked=!0,i.noCloneChecked=g.cloneNode(!0).checked,e.disabled=!0,i.optDisabled=!f.disabled;try{delete a.test}catch(r){i.deleteExpando=!1}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function s(){i.noCloneEvent=!1,a.detachEvent("onclick",s)}),a.cloneNode(!0).fireEvent("onclick")),g=G.createElement("input"),g.value="t",g.setAttribute("type","radio"),i.radioValue=g.value==="t",g.setAttribute("checked","checked"),a.appendChild(g),j=G.createDocumentFragment(),j.appendChild(a.firstChild),i.checkClone=j.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",k=G.createElement("body"),l={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"};for(p in l)k.style[p]=l[p];k.appendChild(a),b.insertBefore(k,b.firstChild),i.appendChecked=g.checked,i.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,i.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="
",i.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="
t
",m=a.getElementsByTagName("td"),q=m[0].offsetHeight===0,m[0].style.display="",m[1].style.display="none",i.reliableHiddenOffsets=q&&m[0].offsetHeight===0,a.innerHTML="",G.defaultView&&G.defaultView.getComputedStyle&&(h=G.createElement("div"),h.style.width="0",h.style.marginRight="0",a.appendChild(h),i.reliableMarginRight=(parseInt((G.defaultView.getComputedStyle(h,null)||{marginRight:0}).marginRight,10)||0)===0),k.innerHTML="",b.removeChild(k);if(a.attachEvent)for(p in{submit:1,change:1,focusin:1})o="on"+p,q=o in a,q||(a.setAttribute(o,"return;"),q=typeof a[o]=="function"),i[p+"Bubbles"]=q;return i}(),J.boxModel=J.support.boxModel;var M=/^(?:\{.*\}|\[.*\])$/,N=/([a-z])([A-Z])/g;J.extend({cache:{},uuid:0,expando:"jQuery"+(J.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?J.cache[a[J.expando]]:a[J.expando];return!!a&&!E(a)},data:function(a,c,d,e){if(!!J.acceptData(a)){var f=J.expando,g=typeof c=="string",h,i=a.nodeType,j=i?J.cache:a,k=i?a[J.expando]:a[J.expando]&&J.expando;if((!k||e&&k&&!j[k][f])&&g&&d===b)return;k||(i?a[J.expando]=k=++J.uuid:k=J.expando),j[k]||(j[k]={},i||(j[k].toJSON=J.noop));if(typeof c=="object"||typeof c=="function")e?j[k][f]=J.extend(j[k][f],c):j[k]=J.extend(j[k],c);h=j[k],e&&(h[f]||(h[f]={}),h=h[f]),d!==b&&(h[J.camelCase(c)]=d);return c==="events"&&!h[c]?h[f]&&h[f].events:g?h[J.camelCase(c)]:h}},removeData:function(b,c,d){if(!!J.acceptData(b)){var e=J.expando,f=b.nodeType,g=f?J.cache:b,h=f?b[J.expando]:J.expando;if(!g[h])return;if(c){var i=d?g[h][e]:g[h];if(i){delete i[c];if(!E(i))return}}if(d){delete g[h][e];if(!E(g[h]))return}var j=g[h][e];J.support.deleteExpando||g!=a?delete g[h]:g[h]=null,j?(g[h]={},f||(g[h].toJSON=J.noop),g[h][e]=j):f&&(J.support.deleteExpando?delete b[J.expando]:b.removeAttribute?b.removeAttribute(J.expando):b[J.expando]=null)}},_data:function(a,b,c){return J.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=J.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),J.fn.extend({data:function(a,c){var d=null;if(typeof a=="undefined"){if(this.length){d=J.data(this[0]);if(this[0].nodeType===1){var e=this[0].attributes,f;for(var g=0,h=e.length;g-1)return!0;return!1},val:function(a){var c,d,e=this[0];if(!arguments.length){if(e){c=J.valHooks[e.nodeName.toLowerCase()]||J.valHooks[e.type];return c&&"get"in c&&(d=c.get(e,"value"))!==b?d:(e.value||"").replace(Q,"")}return b}var f=J.isFunction(a);return this.each(function(d){var e=J(this),g;if(this.nodeType===1){f?g=a.call(this,d,e.val()):g=a,g==null?g="":typeof g=="number"?g+="":J.isArray(g)&&(g=J.map(g,function(a){return a==null?"":a+""})),c=J.valHooks[this.nodeName.toLowerCase()]||J.valHooks[this.type];if(!c||!("set"in c)||c.set(this,g,"value")===b)this.value=g}})}}),J.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c=a.selectedIndex,d=[],e=a.options,f=a.type==="select-one";if(c<0)return null;for(var g=f?c:0,h=f?c+1:e.length;g=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attrFix:{tabindex:"tabIndex"},attr:function(a,c,d,e){var f=a.nodeType;if(!a||f===3||f===8||f===2)return b;if(e&&c in J.attrFn)return J(a)[c](d);if("getAttribute"in a){var g,h,i=f!==1||!J.isXMLDoc(a);c=i&&J.attrFix[c]||c,h=J.attrHooks[c],h||(!U.test(c)||typeof d!="boolean"&&d!==b&&d.toLowerCase()!==c.toLowerCase()?W&&(J.nodeName(a,"form")||V.test(c))&&(h=W):h=X);if(d!==b){if(d===null){J.removeAttr(a,c);return b}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i)return h.get(a,c);g=a.getAttribute(c);return g===null?b:g}return J.prop(a,c,d)},removeAttr:function(a,b){var c;a.nodeType===1&&(b=J.attrFix[b]||b,J.support.getSetAttribute?a.removeAttribute(b):(J.attr(a,b,""),a.removeAttributeNode(a.getAttributeNode(b))),U.test(b)&&(c=J.propFix[b]||b)in a&&(a[c]=!1))},attrHooks:{type:{set:function(a,b){if(R.test(a.nodeName)&&a.parentNode)J.error("type property can't be changed");else if(!J.support.radioValue&&b==="radio"&&J.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},tabIndex:{get:function(a){var c=a.getAttributeNode("tabIndex");return c&&c.specified?parseInt(c.value,10):S.test(a.nodeName)||T.test(a.nodeName)&&a.href?0:b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e=a.nodeType;if(!a||e===3||e===8||e===2)return b;var f,g,h=e!==1||!J.isXMLDoc(a);c=h&&J.propFix[c]||c,g=J.propHooks[c];return d!==b?g&&"set"in g&&(f=g.set(a,d,c))!==b?f:a[c]=d:g&&"get"in g&&(f=g.get(a,c))!==b?f:a[c]},propHooks:{}}),X={get:function(a,c){return a[J.propFix[c]||c]?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?J.removeAttr(a,c):(d=J.propFix[c]||c,d in a&&(a[d]=b),a.setAttribute(c,c.toLowerCase()));return c}},J.attrHooks.value={get:function(a,b){return W&&J.nodeName(a,"button")?W.get(a,b):a.value},set:function(a,b,c){if(W&&J.nodeName(a,"button"))return W.set(a,b,c);a.value=b}},J.support.getSetAttribute||(J.attrFix=J.propFix,W=J.attrHooks.name=J.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&d.nodeValue!==""?d.nodeValue:b},set:function(a,b,c){var d=a.getAttributeNode(c);if(d){d.nodeValue=b;return b}}},J.each(["width","height"],function(a,b){J.attrHooks[b]=J.extend(J.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})})),J.support.hrefNormalized||J.each(["href","src","width","height"],function(a,c){J.attrHooks[c]=J.extend(J.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),J.support.style||(J.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),J.support.optSelected||(J.propHooks.selected=J.extend(J.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}})),J.support.checkOn||J.each(["radio","checkbox"],function(){J.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),J.each(["radio","checkbox"],function(){J.valHooks[this]=J.extend(J.valHooks[this],{set:function(a,b){if(J.isArray(b))return a.checked=J.inArray(J(a).val(),b)>=0}})});var Y=Object.prototype.hasOwnProperty,Z=/\.(.*)$/,$=/^(?:textarea|input|select)$/i,_=/\./g,ba=/ /g,bb=/[^\w\s.|`]/g,bc=function(a){return a.replace(bb,"\\$&")};J.event={add:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){if(d===!1)d=C;else if(!d)return;var f,g;d.handler&&(f=d,d=f.handler),d.guid||(d.guid=J.guid++);var h=J._data(a);if(!h)return;var i=h.events,j=h.handle;i||(h.events=i={}),j||(h.handle=j=function(a){return typeof J!="undefined"&&(!a||J.event.triggered!==a.type)?J.event.handle.apply(j.elem,arguments):b}),j.elem=a,c=c.split(" ");var k,l=0,m;while(k=c[l++]){g=f?J.extend({},f):{handler:d,data:e},k.indexOf(".")>-1?(m=k.split("."),k=m.shift(),g.namespace=m.slice(0).sort().join(".")):(m=[],g.namespace=""),g.type=k,g.guid||(g.guid=d.guid);var n=i[k],o=J.event.special[k]||{};if(!n){n=i[k]=[];if(!o.setup||o.setup.call(a,e,m,j)===!1)a.addEventListener?a.addEventListener(k,j,!1):a.attachEvent&&a.attachEvent("on"+k,j)}o.add&&(o.add.call(a,g),g.handler.guid||(g.handler.guid=d.guid)),n.push(g),J.event.global[k]=!0}a=null}},global:{},remove:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){d===!1&&(d=C);var f,g,h,i,j=0,k,l,m,n,o,p,q,r=J.hasData(a)&&J._data(a),s=r&&r.events;if(!r||!s)return;c&&c.type&&(d=c.handler,c=c.type);if(!c||typeof c=="string"&&c.charAt(0)==="."){c=c||"";for(g in s)J.event.remove(a,g+c);return}c=c.split(" ");while(g=c[j++]){q=g,p=null,k=g.indexOf(".")<0,l=[],k||(l=g.split("."),g=l.shift(),m=new RegExp("(^|\\.)"+J.map(l.slice(0).sort(),bc).join("\\.(?:.*\\.)?")+"(\\.|$)")),o=s[g];if(!o)continue;if(!d){for(i=0;i=0&&(g=g.slice(0,-1),i=!0),g.indexOf(".")>=0&&(h=g.split("."),g=h.shift(),h.sort());if(!!e&&!J.event.customEvent[g]||!!J.event.global[g]){c=typeof c=="object"?c[J.expando]?c:new J.Event(g,c):new J.Event(g),c.type=g,c.exclusive=i,c.namespace=h.join("."),c.namespace_re=new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.)?")+"(\\.|$)");if(f||!e)c.preventDefault(),c.stopPropagation();if(!e){J.each(J.cache,function(){var a=J.expando,b=this[a];b&&b.events&&b.events[g]&&J.event.trigger(c,d,b.handle.elem)});return}if(e.nodeType===3||e.nodeType===8)return;c.result=b,c.target=e,d=d?J.makeArray -(d):[],d.unshift(c);var j=e,k=g.indexOf(":")<0?"on"+g:"";do{var l=J._data(j,"handle");c.currentTarget=j,l&&l.apply(j,d),k&&J.acceptData(j)&&j[k]&&j[k].apply(j,d)===!1&&(c.result=!1,c.preventDefault()),j=j.parentNode||j.ownerDocument||j===c.target.ownerDocument&&a}while(j&&!c.isPropagationStopped());if(!c.isDefaultPrevented()){var m,n=J.event.special[g]||{};if((!n._default||n._default.call(e.ownerDocument,c)===!1)&&(g!=="click"||!J.nodeName(e,"a"))&&J.acceptData(e)){try{k&&e[g]&&(m=e[k],m&&(e[k]=null),J.event.triggered=g,e[g]())}catch(o){}m&&(e[k]=m),J.event.triggered=b}}return c.result}},handle:function(c){c=J.event.fix(c||a.event);var d=((J._data(this,"events")||{})[c.type]||[]).slice(0),e=!c.exclusive&&!c.namespace,f=Array.prototype.slice.call(arguments,0);f[0]=c,c.currentTarget=this;for(var g=0,h=d.length;g-1?J.map(a.options,function(a){return a.selected}).join("-"):"":J.nodeName(a,"select")&&(c=a.selectedIndex);return c},bh=function(a){var c=a.target,d,e;if(!!$.test(c.nodeName)&&!c.readOnly){d=J._data(c,"_change_data"),e=bg(c),(a.type!=="focusout"||c.type!=="radio")&&J._data(c,"_change_data",e);if(d===b||e===d)return;if(d!=null||e)a.type="change",a.liveFired=b,J.event.trigger(a,arguments[1],c)}};J.event.special.change={filters:{focusout:bh,beforedeactivate:bh,click:function(a){var b=a.target,c=J.nodeName(b,"input")?b.type:"";(c==="radio"||c==="checkbox"||J.nodeName(b,"select"))&&bh.call(this,a)},keydown:function(a){var b=a.target,c=J.nodeName(b,"input")?b.type:"";(a.keyCode===13&&!J.nodeName(b,"textarea")||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&bh.call(this,a)},beforeactivate:function(a){var b=a.target;J._data(b,"_change_data",bg(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in bf)J.event.add(this,c+".specialChange",bf[c]);return $.test(this.nodeName)},teardown:function(a){J.event.remove(this,".specialChange");return $.test(this.nodeName)}},bf=J.event.special.change.filters,bf.focus=bf.beforeactivate}J.support.focusinBubbles||J.each({focus:"focusin",blur:"focusout"},function(a,b){function c(a){var c=J.event.fix(a);c.type=b,c.originalEvent={},J.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var d=0;J.event.special[b]={setup:function(){d++===0&&G.addEventListener(a,c,!0)},teardown:function(){--d===0&&G.removeEventListener(a,c,!0)}}}),J.each(["bind","one"],function(a,c){J.fn[c]=function(a,d,e){var f;if(typeof a=="object"){for(var g in a)this[c](g,d,a[g],e);return this}if(arguments.length===2||d===!1)e=d,d=b;c==="one"?(f=function(a){J(this).unbind(a,f);return e.apply(this,arguments)},f.guid=e.guid||J.guid++):f=e;if(a==="unload"&&c!=="one")this.one(a,d,e);else for(var h=0,i=this.length;h0?this.bind(b,a,c):this.trigger(b)},J.attrFn&&(J.attrFn[b]=!0)}),function(){function c(a,b,c,d,e,f){for(var g=0,h=d.length;g0){j=i;break}}i=i[a]}d[g]=j}}}var d=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,f=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(a,b,c,e){c=c||[],b=b||G;var g=b;if(b.nodeType!==1&&b.nodeType!==9)return[];if(!a||typeof a!="string")return c;var h,i,j,n,o,q,r,s,u=!0,v=k.isXML(b),w=[],x=a;do{d.exec(""),h=d.exec(x);if(h){x=h[3],w.push(h[1]);if(h[2]){n=h[3];break}}}while(h);if(w.length>1&&m.exec(a))if(w.length===2&&l.relative[w[0]])i=t(w[0]+w[1],b);else{i=l.relative[w[0]]?[b]:k(w.shift(),b);while(w.length)a=w.shift(),l.relative[a]&&(a+=w.shift()),i=t(a,i)}else{!e&&w.length>1&&b.nodeType===9&&!v&&l.match.ID.test(w[0])&&!l.match.ID.test(w[w.length-1])&&(o=k.find(w.shift(),b,v),b=o.expr?k.filter(o.expr,o.set)[0]:o.set[0]);if(b){o=e?{expr:w.pop(),set:p(e)}:k.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&b.parentNode?b.parentNode:b,v),i=o.expr?k.filter(o.expr,o.set):o.set,w.length>0?j=p(i):u=!1;while(w.length)q=w.pop(),r=q,l.relative[q]?r=w.pop():q="",r==null&&(r=b),l.relative[q](j,r,v)}else j=w=[]}j||(j=i),j||k.error(q||a);if(f.call(j)==="[object Array]")if(!u)c.push.apply(c,j);else if(b&&b.nodeType===1)for(s=0;j[s]!=null;s++)j[s]&&(j[s]===!0||j[s].nodeType===1&&k.contains(b,j[s]))&&c.push(i[s]);else for(s=0;j[s]!=null;s++)j[s]&&j[s].nodeType===1&&c.push(i[s]);else p(j,c);n&&(k(n,g,c,e),k.uniqueSort(c));return c};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&k.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(a,b,c,e,f){if(a[1]==="not")if((d.exec(a[3])||"").length>1||/^\w/.test(a[3]))a[3]=k(a[3],null,null,b);else{var g=k.filter(a[3],b,c,!0^f);c||e.push.apply(e,g);return!1}else if(l.match.POS.test(a[0])||l.match.CHILD.test(a[0]))return!0;return a},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!k(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(G.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if(f.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",d.insertBefore(a,d.firstChild),G.getElementById(c)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),d.removeChild(a),d=a=null}(),function(){var a=G.createElement("div");a.appendChild(G.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),G.querySelectorAll&&function(){var a=k,b=G.createElement("div"),c="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,d,e,f){d=d||G;if(!f&&!k.isXML(d)){var g=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(g&&(d.nodeType===1||d.nodeType===9)){if(g[1])return p(d.getElementsByTagName(b),e);if(g[2]&&l.find.CLASS&&d.getElementsByClassName)return p(d.getElementsByClassName(g[2]),e)}if(d.nodeType===9){if(b==="body"&&d.body)return p([d.body],e);if(g&&g[3]){var h=d.getElementById(g[3]);if(!h||!h.parentNode)return p([],e);if(h.id===g[3])return p([h],e)}try{return p(d.querySelectorAll(b),e)}catch(i){}}else if(d.nodeType===1&&d.nodeName.toLowerCase()!=="object"){var j=d,m=d.getAttribute("id"),n=m||c,o=d.parentNode,q=/^\s*[+~]/.test(b);m?n=n.replace(/'/g,"\\$&"):d.setAttribute("id",n),q&&o&&(d=d.parentNode);try{if(!q||o)return p(d.querySelectorAll("[id='"+n+"'] "+b),e)}catch(r){}finally{m||j.removeAttribute("id")}}}return a(b,d,e,f)};for(var d in a)k[d]=a[d];b=null}}(),function(){var a=G.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var c=!b.call(G.createElement("div"),"div"),d=!1;try{b.call(G.documentElement,"[test!='']:sizzle")}catch(e){d=!0}k.matchesSelector=function(a,e){e=e.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(d||!l.match.PSEUDO.test(e)&&!/!=/.test(e)){var f=b.call(a,e);if(f||!c||a.document&&a.document.nodeType!==11)return f}}catch(g){}return k(e,null,null,[a]).length>0}}}(),function(){var a=G.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),G.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:G.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var t=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g0)for(g=f;g0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,f=this[0];if(J.isArray(a)){var g,h,i={},j=1;if(f&&a.length){for(d=0,e=a.length;d-1:J(f).is(g))&&c.push({selector:h,elem:f,level:j});f=f.parentNode,j++}}return c}var k=bo.test(a)||typeof a!="string"?J(a,b||this.context):0;for(d=0,e=this.length;d-1:J.find.matchesSelector(f,a)){c.push(f);break}f=f.parentNode;if(!f||!f.ownerDocument||f===b||f.nodeType===11)break}}c=c.length>1?J.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){return!a||typeof a=="string"?J.inArray(this[0],a?J(a):this.parent().children()):J.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?J(a,b):J.makeArray(a&&a.nodeType?[a]:a),d=J.merge(this.get(),c);return this.pushStack(x(c[0])||x(d[0])?d:J.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),J.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return J.dir(a,"parentNode")},parentsUntil:function(a,b,c){return J.dir(a,"parentNode",c)},next:function(a){return J.nth(a,2,"nextSibling")},prev:function(a){return J.nth(a,2,"previousSibling")},nextAll:function(a){return J.dir(a,"nextSibling")},prevAll:function(a){return J.dir(a,"previousSibling")},nextUntil:function(a,b,c){return J.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return J.dir(a,"previousSibling",c)},siblings:function(a){return J.sibling(a.parentNode.firstChild,a)},children:function(a){return J.sibling(a.firstChild)},contents:function(a){return J.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:J.makeArray(a.childNodes)}},function(a,b){J.fn[a]=function(c,d){var e=J.map(this,b,c),f=bn.call(arguments);bj.test(a)||(d=c),d&&typeof d=="string"&&(e=J.filter(d,e)),e=this.length>1&&!bp[a]?J.unique(e):e,(this.length>1||bl.test(d))&&bk.test(a)&&(e=e.reverse());return this.pushStack(e,a,f.join(","))}}),J.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?J.find.matchesSelector(b[0],a)?[b[0]]:[]:J.find.matches(a,b)},dir:function(a,c,d){var e=[],f=a[c];while(f&&f.nodeType!==9&&(d===b||f.nodeType!==1||!J(f).is(d)))f.nodeType===1&&e.push(f),f=f[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var bq=/ jQuery\d+="(?:\d+|null)"/g,br=/^\s+/,bs=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,bt=/<([\w:]+)/,bu=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]};bA.optgroup=bA.option,bA.tbody=bA.tfoot=bA.colgroup=bA.caption=bA.thead,bA.th=bA.td,J.support.htmlSerialize||(bA._default=[1,"div
","
"]),J.fn.extend({text:function(a){return J.isFunction(a)?this.each(function(b){var c=J(this);c.text(a.call(this,b,c.text()))}):typeof a!="object"&&a!==b?this.empty().append((this[0]&&this[0].ownerDocument||G).createTextNode(a)):J.text(this)},wrapAll:function(a){if(J.isFunction(a))return this.each(function(b){J(this).wrapAll(a.call(this,b))});if(this[0]){var b=J(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return J.isFunction(a)?this.each(function(b){J(this).wrapInner(a.call(this,b))}):this.each(function(){var b=J(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){J(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){J.nodeName(this,"body")||J(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=J(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,J(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||J.filter(a,[d]).length)!b&&d.nodeType===1&&(J.cleanData(d.getElementsByTagName("*")),J.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&J.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return J.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(bq,""):null;if(typeof a=="string"&&!bw.test(a)&&(J.support.leadingWhitespace||!br.test(a))&&!bA[(bt.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(bs,"<$1>");try{for(var c=0,d=this.length;c1&&k0?this.clone(!0):this).get();J(e[g])[b](i),d=d.concat(i)}return this.pushStack(d,a,e.selector)}}),J.extend({clone:function(a,b,c){var d=a.cloneNode(!0),e,f,g;if((!J.support.noCloneEvent||!J.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!J.isXMLDoc(a)){t(a,d),e=s(a),f=s(d);for(g=0;e[g];++g)t(e[g],f[g])}if(b){u(a,d);if(c){e=s(a),f=s(d);for(g=0;e[g];++g)u(e[g],f[g])}}return d},clean:function(a,b,c,d){var e;b=b||G,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||G);var f=[],g;for(var h=0,i;(i=a[h])!=null;h++){typeof i=="number"&&(i+="");if(! -i)continue;if(typeof i=="string")if(!bv.test(i))i=b.createTextNode(i);else{i=i.replace(bs,"<$1>");var j=(bt.exec(i)||["",""])[1].toLowerCase(),k=bA[j]||bA._default,l=k[0],m=b.createElement("div");m.innerHTML=k[1]+i+k[2];while(l--)m=m.lastChild;if(!J.support.tbody){var n=bu.test(i),o=j==="table"&&!n?m.firstChild&&m.firstChild.childNodes:k[1]===""&&!n?m.childNodes:[];for(g=o.length-1;g>=0;--g)J.nodeName(o[g],"tbody")&&!o[g].childNodes.length&&o[g].parentNode.removeChild(o[g])}!J.support.leadingWhitespace&&br.test(i)&&m.insertBefore(b.createTextNode(br.exec(i)[0]),m.firstChild),i=m.childNodes}var p;if(!J.support.appendChecked)if(i[0]&&typeof (p=i.length)=="number")for(g=0;g=0)return b+"px"}}}),J.support.opacity||(J.cssHooks.opacity={get:function(a,b){return bC.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle;c.zoom=1;var e=J.isNaN(b)?"":"alpha(opacity="+b*100+")",f=d&&d.filter||c.filter||"";c.filter=bB.test(f)?f.replace(bB,e):f+" "+e}}),J(function(){J.support.reliableMarginRight||(J.cssHooks.marginRight={get:function(a,b){var c;J.swap(a,{display:"inline-block"},function(){b?c=bM(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),G.defaultView&&G.defaultView.getComputedStyle&&(bN=function(a,c){var d,e,f;c=c.replace(bE,"-$1").toLowerCase();if(!(e=a.ownerDocument.defaultView))return b;if(f=e.getComputedStyle(a,null))d=f.getPropertyValue(c),d===""&&!J.contains(a.ownerDocument.documentElement,a)&&(d=J.style(a,c));return d}),G.documentElement.currentStyle&&(bO=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bF.test(d)&&bG.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bM=bN||bO,J.expr&&J.expr.filters&&(J.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!J.support.reliableHiddenOffsets&&(a.style.display||J.css(a,"display"))==="none"},J.expr.filters.visible=function(a){return!J.expr.filters.hidden(a)});var bQ=/%20/g,bR=/\[\]$/,bS=/\r?\n/g,bT=/#.*$/,bU=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bV=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bW=/^(?:about|app|app\-storage|.+\-extension|file|widget):$/,bX=/^(?:GET|HEAD)$/,bY=/^\/\//,bZ=/\?/,b$=/)<[^<]*)*<\/script>/gi,b_=/^(?:select|textarea)/i,ca=/\s+/,cb=/([?&])_=[^&]*/,cc=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,cd=J.fn.load,ce={},cf={},cg,ch;try{cg=I.href}catch(ci){cg=G.createElement("a"),cg.href="",cg=cg.href}ch=cc.exec(cg.toLowerCase())||[],J.fn.extend({load:function(a,c,d){if(typeof a!="string"&&cd)return cd.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var f=a.slice(e,a.length);a=a.slice(0,e)}var g="GET";c&&(J.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=J.param(c,J.ajaxSettings.traditional),g="POST"));var h=this;J.ajax({url:a,type:g,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),h.html(f?J("
").append(c.replace(b$,"")).find(f):c)),d&&h.each(d,[c,b,a])}});return this},serialize:function(){return J.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?J.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||b_.test(this.nodeName)||bV.test(this.type))}).map(function(a,b){var c=J(this).val();return c==null?null:J.isArray(c)?J.map(c,function(a,c){return{name:b.name,value:a.replace(bS,"\r\n")}}):{name:b.name,value:c.replace(bS,"\r\n")}}).get()}}),J.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){J.fn[b]=function(a){return this.bind(b,a)}}),J.each(["get","post"],function(a,c){J[c]=function(a,d,e,f){J.isFunction(d)&&(f=f||e,e=d,d=b);return J.ajax({type:c,url:a,data:d,success:e,dataType:f})}}),J.extend({getScript:function(a,c){return J.get(a,b,c,"script")},getJSON:function(a,b,c){return J.get(a,b,c,"json")},ajaxSetup:function(a,b){b?J.extend(!0,a,J.ajaxSettings,b):(b=a,a=J.extend(!0,J.ajaxSettings,b));for(var c in{context:1,url:1})c in b?a[c]=b[c]:c in J.ajaxSettings&&(a[c]=J.ajaxSettings[c]);return a},ajaxSettings:{url:cg,isLocal:bW.test(ch[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":J.parseJSON,"text xml":J.parseXML}},ajaxPrefilter:n(ce),ajaxTransport:n(cf),ajax:function(a,c){function d(a,c,d,m){if(v!==2){v=2,t&&clearTimeout(t),s=b,q=m||"",y.readyState=a?4:0;var o,p,r,u=d?k(e,y,d):b,x,z;if(a>=200&&a<300||a===304){if(e.ifModified){if(x=y.getResponseHeader("Last-Modified"))J.lastModified[n]=x;if(z=y.getResponseHeader("Etag"))J.etag[n]=z}if(a===304)c="notmodified",o=!0;else try{p=j(e,u),c="success",o=!0}catch(A){c="parsererror",r=A}}else{r=c;if(!c||a)c="error",a<0&&(a=0)}y.status=a,y.statusText=c,o?h.resolveWith(f,[p,c,y]):h.rejectWith(f,[y,c,r]),y.statusCode(l),l=b,w&&g.trigger("ajax"+(o?"Success":"Error"),[y,e,o?p:r]),i.resolveWith(f,[y,c]),w&&(g.trigger("ajaxComplete",[y,e]),--J.active||J.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var e=J.ajaxSetup({},c),f=e.context||e,g=f!==e&&(f.nodeType||f instanceof J)?J(f):J.event,h=J.Deferred(),i=J._Deferred(),l=e.statusCode||{},n,o={},p={},q,r,s,t,u,v=0,w,x,y={readyState:0,setRequestHeader:function(a,b){if(!v){var c=a.toLowerCase();a=p[c]=p[c]||a,o[a]=b}return this},getAllResponseHeaders:function(){return v===2?q:null},getResponseHeader:function(a){var c;if(v===2){if(!r){r={};while(c=bU.exec(q))r[c[1].toLowerCase()]=c[2]}c=r[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){v||(e.mimeType=a);return this},abort:function(a){a=a||"abort",s&&s.abort(a),d(0,a);return this}};h.promise(y),y.success=y.done,y.error=y.fail,y.complete=i.done,y.statusCode=function(a){if(a){var b;if(v<2)for(b in a)l[b]=[l[b],a[b]];else b=a[y.status],y.then(b,b)}return this},e.url=((a||e.url)+"").replace(bT,"").replace(bY,ch[1]+"//"),e.dataTypes=J.trim(e.dataType||"*").toLowerCase().split(ca),e.crossDomain==null&&(u=cc.exec(e.url.toLowerCase()),e.crossDomain=!(!u||u[1]==ch[1]&&u[2]==ch[2]&&(u[3]||(u[1]==="http:"?80:443))==(ch[3]||(ch[1]==="http:"?80:443)))),e.data&&e.processData&&typeof e.data!="string"&&(e.data=J.param(e.data,e.traditional)),m(ce,e,c,y);if(v===2)return!1;w=e.global,e.type=e.type.toUpperCase(),e.hasContent=!bX.test(e.type),w&&J.active++===0&&J.event.trigger("ajaxStart");if(!e.hasContent){e.data&&(e.url+=(bZ.test(e.url)?"&":"?")+e.data),n=e.url;if(e.cache===!1){var z=J.now(),A=e.url.replace(cb,"$1_="+z);e.url=A+(A===e.url?(bZ.test(e.url)?"&":"?")+"_="+z:"")}}(e.data&&e.hasContent&&e.contentType!==!1||c.contentType)&&y.setRequestHeader("Content-Type",e.contentType),e.ifModified&&(n=n||e.url,J.lastModified[n]&&y.setRequestHeader("If-Modified-Since",J.lastModified[n]),J.etag[n]&&y.setRequestHeader("If-None-Match",J.etag[n])),y.setRequestHeader("Accept",e.dataTypes[0]&&e.accepts[e.dataTypes[0]]?e.accepts[e.dataTypes[0]]+(e.dataTypes[0]!=="*"?", */*; q=0.01":""):e.accepts["*"]);for(x in e.headers)y.setRequestHeader(x,e.headers[x]);if(!e.beforeSend||e.beforeSend.call(f,y,e)!==!1&&v!==2){for(x in{success:1,error:1,complete:1})y[x](e[x]);s=m(cf,e,c,y);if(!s)d(-1,"No Transport");else{y.readyState=1,w&&g.trigger("ajaxSend",[y,e]),e.async&&e.timeout>0&&(t=setTimeout(function(){y.abort("timeout")},e.timeout));try{v=1,s.send(o,d)}catch(B){status<2?d(-1,B):J.error(B)}}return y}y.abort();return!1},param:function(a,c){var d=[],e=function(a,b){b=J.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=J.ajaxSettings.traditional);if(J.isArray(a)||a.jquery&&!J.isPlainObject(a))J.each(a,function(){e(this.name,this.value)});else for(var f in a)l(f,a[f],c,e);return d.join("&").replace(bQ,"+")}}),J.extend({active:0,lastModified:{},etag:{}});var cj=J.now(),ck=/(\=)\?(&|$)|\?\?/i;J.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return J.expando+"_"+cj++}}),J.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ck.test(b.url)||e&&ck.test(b.data))){var f,g=b.jsonpCallback=J.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h=a[g],i=b.url,j=b.data,k="$1"+g+"$2";b.jsonp!==!1&&(i=i.replace(ck,k),b.url===i&&(e&&(j=j.replace(ck,k)),b.data===j&&(i+=(/\?/.test(i)?"&":"?")+b.jsonp+"="+g))),b.url=i,b.data=j,a[g]=function(a){f=[a]},d.always(function(){a[g]=h,f&&J.isFunction(h)&&a[g](f[0])}),b.converters["script json"]=function(){f||J.error(g+" was not called");return f[0]},b.dataTypes[0]="json";return"script"}}),J.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){J.globalEval(a);return a}}}),J.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),J.ajaxTransport("script",function(a){if(a.crossDomain){var c,d=G.head||G.getElementsByTagName("head")[0]||G.documentElement;return{send:function(e,f){c=G.createElement("script"),c.async="async",a.scriptCharset&&(c.charset=a.scriptCharset),c.src=a.url,c.onload=c.onreadystatechange=function(a,e){if(e||!c.readyState||/loaded|complete/.test(c.readyState))c.onload=c.onreadystatechange=null,d&&c.parentNode&&d.removeChild(c),c=b,e||f(200,"success")},d.insertBefore(c,d.firstChild)},abort:function(){c&&c.onload(0,1)}}}});var cl=a.ActiveXObject?function(){for(var a in cn)cn[a](0,1)}:!1,cm=0,cn;J.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&i()||h()}:i,function(a){J.extend(J.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(J.ajaxSettings.xhr()),J.support.ajax&&J.ajaxTransport(function(c){if(!c.crossDomain||J.support.cors){var d;return{send:function(e,f){var g=c.xhr(),h,i;c.username?g.open(c.type,c.url,c.async,c.username,c.password):g.open(c.type,c.url,c.async);if(c.xhrFields)for(i in c.xhrFields)g[i]=c.xhrFields[i];c.mimeType&&g.overrideMimeType&&g.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(i in e)g.setRequestHeader(i,e[i])}catch(j){}g.send(c.hasContent&&c.data||null),d=function(a,e){var i,j,k,l,m;try{if(d&&(e||g.readyState===4)){d=b,h&&(g.onreadystatechange=J.noop,cl&&delete cn[h]);if(e)g.readyState!==4&&g.abort();else{i=g.status,k=g.getAllResponseHeaders(),l={},m=g.responseXML,m&&m.documentElement&&(l.xml=m),l.text=g.responseText;try{j=g.statusText}catch(n){j=""}!i&&c.isLocal&&!c.crossDomain?i=l.text?200:404:i===1223&&(i=204)}}}catch(o){e||f(-1,o)}l&&f(i,j,l,k)},!c.async||g.readyState===4?d():(h=++cm,cl&&(cn||(cn={},J(a).unload(cl)),cn[h]=d),g.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var co={},cp,cq,cr=/^(?:toggle|show|hide)$/,cs=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,ct,cu=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cv,cw=a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame;J.fn.extend({show:function(a,b,c){var f,g;if(a||a===0)return this.animate(e("show",3),a,b,c);for(var h=0,i=this.length;h=e.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),e.animatedProperties[this.prop]=!0;for(f in e.animatedProperties)e.animatedProperties[f]!==!0&&(c=!1);if(c){e.overflow!=null&&!J.support.shrinkWrapBlocks&&J.each(["","X","Y"],function(a,b){d.style["overflow"+b]=e.overflow[a]}),e.hide&&J(d).hide();if(e.hide||e.show)for(var i in e.animatedProperties)J.style(d,i,e.orig[i]);e.complete.call(d)}return!1}e.duration==Infinity?this.now=b:(h=b-this.startTime,this.state=h/e.duration,this.pos=J.easing[e.animatedProperties[this.prop]](this.state,h,0,1,e.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},J.extend(J.fx,{tick:function(){for(var a=J.timers,b=0;b
";J.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=h,a.insertBefore(b,a.firstChild),c=b.firstChild,d=c.firstChild,f=c.nextSibling.firstChild.firstChild,this.doesNotAddBorder=d.offsetTop!==5,this.doesAddBorderForTableAndCells=f.offsetTop===5,d.style.position="fixed",d.style.top="20px",this.supportsFixedPosition=d.offsetTop===20||d.offsetTop===15,d.style.position=d.style.top="",c.style.overflow="hidden",c.style.position="relative",this.subtractsBorderForOverflowNotVisible=d.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==g,a.removeChild(b),J.offset.initialize=J.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;J.offset.initialize(),J.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(J.css(a,"marginTop"))||0,c+=parseFloat(J.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=J.css(a,"position");d==="static"&&(a.style.position="relative");var e=J(a),f=e.offset(),g=J.css(a,"top"),h=J.css(a,"left"),i=(d==="absolute"||d==="fixed")&&J.inArray("auto",[g,h])>-1,j={},k={},l,m;i?(k=e.position(),l=k.top,m=k.left):(l=parseFloat(g)||0,m=parseFloat(h)||0),J.isFunction(b)&&(b=b.call(a,c,f)),b.top!=null&&(j.top=b.top-f.top+l),b.left!=null&&(j.left=b.left-f.left+m),"using"in b?b.using.call(a,j):e.css(j)}},J.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cy.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(J.css(a,"marginTop"))||0,c.left-=parseFloat(J.css(a,"marginLeft"))||0,d.top+=parseFloat(J.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(J.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||G.body;while(a&&!cy.test(a.nodeName)&&J.css(a,"position")==="static")a=a.offsetParent;return a})}}),J.each(["Left","Top"],function(a,d){var e="scroll"+d;J.fn[e]=function(d){var f,g;if(d===b){f=this[0];if(!f)return null;g=c(f);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:J.support.boxModel&&g.document.documentElement[e]||g.document.body[e]:f[e]}return this.each(function(){g=c(this),g?g.scrollTo(a?J(g).scrollLeft():d,a?d:J(g).scrollTop()):this[e]=d})}}),J.each(["Height","Width"],function(a,c){var d=c.toLowerCase();J.fn["inner"+c]=function(){return this[0]?parseFloat(J.css(this[0],d,"padding")):null},J.fn["outer"+c]=function(a){return this[0]?parseFloat(J.css(this[0],d,a?"margin":"border")):null},J.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(J.isFunction(a))return this.each(function(b){var c=J(this);c[d](a.call(this,b,c[d]()))});if(J.isWindow(e)){var f=e.document.documentElement["client"+c];return e.document.compatMode==="CSS1Compat"&&f||e.document.body["client"+c]||f}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var g=J.css(e,d),h=parseFloat(g);return J.isNaN(h)?g:h}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=J})(window),function(a,b){function d(b){return!a(b).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}function c(b,c){var e=b.nodeName.toLowerCase();if("area"===e){c=b.parentNode,e=c.name;if(!b.href||!e||c.nodeName.toLowerCase()!=="map")return!1;b=a("img[usemap=#"+e+"]")[0];return!!b&&d(b)}return(/input|select|textarea|button|object/.test(e)?!b.disabled:"a"==e?b.href||c:c)&&d(b)}a.ui=a.ui||{},a.ui.version||(a.extend(a.ui,{version:"1.8.14",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}}),a.fn.extend({_focus:a.fn.focus,focus:function(b,c){return typeof b=="number"?this.each(function(){var d=this;setTimeout(function(){a(d).focus(),c&&c.call(d)},b)}):this._focus.apply(this,arguments)},scrollParent:function(){var b;b=a.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(a.curCSS(this,"position",1))&&/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!b.length?a(document):b},zIndex:function(c){if(c!==b)return this.css("zIndex",c);if(this.length){c=a(this[0]);for(var d;c.length&&c[0]!==document;){d=c.css("position");if(d==="absolute"||d==="relative"||d==="fixed"){d=parseInt(c.css("zIndex"),10);if(!isNaN(d)&&d!==0)return d}c=c.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),a.each(["Width","Height"],function(c,d){function e(b,c,d,e){a.each(f,function(){c-=parseFloat(a.curCSS(b,"padding"+this,!0))||0,d&&(c-=parseFloat(a.curCSS(b,"border"+this+"Width",!0))||0),e&&(c-=parseFloat(a.curCSS(b,"margin"+this,!0))||0)});return c}var f=d==="Width"?["Left","Right"]:["Top","Bottom"],g=d.toLowerCase(),h={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};a.fn["inner"+d]=function(c){return c===b?h["inner"+d].call(this):this.each(function(){a(this).css(g,e(this,c)+"px")})},a.fn["outer"+d]=function(b,c){return typeof b!="number"?h["outer"+d].call(this,b):this.each(function(){a(this).css(g,e(this,b,!0,c)+"px")})}}),a.extend(a.expr[":"],{data:function(b,c,d){return!!a.data(b,d[3])},focusable:function(b){return c(b,!isNaN(a.attr(b,"tabindex")))},tabbable:function(b){var d=a.attr(b,"tabindex"),e=isNaN(d);return(e||d>=0)&&c(b,!e)}}),a(function(){var b=document.body,c=b.appendChild(c=document.createElement("div"));a.extend(c.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),a.support.minHeight=c.offsetHeight===100,a.support.selectstart="onselectstart"in c,b.removeChild(c).style.display="none"}),a.extend(a.ui,{plugin:{add:function(b,c,d){b=a.ui[b].prototype;for(var e in d)b.plugins[e]=b.plugins[e]||[],b.plugins[e].push([c,d[e]])},call:function(a,b,c){if((b=a.plugins[b])&&a.element[0].parentNode)for(var d=0;d0)return!0;b[c]=1,d=b[c]>0,b[c]=0;return d},isOverAxis:function(a,b,c){return a>b&&a=9||!!b.button){if(this._mouseStarted){this._mouseDrag(b);return b.preventDefault()}this._mouseDistanceMet(b)&&this._mouseDelayMet(b)&&((this._mouseStarted=this._mouseStart(this._mouseDownEvent,b)!==!1)?this._mouseDrag(b):this._mouseUp(b));return!this._mouseStarted}return this._mouseUp(b)},_mouseUp:function(b){a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,b.target==this._mouseDownEvent.target&&a.data(b.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(b));return!1},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})}(jQuery),function(a){a.widget("ui.draggable",a.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1},_create:function(){this.options.helper=="original"&&!/^(?:r|a|f)/.test(this.element.css("position"))&&(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy();return this}},_mouseCapture:function(b){var c=this.options;if(this.helper||c.disabled||a(b.target).is(".ui-resizable-handle"))return!1;this.handle=this._getHandle(b);if(!this.handle)return!1;a(c.iframeFix===!0?"iframe":c.iframeFix).each(function(){a('
').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(a(this).offset()).appendTo("body")});return!0},_mouseStart:function(b){var c=this.options;this.helper=this._createHelper(b),this._cacheHelperProportions(),a.ui.ddmanager&&(a.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(b),this.originalPageX=b.pageX,this.originalPageY=b.pageY,c.cursorAt&&this._adjustOffsetFromHelper(c.cursorAt),c.containment&&this._setContainment();if(this._trigger("start",b)===!1){this._clear();return!1}this._cacheHelperProportions(),a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this.helper.addClass("ui-draggable-dragging"),this._mouseDrag(b,!0),a.ui.ddmanager&&a.ui.ddmanager.dragStart(this,b);return!0},_mouseDrag:function(b,c){this.position=this._generatePosition(b),this.positionAbs=this._convertPositionTo("absolute");if(!c){c=this._uiHash();if(this._trigger("drag",b,c)===!1){this._mouseUp({});return!1}this.position=c.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";a.ui.ddmanager&&a.ui.ddmanager.drag(this,b);return!1},_mouseStop:function(b){var c=!1;a.ui.ddmanager&&!this.options.dropBehaviour&&(c=a.ui.ddmanager.drop(this,b)),this.dropped&&(c=this.dropped,this.dropped=!1);if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return!1;if(this.options.revert=="invalid"&&!c||this.options.revert=="valid"&&c||this.options.revert===!0||a.isFunction(this.options.revert)&&this.options.revert.call(this.element,c)){var e=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){e._trigger("stop",b)!==!1&&e._clear()})}else this._trigger("stop",b)!==!1&&this._clear();return!1},_mouseUp:function(b){this.options.iframeFix===!0&&a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),a.ui.ddmanager&&a.ui.ddmanager.dragStop(this,b);return a.ui.mouse.prototype._mouseUp.call(this,b)},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(b){var c=!this.options.handle||!a(this.options.handle,this.element).length?!0:!1;a(this.options.handle,this.element).find("*").andSelf().each(function(){this==b.target&&(c=!0)});return c},_createHelper:function(b){var c=this.options;b=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b])):c.helper=="clone"?this.element.clone().removeAttr("id"):this.element,b.parents("body").length||b.appendTo(c.appendTo=="parent"?this.element[0].parentNode:c.appendTo),b[0]!=this.element[0]&&!/(fixed|absolute)/.test(b.css("position"))&&b.css("position","absolute");return b},_adjustOffsetFromHelper:function(b){typeof b=="string"&&(b=b.split(" ")),a.isArray(b)&&(b={left:+b[0],top:+b[1]||0}),"left"in b&&(this.offset.click.left=b.left+this.margins.left),"right"in b&&(this.offset.click.left=this.helperProportions.width-b.right+this.margins.left),"top"in b&&(this.offset.click.top=b.top+this.margins.top),"bottom"in b&&(this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])&&(b.left+=this.scrollParent.scrollLeft(),b.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)b={top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b=this.options;b.containment=="parent"&&(b.containment=this.helper[0].parentNode);if(b.containment=="document"||b.containment=="window")this.containment=[b.containment=="document"?0:a(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,b.containment=="document"?0:a(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,(b.containment=="document"?0:a(window).scrollLeft())+a(b.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(b.containment=="document"?0:a(window).scrollTop())+(a(b.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(b.containment)&&b.containment.constructor!=Array){b=a(b.containment);var c=b[0];if(c){b.offset();var e=a(c).css("overflow")!="hidden";this.containment=[(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0),(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0),(e?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(e?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=b}}else b.containment.constructor==Array&&(this.containment=b.containment)},_convertPositionTo:function(b,c){c||(c=this.position),b=b=="absolute"?1:-1;var e=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(e[0].tagName);return{top:c.top+this.offset.relative.top*b+this.offset.parent.top*b-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:e.scrollTop())*b),left:c.left+this.offset.relative.left*b+this.offset.parent.left*b-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:e.scrollLeft())*b)}},_generatePosition:function(b){var c=this.options,e=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(e[0].tagName),g=b.pageX,h=b.pageY;if(this.originalPosition){var i;this.containment&&(this.relative_container?(i=this.relative_container.offset(),i=[this.containment[0]+i.left,this.containment[1]+i.top,this.containment[2]+i.left,this.containment[3]+i.top]):i=this.containment,b.pageX-this.offset.click.lefti[2]&&(g=i[2]+this.offset.click.left),b.pageY-this.offset.click.top>i[3]&&(h=i[3]+this.offset.click.top)),c.grid&&(h=c.grid[1]?this.originalPageY+Math.round((h-this.originalPageY)/c.grid[1])*c.grid[1]:this.originalPageY,h=i?h-this.offset.click.topi[3]?h-this.offset.click.topi[2]?g-this.offset.click.left=0;l--){var m=e.snapElements[l].left,n=m+e.snapElements[l].width,o=e.snapElements[l].top,p=o+e.snapElements[l].height;if(m-g0&&(a=a[0]);if(a.error)return couch.errors[a.error]},couch.request=function(c){var d=a.extend({},b,c),e=a.Deferred();a.ajax(d).then(function(a){var b=couch.responseError(a);b&&app.emitter.emit(b,"error"),e.resolve(a)},function(a){app.emitter.emit("Fatal XHR Error","error")});return e.promise()},couch.get=function(a){return couch.request({url:a,type:"GET"})},couch.login=function(a){return couch.request({url:"/_session",type:"POST",data:JSON.stringify({name:a.username,password:a.password})})},couch.logout=function(){return couch.request({url:"/_session",type:"DELETE"})},couch.session=function(){return couch.request({url:"/_session"})},couch.db=function(c,d){d||(d="");return{name:c,uri:d+"/"+encodeURIComponent(c)+"/",get:function(a){return couch.request({url:this.uri+a,type:"GET"})},put:function(a,b){return couch.request({url:this.uri+a,type:"PUT",data:b})},designDocs:function(c){return couch.request(a.extend(b,{url:this.uri+"_all_docs",data:{startkey:'"_design/"',endkey:'"_design0"',include_docs:!0}}))}}}}(jQuery),function(a){function b(b){if(typeof b.data=="string"){var c=b.handler,d=b.data.toLowerCase().split(" ");b.handler=function(b){if(this===b.target||!/textarea|select/i.test(b.target.nodeName)&&b.target.type!=="text"){var e=b.type!=="keypress"&&a.hotkeys.specialKeys[b.which],f=String.fromCharCode(b.which).toLowerCase(),g,h="",i={};b.altKey&&e!=="alt"&&(h+="alt+"),b.ctrlKey&&e!=="ctrl"&&(h+="ctrl+"),b.metaKey&&!b.ctrlKey&&e!=="meta"&&(h+="meta+"),b.shiftKey&&e!=="shift"&&(h+="shift+"),e?i[h+e]=!0:(i[h+f]=!0,i[h+a.hotkeys.shiftNums[f]]=!0,h==="shift+"&&(i[a.hotkeys.shiftNums[f]]=!0));for(var j=0,k=d.length;j","/":"?","\\":"|"}},a.each(["keydown","keyup","keypress"],function(){a.event.special[this]={add:b}})}(jQuery),function(a){var b=function(){var a=function(){};a.prototype={otag:"{{",ctag:"}}",pragmas:{},buffer:[],pragmas_implemented:{"IMPLICIT-ITERATOR":!0},context:{},render:function(a,b,c,d){d||(this.context=b,this.buffer=[]);if(!this.includes("",a)){if(d)return a;this.send(a)}else{a=this.render_pragmas(a);var e=this.render_section(a,b,c);if(d)return this.render_tags(e,b,c,d);this.render_tags(e,b,c,d)}},send:function(a){a!=""&&this.buffer.push(a)},render_pragmas:function(a){if(!this.includes("%",a))return a;var b=this,c=new RegExp(this.otag+"%([\\w-]+) ?([\\w]+=[\\w]+)?"+this.ctag);return a.replace(c,function(a,c,d){if(!b.pragmas_implemented[c])throw{message:"This implementation of mustache doesn't understand the '"+c+"' pragma"};b.pragmas[c]={};if(d){var e=d.split("=");b.pragmas[c][e[0]]=e[1]}return""})},render_partial:function(a,b,c){a=this.trim(a);if(!c||c[a]===undefined)throw{message:"unknown_partial '"+a+"'"};return typeof b[a]!="object"?this.render(c[a],b,c,!0):this.render(c[a],b[a],c,!0)},render_section:function(a,b,c){if(!this.includes("#",a)&&!this.includes("^",a))return a;var d=this,e=new RegExp(this.otag+"(\\^|\\#)\\s*(.+)\\s*"+this.ctag+"\n*([\\s\\S]+?)"+this.otag+"\\/\\s*\\2\\s*"+this.ctag+"\\s*","mg");return a.replace(e,function(a,e,f,g){var h=d.find(f,b);if(e=="^")return!h||d.is_array(h)&&h.length===0?d.render(g,b,c,!0):"";if(e=="#")return d.is_array(h)?d.map(h,function(a){return d.render(g,d.create_context(a),c,!0)}).join(""):d.is_object(h)?d.render(g,d.create_context(h),c,!0):typeof h=="function"?h.call(b,g,function(a){return d.render(a,b,c,!0)}):h?d.render(g,b,c,!0):""})},render_tags:function(a,b,c,d){var e=this,f=function(){return new RegExp(e.otag+"(=|!|>|\\{|%)?([^\\/#\\^]+?)\\1?"+e.ctag+"+","g")},g=f(),h=function(a,d,h){switch(d){case"!":return"";case"=":e.set_delimiters(h),g=f();return"";case">":return e.render_partial(h,b,c);case"{":return e.find(h,b);default:return e.escape(e.find(h,b))}},i=a.split("\n");for(var j=0;j\\]/g,function(a){switch(a){case"&":return"&";case"\\":return"\\\\";case'"':return'"';case"<":return"<";case">":return">";default:return a}})},create_context:function(a){if(this.is_object(a))return a;var b=".";this.pragmas["IMPLICIT-ITERATOR"]&&(b=this.pragmas["IMPLICIT-ITERATOR"].iterator);var c={};c[b]=a;return c},is_object:function(a){return a&&typeof a=="object"},is_array:function(a){return Object.prototype.toString.call(a)==="[object Array]"},trim:function(a){return a.replace(/^\s*|\s*$/g,"")},map:function(a,b){if(typeof a.map=="function")return a.map(b);var c=[],d=a.length;for(var e=0;e/g,">").replace(/"/g,""")},m=function(a){return function(b,c){return this.route.apply(this,[a,b,c])}},n={},o=[];c=function(){var b=g(arguments),d,e;c.apps=c.apps||{};if(b.length===0||b[0]&&h(b[0]))return c.apply(c,["body"].concat(b));if(typeof (e=b.shift())=="string"){d=c.apps[e]||new c.Application,d.element_selector=e,b.length>0&&a.each(b,function(a,b){d.use(b)}),d.element_selector!=e&&delete c.apps[e],c.apps[d.element_selector]=d;return d}},c.VERSION="0.6.3",c.addLogger=function(a){o.push(a)},c.log=function(){var b=g(arguments);b.unshift("["+Date()+"]"),a.each(o,function(a,d){d.apply(c,b)})},typeof b.console!="undefined"?h(b.console.log.apply)?c.addLogger(function(){b.console.log.apply(b.console,arguments)}):c.addLogger(function(){b.console.log(arguments)}):typeof console!="undefined"&&c.addLogger(function(){console.log.apply(console,arguments)}),a.extend(c,{makeArray:g,isFunction:h,isArray:i}),c.Object=function(b){return a.extend(this,b||{})},a.extend(c.Object.prototype,{escapeHTML:l,h:l,toHash:function(){var b={};a.each(this,function(a,c){h(c)||(b[a]=c)});return b},toHTML:function(){var b="";a.each(this,function(a,c){h(c)||(b+=""+a+" "+c+"
")});return b},keys:function(a){var b=[];for(var c in this)(!h(this[c])||!a)&&b.push(c);return b},has:function(b){return this[b]&&a.trim(this[b].toString())!=""},join:function(){var a=g(arguments),b=a.shift();return a.join(b)},log:function(){c.log.apply(c,arguments)},toString:function(b){var c=[];a.each(this,function(a,d){(!h(d)||b)&&c.push('"'+a+'": '+d.toString())});return"Sammy.Object: {"+c.join(",")+"}"}}),c.HashLocationProxy=function(a,b){this.app=a,this.is_native=!1,this._startPolling(b)},c.HashLocationProxy.prototype={bind:function(){var d=this,e=this.app;a(b).bind("hashchange."+this.app.eventNamespace(),function(a,f){d.is_native===!1&&!f&&(c.log("native hash change exists, using"),d.is_native=!0,b.clearInterval(c.HashLocationProxy._interval)),e.trigger("location-changed")}),c.HashLocationProxy._bindings||(c.HashLocationProxy._bindings=0),c.HashLocationProxy._bindings++},unbind:function(){a(b).unbind("hashchange."+this.app.eventNamespace()),c.HashLocationProxy._bindings--,c.HashLocationProxy._bindings<=0&&b.clearInterval(c.HashLocationProxy._interval)},getLocation:function(){var a=b.location.toString().match(/^[^#]*(#.+)$/);return a?a[1]:""},setLocation:function(a){return b.location=a},_startPolling:function(d){var e=this;if(!c.HashLocationProxy._interval){d||(d=10);var f=function(){var d=e.getLocation();(!c.HashLocationProxy._last_location||d!=c.HashLocationProxy._last_location)&&b.setTimeout(function(){a(b).trigger("hashchange",[!0])},13),c.HashLocationProxy._last_location=d};f(),c.HashLocationProxy._interval=b.setInterval(f,d)}}},c.Application=function(a){var b=this;this.routes={},this.listeners=new c.Object({}),this.arounds=[],this.befores=[],this.namespace=(new Date).getTime()+"-"+parseInt(Math.random()*1e3,10),this.context_prototype=function(){c.EventContext.apply(this,arguments)},this.context_prototype.prototype=new c.EventContext,h(a)&&a.apply(this,[this]),this._location_proxy||this.setLocationProxy(new c.HashLocationProxy(this,this.run_interval_every)),this.debug&&this.bindToAllEvents(function(a,c){b.log(b.toString(),a.cleaned_type,c||{})})},c.Application.prototype=a.extend({},c.Object.prototype,{ROUTE_VERBS:["get","post","put","delete"],APP_EVENTS:["run","unload","lookup-route","run-route","route-found","event-context-before","event-context-after","changed","error","check-form-submission","redirect","location-changed"],_last_route:null,_location_proxy:null,_running:!1,element_selector:"body",debug:!1,raise_errors:!1,run_interval_every:50,template_engine:null,toString:function(){return"Sammy.Application:"+this.element_selector},$element:function(b){return b?a(this.element_selector).find(b):a(this.element_selector)},use:function(){var a=g(arguments),b=a.shift(),d=b||"";try{a.unshift(this),typeof b=="string"&&(d="Sammy."+b,b=c[b]),b.apply(this,a)}catch(e){typeof b=="undefined"?this.error("Plugin Error: called use() but plugin ("+d.toString()+") is not defined",e):h(b)?this.error("Plugin Error",e):this.error("Plugin Error: called use() but '"+d.toString()+"' is not a function",e)}return this},setLocationProxy:function(a){var b=this._location_proxy;this._location_proxy=a,this.isRunning()&&(b&&b.unbind(),this._location_proxy.bind())},route:function(b,c,f){var g=this,i=[],j,k;!f&&h(c)&&(c=b,f=c,b="any"),b=b.toLowerCase();if(c.constructor==String){e.lastIndex=0;while((k=e.exec(c))!==null)i.push(k[1]);c=new RegExp("^"+c.replace(e,d)+"$")}typeof -f=="string"&&(f=g[f]),j=function(a){var b={verb:a,path:c,callback:f,param_names:i};g.routes[a]=g.routes[a]||[],g.routes[a].push(b)},b==="any"?a.each(this.ROUTE_VERBS,function(a,b){j(b)}):j(b);return this},get:m("get"),post:m("post"),put:m("put"),del:m("delete"),any:m("any"),mapRoutes:function(b){var c=this;a.each(b,function(a,b){c.route.apply(c,b)});return this},eventNamespace:function(){return["sammy-app",this.namespace].join("-")},bind:function(a,b,c){var d=this;typeof c=="undefined"&&(c=b);var e=function(){var a,b,e;a=arguments[0],e=arguments[1],e&&e.context?(b=e.context,delete e.context):b=new d.context_prototype(d,"bind",a.type,e,a.target),a.cleaned_type=a.type.replace(d.eventNamespace(),""),c.apply(b,[a,e])};this.listeners[a]||(this.listeners[a]=[]),this.listeners[a].push(e),this.isRunning()&&this._listen(a,e);return this},trigger:function(a,b){this.$element().trigger([a,this.eventNamespace()].join("."),[b]);return this},refresh:function(){this.last_location=null,this.trigger("location-changed");return this},before:function(a,b){h(a)&&(b=a,a={}),this.befores.push([a,b]);return this},after:function(a){return this.bind("event-context-after",a)},around:function(a){this.arounds.push(a);return this},isRunning:function(){return this._running},helpers:function(b){a.extend(this.context_prototype.prototype,b);return this},helper:function(a,b){this.context_prototype.prototype[a]=b;return this},run:function(c){if(this.isRunning())return!1;var d=this;a.each(this.listeners.toHash(),function(b,c){a.each(c,function(a,c){d._listen(b,c)})}),this.trigger("run",{start_url:c}),this._running=!0,this.last_location=null,this.getLocation()==""&&typeof c!="undefined"&&this.setLocation(c),this._checkLocation(),this._location_proxy.bind(),this.bind("location-changed",function(){d._checkLocation()}),this.bind("submit",function(b){var c=d._checkFormSubmission(a(b.target).closest("form"));return c===!1?b.preventDefault():!1}),a(b).bind("beforeunload",function(){d.unload()});return this.trigger("changed")},unload:function(){if(!this.isRunning())return!1;var b=this;this.trigger("unload"),this._location_proxy.unbind(),this.$element().unbind("submit").removeClass(b.eventNamespace()),a.each(this.listeners.toHash(),function(c,d){a.each(d,function(a,d){b._unlisten(c,d)})}),this._running=!1;return this},bindToAllEvents:function(b){var c=this;a.each(this.APP_EVENTS,function(a,d){c.bind(d,b)}),a.each(this.listeners.keys(!0),function(a,d){c.APP_EVENTS.indexOf(d)==-1&&c.bind(d,b)});return this},routablePath:function(a){return a.replace(f,"")},lookupRoute:function(b,c){var d=this,e=!1;this.trigger("lookup-route",{verb:b,path:c}),typeof this.routes[b]!="undefined"&&a.each(this.routes[b],function(a,b){if(d.routablePath(c).match(b.path)){e=b;return!1}});return e},runRoute:function(b,c,d,e){var f=this,g=this.lookupRoute(b,c),h,i,k,l,m,n,o,p,q;this.log("runRoute",[b,c].join(" ")),this.trigger("run-route",{verb:b,path:c,params:d}),typeof d=="undefined"&&(d={}),a.extend(d,this._parseQueryString(c));if(g){this.trigger("route-found",{route:g}),(p=g.path.exec(this.routablePath(c)))!==null&&(p.shift(),a.each(p,function(a,b){g.param_names[a]?d[g.param_names[a]]=j(b):(d.splat||(d.splat=[]),d.splat.push(j(b)))})),h=new this.context_prototype(this,b,c,d,e),k=this.arounds.slice(0),m=this.befores.slice(0),o=[h].concat(d.splat),i=function(){var a;while(m.length>0){n=m.shift();if(f.contextMatchesOptions(h,n[0])){a=n[1].apply(h,[h]);if(a===!1)return!1}}f.last_route=g,h.trigger("event-context-before",{context:h}),a=g.callback.apply(h,o),h.trigger("event-context-after",{context:h});return a},a.each(k.reverse(),function(a,b){var c=i;i=function(){return b.apply(h,[c])}});try{q=i()}catch(r){this.error(["500 Error",b,c].join(" "),r)}return q}return this.notFound(b,c)},contextMatchesOptions:function(a,b,c){var d=b;if(typeof d=="undefined"||d=={})return!0;typeof c=="undefined"&&(c=!0);if(typeof d=="string"||h(d.test))d={path:d};if(d.only)return this.contextMatchesOptions(a,d.only,!0);if(d.except)return this.contextMatchesOptions(a,d.except,!1);var e=!0,f=!0;d.path&&(h(d.path.test)?e=d.path.test(a.path):e=d.path.toString()===a.path),d.verb&&(f=d.verb===a.verb);return c?f&&e:!f||!e},getLocation:function(){return this._location_proxy.getLocation()},setLocation:function(a){return this._location_proxy.setLocation(a)},swap:function(a){return this.$element().html(a)},templateCache:function(a,b){return typeof b!="undefined"?n[a]=b:n[a]},clearTemplateCache:function(){return n={}},notFound:function(a,b){var c=this.error(["404 Not Found",a,b].join(" "));return a==="get"?c:!0},error:function(a,b){b||(b=new Error),b.message=[a,b.message].join(" "),this.trigger("error",{message:b.message,error:b});if(this.raise_errors)throw b;this.log(b.message,b)},_checkLocation:function(){var a,b;a=this.getLocation();if(!this.last_location||this.last_location[0]!="get"||this.last_location[1]!=a)this.last_location=["get",a],b=this.runRoute("get",a);return b},_getFormVerb:function(b){var c=a(b),d,e;e=c.find('input[name="_method"]'),e.length>0&&(d=e.val()),d||(d=c[0].getAttribute("method"));if(!d||d=="")d="get";return a.trim(d.toString().toLowerCase())},_checkFormSubmission:function(b){var c,d,e,f,g;this.trigger("check-form-submission",{form:b}),c=a(b),d=c.attr("action"),e=this._getFormVerb(c),this.log("_checkFormSubmission",c,d,e),e==="get"?(this.setLocation(d+"?"+this._serializeFormParams(c)),g=!1):(f=a.extend({},this._parseFormParams(c)),g=this.runRoute(e,d,f,b.get(0)));return typeof g=="undefined"?!1:g},_serializeFormParams:function(a){var b="",c=a.serializeArray(),d;if(c.length>0){b=this._encodeFormPair(c[0].name,c[0].value);for(d=1;d0&&this.then(this.callbacks.shift())},load:function(b,c,d){var e=this;return this.then(function(){var f,g,i,j;h(c)?(d=c,c={}):c=a.extend({},c),d&&this.then(d);if(typeof b=="string"){i=b.match(/\.json$/)||c.json,f=i&&c.cache===!0||c.cache!==!1,e.next_engine=e.event_context.engineFor(b),delete c.cache,delete c.json,c.engine&&(e.next_engine=c.engine,delete c.engine);if(f&&(g=this.event_context.app.templateCache(b)))return g;this.wait(),a.ajax(a.extend({url:b,data:{},dataType:i?"json":null,type:"get",success:function(a){f&&e.event_context.app.templateCache(b,a),e.next(a)}},c));return!1}if(b.nodeType)return b.innerHTML;if(b.selector){e.next_engine=b.attr("data-engine");return c.clone===!1?b.remove()[0].innerHTML.toString():b[0].innerHTML.toString()}})},render:function(a,b,c){if(h(a)&&!b)return this.then(a);!b&&this.content&&(b=this.content);return this.load(a).interpolate(b,a).then(c)},partial:function(a,b){return this.render(a,b).swap()},send:function(){var a=this,b=g(arguments),c=b.shift();i(b[0])&&(b=b[0]);return this.then(function(d){b.push(function(b){a.next(b)}),a.wait(),c.apply(c,b);return!1})},collect:function(b,c,d){var e=this,f=function(){h(b)&&(c=b,b=this.content);var d=[],f=!1;a.each(b,function(a,b){var g=c.apply(e,[a,b]);g.jquery&&g.length==1&&(g=g[0],f=!0),d.push(g);return g});return f?d:d.join("")};return d?f():this.then(f)},renderEach:function(b,c,d,e){i(c)&&(e=d,d=c,c=null);return this.load(b).then(function(f){var g=this;d||(d=i(this.previous_content)?this.previous_content:[]);if(e)a.each(d,function(a,d){var h={},i=this.next_engine||b;c?h[c]=d:h=d,e(d,g.event_context.interpolate(f,h,i))});else return this.collect(d,function(a,d){var e={},g=this.next_engine||b;c?e[c]=d:e=d;return this.event_context.interpolate(f,e,g)},!0)})},interpolate:function(a,b,c){var d=this;return this.then(function(e,f){!a&&f&&(a=f),this.next_engine&&(b=this.next_engine,this.next_engine=!1);var g=d.event_context.interpolate(e,a,b);return c?f+g:g})},swap:function(){return this.then(function(a){this.event_context.swap(a)}).trigger("changed",{})},appendTo:function(b){return this.then(function(c){a(b).append(c)}).trigger("changed",{})},prependTo:function(b){return this.then(function(c){a(b).prepend(c)}).trigger("changed",{})},replace:function(b){return this.then(function(c){a(b).html(c)}).trigger("changed",{})},trigger:function(a,b){return this.then(function(c){typeof b=="undefined"&&(b={content:c}),this.event_context.trigger(a,b)})}}),c.EventContext=function(a,b,d,e,f){this.app=a,this.verb=b,this.path=d,this.params=new c.Object(e),this.target=f},c.EventContext.prototype=a.extend({},c.Object.prototype,{$element:function(){return this.app.$element(g(arguments).shift())},engineFor:function(a){var b=this,c;if(h(a))return a;a=(a||b.app.template_engine).toString();if(c=a.match(/\.([^\.]+)$/))a=c[1];return a&&h(b[a])?b[a]:b.app.template_engine?this.engineFor(b.app.template_engine):function(a,b){return a}},interpolate:function(a,b,c){return this.engineFor(c).apply(this,[a,b])},render:function(a,b,d){return(new c.RenderContext(this)).render(a,b,d)},renderEach:function(a,b,d,e){return(new c.RenderContext(this)).renderEach(a,b,d,e)},load:function(a,b,d){return(new c.RenderContext(this)).load(a,b,d)},partial:function(a,b){return(new c.RenderContext(this)).partial(a,b)},send:function(){var a=new c.RenderContext(this);return a.send.apply(a,arguments)},redirect:function(){var a,b=g(arguments),c=this.app.getLocation();b.length>1?(b.unshift("/"),a=this.join.apply(this,b)):a=b[0],this.trigger("redirect",{to:a}),this.app.last_location=[this.verb,this.path],this.app.setLocation(a),c==a&&this.app.trigger("location-changed")},trigger:function(a,b){typeof b=="undefined"&&(b={}),b.context||(b.context=this);return this.app.trigger(a,b)},eventNamespace:function(){return this.app.eventNamespace()},swap:function(a){return this.app.swap(a)},notFound:function(){return this.app.notFound(this.verb,this.path)},json:function(b){return a.parseJSON(b)},toString:function(){return"Sammy.EventContext: "+[this.verb,this.path,this.params].join(" ")}}),a.sammy=b.Sammy=c}(jQuery,window);var require=function(a,b){var c=require.resolve(a,b||"/"),d=require.modules[c];if(!d)throw new Error("Failed to resolve module "+a+", tried "+c);var e=d._cached?d._cached:d();return e},__require=require;require.paths=[],require.modules={},require.extensions=[".js",".coffee"],require.resolve=function(){var a={assert:!0,events:!0,fs:!0,path:!0,vm:!0};return function(b,c){function k(a){var b;a==="/"?b=[""]:b=d.normalize(a).split("/");var c=[];for(var e=b.length-1;e>=0;e--){if(b[e]==="node_modules")continue;var f=b.slice(0,e+1).join("/")+"/node_modules";c.push(f)}return c}function j(a,b){var c=k(b);for(var d=0;d=0;d--){var e=a[d];e=="."?a.splice(d,1):e===".."?(a.splice(d,1),c++):c&&(a.splice(d,1),c--)}if(b)for(;c--;c)a.unshift("..");return a}var c=/^(.+\/(?!$)|\/)?((?:.+?)?(\.[^.]*)?)$/;b.resolve=function(){var b="",c=!1;for(var d=arguments.length;d>=-1&&!c;d--){var e=d>=0?arguments[d]:process.cwd();if(typeof e!="string"||!e)continue;b=e+"/"+b,c=e.charAt(0)==="/"}b=a(b.split("/").filter(function(a){return!!a}),!c).join("/");return(c?"/":"")+b||"."},b.normalize=function(b){var c=b.charAt(0)==="/",d=b.slice(-1)==="/";b=a(b.split("/").filter(function(a){return!!a}),!c).join("/"),!b&&!c&&(b="."),b&&d&&(b+="/");return(c?"/":"")+b},b.join=function(){var a=Array.prototype.slice.call(arguments,0);return b.normalize(a.filter(function(a,b){return a&&typeof a=="string"}).join("/"))},b.dirname=function(a){var b=c.exec(a)[1]||"",d=!1;return b?b.length===1||d&&b.length<=3&&b.charAt(1)===":"?b:b.substring(0,b.length-1):"."},b.basename=function(a,b){var d=c.exec(a)[2]||"";b&&d.substr(-1*b.length)===b&&(d=d.substr(0,d.length-b.length));return d},b.extname=function(a){return c.exec(a)[3]||""}}.call(a.exports),__require.modules.path._cached=a.exports;return a.exports},require.modules["/node_modules/traverse/package.json"]=function(){var a={exports:{}},b=a.exports,c="/node_modules/traverse",d="/node_modules/traverse/package.json",e=function(a){return __require(a,"/node_modules/traverse")};e.resolve=function(a){return __require.resolve(name,"/node_modules/traverse")},e.modules=__require.modules,__require.modules["/node_modules/traverse/package.json"]._cached=a.exports,function(){a.exports={name:"traverse",version:"0.4.4",description:"Traverse and transform objects by visiting every node on a recursive walk",author:"James Halliday",license:"MIT/X11",main:"./index",repository:{type:"git",url:"http://github.com/substack/js-traverse.git"},devDependencies:{expresso:"0.7.x"},scripts:{test:"expresso"}}}.call(a.exports),__require.modules["/node_modules/traverse/package.json"]._cached=a.exports;return a.exports},require.modules["/node_modules/traverse/index.js"]=function(){var a={exports:{}},b=a.exports,c="/node_modules/traverse",d="/node_modules/traverse/index.js",e=function(a){return __require(a,"/node_modules/traverse")};e.resolve=function(a){return __require.resolve(name,"/node_modules/traverse")},e.modules=__require.modules,__require.modules["/node_modules/traverse/index.js"]._cached=a.exports,function(){function d(a){if(typeof a=="object"&&a!==null){var b;Array.isArray(a)?b=[]:a instanceof Date?b=new Date(a):a instanceof Boolean?b=new Boolean(a):a instanceof Number?b=new Number(a):a instanceof String?b=new String(a):b=Object.create(Object.getPrototypeOf(a)),Object.keys(a).forEach(function(c){b[c]=a[c]});return b}return a}function c(a,b,c){var e=[],f=[],g=!0;return function h(a){var i=c?d(a):a,j={},k=!0,l={node:i,node_:a,path:[].concat(e),parent:f[f.length-1],key:e.slice(-1)[0],isRoot:e.length===0,level:e.length,circular:null,update:function(a,b){l.isRoot||(l.parent.node[l.key]=a),l.node=a,b&&(k=!1)},"delete":function(){delete l.parent.node[l.key]},remove:function(){Array.isArray(l.parent.node)?l.parent.node.splice(l.key,1):delete l.parent.node[l.key]},before:function(a){j.before=a},after:function(a){j.after=a},pre:function(a){j.pre=a},post:function(a){j.post=a},stop:function(){g=!1},block:function(){k=!1}};if(!g)return l;if(typeof i=="object"&&i!==null){l.isLeaf=Object.keys(i).length==0;for(var m=0;m=d.computed&&(d={value:a,computed:g})});return d.value},w.min=function(a,b,c){if(!b&&w.isArray(a))return Math.min.apply(Math,a);var d={computed:Infinity};x(a,function(a,e,f){var g=b?b.call(c,a,e,f):a;gd?1:0}),"value")},w.sortedIndex=function(a,b,c){c||(c=w.identity);var d=0,e=a.length;while(d>1;c(a[f])=0})})},w.zip=function(){var a=g.call(arguments),b=w.max(w.pluck(a,"length")),c=Array(b);for(var d=0;d=0;c--)b=[a[c].apply(this,b)];return b[0]}},w.after=function(a,b){return 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){return w.filter(w.keys(a),function(b){return w.isFunction(a[b])}).sort()},w.extend=function(a){x(g.call(arguments,1),function(b){for(var c in b)b[c]!==void 0&&(a[c]=b[c])});return a},w.defaults=function(a){x(g.call(arguments,1),function(b){for(var c in b)a[c]==null&&(a[c]=b[c])});return a},w.clone=function(a){return w.isArray(a)?a.slice():w.extend({},a)},w.tap=function(a,b){b(a);return a},w.isEqual=function(a,b){if(a===b)return!0;var c=typeof a,d=typeof b;if(c!=d)return!1;if(a==b)return!0;if(!a&&b||a&&!b)return!1;a._chain&&(a=a._wrapped),b._chain&&(b=b._wrapped);if(a.isEqual)return a.isEqual(b);if(w.isDate(a)&&w.isDate(b))return a.getTime()===b.getTime();if(w.isNaN(a)&&w.isNaN(b))return!1;if(w.isRegExp(a)&&w.isRegExp(b))return a.source===b.source&&a.global===b.global&&a.ignoreCase===b.ignoreCase&&a.multiline===b.multiline;if(c!=="object")return!1;if(a.length&&a.length!==b.length)return!1;var e=w.keys(a),f=w.keys(b);if(e.length!=f.length)return!1;for(var g in a)if(!(g in b)||!w.isEqual(a[g],b[g]))return!1;return!0},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.isArguments=function(a){return!!a&&!!j.call(a,"callee")},w.isFunction=function(a){return!!(a&&a.constructor&&a.call&&a.apply)},w.isString=function(a){return!!(a===""||a&&a.charCodeAt&&a.substr)},w.isNumber=function(a){return!!(a===0||a&&a.toExponential&&a.toFixed)},w.isNaN=function(a){return a!==a},w.isBoolean=function(a){return a===!0||a===!1},w.isDate=function(a){return!!(a&&a.getTimezoneOffset&&a.setUTCFullYear)},w.isRegExp=function(a){return!(!(a&&a.test&&a.exec)||!a.ignoreCase&&a.ignoreCase!==!1)},w.isNull=function(a){return a===null},w.isUndefined=function(a){return a===void 0},w.noConflict=function(){a._=b;return this},w.identity=function(a){return a},w.times=function(a,b,c){for(var d=0;d/g,interpolate:/<%=([\s\S]+?)%>/g},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.interpolate,function(a,b){return"',"+b.replace(/\\'/g,"'")+",'"}).replace(c.evaluate||null,function(a,b){return"');"+b.replace(/\\'/g,"'").replace(/[\r\n\t]/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):e};var B=function(a){this._wrapped=a};w.prototype=B.prototype;var C=function(a,b){return b?w(a).chain():a},D=function(a,b){B.prototype[a]=function(){var a=g.call(arguments);h.call(a,this._wrapped);return C(b.apply(w,a),this._chain)}};w.mixin(w),x(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=d[a];B.prototype[a]=function(){b.apply(this._wrapped,arguments);return C(this._wrapped,this._chain)}}),x(["concat","join","slice"],function(a){var b=d[a];B.prototype[a]=function(){return C(b.apply(this._wrapped,arguments),this._chain)}}),B.prototype.chain=function(){this._chain=!0;return this},B.prototype.value=function(){return this._wrapped}}() \ No newline at end of file +// Underscore.js 1.1.6 +// (c) 2011 Jeremy Ashkenas, DocumentCloud Inc. +// Underscore is freely distributable under the MIT license. +// Portions of Underscore are inspired or borrowed from Prototype, +// Oliver Steele's Functional, and John Resig's Micro-Templating. +// For all details and documentation: +// http://documentcloud.github.com/underscore +(function(){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 B(a)};typeof module!="undefined"&&module.exports?(module.exports=w,w._=w):a._=w,w.VERSION="1.1.6";var x=w.each=w.forEach=function(a,b,d){if(a!=null)if(k&&a.forEach===k)a.forEach(b,d);else if(w.isNumber(a.length)){for(var e=0,f=a.length;e=d.computed&&(d={value:a,computed:g})});return d.value},w.min=function(a,b,c){if(!b&&w.isArray(a))return Math.min.apply(Math,a);var d={computed:Infinity};x(a,function(a,e,f){var g=b?b.call(c,a,e,f):a;gd?1:0}),"value")},w.sortedIndex=function(a,b,c){c||(c=w.identity);var d=0,e=a.length;while(d>1;c(a[f])=0})})},w.zip=function(){var a=g.call(arguments),b=w.max(w.pluck(a,"length")),c=Array(b);for(var d=0;d=0;c--)b=[a[c].apply(this,b)];return b[0]}},w.after=function(a,b){return 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){return w.filter(w.keys(a),function(b){return w.isFunction(a[b])}).sort()},w.extend=function(a){x(g.call(arguments,1),function(b){for(var c in b)b[c]!==void 0&&(a[c]=b[c])});return a},w.defaults=function(a){x(g.call(arguments,1),function(b){for(var c in b)a[c]==null&&(a[c]=b[c])});return a},w.clone=function(a){return w.isArray(a)?a.slice():w.extend({},a)},w.tap=function(a,b){b(a);return a},w.isEqual=function(a,b){if(a===b)return!0;var c=typeof a,d=typeof b;if(c!=d)return!1;if(a==b)return!0;if(!a&&b||a&&!b)return!1;a._chain&&(a=a._wrapped),b._chain&&(b=b._wrapped);if(a.isEqual)return a.isEqual(b);if(w.isDate(a)&&w.isDate(b))return a.getTime()===b.getTime();if(w.isNaN(a)&&w.isNaN(b))return!1;if(w.isRegExp(a)&&w.isRegExp(b))return a.source===b.source&&a.global===b.global&&a.ignoreCase===b.ignoreCase&&a.multiline===b.multiline;if(c!=="object")return!1;if(a.length&&a.length!==b.length)return!1;var e=w.keys(a),f=w.keys(b);if(e.length!=f.length)return!1;for(var g in a)if(!(g in b)||!w.isEqual(a[g],b[g]))return!1;return!0},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.isArguments=function(a){return!!a&&!!j.call(a,"callee")},w.isFunction=function(a){return!!(a&&a.constructor&&a.call&&a.apply)},w.isString=function(a){return!!(a===""||a&&a.charCodeAt&&a.substr)},w.isNumber=function(a){return!!(a===0||a&&a.toExponential&&a.toFixed)},w.isNaN=function(a){return a!==a},w.isBoolean=function(a){return a===!0||a===!1},w.isDate=function(a){return!!(a&&a.getTimezoneOffset&&a.setUTCFullYear)},w.isRegExp=function(a){return!(!(a&&a.test&&a.exec)||!a.ignoreCase&&a.ignoreCase!==!1)},w.isNull=function(a){return a===null},w.isUndefined=function(a){return a===void 0},w.noConflict=function(){a._=b;return this},w.identity=function(a){return a},w.times=function(a,b,c){for(var d=0;d/g,interpolate:/<%=([\s\S]+?)%>/g},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.interpolate,function(a,b){return"',"+b.replace(/\\'/g,"'")+",'"}).replace(c.evaluate||null,function(a,b){return"');"+b.replace(/\\'/g,"'").replace(/[\r\n\t]/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):e};var B=function(a){this._wrapped=a};w.prototype=B.prototype;var C=function(a,b){return b?w(a).chain():a},D=function(a,b){B.prototype[a]=function(){var a=g.call(arguments);h.call(a,this._wrapped);return C(b.apply(w,a),this._chain)}};w.mixin(w),x(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=d[a];B.prototype[a]=function(){b.apply(this._wrapped,arguments);return C(this._wrapped,this._chain)}}),x(["concat","join","slice"],function(a){var b=d[a];B.prototype[a]=function(){return C(b.apply(this._wrapped,arguments),this._chain)}}),B.prototype.chain=function(){this._chain=!0;return this},B.prototype.value=function(){return this._wrapped}})(),function(){var a=this,b=a.Backbone,c;typeof exports!="undefined"?c=exports:c=a.Backbone={},c.VERSION="0.5.1";var d=a._;!d&&typeof require!="undefined"&&(d=require("underscore")._);var e=a.jQuery||a.Zepto;c.noConflict=function(){a.Backbone=b;return this},c.emulateHTTP=!1,c.emulateJSON=!1,c.Events={bind:function(a,b){var c=this._callbacks||(this._callbacks={}),d=c[a]||(c[a]=[]);d.push(b);return 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').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;this._wantsPushState&&!this._hasPushState&&!h?(this.fragment=this.getFragment(null,!0),window.location.replace(this.options.root+"#"+this.fragment)):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));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)){a.callback(b);return!0}});return c},navigate:function(a,b){var c=(a||"").replace(j,"");if(this.fragment!=c&&this.fragment!=decodeURIComponent(c)){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(){e(this.el).remove();return this},make:function(a,b,c){var d=document.createElement(a);b&&e(d).attr(b),c&&e(d).html(c);return d},delegateEvents:function(a){if(!!a||!!(a=this.events)){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/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")}}.call(this),function(a,b){function F(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(N,"$1-$2").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:J.isNaN(d)?M.test(d)?J.parseJSON(d):d:parseFloat(d)}catch(f){}J.data(a,c,d)}else d=b}return d}function E(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function D(a,c,d){var e=c+"defer",f=c+"queue",g=c+"mark",h=J.data(a,e,b,!0);h&&(d==="queue"||!J.data(a,f,b,!0))&&(d==="mark"||!J.data(a,g,b,!0))&&setTimeout(function(){!J.data(a,f,b,!0)&&!J.data(a,g,b,!0)&&(J.removeData(a,e,!0),h.resolve())},0)}function C(){return!1}function B(){return!0}function A(a,c,d){var e=J.extend({},d[0]);e.type=a,e.originalEvent={},e.liveFired=b,J.event.handle.call(c,e),e.isDefaultPrevented()&&d[0].preventDefault()}function z(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o=[],p=[],q=J._data(this,"events");if(!(a.liveFired===this||!q||!q.live||a.target.disabled||a.button&&a.type==="click")){a.namespace&&(m=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var r=q.live.slice(0);for(h=0;hc)break;a.currentTarget=e.elem,a.data=e.handleObj.data,a.handleObj=e.handleObj,n=e.handleObj.origHandler.apply(e.elem,arguments);if(n===!1||a.isPropagationStopped()){c=e.level,n===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function y(a,b){return(a&&a!=="*"?a+".":"")+b.replace(_,"`").replace(ba,"&")}function x(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function w(a,b,c){b=b||0;if(J.isFunction(b))return J.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return J.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=J.grep(a,function(a){return a.nodeType===1});if(bm.test(b))return J.filter(b,d,!c);b=J.filter(b,d)}return J.grep(a,function(a,d){return J.inArray(a,b)>=0===c})}function v(a,b){return J.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function u(a,b){if(b.nodeType===1&&!!J.hasData(a)){var c=J.expando,d=J.data(a),e=J.data(b,d);if(d=d[c]){var f=d.events;e=e[c]=J.extend({},d);if(f){delete e.handle,e.events={};for(var g in f)for(var h=0,i=f[g].length;h").appendTo("body"),c=b.css("display");b.remove();if(c==="none"||c===""){cp||(cp=G.createElement("iframe"),cp.frameBorder=cp.width=cp.height=0),G.body.appendChild(cp);if(!cq||!cp.createElement)cq=(cp.contentWindow||cp.contentDocument).document,cq.write("");b=cq.createElement(a),cq.body.appendChild(b),c=J.css(b,"display"),G.body.removeChild(cp)}co[a]=c}return co[a]}function c(a){return J.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}var G=a.document,H=a.navigator,I=a.location,J=function(){function c(){if(!d.isReady){try{G.documentElement.doScroll("left")}catch(a){setTimeout(c,1);return}d.ready()}}var d=function(a,b){return new d.fn.init(a,b,g)},e=a.jQuery,f=a.$,g,h=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,i=/\S/,j=/^\s+/,k=/\s+$/,l=/\d/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=H.userAgent,w,x,y,z=Object.prototype.toString,A=Object.prototype.hasOwnProperty,B=Array.prototype.push,C=Array.prototype.slice,D=String.prototype.trim,E=Array.prototype.indexOf,F={};d.fn=d.prototype={constructor:d,init:function(a,c,e){var f,g,i,j;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!c&&G.body){this.context=G,this[0]=G.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?f=h.exec(a):f=[null,a,null];if(f&&(f[1]||!c)){if(f[1]){c=c instanceof d?c[0]:c,j=c?c.ownerDocument||c:G,i=m.exec(a),i?d.isPlainObject(c)?(a=[G.createElement(i[1])],d.fn.attr.call(a,c,!0)):a=[j.createElement(i[1])]:(i=d.buildFragment([f[1]],[j]),a=(i.cacheable?d.clone(i.fragment):i.fragment).childNodes);return d.merge(this,a)}g=G.getElementById(f[2]);if(g&&g.parentNode){if(g.id!==f[2])return e.find(a);this.length=1,this[0]=g}this.context=G,this.selector=a;return this}return!c||c.jquery?(c||e).find(a):this.constructor(c).find(a)}if(d.isFunction(a))return e.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return d.makeArray(a,this)},selector:"",jquery:"1.6.1",length:0,size:function(){return this.length},toArray:function(){return C.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var e=this.constructor();d.isArray(a)?B.apply(e,a):d.merge(e,a),e.prevObject=this,e.context=this.context,b==="find"?e.selector=this.selector+(this.selector?" ":"")+c:b&&(e.selector=this.selector+"."+b+"("+c+")");return e},each:function(a,b){return d.each(this,a,b)},ready:function(a){d.bindReady(),x.done(a);return this},eq:function(a){return a===-1?this.slice(a):this +.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(C.apply(this,arguments),"slice",C.call(arguments).join(","))},map:function(a){return this.pushStack(d.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:B,sort:[].sort,splice:[].splice},d.fn.init.prototype=d.fn,d.extend=d.fn.extend=function(){var a,c,e,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!d.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;x.resolveWith(G,[d]),d.fn.trigger&&d(G).trigger("ready").unbind("ready")}},bindReady:function(){if(!x){x=d._Deferred();if(G.readyState==="complete")return setTimeout(d.ready,1);if(G.addEventListener)G.addEventListener("DOMContentLoaded",y,!1),a.addEventListener("load",d.ready,!1);else if(G.attachEvent){G.attachEvent("onreadystatechange",y),a.attachEvent("onload",d.ready);var b=!1;try{b=a.frameElement==null}catch(e){}G.documentElement.doScroll&&b&&c()}}},isFunction:function(a){return d.type(a)==="function"},isArray:Array.isArray||function(a){return d.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNaN:function(a){return a==null||!l.test(a)||isNaN(a)},type:function(a){return a==null?String(a):F[z.call(a)]||"object"},isPlainObject:function(a){if(!a||d.type(a)!=="object"||a.nodeType||d.isWindow(a))return!1;if(a.constructor&&!A.call(a,"constructor")&&!A.call(a.constructor.prototype,"isPrototypeOf"))return!1;var c;for(c in a);return c===b||A.call(a,c)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=d.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();d.error("Invalid JSON: "+b)},parseXML:function(b,c,e){a.DOMParser?(e=new DOMParser,c=e.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b)),e=c.documentElement,(!e||!e.nodeName||e.nodeName==="parsererror")&&d.error("Invalid XML: "+b);return c},noop:function(){},globalEval:function(b){b&&i.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,e){var f,g=0,h=a.length,i=h===b||d.isFunction(a);if(e){if(i){for(f in a)if(c.apply(a[f],e)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||d.isArray(a));if(k)for(;i1?L.call(arguments,0):b,--f||g.resolveWith(g,L.call(c,0))}}var c=arguments,d=0,e=c.length,f=e,g=e<=1&&a&&J.isFunction(a.promise)?a:J.Deferred();if(e>1){for(;d
a",c=a.getElementsByTagName("*"),d=a.getElementsByTagName("a")[0];if(!c||!c.length||!d)return{};e=G.createElement("select"),f=e.appendChild(G.createElement("option")),g=a.getElementsByTagName("input")[0],i={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/top/.test(d.getAttribute("style")),hrefNormalized:d.getAttribute("href")==="/a",opacity:/^0.55$/.test(d.style.opacity),cssFloat:!!d.style.cssFloat,checkOn:g.value==="on",optSelected:f.selected,getSetAttribute:a.className!=="t",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},g.checked=!0,i.noCloneChecked=g.cloneNode(!0).checked,e.disabled=!0,i.optDisabled=!f.disabled;try{delete a.test}catch(r){i.deleteExpando=!1}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function s(){i.noCloneEvent=!1,a.detachEvent("onclick",s)}),a.cloneNode(!0).fireEvent("onclick")),g=G.createElement("input"),g.value="t",g.setAttribute("type","radio"),i.radioValue=g.value==="t",g.setAttribute("checked","checked"),a.appendChild(g),j=G.createDocumentFragment(),j.appendChild(a.firstChild),i.checkClone=j.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",k=G.createElement("body"),l={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"};for(p in l)k.style[p]=l[p];k.appendChild(a),b.insertBefore(k,b.firstChild),i.appendChecked=g.checked,i.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,i.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="
",i.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="
t
",m=a.getElementsByTagName("td"),q=m[0].offsetHeight===0,m[0].style.display="",m[1].style.display="none",i.reliableHiddenOffsets=q&&m[0].offsetHeight===0,a.innerHTML="",G.defaultView&&G.defaultView.getComputedStyle&&(h=G.createElement("div"),h.style.width="0",h.style.marginRight="0",a.appendChild(h),i.reliableMarginRight=(parseInt((G.defaultView.getComputedStyle(h,null)||{marginRight:0}).marginRight,10)||0)===0),k.innerHTML="",b.removeChild(k);if(a.attachEvent)for(p in{submit:1,change:1,focusin:1})o="on"+p,q=o in a,q||(a.setAttribute(o,"return;"),q=typeof a[o]=="function"),i[p+"Bubbles"]=q;return i}(),J.boxModel=J.support.boxModel;var M=/^(?:\{.*\}|\[.*\])$/,N=/([a-z])([A-Z])/g;J.extend({cache:{},uuid:0,expando:"jQuery"+(J.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?J.cache[a[J.expando]]:a[J.expando];return!!a&&!E(a)},data:function(a,c,d,e){if(!!J.acceptData(a)){var f=J.expando,g=typeof c=="string",h,i=a.nodeType,j=i?J.cache:a,k=i?a[J.expando]:a[J.expando]&&J.expando;if((!k||e&&k&&!j[k][f])&&g&&d===b)return;k||(i?a[J.expando]=k=++J.uuid:k=J.expando),j[k]||(j[k]={},i||(j[k].toJSON=J.noop));if(typeof c=="object"||typeof c=="function")e?j[k][f]=J.extend(j[k][f],c):j[k]=J.extend(j[k],c);h=j[k],e&&(h[f]||(h[f]={}),h=h[f]),d!==b&&(h[J.camelCase(c)]=d);return c==="events"&&!h[c]?h[f]&&h[f].events:g?h[J.camelCase(c)]:h}},removeData:function(b,c,d){if(!!J.acceptData(b)){var e=J.expando,f=b.nodeType,g=f?J.cache:b,h=f?b[J.expando]:J.expando;if(!g[h])return;if(c){var i=d?g[h][e]:g[h];if(i){delete i[c];if(!E(i))return}}if(d){delete g[h][e];if(!E(g[h]))return}var j=g[h][e];J.support.deleteExpando||g!=a?delete g[h]:g[h]=null,j?(g[h]={},f||(g[h].toJSON=J.noop),g[h][e]=j):f&&(J.support.deleteExpando?delete b[J.expando]:b.removeAttribute?b.removeAttribute(J.expando):b[J.expando]=null)}},_data:function(a,b,c){return J.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=J.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),J.fn.extend({data:function(a,c){var d=null;if(typeof a=="undefined"){if(this.length){d=J.data(this[0]);if(this[0].nodeType===1){var e=this[0].attributes,f;for(var g=0,h=e.length;g-1)return!0;return!1},val:function(a){var c,d,e=this[0];if(!arguments.length){if(e){c=J.valHooks[e.nodeName.toLowerCase()]||J.valHooks[e.type];return c&&"get"in c&&(d=c.get(e,"value"))!==b?d:(e.value||"").replace(Q,"")}return b}var f=J.isFunction(a);return this.each(function(d){var e=J(this),g;if(this.nodeType===1){f?g=a.call(this,d,e.val()):g=a,g==null?g="":typeof g=="number"?g+="":J.isArray(g)&&(g=J.map(g,function(a){return a==null?"":a+""})),c=J.valHooks[this.nodeName.toLowerCase()]||J.valHooks[this.type];if(!c||!("set"in c)||c.set(this,g,"value")===b)this.value=g}})}}),J.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c=a.selectedIndex,d=[],e=a.options,f=a.type==="select-one";if(c<0)return null;for(var g=f?c:0,h=f?c+1:e.length;g=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attrFix:{tabindex:"tabIndex"},attr:function(a,c,d,e){var f=a.nodeType;if(!a||f===3||f===8||f===2)return b;if(e&&c in J.attrFn)return J(a)[c](d);if("getAttribute"in a){var g,h,i=f!==1||!J.isXMLDoc(a);c=i&&J.attrFix[c]||c,h=J.attrHooks[c],h||(!U.test(c)||typeof d!="boolean"&&d!==b&&d.toLowerCase()!==c.toLowerCase()?W&&(J.nodeName(a,"form")||V.test(c))&&(h=W):h=X);if(d!==b){if(d===null){J.removeAttr(a,c);return b}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i)return h.get(a,c);g=a.getAttribute(c);return g===null?b:g}return J.prop(a,c,d)},removeAttr:function(a,b){var c;a.nodeType===1&&(b=J.attrFix[b]||b,J.support.getSetAttribute?a.removeAttribute(b):(J.attr(a,b,""),a.removeAttributeNode(a.getAttributeNode(b))),U.test(b)&&(c=J.propFix[b]||b)in a&&(a[c]=!1))},attrHooks:{type:{set:function(a,b){if(R.test(a.nodeName)&&a.parentNode)J.error("type property can't be changed");else if(!J.support.radioValue&&b==="radio"&&J.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},tabIndex:{get:function(a){var c=a.getAttributeNode("tabIndex");return c&&c.specified?parseInt(c.value,10):S.test(a.nodeName)||T.test(a.nodeName)&&a.href?0:b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e=a.nodeType;if(!a||e===3||e===8||e===2)return b;var f,g,h=e!==1||!J.isXMLDoc(a);c=h&&J.propFix[c]||c,g=J.propHooks[c];return d!==b?g&&"set"in g&&(f=g.set(a,d,c))!==b?f:a[c]=d:g&&"get"in g&&(f=g.get(a,c))!==b?f:a[c]},propHooks:{}}),X={get:function(a,c){return a[J.propFix[c]||c]?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?J.removeAttr(a,c):(d=J.propFix[c]||c,d in a&&(a[d]=b),a.setAttribute(c,c.toLowerCase()));return c}},J.attrHooks.value={get:function(a,b){return W&&J.nodeName(a,"button")?W.get(a,b):a.value},set:function(a,b,c){if(W&&J.nodeName(a,"button"))return W.set(a,b,c);a.value=b}},J.support.getSetAttribute||(J.attrFix=J.propFix,W=J.attrHooks.name=J.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&d.nodeValue!==""?d.nodeValue:b},set:function(a,b,c){var d=a.getAttributeNode(c);if(d){d.nodeValue=b;return b}}},J.each(["width","height"],function(a,b){J.attrHooks[b]=J.extend(J.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})})),J.support.hrefNormalized||J.each(["href","src","width","height"],function(a,c){J.attrHooks[c]=J.extend(J.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),J.support.style||(J.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),J.support.optSelected||(J.propHooks.selected=J.extend(J.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}})),J.support.checkOn||J.each(["radio","checkbox"],function(){J.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),J.each(["radio","checkbox"],function(){J.valHooks[this]=J.extend(J.valHooks[this],{set:function(a,b){if(J.isArray(b))return a.checked=J.inArray(J(a).val(),b)>=0}})});var Y=Object.prototype.hasOwnProperty,Z=/\.(.*)$/,$=/^(?:textarea|input|select)$/i,_=/\./g,ba=/ /g,bb=/[^\w\s.|`]/g,bc=function(a){return a.replace(bb,"\\$&")};J.event={add:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){if(d===!1)d=C;else if(!d)return;var f,g;d.handler&&(f=d,d=f.handler),d.guid||(d.guid=J.guid++);var h=J._data(a);if(!h)return;var i=h.events,j=h.handle;i||(h.events=i={}),j||(h.handle=j=function(a){return typeof J!="undefined"&&(!a||J.event.triggered!==a.type)?J.event.handle.apply(j.elem,arguments):b}),j.elem=a,c=c.split(" ");var k,l=0,m;while(k=c[l++]){g=f?J.extend({},f):{handler:d,data:e},k.indexOf(".")>-1?(m=k.split("."),k=m.shift(),g.namespace=m.slice(0).sort().join(".")):(m=[],g.namespace=""),g.type=k,g.guid||(g.guid=d.guid);var n=i[k],o=J.event.special[k]||{};if(!n){n=i[k]=[];if(!o.setup||o.setup.call(a,e,m,j)===!1)a.addEventListener?a.addEventListener(k,j,!1):a.attachEvent&&a.attachEvent("on"+k,j)}o.add&&(o.add.call(a,g),g.handler.guid||(g.handler.guid=d.guid)),n.push(g),J.event.global[k]=!0}a=null}},global:{},remove:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){d===!1&&(d=C);var f,g,h,i,j=0,k,l,m,n,o,p,q,r=J.hasData(a)&&J._data(a),s=r&&r.events;if(!r||!s)return;c&&c.type&&(d=c.handler,c=c.type);if(!c||typeof c=="string"&&c.charAt(0)==="."){c=c||"";for(g in s)J.event.remove(a,g+c);return}c=c.split(" ");while(g=c[j++]){q=g,p=null,k=g.indexOf(".")<0,l=[],k||(l=g.split("."),g=l.shift(),m=new RegExp("(^|\\.)"+J.map(l.slice(0).sort(),bc).join("\\.(?:.*\\.)?")+"(\\.|$)")),o=s[g];if(!o)continue;if(!d){for(i=0;i=0&&(g=g.slice(0,-1),i=!0),g.indexOf(".")>=0&&(h=g.split("."),g=h.shift(),h.sort());if(!!e&&!J.event.customEvent[g]||!!J.event.global[g]){c=typeof c=="object"?c[J.expando]?c:new J.Event(g,c):new J.Event(g),c.type=g,c.exclusive=i,c.namespace=h.join("."),c.namespace_re=new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.)?")+"(\\.|$)");if(f||!e)c.preventDefault(),c.stopPropagation();if(!e){J.each(J.cache,function(){var a=J.expando,b=this[a];b&&b.events&&b.events[g]&&J.event.trigger(c,d,b.handle.elem)});return}if(e.nodeType===3||e.nodeType===8)return;c.result=b,c.target=e,d=d?J.makeArray(d):[],d.unshift(c);var j=e,k=g.indexOf(":")<0?"on"+g:"";do{var l=J._data(j,"handle");c.currentTarget=j,l&&l.apply(j,d),k&&J.acceptData(j)&&j[k]&&j[k].apply(j,d)===!1&&(c.result=!1,c.preventDefault()),j=j.parentNode||j.ownerDocument||j===c.target.ownerDocument&&a}while(j&&!c.isPropagationStopped());if(!c.isDefaultPrevented()){var m,n=J.event.special[g]||{};if((!n._default||n._default.call(e.ownerDocument,c)===!1)&&(g!=="click"||!J.nodeName(e,"a"))&&J.acceptData(e)){try{k&&e[g]&&(m=e[k],m&&(e[k]=null),J.event.triggered=g,e[g]())}catch(o){}m&&(e[k]=m),J.event.triggered=b}}return c.result}},handle:function(c){c=J.event.fix(c||a.event);var d=((J._data(this,"events")||{})[c.type]||[]).slice(0),e=!c.exclusive&&!c.namespace,f=Array.prototype.slice.call(arguments,0);f[0]=c,c.currentTarget=this;for(var g=0,h=d.length;g-1?J.map(a.options,function(a){return a.selected}).join("-"):"":J.nodeName(a,"select")&&(c=a.selectedIndex);return c},bh=function(a){var c=a.target,d,e;if(!!$.test(c.nodeName)&&!c.readOnly){d=J._data(c,"_change_data"),e=bg(c),(a.type!=="focusout"||c.type!=="radio")&&J._data(c,"_change_data",e);if(d===b||e===d)return;if(d!=null||e)a.type="change",a.liveFired=b,J.event.trigger(a,arguments[1],c)}};J.event.special.change={filters:{focusout:bh,beforedeactivate:bh,click:function(a){var b=a.target,c=J.nodeName(b,"input")?b.type:"";(c==="radio"||c==="checkbox"||J.nodeName(b,"select"))&&bh.call(this,a)},keydown:function(a){var b=a.target,c=J.nodeName(b,"input")?b.type:"";(a.keyCode===13&&!J.nodeName(b,"textarea")||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&bh.call(this,a)},beforeactivate:function(a){var b=a.target;J._data(b,"_change_data",bg(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in bf)J.event.add(this,c+".specialChange",bf[c]);return $.test(this.nodeName)},teardown:function(a){J.event.remove(this,".specialChange");return $.test(this.nodeName)}},bf=J.event.special.change.filters,bf.focus=bf.beforeactivate}J.support.focusinBubbles||J.each({focus:"focusin",blur:"focusout"},function(a,b){function c(a){var c=J.event.fix(a);c.type=b,c.originalEvent={},J.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var d=0;J.event.special[b]={setup:function(){d++===0&&G.addEventListener(a,c,!0)},teardown:function(){--d===0&&G.removeEventListener(a,c,!0)}}}),J.each(["bind","one"],function(a,c){J.fn[c]=function(a,d,e){var f;if(typeof a=="object"){for(var g in a)this[c](g,d,a[g],e);return this}if(arguments.length===2||d===!1)e=d,d=b;c==="one"?(f=function(a){J(this).unbind(a,f);return e.apply(this,arguments)},f.guid=e.guid||J.guid++):f=e;if(a==="unload"&&c!=="one")this.one(a,d,e);else for(var h=0,i=this.length;h0?this.bind(b,a,c):this.trigger(b)},J.attrFn&&(J.attrFn[b]=!0)}),function(){function c(a,b,c,d,e,f){for(var g=0,h=d.length;g0){j=i;break}}i=i[a]}d[g]=j}}}var d=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g +,e=0,f=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(a,b,c,e){c=c||[],b=b||G;var g=b;if(b.nodeType!==1&&b.nodeType!==9)return[];if(!a||typeof a!="string")return c;var h,i,j,n,o,q,r,s,u=!0,v=k.isXML(b),w=[],x=a;do{d.exec(""),h=d.exec(x);if(h){x=h[3],w.push(h[1]);if(h[2]){n=h[3];break}}}while(h);if(w.length>1&&m.exec(a))if(w.length===2&&l.relative[w[0]])i=t(w[0]+w[1],b);else{i=l.relative[w[0]]?[b]:k(w.shift(),b);while(w.length)a=w.shift(),l.relative[a]&&(a+=w.shift()),i=t(a,i)}else{!e&&w.length>1&&b.nodeType===9&&!v&&l.match.ID.test(w[0])&&!l.match.ID.test(w[w.length-1])&&(o=k.find(w.shift(),b,v),b=o.expr?k.filter(o.expr,o.set)[0]:o.set[0]);if(b){o=e?{expr:w.pop(),set:p(e)}:k.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&b.parentNode?b.parentNode:b,v),i=o.expr?k.filter(o.expr,o.set):o.set,w.length>0?j=p(i):u=!1;while(w.length)q=w.pop(),r=q,l.relative[q]?r=w.pop():q="",r==null&&(r=b),l.relative[q](j,r,v)}else j=w=[]}j||(j=i),j||k.error(q||a);if(f.call(j)==="[object Array]")if(!u)c.push.apply(c,j);else if(b&&b.nodeType===1)for(s=0;j[s]!=null;s++)j[s]&&(j[s]===!0||j[s].nodeType===1&&k.contains(b,j[s]))&&c.push(i[s]);else for(s=0;j[s]!=null;s++)j[s]&&j[s].nodeType===1&&c.push(i[s]);else p(j,c);n&&(k(n,g,c,e),k.uniqueSort(c));return c};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&k.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(a,b,c,e,f){if(a[1]==="not")if((d.exec(a[3])||"").length>1||/^\w/.test(a[3]))a[3]=k(a[3],null,null,b);else{var g=k.filter(a[3],b,c,!0^f);c||e.push.apply(e,g);return!1}else if(l.match.POS.test(a[0])||l.match.CHILD.test(a[0]))return!0;return a},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!k(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(G.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if(f.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",d.insertBefore(a,d.firstChild),G.getElementById(c)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),d.removeChild(a),d=a=null}(),function(){var a=G.createElement("div");a.appendChild(G.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),G.querySelectorAll&&function(){var a=k,b=G.createElement("div"),c="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,d,e,f){d=d||G;if(!f&&!k.isXML(d)){var g=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(g&&(d.nodeType===1||d.nodeType===9)){if(g[1])return p(d.getElementsByTagName(b),e);if(g[2]&&l.find.CLASS&&d.getElementsByClassName)return p(d.getElementsByClassName(g[2]),e)}if(d.nodeType===9){if(b==="body"&&d.body)return p([d.body],e);if(g&&g[3]){var h=d.getElementById(g[3]);if(!h||!h.parentNode)return p([],e);if(h.id===g[3])return p([h],e)}try{return p(d.querySelectorAll(b),e)}catch(i){}}else if(d.nodeType===1&&d.nodeName.toLowerCase()!=="object"){var j=d,m=d.getAttribute("id"),n=m||c,o=d.parentNode,q=/^\s*[+~]/.test(b);m?n=n.replace(/'/g,"\\$&"):d.setAttribute("id",n),q&&o&&(d=d.parentNode);try{if(!q||o)return p(d.querySelectorAll("[id='"+n+"'] "+b),e)}catch(r){}finally{m||j.removeAttribute("id")}}}return a(b,d,e,f)};for(var d in a)k[d]=a[d];b=null}}(),function(){var a=G.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var c=!b.call(G.createElement("div"),"div"),d=!1;try{b.call(G.documentElement,"[test!='']:sizzle")}catch(e){d=!0}k.matchesSelector=function(a,e){e=e.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(d||!l.match.PSEUDO.test(e)&&!/!=/.test(e)){var f=b.call(a,e);if(f||!c||a.document&&a.document.nodeType!==11)return f}}catch(g){}return k(e,null,null,[a]).length>0}}}(),function(){var a=G.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),G.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:G.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var t=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g0)for(g=f;g0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,f=this[0];if(J.isArray(a)){var g,h,i={},j=1;if(f&&a.length){for(d=0,e=a.length;d-1:J(f).is(g))&&c.push({selector:h,elem:f,level:j});f=f.parentNode,j++}}return c}var k=bo.test(a)||typeof a!="string"?J(a,b||this.context):0;for(d=0,e=this.length;d-1:J.find.matchesSelector(f,a)){c.push(f);break}f=f.parentNode;if(!f||!f.ownerDocument||f===b||f.nodeType===11)break}}c=c.length>1?J.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){return!a||typeof a=="string"?J.inArray(this[0],a?J(a):this.parent().children()):J.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?J(a,b):J.makeArray(a&&a.nodeType?[a]:a),d=J.merge(this.get(),c);return this.pushStack(x(c[0])||x(d[0])?d:J.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),J.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return J.dir(a,"parentNode")},parentsUntil:function(a,b,c){return J.dir(a,"parentNode",c)},next:function(a){return J.nth(a,2,"nextSibling")},prev:function(a){return J.nth(a,2,"previousSibling")},nextAll:function(a){return J.dir(a,"nextSibling")},prevAll:function(a){return J.dir(a,"previousSibling")},nextUntil:function(a,b,c){return J.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return J.dir(a,"previousSibling",c)},siblings:function(a){return J.sibling(a.parentNode.firstChild,a)},children:function(a){return J.sibling(a.firstChild)},contents:function(a){return J.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:J.makeArray(a.childNodes)}},function(a,b){J.fn[a]=function(c,d){var e=J.map(this,b,c),f=bn.call(arguments);bj.test(a)||(d=c),d&&typeof d=="string"&&(e=J.filter(d,e)),e=this.length>1&&!bp[a]?J.unique(e):e,(this.length>1||bl.test(d))&&bk.test(a)&&(e=e.reverse());return this.pushStack(e,a,f.join(","))}}),J.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?J.find.matchesSelector(b[0],a)?[b[0]]:[]:J.find.matches(a,b)},dir:function(a,c,d){var e=[],f=a[c];while(f&&f.nodeType!==9&&(d===b||f.nodeType!==1||!J(f).is(d)))f.nodeType===1&&e.push(f),f=f[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var bq=/ jQuery\d+="(?:\d+|null)"/g,br=/^\s+/,bs=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,bt=/<([\w:]+)/,bu=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]};bA.optgroup=bA.option,bA.tbody=bA.tfoot=bA.colgroup=bA.caption=bA.thead,bA.th=bA.td,J.support.htmlSerialize||(bA._default=[1,"div
","
"]),J.fn.extend({text:function(a){return J.isFunction(a)?this.each(function(b){var c=J(this);c.text(a.call(this,b,c.text()))}):typeof a!="object"&&a!==b?this.empty().append((this[0]&&this[0].ownerDocument||G).createTextNode(a)):J.text(this)},wrapAll:function(a){if(J.isFunction(a))return this.each(function(b){J(this).wrapAll(a.call(this,b))});if(this[0]){var b=J(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return J.isFunction(a)?this.each(function(b){J(this).wrapInner(a.call(this,b))}):this.each(function(){var b=J(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){J(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){J.nodeName(this,"body")||J(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=J(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,J(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||J.filter(a,[d]).length)!b&&d.nodeType===1&&(J.cleanData(d.getElementsByTagName("*")),J.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&J.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return J.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(bq,""):null;if(typeof a=="string"&&!bw.test(a)&&(J.support.leadingWhitespace||!br.test(a))&&!bA[(bt.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(bs,"<$1>");try{for(var c=0,d=this.length;c1&&k0?this.clone(!0):this).get();J(e[g])[b](i),d=d.concat(i)}return this.pushStack(d,a,e.selector)}}),J.extend({clone:function(a,b,c){var d=a.cloneNode(!0),e,f,g;if((!J.support.noCloneEvent||!J.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!J.isXMLDoc(a)){t(a,d),e=s(a),f=s(d);for(g=0;e[g];++g)t(e[g],f[g])}if(b){u(a,d);if(c){e=s(a),f=s(d);for(g=0;e[g];++g)u(e[g],f[g])}}return d},clean:function(a,b,c,d){var e;b=b||G,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||G);var f=[],g;for(var h=0,i;(i=a[h])!=null;h++){typeof i=="number"&&(i+="");if(!i)continue;if(typeof i=="string")if(!bv.test(i))i=b.createTextNode(i);else{i=i.replace(bs,"<$1>");var j=(bt.exec(i)||["",""])[1].toLowerCase(),k=bA[j]||bA._default,l=k[0],m=b.createElement("div");m.innerHTML=k[1]+i+k[2];while(l--)m=m.lastChild;if(!J.support.tbody){var n=bu.test(i),o=j==="table"&&!n?m.firstChild&&m.firstChild.childNodes:k[1]===""&&!n?m.childNodes:[];for(g=o.length-1;g>=0;--g)J.nodeName(o[g],"tbody")&&!o[g].childNodes.length&&o[g].parentNode.removeChild(o[g])}!J.support.leadingWhitespace&&br.test(i)&&m.insertBefore(b.createTextNode(br.exec(i)[0]),m.firstChild),i=m.childNodes}var p;if(!J.support.appendChecked)if(i[0]&&typeof (p=i.length)=="number")for(g=0;g=0)return b+"px"}}}),J.support.opacity||(J.cssHooks.opacity={get:function(a,b){return bC.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle;c.zoom=1;var e=J.isNaN(b)?"":"alpha(opacity="+b*100+")",f=d&&d.filter||c.filter||"";c.filter=bB.test(f)?f.replace(bB,e):f+" "+e}}),J(function(){J.support.reliableMarginRight||(J.cssHooks.marginRight={get:function(a,b){var c;J.swap(a,{display:"inline-block"},function(){b?c=bM(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),G.defaultView&&G.defaultView.getComputedStyle&&(bN=function(a,c){var d,e,f;c=c.replace(bE,"-$1").toLowerCase();if(!(e=a.ownerDocument.defaultView))return b;if(f=e.getComputedStyle(a,null))d=f.getPropertyValue(c),d===""&&!J.contains(a.ownerDocument.documentElement,a)&&(d=J.style(a,c));return d}),G.documentElement.currentStyle&&(bO=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bF.test(d)&&bG.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bM=bN||bO,J.expr&&J.expr.filters&&(J.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!J.support.reliableHiddenOffsets&&(a.style.display||J.css(a,"display"))==="none"},J.expr.filters.visible=function(a){return!J.expr.filters.hidden(a)});var bQ=/%20/g,bR=/\[\]$/,bS=/\r?\n/g,bT=/#.*$/,bU=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bV=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bW=/^(?:about|app|app\-storage|.+\-extension|file|widget):$/,bX=/^(?:GET|HEAD)$/,bY=/^\/\//,bZ=/\?/,b$=/)<[^<]*)*<\/script>/gi,b_=/^(?:select|textarea)/i,ca=/\s+/,cb=/([?&])_=[^&]*/,cc=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,cd=J.fn.load,ce={},cf={},cg,ch;try{cg=I.href}catch(ci){cg=G.createElement("a"),cg.href="",cg=cg.href}ch=cc.exec(cg.toLowerCase())||[],J.fn.extend({load:function(a,c,d){if(typeof a!="string"&&cd)return cd.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var f=a.slice(e,a.length);a=a.slice(0,e)}var g="GET";c&&(J.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=J.param(c,J.ajaxSettings.traditional),g="POST"));var h=this;J.ajax({url:a,type:g,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),h.html(f?J("
").append(c.replace(b$,"")).find(f):c)),d&&h.each(d,[c,b,a])}});return this},serialize:function(){return J.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?J.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||b_.test(this.nodeName)||bV.test(this.type))}).map(function(a,b){var c=J(this).val();return c==null?null:J.isArray(c)?J.map(c,function(a,c){return{name:b.name,value:a.replace(bS,"\r\n")}}):{name:b.name,value:c.replace(bS,"\r\n")}}).get()}}),J.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){J.fn[b]=function(a){return this.bind(b,a)}}),J.each(["get","post"],function(a,c){J[c]=function(a,d,e,f){J.isFunction(d)&&(f=f||e,e=d,d=b);return J.ajax({type:c,url:a,data:d,success:e,dataType:f})}}),J.extend({getScript:function(a,c){return J.get(a,b,c,"script")},getJSON:function(a,b,c){return J.get(a,b,c,"json")},ajaxSetup:function(a,b){b?J.extend(!0,a,J.ajaxSettings,b):(b=a,a=J.extend(!0,J.ajaxSettings,b));for(var c in{context:1,url:1})c in b?a[c]=b[c]:c in J.ajaxSettings&&(a[c]=J.ajaxSettings[c]);return a},ajaxSettings:{url:cg,isLocal:bW.test(ch[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":J.parseJSON,"text xml":J.parseXML}},ajaxPrefilter:n(ce),ajaxTransport:n(cf),ajax:function(a,c){function d(a,c,d,m){if(v!==2){v=2,t&&clearTimeout(t),s=b,q=m||"",y.readyState=a?4:0;var o,p,r,u=d?k(e,y,d):b,x,z;if(a>=200&&a<300||a===304){if(e.ifModified){if(x=y.getResponseHeader("Last-Modified"))J.lastModified[n]=x;if(z=y.getResponseHeader("Etag"))J.etag[n]=z}if(a===304)c="notmodified",o=!0;else try{p=j(e,u),c="success",o=!0}catch(A){c="parsererror",r=A}}else{r=c;if(!c||a)c="error",a<0&&(a=0)}y.status=a,y.statusText=c,o?h.resolveWith(f,[p,c,y]):h.rejectWith(f,[y,c,r]),y.statusCode(l),l=b,w&&g.trigger("ajax"+(o?"Success":"Error"),[y,e,o?p:r]),i.resolveWith(f,[y,c]),w&&(g.trigger("ajaxComplete",[y,e]),--J.active||J.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var e=J.ajaxSetup({},c),f=e.context||e,g=f!==e&&(f.nodeType||f instanceof J)?J(f):J.event,h=J.Deferred(),i=J._Deferred(),l=e.statusCode||{},n,o={},p={},q,r,s,t,u,v=0,w,x,y={readyState:0,setRequestHeader:function(a,b){if(!v){var c=a.toLowerCase();a=p[c]=p[c]||a,o[a]=b}return this},getAllResponseHeaders:function(){return v===2?q:null},getResponseHeader:function(a){var c;if(v===2){if(!r){r={};while(c=bU.exec(q))r[c[1].toLowerCase()]=c[2]}c=r[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){v||(e.mimeType=a);return this},abort:function(a){a=a||"abort",s&&s.abort(a),d(0,a);return this}};h.promise(y),y.success=y.done,y.error=y.fail,y.complete=i.done,y.statusCode=function(a){if(a){var b;if(v<2)for(b in a)l[b]=[l[b],a[b]];else b=a[y.status],y.then(b,b)}return this},e.url=((a||e.url)+"").replace(bT,"").replace(bY,ch[1]+"//"),e.dataTypes=J.trim(e.dataType||"*").toLowerCase().split(ca),e.crossDomain==null&&(u=cc.exec(e.url.toLowerCase()),e.crossDomain=! +(!u||u[1]==ch[1]&&u[2]==ch[2]&&(u[3]||(u[1]==="http:"?80:443))==(ch[3]||(ch[1]==="http:"?80:443)))),e.data&&e.processData&&typeof e.data!="string"&&(e.data=J.param(e.data,e.traditional)),m(ce,e,c,y);if(v===2)return!1;w=e.global,e.type=e.type.toUpperCase(),e.hasContent=!bX.test(e.type),w&&J.active++===0&&J.event.trigger("ajaxStart");if(!e.hasContent){e.data&&(e.url+=(bZ.test(e.url)?"&":"?")+e.data),n=e.url;if(e.cache===!1){var z=J.now(),A=e.url.replace(cb,"$1_="+z);e.url=A+(A===e.url?(bZ.test(e.url)?"&":"?")+"_="+z:"")}}(e.data&&e.hasContent&&e.contentType!==!1||c.contentType)&&y.setRequestHeader("Content-Type",e.contentType),e.ifModified&&(n=n||e.url,J.lastModified[n]&&y.setRequestHeader("If-Modified-Since",J.lastModified[n]),J.etag[n]&&y.setRequestHeader("If-None-Match",J.etag[n])),y.setRequestHeader("Accept",e.dataTypes[0]&&e.accepts[e.dataTypes[0]]?e.accepts[e.dataTypes[0]]+(e.dataTypes[0]!=="*"?", */*; q=0.01":""):e.accepts["*"]);for(x in e.headers)y.setRequestHeader(x,e.headers[x]);if(!e.beforeSend||e.beforeSend.call(f,y,e)!==!1&&v!==2){for(x in{success:1,error:1,complete:1})y[x](e[x]);s=m(cf,e,c,y);if(!s)d(-1,"No Transport");else{y.readyState=1,w&&g.trigger("ajaxSend",[y,e]),e.async&&e.timeout>0&&(t=setTimeout(function(){y.abort("timeout")},e.timeout));try{v=1,s.send(o,d)}catch(B){status<2?d(-1,B):J.error(B)}}return y}y.abort();return!1},param:function(a,c){var d=[],e=function(a,b){b=J.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=J.ajaxSettings.traditional);if(J.isArray(a)||a.jquery&&!J.isPlainObject(a))J.each(a,function(){e(this.name,this.value)});else for(var f in a)l(f,a[f],c,e);return d.join("&").replace(bQ,"+")}}),J.extend({active:0,lastModified:{},etag:{}});var cj=J.now(),ck=/(\=)\?(&|$)|\?\?/i;J.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return J.expando+"_"+cj++}}),J.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ck.test(b.url)||e&&ck.test(b.data))){var f,g=b.jsonpCallback=J.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h=a[g],i=b.url,j=b.data,k="$1"+g+"$2";b.jsonp!==!1&&(i=i.replace(ck,k),b.url===i&&(e&&(j=j.replace(ck,k)),b.data===j&&(i+=(/\?/.test(i)?"&":"?")+b.jsonp+"="+g))),b.url=i,b.data=j,a[g]=function(a){f=[a]},d.always(function(){a[g]=h,f&&J.isFunction(h)&&a[g](f[0])}),b.converters["script json"]=function(){f||J.error(g+" was not called");return f[0]},b.dataTypes[0]="json";return"script"}}),J.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){J.globalEval(a);return a}}}),J.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),J.ajaxTransport("script",function(a){if(a.crossDomain){var c,d=G.head||G.getElementsByTagName("head")[0]||G.documentElement;return{send:function(e,f){c=G.createElement("script"),c.async="async",a.scriptCharset&&(c.charset=a.scriptCharset),c.src=a.url,c.onload=c.onreadystatechange=function(a,e){if(e||!c.readyState||/loaded|complete/.test(c.readyState))c.onload=c.onreadystatechange=null,d&&c.parentNode&&d.removeChild(c),c=b,e||f(200,"success")},d.insertBefore(c,d.firstChild)},abort:function(){c&&c.onload(0,1)}}}});var cl=a.ActiveXObject?function(){for(var a in cn)cn[a](0,1)}:!1,cm=0,cn;J.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&i()||h()}:i,function(a){J.extend(J.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(J.ajaxSettings.xhr()),J.support.ajax&&J.ajaxTransport(function(c){if(!c.crossDomain||J.support.cors){var d;return{send:function(e,f){var g=c.xhr(),h,i;c.username?g.open(c.type,c.url,c.async,c.username,c.password):g.open(c.type,c.url,c.async);if(c.xhrFields)for(i in c.xhrFields)g[i]=c.xhrFields[i];c.mimeType&&g.overrideMimeType&&g.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(i in e)g.setRequestHeader(i,e[i])}catch(j){}g.send(c.hasContent&&c.data||null),d=function(a,e){var i,j,k,l,m;try{if(d&&(e||g.readyState===4)){d=b,h&&(g.onreadystatechange=J.noop,cl&&delete cn[h]);if(e)g.readyState!==4&&g.abort();else{i=g.status,k=g.getAllResponseHeaders(),l={},m=g.responseXML,m&&m.documentElement&&(l.xml=m),l.text=g.responseText;try{j=g.statusText}catch(n){j=""}!i&&c.isLocal&&!c.crossDomain?i=l.text?200:404:i===1223&&(i=204)}}}catch(o){e||f(-1,o)}l&&f(i,j,l,k)},!c.async||g.readyState===4?d():(h=++cm,cl&&(cn||(cn={},J(a).unload(cl)),cn[h]=d),g.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var co={},cp,cq,cr=/^(?:toggle|show|hide)$/,cs=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,ct,cu=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cv,cw=a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame;J.fn.extend({show:function(a,b,c){var f,g;if(a||a===0)return this.animate(e("show",3),a,b,c);for(var h=0,i=this.length;h=e.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),e.animatedProperties[this.prop]=!0;for(f in e.animatedProperties)e.animatedProperties[f]!==!0&&(c=!1);if(c){e.overflow!=null&&!J.support.shrinkWrapBlocks&&J.each(["","X","Y"],function(a,b){d.style["overflow"+b]=e.overflow[a]}),e.hide&&J(d).hide();if(e.hide||e.show)for(var i in e.animatedProperties)J.style(d,i,e.orig[i]);e.complete.call(d)}return!1}e.duration==Infinity?this.now=b:(h=b-this.startTime,this.state=h/e.duration,this.pos=J.easing[e.animatedProperties[this.prop]](this.state,h,0,1,e.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},J.extend(J.fx,{tick:function(){for(var a=J.timers,b=0;b
";J.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=h,a.insertBefore(b,a.firstChild),c=b.firstChild,d=c.firstChild,f=c.nextSibling.firstChild.firstChild,this.doesNotAddBorder=d.offsetTop!==5,this.doesAddBorderForTableAndCells=f.offsetTop===5,d.style.position="fixed",d.style.top="20px",this.supportsFixedPosition=d.offsetTop===20||d.offsetTop===15,d.style.position=d.style.top="",c.style.overflow="hidden",c.style.position="relative",this.subtractsBorderForOverflowNotVisible=d.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==g,a.removeChild(b),J.offset.initialize=J.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;J.offset.initialize(),J.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(J.css(a,"marginTop"))||0,c+=parseFloat(J.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=J.css(a,"position");d==="static"&&(a.style.position="relative");var e=J(a),f=e.offset(),g=J.css(a,"top"),h=J.css(a,"left"),i=(d==="absolute"||d==="fixed")&&J.inArray("auto",[g,h])>-1,j={},k={},l,m;i?(k=e.position(),l=k.top,m=k.left):(l=parseFloat(g)||0,m=parseFloat(h)||0),J.isFunction(b)&&(b=b.call(a,c,f)),b.top!=null&&(j.top=b.top-f.top+l),b.left!=null&&(j.left=b.left-f.left+m),"using"in b?b.using.call(a,j):e.css(j)}},J.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cy.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(J.css(a,"marginTop"))||0,c.left-=parseFloat(J.css(a,"marginLeft"))||0,d.top+=parseFloat(J.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(J.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||G.body;while(a&&!cy.test(a.nodeName)&&J.css(a,"position")==="static")a=a.offsetParent;return a})}}),J.each(["Left","Top"],function(a,d){var e="scroll"+d;J.fn[e]=function(d){var f,g;if(d===b){f=this[0];if(!f)return null;g=c(f);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:J.support.boxModel&&g.document.documentElement[e]||g.document.body[e]:f[e]}return this.each(function(){g=c(this),g?g.scrollTo(a?J(g).scrollLeft():d,a?d:J(g).scrollTop()):this[e]=d})}}),J.each(["Height","Width"],function(a,c){var d=c.toLowerCase();J.fn["inner"+c]=function(){return this[0]?parseFloat(J.css(this[0],d,"padding")):null},J.fn["outer"+c]=function(a){return this[0]?parseFloat(J.css(this[0],d,a?"margin":"border")):null},J.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(J.isFunction(a))return this.each(function(b){var c=J(this);c[d](a.call(this,b,c[d]()))});if(J.isWindow(e)){var f=e.document.documentElement["client"+c];return e.document.compatMode==="CSS1Compat"&&f||e.document.body["client"+c]||f}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var g=J.css(e,d),h=parseFloat(g);return J.isNaN(h)?g:h}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=J}(window),function(a,b){function d(b){return!a(b).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}function c(b,c){var e=b.nodeName.toLowerCase();if("area"===e){c=b.parentNode,e=c.name;if(!b.href||!e||c.nodeName.toLowerCase()!=="map")return!1;b=a("img[usemap=#"+e+"]")[0];return!!b&&d(b)}return(/input|select|textarea|button|object/.test(e)?!b.disabled:"a"==e?b.href||c:c)&&d(b)}a.ui=a.ui||{},a.ui.version||(a.extend(a.ui,{version:"1.8.14",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}}),a.fn.extend({_focus:a.fn.focus,focus:function(b,c){return typeof b=="number"?this.each(function(){var d=this;setTimeout(function(){a(d).focus(),c&&c.call(d)},b)}):this._focus.apply(this,arguments)},scrollParent:function(){var b;b=a.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(a.curCSS(this,"position",1))&&/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!b.length?a(document):b},zIndex:function(c){if(c!==b)return this.css("zIndex",c);if(this.length){c=a(this[0]);for(var d;c.length&&c[0]!==document;){d=c.css("position");if(d==="absolute"||d==="relative"||d==="fixed"){d=parseInt(c.css("zIndex"),10);if(!isNaN(d)&&d!==0)return d}c=c.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),a.each(["Width","Height"],function(c,d){function e(b,c,d,e){a.each(f,function(){c-=parseFloat(a.curCSS(b,"padding"+this,!0))||0,d&&(c-=parseFloat(a.curCSS(b,"border"+this+"Width",!0))||0),e&&(c-=parseFloat(a.curCSS(b,"margin"+this,!0))||0)});return c}var f=d==="Width"?["Left","Right"]:["Top","Bottom"],g=d.toLowerCase(),h={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};a.fn["inner"+d]=function(c){return c===b?h["inner"+d].call(this):this.each(function(){a(this).css(g,e(this,c)+"px")})},a.fn["outer"+d]=function(b,c){return typeof b!="number"?h["outer"+d].call(this,b):this.each(function(){a(this).css(g,e(this,b,!0,c)+"px")})}}),a.extend(a.expr[":"],{data:function(b,c,d){return!!a.data(b,d[3])},focusable:function(b){return c(b,!isNaN(a.attr(b,"tabindex")))},tabbable:function(b){var d=a.attr(b,"tabindex"),e=isNaN(d);return(e||d>=0)&&c(b,!e)}}),a(function(){var b=document.body,c=b.appendChild(c=document.createElement("div"));a.extend(c.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),a.support.minHeight=c.offsetHeight===100,a.support.selectstart="onselectstart"in c,b.removeChild(c).style.display="none"}),a.extend(a.ui,{plugin:{add:function(b,c,d){b=a.ui[b].prototype;for(var e in d)b.plugins[e]=b.plugins[e]||[],b.plugins[e].push([c,d[e]])},call:function(a,b,c){if((b=a.plugins[b])&&a.element[0].parentNode)for(var d=0;d0)return!0;b[c]=1,d=b[c]>0,b[c]=0;return d},isOverAxis:function(a,b,c){return a>b&&a=9||!!b.button){if(this._mouseStarted){this._mouseDrag(b);return b.preventDefault()}this._mouseDistanceMet(b)&&this._mouseDelayMet(b)&&((this._mouseStarted=this._mouseStart(this._mouseDownEvent,b)!==!1)?this._mouseDrag(b):this._mouseUp(b));return!this._mouseStarted}return this._mouseUp(b)},_mouseUp:function(b){a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,b.target==this._mouseDownEvent.target&&a.data(b.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(b));return!1},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})}(jQuery),function(a){a.widget("ui.draggable",a.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1},_create:function(){this.options.helper=="original"&&!/^(?:r|a|f)/.test(this.element.css("position"))&&(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy();return this}},_mouseCapture:function(b){var c=this.options;if(this.helper||c.disabled||a(b.target).is(".ui-resizable-handle"))return!1;this.handle=this._getHandle(b);if(!this.handle)return!1;a(c.iframeFix===!0?"iframe":c.iframeFix).each(function(){a('
').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(a(this).offset()).appendTo("body")});return!0},_mouseStart:function(b){var c=this.options;this.helper=this._createHelper(b),this._cacheHelperProportions(),a.ui.ddmanager&&(a.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(b),this.originalPageX=b.pageX,this.originalPageY=b.pageY,c.cursorAt&&this._adjustOffsetFromHelper(c.cursorAt),c.containment&&this._setContainment();if(this._trigger("start",b)===!1){this._clear();return!1}this._cacheHelperProportions(),a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this.helper.addClass("ui-draggable-dragging"),this._mouseDrag(b,!0),a.ui.ddmanager&&a.ui.ddmanager.dragStart(this,b);return!0},_mouseDrag:function(b,c){this.position=this._generatePosition(b),this.positionAbs=this._convertPositionTo("absolute");if(!c){c=this._uiHash();if(this._trigger("drag",b,c)===!1){this._mouseUp({});return!1}this.position=c.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";a.ui.ddmanager&&a.ui.ddmanager.drag(this,b);return!1},_mouseStop:function(b){var c=!1;a.ui.ddmanager&&!this.options.dropBehaviour&&(c=a.ui.ddmanager.drop(this,b)),this.dropped&&(c=this.dropped,this.dropped=!1);if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return!1;if(this.options.revert=="invalid"&&!c||this.options.revert=="valid"&&c||this.options.revert===!0||a.isFunction(this.options.revert)&&this.options.revert.call(this.element,c)){var e=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){e._trigger("stop",b)!==!1&&e._clear()})}else this._trigger("stop",b)!==!1&&this._clear();return!1},_mouseUp:function(b){this.options.iframeFix===!0&&a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),a.ui.ddmanager&&a.ui.ddmanager.dragStop(this,b);return a.ui.mouse.prototype._mouseUp.call(this,b)},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(b){var c=!this.options.handle||!a(this.options.handle,this.element).length?!0:!1;a(this.options.handle,this.element).find("*").andSelf().each(function(){this==b.target&&(c=!0)});return c},_createHelper:function(b){var c=this.options;b=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b])):c.helper=="clone"?this.element.clone().removeAttr("id"):this.element,b.parents("body").length||b.appendTo(c.appendTo=="parent"?this.element[0].parentNode:c.appendTo),b[0]!=this.element[0]&&!/(fixed|absolute)/.test(b.css("position"))&&b.css("position","absolute");return b},_adjustOffsetFromHelper:function(b){typeof b=="string"&&(b=b.split(" ")),a.isArray(b)&&(b={left:+b[0],top:+b[1]||0}),"left"in b&&(this.offset.click.left=b.left+this.margins.left),"right"in b&&(this.offset.click.left=this.helperProportions.width-b.right+this.margins.left),"top"in b&&(this.offset.click.top=b.top+this.margins.top),"bottom"in b&&(this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])&&(b.left+=this.scrollParent.scrollLeft(),b.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)b={top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b=this.options;b.containment=="parent"&&(b.containment=this.helper[0].parentNode);if(b.containment=="document"||b.containment=="window")this.containment=[b.containment=="document"?0:a(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,b.containment=="document"?0:a(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,(b.containment=="document"?0:a(window).scrollLeft())+a(b.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(b.containment=="document"?0:a(window).scrollTop())+(a(b.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/ +.test(b.containment)&&b.containment.constructor!=Array){b=a(b.containment);var c=b[0];if(c){b.offset();var e=a(c).css("overflow")!="hidden";this.containment=[(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0),(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0),(e?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(e?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=b}}else b.containment.constructor==Array&&(this.containment=b.containment)},_convertPositionTo:function(b,c){c||(c=this.position),b=b=="absolute"?1:-1;var e=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(e[0].tagName);return{top:c.top+this.offset.relative.top*b+this.offset.parent.top*b-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:e.scrollTop())*b),left:c.left+this.offset.relative.left*b+this.offset.parent.left*b-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:e.scrollLeft())*b)}},_generatePosition:function(b){var c=this.options,e=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(e[0].tagName),g=b.pageX,h=b.pageY;if(this.originalPosition){var i;this.containment&&(this.relative_container?(i=this.relative_container.offset(),i=[this.containment[0]+i.left,this.containment[1]+i.top,this.containment[2]+i.left,this.containment[3]+i.top]):i=this.containment,b.pageX-this.offset.click.lefti[2]&&(g=i[2]+this.offset.click.left),b.pageY-this.offset.click.top>i[3]&&(h=i[3]+this.offset.click.top)),c.grid&&(h=c.grid[1]?this.originalPageY+Math.round((h-this.originalPageY)/c.grid[1])*c.grid[1]:this.originalPageY,h=i?h-this.offset.click.topi[3]?h-this.offset.click.topi[2]?g-this.offset.click.left=0;l--){var m=e.snapElements[l].left,n=m+e.snapElements[l].width,o=e.snapElements[l].top,p=o+e.snapElements[l].height;if(m-g0&&(a=a[0]);if(a.error)return couch.errors[a.error]},couch.request=function(c){var d=a.extend({},b,c),e=a.Deferred();a.ajax(d).then(function(a){var b=couch.responseError(a);b&&app.emitter.emit(b,"error"),e.resolve(a)},function(a){app.emitter.emit("Fatal XHR Error","error")});return e.promise()},couch.get=function(a){return couch.request({url:a,type:"GET"})},couch.login=function(a){return couch.request({url:"/_session",type:"POST",data:JSON.stringify({name:a.username,password:a.password})})},couch.logout=function(){return couch.request({url:"/_session",type:"DELETE"})},couch.session=function(){return couch.request({url:"/_session"})},couch.db=function(c,d){d||(d="");return{name:c,uri:d+"/"+encodeURIComponent(c)+"/",get:function(a){return couch.request({url:this.uri+a,type:"GET"})},put:function(a,b){return couch.request({url:this.uri+a,type:"PUT",data:b})},designDocs:function(c){return couch.request(a.extend(b,{url:this.uri+"_all_docs",data:{startkey:'"_design/"',endkey:'"_design0"',include_docs:!0}}))}}}}(jQuery),function(a){function b(b){if(typeof b.data=="string"){var c=b.handler,d=b.data.toLowerCase().split(" ");b.handler=function(b){if(this===b.target||!/textarea|select/i.test(b.target.nodeName)&&b.target.type!=="text"){var e=b.type!=="keypress"&&a.hotkeys.specialKeys[b.which],f=String.fromCharCode(b.which).toLowerCase(),g,h="",i={};b.altKey&&e!=="alt"&&(h+="alt+"),b.ctrlKey&&e!=="ctrl"&&(h+="ctrl+"),b.metaKey&&!b.ctrlKey&&e!=="meta"&&(h+="meta+"),b.shiftKey&&e!=="shift"&&(h+="shift+"),e?i[h+e]=!0:(i[h+f]=!0,i[h+a.hotkeys.shiftNums[f]]=!0,h==="shift+"&&(i[a.hotkeys.shiftNums[f]]=!0));for(var j=0,k=d.length;j","/":"?","\\":"|"}},a.each(["keydown","keyup","keypress"],function(){a.event.special[this]={add:b}})}(jQuery),function(a){var b=function(){var a=function(){};a.prototype={otag:"{{",ctag:"}}",pragmas:{},buffer:[],pragmas_implemented:{"IMPLICIT-ITERATOR":!0},context:{},render:function(a,b,c,d){d||(this.context=b,this.buffer=[]);if(!this.includes("",a)){if(d)return a;this.send(a)}else{a=this.render_pragmas(a);var e=this.render_section(a,b,c);if(d)return this.render_tags(e,b,c,d);this.render_tags(e,b,c,d)}},send:function(a){a!=""&&this.buffer.push(a)},render_pragmas:function(a){if(!this.includes("%",a))return a;var b=this,c=new RegExp(this.otag+"%([\\w-]+) ?([\\w]+=[\\w]+)?"+this.ctag);return a.replace(c,function(a,c,d){if(!b.pragmas_implemented[c])throw{message:"This implementation of mustache doesn't understand the '"+c+"' pragma"};b.pragmas[c]={};if(d){var e=d.split("=");b.pragmas[c][e[0]]=e[1]}return""})},render_partial:function(a,b,c){a=this.trim(a);if(!c||c[a]===undefined)throw{message:"unknown_partial '"+a+"'"};return typeof b[a]!="object"?this.render(c[a],b,c,!0):this.render(c[a],b[a],c,!0)},render_section:function(a,b,c){if(!this.includes("#",a)&&!this.includes("^",a))return a;var d=this,e=new RegExp(this.otag+"(\\^|\\#)\\s*(.+)\\s*"+this.ctag+"\n*([\\s\\S]+?)"+this.otag+"\\/\\s*\\2\\s*"+this.ctag+"\\s*","mg");return a.replace(e,function(a,e,f,g){var h=d.find(f,b);if(e=="^")return!h||d.is_array(h)&&h.length===0?d.render(g,b,c,!0):"";if(e=="#")return d.is_array(h)?d.map(h,function(a){return d.render(g,d.create_context(a),c,!0)}).join(""):d.is_object(h)?d.render(g,d.create_context(h),c,!0):typeof h=="function"?h.call(b,g,function(a){return d.render(a,b,c,!0)}):h?d.render(g,b,c,!0):""})},render_tags:function(a,b,c,d){var e=this,f=function(){return new RegExp(e.otag+"(=|!|>|\\{|%)?([^\\/#\\^]+?)\\1?"+e.ctag+"+","g")},g=f(),h=function(a,d,h){switch(d){case"!":return"";case"=":e.set_delimiters(h),g=f();return"";case">":return e.render_partial(h,b,c);case"{":return e.find(h,b);default:return e.escape(e.find(h,b))}},i=a.split("\n");for(var j=0;j\\]/g,function(a){switch(a){case"&":return"&";case"\\":return"\\\\";case'"':return'"';case"<":return"<";case">":return">";default:return a}})},create_context:function(a){if(this.is_object(a))return a;var b=".";this.pragmas["IMPLICIT-ITERATOR"]&&(b=this.pragmas["IMPLICIT-ITERATOR"].iterator);var c={};c[b]=a;return c},is_object:function(a){return a&&typeof a=="object"},is_array:function(a){return Object.prototype.toString.call(a)==="[object Array]"},trim:function(a){return a.replace(/^\s*|\s*$/g,"")},map:function(a,b){if(typeof a.map=="function")return a.map(b);var c=[],d=a.length;for(var e=0;e/g,">").replace(/"/g,""")},m=function(a){return function(b,c){return this.route.apply(this,[a,b,c])}},n={},o=[];c=function(){var b=g(arguments),d,e;c.apps=c.apps||{};if(b.length===0||b[0]&&h(b[0]))return c.apply(c,["body"].concat(b));if(typeof (e=b.shift())=="string"){d=c.apps[e]||new c.Application,d.element_selector=e,b.length>0&&a.each(b,function(a,b){d.use(b)}),d.element_selector!=e&&delete c.apps[e],c.apps[d.element_selector]=d;return d}},c.VERSION="0.6.3",c.addLogger=function(a){o.push(a)},c.log=function(){var b=g(arguments);b.unshift("["+Date()+"]"),a.each(o,function(a,d){d.apply(c,b)})},typeof b.console!="undefined"?h(b.console.log.apply)?c.addLogger(function(){b.console.log.apply(b.console,arguments)}):c.addLogger(function(){b.console.log(arguments)}):typeof console!="undefined"&&c.addLogger(function(){console.log.apply(console,arguments)}),a.extend(c,{makeArray:g,isFunction:h,isArray:i}),c.Object=function(b){return a.extend(this,b||{})},a.extend(c.Object.prototype,{escapeHTML:l,h:l,toHash:function(){var b={};a.each(this,function(a,c){h(c)||(b[a]=c)});return b},toHTML:function(){var b="";a.each(this,function(a,c){h(c)||(b+=""+a+" "+c+"
")});return b},keys:function(a){var b=[];for(var c in this)(!h(this[c])||!a)&&b.push(c);return b},has:function(b){return this[b]&&a.trim(this[b].toString())!=""},join:function(){var a=g(arguments),b=a.shift();return a.join(b)},log:function(){c.log.apply(c,arguments)},toString:function(b){var c=[];a.each(this,function(a,d){(!h(d)||b)&&c.push('"'+a+'": '+d.toString())});return"Sammy.Object: {"+c.join(",")+"}"}}),c.HashLocationProxy=function(a,b){this.app=a,this.is_native=!1,this._startPolling(b)},c.HashLocationProxy.prototype={bind:function(){var d=this,e=this.app;a(b).bind("hashchange."+this.app.eventNamespace(),function(a,f){d.is_native===!1&&!f&&(c.log("native hash change exists, using"),d.is_native=!0,b.clearInterval(c.HashLocationProxy._interval)),e.trigger("location-changed")}),c.HashLocationProxy._bindings||(c.HashLocationProxy._bindings=0),c.HashLocationProxy._bindings++},unbind:function(){a(b).unbind("hashchange."+this.app.eventNamespace()),c.HashLocationProxy._bindings--,c.HashLocationProxy._bindings<=0&&b.clearInterval(c.HashLocationProxy._interval)},getLocation:function(){var a=b.location.toString().match(/^[^#]*(#.+)$/);return a?a[1]:""},setLocation:function(a){return b.location=a},_startPolling:function(d){var e=this;if(!c.HashLocationProxy._interval){d||(d=10);var f=function(){var d=e.getLocation();(!c.HashLocationProxy._last_location||d!=c.HashLocationProxy._last_location)&&b.setTimeout(function(){a(b).trigger("hashchange",[!0])},13),c.HashLocationProxy._last_location=d};f(),c.HashLocationProxy._interval=b.setInterval(f,d)}}},c.Application=function(a){var b=this;this.routes={},this.listeners=new c.Object({}),this.arounds=[],this.befores=[],this.namespace=(new Date).getTime()+"-"+parseInt(Math.random()*1e3,10),this.context_prototype=function(){c.EventContext.apply(this,arguments)},this.context_prototype.prototype=new c.EventContext,h(a)&&a.apply(this,[this]),this._location_proxy||this.setLocationProxy(new c.HashLocationProxy(this,this.run_interval_every)),this.debug&&this.bindToAllEvents(function(a,c){b.log(b.toString(),a.cleaned_type,c||{})})},c.Application.prototype=a.extend({},c.Object.prototype,{ROUTE_VERBS:["get","post","put","delete"],APP_EVENTS:["run","unload","lookup-route","run-route","route-found","event-context-before","event-context-after","changed","error","check-form-submission","redirect","location-changed"],_last_route:null,_location_proxy:null,_running:!1,element_selector:"body",debug:!1,raise_errors:!1,run_interval_every:50,template_engine:null,toString:function(){return"Sammy.Application:"+this.element_selector},$element:function(b){return b?a(this.element_selector).find(b):a(this.element_selector)},use:function(){var a=g(arguments),b=a.shift(),d=b||"";try{a.unshift(this),typeof b=="string"&&(d="Sammy."+b,b=c[b]),b.apply(this,a)}catch(e){typeof b=="undefined"?this.error("Plugin Error: called use() but plugin ("+d.toString()+") is not defined",e):h(b)?this.error("Plugin Error",e):this.error("Plugin Error: called use() but '"+d.toString()+"' is not a function",e)}return this},setLocationProxy:function(a){var b=this._location_proxy;this._location_proxy=a,this.isRunning()&&(b&&b.unbind(),this._location_proxy.bind())},route:function(b,c,f){var g=this,i=[],j,k;!f&&h(c)&&(c=b,f=c,b="any"),b=b.toLowerCase();if(c.constructor==String){e.lastIndex=0;while((k=e.exec(c))!==null)i.push(k[1]);c=new RegExp("^"+c.replace(e,d)+"$")}typeof f=="string"&&(f=g[f]),j=function(a){var b={verb:a,path:c,callback:f,param_names:i};g.routes[a]=g.routes[a]||[],g.routes[a].push(b)},b==="any"?a.each(this.ROUTE_VERBS,function(a,b){j(b)}):j(b);return this},get:m("get"),post:m("post"),put:m("put"),del:m("delete"),any:m("any"),mapRoutes:function(b){var c=this;a.each(b,function(a,b){c.route.apply(c,b)});return this},eventNamespace:function(){return["sammy-app",this.namespace].join("-")},bind:function(a,b,c){var d=this;typeof c=="undefined"&&(c=b);var e=function(){var a,b,e;a=arguments[0],e=arguments[1],e&&e.context?(b=e.context,delete e.context):b=new d.context_prototype(d,"bind",a.type,e,a.target),a.cleaned_type=a.type.replace(d.eventNamespace(),""),c.apply(b,[a,e])};this.listeners[a]||(this.listeners[a]=[]),this.listeners[a].push(e),this.isRunning()&&this._listen(a,e);return this},trigger:function(a,b){this.$element().trigger([a,this.eventNamespace()].join("."),[b]);return this},refresh:function(){this.last_location=null,this.trigger("location-changed");return this},before:function(a,b){h(a)&&(b=a,a={}),this.befores.push([a,b]);return this},after:function(a){return this.bind("event-context-after",a)},around:function(a){this.arounds.push(a);return this},isRunning:function(){return this._running},helpers:function(b){a.extend(this.context_prototype.prototype,b);return this},helper:function(a,b){this.context_prototype.prototype[a]=b;return this},run:function(c){if(this.isRunning())return!1;var d=this;a.each(this.listeners.toHash(),function(b,c){a.each(c,function(a,c){d._listen(b,c)})}),this.trigger("run",{start_url:c}),this._running=!0,this.last_location=null,this.getLocation()==""&&typeof c!="undefined"&&this.setLocation(c),this._checkLocation(),this._location_proxy.bind(),this.bind("location-changed",function(){d._checkLocation()}),this.bind("submit",function(b){var c=d._checkFormSubmission(a(b.target).closest("form"));return c===!1?b.preventDefault():!1}),a(b).bind("beforeunload",function(){d.unload()});return this.trigger("changed")},unload:function(){if(!this.isRunning())return!1;var b=this;this.trigger("unload"),this._location_proxy.unbind(),this.$element().unbind("submit").removeClass(b.eventNamespace()),a.each(this.listeners.toHash(),function(c,d){a.each(d,function(a,d){b._unlisten(c,d)})}),this._running=!1;return this},bindToAllEvents:function(b){var c=this;a.each(this.APP_EVENTS,function(a,d){c.bind(d,b)}),a.each(this.listeners.keys(!0),function(a,d){c.APP_EVENTS.indexOf(d)==-1&&c.bind(d,b)});return this},routablePath:function(a){return a.replace(f,"")},lookupRoute:function(b,c){var d=this,e=!1;this.trigger("lookup-route",{verb:b,path:c}),typeof this.routes[b]!="undefined"&&a.each(this.routes[b],function(a,b){if(d.routablePath(c).match(b.path)){e=b;return!1}});return e},runRoute:function(b,c,d,e){var f=this,g=this.lookupRoute(b,c),h,i,k,l,m,n,o,p,q;this.log("runRoute",[b,c].join(" ")),this.trigger("run-route",{verb:b,path:c,params:d}),typeof d=="undefined"&&(d={}),a.extend(d,this._parseQueryString(c));if(g){this.trigger("route-found",{route:g}),(p=g.path.exec(this.routablePath(c)))!==null&&(p.shift(),a.each(p,function(a,b){g.param_names[a]?d[g.param_names[a]]=j(b):(d.splat||(d.splat=[]),d.splat.push(j(b)))})),h=new this.context_prototype(this,b,c,d,e),k=this.arounds.slice(0),m=this.befores.slice(0),o=[h].concat(d.splat),i=function(){var a;while(m.length>0){n=m.shift();if(f.contextMatchesOptions(h,n[0])){a=n[1].apply(h,[h]);if(a===!1)return!1}}f.last_route=g,h.trigger("event-context-before",{context:h}),a=g.callback.apply(h,o),h.trigger("event-context-after",{context:h});return a},a.each(k.reverse(),function(a,b){var c=i;i=function(){return b.apply(h,[c])}});try{q=i()}catch(r){this.error(["500 Error",b,c].join(" "),r)}return q}return this.notFound(b,c)},contextMatchesOptions:function(a,b,c){var d=b;if(typeof d=="undefined"||d=={})return!0;typeof c=="undefined"&&(c=!0);if(typeof d=="string"||h(d.test))d={path:d};if(d.only)return this.contextMatchesOptions(a,d.only,!0);if(d.except)return this.contextMatchesOptions(a,d.except,!1);var e=!0,f=!0;d.path&&(h(d.path.test)?e=d.path.test(a.path):e=d.path.toString()===a.path),d.verb&&(f=d.verb===a.verb);return c?f&&e:!f||!e},getLocation:function(){return this._location_proxy.getLocation()},setLocation:function(a){return this._location_proxy.setLocation(a)},swap:function(a){return this.$element().html(a)},templateCache:function(a,b){return typeof b!="undefined"?n[a]=b:n[a]},clearTemplateCache:function(){return n={}},notFound:function(a,b){var c=this.error(["404 Not Found",a,b].join(" "));return a==="get"?c:!0},error:function(a,b){b||(b=new Error),b.message=[a,b.message].join(" "),this.trigger("error",{message:b.message,error:b});if(this.raise_errors)throw b;this.log(b.message,b)},_checkLocation:function(){var a,b;a=this.getLocation();if(!this.last_location||this.last_location[0]!="get"||this.last_location[1]!=a)this.last_location=["get",a],b=this.runRoute("get",a);return b},_getFormVerb:function(b){var c=a(b),d,e;e=c.find('input[name="_method"]'),e.length>0&&(d=e.val()),d||(d=c[0].getAttribute("method"));if(!d||d=="")d="get";return a.trim(d.toString().toLowerCase())},_checkFormSubmission:function(b){var c,d,e,f,g;this.trigger("check-form-submission",{form:b}),c=a(b),d=c.attr("action"),e=this._getFormVerb(c),this.log("_checkFormSubmission",c,d,e),e==="get"?(this.setLocation(d+"?"+this._serializeFormParams(c)),g=!1):(f=a.extend({},this._parseFormParams(c)),g=this.runRoute(e,d,f,b.get(0)));return typeof g=="undefined"?!1:g},_serializeFormParams:function(a){var b="",c=a.serializeArray(),d;if(c.length>0){b=this._encodeFormPair(c[0].name,c[0].value);for(d=1;d0&&this.then(this.callbacks.shift())},load:function(b,c,d){var e=this;return this.then(function(){var f,g,i,j;h(c)?(d=c,c={}):c=a.extend({},c),d&&this.then(d);if(typeof b=="string"){i=b.match(/\.json$/)||c.json,f=i&&c.cache===!0||c.cache!==!1,e.next_engine=e.event_context.engineFor(b),delete c.cache,delete c.json,c.engine&&(e.next_engine=c.engine,delete c.engine);if(f&&(g=this.event_context.app.templateCache(b)))return g;this.wait(),a.ajax(a.extend({url:b,data:{},dataType:i?"json":null,type:"get",success:function(a){f&&e.event_context.app.templateCache(b,a),e.next(a)}},c));return!1}if(b.nodeType)return b.innerHTML;if(b.selector){e.next_engine=b.attr("data-engine");return c.clone===!1?b.remove()[0].innerHTML.toString():b[0].innerHTML.toString()}})},render:function(a,b,c){if(h(a)&&!b)return this.then(a);!b&&this.content&&(b=this.content);return this.load(a).interpolate(b,a).then(c)},partial:function(a,b){return this.render(a,b).swap()},send:function(){var a=this,b=g(arguments),c=b.shift();i(b[0])&&(b=b[0]);return this.then(function(d){b.push(function(b){a.next(b)}),a.wait(),c.apply(c,b);return!1})},collect:function(b,c,d){var e=this,f=function(){h(b)&&(c=b,b=this.content);var d=[],f=!1;a.each(b,function(a,b){var g=c.apply(e,[a,b]);g.jquery&&g.length==1&&(g=g[0],f=!0),d.push(g);return g});return f?d:d.join("")};return d?f():this.then(f)},renderEach:function(b,c,d,e){i(c)&&(e=d,d=c,c=null);return this.load(b).then(function(f){var g=this;d||(d=i(this.previous_content)?this.previous_content:[]);if(e)a.each(d,function(a,d){var h={},i=this.next_engine||b;c?h[c]=d:h=d,e(d,g.event_context.interpolate(f,h,i))});else return this.collect(d,function(a,d){var e={},g=this.next_engine||b;c?e[c]=d:e=d;return this.event_context.interpolate(f,e,g)},!0)})},interpolate:function(a,b,c){var d=this;return this.then(function(e,f){!a&&f&&(a=f),this.next_engine&&(b=this.next_engine,this.next_engine=!1);var g=d.event_context.interpolate(e,a,b);return c?f+g:g})},swap:function(){return this.then(function(a){this.event_context.swap(a)}).trigger("changed",{})},appendTo:function(b){return this.then(function(c){a(b).append(c)}).trigger("changed",{})},prependTo:function(b){return this.then(function(c){a(b).prepend(c)}).trigger("changed",{})},replace:function(b){return this.then(function(c){a(b +).html(c)}).trigger("changed",{})},trigger:function(a,b){return this.then(function(c){typeof b=="undefined"&&(b={content:c}),this.event_context.trigger(a,b)})}}),c.EventContext=function(a,b,d,e,f){this.app=a,this.verb=b,this.path=d,this.params=new c.Object(e),this.target=f},c.EventContext.prototype=a.extend({},c.Object.prototype,{$element:function(){return this.app.$element(g(arguments).shift())},engineFor:function(a){var b=this,c;if(h(a))return a;a=(a||b.app.template_engine).toString();if(c=a.match(/\.([^\.]+)$/))a=c[1];return a&&h(b[a])?b[a]:b.app.template_engine?this.engineFor(b.app.template_engine):function(a,b){return a}},interpolate:function(a,b,c){return this.engineFor(c).apply(this,[a,b])},render:function(a,b,d){return(new c.RenderContext(this)).render(a,b,d)},renderEach:function(a,b,d,e){return(new c.RenderContext(this)).renderEach(a,b,d,e)},load:function(a,b,d){return(new c.RenderContext(this)).load(a,b,d)},partial:function(a,b){return(new c.RenderContext(this)).partial(a,b)},send:function(){var a=new c.RenderContext(this);return a.send.apply(a,arguments)},redirect:function(){var a,b=g(arguments),c=this.app.getLocation();b.length>1?(b.unshift("/"),a=this.join.apply(this,b)):a=b[0],this.trigger("redirect",{to:a}),this.app.last_location=[this.verb,this.path],this.app.setLocation(a),c==a&&this.app.trigger("location-changed")},trigger:function(a,b){typeof b=="undefined"&&(b={}),b.context||(b.context=this);return this.app.trigger(a,b)},eventNamespace:function(){return this.app.eventNamespace()},swap:function(a){return this.app.swap(a)},notFound:function(){return this.app.notFound(this.verb,this.path)},json:function(b){return a.parseJSON(b)},toString:function(){return"Sammy.EventContext: "+[this.verb,this.path,this.params].join(" ")}}),a.sammy=b.Sammy=c}(jQuery,window);var require=function(a,b){var c=require.resolve(a,b||"/"),d=require.modules[c];if(!d)throw new Error("Failed to resolve module "+a+", tried "+c);var e=d._cached?d._cached:d();return e},__require=require;require.paths=[],require.modules={},require.extensions=[".js",".coffee"],require.resolve=function(){var a={assert:!0,events:!0,fs:!0,path:!0,vm:!0};return function(b,c){function k(a){var b;a==="/"?b=[""]:b=d.normalize(a).split("/");var c=[];for(var e=b.length-1;e>=0;e--){if(b[e]==="node_modules")continue;var f=b.slice(0,e+1).join("/")+"/node_modules";c.push(f)}return c}function j(a,b){var c=k(b);for(var d=0;d=0;d--){var e=a[d];e=="."?a.splice(d,1):e===".."?(a.splice(d,1),c++):c&&(a.splice(d,1),c--)}if(b)for(;c--;c)a.unshift("..");return a}var c=/^(.+\/(?!$)|\/)?((?:.+?)?(\.[^.]*)?)$/;b.resolve=function(){var b="",c=!1;for(var d=arguments.length;d>=-1&&!c;d--){var e=d>=0?arguments[d]:process.cwd();if(typeof e!="string"||!e)continue;b=e+"/"+b,c=e.charAt(0)==="/"}b=a(b.split("/").filter(function(a){return!!a}),!c).join("/");return(c?"/":"")+b||"."},b.normalize=function(b){var c=b.charAt(0)==="/",d=b.slice(-1)==="/";b=a(b.split("/").filter(function(a){return!!a}),!c).join("/"),!b&&!c&&(b="."),b&&d&&(b+="/");return(c?"/":"")+b},b.join=function(){var a=Array.prototype.slice.call(arguments,0);return b.normalize(a.filter(function(a,b){return a&&typeof a=="string"}).join("/"))},b.dirname=function(a){var b=c.exec(a)[1]||"",d=!1;return b?b.length===1||d&&b.length<=3&&b.charAt(1)===":"?b:b.substring(0,b.length-1):"."},b.basename=function(a,b){var d=c.exec(a)[2]||"";b&&d.substr(-1*b.length)===b&&(d=d.substr(0,d.length-b.length));return d},b.extname=function(a){return c.exec(a)[3]||""}}.call(a.exports),__require.modules.path._cached=a.exports;return a.exports},require.modules["/node_modules/traverse/package.json"]=function(){var a={exports:{}},b=a.exports,c="/node_modules/traverse",d="/node_modules/traverse/package.json",e=function(a){return __require(a,"/node_modules/traverse")};e.resolve=function(a){return __require.resolve(name,"/node_modules/traverse")},e.modules=__require.modules,__require.modules["/node_modules/traverse/package.json"]._cached=a.exports,function(){a.exports={name:"traverse",version:"0.4.4",description:"Traverse and transform objects by visiting every node on a recursive walk",author:"James Halliday",license:"MIT/X11",main:"./index",repository:{type:"git",url:"http://github.com/substack/js-traverse.git"},devDependencies:{expresso:"0.7.x"},scripts:{test:"expresso"}}}.call(a.exports),__require.modules["/node_modules/traverse/package.json"]._cached=a.exports;return a.exports},require.modules["/node_modules/traverse/index.js"]=function(){var a={exports:{}},b=a.exports,c="/node_modules/traverse",d="/node_modules/traverse/index.js",e=function(a){return __require(a,"/node_modules/traverse")};e.resolve=function(a){return __require.resolve(name,"/node_modules/traverse")},e.modules=__require.modules,__require.modules["/node_modules/traverse/index.js"]._cached=a.exports,function(){function d(a){if(typeof a=="object"&&a!==null){var b;Array.isArray(a)?b=[]:a instanceof Date?b=new Date(a):a instanceof Boolean?b=new Boolean(a):a instanceof Number?b=new Number(a):a instanceof String?b=new String(a):b=Object.create(Object.getPrototypeOf(a)),Object.keys(a).forEach(function(c){b[c]=a[c]});return b}return a}function c(a,b,c){var e=[],f=[],g=!0;return function h(a){var i=c?d(a):a,j={},k=!0,l={node:i,node_:a,path:[].concat(e),parent:f[f.length-1],key:e.slice(-1)[0],isRoot:e.length===0,level:e.length,circular:null,update:function(a,b){l.isRoot||(l.parent.node[l.key]=a),l.node=a,b&&(k=!1)},"delete":function(){delete l.parent.node[l.key]},remove:function(){Array.isArray(l.parent.node)?l.parent.node.splice(l.key,1):delete l.parent.node[l.key]},before:function(a){j.before=a},after:function(a){j.after=a},pre:function(a){j.pre=a},post:function(a){j.post=a},stop:function(){g=!1},block:function(){k=!1}};if(!g)return l;if(typeof i=="object"&&i!==null){l.isLeaf=Object.keys(i).length==0;for(var m=0;m