(function(jQuery,undefined){var oldManip=jQuery.fn.domManip,tmplItmAtt="_tmplitem",htmlExpr=/^[^<]*(<[\w\W]+>)[^>]*$|\{\{\! /,newTmplItems={},wrappedItems={},appendToTmplItems,topTmplItem={key:0,data:{}},itemKey=0,cloneIndex=0,stack=[];function newTmplItem(options,parentItem,fn,data){var newItem={data:data||(data===0||data===false)?data:(parentItem?parentItem.data:{}),_wrap:parentItem?parentItem._wrap:null,tmpl:null,parent:parentItem||null,nodes:[],calls:tiCalls,nest:tiNest,wrap:tiWrap,html:tiHtml,update:tiUpdate};if(options){jQuery.extend(newItem,options,{nodes:[],parent:parentItem});}
if(fn){newItem.tmpl=fn;newItem._ctnt=newItem._ctnt||newItem.tmpl(jQuery,newItem);newItem.key=++itemKey;(stack.length?wrappedItems:newTmplItems)[itemKey]=newItem;}
return newItem;}
jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(selector){var ret=[],insert=jQuery(selector),elems,i,l,tmplItems,parent=this.length===1&&this[0].parentNode;appendToTmplItems=newTmplItems||{};if(parent&&parent.nodeType===11&&parent.childNodes.length===1&&insert.length===1){insert[original](this[0]);ret=this;}else{for(i=0,l=insert.length;i<l;i++){cloneIndex=i;elems=(i>0?this.clone(true):this).get();jQuery(insert[i])[original](elems);ret=ret.concat(elems);}
cloneIndex=0;ret=this.pushStack(ret,name,insert.selector);}
tmplItems=appendToTmplItems;appendToTmplItems=null;jQuery.tmpl.complete(tmplItems);return ret;};});jQuery.fn.extend({tmpl:function(data,options,parentItem){return jQuery.tmpl(this[0],data,options,parentItem);},tmplItem:function(){return jQuery.tmplItem(this[0]);},template:function(name){return jQuery.template(name,this[0]);},domManip:function(args,table,callback,options){if(args[0]&&jQuery.isArray(args[0])){var dmArgs=jQuery.makeArray(arguments),elems=args[0],elemsLength=elems.length,i=0,tmplItem;while(i<elemsLength&&!(tmplItem=jQuery.data(elems[i++],"tmplItem"))){}
if(tmplItem&&cloneIndex){dmArgs[2]=function(fragClone){jQuery.tmpl.afterManip(this,fragClone,callback);};}
oldManip.apply(this,dmArgs);}else{oldManip.apply(this,arguments);}
cloneIndex=0;if(!appendToTmplItems){jQuery.tmpl.complete(newTmplItems);}
return this;}});jQuery.extend({tmpl:function(tmpl,data,options,parentItem){var ret,topLevel=!parentItem;if(topLevel){parentItem=topTmplItem;tmpl=jQuery.template[tmpl]||jQuery.template(null,tmpl);wrappedItems={};}else if(!tmpl){tmpl=parentItem.tmpl;newTmplItems[parentItem.key]=parentItem;parentItem.nodes=[];if(parentItem.wrapped){updateWrapped(parentItem,parentItem.wrapped);}
return jQuery(build(parentItem,null,parentItem.tmpl(jQuery,parentItem)));}
if(!tmpl){return[];}
if(typeof data==="function"){data=data.call(parentItem||{});}
if(options&&options.wrapped){updateWrapped(options,options.wrapped);}
ret=jQuery.isArray(data)?jQuery.map(data,function(dataItem){return dataItem?newTmplItem(options,parentItem,tmpl,dataItem):null;}):[newTmplItem(options,parentItem,tmpl,data)];return topLevel?jQuery(build(parentItem,null,ret)):ret;},tmplItem:function(elem){var tmplItem;if(elem instanceof jQuery){elem=elem[0];}
while(elem&&elem.nodeType===1&&!(tmplItem=jQuery.data(elem,"tmplItem"))&&(elem=elem.parentNode)){}
return tmplItem||topTmplItem;},template:function(name,tmpl){if(tmpl){if(typeof tmpl==="string"){tmpl=buildTmplFn(tmpl)}else if(tmpl instanceof jQuery){tmpl=tmpl[0]||{};}
if(tmpl.nodeType){tmpl=jQuery.data(tmpl,"tmpl")||jQuery.data(tmpl,"tmpl",buildTmplFn(tmpl.innerHTML));}
return typeof name==="string"?(jQuery.template[name]=tmpl):tmpl;}
return name?(typeof name!=="string"?jQuery.template(null,name):(jQuery.template[name]||jQuery.template(null,htmlExpr.test(name)?name:jQuery(name)))):null;},encode:function(text){return(""+text).split("<").join("&lt;").split(">").join("&gt;").split('"').join("&#34;").split("'").join("&#39;");}});jQuery.extend(jQuery.tmpl,{tag:{"tmpl":{_default:{$2:"null"},open:"if($notnull_1){__=__.concat($item.nest($1,$2));}"},"wrap":{_default:{$2:"null"},open:"$item.calls(__,$1,$2);__=[];",close:"call=$item.calls();__=call._.concat($item.wrap(call,__));"},"each":{_default:{$2:"$index, $value"},open:"if($notnull_1){$.each($1a,function($2){with(this){",close:"}});}"},"if":{open:"if(($notnull_1) && $1a){",close:"}"},"else":{_default:{$1:"true"},open:"}else if(($notnull_1) && $1a){"},"html":{open:"if($notnull_1){__.push($1a);}"},"=":{_default:{$1:"$data"},open:"if($notnull_1){__.push($.encode($1a));}"},"!":{open:""}},complete:function(items){newTmplItems={};},afterManip:function afterManip(elem,fragClone,callback){var content=fragClone.nodeType===11?jQuery.makeArray(fragClone.childNodes):fragClone.nodeType===1?[fragClone]:[];callback.call(elem,fragClone);storeTmplItems(content);cloneIndex++;}});function build(tmplItem,nested,content){var frag,ret=content?jQuery.map(content,function(item){return(typeof item==="string")?(tmplItem.key?item.replace(/(<\w+)(?=[\s>])(?![^>]*_tmplitem)([^>]*)/g,"$1 "+tmplItmAtt+"=\""+tmplItem.key+"\" $2"):item):build(item,tmplItem,item._ctnt);}):tmplItem;if(nested){return ret;}
ret=ret.join("");ret.replace(/^\s*([^<\s][^<]*)?(<[\w\W]+>)([^>]*[^>\s])?\s*$/,function(all,before,middle,after){frag=jQuery(middle).get();storeTmplItems(frag);if(before){frag=unencode(before).concat(frag);}
if(after){frag=frag.concat(unencode(after));}});return frag?frag:unencode(ret);}
function unencode(text){var el=document.createElement("div");el.innerHTML=text;return jQuery.makeArray(el.childNodes);}
function buildTmplFn(markup){return new Function("jQuery","$item","var $=jQuery,call,__=[],$data=$item.data;"+"with($data){__.push('"+
jQuery.trim(markup).replace(/([\\'])/g,"\\$1").replace(/[\r\t\n]/g," ").replace(/\$\{([^\}]*)\}/g,"{{= $1}}").replace(/\{\{(\/?)(\w+|.)(?:\(((?:[^\}]|\}(?!\}))*?)?\))?(?:\s+(.*?)?)?(\(((?:[^\}]|\}(?!\}))*?)\))?\s*\}\}/g,function(all,slash,type,fnargs,target,parens,args){var tag=jQuery.tmpl.tag[type],def,expr,exprAutoFnDetect;if(!tag){throw"Unknown template tag: "+type;}
def=tag._default||[];if(parens&&!/\w$/.test(target)){target+=parens;parens="";}
if(target){target=unescape(target);args=args?(","+unescape(args)+")"):(parens?")":"");expr=parens?(target.indexOf(".")>-1?target+unescape(parens):("("+target+").call($item"+args)):target;exprAutoFnDetect=parens?expr:"(typeof("+target+")==='function'?("+target+").call($item):("+target+"))";}else{exprAutoFnDetect=expr=def.$1||"null";}
fnargs=unescape(fnargs);return"');"+
tag[slash?"close":"open"].split("$notnull_1").join(target?"typeof("+target+")!=='undefined' && ("+target+")!=null":"true").split("$1a").join(exprAutoFnDetect).split("$1").join(expr).split("$2").join(fnargs||def.$2||"")+"__.push('";})+"');}return __;");}
function updateWrapped(options,wrapped){options._wrap=build(options,true,jQuery.isArray(wrapped)?wrapped:[htmlExpr.test(wrapped)?wrapped:jQuery(wrapped).html()]).join("");}
function unescape(args){return args?args.replace(/\\'/g,"'").replace(/\\\\/g,"\\"):null;}
function outerHtml(elem){var div=document.createElement("div");div.appendChild(elem.cloneNode(true));return div.innerHTML;}
function storeTmplItems(content){var keySuffix="_"+cloneIndex,elem,elems,newClonedItems={},i,l,m;for(i=0,l=content.length;i<l;i++){if((elem=content[i]).nodeType!==1){continue;}
elems=elem.getElementsByTagName("*");for(m=elems.length-1;m>=0;m--){processItemKey(elems[m]);}
processItemKey(elem);}
function processItemKey(el){var pntKey,pntNode=el,pntItem,tmplItem,key;if((key=el.getAttribute(tmplItmAtt))){while(pntNode.parentNode&&(pntNode=pntNode.parentNode).nodeType===1&&!(pntKey=pntNode.getAttribute(tmplItmAtt))){}
if(pntKey!==key){pntNode=pntNode.parentNode?(pntNode.nodeType===11?0:(pntNode.getAttribute(tmplItmAtt)||0)):0;if(!(tmplItem=newTmplItems[key])){tmplItem=wrappedItems[key];tmplItem=newTmplItem(tmplItem,newTmplItems[pntNode]||wrappedItems[pntNode]);tmplItem.key=++itemKey;newTmplItems[itemKey]=tmplItem;}
if(cloneIndex){cloneTmplItem(key);}}
el.removeAttribute(tmplItmAtt);}else if(cloneIndex&&(tmplItem=jQuery.data(el,"tmplItem"))){cloneTmplItem(tmplItem.key);newTmplItems[tmplItem.key]=tmplItem;pntNode=jQuery.data(el.parentNode,"tmplItem");pntNode=pntNode?pntNode.key:0;}
if(tmplItem){pntItem=tmplItem;while(pntItem&&pntItem.key!=pntNode){pntItem.nodes.push(el);pntItem=pntItem.parent;}
delete tmplItem._ctnt;delete tmplItem._wrap;jQuery.data(el,"tmplItem",tmplItem);}
function cloneTmplItem(key){key=key+keySuffix;tmplItem=newClonedItems[key]=(newClonedItems[key]||newTmplItem(tmplItem,newTmplItems[tmplItem.parent.key+keySuffix]||tmplItem.parent));}}}
function tiCalls(content,tmpl,data,options){if(!content){return stack.pop();}
stack.push({_:content,tmpl:tmpl,item:this,data:data,options:options});}
function tiNest(tmpl,data,options){return jQuery.tmpl(jQuery.template(tmpl),data,options,this);}
function tiWrap(call,wrapped){var options=call.options||{};options.wrapped=wrapped;return jQuery.tmpl(jQuery.template(call.tmpl),call.data,options,call.item);}
function tiHtml(filter,textOnly){var wrapped=this._wrap;return jQuery.map(jQuery(jQuery.isArray(wrapped)?wrapped.join(""):wrapped).filter(filter||"*"),function(e){return textOnly?e.innerText||e.textContent:e.outerHTML||outerHtml(e);});}
function tiUpdate(){var coll=this.nodes;jQuery.tmpl(null,null,null,this).insertBefore(coll[0]);jQuery(coll).remove();}})(jQuery);var JSON;if(!JSON){JSON={};}
(function(){"use strict";function f(n){return n<10?'0'+n:n;}
if(typeof Date.prototype.toJSON!=='function'){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+'-'+
f(this.getUTCMonth()+1)+'-'+
f(this.getUTCDate())+'T'+
f(this.getUTCHours())+':'+
f(this.getUTCMinutes())+':'+
f(this.getUTCSeconds())+'Z':null;};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf();};}
var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==='string'?c:'\\u'+('0000'+a.charCodeAt(0).toString(16)).slice(-4);})+'"':'"'+string+'"';}
function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==='object'&&typeof value.toJSON==='function'){value=value.toJSON(key);}
if(typeof rep==='function'){value=rep.call(holder,key,value);}
switch(typeof value){case'string':return quote(value);case'number':return isFinite(value)?String(value):'null';case'boolean':case'null':return String(value);case'object':if(!value){return'null';}
gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==='[object Array]'){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||'null';}
v=partial.length===0?'[]':gap?'[\n'+gap+partial.join(',\n'+gap)+'\n'+mind+']':'['+partial.join(',')+']';gap=mind;return v;}
if(rep&&typeof rep==='object'){length=rep.length;for(i=0;i<length;i+=1){if(typeof rep[i]==='string'){k=rep[i];v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}}else{for(k in value){if(Object.prototype.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}}
v=partial.length===0?'{}':gap?'{\n'+gap+partial.join(',\n'+gap)+'\n'+mind+'}':'{'+partial.join(',')+'}';gap=mind;return v;}}
if(typeof JSON.stringify!=='function'){JSON.stringify=function(value,replacer,space){var i;gap='';indent='';if(typeof space==='number'){for(i=0;i<space;i+=1){indent+=' ';}}else if(typeof space==='string'){indent=space;}
rep=replacer;if(replacer&&typeof replacer!=='function'&&(typeof replacer!=='object'||typeof replacer.length!=='number')){throw new Error('JSON.stringify');}
return str('',{'':value});};}
if(typeof JSON.parse!=='function'){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==='object'){for(k in value){if(Object.prototype.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v;}else{delete value[k];}}}}
return reviver.call(holder,key,value);}
text=String(text);cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return'\\u'+
('0000'+a.charCodeAt(0).toString(16)).slice(-4);});}
if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,''))){j=eval('('+text+')');return typeof reviver==='function'?walk({'':j},''):j;}
throw new SyntaxError('JSON.parse');};}}());jQuery.cookie=function(key,value,options){if(arguments.length>1&&String(value)!=="[object Object]"){options=jQuery.extend({},options);if(value===null||value===undefined){options.expires=-1;}
if(typeof options.expires==='number'){var days=options.expires,t=options.expires=new Date();t.setDate(t.getDate()+days);}
value=String(value);return(document.cookie=[encodeURIComponent(key),'=',options.raw?value:encodeURIComponent(value),options.expires?'; expires='+options.expires.toUTCString():'',options.path?'; path='+options.path:'',options.domain?'; domain='+options.domain:'',options.secure?'; secure':''].join(''));}
options=value||{};var result,decode=options.raw?function(s){return s;}:decodeURIComponent;return(result=new RegExp('(?:^|; )'+encodeURIComponent(key)+'=([^;]*)').exec(document.cookie))?decode(result[1]):null;};(function(){$(document).ajaxSend(function(event,xhr,settings){var safeMethod;safeMethod=function(method){return/^(GET|HEAD|OPTIONS|TRACE)$/.test(method);};if(!safeMethod(settings.type)&&!settings.crossDomain){return xhr.setRequestHeader("X-CSRFToken",$.cookie('csrftoken'));}});}).call(this);(function($,window){var Sammy,PATH_REPLACER="([^\/]+)",PATH_NAME_MATCHER=/:([\w\d]+)/g,QUERY_STRING_MATCHER=/\?([^#]*)?$/,_makeArray=function(nonarray){return Array.prototype.slice.call(nonarray);},_isFunction=function(obj){return Object.prototype.toString.call(obj)==="[object Function]";},_isArray=function(obj){return Object.prototype.toString.call(obj)==="[object Array]";},_decode=function(str){return decodeURIComponent((str||'').replace(/\+/g,' '));},_encode=encodeURIComponent,_escapeHTML=function(s){return String(s).replace(/&(?!\w+;)/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/"/g,'&quot;');},_routeWrapper=function(verb){return function(path,callback){return this.route.apply(this,[verb,path,callback]);};},_template_cache={},_has_history=!!(window.history&&history.pushState),loggers=[];Sammy=function(){var args=_makeArray(arguments),app,selector;Sammy.apps=Sammy.apps||{};if(args.length===0||args[0]&&_isFunction(args[0])){return Sammy.apply(Sammy,['body'].concat(args));}else if(typeof(selector=args.shift())=='string'){app=Sammy.apps[selector]||new Sammy.Application();app.element_selector=selector;if(args.length>0){$.each(args,function(i,plugin){app.use(plugin);});}
if(app.element_selector!=selector){delete Sammy.apps[selector];}
Sammy.apps[app.element_selector]=app;return app;}};Sammy.VERSION='0.7.0';Sammy.addLogger=function(logger){loggers.push(logger);};Sammy.log=function(){var args=_makeArray(arguments);args.unshift("["+Date()+"]");$.each(loggers,function(i,logger){logger.apply(Sammy,args);});};if(typeof window.console!='undefined'){if(_isFunction(window.console.log.apply)){Sammy.addLogger(function(){window.console.log.apply(window.console,arguments);});}else{Sammy.addLogger(function(){window.console.log(arguments);});}}else if(typeof console!='undefined'){Sammy.addLogger(function(){console.log.apply(console,arguments);});}
$.extend(Sammy,{makeArray:_makeArray,isFunction:_isFunction,isArray:_isArray});Sammy.Object=function(obj){return $.extend(this,obj||{});};$.extend(Sammy.Object.prototype,{escapeHTML:_escapeHTML,h:_escapeHTML,toHash:function(){var json={};$.each(this,function(k,v){if(!_isFunction(v)){json[k]=v;}});return json;},toHTML:function(){var display="";$.each(this,function(k,v){if(!_isFunction(v)){display+="<strong>"+k+"</strong> "+v+"<br />";}});return display;},keys:function(attributes_only){var keys=[];for(var property in this){if(!_isFunction(this[property])||!attributes_only){keys.push(property);}}
return keys;},has:function(key){return this[key]&&$.trim(this[key].toString())!=='';},join:function(){var args=_makeArray(arguments);var delimiter=args.shift();return args.join(delimiter);},log:function(){Sammy.log.apply(Sammy,arguments);},toString:function(include_functions){var s=[];$.each(this,function(k,v){if(!_isFunction(v)||include_functions){s.push('"'+k+'": '+v.toString());}});return"Sammy.Object: {"+s.join(',')+"}";}});Sammy.DefaultLocationProxy=function(app,run_interval_every){this.app=app;this.is_native=false;this.has_history=_has_history;this._startPolling(run_interval_every);};Sammy.DefaultLocationProxy.fullPath=function(location_obj){var matches=location_obj.toString().match(/^[^#]*(#.+)$/);var hash=matches?matches[1]:'';return[location_obj.pathname,location_obj.search,hash].join('');};Sammy.DefaultLocationProxy.prototype={bind:function(){var proxy=this,app=this.app,lp=Sammy.DefaultLocationProxy;$(window).bind('hashchange.'+this.app.eventNamespace(),function(e,non_native){if(proxy.is_native===false&&!non_native){proxy.is_native=true;window.clearInterval(lp._interval);}
app.trigger('location-changed');});if(_has_history&&!app.disable_push_state){$(window).bind('popstate.'+this.app.eventNamespace(),function(e){app.trigger('location-changed');});$('a').live('click.history-'+this.app.eventNamespace(),function(e){var full_path=lp.fullPath(this);if(this.hostname==window.location.hostname&&app.lookupRoute('get',full_path)){e.preventDefault();proxy.setLocation(full_path);return false;}});}
if(!lp._bindings){lp._bindings=0;}
lp._bindings++;},unbind:function(){$(window).unbind('hashchange.'+this.app.eventNamespace());$(window).unbind('popstate.'+this.app.eventNamespace());$('a').die('click.history-'+this.app.eventNamespace());Sammy.DefaultLocationProxy._bindings--;if(Sammy.DefaultLocationProxy._bindings<=0){window.clearInterval(Sammy.DefaultLocationProxy._interval);}},getLocation:function(){return Sammy.DefaultLocationProxy.fullPath(window.location);},setLocation:function(new_location){if(/^([^#\/]|$)/.test(new_location)){if(_has_history){new_location='/'+new_location;}else{new_location='#!/'+new_location;}}
if(new_location!=this.getLocation()){if(_has_history&&/^\//.test(new_location)){history.pushState({path:new_location},window.title,new_location);this.app.trigger('location-changed');}else{return(window.location=new_location);}}},_startPolling:function(every){var proxy=this;if(!Sammy.DefaultLocationProxy._interval){if(!every){every=10;}
var hashCheck=function(){var current_location=proxy.getLocation();if(typeof Sammy.DefaultLocationProxy._last_location=='undefined'||current_location!=Sammy.DefaultLocationProxy._last_location){window.setTimeout(function(){$(window).trigger('hashchange',[true]);},0);}
Sammy.DefaultLocationProxy._last_location=current_location;};hashCheck();Sammy.DefaultLocationProxy._interval=window.setInterval(hashCheck,every);}}};Sammy.Application=function(app_function){var app=this;this.routes={};this.listeners=new Sammy.Object({});this.arounds=[];this.befores=[];this.namespace=(new Date()).getTime()+'-'+parseInt(Math.random()*1000,10);this.context_prototype=function(){Sammy.EventContext.apply(this,arguments);};this.context_prototype.prototype=new Sammy.EventContext();if(_isFunction(app_function)){app_function.apply(this,[this]);}
if(!this._location_proxy){this.setLocationProxy(new Sammy.DefaultLocationProxy(this,this.run_interval_every));}
if(this.debug){this.bindToAllEvents(function(e,data){app.log(app.toString(),e.cleaned_type,data||{});});}};Sammy.Application.prototype=$.extend({},Sammy.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:false,element_selector:'body',debug:false,raise_errors:false,run_interval_every:50,disable_push_state:false,template_engine:null,toString:function(){return'Sammy.Application:'+this.element_selector;},$element:function(selector){return selector?$(this.element_selector).find(selector):$(this.element_selector);},use:function(){var args=_makeArray(arguments),plugin=args.shift(),plugin_name=plugin||'';try{args.unshift(this);if(typeof plugin=='string'){plugin_name='Sammy.'+plugin;plugin=Sammy[plugin];}
plugin.apply(this,args);}catch(e){if(typeof plugin==='undefined'){this.error("Plugin Error: called use() but plugin ("+plugin_name.toString()+") is not defined",e);}else if(!_isFunction(plugin)){this.error("Plugin Error: called use() but '"+plugin_name.toString()+"' is not a function",e);}else{this.error("Plugin Error",e);}}
return this;},setLocationProxy:function(new_proxy){var original_proxy=this._location_proxy;this._location_proxy=new_proxy;if(this.isRunning()){if(original_proxy){original_proxy.unbind();}
this._location_proxy.bind();}},route:function(verb,path,callback){var app=this,param_names=[],add_route,path_match;if(!callback&&_isFunction(path)){path=verb;callback=path;verb='any';}
verb=verb.toLowerCase();if(path.constructor==String){PATH_NAME_MATCHER.lastIndex=0;while((path_match=PATH_NAME_MATCHER.exec(path))!==null){param_names.push(path_match[1]);}
path=new RegExp(path.replace(PATH_NAME_MATCHER,PATH_REPLACER)+"$");}
if(typeof callback=='string'){callback=app[callback];}
add_route=function(with_verb){var r={verb:with_verb,path:path,callback:callback,param_names:param_names};app.routes[with_verb]=app.routes[with_verb]||[];app.routes[with_verb].push(r);};if(verb==='any'){$.each(this.ROUTE_VERBS,function(i,v){add_route(v);});}else{add_route(verb);}
return this;},get:_routeWrapper('get'),post:_routeWrapper('post'),put:_routeWrapper('put'),del:_routeWrapper('delete'),any:_routeWrapper('any'),mapRoutes:function(route_array){var app=this;$.each(route_array,function(i,route_args){app.route.apply(app,route_args);});return this;},eventNamespace:function(){return['sammy-app',this.namespace].join('-');},bind:function(name,data,callback){var app=this;if(typeof callback=='undefined'){callback=data;}
var listener_callback=function(){var e,context,data;e=arguments[0];data=arguments[1];if(data&&data.context){context=data.context;delete data.context;}else{context=new app.context_prototype(app,'bind',e.type,data,e.target);}
e.cleaned_type=e.type.replace(app.eventNamespace(),'');callback.apply(context,[e,data]);};if(!this.listeners[name]){this.listeners[name]=[];}
this.listeners[name].push(listener_callback);if(this.isRunning()){this._listen(name,listener_callback);}
return this;},trigger:function(name,data){this.$element().trigger([name,this.eventNamespace()].join('.'),[data]);return this;},refresh:function(){this.last_location=null;this.trigger('location-changed');return this;},before:function(options,callback){if(_isFunction(options)){callback=options;options={};}
this.befores.push([options,callback]);return this;},after:function(callback){return this.bind('event-context-after',callback);},around:function(callback){this.arounds.push(callback);return this;},isRunning:function(){return this._running;},helpers:function(extensions){$.extend(this.context_prototype.prototype,extensions);return this;},helper:function(name,method){this.context_prototype.prototype[name]=method;return this;},run:function(start_url){if(this.isRunning()){return false;}
var app=this;$.each(this.listeners.toHash(),function(name,callbacks){$.each(callbacks,function(i,listener_callback){app._listen(name,listener_callback);});});this.trigger('run',{start_url:start_url});this._running=true;this.last_location=null;if(!(/\#(.+)/.test(this.getLocation()))&&typeof start_url!='undefined'){this.setLocation(start_url);}
this._checkLocation();this._location_proxy.bind();this.bind('location-changed',function(){app._checkLocation();});this.bind('submit',function(e){var returned=app._checkFormSubmission($(e.target).closest('form'));return(returned===false)?e.preventDefault():false;});$(window).bind('beforeunload',function(){app.unload();});return this.trigger('changed');},unload:function(){if(!this.isRunning()){return false;}
var app=this;this.trigger('unload');this._location_proxy.unbind();this.$element().unbind('submit').removeClass(app.eventNamespace());$.each(this.listeners.toHash(),function(name,listeners){$.each(listeners,function(i,listener_callback){app._unlisten(name,listener_callback);});});this._running=false;return this;},bindToAllEvents:function(callback){var app=this;$.each(this.APP_EVENTS,function(i,e){app.bind(e,callback);});$.each(this.listeners.keys(true),function(i,name){if($.inArray(name,app.APP_EVENTS)==-1){app.bind(name,callback);}});return this;},routablePath:function(path){return path.replace(QUERY_STRING_MATCHER,'');},lookupRoute:function(verb,path){var app=this,routed=false,i=0,l,route;if(typeof this.routes[verb]!='undefined'){l=this.routes[verb].length;for(;i<l;i++){route=this.routes[verb][i];if(app.routablePath(path).match(route.path)){routed=route;break;}}}
return routed;},runRoute:function(verb,path,params,target){var app=this,route=this.lookupRoute(verb,path),context,wrapped_route,arounds,around,befores,before,callback_args,path_params,final_returned;this.log('runRoute',[verb,path].join(' '));this.trigger('run-route',{verb:verb,path:path,params:params});if(typeof params=='undefined'){params={};}
$.extend(params,this._parseQueryString(path));if(route){this.trigger('route-found',{route:route});if((path_params=route.path.exec(this.routablePath(path)))!==null){path_params.shift();$.each(path_params,function(i,param){if(route.param_names[i]){params[route.param_names[i]]=_decode(param);}else{if(!params.splat){params.splat=[];}
params.splat.push(_decode(param));}});}
context=new this.context_prototype(this,verb,path,params,target);arounds=this.arounds.slice(0);befores=this.befores.slice(0);callback_args=[context].concat(params.splat);wrapped_route=function(){var returned;while(befores.length>0){before=befores.shift();if(app.contextMatchesOptions(context,before[0])){returned=before[1].apply(context,[context]);if(returned===false){return false;}}}
app.last_route=route;context.trigger('event-context-before',{context:context});returned=route.callback.apply(context,callback_args);context.trigger('event-context-after',{context:context});return returned;};$.each(arounds.reverse(),function(i,around){var last_wrapped_route=wrapped_route;wrapped_route=function(){return around.apply(context,[last_wrapped_route]);};});try{final_returned=wrapped_route();}catch(e){this.error(['500 Error',verb,path].join(' '),e);}
return final_returned;}else{return this.notFound(verb,path);}},contextMatchesOptions:function(context,match_options,positive){var options=match_options;if(typeof options==='undefined'||options=={}){return true;}
if(typeof positive==='undefined'){positive=true;}
if(typeof options==='string'||_isFunction(options.test)){options={path:options};}
if(options.only){return this.contextMatchesOptions(context,options.only,true);}else if(options.except){return this.contextMatchesOptions(context,options.except,false);}
var path_matched=true,verb_matched=true;if(options.path){if(!_isFunction(options.path.test)){options.path=new RegExp(options.path.toString()+'$');}
path_matched=options.path.test(context.path);}
if(options.verb){if(typeof options.verb==='string'){verb_matched=options.verb===context.verb;}else{verb_matched=options.verb.indexOf(context.verb)>-1;}}
return positive?(verb_matched&&path_matched):!(verb_matched&&path_matched);},getLocation:function(){return this._location_proxy.getLocation();},setLocation:function(new_location){return this._location_proxy.setLocation(new_location);},swap:function(content){return this.$element().html(content);},templateCache:function(key,value){if(typeof value!='undefined'){return _template_cache[key]=value;}else{return _template_cache[key];}},clearTemplateCache:function(){return _template_cache={};},notFound:function(verb,path){var ret=this.error(['404 Not Found',verb,path].join(' '));return(verb==='get')?ret:true;},error:function(message,original_error){if(!original_error){original_error=new Error();}
original_error.message=[message,original_error.message].join(' ');this.trigger('error',{message:original_error.message,error:original_error});if(this.raise_errors){throw(original_error);}else{this.log(original_error.message,original_error);}},_checkLocation:function(){var location,returned;location=this.getLocation();if(!this.last_location||this.last_location[0]!='get'||this.last_location[1]!=location){this.last_location=['get',location];returned=this.runRoute('get',location);}
return returned;},_getFormVerb:function(form){var $form=$(form),verb,$_method;$_method=$form.find('input[name="_method"]');if($_method.length>0){verb=$_method.val();}
if(!verb){verb=$form[0].getAttribute('method');}
if(!verb||verb==''){verb='get';}
return $.trim(verb.toString().toLowerCase());},_checkFormSubmission:function(form){var $form,path,verb,params,returned;this.trigger('check-form-submission',{form:form});$form=$(form);path=$form.attr('action')||'';verb=this._getFormVerb($form);this.log('_checkFormSubmission',$form,path,verb);if(verb==='get'){params=this._serializeFormParams($form);if(params!==''){path+='?'+params;}
this.setLocation(path);returned=false;}else{params=$.extend({},this._parseFormParams($form));returned=this.runRoute(verb,path,params,form.get(0));}
return(typeof returned=='undefined')?false:returned;},_serializeFormParams:function($form){var queryString="",fields=$form.serializeArray(),i;if(fields.length>0){queryString=this._encodeFormPair(fields[0].name,fields[0].value);for(i=1;i<fields.length;i++){queryString=queryString+"&"+this._encodeFormPair(fields[i].name,fields[i].value);}}
return queryString;},_encodeFormPair:function(name,value){return _encode(name)+"="+_encode(value);},_parseFormParams:function($form){var params={},form_fields=$form.serializeArray(),i;for(i=0;i<form_fields.length;i++){params=this._parseParamPair(params,form_fields[i].name,form_fields[i].value);}
return params;},_parseQueryString:function(path){var params={},parts,pairs,pair,i;parts=path.match(QUERY_STRING_MATCHER);if(parts){pairs=parts[1].split('&');for(i=0;i<pairs.length;i++){pair=pairs[i].split('=');params=this._parseParamPair(params,_decode(pair[0]),_decode(pair[1]||""));}}
return params;},_parseParamPair:function(params,key,value){if(params[key]){if(_isArray(params[key])){params[key].push(value);}else{params[key]=[params[key],value];}}else{params[key]=value;}
return params;},_listen:function(name,callback){return this.$element().bind([name,this.eventNamespace()].join('.'),callback);},_unlisten:function(name,callback){return this.$element().unbind([name,this.eventNamespace()].join('.'),callback);}});Sammy.RenderContext=function(event_context){this.event_context=event_context;this.callbacks=[];this.previous_content=null;this.content=null;this.next_engine=false;this.waiting=false;};Sammy.RenderContext.prototype=$.extend({},Sammy.Object.prototype,{then:function(callback){if(!_isFunction(callback)){if(typeof callback==='string'&&callback in this.event_context){var helper=this.event_context[callback];callback=function(content){return helper.apply(this.event_context,[content]);};}else{return this;}}
var context=this;if(this.waiting){this.callbacks.push(callback);}else{this.wait();window.setTimeout(function(){var returned=callback.apply(context,[context.content,context.previous_content]);if(returned!==false){context.next(returned);}},0);}
return this;},wait:function(){this.waiting=true;},next:function(content){this.waiting=false;if(typeof content!=='undefined'){this.previous_content=this.content;this.content=content;}
if(this.callbacks.length>0){this.then(this.callbacks.shift());}},load:function(location,options,callback){var context=this;return this.then(function(){var should_cache,cached,is_json,location_array;if(_isFunction(options)){callback=options;options={};}else{options=$.extend({},options);}
if(callback){this.then(callback);}
if(typeof location==='string'){is_json=(location.match(/\.json$/)||options.json);should_cache=((is_json&&options.cache===true)||options.cache!==false);context.next_engine=context.event_context.engineFor(location);delete options.cache;delete options.json;if(options.engine){context.next_engine=options.engine;delete options.engine;}
if(should_cache&&(cached=this.event_context.app.templateCache(location))){return cached;}
this.wait();$.ajax($.extend({url:location,data:{},dataType:is_json?'json':null,type:'get',success:function(data){if(should_cache){context.event_context.app.templateCache(location,data);}
context.next(data);}},options));return false;}else{if(location.nodeType){return location.innerHTML;}
if(location.selector){context.next_engine=location.attr('data-engine');if(options.clone===false){return location.remove()[0].innerHTML.toString();}else{return location[0].innerHTML.toString();}}}});},loadPartials:function(partials){if(partials){this.partials=this.partials||{};for(name in partials){this.load(partials[name]).then(function(template){this.partials[name]=template;});}}
return this;},render:function(location,data,callback,partials){if(_isFunction(location)&&!data){return this.then(location);}else{return this.loadPartials(partials).load(location).interpolate(data,location).then(callback);}},partial:function(location,data){return this.render(location,data).swap();},send:function(){var context=this,args=_makeArray(arguments),fun=args.shift();if(_isArray(args[0])){args=args[0];}
return this.then(function(content){args.push(function(response){context.next(response);});context.wait();fun.apply(fun,args);return false;});},collect:function(array,callback,now){var context=this;var coll=function(){if(_isFunction(array)){callback=array;array=this.content;}
var contents=[],doms=false;$.each(array,function(i,item){var returned=callback.apply(context,[i,item]);if(returned.jquery&&returned.length==1){returned=returned[0];doms=true;}
contents.push(returned);return returned;});return doms?contents:contents.join('');};return now?coll():this.then(coll);},renderEach:function(location,name,data,callback){if(_isArray(name)){callback=data;data=name;name=null;}
return this.load(location).then(function(content){var rctx=this;if(!data){data=_isArray(this.previous_content)?this.previous_content:[];}
if(callback){$.each(data,function(i,value){var idata={},engine=this.next_engine||location;name?(idata[name]=value):(idata=value);callback(value,rctx.event_context.interpolate(content,idata,engine));});}else{return this.collect(data,function(i,value){var idata={},engine=this.next_engine||location;name?(idata[name]=value):(idata=value);return this.event_context.interpolate(content,idata,engine);},true);}});},interpolate:function(data,engine,retain){var context=this;return this.then(function(content,prev){if(!data&&prev){data=prev;}
if(this.next_engine){engine=this.next_engine;this.next_engine=false;}
var rendered=context.event_context.interpolate(content,data,engine,this.partials);return retain?prev+rendered:rendered;});},swap:function(){return this.then(function(content){this.event_context.swap(content);}).trigger('changed',{});},appendTo:function(selector){return this.then(function(content){$(selector).append(content);}).trigger('changed',{});},prependTo:function(selector){return this.then(function(content){$(selector).prepend(content);}).trigger('changed',{});},replace:function(selector){return this.then(function(content){$(selector).html(content);}).trigger('changed',{});},trigger:function(name,data){return this.then(function(content){if(typeof data=='undefined'){data={content:content};}
this.event_context.trigger(name,data);});}});Sammy.EventContext=function(app,verb,path,params,target){this.app=app;this.verb=verb;this.path=path;this.params=new Sammy.Object(params);this.target=target;};Sammy.EventContext.prototype=$.extend({},Sammy.Object.prototype,{$element:function(){return this.app.$element(_makeArray(arguments).shift());},engineFor:function(engine){var context=this,engine_match;if(_isFunction(engine)){return engine;}
engine=(engine||context.app.template_engine).toString();if((engine_match=engine.match(/\.([^\.\?\#]+)$/))){engine=engine_match[1];}
if(engine&&_isFunction(context[engine])){return context[engine];}
if(context.app.template_engine){return this.engineFor(context.app.template_engine);}
return function(content,data){return content;};},interpolate:function(content,data,engine,partials){return this.engineFor(engine).apply(this,[content,data,partials]);},render:function(location,data,callback,partials){return new Sammy.RenderContext(this).render(location,data,callback,partials);},renderEach:function(location,name,data,callback){return new Sammy.RenderContext(this).renderEach(location,name,data,callback);},load:function(location,options,callback){return new Sammy.RenderContext(this).load(location,options,callback);},partial:function(location,data){return new Sammy.RenderContext(this).partial(location,data);},send:function(){var rctx=new Sammy.RenderContext(this);return rctx.send.apply(rctx,arguments);},redirect:function(){var to,args=_makeArray(arguments),current_location=this.app.getLocation(),l=args.length;if(l>1){var i=0,paths=[],pairs=[],params={},has_params=false;for(;i<l;i++){if(typeof args[i]=='string'){paths.push(args[i]);}else{$.extend(params,args[i]);has_params=true;}}
to=paths.join('/');if(has_params){for(var k in params){pairs.push(this.app._encodeFormPair(k,params[k]));}
to+='?'+pairs.join('&');}}else{to=args[0];}
this.trigger('redirect',{to:to});this.app.last_location=[this.verb,this.path];this.app.setLocation(to);if(new RegExp(to).test(current_location)){this.app.trigger('location-changed');}},trigger:function(name,data){if(typeof data=='undefined'){data={};}
if(!data.context){data.context=this;}
return this.app.trigger(name,data);},eventNamespace:function(){return this.app.eventNamespace();},swap:function(contents){return this.app.swap(contents);},notFound:function(){return this.app.notFound(this.verb,this.path);},json:function(string){return $.parseJSON(string);},toString:function(){return"Sammy.EventContext: "+[this.verb,this.path,this.params].join(' ');}});$.sammy=window.Sammy=Sammy;})(jQuery,window);(function(){var p=this,C=p._,m={},i=Array.prototype,n=Object.prototype,f=i.slice,D=i.unshift,E=n.toString,l=n.hasOwnProperty,s=i.forEach,t=i.map,u=i.reduce,v=i.reduceRight,w=i.filter,x=i.every,y=i.some,o=i.indexOf,z=i.lastIndexOf;n=Array.isArray;var F=Object.keys,q=Function.prototype.bind,b=function(a){return new j(a)};typeof module!=="undefined"&&module.exports?(module.exports=b,b._=b):p._=b;b.VERSION="1.1.7";var h=b.each=b.forEach=function(a,c,b){if(a!=null)if(s&&a.forEach===s)a.forEach(c,b);else if(a.length===+a.length)for(var e=0,k=a.length;e<k;e++){if(e in a&&c.call(b,a[e],e,a)===m)break}else for(e in a)if(l.call(a,e)&&c.call(b,a[e],e,a)===m)break};b.map=function(a,c,b){var e=[];if(a==null)return e;if(t&&a.map===t)return a.map(c,b);h(a,function(a,g,G){e[e.length]=c.call(b,a,g,G)});return e};b.reduce=b.foldl=b.inject=function(a,c,d,e){var k=d!==void 0;a==null&&(a=[]);if(u&&a.reduce===u)return e&&(c=b.bind(c,e)),k?a.reduce(c,d):a.reduce(c);h(a,function(a,b,f){k?d=c.call(e,d,a,b,f):(d=a,k=!0)});if(!k)throw new TypeError("Reduce of empty array with no initial value");return d};b.reduceRight=b.foldr=function(a,c,d,e){a==null&&(a=[]);if(v&&a.reduceRight===v)return e&&(c=b.bind(c,e)),d!==void 0?a.reduceRight(c,d):a.reduceRight(c);a=(b.isArray(a)?a.slice():b.toArray(a)).reverse();return b.reduce(a,c,d,e)};b.find=b.detect=function(a,c,b){var e;A(a,function(a,g,f){if(c.call(b,a,g,f))return e=a,!0});return e};b.filter=b.select=function(a,c,b){var e=[];if(a==null)return e;if(w&&a.filter===w)return a.filter(c,b);h(a,function(a,g,f){c.call(b,a,g,f)&&(e[e.length]=a)});return e};b.reject=function(a,c,b){var e=[];if(a==null)return e;h(a,function(a,g,f){c.call(b,a,g,f)||(e[e.length]=a)});return e};b.every=b.all=function(a,c,b){var e=!0;if(a==null)return e;if(x&&a.every===x)return a.every(c,b);h(a,function(a,g,f){if(!(e=e&&c.call(b,a,g,f)))return m});return e};var A=b.some=b.any=function(a,c,d){c=c||b.identity;var e=!1;if(a==null)return e;if(y&&a.some===y)return a.some(c,d);h(a,function(a,b,f){if(e|=c.call(d,a,b,f))return m});return!!e};b.include=b.contains=function(a,c){var b=!1;if(a==null)return b;if(o&&a.indexOf===o)return a.indexOf(c)!=-1;A(a,function(a){if(b=a===c)return!0});return b};b.invoke=function(a,c){var d=f.call(arguments,2);return b.map(a,function(a){return(c.call?c||a:a[c]).apply(a,d)})};b.pluck=function(a,c){return b.map(a,function(a){return a[c]})};b.max=function(a,c,d){if(!c&&b.isArray(a))return Math.max.apply(Math,a);var e={computed:-Infinity};h(a,function(a,b,f){b=c?c.call(d,a,b,f):a;b>=e.computed&&(e={value:a,computed:b})});return e.value};b.min=function(a,c,d){if(!c&&b.isArray(a))return Math.min.apply(Math,a);var e={computed:Infinity};h(a,function(a,b,f){b=c?c.call(d,a,b,f):a;b<e.computed&&(e={value:a,computed:b})});return e.value};b.sortBy=function(a,c,d){return b.pluck(b.map(a,function(a,b,f){return{value:a,criteria:c.call(d,a,b,f)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;return c<d?-1:c>d?1:0}),"value")};b.groupBy=function(a,b){var d={};h(a,function(a,f){var g=b(a,f);(d[g]||(d[g]=[])).push(a)});return d};b.sortedIndex=function(a,c,d){d||(d=b.identity);for(var e=0,f=a.length;e<f;){var g=e+f>>1;d(a[g])<d(c)?e=g+1:f=g}return e};b.toArray=function(a){if(!a)return[];if(a.toArray)return a.toArray();if(b.isArray(a))return f.call(a);if(b.isArguments(a))return f.call(a);return b.values(a)};b.size=function(a){return b.toArray(a).length};b.first=b.head=function(a,b,d){return b!=null&&!d?f.call(a,0,b):a[0]};b.rest=b.tail=function(a,b,d){return f.call(a,b==null||d?1:b)};b.last=function(a){return a[a.length-1]};b.compact=function(a){return b.filter(a,function(a){return!!a})};b.flatten=function(a){return b.reduce(a,function(a,d){if(b.isArray(d))return a.concat(b.flatten(d));a[a.length]=d;return a},[])};b.without=function(a){return b.difference(a,f.call(arguments,1))};b.uniq=b.unique=function(a,c){return b.reduce(a,function(a,e,f){if(0==f||(c===!0?b.last(a)!=e:!b.include(a,e)))a[a.length]=e;return a},[])};b.union=function(){return b.uniq(b.flatten(arguments))};b.intersection=b.intersect=function(a){var c=f.call(arguments,1);return b.filter(b.uniq(a),function(a){return b.every(c,function(c){return b.indexOf(c,a)>=0})})};b.difference=function(a,c){return b.filter(a,function(a){return!b.include(c,a)})};b.zip=function(){for(var a=f.call(arguments),c=b.max(b.pluck(a,"length")),d=Array(c),e=0;e<c;e++)d[e]=b.pluck(a,""+e);return d};b.indexOf=function(a,c,d){if(a==null)return-1;var e;if(d)return d=b.sortedIndex(a,c),a[d]===c?d:-1;if(o&&a.indexOf===o)return a.indexOf(c);d=0;for(e=a.length;d<e;d++)if(a[d]===c)return d;return-1};b.lastIndexOf=function(a,b){if(a==null)return-1;if(z&&a.lastIndexOf===z)return a.lastIndexOf(b);for(var d=a.length;d--;)if(a[d]===b)return d;return-1};b.range=function(a,b,d){arguments.length<=1&&(b=a||0,a=0);d=arguments[2]||1;for(var e=Math.max(Math.ceil((b-a)/d),0),f=0,g=Array(e);f<e;)g[f++]=a,a+=d;return g};b.bind=function(a,b){if(a.bind===q&&q)return q.apply(a,f.call(arguments,1));var d=f.call(arguments,2);return function(){return a.apply(b,d.concat(f.call(arguments)))}};b.bindAll=function(a){var c=f.call(arguments,1);c.length==0&&(c=b.functions(a));h(c,function(c){a[c]=b.bind(a[c],a)});return a};b.memoize=function(a,c){var d={};c||(c=b.identity);return function(){var b=c.apply(this,arguments);return l.call(d,b)?d[b]:d[b]=a.apply(this,arguments)}};b.delay=function(a,b){var d=f.call(arguments,2);return setTimeout(function(){return a.apply(a,d)},b)};b.defer=function(a){return b.delay.apply(b,[a,1].concat(f.call(arguments,1)))};var B=function(a,b,d){var e;return function(){var f=this,g=arguments,h=function(){e=null;a.apply(f,g)};d&&clearTimeout(e);if(d||!e)e=setTimeout(h,b)}};b.throttle=function(a,b){return B(a,b,!1)};b.debounce=function(a,b){return B(a,b,!0)};b.once=function(a){var b=!1,d;return function(){if(b)return d;b=!0;return d=a.apply(this,arguments)}};b.wrap=function(a,b){return function(){var d=[a].concat(f.call(arguments));return b.apply(this,d)}};b.compose=function(){var a=f.call(arguments);return function(){for(var b=f.call(arguments),d=a.length-1;d>=0;d--)b=[a[d].apply(this,b)];return b[0]}};b.after=function(a,b){return function(){if(--a<1)return b.apply(this,arguments)}};b.keys=F||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var b=[],d;for(d in a)l.call(a,d)&&(b[b.length]=d);return b};b.values=function(a){return b.map(a,b.identity)};b.functions=b.methods=function(a){var c=[],d;for(d in a)b.isFunction(a[d])&&c.push(d);return c.sort()};b.extend=function(a){h(f.call(arguments,1),function(b){for(var d in b)b[d]!==void 0&&(a[d]=b[d])});return a};b.defaults=function(a){h(f.call(arguments,1),function(b){for(var d in b)a[d]==null&&(a[d]=b[d])});return a};b.clone=function(a){return b.isArray(a)?a.slice():b.extend({},a)};b.tap=function(a,b){b(a);return a};b.isEqual=function(a,c){if(a===c)return!0;var d=typeof a;if(d!=typeof c)return!1;if(a==c)return!0;if(!a&&c||a&&!c)return!1;if(a._chain)a=a._wrapped;if(c._chain)c=c._wrapped;if(a.isEqual)return a.isEqual(c);if(c.isEqual)return c.isEqual(a);if(b.isDate(a)&&b.isDate(c))return a.getTime()===c.getTime();if(b.isNaN(a)&&b.isNaN(c))return!1;if(b.isRegExp(a)&&b.isRegExp(c))return a.source===c.source&&a.global===c.global&&a.ignoreCase===c.ignoreCase&&a.multiline===c.multiline;if(d!=="object")return!1;if(a.length&&a.length!==c.length)return!1;d=b.keys(a);var e=b.keys(c);if(d.length!=e.length)return!1;for(var f in a)if(!(f in c)||!b.isEqual(a[f],c[f]))return!1;return!0};b.isEmpty=function(a){if(b.isArray(a)||b.isString(a))return a.length===0;for(var c in a)if(l.call(a,c))return!1;return!0};b.isElement=function(a){return!!(a&&a.nodeType==1)};b.isArray=n||function(a){return E.call(a)==="[object Array]"};b.isObject=function(a){return a===Object(a)};b.isArguments=function(a){return!(!a||!l.call(a,"callee"))};b.isFunction=function(a){return!(!a||!a.constructor||!a.call||!a.apply)};b.isString=function(a){return!!(a===""||a&&a.charCodeAt&&a.substr)};b.isNumber=function(a){return!!(a===0||a&&a.toExponential&&a.toFixed)};b.isNaN=function(a){return a!==a};b.isBoolean=function(a){return a===!0||a===!1};b.isDate=function(a){return!(!a||!a.getTimezoneOffset||!a.setUTCFullYear)};b.isRegExp=function(a){return!(!a||!a.test||!a.exec||!(a.ignoreCase||a.ignoreCase===!1))};b.isNull=function(a){return a===null};b.isUndefined=function(a){return a===void 0};b.noConflict=function(){p._=C;return this};b.identity=function(a){return a};b.times=function(a,b,d){for(var e=0;e<a;e++)b.call(d,e)};b.mixin=function(a){h(b.functions(a),function(c){H(c,b[c]=a[c])})};var I=0;b.uniqueId=function(a){var b=I++;return a?a+b:b};b.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g};b.template=function(a,c){var d=b.templateSettings;d="var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('"+a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(d.interpolate,function(a,b){return"',"+b.replace(/\\'/g,"'")+",'"}).replace(d.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('');";d=new Function("obj",d);return c?d(c):d};var j=function(a){this._wrapped=a};b.prototype=j.prototype;var r=function(a,c){return c?b(a).chain():a},H=function(a,c){j.prototype[a]=function(){var a=f.call(arguments);D.call(a,this._wrapped);return r(c.apply(b,a),this._chain)}};b.mixin(b);h(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=i[a];j.prototype[a]=function(){b.apply(this._wrapped,arguments);return r(this._wrapped,this._chain)}});h(["concat","join","slice"],function(a){var b=i[a];j.prototype[a]=function(){return r(b.apply(this._wrapped,arguments),this._chain)}});j.prototype.chain=function(){this._chain=!0;return this};j.prototype.value=function(){return this._wrapped}})();(function(){var Spine;if(typeof exports!=="undefined"){Spine=exports;}else{Spine=this.Spine={};}
Spine.version="0.0.4";var $=Spine.$=this.jQuery||this.Zepto||function(){return arguments[0];};var makeArray=Spine.makeArray=function(args){return Array.prototype.slice.call(args,0);};var isArray=Spine.isArray=function(value){return Object.prototype.toString.call(value)=="[object Array]";};if(typeof Array.prototype.indexOf==="undefined")
Array.prototype.indexOf=function(value){for(var i=0;i<this.length;i++)
if(this[i]===value)
return i;return-1;};var Events=Spine.Events={bind:function(ev,callback){var evs=ev.split(" ");var calls=this._callbacks||(this._callbacks={});for(var i=0;i<evs.length;i++)
(this._callbacks[evs[i]]||(this._callbacks[evs[i]]=[])).push(callback);return this;},trigger:function(){var args=makeArray(arguments);var ev=args.shift();var list,calls,i,l;if(!(calls=this._callbacks))return false;if(!(list=this._callbacks[ev]))return false;for(i=0,l=list.length;i<l;i++)
if(list[i].apply(this,args)===false)
break;return true;},unbind:function(ev,callback){if(!ev){this._callbacks={};return this;}
var list,calls,i,l;if(!(calls=this._callbacks))return this;if(!(list=this._callbacks[ev]))return this;if(!callback){delete this._callbacks[ev];return this;}
for(i=0,l=list.length;i<l;i++)
if(callback===list[i]){list.splice(i,1);break;}
return this;}};var Log=Spine.Log={trace:true,logPrefix:"(App)",log:function(){if(!this.trace)return;if(typeof console=="undefined")return;var args=makeArray(arguments);if(this.logPrefix)args.unshift(this.logPrefix);console.log.apply(console,args);return this;}};if(typeof Object.create!=="function")
Object.create=function(o){function F(){}
F.prototype=o;return new F();};var moduleKeywords=["included","extended"];var Class=Spine.Class={inherited:function(){},created:function(){},prototype:{initialize:function(){},init:function(){}},create:function(include,extend){var object=Object.create(this);object.parent=this;object.prototype=object.fn=Object.create(this.prototype);if(include)object.include(include);if(extend)object.extend(extend);object.created();this.inherited(object);return object;},init:function(){var instance=Object.create(this.prototype);instance.parent=this;instance.initialize.apply(instance,arguments);instance.init.apply(instance,arguments);return instance;},proxy:function(func){var thisObject=this;return(function(){return func.apply(thisObject,arguments);});},proxyAll:function(){var functions=makeArray(arguments);for(var i=0;i<functions.length;i++)
this[functions[i]]=this.proxy(this[functions[i]]);},include:function(obj){for(var key in obj)
if(moduleKeywords.indexOf(key)==-1)
this.fn[key]=obj[key];var included=obj.included;if(included)included.apply(this);return this;},extend:function(obj){for(var key in obj)
if(moduleKeywords.indexOf(key)==-1)
this[key]=obj[key];var extended=obj.extended;if(extended)extended.apply(this);return this;}};Class.prototype.proxy=Class.proxy;Class.prototype.proxyAll=Class.proxyAll;Class.inst=Class.init;Class.sub=Class.create;Spine.guid=function(){return'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g,function(c){var r=Math.random()*16|0,v=c=='x'?r:(r&0x3|0x8);return v.toString(16);}).toUpperCase();};var Model=Spine.Model=Class.create();Model.extend(Events);Model.extend({setup:function(name,atts){var model=Model.sub();if(name)model.name=name;if(atts)model.attributes=atts;return model;},created:function(sub){this.records={};this.attributes=this.attributes?makeArray(this.attributes):[];},find:function(id){var record=this.records[id];if(!record)throw("Unknown record");return record.clone();},exists:function(id){try{return this.find(id);}catch(e){return false;}},refresh:function(values){values=this.fromJSON(values);this.records={};for(var i=0,il=values.length;i<il;i++){var record=values[i];record.newRecord=false;this.records[record.id]=record;}
this.trigger("refresh");return this;},select:function(callback){var result=[];for(var key in this.records)
if(callback(this.records[key]))
result.push(this.records[key]);return this.cloneArray(result);},findByAttribute:function(name,value){for(var key in this.records)
if(this.records[key][name]==value)
return this.records[key].clone();},findAllByAttribute:function(name,value){return(this.select(function(item){return(item[name]==value);}));},each:function(callback){for(var key in this.records)
callback(this.records[key]);},all:function(){return this.cloneArray(this.recordsValues());},first:function(){var record=this.recordsValues()[0];return(record&&record.clone());},last:function(){var values=this.recordsValues()
var record=values[values.length-1];return(record&&record.clone());},count:function(){return this.recordsValues().length;},deleteAll:function(){for(var key in this.records)
delete this.records[key];},destroyAll:function(){for(var key in this.records)
this.records[key].destroy();},update:function(id,atts){this.find(id).updateAttributes(atts);},create:function(atts){var record=this.init(atts);return record.save();},destroy:function(id){this.find(id).destroy();},sync:function(callback){this.bind("change",callback);},fetch:function(callbackOrParams){typeof(callbackOrParams)=="function"?this.bind("fetch",callbackOrParams):this.trigger("fetch",callbackOrParams);},toJSON:function(){return this.recordsValues();},fromJSON:function(objects){if(!objects)return;if(typeof objects=="string")
objects=JSON.parse(objects)
if(isArray(objects)){var results=[];for(var i=0;i<objects.length;i++)
results.push(this.init(objects[i]));return results;}else{return this.init(objects);}},recordsValues:function(){var result=[];for(var key in this.records)
result.push(this.records[key]);return result;},cloneArray:function(array){var result=[];for(var i=0;i<array.length;i++)
result.push(array[i].clone());return result;}});Model.include({model:true,newRecord:true,init:function(atts){if(atts)this.load(atts);this.trigger("init",this);},isNew:function(){return this.newRecord;},isValid:function(){return(!this.validate());},validate:function(){},load:function(atts){for(var name in atts)
this[name]=atts[name];},attributes:function(){var result={};for(var i=0;i<this.parent.attributes.length;i++){var attr=this.parent.attributes[i];result[attr]=this[attr];}
result.id=this.id;return result;},eql:function(rec){return(rec&&rec.id===this.id&&rec.parent===this.parent);},save:function(){var error=this.validate();if(error){this.trigger("error",this,error);return false;}
this.trigger("beforeSave",this);this.newRecord?this.create():this.update();this.trigger("save",this);return this;},updateAttribute:function(name,value){this[name]=value;return this.save();},updateAttributes:function(atts){this.load(atts);return this.save();},destroy:function(){this.trigger("beforeDestroy",this);delete this.parent.records[this.id];this.destroyed=true;this.trigger("destroy",this);this.trigger("change",this,"destroy");},dup:function(){var result=this.parent.init(this.attributes());result.newRecord=this.newRecord;return result;},clone:function(){return Object.create(this);},reload:function(){if(this.newRecord)return this;var original=this.parent.find(this.id);this.load(original.attributes());return original;},toJSON:function(){return(this.attributes());},exists:function(){return(this.id&&this.id in this.parent.records);},update:function(){this.trigger("beforeUpdate",this);var records=this.parent.records;records[this.id].load(this.attributes());var clone=records[this.id].clone();this.trigger("update",clone);this.trigger("change",clone,"update");},create:function(){this.trigger("beforeCreate",this);if(!this.id)this.id=Spine.guid();this.newRecord=false;var records=this.parent.records;records[this.id]=this.dup();var clone=records[this.id].clone();this.trigger("create",clone);this.trigger("change",clone,"create");},bind:function(events,callback){return this.parent.bind(events,this.proxy(function(record){if(record&&this.eql(record))
callback.apply(this,arguments);}));},trigger:function(){return this.parent.trigger.apply(this.parent,arguments);}});var eventSplitter=/^(\w+)\s*(.*)$/;var Controller=Spine.Controller=Class.create({tag:"div",initialize:function(options){this.options=options;for(var key in this.options)
this[key]=this.options[key];if(!this.el)this.el=document.createElement(this.tag);this.el=$(this.el);if(!this.events)this.events=this.parent.events;if(!this.elements)this.elements=this.parent.elements;if(this.events)this.delegateEvents();if(this.elements)this.refreshElements();if(this.proxied)this.proxyAll.apply(this,this.proxied);},$:function(selector){return $(selector,this.el);},delegateEvents:function(){for(var key in this.events){var methodName=this.events[key];var method=this.proxy(this[methodName]);var match=key.match(eventSplitter);var eventName=match[1],selector=match[2];if(selector===''){this.el.bind(eventName,method);}else{this.el.delegate(selector,eventName,method);}}},refreshElements:function(){for(var key in this.elements){this[this.elements[key]]=this.$(key);}},delay:function(func,timeout){setTimeout(this.proxy(func),timeout||0);}});Controller.include(Events);Controller.include(Log);Spine.App=Class.create();Spine.App.extend(Events);Controller.fn.App=Spine.App;})();(function(Spine,$){var Model=Spine.Model;var Ajax=Spine.Ajax={getUrl:function(object){if(!(object&&object.url))return null;return((typeof object.url=="function")?object.url():object.url);},methodMap:{"create":"POST","update":"PUT","destroy":"DELETE","read":"GET"},send:function(record,method,params){params=$.extend(params||{},{type:this.methodMap[method],contentType:"application/json",dataType:"json",data:{}});if(method=="create"&&record.model)
params.url=this.getUrl(record.parent);else
params.url=this.getUrl(record);if(!params.url)throw("Invalid URL");if(method=="create"||method=="update"){var data={};if(Model.ajaxPrefix){data={};data[Model.ajaxPrefix]=record;}else{data=record;}
data=$.extend(data,params.data);params.data=JSON.stringify(data);params.processData=false;params.success=function(data,status,xhr){if(!data)return;if(JSON.stringify(record)==JSON.stringify(data))return;if(data.id&&record.id!=data.id){var records=record.parent.records;records[data.id]=records[record.id];delete records[record.id];record.id=data.id;}
Ajax.noSync(function(){record.updateAttributes(data);});record.trigger("ajaxSuccess",record,status,xhr);};}
if(method=="read"&&!params.success)
params.success=function(data){(record.refresh||record.load).call(record,data);};var success=params.success;params.success=$.proxy(function(){if(success)success.apply(this,arguments);this.sendNext();},this);params.error=function(xhr,s,e){record.trigger("ajaxError",record,xhr,s,e);};$.ajax(params);},enabled:true,pending:false,requests:[],noSync:function(callback){this.enabled=false;callback()
this.enabled=true;},sendNext:function(){var next=this.requests.shift();if(next){this.send.apply(this,next);}else{this.pending=false;}},ajaxSync:function(){if(!this.enabled)return;if(this.pending){this.requests.push(arguments);}else{this.pending=true;this.send.apply(this,arguments);}}};Model.Ajax={extended:function(){this.sync(function(){Ajax.ajaxSync.apply(Ajax,arguments);});this.fetch(this.proxy(function(params){Ajax.ajaxSync(this,"read",params);}));}};Model.extend({ajaxPrefix:false,url:function(){return"/"+this.name.toLowerCase()+"s"}});Model.include({url:function(){var base=Ajax.getUrl(this.parent);base+=(base.charAt(base.length-1)=="/"?"":"/");base+=encodeURIComponent(this.id);return base;}});})(Spine,Spine.$);(function(Spine,$){var Route=Spine.Route=Spine.Class.create();var hashStrip=/^#*/;Route.extend({routes:[],historySupport:("history"in window),history:false,add:function(path,callback){if(typeof path=="object")
for(var p in path)this.add(p,path[p]);else
this.routes.push(this.init(path,callback));},setup:function(options){if(options&&options.history)
this.history=this.historySupport&&options.history;if(this.history)
$(window).bind("popstate",this.change);else
$(window).bind("hashchange",this.change);this.change();},unbind:function(){if(this.history)
$(window).unbind("popstate",this.change);else
$(window).unbind("hashchange",this.change);},navigate:function(){var args=Spine.makeArray(arguments);var triggerRoutes=true;if(typeof args[args.length-1]=="boolean"){triggerRoutes=args.pop();}
var path=args.join("/");if(this.path==path)return;if(!triggerRoutes)
this.path=path;if(this.history)
history.pushState({},document.title,this.getHost()+path);else
window.location.hash=path;},getPath:function(){return window.location.pathname;},getHash:function(){return window.location.hash;},getHost:function(){return((document.location+"").replace(this.getPath()+this.getHash(),""));},getFragment:function(){return this.getHash().replace(hashStrip,"");},change:function(e){var path=(this.history?this.getPath():this.getFragment());if(path==this.path)return;this.path=path;for(var i=0;i<this.routes.length;i++)
if(this.routes[i].match(path))return;}});Route.proxyAll("change");var namedParam=/:([\w\d]+)/g;var splatParam=/\*([\w\d]+)/g;var escapeRegExp=/[-[\]{}()+?.,\\^$|#\s]/g;Route.include({init:function(path,callback){this.callback=callback;if(typeof path=="string"){path=path.replace(escapeRegExp,"\\$&").replace(namedParam,"([^\/]*)").replace(splatParam,"(.*?)");this.route=new RegExp('^'+path+'$');}else{this.route=path;}},match:function(path){var match=this.route.exec(path)
if(!match)return false;var params=match.slice(1);this.callback.apply(this.callback,params);return true;}});Spine.Controller.fn.route=function(path,callback){Spine.Route.add(path,this.proxy(callback));};Spine.Controller.fn.routes=function(routes){for(var path in routes)
this.route(path,routes[path]);};Spine.Controller.fn.navigate=function(){Spine.Route.navigate.apply(Spine.Route,arguments);};})(Spine,Spine.$);(function(){$(function(){$('a.follow').click(function(){var href,id,inc,link;link=$(this);href=link.attr('href');id=link.attr('data-id');inc=function(num){var el;el=$("[data-follow-id="+id+"]");return el.html(parseInt(el.html())+num);};$.post(href,{},function(){link.hide();if(link.attr('data-follow')!=null){link.parent().find('[data-unfollow]').show();return inc(1);}else{link.parent().find('[data-follow]').show();return inc(-1);}});return false;});return $('a.fave').click(function(){var getVoteBox,href,id,link,parent,votes;getVoteBox=function(id){var votes;votes=_.filter($('span.votes'),function(item){return $(item).attr('data-votes')===id;});return $(votes[0]);};link=$(this);href=link.attr('href');id=link.attr('data-object-id');votes=getVoteBox(id);parent=link.parent();$.post(href,{},function(){if(parent.hasClass('active')){parent.removeClass('active');return votes.html(parseInt(votes.html())-1);}else{parent.addClass('active');return votes.html(parseInt(votes.html())+1);}});return false;});});}).call(this);!function($){var transitionEnd
$(document).ready(function(){$.support.transition=(function(){var thisBody=document.body||document.documentElement,thisStyle=thisBody.style,support=thisStyle.transition!==undefined||thisStyle.WebkitTransition!==undefined||thisStyle.MozTransition!==undefined||thisStyle.MsTransition!==undefined||thisStyle.OTransition!==undefined
return support})()
if($.support.transition){transitionEnd="TransitionEnd"
if($.browser.webkit){transitionEnd="webkitTransitionEnd"}else if($.browser.mozilla){transitionEnd="transitionend"}else if($.browser.opera){transitionEnd="oTransitionEnd"}}})
var Twipsy=function(element,options){this.$element=$(element)
this.options=options
this.enabled=true
this.fixTitle()}
Twipsy.prototype={show:function(){var pos,actualWidth,actualHeight,placement,$tip,tp
if(this.getTitle()&&this.enabled){$tip=this.tip()
this.setContent()
if(this.options.animate){$tip.addClass('fade')}
$tip.remove().css({top:0,left:0,display:'block'}).prependTo(document.body)
pos=$.extend({},this.$element.offset(),{width:this.$element[0].offsetWidth,height:this.$element[0].offsetHeight})
actualWidth=$tip[0].offsetWidth
actualHeight=$tip[0].offsetHeight
placement=_.maybeCall(this.options.placement,this.$element[0])
switch(placement){case'below':tp={top:pos.top+pos.height+this.options.offset,left:pos.left+pos.width/2-actualWidth/2}
break
case'above':tp={top:pos.top-actualHeight-this.options.offset,left:pos.left+pos.width/2-actualWidth/2}
break
case'left':tp={top:pos.top+pos.height/2-actualHeight/2,left:pos.left-actualWidth-this.options.offset}
break
case'right':tp={top:pos.top+pos.height/2-actualHeight/2,left:pos.left+pos.width+this.options.offset}
break}
$tip.css(tp).addClass(placement).addClass('in')}},setContent:function(){var $tip=this.tip()
$tip.find('.twipsy-inner')[this.options.html?'html':'text'](this.getTitle())
$tip[0].className='twipsy'},hide:function(){var that=this,$tip=this.tip()
$tip.removeClass('in')
function removeElement(){$tip.remove()}
$.support.transition&&this.$tip.hasClass('fade')?$tip.bind(transitionEnd,removeElement):removeElement()},fixTitle:function(){var $e=this.$element
if($e.attr('title')||typeof($e.attr('data-original-title'))!='string'){$e.attr('data-original-title',$e.attr('title')||'').removeAttr('title')}},getTitle:function(){var title,$e=this.$element,o=this.options
this.fixTitle()
if(typeof o.title=='string'){title=$e.attr(o.title=='title'?'data-original-title':o.title)}else if(typeof o.title=='function'){title=o.title.call($e[0])}
title=(''+title).replace(/(^\s*|\s*$)/,"")
return title||o.fallback},tip:function(){if(!this.$tip){this.$tip=$('<div class="twipsy" />').html('<div class="twipsy-arrow"></div><div class="twipsy-inner"></div>')}
return this.$tip},validate:function(){if(!this.$element[0].parentNode){this.hide()
this.$element=null
this.options=null}},enable:function(){this.enabled=true},disable:function(){this.enabled=false},toggleEnabled:function(){this.enabled=!this.enabled}}
var _={maybeCall:function(thing,ctx){return(typeof thing=='function')?(thing.call(ctx)):thing}}
$.fn.twipsy=function(options){$.fn.twipsy.initWith.call(this,options,Twipsy,'twipsy')
return this}
$.fn.twipsy.initWith=function(options,Constructor,name){var twipsy,binder,eventIn,eventOut
if(options===true){return this.data(name)}else if(typeof options=='string'){twipsy=this.data(name)
if(twipsy){twipsy[options]()}
return this}
options=$.extend({},$.fn[name].defaults,options)
function get(ele){var twipsy=$.data(ele,name)
if(!twipsy){twipsy=new Constructor(ele,$.fn.twipsy.elementOptions(ele,options))
$.data(ele,name,twipsy)}
return twipsy}
function enter(){var twipsy=get(this)
twipsy.hoverState='in'
if(options.delayIn==0){twipsy.show()}else{twipsy.fixTitle()
setTimeout(function(){if(twipsy.hoverState=='in'){twipsy.show()}},options.delayIn)}}
function leave(){var twipsy=get(this)
twipsy.hoverState='out'
if(options.delayOut==0){twipsy.hide()}else{setTimeout(function(){if(twipsy.hoverState=='out'){twipsy.hide()}},options.delayOut)}}
if(!options.live){this.each(function(){get(this)})}
if(options.trigger!='manual'){binder=options.live?'live':'bind'
eventIn=options.trigger=='hover'?'mouseenter':'focus'
eventOut=options.trigger=='hover'?'mouseleave':'blur'
this[binder](eventIn,enter)[binder](eventOut,leave)}
return this}
$.fn.twipsy.Twipsy=Twipsy
$.fn.twipsy.defaults={animate:true,delayIn:0,delayOut:0,fallback:'',placement:'above',html:false,live:false,offset:0,title:'title',trigger:'hover'}
$.fn.twipsy.elementOptions=function(ele,options){return $.metadata?$.extend({},options,$(ele).metadata()):options}}(window.jQuery||window.ender)
var _gaq=_gaq||[];_gaq.push(['_setAccount','UA-19471806-1']);_gaq.push(['_trackPageview']);(function(){var ga=document.createElement('script');ga.type='text/javascript';ga.async=true;ga.src=('https:'==document.location.protocol?'https://ssl':'http://www')+'.google-analytics.com/ga.js';var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(ga,s);})();
