)<[^<]*)*<\/script>/gi,Gb=/^(?:select|textarea)/i,sa=/\s+/,Hb=/([?&])_=[^&]*/,Pa=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,Qa=b.fn.load,ha={},Ra={},W,X,Sa=["*/"]+["*"];try{W=ca.href}catch(Nb){W=s.createElement("a"),W.href=
"",W=W.href}X=Pa.exec(W.toLowerCase())||[];b.fn.extend({load:function(a,c,d){if("string"!==typeof a&&Qa)return Qa.apply(this,arguments);if(!this.length)return this;var g=a.indexOf(" ");if(0<=g)var e=a.slice(g,a.length),a=a.slice(0,g);g="GET";c&&(b.isFunction(c)?(d=c,c=j):"object"===typeof c&&(c=b.param(c,b.ajaxSettings.traditional),g="POST"));var k=this;b.ajax({url:a,type:g,dataType:"html",data:c,complete:function(a,c,g){g=a.responseText;a.isResolved()&&(a.done(function(a){g=a}),k.html(e?b("").append(g.replace(Fb,
"")).find(e):g));d&&k.each(d,[g,c,a])}});return this},serialize:function(){return b.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?b.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||Gb.test(this.nodeName)||Cb.test(this.type))}).map(function(a,c){var d=b(this).val();return null==d?null:b.isArray(d)?b.map(d,function(a){return{name:c.name,value:a.replace(Na,"\r\n")}}):{name:c.name,value:d.replace(Na,
"\r\n")}}).get()}});b.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,c){b.fn[c]=function(a){return this.on(c,a)}});b.each(["get","post"],function(a,c){b[c]=function(a,d,g,e){b.isFunction(d)&&(e=e||g,g=d,d=j);return b.ajax({type:c,url:a,data:d,success:g,dataType:e})}});b.extend({getScript:function(a,c){return b.get(a,j,c,"script")},getJSON:function(a,c,d){return b.get(a,c,d,"json")},ajaxSetup:function(a,c){c?V(a,b.ajaxSettings):(c=a,a=b.ajaxSettings);V(a,
c);return a},ajaxSettings:{url:W,isLocal:/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/.test(X[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","*":Sa},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":i.String,"text html":!0,"text json":b.parseJSON,
"text xml":b.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:v(ha),ajaxTransport:v(Ra),ajax:function(a,c){function d(a,c,f,o){if(2!==t){t=2;s&&clearTimeout(s);p=j;q=o||"";A.readyState=0
a||304===a){if(g.ifModified){if(B=A.getResponseHeader("Last-Modified"))b.lastModified[w]=B;if(B=A.getResponseHeader("Etag"))b.etag[w]=B}if(304===a)o="notmodified",x=!0;else try{B=g;B.dataFilter&&(f=B.dataFilter(f,B.dataType));var D=B.dataTypes;u={};var F,J,M=D.length,Q,K=D[0],O,ja,G,H,L;for(F=1;Fa&&(a=0);A.status=a;A.statusText=""+(c||o);x?l.resolveWith(e,[E,o,A]):l.rejectWith(e,[A,o,C]);A.statusCode(i);i=j;N&&k.trigger("ajax"+
(x?"Success":"Error"),[A,g,x?E:C]);m.fireWith(e,[A,o]);N&&(k.trigger("ajaxComplete",[A,g]),--b.active||b.event.trigger("ajaxStop"))}}"object"===typeof a&&(c=a,a=j);var c=c||{},g=b.ajaxSetup({},c),e=g.context||g,k=e!==g&&(e.nodeType||e instanceof b)?b(e):b.event,l=b.Deferred(),m=b.Callbacks("once memory"),i=g.statusCode||{},w,o={},x={},q,E,p,s,C,t=0,N,v,A={readyState:0,setRequestHeader:function(a,c){if(!t){var b=a.toLowerCase(),a=x[b]=x[b]||a;o[a]=c}return this},getAllResponseHeaders:function(){return 2===
t?q:null},getResponseHeader:function(a){var c;if(2===t){if(!E)for(E={};c=Bb.exec(q);)E[c[1].toLowerCase()]=c[2];c=E[a.toLowerCase()]}return c===j?null:c},overrideMimeType:function(a){if(!t)g.mimeType=a;return this},abort:function(a){a=a||"abort";p&&p.abort(a);d(0,a);return this}};l.promise(A);A.success=A.done;A.error=A.fail;A.complete=m.add;A.statusCode=function(a){if(a){var c;if(2>t)for(c in a)i[c]=[i[c],a[c]];else c=a[A.status],A.then(c,c)}return this};g.url=((a||g.url)+"").replace(Ab,"").replace(Eb,
X[1]+"//");g.dataTypes=b.trim(g.dataType||"*").toLowerCase().split(sa);if(null==g.crossDomain)C=Pa.exec(g.url.toLowerCase()),g.crossDomain=!(!C||!(C[1]!=X[1]||C[2]!=X[2]||(C[3]||("http:"===C[1]?80:443))!=(X[3]||("http:"===X[1]?80:443))));if(g.data&&g.processData&&"string"!==typeof g.data)g.data=b.param(g.data,g.traditional);H(ha,g,c,A);if(2===t)return!1;N=g.global;g.type=g.type.toUpperCase();g.hasContent=!Db.test(g.type);N&&0===b.active++&&b.event.trigger("ajaxStart");if(!g.hasContent&&(g.data&&(g.url+=
(Oa.test(g.url)?"&":"?")+g.data,delete g.data),w=g.url,!1===g.cache)){C=b.now();var I=g.url.replace(Hb,"$1_="+C);g.url=I+(I===g.url?(Oa.test(g.url)?"&":"?")+"_="+C:"")}(g.data&&g.hasContent&&!1!==g.contentType||c.contentType)&&A.setRequestHeader("Content-Type",g.contentType);g.ifModified&&(w=w||g.url,b.lastModified[w]&&A.setRequestHeader("If-Modified-Since",b.lastModified[w]),b.etag[w]&&A.setRequestHeader("If-None-Match",b.etag[w]));A.setRequestHeader("Accept",g.dataTypes[0]&&g.accepts[g.dataTypes[0]]?
g.accepts[g.dataTypes[0]]+("*"!==g.dataTypes[0]?", "+Sa+"; q=0.01":""):g.accepts["*"]);for(v in g.headers)A.setRequestHeader(v,g.headers[v]);if(g.beforeSend&&(!1===g.beforeSend.call(e,A,g)||2===t))return A.abort(),!1;for(v in{success:1,error:1,complete:1})A[v](g[v]);if(p=H(Ra,g,c,A)){A.readyState=1;N&&k.trigger("ajaxSend",[A,g]);g.async&&0t)d(-1,z);else throw z;}}else d(-1,"No Transport");return A},
param:function(a,c){var d=[],g=function(a,c){c=b.isFunction(c)?c():c;d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(c)};if(c===j)c=b.ajaxSettings.traditional;if(b.isArray(a)||a.jquery&&!b.isPlainObject(a))b.each(a,function(){g(this.name,this.value)});else for(var k in a)e(k,a[k],c,g);return d.join("&").replace(zb,"+")}});b.extend({active:0,lastModified:{},etag:{}});var Ib=b.now(),fa=/(\=)\?(&|$)|\?\?/i;b.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return b.expando+"_"+Ib++}});b.ajaxPrefilter("json jsonp",
function(a,c,d){c="application/x-www-form-urlencoded"===a.contentType&&"string"===typeof a.data;if("jsonp"===a.dataTypes[0]||!1!==a.jsonp&&(fa.test(a.url)||c&&fa.test(a.data))){var g,e=a.jsonpCallback=b.isFunction(a.jsonpCallback)?a.jsonpCallback():a.jsonpCallback,k=i[e],l=a.url,m=a.data,j="$1"+e+"$2";!1!==a.jsonp&&(l=l.replace(fa,j),a.url===l&&(c&&(m=m.replace(fa,j)),a.data===m&&(l+=(/\?/.test(l)?"&":"?")+a.jsonp+"="+e)));a.url=l;a.data=m;i[e]=function(a){g=[a]};d.always(function(){i[e]=k;if(g&&
b.isFunction(k))i[e](g[0])});a.converters["script json"]=function(){g||b.error(e+" was not called");return g[0]};a.dataTypes[0]="json";return"script"}});b.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){b.globalEval(a);return a}}});b.ajaxPrefilter("script",function(a){if(a.cache===j)a.cache=!1;if(a.crossDomain)a.type="GET",a.global=!1});b.ajaxTransport("script",
function(a){if(a.crossDomain){var c,b=s.head||s.getElementsByTagName("head")[0]||s.documentElement;return{send:function(d,g){c=s.createElement("script");c.async="async";if(a.scriptCharset)c.charset=a.scriptCharset;c.src=a.url;c.onload=c.onreadystatechange=function(a,d){if(d||!c.readyState||/loaded|complete/.test(c.readyState))c.onload=c.onreadystatechange=null,b&&c.parentNode&&b.removeChild(c),c=j,d||g(200,"success")};b.insertBefore(c,b.firstChild)},abort:function(){if(c)c.onload(0,1)}}}});var pa=
i.ActiveXObject?function(){for(var a in ba)ba[a](0,1)}:!1,Jb=0,ba;b.ajaxSettings.xhr=i.ActiveXObject?function(){var a;if(!(a=!this.isLocal&&d()))a:{try{a=new i.ActiveXObject("Microsoft.XMLHTTP");break a}catch(c){}a=void 0}return a}:d;(function(a){b.extend(b.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})})(b.ajaxSettings.xhr());b.support.ajax&&b.ajaxTransport(function(a){if(!a.crossDomain||b.support.cors){var c;return{send:function(d,g){var e=a.xhr(),k,l;a.username?e.open(a.type,a.url,a.async,
a.username,a.password):e.open(a.type,a.url,a.async);if(a.xhrFields)for(l in a.xhrFields)e[l]=a.xhrFields[l];a.mimeType&&e.overrideMimeType&&e.overrideMimeType(a.mimeType);!a.crossDomain&&!d["X-Requested-With"]&&(d["X-Requested-With"]="XMLHttpRequest");try{for(l in d)e.setRequestHeader(l,d[l])}catch(m){}e.send(a.hasContent&&a.data||null);c=function(d,f){var l,m,i,w,o;try{if(c&&(f||4===e.readyState)){c=j;if(k)e.onreadystatechange=b.noop,pa&&delete ba[k];if(f)4!==e.readyState&&e.abort();else{l=e.status;
i=e.getAllResponseHeaders();w={};if((o=e.responseXML)&&o.documentElement)w.xml=o;w.text=e.responseText;try{m=e.statusText}catch(x){m=""}!l&&a.isLocal&&!a.crossDomain?l=w.text?200:404:1223===l&&(l=204)}}}catch(E){f||g(-1,E)}w&&g(l,m,w,i)};!a.async||4===e.readyState?c():(k=++Jb,pa&&(ba||(ba={},b(i).unload(pa)),ba[k]=c),e.onreadystatechange=c)},abort:function(){c&&c(0,1)}}}});var ia={},S,Z,Kb=/^(?:toggle|show|hide)$/,Lb=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,ga,ta=[["height","marginTop","marginBottom","paddingTop",
"paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],ea;b.fn.extend({show:function(a,c,d){if(a||0===a)return this.animate(o("show",3),a,c,d);for(var d=0,g=this.length;d=k.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();k.animatedProperties[this.prop]=!0;for(c in k.animatedProperties)!0!==k.animatedProperties[c]&&(g=!1);if(g){null!=k.overflow&&!b.support.shrinkWrapBlocks&&b.each(["","X","Y"],function(a,c){e.style["overflow"+c]=k.overflow[a]});k.hide&&
b(e).hide();if(k.hide||k.show)for(c in k.animatedProperties)b.style(e,c,k.orig[c]),b.removeData(e,"fxshow"+c,!0),b.removeData(e,"toggle"+c,!0);if(a=k.complete)k.complete=!1,a.call(e)}return!1}Infinity==k.duration?this.now=d:(a=d-this.startTime,this.state=a/k.duration,this.pos=b.easing[k.animatedProperties[this.prop]](this.state,a,0,1,k.duration),this.now=this.start+(this.end-this.start)*this.pos);this.update();return!0}};b.extend(b.fx,{tick:function(){for(var a,c=b.timers,d=0;d=i.computed&&(i={value:b,computed:d})});return i.value};d.min=function(b,e,l){if(!e&&d.isArray(b))return Math.min.apply(Math,b);if(!e&&d.isEmpty(b))return Infinity;var i={computed:Infinity};m(b,function(b,d,g){d=e?e.call(l,b,d,g):b;de?1:0}),"value")};d.groupBy=function(b,e){var l={},i=d.isFunction(e)?e:function(b){return b[e]};m(b,function(b,d){var e=i(b,d);(l[e]||(l[e]=[])).push(b)});return l};d.sortedIndex=function(b,e,l){l||(l=d.identity);for(var m=0,i=b.length;m<
i;){var j=m+i>>1;l(b[j])=arguments.length&&(d=b||0,b=0);for(var e=arguments[2]||1,m=Math.max(Math.ceil((d-b)/e),0),i=0,j=Array(m);i=b?d():function(){if(1>--b)return d.apply(this,arguments)}};
d.keys=V||function(b){if(b!==Object(b))throw new TypeError("Invalid object");var e=[],m;for(m in b)d.has(b,m)&&(e[e.length]=m);return e};d.values=function(b){return d.map(b,d.identity)};d.functions=d.methods=function(b){var e=[],m;for(m in b)d.isFunction(b[m])&&e.push(m);return e.sort()};d.extend=function(b){m(t.call(arguments,1),function(d){for(var e in d)b[e]=d[e]});return b};d.defaults=function(b){m(t.call(arguments,1),function(d){for(var e in d)null==b[e]&&(b[e]=d[e])});return b};d.clone=function(b){return!d.isObject(b)?
b:d.isArray(b)?b.slice():d.extend({},b)};d.tap=function(b,d){d(b);return b};d.isEqual=function(b,d){return i(b,d,[])};d.isEmpty=function(b){if(d.isArray(b)||d.isString(b))return 0===b.length;for(var e in b)if(d.has(b,e))return!1;return!0};d.isElement=function(b){return!!(b&&1==b.nodeType)};d.isArray=q||function(b){return"[object Array]"==y.call(b)};d.isObject=function(b){return b===Object(b)};d.isArguments=function(b){return"[object Arguments]"==y.call(b)};if(!d.isArguments(arguments))d.isArguments=
function(b){return!(!b||!d.has(b,"callee"))};d.isFunction=function(b){return"[object Function]"==y.call(b)};d.isString=function(b){return"[object String]"==y.call(b)};d.isNumber=function(b){return"[object Number]"==y.call(b)};d.isNaN=function(b){return b!==b};d.isBoolean=function(b){return!0===b||!1===b||"[object Boolean]"==y.call(b)};d.isDate=function(b){return"[object Date]"==y.call(b)};d.isRegExp=function(b){return"[object RegExp]"==y.call(b)};d.isNull=function(b){return null===b};d.isUndefined=
function(b){return void 0===b};d.has=function(b,d){return I.call(b,d)};d.noConflict=function(){j._=z;return this};d.identity=function(b){return b};d.times=function(b,d,e){for(var m=0;m/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")};d.mixin=function(e){m(d.functions(e),function(m){b(m,d[m]=e[m])})};var N=0;d.uniqueId=function(b){var d=N++;return b?b+d:d};d.templateSettings=
{evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var Q=/.^/,s=function(b){return b.replace(/\\\\/g,"\\").replace(/\\'/g,"'")};d.template=function(b,e){var m=d.templateSettings,m="var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('"+b.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(m.escape||Q,function(b,d){return"',_.escape("+s(d)+"),'"}).replace(m.interpolate||Q,function(b,d){return"',"+s(d)+",'"}).replace(m.evaluate||Q,function(b,
d){return"');"+s(d).replace(/[\r\n\t]/g," ")+";__p.push('"}).replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t")+"');}return __p.join('');",i=new Function("obj","_",m);return e?i(e,d):function(b){return i.call(this,b,d)}};d.chain=function(b){return d(b).chain()};var O=function(b){this._wrapped=b};d.prototype=O.prototype;var ca=function(b,e){return e?d(b).chain():b},b=function(b,e){O.prototype[b]=function(){var b=t.call(arguments);M.call(b,this._wrapped);return ca(e.apply(d,b),this._chain)}};
d.mixin(d);m("pop,push,reverse,shift,sort,splice,unshift".split(","),function(b){var d=p[b];O.prototype[b]=function(){var e=this._wrapped;d.apply(e,arguments);var m=e.length;("shift"==b||"splice"==b)&&0===m&&delete e[0];return ca(e,this._chain)}});m(["concat","join","slice"],function(b){var d=p[b];O.prototype[b]=function(){return ca(d.apply(this._wrapped,arguments),this._chain)}});O.prototype.chain=function(){this._chain=!0;return this};O.prototype.value=function(){return this._wrapped}}).call(this);var JSON;JSON||(JSON={});
(function(){function i(i){return 10>i?"0"+i:i}function j(i){p.lastIndex=0;return p.test(i)?'"'+i.replace(p,function(i){var j=M[i];return"string"===typeof j?j:"\\u"+("0000"+i.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+i+'"'}function z(i,p){var u,B,J,G,K=q,F,v=p[i];v&&"object"===typeof v&&"function"===typeof v.toJSON&&(v=v.toJSON(i));"function"===typeof y&&(v=y.call(p,i,v));switch(typeof v){case "string":return j(v);case "number":return isFinite(v)?""+v:"null";case "boolean":case "null":return""+v;
case "object":if(!v)return"null";q+=t;F=[];if("[object Array]"===Object.prototype.toString.apply(v)){G=v.length;for(u=0;u<%= name %> '),
galleryView:_.template('')};(function(){var i=this,j=i.Backbone,z=Array.prototype.slice,u=Array.prototype.splice,p;p="undefined"!==typeof exports?exports:i.Backbone={};p.VERSION="0.9.1";var q=i._;!q&&"undefined"!==typeof require&&(q=require("underscore"));var t=i.jQuery||i.Zepto||i.ender;p.setDomLibrary=function(e){t=e};p.noConflict=function(){i.Backbone=j;return this};p.emulateHTTP=!1;p.emulateJSON=!1;p.Events={on:function(e,d,m){for(var i,e=e.split(/\s+/),j=this._callbacks||(this._callbacks={});i=e.shift();){i=j[i]||(j[i]=
{});var p=i.tail||(i.tail=i.next={});p.callback=d;p.context=m;i.tail=p.next={}}return this},off:function(e,d,m){var i,j,p;if(e){if(j=this._callbacks)for(e=e.split(/\s+/);i=e.shift();)if(p=j[i],delete j[i],d&&p)for(;(p=p.next)&&p.next;)if(!(p.callback===d&&(!m||p.context===m)))this.on(i,p.callback,p.context)}else delete this._callbacks;return this},trigger:function(e){var d,m,i,j;if(!(i=this._callbacks))return this;j=i.all;for((e=e.split(/\s+/)).push(null);d=e.shift();)j&&e.push({next:j.next,tail:j.tail,
event:d}),(m=i[d])&&e.push({next:m.next,tail:m.tail});for(j=z.call(arguments,1);m=e.pop();){d=m.tail;for(i=m.event?[m.event].concat(j):j;(m=m.next)!==d;)m.callback.apply(m.context||this,i)}return this}};p.Events.bind=p.Events.on;p.Events.unbind=p.Events.off;p.Model=function(e,d){var m;e||(e={});d&&d.parse&&(e=this.parse(e));if(m=H(this,"defaults"))e=q.extend({},m,e);if(d&&d.collection)this.collection=d.collection;this.attributes={};this._escapedAttributes={};this.cid=q.uniqueId("c");if(!this.set(e,
{silent:!0}))throw Error("Can't create an invalid model");delete this._changed;this._previousAttributes=q.clone(this.attributes);this.initialize.apply(this,arguments)};q.extend(p.Model.prototype,p.Events,{idAttribute:"id",initialize:function(){},toJSON:function(){return q.clone(this.attributes)},get:function(e){return this.attributes[e]},escape:function(e){var d;if(d=this._escapedAttributes[e])return d;d=this.attributes[e];return this._escapedAttributes[e]=q.escape(null==d?"":""+d)},has:function(e){return null!=
this.attributes[e]},set:function(e,d,m){var i,j;q.isObject(e)||null==e?(i=e,m=d):(i={},i[e]=d);m||(m={});if(!i)return this;if(i instanceof p.Model)i=i.attributes;if(m.unset)for(j in i)i[j]=void 0;if(!this._validate(i,m))return!1;if(this.idAttribute in i)this.id=i[this.idAttribute];var d=this.attributes,t=this._escapedAttributes,u=this._previousAttributes||{},s=this._setting;this._changed||(this._changed={});this._setting=!0;for(j in i){e=i[j];q.isEqual(d[j],e)||delete t[j];m.unset?delete d[j]:d[j]=
e;if(this._changing&&!q.isEqual(this._changed[j],e))this.trigger("change:"+j,this,e,m),this._moreChanges=!0;delete this._changed[j];if(!q.isEqual(u[j],e)||q.has(d,j)!=q.has(u,j))this._changed[j]=e}if(!s)!m.silent&&this.hasChanged()&&this.change(m),this._setting=!1;return this},unset:function(e,d){(d||(d={})).unset=!0;return this.set(e,null,d)},clear:function(e){(e||(e={})).unset=!0;return this.set(q.clone(this.attributes),e)},fetch:function(e){var e=e?q.clone(e):{},d=this,m=e.success;e.success=function(i,
j,p){if(!d.set(d.parse(i,p),e))return!1;m&&m(d,i)};e.error=p.wrapError(e.error,d,e);return(this.sync||p.sync).call(this,"read",this,e)},save:function(e,d,i){var j,o;q.isObject(e)||null==e?(j=e,i=d):(j={},j[e]=d);i=i?q.clone(i):{};i.wait&&(o=q.clone(this.attributes));e=q.extend({},i,{silent:!0});if(j&&!this.set(j,i.wait?e:i))return!1;var t=this,u=i.success;i.success=function(d,e,o){e=t.parse(d,o);i.wait&&(e=q.extend(j||{},e));if(!t.set(e,i))return!1;u?u(t,d):t.trigger("sync",t,d,i)};i.error=p.wrapError(i.error,
t,i);d=this.isNew()?"create":"update";d=(this.sync||p.sync).call(this,d,this,i);i.wait&&this.set(o,e);return d},destroy:function(e){var e=e?q.clone(e):{},d=this,i=e.success,j=function(){d.trigger("destroy",d,d.collection,e)};if(this.isNew())return j();e.success=function(o){e.wait&&j();i?i(d,o):d.trigger("sync",d,o,e)};e.error=p.wrapError(e.error,d,e);var o=(this.sync||p.sync).call(this,"delete",this,e);e.wait||j();return o},url:function(){var e=H(this.collection,"url")||H(this,"urlRoot")||V();return this.isNew()?
e:e+("/"==e.charAt(e.length-1)?"":"/")+encodeURIComponent(this.id)},parse:function(e){return e},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return null==this.id},change:function(e){if(this._changing||!this.hasChanged())return this;this._moreChanges=this._changing=!0;for(var d in this._changed)this.trigger("change:"+d,this,this._changed[d],e);for(;this._moreChanges;)this._moreChanges=!1,this.trigger("change",this,e);this._previousAttributes=q.clone(this.attributes);
delete this._changed;this._changing=!1;return this},hasChanged:function(e){return!arguments.length?!q.isEmpty(this._changed):this._changed&&q.has(this._changed,e)},changedAttributes:function(e){if(!e)return this.hasChanged()?q.clone(this._changed):!1;var d,i=!1,j=this._previousAttributes,o;for(o in e)if(!q.isEqual(j[o],d=e[o]))(i||(i={}))[o]=d;return i},previous:function(e){return!arguments.length||!this._previousAttributes?null:this._previousAttributes[e]},previousAttributes:function(){return q.clone(this._previousAttributes)},
isValid:function(){return!this.validate(this.attributes)},_validate:function(e,d){if(d.silent||!this.validate)return!0;var e=q.extend({},this.attributes,e),i=this.validate(e,d);if(!i)return!0;d&&d.error?d.error(this,i,d):this.trigger("error",this,i,d);return!1}});p.Collection=function(e,d){d||(d={});if(d.comparator)this.comparator=d.comparator;this._reset();this.initialize.apply(this,arguments);e&&this.reset(e,{silent:!0,parse:d.parse})};q.extend(p.Collection.prototype,p.Events,{model:p.Model,initialize:function(){},
toJSON:function(){return this.map(function(e){return e.toJSON()})},add:function(e,d){var i,j,o,p,t,s={},v={};d||(d={});e=q.isArray(e)?e.slice():[e];for(i=0,j=e.length;i=d))this.iframe=t('').hide().appendTo("body")[0].contentWindow,this.navigate(e);if(this._hasPushState)t(window).bind("popstate",
this.checkUrl);else if(this._wantsHashChange&&"onhashchange"in window&&!d)t(window).bind("hashchange",this.checkUrl);else if(this._wantsHashChange)this._checkUrlInterval=setInterval(this.checkUrl,this.interval);this.fragment=e;B=!0;e=window.location;d=e.pathname==this.options.root;if(this._wantsHashChange&&this._wantsPushState&&!this._hasPushState&&!d)return this.fragment=this.getFragment(null,!0),window.location.replace(this.options.root+"#"+this.fragment),!0;if(this._wantsPushState&&this._hasPushState&&
d&&e.hash)this.fragment=e.hash.replace(P,""),window.history.replaceState({},document.title,e.protocol+"//"+e.host+this.options.root+this.fragment);if(!this.options.silent)return this.loadUrl()},stop:function(){t(window).unbind("popstate",this.checkUrl).unbind("hashchange",this.checkUrl);clearInterval(this._checkUrlInterval);B=!1},route:function(e,d){this.handlers.unshift({route:e,callback:d})},checkUrl:function(){var e=this.getFragment();e==this.fragment&&this.iframe&&(e=this.getFragment(this.iframe.location.hash));
if(e==this.fragment||e==decodeURIComponent(this.fragment))return!1;this.iframe&&this.navigate(e);this.loadUrl()||this.loadUrl(window.location.hash)},loadUrl:function(e){var d=this.fragment=this.getFragment(e);return q.any(this.handlers,function(e){if(e.route.test(d))return e.callback(d),!0})},navigate:function(e,d){if(!B)return!1;if(!d||!0===d)d={trigger:d};var i=(e||"").replace(P,"");if(!(this.fragment==i||this.fragment==decodeURIComponent(i)))this._hasPushState?(0!=i.indexOf(this.options.root)&&
(i=this.options.root+i),this.fragment=i,window.history[d.replace?"replaceState":"pushState"]({},document.title,i)):this._wantsHashChange?(this.fragment=i,this._updateHash(window.location,i,d.replace),this.iframe&&i!=this.getFragment(this.iframe.location.hash)&&(d.replace||this.iframe.document.open().close(),this._updateHash(this.iframe.location,i,d.replace))):window.location.assign(this.options.root+e),d.trigger&&this.loadUrl(e)},_updateHash:function(e,d,i){i?e.replace(e.toString().replace(/(javascript:|#).*$/,
"")+"#"+d):e.hash=d}});p.View=function(e){this.cid=q.uniqueId("view");this._configure(e||{});this._ensureElement();this.initialize.apply(this,arguments);this.delegateEvents()};var J=/^(\S+)\s*(.*)$/,G="model,collection,el,id,attributes,className,tagName".split(",");q.extend(p.View.prototype,p.Events,{tagName:"div",$:function(e){return this.$el.find(e)},initialize:function(){},render:function(){return this},remove:function(){this.$el.remove();return this},make:function(e,d,i){e=document.createElement(e);
d&&t(e).attr(d);i&&t(e).html(i);return e},setElement:function(e,d){this.$el=t(e);this.el=this.$el[0];!1!==d&&this.delegateEvents();return this},delegateEvents:function(e){if(e||(e=H(this,"events"))){this.undelegateEvents();for(var d in e){var i=e[d];q.isFunction(i)||(i=this[e[d]]);if(!i)throw Error('Event "'+e[d]+'" does not exist');var j=d.match(J),o=j[1],j=j[2],i=q.bind(i,this),o=o+(".delegateEvents"+this.cid);""===j?this.$el.bind(o,i):this.$el.delegate(j,o,i)}}},undelegateEvents:function(){this.$el.unbind(".delegateEvents"+
this.cid)},_configure:function(e){this.options&&(e=q.extend({},this.options,e));for(var d=0,i=G.length;d